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

+ 2 - 0
SE/stuff/P5_Automation_can-dev-res/_PortTypes_struct.h

@@ -6,6 +6,8 @@ typedef  byte PortTypes_T ;
  const  PortTypes_T PortTypes_I2C           =  B00000010 ; // 0x02
  const  PortTypes_T PortTypes_EXP           =  B00000100 ; // 0x03
  const  PortTypes_T PortTypes_SERVO         =  B00001000 ; // 0x03
+ const  PortTypes_T PortTypes_SERVO_360     =  B00010000 ; // 0x03
+
 
  const  PortTypes_T PortTypes_P2M_EXP_I2C =  PortTypes_PWM | PortTypes_I2C | PortTypes_EXP  ; //0x07 ; //TODO BITTEST
  const  PortTypes_T PortTypes_PWM_EXP_I2C =  PortTypes_PWM | PortTypes_I2C | PortTypes_EXP  ; //0x07 ; //TODO BITTEST

+ 12 - 3
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_I2C_func.h

@@ -171,9 +171,18 @@
                                     
                                     
                                     if(Slave_Ports_Status_A[i].PortTypes & PortTypes_SERVO) {
-                                            Serial.print("#147   [PortTypes_SERVO]   ");
-                                                if(Slave_Ports_Status_A[i].Exp_state & Exp_state_ON) {
-                                    
+                                                Sprintln(F("#147   [PortTypes_SERVO]  [")); Serial.print(Exp_state_ON_USE_LEVEL, BIN); Sprintln(F("] ")); 
+                                                if(Slave_Ports_Status_A[i].Exp_state & Exp_state_ON_USE_LEVEL) {
+                                                        #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
+                                                        Sprintln(F("[SERVO] [Exp_state_ON_USE_LEVEL]"));        
+                                                        #endif
+                                                         Serial.print("[SERVO]->[PORT["); Serial.print(Slave_Ports_Status_A[i].LocalPort); Serial.println("]  ");
+                                                        Adafruit_PWMServoDriver_A[I2C_INDEX_DRIVER_A].Adafruit_PWMServoDriver_V.setPWM(Slave_Ports_Status_A[i].LocalPort, 0, map(Slave_Ports_Status_A[i].Exp_state_level_A , 0, 180, SERVOMIN, SERVOMAX));
+                                                        Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state | Exp_state_SET; //TODO BITTEST
+                                                        Slave_Ports_Status_A[i].Exp_state = ~ Exp_state_SET_REQ_SEND; //TODO BITTEST
+                                                        //Serial.print("[D209]Aft[");Serial.print(Slave_Ports_Status_A[i].Exp_state , BIN);Serial.print("]");
+                                                        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) {
                                                          Adafruit_PWMServoDriver_A[I2C_INDEX_DRIVER_A].Adafruit_PWMServoDriver_V.setPWM(Slave_Ports_Status_A[i].LocalPort, 0, map(90, 0, 180, SERVOMIN, SERVOMAX));
                                                          #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
                                                           Serial.print("#149 I2C_driver PortTypes_SERVO->ON Exp_state [SET]"); Serial.print(Slave_Ports_Status_A[i].Exp_state); Serial.print("]   after   [");

+ 0 - 0
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_Status_func - Copy.h


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

@@ -129,12 +129,12 @@
   )
    {
    
-   
+                String title = "Ports of 0x" ; title.concat(String(Active_ControllerID_HEX , HEX));                 title.concat(" ");
                      
                   
                      DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[1].DISPLAY_CURSOR_X_CHARS_A =  0 ;
                      DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[1].DISPLAY_CURSOR_Y_CHARS_A = 0 ;
-                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[1].DISPLAY_string_A =  "Ports"; //DISPLAY_string_A ;
+                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[1].DISPLAY_string_A = title ;// "Ports"; //DISPLAY_string_A ;
                      DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[1].DISPLAY_COLOR_A =  0x0004 ;
                      DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[1].DISPLAY_MENU_ITEM_FLAG_A = DISPLAY_MENU_ITEM_FLAG_INITIALIZED  ;
                              
@@ -171,6 +171,13 @@
                       message.concat(Slave_Ports_Status_A[i].Port_ID )  ; 
                       message.concat(" ");
                       
+                       if(Slave_Ports_Status_A[i].PortTypes & PortTypes_SERVO ) {
+                            message.concat("S");
+                       }
+                       if(Slave_Ports_Status_A[i].PortTypes & PortTypes_SERVO_360 ) {
+                            message.concat("3");
+                       }
+                      
                          if(Slave_Ports_Status_A[i].IS_gone_A == IS_gone_TRUE) {
                              message2 = message ; message2.concat(" [---] ");
                          } else {

+ 4 - 4
SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x11/config_Slave_Ports_LOCAL_0x11_init.h

@@ -25,9 +25,9 @@ ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
                                     Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
                                 1,  // int  Port_ID,
                                 Active_ControllerID_HEX ,  //int  _Slave_ID,
-                                PortTypes_PWM_EXP_I2C , //int  PortTypes,
+                                PortTypes_PWM_EXP_I2C, //int  PortTypes,
                                 0x40 ,  //int  Address,
-                                1 , //int  LocalPort,
+                                0 , //int  LocalPort,
                                 Exp_state_OFF, //int  Exp_state,
                                 Exp_state_ttl_TO_REFRESH, //int  Exp_state_ttl,
                                 Broadcast_state_TO_REFRESH, //int  Broadcast_state,
@@ -45,9 +45,9 @@ ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
                                     Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
                                 2,  // int  Port_ID,
                                 Active_ControllerID_HEX ,  //int  _Slave_ID,
-                                PortTypes_PWM_EXP_I2C ,// | PortTypes_SERVO //int  PortTypes,
+                                PortTypes_PWM_EXP_I2C | PortTypes_SERVO  ,// | PortTypes_SERVO //int  PortTypes,
                                 0x40 ,  //int  Address,
-                                2 , //int  LocalPort,
+                                1 , //int  LocalPort,
                                 Exp_state_OFF, //int  Exp_state,
                                 Exp_state_ttl_TO_REFRESH , //Exp_state_ttl_TO_REFRESH, //int  Exp_state_ttl,
                                 Broadcast_state_FULL_FRESH, //Broadcast_state_TO_REFRESH, //int  Broadcast_state,

+ 4 - 4
SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x13/config_Slave_Ports_LOCAL_0x13_init.h

@@ -36,7 +36,7 @@ ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
                                 IS_Local_TRUE 
                                 );
                                 
-                           /*     
+                                
                   Slave_Ports_Status_add_port(
                                 Slave_Ports_Status_A ,
                                 Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
@@ -45,9 +45,9 @@ ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
                                     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,
+                                PortTypes_P2M_EXP_I2C | PortTypes_SERVO , //int  PortTypes,
                                 0x40 ,  //int  Address,
-                                2 , //int  LocalPort,
+                                4 , //int  LocalPort,
                                 Exp_state_OFF, //int  Exp_state,
                                 Exp_state_ttl_TO_REFRESH, //int  Exp_state_ttl,
                                 Broadcast_state_TO_REFRESH, //int  Broadcast_state,
@@ -55,7 +55,7 @@ ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
                                 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,