From b206565e60f6caac276a01394a05999f27be71eb Mon Sep 17 00:00:00 2001 From: gmazzucchi Date: Thu, 15 Aug 2024 22:46:29 +0200 Subject: [PATCH] FSG 2024 --- .vscode/settings.json | 2 +- Core/Lib/lvgl-stm32/lvgl | 2 +- Core/UI/steering/controls.c | 7 ++++++- Core/UI/steering/graphics_manager.c | 3 --- Core/UI/steering/messages.h | 2 +- Core/UI/steering/racing_tabs/tab_sensors.c | 7 ++----- Core/UI/steering/steering_config.h | 2 +- Core/UI/steering/tab_manager.c | 2 ++ 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 3a2eae0a..7a1514bb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "cortex-debug.armToolchainPath": "/home/gmazzucchi/.config/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/arm-none-eabi-gcc/13.2.1-1.1.1/.content/bin", - "cortex-debug.openocdPath": "/home/gmazzucchi/.config/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/openocd/0.12.0-2.1/.content/bin/openocd", + "cortex-debug.openocdPath": "/home/gmazzucchi/.config/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/openocd/0.12.0-4.1/.content/bin/openocd", "files.associations": { "gpio.h": "c", "main.h": "c", diff --git a/Core/Lib/lvgl-stm32/lvgl b/Core/Lib/lvgl-stm32/lvgl index c99a5f5a..97497f03 160000 --- a/Core/Lib/lvgl-stm32/lvgl +++ b/Core/Lib/lvgl-stm32/lvgl @@ -1 +1 @@ -Subproject commit c99a5f5ae0dd0a69052f92e1484651c6b56aa006 +Subproject commit 97497f0327db0667d54f2b4d3945887ec81bbf84 diff --git a/Core/UI/steering/controls.c b/Core/UI/steering/controls.c index c71c876b..0ae572d2 100644 --- a/Core/UI/steering/controls.c +++ b/Core/UI/steering/controls.c @@ -52,7 +52,12 @@ void turn_telemetry_on_off(void) { display_notification("Sending\nTelemetry\nON", 800, COLOR_GREEN_STATUS_HEX, COLOR_PRIMARY_HEX); converted.status = primary_tlm_set_status_status_on; } - STEER_CAN_PACK(primary, PRIMARY, tlm_set_status, TLM_SET_STATUS); + can_message_t msg = {0}; + msg.id = 0x431; // PRIMARY_TLM_SET_STATUS_FRAME_ID; + msg.size = PRIMARY_TLM_SET_STATUS_BYTE_SIZE; + primary_tlm_set_status_t raw = {0}; + primary_tlm_set_status_conversion_to_raw_struct(&raw, &converted); + primary_tlm_set_status_pack(msg.data, &raw, PRIMARY_TLM_SET_STATUS_BYTE_SIZE); can_send(&msg, true); } diff --git a/Core/UI/steering/graphics_manager.c b/Core/UI/steering/graphics_manager.c index 96f6cb85..fca044d0 100644 --- a/Core/UI/steering/graphics_manager.c +++ b/Core/UI/steering/graphics_manager.c @@ -57,7 +57,6 @@ void update_graphics(lv_timer_t *t) { if (is_pmsg_new[iindex]) { is_pmsg_new[iindex] = false; can_id_t id = primary_id_from_index(iindex); - //bool valid = (bool) t->user_data; switch (id) { case PRIMARY_ECU_STATUS_FRAME_ID: { car_status_update(is_pmsg_valid[iindex]); @@ -207,7 +206,6 @@ void update_graphics(lv_timer_t *t) { if (is_imsg_new[iindex]) { is_imsg_new[iindex] = false; can_id_t id = inverters_id_from_index(iindex); - //bool valid = (bool) t->user_data; switch (id) { case INVERTERS_INV_L_RCV_FRAME_ID: inv_l_rcv_update(is_imsg_valid[iindex]); @@ -225,7 +223,6 @@ void update_graphics(lv_timer_t *t) { if (is_smsg_new[iindex]) { is_smsg_new[iindex] = false; can_id_t id = secondary_id_from_index(iindex); - //bool valid = (bool) t->user_data; switch (id) { case SECONDARY_FRONT_ANGULAR_VELOCITY_FRAME_ID: { angular_velocity_update(is_smsg_valid[iindex]); //TODO funzione vuota diff --git a/Core/UI/steering/messages.h b/Core/UI/steering/messages.h index fa336731..71df3b3c 100644 --- a/Core/UI/steering/messages.h +++ b/Core/UI/steering/messages.h @@ -33,7 +33,7 @@ msg.size = NTW##_##MSG_NAME##_BYTE_SIZE; \ ntw##_##msg_name##_t raw = {0}; \ ntw##_##msg_name##_conversion_to_raw_struct(&raw, &converted); \ - ntw##_##msg_name##_pack(msg.data, &raw, PRIMARY_##MSG_NAME##_BYTE_SIZE); + ntw##_##msg_name##_pack(msg.data, &raw, NTW##_##MSG_NAME##_BYTE_SIZE); typedef uint16_t can_id_t; diff --git a/Core/UI/steering/racing_tabs/tab_sensors.c b/Core/UI/steering/racing_tabs/tab_sensors.c index 069bab24..c5644632 100644 --- a/Core/UI/steering/racing_tabs/tab_sensors.c +++ b/Core/UI/steering/racing_tabs/tab_sensors.c @@ -37,22 +37,19 @@ void set_tab_sensors_label_text(const char *s, tab_sensors_labels_enum idx) { void set_tab_sensors_value_brake_f(float value_in_bar) { CHECK_CURRENT_TAB(engineer_mode, racing, STEERING_WHEEL_TAB_SENSORS); - // assuming that maximum 15 bars are reached - lv_bar_set_value(brake_front_bar, (int32_t)(value_in_bar * 6.66f), LV_ANIM_OFF); + lv_bar_set_value(brake_front_bar, (int32_t)(value_in_bar), LV_ANIM_OFF); } void set_tab_sensors_value_brake_r(float value_in_bar) { CHECK_CURRENT_TAB(engineer_mode, racing, STEERING_WHEEL_TAB_SENSORS); - // assuming that maximum 15 bars are reached - lv_bar_set_value(break_rear_bar, (int32_t)(value_in_bar * 6.66f), LV_ANIM_OFF); + lv_bar_set_value(break_rear_bar, (int32_t)(value_in_bar), LV_ANIM_OFF); } void set_tab_sensors_value_apps(int32_t value_0_to_100) { CHECK_CURRENT_TAB(engineer_mode, racing, STEERING_WHEEL_TAB_SENSORS); lv_bar_set_value(throttle_bar1, (int32_t)value_0_to_100, LV_ANIM_OFF); - // lv_bar_set_value(throttle_bar2, (int32_t) value_0_to_100, LV_ANIM_OFF); } lv_style_t throttle_bar_style; diff --git a/Core/UI/steering/steering_config.h b/Core/UI/steering/steering_config.h index 6e37b92d..d3c7a544 100644 --- a/Core/UI/steering/steering_config.h +++ b/Core/UI/steering/steering_config.h @@ -30,7 +30,7 @@ */ #define CANSNIFFER_ENABLED 1 #define CAN_LOG_ENABLED 0 -#define WATCHDOG_ENABLED 1 +#define WATCHDOG_ENABLED 0 #define CAN_OVER_SERIAL_ENABLED 0 #define MCP23017_IT_ENABLED 0 diff --git a/Core/UI/steering/tab_manager.c b/Core/UI/steering/tab_manager.c index b51fd1a7..05252d96 100644 --- a/Core/UI/steering/tab_manager.c +++ b/Core/UI/steering/tab_manager.c @@ -300,7 +300,9 @@ bool is_on_help_animation(void) { return help_animation; } +#if PRECHARGE_BAR_ENABLED == 1 static bool on_precharge_bar_popup = false; +#endif void precharge_bar_popup_show() { #if PRECHARGE_BAR_ENABLED == 1