소스 검색

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

Heinrich Blatt 7 달 전
부모
커밋
92cd570cc5
1개의 변경된 파일9개의 추가작업 그리고 7개의 파일을 삭제
  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);