Parcourir la source

Merge branch 'master' of ssh://biuro.biall-net.pl:2222/plabudda/se

a.binder il y a 5 ans
Parent
commit
124fe1704d

+ 35 - 5
SE/stuff/P5_Automation_can-dev-res/P5_Automation_can-dev-res.ino

@@ -95,7 +95,26 @@
 #define  _ControllerID   0x101 
 #define  _Slave1_ID   0x103 
 
-#include "config_Active_ControllerID.h"
+
+
+//#include "Active_ControllerID_0x103.h"
+//#define Active_ControllerID _ControllerID 
+//#define Active_ControllerID _Slave1_ID 
+
+#include "config_Active_ControllerID.h" //there kleep id of device
+
+//#include "config_Slave_Ports_LOCAL_0x101_init.h" //there kleep config of this id device
+
+
+#if Active_ControllerID == 0x101 
+     #include "config_Active_ControllerID_0x101.h"
+#endif
+
+
+#if Active_ControllerID == 0x103 
+    #include "config_Active_ControllerID_0x103.h"  //there kleep config of this id device
+#endif
+
 
 
 
@@ -103,10 +122,6 @@
 #if defined(HAS_TFT_ILI9163C)
     #include "_TFT_ILI9163C_config.h"
 #endif
-//#include "Active_ControllerID_0x103.h"
-//#define Active_ControllerID _ControllerID 
-//#define Active_ControllerID _Slave1_ID 
-
 #include "_DISPLAY_struct.h"
 #include "_Port_ID_sruct.h"
 
@@ -274,6 +289,21 @@
 
 #include "config_Slave_Ports_LOCAL_init.h"
 
+
+#if Active_ControllerID == 0x101 
+     #include "config_Slave_Ports_LOCAL_0x101_init.h"
+#endif
+
+
+#if Active_ControllerID == 0x103 
+    #include "config_Slave_Ports_LOCAL_0x103_init.h"
+#endif
+
+
+
+
+
+
 #include "__main_init.h"
 
 

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

@@ -12,7 +12,7 @@ DISPLAY__CURSOR_Y_CHARS__SET(DISPLAY_PHYSICAL_CHAR_A,
           DISPLAY_array16_T  DISPLAY_array16_AA="" ;
           //( "OUT I2C 0X40[2]" + encoderPos * 5 , 2), //message,                
           String message = "OUT I2C 0X40[2] V:";
-              message.concat(encoderPos * 5);
+              message.concat(String(encoderPos * 5));
               message.toCharArray(DISPLAY_array16_AA, message.length());
                      DISPLAY__print(
                           DISPLAY_A ,

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

@@ -80,7 +80,7 @@ void DISPLAY_DEV__CURSOR_Y_CHARS__SET(DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_
                  DISPLAY_DEV.fillRect(0, 
                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A * DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A,
                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_PX_A , 
-                    DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A  , BLUE);
+                    DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A  , GREEN);
          
 }
 

+ 6 - 5
SE/stuff/P5_Automation_can-dev-res/config_Active_ControllerID.h

@@ -1,8 +1,9 @@
-//#define Active_ControllerID _ControllerID 
-#define Active_ControllerID _Slave1_ID 
+#define Active_ControllerID _ControllerID 
+//#define Active_ControllerID _Slave1_ID 
 
-#define HAS_TFT_ILI9163C 
+
+//there kleep config of this id device#define HAS_TFT_ILI9163C 
 // #define HAS_LCD1602 
-#define HAS_ROTTARY_SW
+//#define HAS_ROTTARY_SW
 
-#define HAS_I2C_driver_Adafruit_PWMServoDriver 
+//#define HAS_I2C_driver_Adafruit_PWMServoDriver 

+ 6 - 0
SE/stuff/P5_Automation_can-dev-res/config_Active_ControllerID_0x101.h

@@ -0,0 +1,6 @@
+
+//there kleep config of this id device#define HAS_TFT_ILI9163C 
+// #define HAS_LCD1602 
+#define HAS_ROTTARY_SW
+#define HAS_TFT_ILI9163C
+#define HAS_I2C_driver_Adafruit_PWMServoDriver 

+ 6 - 0
SE/stuff/P5_Automation_can-dev-res/config_Active_ControllerID_0x103.h

@@ -0,0 +1,6 @@
+
+//there kleep config of this id device#define HAS_TFT_ILI9163C 
+// #define HAS_LCD1602 
+//#define HAS_ROTTARY_SW
+
+#define HAS_I2C_driver_Adafruit_PWMServoDriver 

+ 106 - 0
SE/stuff/P5_Automation_can-dev-res/config_Slave_Ports_LOCAL_0x101_init.h

@@ -0,0 +1,106 @@
+
+ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
+                Slave_Ports_Status_T* Slave_Ports_Status_A ,
+                Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
+                 Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_T*            Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
+                 Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T*      Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
+                 Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_T*  Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
+                
+                DISPLAY_T*  DISPLAY_A ,  DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A
+                //,*DISPLAY_PHYSICAL_CHAR_A //DISPLAY_PHYSICAL_CHAR_T 
+                ) {
+
+   //DISPLAY_T_ARDUINO_ATTR_ARRAY_A[ARDUINO_ATTR_ARRAY_S_INDEX].ARDUINO_ARRAY_INDEX_CURRENT_INIT ++;
+     #if defined(DEBUG) 
+                                  if(DEBUG > 6) {  
+                Serial.println("#4444 _Slave_Ports_LOCAL_init");
+                }
+     #endif
+      
+                  Slave_Ports_Status_add_port(
+                                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,
+                                1,  // int  Port_ID,
+                                Active_ControllerID ,  //int  _Slave_ID,
+                                PortTypes_P2M_EXP_I2C + PortTypes_SERVO , //int  PortTypes,
+                                0x40 ,  //int  Address,
+                                1 , //int  LocalPort,
+                                Exp_state_OFF, //int  Exp_state,
+                                Exp_state_ttl_TO_REFRESH, //int  Exp_state_ttl,
+                                Broadcast_state_TO_REFRESH, //int  Broadcast_state,
+                                I2C_port_DEFAULT, //int I2C_port,
+                                I2C_driver_Adafruit_PWMServoDriver ,//int I2C_driver
+                                IS_Local_TRUE 
+                                );
+                                
+                                
+                  Slave_Ports_Status_add_port(
+                                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,
+                                2,  // int  Port_ID,
+                                Active_ControllerID ,  //int  _Slave_ID,
+                                PortTypes_P2M_EXP_I2C , //int  PortTypes,
+                                0x40 ,  //int  Address,
+                                2 , //int  LocalPort,
+                                Exp_state_OFF, //int  Exp_state,
+                                Exp_state_ttl_TO_REFRESH, //int  Exp_state_ttl,
+                                Broadcast_state_TO_REFRESH, //int  Broadcast_state,
+                                I2C_port_DEFAULT, //int I2C_port,
+                                I2C_driver_Adafruit_PWMServoDriver ,//int I2C_driver
+                                IS_Local_TRUE 
+                                );
+                                
+                                 Slave_Ports_Status_add_port(
+                                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,
+                                3,  // int  Port_ID,
+                                Active_ControllerID ,  //int  _Slave_ID,
+                                PortTypes_P2M_EXP_I2C , //int  PortTypes,
+                                0x40 ,  //int  Address,
+                                3 , //int  LocalPort,
+                                Exp_state_BLINK, //int  Exp_state,
+                                Exp_state_ttl_TO_REFRESH, //int  Exp_state_ttl,
+                                Broadcast_state_TO_REFRESH, //int  Broadcast_state,
+                                I2C_port_DEFAULT, //int I2C_port,
+                                I2C_driver_Adafruit_PWMServoDriver ,//int I2C_driver
+                                IS_Local_TRUE 
+                                );
+                                
+                                
+                                
+                                
+                    /*    DISPLAY__print_ANY(
+                    DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
+                    DISPLAY_PHYSICAL_CHAR_A,
+                    DISPLAY_pos_seq_A_NEXT,
+                    "#4 _Slave_Ports_LOCAL_init");             
+                 
+                 */
+                 DISPLAY__add_record(
+                       DISPLAY_A ,
+                      DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
+                      DISPLAY_PHYSICAL_CHAR_A, 
+                          DISPLAY_pos_seq_A_NEXT ,
+                          "#50 Added ports ",//DISPLAY_array16_A
+                          DISPLAY_TARGET_DISPLAY128,
+                          millis(), //time_seq_id_A,
+                           millis() + 5000 //time_min_run_A =
+                           //QUEUE
+                           , Slave_Ports_Status_QUEUE_A,
+                            TASK_TYPE_T__EMPTY__JUST_PASSED_ARG__,
+                            TASK_PORT_ASSOC_EMPTY
+                 );
+     
+                    
+    return true ;
+
+}

