Show battery temperature
This commit is contained in:
@ -87,6 +87,8 @@ typedef struct {
|
||||
float inv_r;
|
||||
float mot_l;
|
||||
float mot_r;
|
||||
float bat_l;
|
||||
float bat_r;
|
||||
} Temperatures;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@ -92,6 +92,9 @@ void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data) {
|
||||
ftcan_unmarshal_unsigned(&ptr, 2) * CAN_AMS_STATUS_VOLTAGE_FACTOR;
|
||||
vehicle_state.max_cell_temp =
|
||||
ftcan_unmarshal_signed(&ptr, 2) * CAN_AMS_STATUS_TEMP_FACTOR;
|
||||
// TODO: Separate temperatures for left and right side of battery
|
||||
vehicle_state.temps.bat_l = vehicle_state.max_cell_temp;
|
||||
vehicle_state.temps.bat_r = vehicle_state.max_cell_temp;
|
||||
break;
|
||||
case CAN_ID_AMS_ERROR:
|
||||
vehicle_state.last_ams_error.kind = data[0];
|
||||
|
||||
Reference in New Issue
Block a user