|
@@ -1,4 +1,4 @@
|
|
|
-#include "_Slave_Ports_ttl_decrement.h"
|
|
|
|
|
|
|
+//#include "_Slave_Ports_ttl_decrement.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -39,7 +39,7 @@ typedef struct {
|
|
|
bit 8 - not allocated
|
|
bit 8 - not allocated
|
|
|
}*/
|
|
}*/
|
|
|
int Exp_state_ttl; // 0x00 = odswiezyc
|
|
int Exp_state_ttl; // 0x00 = odswiezyc
|
|
|
- //int Broadcast_state; //0x00 - not broadcast; 0x01
|
|
|
|
|
|
|
+ int Broadcast_state; //0x00 - not broadcast; 0x01
|
|
|
} _Slave_Port;
|
|
} _Slave_Port;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -53,7 +53,6 @@ _Slave_Port _Slave_Ports[] = {
|
|
|
};
|
|
};
|
|
|
*/
|
|
*/
|
|
|
#include "_Slave_Ports_LOCAL.h"
|
|
#include "_Slave_Ports_LOCAL.h"
|
|
|
-#include "_Slave_Ports_queue_task_type_LIST.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct _Slave_Ports_queue_tasksS {
|
|
struct _Slave_Ports_queue_tasksS {
|
|
@@ -95,7 +94,7 @@ void _Slave_Ports_queue__INIT( _Slave_Ports_queue_tasksT* _Slave_Ports_queue_tas
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-String _Slave_Ports_queue_task_type_DESC( int _Slave_Ports_queue_task_type ) {//, int* res
|
|
|
|
|
|
|
+void _Slave_Ports_queue_task_type_DESC( int _Slave_Ports_queue_task_type ) {//, int* res
|
|
|
/* if(_Slave_Ports_queue_task_type == 0x01) res=0x99; //res="_Slave_Ports_ttl_decrement";
|
|
/* if(_Slave_Ports_queue_task_type == 0x01) res=0x99; //res="_Slave_Ports_ttl_decrement";
|
|
|
else if(_Slave_Ports_queue_task_type == 0x02) res=0x99; //res="request_confirm_Exp_state";
|
|
else if(_Slave_Ports_queue_task_type == 0x02) res=0x99; //res="request_confirm_Exp_state";
|
|
|
else if(_Slave_Ports_queue_task_type == 0x03) res=0x99; //res="request_set_new_Exp_state";
|
|
else if(_Slave_Ports_queue_task_type == 0x03) res=0x99; //res="request_set_new_Exp_state";
|
|
@@ -115,7 +114,7 @@ String _Slave_Ports_queue_task_type_DESC( int _Slave_Ports_queue_task_type ) {//
|
|
|
// return return_i ;
|
|
// return return_i ;
|
|
|
*/
|
|
*/
|
|
|
//Serial.print(_Slave_Ports_queue_task_type[_Slave_Ports_queue_task_type]);
|
|
//Serial.print(_Slave_Ports_queue_task_type[_Slave_Ports_queue_task_type]);
|
|
|
- return _Slave_Ports_queue_task_type_LIST[_Slave_Ports_queue_task_type];
|
|
|
|
|
|
|
+ Serial.print(_Slave_Ports_queue_task_type_LIST[_Slave_Ports_queue_task_type]);
|
|
|
// String ret = "aaaaxxx";
|
|
// String ret = "aaaaxxx";
|
|
|
//return ret;
|
|
//return ret;
|
|
|
}
|
|
}
|
|
@@ -145,7 +144,7 @@ void _Slave_Ports_queue__list( _Slave_Ports_queue_tasksT* _Slave_Ports_queue_tas
|
|
|
//Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type);
|
|
//Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type);
|
|
|
//char res;
|
|
//char res;
|
|
|
// res = _Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type); Serial.print(res);
|
|
// res = _Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type); Serial.print(res);
|
|
|
- Serial.print(_Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type));
|
|
|
|
|
|
|
+ _Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type);
|
|
|
Serial.print(" - map["); Serial.print(_Slave_Ports_queue_task_type_LIST[_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type]); Serial.print("]");
|
|
Serial.print(" - map["); Serial.print(_Slave_Ports_queue_task_type_LIST[_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type]); Serial.print("]");
|
|
|
// Serial.print(_Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type)) ; //(res); //_Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type
|
|
// Serial.print(_Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type)) ; //(res); //_Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type
|
|
|
|
|
|
|
@@ -284,8 +283,22 @@ int _Slave_Ports_queue_task_type, int _Slave_Port_link, long time_seq_id, long t
|
|
|
|
|
|
|
|
void _Slave_Ports_broadcast_POP(_Slave_Ports_queue_tasksT* _Slave_Ports_queue_tasks_LIST, int _Slave_Ports_queue_pop , _Slave_Port* _Slave_Ports, int LCDtim ) {
|
|
void _Slave_Ports_broadcast_POP(_Slave_Ports_queue_tasksT* _Slave_Ports_queue_tasks_LIST, int _Slave_Ports_queue_pop , _Slave_Port* _Slave_Ports, int LCDtim ) {
|
|
|
Serial.println("#251 _Slave_Ports_broadcast_POP");
|
|
Serial.println("#251 _Slave_Ports_broadcast_POP");
|
|
|
- int i;
|
|
|
|
|
- for(i=0;i<=100;i++) {
|
|
|
|
|
|
|
+ int i = 0;
|
|
|
|
|
+ // int count = Slave_Ports_Status_C.get_count() ;
|
|
|
|
|
+ //Slave_Ports_Status_S Slave_Ports_Status_A[1] ;
|
|
|
|
|
+ /* for(i=0;i<=10;i++) {
|
|
|
|
|
+ Slave_Ports_Status_S Slave_Ports_Status_AP = Slave_Ports_Status_C.get_port(i);
|
|
|
|
|
+ //i++;
|
|
|
|
|
+ // if( Slave_Ports_Status_A[i].Port_ID == 0 ) break;
|
|
|
|
|
+ Serial.print("#293 i[");
|
|
|
|
|
+ Serial.print(i); Serial.print("] Port_ID[");
|
|
|
|
|
+ Serial.print(Slave_Ports_Status_AP.Port_ID); Serial.print("] PortTypes[");
|
|
|
|
|
+ Serial.print(Slave_Ports_Status_AP.PortTypes); Serial.println("] ");
|
|
|
|
|
+ delay(5000);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ */
|
|
|
|
|
+ /*for(i=0;i<=100;i++) {
|
|
|
if(_Slave_Ports[i]._Protocol == "CAN") {
|
|
if(_Slave_Ports[i]._Protocol == "CAN") {
|
|
|
Serial.print(" ind:"); Serial.print(i); Serial.print("] Prot:");
|
|
Serial.print(" ind:"); Serial.print(i); Serial.print("] Prot:");
|
|
|
Serial.print(_Slave_Ports[i]._Protocol);
|
|
Serial.print(_Slave_Ports[i]._Protocol);
|
|
@@ -297,35 +310,78 @@ int _Slave_Ports_queue_task_type, int _Slave_Port_link, long time_seq_id, long t
|
|
|
Serial.print(" , Exp_state_ttl"); Serial.println(_Slave_Ports[i].Exp_state_ttl);
|
|
Serial.print(" , Exp_state_ttl"); Serial.println(_Slave_Ports[i].Exp_state_ttl);
|
|
|
|
|
|
|
|
|
|
|
|
|
- Serial.println(" Prepared data");
|
|
|
|
|
|
|
+ Serial.println("#299 Prepared data");
|
|
|
#if defined(HAS_LCD1602)
|
|
#if defined(HAS_LCD1602)
|
|
|
- String LCDarray1 = "P[";
|
|
|
|
|
- LCDarray1.concat(_Slave_Ports[i]._Protocol); LCDarray1.concat("] ID["); LCDarray1.concat(String(_Slave_Ports[i]._Slave_ID, HEX)); LCDarray1.concat("] T["); LCDarray1.concat(String(_Slave_Ports[i].PortTypes, HEX));
|
|
|
|
|
|
|
+ // String LCDarray1 = "P[";
|
|
|
|
|
+ LCD_print1(" Prepared data P[", LCDtim / 2);
|
|
|
|
|
+ Serial.println("#303");
|
|
|
|
|
+ LCD_print1(_Slave_Ports[i]._Protocol, LCDtim / 2);
|
|
|
|
|
+ Serial.println("#305");
|
|
|
|
|
+ // LCDarray1.concat(_Slave_Ports[i]._Protocol); LCDarray1.concat("] ID["); LCDarray1.concat(String(_Slave_Ports[i]._Slave_ID, HEX)); LCDarray1.concat("] T["); LCDarray1.concat(String(_Slave_Ports[i].PortTypes, HEX));
|
|
|
// lcd.print(LCDarray1);
|
|
// lcd.print(LCDarray1);
|
|
|
- String LCDarray2 = " >"; LCDarray2.concat(String(_Slave_Ports[i].Address, HEX)); LCDarray2.concat( "< {"); LCDarray2.concat( String(_Slave_Ports[i].LocalPort, HEX)); LCDarray2.concat( "} =[" ); LCDarray2.concat(String(_Slave_Ports[i].Exp_state, HEX) ); LCDarray2.concat("] ?[" ) ;
|
|
|
|
|
- LCDarray2.concat(String(_Slave_Ports[i].Exp_state_ttl, HEX)) ; LCDarray2.concat("]") ;
|
|
|
|
|
- LCD_print(LCDarray1, LCDarray2, LCDtim / 2 ) ;
|
|
|
|
|
|
|
+ // String LCDarray2 = " >"; LCDarray2.concat(String(_Slave_Ports[i].Address, HEX)); LCDarray2.concat( "< {"); LCDarray2.concat( String(_Slave_Ports[i].LocalPort, HEX)); LCDarray2.concat( "} =[" ); LCDarray2.concat(String(_Slave_Ports[i].Exp_state, HEX) ); LCDarray2.concat("] ?[" ) ;
|
|
|
|
|
+ // LCDarray2.concat(String(_Slave_Ports[i].Exp_state_ttl, HEX)) ; LCDarray2.concat("]") ;
|
|
|
|
|
+ // LCD_print(LCDarray1, LCDarray2, LCDtim / 2 ) ;
|
|
|
#endif
|
|
#endif
|
|
|
// (0) (1) (2) (3) (4) (5) (6)
|
|
// (0) (1) (2) (3) (4) (5) (6)
|
|
|
- byte data[8] = {_Slave_Ports[i].Address, 0x04, _Slave_Ports[i].LocalPort, _Slave_Ports[i].PortTypes, _Slave_Ports[i].LocalPort, _Slave_Ports[i].Exp_state, _Slave_Ports[i].Exp_state_ttl, 0x07};
|
|
|
|
|
- // byte data[8] = {element.Address, 0x04, element.LocalPort, element.PortTypes, element.LocalPort, element.Exp_state, element.Exp_state_ttl, 0x07};
|
|
|
|
|
- Serial.print("#303 byte data[8] 1["); Serial.print(_Slave_Ports[i].Address); Serial.print("] 2["); Serial.print(0x04); Serial.print("] 3[");
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_T _Slave_Ports_Protocol_CAN_broadcast_A;
|
|
|
|
|
+ // _Slave_Ports_Protocol_CAN_broadcast_A[1]._Slave_ID_BROADCAST = 0xFF;
|
|
|
|
|
+ // _Slave_Ports_Protocol_CAN_broadcast_A[1]._SENDER = Active_ControllerID ;
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_A.Port_ID = i ;
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_A.PortTypes = _Slave_Ports[i].PortTypes ;
|
|
|
|
|
+
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_A.Exp_state = _Slave_Ports[i].Exp_state ;
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_A.Exp_state_ttl = _Slave_Ports[i].Exp_state_ttl ;
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_A.Broadcast_state = _Slave_Ports[i].Broadcast_state ;
|
|
|
|
|
+ //_Slave_Ports_Protocol_CAN_broadcast_A[1]._CAN_8 = 0x07 ;
|
|
|
|
|
+
|
|
|
|
|
+ /* byte data[8] = { _Slave_Ports_Protocol_CAN_broadcast_A._Slave_ID_BROADCAST,
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_A._SENDER,
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_A.Port_ID,
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_A.PortTypes,
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_A.Exp_state,
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_A.Exp_state_ttl,
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_A.Broadcast_state,
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_A._CAN_8
|
|
|
|
|
+ } ;
|
|
|
|
|
+ //_Slave_Ports_Protocol_CAN_broadcast_AS _Slave_Ports_Protocol_CAN_broadcast_B[8];
|
|
|
|
|
+ //byte _Slave_Ports_Protocol_CAN_broadcast_B[8] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
|
|
|
|
|
+ byte _Slave_Ports_Protocol_CAN_broadcast_B[8] ;
|
|
|
|
|
+ _Slave_Ports_Protocol_CAN_broadcast_AF(_Slave_Ports_Protocol_CAN_broadcast_A, _Slave_Ports_Protocol_CAN_broadcast_B);
|
|
|
|
|
+ //byte data[8] = {_Slave_Ports[i].Address, 0x04, _Slave_Ports[i].LocalPort, _Slave_Ports[i].PortTypes, _Slave_Ports[i].LocalPort, _Slave_Ports[i].Exp_state, _Slave_Ports[i].Exp_state_ttl, 0x07};
|
|
|
|
|
+ //_Slave_Ports_Protocol_CAN_broadcast_AS data = _Slave_Ports_Protocol_CAN_broadcast_F(_Slave_Ports_Protocol_CAN_broadcast_A) ;
|
|
|
|
|
+ // byte data[8] = {element.Address, 0x04, element.LocalPort, element.PortTypes, element.LocalPort, element.Exp_state, element.Exp_state_ttl, 0x07};
|
|
|
|
|
+ // byte data[8] = { _Slave_Ports_Protocol_CAN_broadcast_A };
|
|
|
|
|
+ // _Slave_Ports_Protocol_CAN_broadcast_AS data = _Slave_Ports_Protocol_CAN_broadcast_AF(_Slave_Ports_Protocol_CAN_broadcast_A);
|
|
|
|
|
+ /* Serial.print("#303 byte data[8] 1["); Serial.print(_Slave_Ports[i].Address); Serial.print("] 2["); Serial.print(0x04); Serial.print("] 3[");
|
|
|
Serial.print(_Slave_Ports[i].LocalPort); Serial.print("] 4["); Serial.print(_Slave_Ports[i].PortTypes); Serial.print("] 5["); Serial.print(_Slave_Ports[i].Exp_state); Serial.print("] 6[");
|
|
Serial.print(_Slave_Ports[i].LocalPort); Serial.print("] 4["); Serial.print(_Slave_Ports[i].PortTypes); Serial.print("] 5["); Serial.print(_Slave_Ports[i].Exp_state); Serial.print("] 6[");
|
|
|
Serial.print( _Slave_Ports[i].Exp_state_ttl); Serial.print("] 7["); Serial.print(0x07); Serial.println("] ");
|
|
Serial.print( _Slave_Ports[i].Exp_state_ttl); Serial.print("] 7["); Serial.print(0x07); Serial.println("] ");
|
|
|
- byte sndStat = CAN0.sendMsgBuf(_Slave_Ports[i]._Slave_ID, 0, 8, data);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ Serial.print("#343 byte data[8] ");
|
|
|
|
|
+ // Serial.print((char)data);
|
|
|
|
|
+ Serial.println("]");
|
|
|
|
|
+ byte sndStat = CAN0.sendMsgBuf(_Slave_Ports[i]._Slave_ID, 0, 8, _Slave_Ports_Protocol_CAN_broadcast_B); //_Slave_Ports_Protocol_CAN_broadcast_A //data
|
|
|
// byte sndStat ;
|
|
// byte sndStat ;
|
|
|
if(sndStat == CAN_OK){
|
|
if(sndStat == CAN_OK){
|
|
|
- Serial.println("Message Sent Successfully!");
|
|
|
|
|
|
|
+ Serial.println("#349 Message Sent Successfully!");
|
|
|
String LCDarray1 = "Message Sent";
|
|
String LCDarray1 = "Message Sent";
|
|
|
String LCDarray2 = "Successfully";
|
|
String LCDarray2 = "Successfully";
|
|
|
|
|
+ #if defined(HAS_LCD1602)
|
|
|
|
|
+ LCD_print(LCDarray1,LCDarray2,LCDtim);
|
|
|
|
|
+ #endif
|
|
|
} else {
|
|
} else {
|
|
|
- Serial.println("Error Sending Message...");
|
|
|
|
|
|
|
+ Serial.println("#356 Error Sending Message...");
|
|
|
String LCDarray1 = "Error Sending";
|
|
String LCDarray1 = "Error Sending";
|
|
|
String LCDarray2 = "Message...";
|
|
String LCDarray2 = "Message...";
|
|
|
|
|
+ #if defined(HAS_LCD1602)
|
|
|
|
|
+ LCD_print(LCDarray1,LCDarray2,LCDtim);
|
|
|
|
|
+ #endif
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ /*
|
|
|
#if defined(HAS_LCD1602)
|
|
#if defined(HAS_LCD1602)
|
|
|
- LCD_print(LCDarray1,LCDarray2,LCDtim);
|
|
|
|
|
|
|
+ // LCD_print(LCDarray1,LCDarray2,LCDtim);
|
|
|
/*
|
|
/*
|
|
|
delay(LCDtim * 5);
|
|
delay(LCDtim * 5);
|
|
|
//lcd.setCursor(0,1);
|
|
//lcd.setCursor(0,1);
|
|
@@ -339,17 +395,18 @@ int _Slave_Ports_queue_task_type, int _Slave_Port_link, long time_seq_id, long t
|
|
|
else lcdPattern = "s" ;
|
|
else lcdPattern = "s" ;
|
|
|
}
|
|
}
|
|
|
lcdPos ++;
|
|
lcdPos ++;
|
|
|
- |*/
|
|
|
|
|
|
|
+ |
|
|
|
#endif
|
|
#endif
|
|
|
#if defined(HAS_TFT_ILI9163C)
|
|
#if defined(HAS_TFT_ILI9163C)
|
|
|
delay(LCDtim);
|
|
delay(LCDtim);
|
|
|
display.setCursor(0,60);
|
|
display.setCursor(0,60);
|
|
|
display.print(LCDarray1); display.print(" "); display.print(LCDarray2);
|
|
display.print(LCDarray1); display.print(" "); display.print(LCDarray2);
|
|
|
- #endif
|
|
|
|
|
|
|
+ #endif
|
|
|
|
|
+
|
|
|
|
|
|
|
|
- delay(5000); // send data per 100ms
|
|
|
|
|
|
|
+ delay(1000); // send data per 100ms
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -359,76 +416,9 @@ int _Slave_Ports_queue_task_type, int _Slave_Port_link, long time_seq_id, long t
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
|
|
|
|
- /*
|
|
|
|
|
- for (auto element: _Slave_Ports) {
|
|
|
|
|
- ind++;
|
|
|
|
|
- Serial.print(" ind:"); Serial.print(ind); Serial.print("] Prot:"); Serial.print(element._Protocol); Serial.print(" , ID:"); Serial.print(element._Slave_ID); Serial.print(" , PortTypes:");
|
|
|
|
|
- Serial.print(element.PortTypes); Serial.print(" , Addr:"); Serial.print(element.Address);
|
|
|
|
|
- Serial.print(" , Local:"); Serial.print(element.LocalPort);
|
|
|
|
|
- Serial.print(" , Exp state:"); Serial.print(element.Exp_state);
|
|
|
|
|
- Serial.print(" , Exp_state_ttl"); Serial.println(element.Exp_state_ttl);
|
|
|
|
|
- if(element._Protocol == "CAN") {
|
|
|
|
|
- Serial.println(" Prepared data");
|
|
|
|
|
- #if defined(HAS_LCD1602)
|
|
|
|
|
-
|
|
|
|
|
- String LCDarray1 = "P[";
|
|
|
|
|
- LCDarray1.concat(element._Protocol); LCDarray1.concat("] ID["); LCDarray1.concat(String(element._Slave_ID, HEX)); LCDarray1.concat("] T["); LCDarray1.concat(String(element.PortTypes, HEX));
|
|
|
|
|
- // lcd.print(LCDarray1);
|
|
|
|
|
- String LCDarray2 = " >"; LCDarray2.concat(String(element.Address, HEX)); LCDarray2.concat( "< {"); LCDarray2.concat( String(element.LocalPort, HEX)); LCDarray2.concat( "} =[" ); LCDarray2.concat(String(element.Exp_state, HEX) ); LCDarray2.concat("] ?[" ) ;
|
|
|
|
|
- LCDarray2.concat(String(element.Exp_state_ttl, HEX)) ; LCDarray2.concat("]") ;
|
|
|
|
|
- LCD_print(LCDarray1, LCDarray2, LCDtim / 2 ) ;
|
|
|
|
|
- #endif
|
|
|
|
|
- byte data[8] = {element.Address, 0x04, element.LocalPort, element.PortTypes, element.LocalPort, element.Exp_state, element.Exp_state_ttl, 0x07};
|
|
|
|
|
- // }
|
|
|
|
|
- byte sndStat = CAN0.sendMsgBuf(element._Slave_ID, 0, 8, data);
|
|
|
|
|
-
|
|
|
|
|
- if(sndStat == CAN_OK){
|
|
|
|
|
- Serial.println("Message Sent Successfully!");
|
|
|
|
|
- String LCDarray1 = "Message Sent";
|
|
|
|
|
- String LCDarray2 = "Successfully";
|
|
|
|
|
- } else {
|
|
|
|
|
- Serial.println("Error Sending Message...");
|
|
|
|
|
- String LCDarray1 = "Error Sending";
|
|
|
|
|
- String LCDarray2 = "Message...";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- #if defined(HAS_LCD1602)
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- delay(LCDtim * 5);
|
|
|
|
|
- //lcd.setCursor(0,1);
|
|
|
|
|
- lcd.print(lcdPattern);
|
|
|
|
|
- //lcd.print(lcdPos % 10);
|
|
|
|
|
- if(lcdPos >= 16) {
|
|
|
|
|
- //lcd.print("N");
|
|
|
|
|
- lcd.setCursor(0,1);
|
|
|
|
|
- lcdPos = 0;
|
|
|
|
|
- if(lcdPattern=="s") lcdPattern = "S" ;
|
|
|
|
|
- else lcdPattern = "s" ;
|
|
|
|
|
- }
|
|
|
|
|
- lcdPos ++;
|
|
|
|
|
- #endif
|
|
|
|
|
- #if defined(HAS_TFT_ILI9163C)
|
|
|
|
|
- delay(LCDtim);
|
|
|
|
|
- display.setCursor(0,60);
|
|
|
|
|
- display.print(LCDarray1); display.print(" "); display.print(LCDarray2);
|
|
|
|
|
- #endif
|
|
|
|
|
- delay(5000); // send data per 100ms
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }*/
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // byte sndStat = CAN0.sendMsgBuf(_Slave1_ID, 0, 8, data);
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
} //EOF _Slave_Ports_broadcast_POP
|
|
} //EOF _Slave_Ports_broadcast_POP
|
|
|
|
|
|
|
@@ -446,15 +436,18 @@ int _Slave_Ports_queue_task_type, int _Slave_Port_link, long time_seq_id, long t
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_Slave_Ports_queue_count > 0) {
|
|
if (_Slave_Ports_queue_count > 0) {
|
|
|
-
|
|
|
|
|
- String LCDarray1 = "`Slave_Ports_queue size [";
|
|
|
|
|
|
|
+ Serial.println("#472");
|
|
|
|
|
+ /* String LCDarray1 = "`Slave_Ports_queue size [";
|
|
|
|
|
+ Serial.println("#474");
|
|
|
LCDarray1.concat(_Slave_Ports_queue_count);
|
|
LCDarray1.concat(_Slave_Ports_queue_count);
|
|
|
- LCDarray1.concat("] Oldest[");
|
|
|
|
|
|
|
+ Serial.println("#476");
|
|
|
|
|
+ //LCDarray1.concat("] Oldest[");
|
|
|
|
|
+ Serial.println("#477");
|
|
|
LCDarray1.concat(_Slave_Ports_queue_pop);
|
|
LCDarray1.concat(_Slave_Ports_queue_pop);
|
|
|
-
|
|
|
|
|
|
|
+ Serial.println("#478");
|
|
|
LCDarray1.concat("] Curr[");
|
|
LCDarray1.concat("] Curr[");
|
|
|
LCDarray1.concat(_Slave_Ports_queue_front);
|
|
LCDarray1.concat(_Slave_Ports_queue_front);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
String LCDarray2 = "] last[";
|
|
String LCDarray2 = "] last[";
|
|
|
LCDarray2.concat(_Slave_Ports_queue_back);
|
|
LCDarray2.concat(_Slave_Ports_queue_back);
|
|
|
LCDarray2.concat("] Next[");
|
|
LCDarray2.concat("] Next[");
|
|
@@ -464,20 +457,24 @@ int _Slave_Ports_queue_task_type, int _Slave_Port_link, long time_seq_id, long t
|
|
|
Serial.print(LCDarray1);
|
|
Serial.print(LCDarray1);
|
|
|
Serial.println(LCDarray2);
|
|
Serial.println(LCDarray2);
|
|
|
LCD_print(LCDarray1, LCDarray2, LCDtim / 3 ) ;
|
|
LCD_print(LCDarray1, LCDarray2, LCDtim / 3 ) ;
|
|
|
-
|
|
|
|
|
|
|
+ */
|
|
|
if(_Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop].queueID == 0 and
|
|
if(_Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop].queueID == 0 and
|
|
|
_Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop].queueID == 0 and
|
|
_Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop].queueID == 0 and
|
|
|
_Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Ports_queue_task_type == 0 and
|
|
_Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Ports_queue_task_type == 0 and
|
|
|
_Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Port_link == 0 and
|
|
_Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Port_link == 0 and
|
|
|
_Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop].time_seq_id == 0 and
|
|
_Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop].time_seq_id == 0 and
|
|
|
_Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop].time_min_run == 0 ) {
|
|
_Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop].time_min_run == 0 ) {
|
|
|
- String LCDarray1 = "#206 Error with queue";
|
|
|
|
|
|
|
+ /* String LCDarray1 = "#206 Error with queue";
|
|
|
String LCDarray2 = "ID: ";
|
|
String LCDarray2 = "ID: ";
|
|
|
LCDarray2.concat( _Slave_Ports_queue_pop); LCDarray2.concat("] ");
|
|
LCDarray2.concat( _Slave_Ports_queue_pop); LCDarray2.concat("] ");
|
|
|
Serial.print(LCDarray1);
|
|
Serial.print(LCDarray1);
|
|
|
Serial.println(LCDarray2);
|
|
Serial.println(LCDarray2);
|
|
|
LCD_print(LCDarray1, LCDarray2, LCDtim / 3 ) ;
|
|
LCD_print(LCDarray1, LCDarray2, LCDtim / 3 ) ;
|
|
|
|
|
+ */
|
|
|
|
|
+ Serial.println("#507");
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ Serial.println("#509");
|
|
|
|
|
+ /*
|
|
|
String LCDarray1 = "#407 Running task";
|
|
String LCDarray1 = "#407 Running task";
|
|
|
String LCDarray2 = "ID: ";
|
|
String LCDarray2 = "ID: ";
|
|
|
LCDarray2.concat( _Slave_Ports_queue_pop); LCDarray2.concat("] task_type[");
|
|
LCDarray2.concat( _Slave_Ports_queue_pop); LCDarray2.concat("] task_type[");
|
|
@@ -487,7 +484,7 @@ int _Slave_Ports_queue_task_type, int _Slave_Port_link, long time_seq_id, long t
|
|
|
Serial.print(LCDarray1);
|
|
Serial.print(LCDarray1);
|
|
|
Serial.println(LCDarray2);
|
|
Serial.println(LCDarray2);
|
|
|
LCD_print(LCDarray1, LCDarray2, LCDtim / 3 ) ;
|
|
LCD_print(LCDarray1, LCDarray2, LCDtim / 3 ) ;
|
|
|
-
|
|
|
|
|
|
|
+ */
|
|
|
if( _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Ports_queue_task_type == 0x01 ) {
|
|
if( _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Ports_queue_task_type == 0x01 ) {
|
|
|
Serial.print("#224 running _Slave_Ports_ttl_decrement = "); Serial.println( _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Ports_queue_task_type);
|
|
Serial.print("#224 running _Slave_Ports_ttl_decrement = "); Serial.println( _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Ports_queue_task_type);
|
|
|
#include "_Slave_Ports_ttl_decrement.h"
|
|
#include "_Slave_Ports_ttl_decrement.h"
|
|
@@ -537,7 +534,9 @@ int _Slave_Ports_queue_task_type, int _Slave_Port_link, long time_seq_id, long t
|
|
|
Serial.print(_Slave_Ports_queue_back);
|
|
Serial.print(_Slave_Ports_queue_back);
|
|
|
Serial.print(" _Slave_Ports_queue.peek(): ");
|
|
Serial.print(" _Slave_Ports_queue.peek(): ");
|
|
|
Serial.println(_Slave_Ports_queue_peek);
|
|
Serial.println(_Slave_Ports_queue_peek);
|
|
|
- LCD_print(LCDarray1, LCDarray2, LCDtim / 3 ) ;
|
|
|
|
|
|
|
+ #if defined(HAS_LCD1602)
|
|
|
|
|
+ LCD_print(LCDarray1, LCDarray2, LCDtim / 3 ) ;
|
|
|
|
|
+ #endif
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|