+ 9 - 7
SE/stuff/P5_Automation_can-dev-res/config_Slave_Ports_LOCAL_init.h

@@ -1,5 +1,7 @@
 
-ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
+//default ports of any device
+
+ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_DEFAULT_LOCAL_init(
                 Slave_Ports_Status_T* Slave_Ports_Status_A ,
                 Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
                  Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_T*            Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
@@ -13,11 +15,11 @@ ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
    //DISPLAY_T_ARDUINO_ATTR_ARRAY_A[ARDUINO_ATTR_ARRAY_S_INDEX].ARDUINO_ARRAY_INDEX_CURRENT_INIT ++;
      #if defined(DEBUG) 
                                   if(DEBUG > 6) {  
-                Serial.println("#4444 _Slave_Ports_LOCAL_init");
+                Serial.println("#3333 _Slave_Ports_DEFAULT_LOCAL_init");
                 }
      #endif
       
-                  Slave_Ports_Status_add_port(
+               /*   Slave_Ports_Status_add_port(
                                 Slave_Ports_Status_A ,
                                 Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
                                     Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
@@ -76,7 +78,7 @@ ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
                                 );
                                 
                                 
-                                
+                                */
                                 
                     /*    DISPLAY__print_ANY(
                     DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
@@ -85,12 +87,12 @@ ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
                     "#4 _Slave_Ports_LOCAL_init");             
                  
                  */
-                 DISPLAY__add_record(
+               /*  DISPLAY__add_record(
                        DISPLAY_A ,
                       DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
                       DISPLAY_PHYSICAL_CHAR_A, 
                           DISPLAY_pos_seq_A_NEXT ,
-                          "#50 Added ports ",//DISPLAY_array16_A
+                          "#50 Added default ports ",//DISPLAY_array16_A
                           DISPLAY_TARGET_DISPLAY128,
                           millis(), //time_seq_id_A,
                            millis() + 5000 //time_min_run_A =
@@ -100,7 +102,7 @@ ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
                             TASK_PORT_ASSOC_EMPTY
                  );
      
-                    
+                 */   
     return true ;
 
 }