Skip to content

Commit dff1094

Browse files
committed
fix battery temperature data typing bug
1 parent aeeb5d6 commit dff1094

File tree

1 file changed

+8
-8
lines changed
  • src/f0/app_battery/source

1 file changed

+8
-8
lines changed

src/f0/app_battery/source/batt.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,10 @@ void populate_od_pack_data(batt_pack_data_t *pack_data) {
511511
OD_RAM.x4000_pack_1.time_to_full = pack_data->time_to_full_seconds;
512512
OD_RAM.x4000_pack_1.cycles = pack_data->cycles;
513513
OD_RAM.x4000_pack_1.reported_state_of_charge = pack_data->reported_state_of_charge;
514-
OD_RAM.x4000_pack_1.temperature = pack_data->temp_1_C;
515-
OD_RAM.x4000_pack_1.temperature_avg = pack_data->avg_temp_1_C;
516-
OD_RAM.x4000_pack_1.temperature_min = pack_data->temp_min_C;
517-
OD_RAM.x4000_pack_1.temperature_max = pack_data->temp_max_C;
514+
OD_RAM.x4000_pack_1.temperature = (int8_t)(pack_data->temp_1_C);
515+
OD_RAM.x4000_pack_1.temperature_avg = (int8_t)(pack_data->avg_temp_1_C);
516+
OD_RAM.x4000_pack_1.temperature_min = (int8_t)(pack_data->temp_min_C);
517+
OD_RAM.x4000_pack_1.temperature_max = (int8_t)(pack_data->temp_max_C);
518518

519519
if (palReadLine(LINE_HEATER_ON_1)) {
520520
state_bitmask |= (1 << STATUS_BIT_HEATER);
@@ -552,10 +552,10 @@ void populate_od_pack_data(batt_pack_data_t *pack_data) {
552552
OD_RAM.x4001_pack_2.time_to_full = pack_data->time_to_full_seconds;
553553
OD_RAM.x4001_pack_2.cycles = pack_data->cycles;
554554
OD_RAM.x4001_pack_2.reported_state_of_charge = pack_data->reported_state_of_charge;
555-
OD_RAM.x4001_pack_2.temperature = pack_data->temp_1_C;
556-
OD_RAM.x4001_pack_2.temperature_avg = pack_data->avg_temp_1_C;
557-
OD_RAM.x4001_pack_2.temperature_min = pack_data->temp_min_C;
558-
OD_RAM.x4001_pack_2.temperature_max = pack_data->temp_max_C;
555+
OD_RAM.x4001_pack_2.temperature = (int8_t)(pack_data->temp_1_C);
556+
OD_RAM.x4001_pack_2.temperature_avg = (int8_t)(pack_data->avg_temp_1_C);
557+
OD_RAM.x4001_pack_2.temperature_min = (int8_t)(pack_data->temp_min_C);
558+
OD_RAM.x4001_pack_2.temperature_max = (int8_t)(pack_data->temp_max_C);
559559

560560
if (palReadLine(LINE_HEATER_ON_2)) {
561561
state_bitmask |= (1 << STATUS_BIT_HEATER);

0 commit comments

Comments
 (0)