Basic SoC estimation
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
|
||||
#include "can-halal.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void can_init(CAN_HandleTypeDef *handle) {
|
||||
@ -22,7 +23,7 @@ void can_init(CAN_HandleTypeDef *handle) {
|
||||
HAL_StatusTypeDef can_send_status() {
|
||||
uint8_t data[6];
|
||||
data[0] = ts_state.current_state | (sdc_closed << 7);
|
||||
data[1] = current_soc;
|
||||
data[1] = roundf(current_soc);
|
||||
ftcan_marshal_unsigned(&data[2], min_voltage, 2);
|
||||
ftcan_marshal_signed(&data[4], max_temp, 2);
|
||||
return ftcan_transmit(CAN_ID_AMS_STATUS, data, sizeof(data));
|
||||
|
||||
Reference in New Issue
Block a user