|
|
@@ -107,12 +107,9 @@ void pi_i2c_mcu(){
|
|
|
while(rx_index < (sizeof(BatteryLimitMsg))){
|
|
|
if(!DL_I2C_isTargetRXFIFOEmpty(I2C_0_INST)){
|
|
|
rxPacket.rxBuffer[rx_index]= DL_I2C_receiveTargetData(I2C_0_INST);
|
|
|
- //rxPacket.rxBuffer[rx_index] = DL_I2C_receiveTargetData(I2C_0_INST);
|
|
|
- //printf("Received Bytes[%d]: 0x%02X\n", rx_index, rx_packet.rxBuffer[rx_index]);
|
|
|
rx_index++;
|
|
|
}
|
|
|
}
|
|
|
- //printf("index:%d\n", rx_index);
|
|
|
//Check if all the data is received then store the battery limits in BatteryInfo struct:
|
|
|
if(rx_index== (sizeof(BatteryLimitMsg))){
|
|
|
BatteryLimitMsg battery_limit_received;
|
|
|
@@ -128,12 +125,6 @@ void pi_i2c_mcu(){
|
|
|
battery->cycle_number = battery_limit_received.previous_cycle_number;
|
|
|
battery->batteryLimitReceived= true;
|
|
|
}
|
|
|
- /*if(battery_limit_received.previous_cycle_number > MAX_CYCLES){
|
|
|
- DL_I2C_fillTargetTXFIFO(I2C_0_INST, (uint8_t *)statusResponse[1], 1);
|
|
|
- }else{
|
|
|
- DL_I2C_fillTargetTXFIFO(I2C_0_INST, (uint8_t *)statusResponse[0], 1);
|
|
|
- }
|
|
|
- DL_I2C_flushTargetTXFIFO(I2C_0_INST);*/
|
|
|
}
|
|
|
rx_index= 0;
|
|
|
DL_I2C_flushTargetRXFIFO(I2C_0_INST);
|