Skip to content

Commit

Permalink
FSG 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzucchi committed Aug 15, 2024
1 parent b52b3e5 commit b206565
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion Core/Lib/lvgl-stm32/lvgl
Submodule lvgl updated from c99a5f to 97497f
7 changes: 6 additions & 1 deletion Core/UI/steering/controls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
3 changes: 0 additions & 3 deletions Core/UI/steering/graphics_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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]);
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Core/UI/steering/messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
7 changes: 2 additions & 5 deletions Core/UI/steering/racing_tabs/tab_sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Core/UI/steering/steering_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions Core/UI/steering/tab_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b206565

Please sign in to comment.