Prechádzať zdrojové kódy

Verbesserung: Die Response zum externen I2C kann auch zwischen den slots measurement/control funktionen getriggert werden

Heinrich Blatt 7 mesiacov pred
rodič
commit
92cd570cc5
1 zmenil súbory, kde vykonal 9 pridanie a 7 odobranie
  1. 9 7
      main_target.c

+ 9 - 7
main_target.c

@@ -105,18 +105,20 @@ int main(void)
     NVIC_EnableIRQ(I2C_target_INST_INT_IRQN);
 
     initialize_target_address();
-    
+
     while (1) {
 
-        if(mcu_CommandPending){
+        for(uint8_t slot= 0; slot< NUM_SLOTS; slot++){
+
+            if(mcu_CommandPending){
 #ifdef DEBUG_TARGET
-            printf("Calling MCU target action\n");
+                printf("Calling MCU target action\n");
 #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
             battery_slotmgr.read_state(slot);