|
|
@@ -1,7 +1,7 @@
|
|
|
#include "_Slave_Ports_ttl_decrement.h"
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+//#include "_Slave_Ports_Protocol.h"
|
|
|
+#include "Slave_Ports_Status_QUEUE.h"
|
|
|
+//#include "Slave_Ports_Status_S.h"
|
|
|
|
|
|
typedef struct {
|
|
|
const char * const _Protocol;
|
|
|
@@ -52,8 +52,9 @@ _Slave_Port _Slave_Ports[] = {
|
|
|
//{"CAN", 0x102, 0x01, 0x00, 0x01, 0xFF, 0x6d } //testowy ttl
|
|
|
};
|
|
|
*/
|
|
|
-#include "_Slave_Ports_LOCAL.h"
|
|
|
-#include "_Slave_Ports_queue_task_type_LIST.h"
|
|
|
+//#include "_Slave_Ports_LOCAL.h"
|
|
|
+//#include "_Slave_Ports_queue_task_type_LIST.h"
|
|
|
+#include "Slave_Ports_Status_QUEUE.h"
|
|
|
|
|
|
|
|
|
struct _Slave_Ports_queue_tasksS {
|
|
|
@@ -95,29 +96,16 @@ 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
|
|
|
- /* 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 == 0x03) res=0x99; //res="request_set_new_Exp_state";
|
|
|
- else {
|
|
|
- res=0x99; // res="_UNKNOIWN";
|
|
|
- Serial.print("#82 Get ["); Serial.print(_Slave_Ports_queue_task_type); Serial.println("] #82 [U] ");
|
|
|
- }
|
|
|
- *//*
|
|
|
- // char return_i;
|
|
|
- Serial.print("=["); Serial.print(_Slave_Ports_queue_task_type); Serial.print("] ");
|
|
|
- if(_Slave_Ports_queue_task_type == 0x01) Serial.print("_Slave_Ports_ttl_decrement"); // return "_Slave_Ports_ttl_decrement";
|
|
|
- else if(_Slave_Ports_queue_task_type == 0x02) Serial.print("request_confirm_Exp_state"); //return "request_confirm_Exp_state";
|
|
|
- else if(_Slave_Ports_queue_task_type == 0x03) Serial.print("request_set_new_Exp_state"); //return "request_set__new_Exp_state";
|
|
|
- else //return_i = "_UNKNOIWN"; //return "_UNKNOIWN";
|
|
|
- Serial.print("_UNKNOIWN");
|
|
|
-// Serial.print((String)return_i);
|
|
|
-// return return_i ;
|
|
|
-*/
|
|
|
- //Serial.print(_Slave_Ports_queue_task_type[_Slave_Ports_queue_task_type]);
|
|
|
- return _Slave_Ports_queue_task_type_LIST[_Slave_Ports_queue_task_type];
|
|
|
- // String ret = "aaaaxxx";
|
|
|
- //return ret;
|
|
|
+void _Slave_Ports_queue_task_type_DESC( int _Slave_Ports_queue_task_type ) {//, int* res
|
|
|
+ if(_Slave_Ports_queue_task_type == TASK_TYPE_T_NOT_USED_________________) {
|
|
|
+ Serial.println("TASK_TYPE_T_NOT_USED_________________");
|
|
|
+ } else if(_Slave_Ports_queue_task_type == TASK_TYPE_T_Slave_Ports_ttl_decrement) { Serial.println("TASK_TYPE_T_Slave_Ports_ttl_decrement");
|
|
|
+ } else if(_Slave_Ports_queue_task_type == TASK_TYPE_T_request_confirm_Exp_state) { Serial.println("TASK_TYPE_T_request_confirm_Exp_state");
|
|
|
+ } else if(_Slave_Ports_queue_task_type == TASK_TYPE_T_request_set_new_Exp_state) { Serial.println("TASK_TYPE_T_request_set_new_Exp_state");
|
|
|
+ } else if(_Slave_Ports_queue_task_type == TASK_TYPE_T_Slave_Ports_broadcast____) { Serial.println("TASK_TYPE_T_Slave_Ports_broadcast____");
|
|
|
+ } else if(_Slave_Ports_queue_task_type == TASK_TYPE_T_Slave_Ports_set_I2C______) { Serial.println("TASK_TYPE_T_Slave_Ports_set_I2C______");
|
|
|
+ } else { Serial.println("106 unknown _Slave_Ports_queue_task_type");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -145,9 +133,9 @@ 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);
|
|
|
//char 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));
|
|
|
- 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(" - map["); Serial.print(_Slave_Ports_queue_task_type_LIST[_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
|
|
|
|
|
|
|
|
|
Serial.print("] _Slave_Port_link: ");
|
|
|
@@ -236,51 +224,7 @@ int _Slave_Ports_queue_task_type, int _Slave_Port_link, long time_seq_id, long t
|
|
|
*/
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- void _Slave_Ports_ttl_decrement_POP(_Slave_Ports_queue_tasksT* _Slave_Ports_queue_tasks_LIST,int _Slave_Ports_queue_pop , _Slave_Port* _Slave_Ports) {
|
|
|
- Serial.print("#213 _Slave_Ports_ttl_decrement_POP. sizeof _Slave_Ports["); Serial.print(sizeof(_Slave_Ports));
|
|
|
- int i;
|
|
|
- for(i=0;i<=100;i++) {
|
|
|
- if(_Slave_Ports[i]._Protocol == "CAN") {
|
|
|
- if(_Slave_Ports[i].Exp_state_ttl > 0x00 ) {
|
|
|
- Serial.print("#217 ttl min for: Prot["); Serial.print(_Slave_Ports[i]._Protocol); Serial.print("] ttl["); Serial.print(_Slave_Ports[i].Exp_state_ttl); Serial.print(" id["); Serial.print(i); Serial.println("] ");
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /*
|
|
|
- const char * const _Protocol;
|
|
|
- int _Slave_ID;
|
|
|
- int PortTypes; //0xFF = 1111 1111 { PWM, .....} = 0x80
|
|
|
- // byte has_Address;
|
|
|
- int Address ;
|
|
|
- // byte has_Local_Port;
|
|
|
- int LocalPort;
|
|
|
- int Exp_state; /*0xFF = 1111 1111
|
|
|
- 0x00 = 0000 0000 = OFF = 0V
|
|
|
- 0x01 = 0000 0001 = ON = PWM max
|
|
|
- {
|
|
|
- bit 1 - OFF = 0V
|
|
|
- bit 2 - ON = PWM max
|
|
|
- bit 3 - not allocated
|
|
|
- bit 4 - not allocated
|
|
|
- bit 2 - not allocated
|
|
|
- bit 5 - not allocated
|
|
|
- bit 6 - not allocated
|
|
|
- bit 7 - not allocated
|
|
|
- bit 8 - not allocated
|
|
|
-
|
|
|
- int Exp_state_ttl; // 0x00 = odswiezyc
|
|
|
-
|
|
|
- */
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+#include "_Slave_Ports_ttl_decrement_POP.h"
|
|
|
|
|
|
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");
|