arkadiusz binder 5 سال پیش
والد
کامیت
14d89c9ed5

+ 6 - 6
SE/stuff/P5_Automation_can-dev-res/P5_Automation_can-dev-res.ino

@@ -133,7 +133,7 @@
 //#include "config_Slave_Ports_LOCAL_0x101_init.h" //there kleep config of this id device
 
 
-#ifdef DEBUG
+#if defined(DEBUG)
 #define DPRINT(...)    Serial.print(__VA_ARGS__)
 #define DPRINTLN(...)  Serial.println(__VA_ARGS__)
 #define DRINTF(...)    Serial.print(F(__VA_ARGS__))
@@ -462,7 +462,7 @@ void setup() {  //REMEMBER NOT INITIALIZE ANY VARIABLES OR ARRAYS
                     
                     if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A == 0 ) {
                         ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A = ARDUINO_LOOP_LATENCY__MAIN_END_A;
-                          #ifdef DEBUG
+                          #if defined(DEBUG)
                           Serial.print("] COUNTER__MAIN_END_A["); Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A); Serial.print("] C["); Serial.print(ARDUINO_LOOP_LATENCY__MAIN_END_A); Serial.println("] ");
                           #endif
                     } else {
@@ -476,7 +476,7 @@ void setup() {  //REMEMBER NOT INITIALIZE ANY VARIABLES OR ARRAYS
                     static ARDUINO_LOOP_LATENCY_COUNTER_T  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A = ARDUINO_LOOP_LATENCY__MAIN_A;
                     
                     if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A == 0 ) {
-                         #ifdef DEBUG
+                         #if defined(DEBUG)
                          Serial.print("] COUNTER__MAIN_A["); Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A); Serial.print("] C["); Serial.print(ARDUINO_LOOP_LATENCY__MAIN_A); Serial.println("] ");
                          #endif 
                         ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A = ARDUINO_LOOP_LATENCY__MAIN_A;
@@ -517,7 +517,7 @@ void loop() {
     
     
     if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END(ARDUINO_LOOP_LATENCY__MAIN_END_A) <= ARDUINO_LOOP_LATENCY_COUNTER_INIT ) {
-        #ifdef DEBUG
+        #if defined(DEBUG)
             #ifndef DISABLE_LOOP            
                 if(DEBUG_ACTION_TRIG == 1)                            Serial.print("] Time: " );   Serial.println(time);
                  
@@ -528,7 +528,7 @@ void loop() {
         }
             #ifndef DISABLE_LOOP
                 if(DEBUG_ACTION_TRIG == 1) {
-                      #ifdef DEBUG
+                      #if defined(DEBUG)
                       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=[");
@@ -538,7 +538,7 @@ void loop() {
                        #endif
                }
                
-               #ifdef DEBUG_DISPLAY
+               #if defined(DEBUG_DISPLAY)
                
                 Serial.print("#532 Will  TODO bug when too many mesgs to queue ..DISPLAY_pos_seq_T[");
                      Serial.print(DISPLAY_pos_seq_A_NEXT  , BIN);  Serial.print("]+[ ");    Serial.print(DISPLAY_pos_seq_A_IMMEDIATE  , BIN); Serial.print("]  ==[ "); Serial.print(DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE  , BIN);

+ 1 - 1
SE/stuff/P5_Automation_can-dev-res/_CAN_setup.h

@@ -1,6 +1,6 @@
  //if(CAN0.begin(MCP_STDEXT, CAN_500KBPS, MCP_16MHZ) == CAN_OK) {
 
-#ifdef DEBUG_CAN || DEBUG
+#if defined(DEBUG_CAN) ||  defined(DEBUG)
     Serial.print("#44 _CAN_setup.h will CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ) == CAN_OK ");
 #endif
 

+ 5 - 5
SE/stuff/P5_Automation_can-dev-res/_DISPLAY_add_record_func.h

@@ -26,7 +26,7 @@
                 
                  ARDUINO_ARRAY_INDEX_CURRENT_T i = DISPLAY_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;
                          if(i == ARDUINO_ARRAY_INDEX_CORRUPT) {
-                            #ifdef DEBUG
+                            #if defined(DEBUG)
                                 Serial.print(" [#30 i == ARDUINO_ARRAY_INDEX_CORRUPT]  [");
                                 Serial.print(i);
                                 
@@ -42,7 +42,7 @@
                                     
                                     ARDUINO_ATTR_ARRAY_S__commit_added_element(
                                          DISPLAY_T_ARDUINO_ATTR_ARRAY_A , i); 
-                                         #ifdef DEBUG
+                                         #if defined(DEBUG)
                                               Serial.print(" [#43 ARDUINO_ATTR_ARRAY_S__commit_added_element]  ");
                                                Serial.print("#47 ARDUINO_ARRAY_INDEX_CURRENT_A: [");
                                              Serial.print(DISPLAY_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A);
@@ -98,7 +98,7 @@
                 //DISPLAY_A[i].DISPLAY_array16_A = DISPLAY_array16_AAAA ; // DISPLAY_array16_AAAA ;//"012345678901234" ;
                 // DISPLAY_array16_A ;
                 DISPLAY_A[i].DISPLAY_TARGET_A  = DISPLAY_TARGET_A ; 
-                #ifdef DEBUG
+                #if defined(DEBUG)
                 Serial.print("#66 ");
                 #endif
                     if(time_seq_id_A == 0 ) {
@@ -107,7 +107,7 @@
                        DISPLAY_A[i].time_seq_id_A = time_seq_id_A ;
                     }
                     
-                #ifdef DEBUG
+                #if defined(DEBUG)
                     Serial.print("#66 ");
                 #endif
                 if(time_min_run_A == 0 and not(time_seq_id_A == 0)) {
@@ -118,7 +118,7 @@
                 ARDUINO_ATTR_ARRAY_S__commit_added_element(
                 DISPLAY_T_ARDUINO_ATTR_ARRAY_A , i); 
                
-                          #ifdef DEBUG
+                          #if defined(DEBUG)
                     // if(DEBUG > 6) {
                                    Serial.print("#172 DISPLAY__add_record[DEBUG]  AFTER #COUNT["); Serial.print(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A);
                                     Serial.print("] INDEX_LAST["); Serial.print( DISPLAY_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A);

+ 1 - 1
SE/stuff/P5_Automation_can-dev-res/_DISPLAY_func.h

@@ -146,7 +146,7 @@ void DISPLAY__print_IMMEDIATE(
                     #endif
                     
                     if(DISPLAY_pos_seq_A & DISPLAY_pos_seq_A_IMMEDIATE){ ////BIN TEST
-                            #ifdef DEBUG_DISPLAY
+                            #if defined(DEBUG_DISPLAY)
                                     //if(DEBUG > 6) {
                                         Serial.print("#84 DISPLAY__print to DISPLAY__print_IMMEDIATE [DEBUG]  else  Seq["); Serial.print(DISPLAY_pos_seq_A , BIN);
                                         Serial.print("] Target["); Serial.print(DISPLAY_TARGET_A , BIN); 

+ 1 - 1
SE/stuff/P5_Automation_can-dev-res/_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_setup.h

@@ -34,6 +34,6 @@ Adafruit_PWMServoDriver_0X40.setPWMFreq(PortTypes_PWM_FREQ_DEFAULT);
 
 
 
-#ifdef DISABLE_LOOP || DEBUG
+#if defined(DISABLE_LOOP) || defined(DEBUG)
          Serial.println("END #include _I2C_driver_Adafruit_PWMServoDriver_setup.h ");
 #endif

+ 6 - 6
SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW/_ROTTARY_SW_setup.h

@@ -11,24 +11,24 @@
              Serial.println("will  attachPinChangeInterrupt(ROTTARY_SW_sw, ROTTARY_SW_sw_INT, FALLING); ");
     #endif
   attachPinChangeInterrupt(ROTTARY_SW_sw, ROTTARY_SW_sw_INT, FALLING);  // add more attachInterrupt code as required
-    #ifdef DISABLE_LOOP || DEBUG
+    #if defined(DISABLE_LOOP) ||  defined(DEBUG)
              Serial.println("will  pinMode(ROTTARY_SW_sw, INPUT_PULLUP) ");
     #endif
   pinMode(ROTTARY_SW_sw, INPUT_PULLUP);
   
-    #ifdef DISABLE_LOOP || DEBUG
+    #if defined(DISABLE_LOOP) ||  defined(DEBUG)
              Serial.println("will  attachPinChangeInterrupt(ROTTARY_SW_dt, ROTTARY_SW_dt_INT, RISING)");
     #endif
   attachPinChangeInterrupt(ROTTARY_SW_dt, ROTTARY_SW_dt_INT, RISING); //FALLING //RISING 
-    #ifdef DISABLE_LOOP || DEBUG
+    #if defined(DISABLE_LOOP) ||  defined(DEBUG)
              Serial.println("will  pinMode(ROTTARY_SW_dt, INPUT_PULLUP)");
     #endif
   pinMode(ROTTARY_SW_dt, INPUT_PULLUP);
-   #ifdef DISABLE_LOOP || DEBUG
+   #if defined(DISABLE_LOOP) ||  defined(DEBUG)
              Serial.println("will  attachPinChangeInterrupt(ROTTARY_SW_clk, ROTTARY_SW_clk_INT, RISING)");
     #endif
   attachPinChangeInterrupt(ROTTARY_SW_clk, ROTTARY_SW_clk_INT, RISING); //CHANGE
-  #ifdef DISABLE_LOOP || DEBUG
+  #if defined(DISABLE_LOOP) ||  defined(DEBUG)
              Serial.println("pinMode(ROTTARY_SW_clk, INPUT_PULLUP)");
     #endif
   pinMode(ROTTARY_SW_clk, INPUT_PULLUP);
@@ -50,6 +50,6 @@
 
 
 
-#ifdef DISABLE_LOOP || DEBUG
+#if defined(DISABLE_LOOP) ||  defined(DEBUG)
          Serial.println("END #include _ROTTARY_SW_setup.h ");
 #endif

+ 1 - 1
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_I2C_func.h

@@ -20,7 +20,7 @@
     ) {     
     
     
-    #ifdef DISABLE_LOOP || DEBUG || DEBUG_I2C
+    #if defined(DISABLE_LOOP) ||  defined(DEBUG) ||  defined(DEBUG_I2C)
         
      Serial.print("#234 _Slave_Ports_I2C_POP  _Slave_Ports_queue_pop["); Serial.print(_Slave_Ports_queue_pop);  Serial.println("]");
     #endif

+ 1 - 1
SE/stuff/P5_Automation_can-dev-res/___loop/__main_loop_end.h

@@ -4,7 +4,7 @@
 
 if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END(ARDUINO_LOOP_LATENCY__MAIN_END_A) <= ARDUINO_LOOP_LATENCY_COUNTER_INIT )  {
            
-             #ifdef DISABLE_LOOP || DEBUG
+             #if defined(DISABLE_LOOP) ||  defined(DEBUG)
                 if(DEBUG_ACTION_TRIG != DEBUG_LAST_ACTION_TRIG) { 
                  Serial.print("#4 main_loop_end  will    _Slave_Ports_queue__list"); 
                  }