a.binder 5 年 前
コミット
8b7337a122

+ 33 - 29
SE/stuff/P5_Automation_can-dev-res/P5_Automation_can-dev-res.ino

@@ -371,34 +371,38 @@ void loop() {
 
   
     #include "__main_loop_top.h"
-    Serial.print("#331_L1 main loop top   ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init  ");
-    Serial.println(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
-  
-      Serial.print("#331_L2 main loop top ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init=[");
-      
-      
-         Serial.println(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
-         Serial.print("   true[");  Serial.print(true); Serial.print("]   false[");  Serial.print(false);
-         Serial.println("] ");  
-  
-   Slave_Ports_Status__DISPLAY_TARGET(
-         Slave_Ports_Status_A ,
-         Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
-          0 ,
-           DISPLAY_A ,
-             DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-             DISPLAY_PHYSICAL_CHAR_A, 
-        DISPLAY_pos_seq_A_NEXT + DISPLAY_pos_seq_A_IMMEDIATE,
-        "336 PORTS:",
-        DISPLAY_TARGET_DISPLAY128,
-       millis(),
-        millis() + ARDUINO_time_seq_id_A_INCREMENT
-         //queue
-        ,Slave_Ports_Status_QUEUE_A,
-        TASK_TYPE_T__EMPTY__JUST_PASSED_ARG__,
-        TASK_PORT_ASSOC_EMPTY
-     );
-
+    
+    
+    if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A <= ARDUINO_LOOP_LATENCY_COUNTER_INIT ) {
+                
+                Serial.print("#331_L1 main loop top   ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init  ");
+                Serial.println(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
+              
+                  Serial.print("#331_L2 main loop top ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init=[");
+                  
+                  
+                     Serial.println(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
+                     Serial.print("   true[");  Serial.print(true); Serial.print("]   false[");  Serial.print(false);
+                     Serial.println("] ");  
+              
+               Slave_Ports_Status__DISPLAY_TARGET(
+                     Slave_Ports_Status_A ,
+                     Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
+                      0 ,
+                       DISPLAY_A ,
+                         DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
+                         DISPLAY_PHYSICAL_CHAR_A, 
+                    DISPLAY_pos_seq_A_NEXT + DISPLAY_pos_seq_A_IMMEDIATE,
+                    "336 PORTS:",
+                    DISPLAY_TARGET_DISPLAY128,
+                   millis(),
+                    millis() + ARDUINO_time_seq_id_A_INCREMENT
+                     //queue
+                    ,Slave_Ports_Status_QUEUE_A,
+                    TASK_TYPE_T__EMPTY__JUST_PASSED_ARG__,
+                    TASK_PORT_ASSOC_EMPTY
+                 );
+}
  // Serial.println(time);
       #include "_SlaveID_loop1.h" //todo PCINT
       #include "_ControllerID_loop1.h"  //todo make default
@@ -414,7 +418,7 @@ void loop() {
                     "123456789012345678901234567890" 
         );     */
         
-  delay(10000);
+  delay(10);
   
   
 }

+ 0 - 60
SE/stuff/P5_Automation_can-dev-res/_Port_I2C_driver_struct.h

@@ -4,63 +4,3 @@ typedef int I2C_driver_T ;
 const I2C_driver_T  EI2C_driver_NOT_USED_ = 0x00 ;
 const I2C_driver_T  I2C_driver_Adafruit_PWMServoDriver = 0x01 ;
 
-
-
-/*
-#include <Wire.h>
-#include <Adafruit_PWMServoDriver.h>
-
- // Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x40);
-  Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDr    iver();
-
-
-  #define SERVOMIN 100
-  #define SERVOMAX 2200
-
-  
-int servoNo = 0; // Defines a counter for servos.
-
-
-void setup() {
-  // put your setup code here, to run once:
- Serial.begin(9600);
-  Serial.println("16 channel PWM test!");
- 
-  pwm1.begin();
-//  pwm1.setPWMFreq(1600);  // This is the maximum PWM frequency
-  pwm1.setPWMFreq(50);  // This is the maximum PWM frequency
-
-}
-
-void loop() {
-  // put your main code here, to run repeatedly:
- 
-   Serial.println("pwm1.setPWM(0, 1024, 2000");
-  pwm1.setPWM(0, 1024, 3072);
-    delay(2500);
-    
-  
-  Serial.println("pwm1.setPWM(0, 2000, 3072");
-  pwm1.setPWM(0, 2000, 3072);
-  delay(2500);
-
-
- Serial.println("pwm1.setPWM(0, 3072, 2000");
-  pwm1.setPWM(0, 3072, 2000 );
-  delay(2500);
-
-
-  Serial.println("pwm1.setPWM(0, 1024, 3072");
-  pwm1.setPWM(0, 1024, 3072);
-  delay(2500);
-
-Serial.println("pwm1.setPWM(0, 4096, 0");
-   pwm1.setPWM(0, 4096, 0);
-  delay(2500);
-  
-   Serial.println("pwm1.setPWM(0, 0, 4096");
-   pwm1.setPWM(0, 0, 4096);
-  delay(2500);
-  
-}
-*/

+ 7 - 5
SE/stuff/P5_Automation_can-dev-res/_SlaveID_loop1.h

@@ -4,13 +4,14 @@ if(!digitalRead(CAN_INTpin))                    // If pin 2 is low, read receive
             Serial.print("# read ID: ");
             Serial.print(CANrxId, HEX);
             Serial.print(" Data: ");
-             #if defined(HAS_LCD1602)
+           /*  #if defined(HAS_LCD1602)
               lcd.setCursor(0,0); 
               lcd.print("ID: ");
               lcd.print(CANrxId, HEX);
               lcd.setCursor(0,1); 
               lcd.print(" Data: ");
              #endif
+             */
          /*     #if defined(HAS_TFT_ILI9163C)
              DISPLAY_DEV.setCursor(0,40); 
               DISPLAY_DEV.print("ID: ");
@@ -24,19 +25,20 @@ if(!digitalRead(CAN_INTpin))                    // If pin 2 is low, read receive
               if(CANrxBuf[i] < 0x10)                // If data byte is less than 0x10, add a leading zero
               {
                 Serial.print("0");
-                 #if defined(HAS_LCD1602)
-                    lcd.print("0");
-                 #endif
+             //    #if defined(HAS_LCD1602)
+             //       lcd.print("0");
+             //    #endif
             //     #if defined(HAS_TFT_ILI9163C)
             //        DISPLAY_DEV.print("0");
             //     #endif
               }
               Serial.print(CANrxBuf[i], HEX);
               Serial.print(" ");
-               #if defined(HAS_LCD1602)
+              /* #if defined(HAS_LCD1602)
                   lcd.print(CANrxBuf[i], HEX);
                   lcd.print(" ");
                #endif
+               */
         //       #if defined(HAS_TFT_ILI9163C)
         //          DISPLAY_DEV.print(CANrxBuf[i], HEX);
         //          DISPLAY_DEV.print(" ");

+ 8 - 5
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_I2C_func.h

@@ -72,13 +72,16 @@
                                     }
                                     */
                                     if(Slave_Ports_Status_A[i].PortTypes | PortTypes_SERVO) {
-                                                         Adafruit_PWMServoDriver_0X40.setPWM(Slave_Ports_Status_A[i].LocalPort, 0, map(180, 0, 180, SERVOMIN, SERVOMAX));
-                                                         delay(1500);
+                                                if(Slave_Ports_Status_A[i].Exp_state | Exp_state_ON) {
+                                    
+                                                         Adafruit_PWMServoDriver_0X40.setPWM(Slave_Ports_Status_A[i].LocalPort, 0, map(90, 0, 180, SERVOMIN, SERVOMAX));
+                                                         Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state + Exp_state_SET;
+                                                         Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
+                                                } else if(Slave_Ports_Status_A[i].Exp_state | Exp_state_OFF)  {
                                                          Adafruit_PWMServoDriver_0X40.setPWM(Slave_Ports_Status_A[i].LocalPort, 0, map(0, 0, 180, SERVOMIN, SERVOMAX));
-                                                         delay(1500);
-                                                         Adafruit_PWMServoDriver_0X40.setPWM(Slave_Ports_Status_A[i].LocalPort, 0, map(180, 0, 180, SERVOMIN, SERVOMAX));
                                                          Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state + Exp_state_SET;
                                                          Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
+                                                }
                                     } else {
                                     
                                                     if(Slave_Ports_Status_A[i].Exp_state == Exp_state_ON ) {
@@ -92,7 +95,7 @@
                                                         Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state + Exp_state_SET;
                                                     } else if(Slave_Ports_Status_A[i].Exp_state == Exp_state_BLINK ){
                                                          Adafruit_PWMServoDriver_0X40.setPWM(Slave_Ports_Status_A[i].LocalPort, 0,2000);
-                                                         delay(1000);
+                                                      //   delay(1000);
                                                          Adafruit_PWMServoDriver_0X40.setPWM(Slave_Ports_Status_A[i].LocalPort, 0,1000);
                                                          Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state + Exp_state_ERROR;
                                                          Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;

+ 2 - 2
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_Status_func.h

@@ -145,7 +145,7 @@
                         
                           ); 
         int i;
-        for(i=ARDUINO_ARRAY_INDEX_FIRST ; i < ARDUINO_ARRAY_INDEX_LIMIT_PORTS; i++) {//
+        for(i=ARDUINO_ARRAY_INDEX_FIRST ; i <= Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A; i++) {//
            DISPLAY_array16_T  DISPLAY_array16_AA="" ;
            DISPLAY_array16_T  DISPLAY_array16_AB="" ;
         
@@ -197,7 +197,7 @@
                             TASK_TYPE_A,
                             TASK_PORT_ASSOC_A
                    ); 
-               delay(100);
+              // delay(100);
             }
         }
    

+ 12 - 1
SE/stuff/P5_Automation_can-dev-res/__main_init.h

@@ -1,2 +1,13 @@
 ARDUINO_FUNCT_INIT_RESULT_T ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add ;
-ARDUINO_FUNCT_INIT_RESULT_T ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init ;
+ARDUINO_FUNCT_INIT_RESULT_T ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init ;
+
+
+
+ARDUINO_LOOP_LATENCY_T                  ARDUINO_LOOP_LATENCY__MAIN_A = 10 ; //EVERY 10 LOOPS INIT THIS LATENCY
+ARDUINO_LOOP_LATENCY_COUNTER_T  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A = ARDUINO_LOOP_LATENCY_COUNTER_INIT ; //WILL decrement
+
+
+
+
+ARDUINO_LOOP_LATENCY_T                  ARDUINO_LOOP_LATENCY__MAIN_END_A = 100 ; //EVERY 10 LOOPS INIT THIS LATENCY
+ARDUINO_LOOP_LATENCY_COUNTER_T  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A = ARDUINO_LOOP_LATENCY_COUNTER_INIT ; //WILL DECREMENT

+ 39 - 26
SE/stuff/P5_Automation_can-dev-res/__main_loop_end.h

@@ -1,33 +1,46 @@
- _Slave_Ports_queue__list(Slave_Ports_Status_QUEUE_A) ;
-  int _Slave_Ports_queue_count = _Slave_Ports_queue.count();
-  int _Slave_Ports_queue_front = _Slave_Ports_queue.front();
-  int _Slave_Ports_queue_back =  _Slave_Ports_queue.back();
-  int _Slave_Ports_queue_peek = _Slave_Ports_queue.peek();
-  int _Slave_Ports_queue_pop = _Slave_Ports_queue.pop();
- _Slave_Ports_queue__POP(
-         Slave_Ports_Status_QUEUE_A, 
-         Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-        _Slave_Ports_queue_count, 
-        _Slave_Ports_queue_pop, 
-        _Slave_Ports_queue_front, 
-        _Slave_Ports_queue_back,
-        _Slave_Ports_queue_peek,
-        LCDtim, 
-        
-                Slave_Ports_Status_A ,
-                Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
-                Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A
-                 ,
-                  DISPLAY_A , 
-                  DISPLAY_T_ARDUINO_ATTR_ARRAY_A,
-                  DISPLAY_PHYSICAL_CHAR_A
- );
+
+if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A <= ARDUINO_LOOP_LATENCY_COUNTER_INIT )  {
+            
+             _Slave_Ports_queue__list(Slave_Ports_Status_QUEUE_A) ;
+              int _Slave_Ports_queue_count = _Slave_Ports_queue.count();
+              int _Slave_Ports_queue_front = _Slave_Ports_queue.front();
+              int _Slave_Ports_queue_back =  _Slave_Ports_queue.back();
+              int _Slave_Ports_queue_peek = _Slave_Ports_queue.peek();
+              int _Slave_Ports_queue_pop = _Slave_Ports_queue.pop();
+             _Slave_Ports_queue__POP(
+                     Slave_Ports_Status_QUEUE_A, 
+                     Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
+                    _Slave_Ports_queue_count, 
+                    _Slave_Ports_queue_pop, 
+                    _Slave_Ports_queue_front, 
+                    _Slave_Ports_queue_back,
+                    _Slave_Ports_queue_peek,
+                    LCDtim, 
+                    
+                            Slave_Ports_Status_A ,
+                            Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
+                            Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
+                             Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
+                             Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A
+                             ,
+                              DISPLAY_A , 
+                              DISPLAY_T_ARDUINO_ATTR_ARRAY_A,
+                              DISPLAY_PHYSICAL_CHAR_A
+             );
+             
+             
  
  
+ }
  
  
+if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A <= ARDUINO_LOOP_LATENCY_COUNTER_INIT )  {
+    Serial.print("#39  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A");   Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A); Serial.println("] ");
+    ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A = ARDUINO_LOOP_LATENCY__MAIN_END_A ;
+     
+} else {
+    ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A ++ ;
+}
 
   //_LCD_print_buffors_list(_LCD_print_buffors) ;
   //_LCD_print_screens_list(_LCD_print_screens);

