Skip to content

Commit

Permalink
fix: increased delay to 5s
Browse files Browse the repository at this point in the history
  • Loading branch information
federico-carbone committed Aug 31, 2024
1 parent 9542c5e commit c309e90
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Core/Inc/conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/* ---------- Exported constants --------------------------------------------*/
#define VERSION_MAJOR 2
#define VERSION_MINOR 1
#define VERSION_PATCH 2
#define VERSION_PATCH 3

#define DEBUG_SERIAL
#define DEBUG_AIN
Expand Down
64 changes: 32 additions & 32 deletions Core/Src/can_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,38 +90,38 @@ void MCB_send_msg(uint32_t id) {
tx_header.DLC = mcb_bms_lv_lv_bat_general_pack(
buffer, &msg.lv_bat_general, 8U);
break;
// case MCB_BMS_LV_CELLS_STATUS_FRAME_ID:
// msg.cells_status.lv_cell_0_is_ov = error_get_overvoltage(0);
// msg.cells_status.lv_cell_1_is_ov = error_get_overvoltage(1);
// msg.cells_status.lv_cell_2_is_ov = error_get_overvoltage(2);
// msg.cells_status.lv_cell_3_is_ov = error_get_overvoltage(3);
// msg.cells_status.lv_cell_4_is_ov = error_get_overvoltage(4);
// msg.cells_status.lv_cell_5_is_ov = error_get_overvoltage(5);
// msg.cells_status.lv_cell_6_is_ov = error_get_overvoltage(6);

// msg.cells_status.lv_cell_0_is_uv = error_get_undervoltage(0);
// msg.cells_status.lv_cell_1_is_uv = error_get_undervoltage(1);
// msg.cells_status.lv_cell_2_is_uv = error_get_undervoltage(2);
// msg.cells_status.lv_cell_3_is_uv = error_get_undervoltage(3);
// msg.cells_status.lv_cell_4_is_uv = error_get_undervoltage(4);
// msg.cells_status.lv_cell_5_is_uv = error_get_undervoltage(5);
// msg.cells_status.lv_cell_6_is_uv = error_get_undervoltage(6);

// msg.cells_status.lv_cell_ntc_00_is_ot = error_get_overtemp(0);
// msg.cells_status.lv_cell_ntc_01_is_ot = error_get_overtemp(1);
// msg.cells_status.lv_cell_ntc_02_is_ot = error_get_overtemp(2);
// msg.cells_status.lv_cell_ntc_03_is_ot = error_get_overtemp(3);
// msg.cells_status.lv_cell_ntc_04_is_ot = error_get_overtemp(4);
// msg.cells_status.lv_cell_ntc_05_is_ot = error_get_overtemp(5);
// msg.cells_status.lv_cell_ntc_06_is_ot = error_get_overtemp(6);
// msg.cells_status.lv_cell_ntc_07_is_ot = error_get_overtemp(7);
// msg.cells_status.lv_cell_ntc_08_is_ot = error_get_overtemp(8);
// msg.cells_status.lv_cell_ntc_09_is_ot = error_get_overtemp(9);
// msg.cells_status.lv_cell_ntc_10_is_ot = error_get_overtemp(10);
// msg.cells_status.lv_cell_ntc_11_is_ot = error_get_overtemp(11);

// tx_header.DLC = mcb_bms_lv_cells_status_pack(buffer, &msg.cells_status, 8U);
// break;
case MCB_BMS_LV_CELLS_STATUS_FRAME_ID:
msg.cells_status.lv_cell_0_is_ov = error_get_overvoltage(0);
msg.cells_status.lv_cell_1_is_ov = error_get_overvoltage(1);
msg.cells_status.lv_cell_2_is_ov = error_get_overvoltage(2);
msg.cells_status.lv_cell_3_is_ov = error_get_overvoltage(3);
msg.cells_status.lv_cell_4_is_ov = error_get_overvoltage(4);
msg.cells_status.lv_cell_5_is_ov = error_get_overvoltage(5);
msg.cells_status.lv_cell_6_is_ov = error_get_overvoltage(6);

msg.cells_status.lv_cell_0_is_uv = error_get_undervoltage(0);
msg.cells_status.lv_cell_1_is_uv = error_get_undervoltage(1);
msg.cells_status.lv_cell_2_is_uv = error_get_undervoltage(2);
msg.cells_status.lv_cell_3_is_uv = error_get_undervoltage(3);
msg.cells_status.lv_cell_4_is_uv = error_get_undervoltage(4);
msg.cells_status.lv_cell_5_is_uv = error_get_undervoltage(5);
msg.cells_status.lv_cell_6_is_uv = error_get_undervoltage(6);

msg.cells_status.lv_cell_ntc_00_is_ot = error_get_overtemp(0);
msg.cells_status.lv_cell_ntc_01_is_ot = error_get_overtemp(1);
msg.cells_status.lv_cell_ntc_02_is_ot = error_get_overtemp(2);
msg.cells_status.lv_cell_ntc_03_is_ot = error_get_overtemp(3);
msg.cells_status.lv_cell_ntc_04_is_ot = error_get_overtemp(4);
msg.cells_status.lv_cell_ntc_05_is_ot = error_get_overtemp(5);
msg.cells_status.lv_cell_ntc_06_is_ot = error_get_overtemp(6);
msg.cells_status.lv_cell_ntc_07_is_ot = error_get_overtemp(7);
msg.cells_status.lv_cell_ntc_08_is_ot = error_get_overtemp(8);
msg.cells_status.lv_cell_ntc_09_is_ot = error_get_overtemp(9);
msg.cells_status.lv_cell_ntc_10_is_ot = error_get_overtemp(10);
msg.cells_status.lv_cell_ntc_11_is_ot = error_get_overtemp(11);

tx_header.DLC = mcb_bms_lv_cells_status_pack(buffer, &msg.cells_status, 8U);
break;
// case MCB_BMS_LV_STATUS_FRAME_ID:
// msg.status.lv_relay_is_closed = HAL_GPIO_ReadPin(LV_CMD_GPIO_OUT_GPIO_Port, LV_CMD_GPIO_OUT_Pin);
// msg.status.lv_relay_is_relay_override_on = ADB.LV_RLY_override_state != LV_RLY_override_OFF ? 1U : 0U ;
Expand Down
2 changes: 1 addition & 1 deletion Core/Src/data_reading_timebase.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ STMLIBS_StatusTypeDef data_reading_l9963e_cb(void) {
error_reset_undervoltage(i);
}

if(is_ntc_measure_required && HAL_GetTick() > 2000) {
if(is_ntc_measure_required && HAL_GetTick() > 5000) {
for(uint8_t i=0; i<NTC_INT_ADC_N; ++i) {
if(ntc_get_int_temp(i) > 80){
error_set_overtemp(i);
Expand Down

0 comments on commit c309e90

Please sign in to comment.