|
@@ -15,49 +15,57 @@ void CAN_READ(
|
|
|
Serial.print(" Data: [");Serial.print(CANlen); Serial.print("]");
|
|
Serial.print(" Data: [");Serial.print(CANlen); Serial.print("]");
|
|
|
|
|
|
|
|
|
|
|
|
|
- /* if(CANlen == CAN_MSG_DATA8_LEN) {
|
|
|
|
|
|
|
+ if(CANlen == CAN_MSG_DATA8_LEN) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DISPLAY__print_loop(DISPLAY_CURSOR_Y_CHARS_CAN_DEBUG, "CAN RECV DATA", 13, DISPLAY__print_loop_ACTION_ADD ) ;
|
|
// DISPLAY__print_loop(DISPLAY_CURSOR_Y_CHARS_CAN_DEBUG, "CAN RECV DATA", 13, DISPLAY__print_loop_ACTION_ADD ) ;
|
|
|
_CAN_REMOTE_ID_T _CAN_REMOTE_ID = CANrxId ;
|
|
_CAN_REMOTE_ID_T _CAN_REMOTE_ID = CANrxId ;
|
|
|
|
|
|
|
|
- CAN_MSG8_BIT_1_T CAN_MSG8_BIT_1_A = CANrxBuf[1] < 0x10 ;
|
|
|
|
|
- CAN_MSG8_BIT_2_T CAN_MSG8_BIT_2_A = CANrxBuf[2] < 0x10 ;
|
|
|
|
|
- CAN_MSG8_BIT_3_T CAN_MSG8_BIT_3_A = CANrxBuf[3] < 0x10 ;
|
|
|
|
|
- CAN_MSG8_BIT_4_T CAN_MSG8_BIT_4_A = CANrxBuf[4] < 0x10 ;
|
|
|
|
|
- CAN_MSG8_BIT_5_T CAN_MSG8_BIT_5_A = CANrxBuf[5] < 0x10 ;
|
|
|
|
|
- CAN_MSG8_BIT_6_T CAN_MSG8_BIT_6_A = CANrxBuf[6] < 0x10 ;
|
|
|
|
|
- CAN_MSG8_BIT_7_T CAN_MSG8_BIT_7_A = CANrxBuf[7] < 0x10 ;
|
|
|
|
|
- CAN_MSG8_BIT_8_T CAN_MSG8_BIT_8_A = CANrxBuf[8] < 0x10 ;
|
|
|
|
|
|
|
+ CAN_MSG8_BIT_1_T CAN_MSG8_BIT_1_A = int(CANrxBuf[1] < 0x10) ;
|
|
|
|
|
+ CAN_MSG8_BIT_2_T CAN_MSG8_BIT_2_A = int(CANrxBuf[2] < 0x10) ;
|
|
|
|
|
+ CAN_MSG8_BIT_3_T CAN_MSG8_BIT_3_A = int(CANrxBuf[3] < 0x10) ;
|
|
|
|
|
+ CAN_MSG8_BIT_4_T CAN_MSG8_BIT_4_A = int(CANrxBuf[4] < 0x10) ;
|
|
|
|
|
+ CAN_MSG8_BIT_5_T CAN_MSG8_BIT_5_A = int(CANrxBuf[5] < 0x10) ;
|
|
|
|
|
+ CAN_MSG8_BIT_6_T CAN_MSG8_BIT_6_A = int(CANrxBuf[6] < 0x10) ;
|
|
|
|
|
+ CAN_MSG8_BIT_7_T CAN_MSG8_BIT_7_A = int(CANrxBuf[7] < 0x10) ;
|
|
|
|
|
+ CAN_MSG8_BIT_8_T CAN_MSG8_BIT_8_A = int(CANrxBuf[8] < 0x10) ;
|
|
|
|
|
|
|
|
// Serial.print();
|
|
// Serial.print();
|
|
|
|
|
|
|
|
- Serial.print("0");
|
|
|
|
|
- */ /*
|
|
|
|
|
|
|
+ Serial.print("1:");Serial.print(CAN_MSG8_BIT_1_A, HEX);Serial.print(",2:");
|
|
|
|
|
+ Serial.print(CAN_MSG8_BIT_2_A, HEX);Serial.print(",3:");
|
|
|
|
|
+ Serial.print(CAN_MSG8_BIT_3_A, HEX);Serial.print(",4:");
|
|
|
|
|
+ Serial.print(CAN_MSG8_BIT_4_A, HEX);Serial.print(",5:");
|
|
|
|
|
+ Serial.print(CAN_MSG8_BIT_5_A, BIN);Serial.print(",6:");
|
|
|
|
|
+ Serial.print(CAN_MSG8_BIT_6_A, HEX);Serial.print(",7:");
|
|
|
|
|
+ Serial.print(CAN_MSG8_BIT_7_A, HEX);Serial.print(",8:");
|
|
|
|
|
+ Serial.print(CAN_MSG8_BIT_8_A, HEX);Serial.println(" ] ");
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
Slave_Ports_Status_add_port(
|
|
Slave_Ports_Status_add_port(
|
|
|
Slave_Ports_Status_A ,
|
|
Slave_Ports_Status_A ,
|
|
|
Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_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_TABLE_A,
|
|
|
Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
|
|
Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
|
|
|
Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_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
|
|
|
|
|
|
|
+ CAN_MSG8_BIT_3_A, // int Port_ID,
|
|
|
|
|
+ CANrxId , //int _Slave_ID,
|
|
|
|
|
+ CAN_MSG8_BIT_4_A , //int PortTypes,
|
|
|
|
|
+ 0 , //int Address,
|
|
|
|
|
+ 0 , //int LocalPort,
|
|
|
|
|
+ CAN_MSG8_BIT_5_A , //Exp_state_BLINK, //int Exp_state,
|
|
|
|
|
+ CAN_MSG8_BIT_6_A, //Exp_state_ttl_TO_REFRESH, //int Exp_state_ttl,
|
|
|
|
|
+ CAN_MSG8_BIT_7_A, //Broadcast_state_TO_REFRESH, //int Broadcast_state,
|
|
|
|
|
+ 0 , //int I2C_port,
|
|
|
|
|
+ 0 ,//int I2C_driver
|
|
|
|
|
+ IS_Local_FALSE
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- */
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
- // } else { //if(CANlen == CAN_MSG_DATA8_LEN)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ } else { //if(CANlen == CAN_MSG_DATA8_LEN)
|
|
|
|
|
+
|
|
|
|
|
|
|
|
for(int i = 0; i<CANlen; i++) // Print each byte of the data
|
|
for(int i = 0; i<CANlen; i++) // Print each byte of the data
|
|
|
{
|
|
{
|