Add LV SoC field
This commit is contained in:
@ -133,7 +133,8 @@ typedef struct {
|
||||
|
||||
float min_cell_volt;
|
||||
float max_cell_temp;
|
||||
int soc;
|
||||
int soc_ts;
|
||||
int soc_lv;
|
||||
|
||||
float ts_current;
|
||||
float ts_voltage_bat;
|
||||
|
||||
@ -85,7 +85,7 @@ void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data) {
|
||||
case CAN_ID_AMS_STATUS:
|
||||
vehicle_state.ts_state = data[0] & 0x7F;
|
||||
vehicle_state.sdc_closed = (data[0] & 0x80) >> 7;
|
||||
vehicle_state.soc = data[1];
|
||||
vehicle_state.soc_ts = data[1];
|
||||
ptr = &data[2];
|
||||
vehicle_state.min_cell_volt =
|
||||
ftcan_unmarshal_unsigned(&ptr, 2) * CAN_AMS_STATUS_VOLTAGE_FACTOR;
|
||||
@ -123,6 +123,7 @@ void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data) {
|
||||
case CAN_ID_ABX_MISC:
|
||||
vehicle_state.distance_total =
|
||||
(data[3] | (data[4] << 8)) * CAN_ABX_MISC_DISTANCE_TOTAL_FACTOR;
|
||||
vehicle_state.soc_lv = data[5];
|
||||
break;
|
||||
case CAN_ID_AS_MISSION_FB:
|
||||
vehicle_state.active_mission = data[0] & 0b111;
|
||||
|
||||
Reference in New Issue
Block a user