a.binder 5 лет назад
Родитель
Сommit
a4d9267eea

+ 7 - 0
SE/stuff/P5_Automation_can-dev-res/_CAN/_CAN_func.h

@@ -6,6 +6,13 @@ void CAN_READ() {
               Serial.print(CANrxId, HEX);
               Serial.print(" Data: [");Serial.print(CANlen); Serial.print("]"); 
             
+            
+                if(CANlen == CAN_MSG_DATA8_LEN) {
+                
+                        DISPLAY__print_loop(DISPLAY_CURSOR_Y_CHARS_CAN_DEBUG, "CAN RECV DATA", 13, DISPLAY__print_loop_ACTION_ADD ) ;
+                
+                } //if(CANlen == CAN_MSG_DATA8_LEN) {
+            
               for(int i = 0; i<CANlen; i++)           // Print each byte of the data
               {
                 if(CANrxBuf[i] < 0x10)                // If data byte is less than 0x10, add a leading zero

+ 1 - 0
SE/stuff/P5_Automation_can-dev-res/_CAN/_Slave_Ports_Protocol_CAN_struct.h

@@ -18,6 +18,7 @@ typedef  CAN_MSG8_BIT_T CAN_MSG8_T[8] ;
 //typedef int _SENDER_T  ;
 
 const int _CAN_REMOTE_ID_BROADCAST = 0xFF ;
+const int CAN_MSG_DATA8_LEN = 8 ;
 
 typedef int _REMOTE_Controller_ID_T ;
 

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

@@ -114,7 +114,20 @@ void DISPLAY__print_IMMEDIATE(
         
         
         
-
+void DISPLAY__print_loop(DISPLAY_CURSOR_Y_CHARS_T DISPLAY_CURSOR_Y_CHARS_A, 
+    char message,
+    int message_len, 
+    DISPLAY__print_loop_ACTION_T DISPLAY__print_loop_ACTION_A
+) { //to print while in loop
+    static  DISPLAY__print_loop_T  DISPLAY__print_loop_A[5]={} ;
+    static int count = 0 ;
+    if(DISPLAY__print_loop_ACTION_A == DISPLAY__print_loop_ACTION_ADD) {
+        count ++ ;
+        DISPLAY__print_loop_A[count].DISPLAY_CURSOR_Y_CHARS_A = DISPLAY_CURSOR_Y_CHARS_A ;
+        DISPLAY__print_loop_A[count].message_len = message_len ;
+        memcpy(DISPLAY__print_loop_A[count].message, message, message_len );
+    }
+}
 
 
  void DISPLAY__print(

+ 11 - 1
SE/stuff/P5_Automation_can-dev-res/_DISPLAY_struct.h

@@ -108,6 +108,16 @@ static    DISPLAY_T  DISPLAY_A[ARDUINO_ARRAY_INDEX_LIMIT_DISPLAY] = {} ;
  static   DISPLAY_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T  DISPLAY_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A[ARDUINO_ARRAY_INDEX_T_TO_DELETE_S_LIMIT]  = {};  
    
     
-    
+struct DISPLAY__print_loop_S {
+    DISPLAY_CURSOR_Y_CHARS_T DISPLAY_CURSOR_Y_CHARS_A;
+    char message;
+     int message_len ;
+}    ;
+typedef struct DISPLAY__print_loop_S DISPLAY__print_loop_T;
+
+typedef byte DISPLAY__print_loop_ACTION_T ;
+const DISPLAY__print_loop_ACTION_T DISPLAY__print_loop_ACTION_ADD = B00000001 ;
+const DISPLAY__print_loop_ACTION_T DISPLAY__print_loop_ACTION_POP = B00000010 ;
+
     
     

+ 2 - 2
SE/stuff/P5_Automation_can-dev-res/___main/__main_struct_funct.h

@@ -429,8 +429,8 @@ ARDUINO_ARRAY_INDEX_NEXT_LOCK_T ARDUINO_ARRAY_INDEX_POP_LOCK( ARDUINO_ATTR_ARRAY
                                              Serial.print("  2[INCREMENT][=CURRENT] [QUEUE FORCE 0] ");
                                          #endif 
                                                  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A = 0;
-                                                  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A --;
-                                                  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A --;
+                                                  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A = 0;
+                                                  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A = 0;
                                 } else {
                                 
                                           #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT) || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)