Add dummy SoC, replace ID
This commit is contained in:
@@ -39,6 +39,8 @@ static volatile CAN_MSG_t can2_tx_buf = {0,}; // Buf for 1 TX packet
|
||||
extern modPowerElectronicsPackStateTypedef packState;
|
||||
extern modConfigGeneralConfigStructTypedef *generalConfig;
|
||||
|
||||
static volatile bool dummy_soc = 0;
|
||||
|
||||
static volatile bool threshold_request = 0;
|
||||
static volatile bool active_request = 0;
|
||||
|
||||
@@ -47,6 +49,18 @@ void can_msgr_init() {
|
||||
RingBuf_Init((void *) &can2_transmit_q_msg, 10, sizeof(CAN_MSG_t), (RINGBUF_t *) &can2_ring);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Make SoC for charging = 100%
|
||||
*/
|
||||
void can_set_dummy_soc(void){
|
||||
dummy_soc = 1;
|
||||
}
|
||||
|
||||
|
||||
bool get_dummy_soc(void){
|
||||
return dummy_soc;
|
||||
}
|
||||
|
||||
void transmitCan1Packet() {
|
||||
if ((TIM_Clock - can1_transmit_clock) < 1000) {
|
||||
return;
|
||||
@@ -178,7 +192,7 @@ int getIndexByTemperature() {
|
||||
|
||||
u16_t get_table_current() {
|
||||
// sending table current and end-of-charge current command
|
||||
const int socIndex = getIndexBySoc();
|
||||
const int socIndex = dummy_soc ? 10 : getIndexBySoc();
|
||||
const int temperatureIndex = getIndexByTemperature();
|
||||
float tableCurrent = 0;
|
||||
if (socIndex != -1 && temperatureIndex != -1) {
|
||||
|
||||
Reference in New Issue
Block a user