Skip to content

Commit

Permalink
Fixed name conflicts for CAN messages in DashboardInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
walkermburns committed Feb 6, 2024
1 parent ae98ef2 commit 37ba9e4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lib/interfaces/include/DashboardInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct DashComponentInterface_s
bool buzzer_cmd;
//making it an array of ints to support enumerated LEDs as well as
//gradient/value based LEDs
LEDColors_e LED[12];
uint8_t LED[12];
};


Expand Down
41 changes: 21 additions & 20 deletions lib/interfaces/src/DashboardInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ void DashboardInterface::read(const CAN_message_t &can_msg)
_data.ssok = msg.ssok_above_threshold;
_data.shutdown = msg.shutdown_h_above_threshold;

// _data.button.start = msg.start_btn;
// _data.button.mark = msg.mark_btn;
// _data.button.mode = msg.mode_btn;
// _data.button.mc_cycle = msg.mc_cycle_btn;
// _data.button.launch_ctrl = msg.launch_ctrl_btn;
// _data.button.torque_mode = msg.torque_mode_btn;
// _data.button.led_dimmer = msg.led_dimmer_btn;
_data.button.start = msg.start_button;
_data.button.mark = msg.mark_button;
_data.button.mode = msg.mode_button;
_data.button.mc_cycle = msg.motor_controller_cycle_button;
_data.button.launch_ctrl = msg.launch_ctrl_button;
_data.button.torque_mode = msg.torque_mode_button;
_data.button.led_dimmer = msg.led_dimmer_button;

_data.buzzer_state = msg.drive_buzzer;

Expand All @@ -30,19 +30,20 @@ void DashboardInterface::write()
msg.drive_buzzer = _data.buzzer_cmd;

// TODO: use logic as to not write data for LEDs that have not changed
// msg.bots_led = _data.LED[DashLED_e::BOTS_LED];
// msg.launch_control_led = _data.LED[DashLED_e::LAUNCH_CONTROL_LED];
// msg.mode_led = _data.LED[DashLED_e::MODE_LED];
// msg.mech_brake_led = _data.LED[DashLED_e::MECH_BRAKE_LED];
// msg.cockpit_brb_led = _data.LED[DashLED_e::COCKPIT_BRB_LED];
// msg.inertia_led = _data.LED[DashLED_e::INERTIA_LED];
// msg.glv_led = _data.LED[DashLED_e::GLV_LED];
// msg.crit_charge_led = _data.LED[DashLED_e::CRIT_CHARGE_LED];
// msg.start_led = _data.LED[DashLED_e::START_LED];
// msg.mc_error_led = _data.LED[DashLED_e::MC_ERROR_LED];
// msg.imd_led = _data.LED[DashLED_e::IMD_LED];
// msg.ams_led = _data.LED[DashLED_e::AMS_LED];

msg.bots_led = _data.LED[DashLED_e::BOTS_LED];
msg.launch_control_led = _data.LED[DashLED_e::LAUNCH_CONTROL_LED];
msg.mode_led = _data.LED[DashLED_e::MODE_LED];
msg.mechanical_brake_led = _data.LED[DashLED_e::MECH_BRAKE_LED];
msg.cockpit_brb_led = _data.LED[DashLED_e::COCKPIT_BRB_LED];
msg.inertia_status_led = _data.LED[DashLED_e::INERTIA_LED];
msg.start_status_led = _data.LED[DashLED_e::START_LED];
msg.motor_controller_error_led = _data.LED[DashLED_e::MC_ERROR_LED];
msg.imd_led = _data.LED[DashLED_e::IMD_LED];
msg.ams_led = _data.LED[DashLED_e::AMS_LED];

msg.glv_led = _data.LED[DashLED_e::GLV_LED];
msg.pack_charge_led = _data.LED[DashLED_e::CRIT_CHARGE_LED];

CAN_message_t can_msg;
can_msg.id = Pack_DASHBOARD_MCU_STATE_hytech(&msg, can_msg.buf, &can_msg.len, NULL);

Expand Down

0 comments on commit 37ba9e4

Please sign in to comment.