+ 57 - 47
SE/stuff/P5_Automation_can-dev-res/__main_loop_top.h

@@ -3,58 +3,68 @@
 //ARDUINO_FUNCT_INIT_RESULT_T ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add ;
 
 
+if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A <= ARDUINO_LOOP_LATENCY_COUNTER_INIT ) {
 
-
-
-if(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init == true ){
-                #ifdef DEBUG
-                         Serial.println(" ");
-                        Serial.print("#331__BBB main loop top bypassed  ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init  ");
-                        Serial.print(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
-                        Serial.println("]");
-                 #endif
-
-        }  else { 
-                 #ifdef DEBUG
-                     Serial.print("#331___ccc main loop top ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init=[");
-                     Serial.print(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
-                     Serial.println("]");
-                 #endif
-                 ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init = 
-                         _Slave_Ports_LOCAL_init(
-                                 Slave_Ports_Status_A ,
-                                 Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
-                                  Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
-                                                    Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
-                                                    Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                                 DISPLAY_A , DISPLAY_T_ARDUINO_ATTR_ARRAY_A
-                                 //, DISPLAY_PHYSICAL_CHAR_A
-                            );
-                            
+            
+            if(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init == true ){
+                            #ifdef DEBUG
+                                     Serial.println(" ");
+                                    Serial.print("#331__BBB main loop top bypassed  ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init  ");
+                                    Serial.print(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
+                                    Serial.println("]");
+                             #endif
+            
+                    }  else { 
                              #ifdef DEBUG
-                                Serial.print("#331_AAA main loop top   ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init  ");
-                                Serial.println(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
-                              #endif
-                            
+                                 Serial.print("#331___ccc main loop top ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init=[");
+                                 Serial.print(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
+                                 Serial.println("]");
+                             #endif
+                             ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init = 
+                                     _Slave_Ports_LOCAL_init(
+                                             Slave_Ports_Status_A ,
+                                             Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
+                                              Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
+                                                                Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
+                                                                Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
+                                             DISPLAY_A , DISPLAY_T_ARDUINO_ATTR_ARRAY_A
+                                             //, DISPLAY_PHYSICAL_CHAR_A
+                                        );
+                                        
+                                         #ifdef DEBUG
+                                            Serial.print("#331_AAA main loop top   ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init  ");
+                                            Serial.println(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
+                                          #endif
+                                        
+                        }
+            
+            
+            
+            if(ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add == true) {
+                #if defined(DEBUG)
+                     Serial.println(" ");
+                    Serial.print("#75 main loop top bypassed  ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add=[");
+                    Serial.print(ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add);
+                    Serial.println("]");
+             #endif
+            } else {
+                #if defined(DEBUG)
+                    Serial.println(" ");
+                    Serial.print("#777 main loop top ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add=[");
+                    Serial.print(ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add);
+                    Serial.println("]");
+                 #endif
+            ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add = _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A,  TASK_TYPE_T_Slave_Ports_broadcast____ ,TASK_PORT_ASSOC_EMPTY ,millis(), millis() + ARDUINO_time_seq_id_A_INCREMENT , ARDUINO_ARRAY_INDEX_NOT_SET ) ;  //        "_Slave_Ports_broadcast", //4
+            ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add = _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A,  TASK_TYPE_T_Slave_Ports_set_I2C______ ,TASK_PORT_ASSOC_EMPTY ,millis(), millis() + ARDUINO_time_seq_id_A_INCREMENT , ARDUINO_ARRAY_INDEX_NOT_SET) ;  //"_Slave_Ports_set_I2C" //5  - to set ports associated on PW
+            //ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add = _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A,  TASK_TYPE_T_DISPLAY_queue_pop________ ,TASK_PORT_ASSOC_EMPTY ,millis(), millis() + ARDUINO_time_seq_id_A_INCREMENT , ) ;  //"_Slave_Ports_set_I2C" //5  - to set ports associated on PW
             }
 
 
+}
 
-if(ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add == true) {
-    #if defined(DEBUG)
-         Serial.println(" ");
-        Serial.print("#75 main loop top bypassed  ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add=[");
-        Serial.print(ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add);
-        Serial.println("]");
- #endif
+if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A <= ARDUINO_LOOP_LATENCY_COUNTER_INIT )  {
+    Serial.print("#66  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A");   Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A); Serial.println("] ");
+    ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A = ARDUINO_LOOP_LATENCY__MAIN_A ; 
 } else {
-    #if defined(DEBUG)
-        Serial.println(" ");
-        Serial.print("#777 main loop top ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add=[");
-        Serial.print(ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add);
-        Serial.println("]");
-     #endif
-ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add = _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A,  TASK_TYPE_T_Slave_Ports_broadcast____ ,TASK_PORT_ASSOC_EMPTY ,millis(), millis() + ARDUINO_time_seq_id_A_INCREMENT , ARDUINO_ARRAY_INDEX_NOT_SET ) ;  //        "_Slave_Ports_broadcast", //4
-ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add = _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A,  TASK_TYPE_T_Slave_Ports_set_I2C______ ,TASK_PORT_ASSOC_EMPTY ,millis(), millis() + ARDUINO_time_seq_id_A_INCREMENT , ARDUINO_ARRAY_INDEX_NOT_SET) ;  //"_Slave_Ports_set_I2C" //5  - to set ports associated on PW
-//ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add = _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A,  TASK_TYPE_T_DISPLAY_queue_pop________ ,TASK_PORT_ASSOC_EMPTY ,millis(), millis() + ARDUINO_time_seq_id_A_INCREMENT , ) ;  //"_Slave_Ports_set_I2C" //5  - to set ports associated on PW
+    ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A -- ;
 }

+ 3 - 1
SE/stuff/P5_Automation_can-dev-res/__main_struct.h

@@ -4,7 +4,9 @@ typedef int  ARDUINO_SIZE_T ; //for display etc
 typedef ARDUINO_SIZE_T  ARDUINO_SIZE_MIN_T ; //for display etc
 typedef ARDUINO_SIZE_T  ARDUINO_SIZE_MAX_T ; //for display etc
 
-
+typedef int ARDUINO_LOOP_LATENCY_T;
+typedef int ARDUINO_LOOP_LATENCY_COUNTER_T; //WILL increment
+const ARDUINO_LOOP_LATENCY_COUNTER_T ARDUINO_LOOP_LATENCY_COUNTER_INIT = 1 ; //
 
 typedef bool ARDUINO_FUNCT_INIT_RESULT_T ;