Send min voltage & max temp as 16 bit ints
This commit is contained in:
parent
3ac8e0e746
commit
f8b74a0aa3
|
@ -1 +1 @@
|
||||||
Subproject commit eb74553f896ed2739fc73cee13cbde9e19e1d66a
|
Subproject commit b2929ad66414b394805ee1d2b9c4778a2f9fe515
|
|
@ -20,12 +20,12 @@ void can_init(CAN_HandleTypeDef *handle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
HAL_StatusTypeDef can_send_status() {
|
HAL_StatusTypeDef can_send_status() {
|
||||||
uint8_t data[4];
|
uint8_t data[6];
|
||||||
data[0] = ts_state.current_state;
|
data[0] = ts_state.current_state;
|
||||||
data[1] = current_soc;
|
data[1] = current_soc;
|
||||||
data[2] = min_voltage >> 8;
|
ftcan_marshal_unsigned(&data[2], min_voltage, 2);
|
||||||
data[3] = max_temp >> 4;
|
ftcan_marshal_signed(&data[4], max_temp, 2);
|
||||||
return ftcan_transmit(CAN_ID_AMS_STATUS, data, 4);
|
return ftcan_transmit(CAN_ID_AMS_STATUS, data, sizeof(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data) {
|
void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data) {
|
||||||
|
|
Loading…
Reference in New Issue