|
@@ -105,18 +105,20 @@ int main(void)
|
|
|
NVIC_EnableIRQ(I2C_target_INST_INT_IRQN);
|
|
NVIC_EnableIRQ(I2C_target_INST_INT_IRQN);
|
|
|
|
|
|
|
|
initialize_target_address();
|
|
initialize_target_address();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
while (1) {
|
|
while (1) {
|
|
|
|
|
|
|
|
- if(mcu_CommandPending){
|
|
|
|
|
|
|
+ for(uint8_t slot= 0; slot< NUM_SLOTS; slot++){
|
|
|
|
|
+
|
|
|
|
|
+ if(mcu_CommandPending){
|
|
|
#ifdef DEBUG_TARGET
|
|
#ifdef DEBUG_TARGET
|
|
|
- printf("Calling MCU target action\n");
|
|
|
|
|
|
|
+ printf("Calling MCU target action\n");
|
|
|
#endif
|
|
#endif
|
|
|
- mcu_i2c_handle(I2C_target_INST);
|
|
|
|
|
- mcu_CommandPending = false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ mcu_i2c_handle(I2C_target_INST);
|
|
|
|
|
+ mcu_CommandPending = false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
- for(uint8_t slot= 0; slot< NUM_SLOTS; slot++){
|
|
|
|
|
|
|
|
|
|
// step 1: update the voltage readings
|
|
// step 1: update the voltage readings
|
|
|
battery_slotmgr.read_state(slot);
|
|
battery_slotmgr.read_state(slot);
|