P5_Automation_can-dev-res.ino 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. /* P5_Automation_can-dev
  2. * 2020-06 testing communications CAN for integrate further with Procesy5
  3. * A.Binder
  4. * Uses:
  5. * LCD1602 - big 2x16 character display
  6. * TFT_ILI9163C 128x128 lcd display
  7. * MCP_2515 - can port controller
  8. * //#define HAS_I2C_driver_Adafruit_PWMServoDriver
  9. * controls
  10. * Slave ports via:
  11. * I2C
  12. * PCA9685 - 16port 12bit PWM driver - can controll 16 eg. LEDs which can be 0....12V dimmed=]
  13. * todo 74HC595 - Serial to Parallel Shifting-Out - from 8 ports to many if connected in paraller
  14. * based on https://www.arduino.cc/en/tutorial/ShiftOut
  15. * or 16 servos
  16. * - can have addressed many of PCA9685 on I2C bus - so can controll over 64 ports
  17. * to be added another devices tested
  18. * todo Rottary Swich { GND, +, SW, DT, CLK } - to provide LCD menu access
  19. * TODO structure of port is in _Slave_Ports.h
  20. * _Slave_Port _Slave_Ports[] = {
  21. {"CAN", 0x102, 0x80, 0x00, 0, 0x00, 0x00 },
  22. {"CAN", - Base port origin protocol
  23. 0x102, - Base port origin protocol address
  24. 0x80, - int PortTypes; 0xFF = 1111 1111
  25. 0x01 = 0000 0001 = PWM port
  26. {
  27. bit 1 - PWM port
  28. bit 2 - not allocated
  29. bit 3 - not allocated
  30. bit 4 - not allocated
  31. bit 2 - not allocated
  32. bit 5 - not allocated
  33. bit 6 - not allocated
  34. bit 7 - not allocated
  35. bit 8 - not allocated
  36. },
  37. 0x00, int Address - local address on e.g. I2C bus - 0x40 etc
  38. 0x00, - int LocalPort - local port number when used e.g. I2C extension
  39. 0x01 - Exp_state - 0xFF = 1111 1111
  40. 0x00 = 0000 0000 = OFF = 0V
  41. 0x01 = 0000 0001 = ON = PWM max
  42. {
  43. bit 1 - OFF = 0V
  44. bit 2 - ON = PWM max
  45. bit 3 - not allocated
  46. bit 4 - not allocated
  47. bit 2 - not allocated
  48. bit 5 - not allocated
  49. bit 6 - not allocated
  50. bit 7 - not allocated
  51. bit 8 - not allocated
  52. },
  53. 0x6d - testowy ttl - 10 sekund do przedawnienia stanu portu w tablicy i koniecznosci odswiezenia tablicy
  54. }
  55. };
  56. - to be optimalized for inegration
  57. - to allow of subscribe ports
  58. - to allow of concurent routing
  59. - to allow new port detectioj
  60. - to allow creating ports dependencies e.g. IF
  61. - port has value
  62. - port AND port
  63. THEN
  64. - set port
  65. - probably should be avilable creations of virtual ports which would describe
  66. - state of port AND port etc...
  67. * TO BE INTEGRATED WITH p5
  68. * - interface and WFST
  69. * TO BE INGEGRATED WITH MARLIN 3D PRINTERS - machine and automation purpose
  70. * - controll remote ports via g-code
  71. * - allows interrupts
  72. * TO ALLOW OF NEXT PACKETS TYPES WITH DIFFERENT MEANINGS
  73. * - dimming
  74. * logic
  75. */
  76. //#define HAS_DEBUG_ACTION_TRIG
  77. //#define DEBUG_I2C //to debug _Slave_Ports_I2C_POP etc
  78. //#define HAS_TFT_ILI9163C
  79. //#define HAS_LCD1602
  80. //#define HAS_ROTTARY_SW
  81. //#define DEBUG_I2C_driver_Adafruit_PWMServoDriver
  82. //#define DEBUG_CAN
  83. //#define DEBUG_QUEUE
  84. //#define DEBUG_QUEUE_ASSERT
  85. //#define DEBUG_QUEUE_WAIT 500
  86. //#define DEBUG_STRUCT_INIT
  87. //#define DEBUG_STORAGE_QUEUE_TEST
  88. //#define DEBUG_ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE
  89. //#define DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK
  90. //#define HAS__PCINT_setup //to allow interrupts
  91. //#define DEBUG_TASK_TYPE_T_Slave_Ports_broadcast____
  92. //#define DEBUG_TASK_TYPE_T_DISPLAY_queue_pop________
  93. //#define DEBUG_TASK_TYPE_T_Slave_Ports_set_I2C______
  94. //#define DEBUG_QUEUE_ASSERT todo not working
  95. //#define DEBUG_LAST_ACTION_TRIG_ENABLE
  96. #define DISABLE_DISPLAY__add_record
  97. #define DISPLAY_array16_T_is_DISPLAY_string_T
  98. #define ENABLE_DISPLAY_MENU
  99. //#define DISABLE_ANY_PRINT //when uno ?
  100. #define __OFFSET 0
  101. #define Sprintln(a) (Serial.println(a))
  102. /*
  103. Then instead of
  104. Serial.println(F("Hello world!"));
  105. write
  106. Sprintln(F("Hello world!"));
  107. etc. To deactivate the Serial printing, define the macro empty:
  108. #define Sprintln(a)
  109. */
  110. #include "___CONFIG/config_Active_ControllerID.h" //there kleep id of device
  111. #define HAS__jm_Scheduler //to allow planned actions blink etc
  112. #if defined(HAS__jm_Scheduler)
  113. #include "jm_Scheduler.h"
  114. #endif
  115. //Debug level
  116. //#define DEBUG 5
  117. //#define DISABLE_LOOP //To debug and disable any output
  118. #include "___main/__main_struct.h"
  119. #include "___main/__main_trigger_struct.h"
  120. #include "___main/__main_struct_funct.h"
  121. #include "___main/__main_struct_limits.h"
  122. #include "_time_struct.h"
  123. #include "_DRIVER_STATUS/_DRIVER_STATUS_struct.h"
  124. #include "___main/__main_I2C_struc.h"
  125. #include "___main/__main_static.h"
  126. #include "___main/__main_auto.h"
  127. #include "___main/__main_register.h"
  128. #include "___main/__main_extern.h"
  129. #include "___template/__STORAGE_ARRAY_func.h" //testing
  130. #define _ControllerID 0x11
  131. #define _Slave1_ID 0x13
  132. //#include "Active_ControllerID_0x103.h"
  133. //#define Active_ControllerID _ControllerID
  134. //#define Active_ControllerID _Slave1_ID
  135. //#include "config_Slave_Ports_LOCAL_0x101_init.h" //there kleep config of this id device
  136. #define print_SEP_RT "]"
  137. #if defined(DEBUG)
  138. #define DPRINT(...) Serial.print(__VA_ARGS__)
  139. #define DPRINTLN(...) Serial.println(__VA_ARGS__)
  140. #define DRINTF(...) Serial.print(F(__VA_ARGS__))
  141. #define DPRINTLNF(...) Serial.println(F(__VA_ARGS__))
  142. DPRINTLN("#125 [DEBUG ENABLED]");
  143. //DPRINTLN(0xC0FFEEul,DEC);
  144. //DPRINTLN(12648430ul,HEX);
  145. #else
  146. #define DPRINT(...) //blank line
  147. #define DPRINTLN(...) //blank line
  148. #define DPRINTF(...) //blank line
  149. #define DPRINTLNF(...) //blank line
  150. #endif
  151. #if Active_ControllerID == 0x11
  152. const int Active_ControllerID_HEX = 0x11 ;
  153. #include "___CONFIG/0x11/config_Active_ControllerID_0x11.h"
  154. #endif
  155. #if Active_ControllerID == 0x13
  156. const int Active_ControllerID_HEX = 0x13 ;
  157. #include "___CONFIG/0x13/config_Active_ControllerID_0x13.h" //there kleep config of this id device
  158. #endif
  159. #if Active_ControllerID == 0x14
  160. const int Active_ControllerID_HEX = 0x14 ;
  161. #include "___CONFIG/0x14/config_Active_ControllerID_0x14.h" //there kleep config of this id device
  162. #endif
  163. #if defined(HAS_TFT_ILI9163C)
  164. #include "_TFT_ILI9163C_config.h"
  165. #endif
  166. #include "_DISPLAY_struct.h"
  167. #include "_Port_ID_sruct.h"
  168. #include "_TASK_TYPES_struct.h"
  169. #include "_Slave_Ports_Status_QUEUE_struct.h"
  170. //#include "Slave_Ports_Status_QUEUE.h"
  171. #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_struct.h"
  172. #include "_CAN/_CAN_config.h"
  173. #if defined(HAS_ROTTARY_SW)
  174. #include "_ROTTARY_SW/_ROTTARY_SW_config.h"
  175. #endif
  176. #if defined(HAS_I2C_driver_Adafruit_PWMServoDriver)
  177. #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_config.h"
  178. #endif
  179. #if defined(HAS_ROTTARY_SW)
  180. #include "_ROTTARY_SW/_ROTTARY_SW_struct.h"
  181. #endif
  182. #include "Queue.h"
  183. //#include "TPQ.h"
  184. Queue<int> _Slave_Ports_queue = Queue<int>(ARDUINO_ARRAY_INDEX_LIMIT_QUEUE);
  185. Queue<int> TEST_QUEUE = Queue<int>(ARDUINO_ARRAY_INDEX_LIMIT_QUEUE);
  186. #if Active_ControllerID == _ControllerID
  187. String lcdPattern = "s" ;
  188. #endif
  189. #if Active_ControllerID == _Slave1_ID
  190. String lcdPattern = "." ;
  191. #endif
  192. //BEGIN 1602
  193. #if defined(HAS_LCD1602)
  194. #include <LiquidCrystal.h>
  195. // initialize the library with the numbers of the interface pins
  196. //LiquidCrystal lcd(4, 6, 10, 11, 12, 13);
  197. //LiquidCrystal lcd(4, 6, 53, 51, 50, 52 );
  198. #include "_LCD1602_struct.h"
  199. // #include "_LCD1602_init.h"
  200. #endif
  201. //#if defined(HAS_TFT_ILI9163C)
  202. #include "_TFT_ILI9163C_struct.h"
  203. //#endif
  204. #if defined(HAS__PCINT_setup)
  205. #include "_PCINT/_PCINT_struct.h" //pins MYPIN1 MYPIN2 MYPIN3
  206. #endif
  207. //BEGIN CAN
  208. #include "_CAN/_CAN_init.h"
  209. //EOF CAN
  210. //REMOTE PORTS DEFINITIONS
  211. #include "_PortTypes_struct.h"
  212. #include "_PortStates_struct.h"
  213. #include "_Port_Exp_state_ttl_struct.h"
  214. #include "_Port_Broadcast_state_struct.h"
  215. #include "_Port_I2C_driver_struct.h"
  216. #include "_Slave_Ports_Status_struct.h"
  217. #include "_CAN/_Slave_Ports_Protocol_CAN_struct.h"
  218. #if defined(HAS_TFT_ILI9163C)
  219. #include "_TFT_ILI9163C_func.h"
  220. #endif
  221. #if defined(HAS_I2C_driver_Adafruit_PWMServoDriver)
  222. #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_func.h"
  223. #endif
  224. #include "_TASK_TYPES_func.h"
  225. #include "_Slave_Ports_Status_QUEUE_add_func.h"
  226. #include "_DISPLAY_add_record_func.h"
  227. #include "_DISPLAY_func.h"
  228. #if defined(HAS_LCD1602)
  229. #include "_LCD1602_func.h"
  230. //#include "_LCD1602_init.h"
  231. #endif
  232. #if defined(HAS_ROTTARY_SW)
  233. #include "_ROTTARY_SW/_ROTTARY_SW_func.h"
  234. #endif
  235. #include "_time_func.h"
  236. #include "_Slave_Ports_ttl_decrement_func.h"
  237. #include "_Slave_Ports_broadcast_func.h"
  238. #include "_Slave_Ports_I2C_func.h"
  239. #include "_Slave_Ports_action_func.h"
  240. #include "_DISPLAY_queue_pop_func.h"
  241. #include "_Slave_Ports_Status_QUEUE_func.h"
  242. #include "_Slave_Ports_Protocol_CAN_func.h"
  243. #include "_Slave_Ports_Status_func.h"
  244. #include "_CAN/_CAN_func.h"
  245. #include "_Slave_Ports.h"
  246. // #include "_Slave_Ports_ttl_decrement_POP.h"
  247. // #define _CAN_P_0x102_PWM0x00_0 { _Slave1_ID , "PWM", 0x00, 0 }
  248. //#define _CAN_P_0x102_PWMServoDriver0x40
  249. // #define Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver();
  250. // Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x40);
  251. // #define __CSpin 53 // 10 // chip select
  252. #if defined(HAS_LCD1602)
  253. #include "_LCD1602_init.h"
  254. #endif
  255. #if defined(HAS_TFT_ILI9163C)
  256. #include "_TFT_ILI9163C_init.h"
  257. #endif
  258. #include "_DISPLAY_init.h"
  259. #if defined(HAS_ROTTARY_SW)
  260. #include "_ROTTARY_SW/_ROTTARY_SW_init.h" //empty
  261. #endif
  262. #if defined(HAS__PCINT_setup)
  263. #include "_PCINT/_PCINT_init.h"
  264. #endif
  265. #include "___CONFIG/config_Slave_Ports_LOCAL_init.h"
  266. #if Active_ControllerID == 0x11
  267. #include "___CONFIG/0x11/config_Slave_Ports_LOCAL_0x11_init.h"
  268. #endif
  269. #if Active_ControllerID == 0x13
  270. #include "___CONFIG/0x13/config_Slave_Ports_LOCAL_0x13_init.h"
  271. #endif
  272. #if Active_ControllerID == 0x14
  273. #include "___CONFIG/0x14/config_Slave_Ports_LOCAL_0x14_init.h"
  274. #endif
  275. #if defined(HAS_I2C_driver_Adafruit_PWMServoDriver)
  276. #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_init.h"
  277. #endif
  278. #include "___main/__main_init.h"
  279. #ifdef DISABLE_LOOP
  280. #include "___DEBUG/___DEBUG_DISABLE_INIT.h"
  281. #endif
  282. void setup() { //REMEMBER NOT INITIALIZE ANY VARIABLES OR ARRAYS
  283. Serial.begin(115200);
  284. #if defined(DEBUG) || defined(DEBUG_QUEUE)
  285. Serial.println("#329 Serial.begin(115200)");
  286. #endif
  287. // Serial.begin(9600);
  288. // Serial.println("#233 setup" );
  289. // _LCD_print_queue.push(1);
  290. // _LCD_print_queue.push(2);
  291. // _LCD_print_queue.push(3);
  292. //String character = "Geas";
  293. //char b = abc.charAt(0);
  294. //int b_ascii_value = b;
  295. // LCD_print_background_add( _LCD_print_buffors, 0, 0, 0, "W", 5000, 6000);
  296. // LCD_print_background_add( _LCD_print_buffors, 1, 0, 0, "H", 5000, 6000);
  297. // LCD_print_background_add( _LCD_print_buffors, 2, 0, 0, "W", 5000, 6000);
  298. // LCD_print_background_add( _LCD_print_buffors, 3, 0, 0, "K", 5000, 6000);
  299. //todo PCINT service
  300. #if defined(DISABLE_LOOP) || defined(DEBUG)
  301. Serial.println("#375 will include ___main/__main_I2C_setup.h");
  302. #endif
  303. #include "___main/__main_I2C_setup.h"
  304. #if defined(HAS__PCINT_setup)
  305. #include "_PCINT/_PCINT_setup.h" //empty
  306. #endif
  307. #if defined(HAS_ROTTARY_SW)
  308. #include "_ROTTARY_SW/_ROTTARY_SW_setup.h" //Attach interrupts
  309. #endif
  310. /* TODO
  311. String LCDarray1="CAN_1602_LCD "; //the string to print onthe LCD
  312. String LCDarray2="Testing id "; //the string to print onthe LCD
  313. LCDarray2.concat(String(Active_ControllerID, HEX) ) ;
  314. */
  315. #if defined(HAS_I2C_driver_Adafruit_PWMServoDriver)
  316. #if defined(DISABLE_LOOP) || defined(DEBUG) || defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
  317. Serial.println("#401 will include /_I2C_driver_Adafruit_PWMServoDriver_setup.h");
  318. #endif
  319. #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_setup.h"
  320. #endif
  321. // put your setup code here, to run once:
  322. #if defined(HAS_LCD1602)
  323. #include "_LCD1602_setup.h"
  324. #endif
  325. #if defined(HAS_TFT_ILI9163C)
  326. #include "_TFT_ILI9163C_setup.h"
  327. #endif
  328. //BEGIN CAN
  329. #include "_CAN/_CAN_setup.h"
  330. #if defined(HAS_LCD1602)
  331. /* todo
  332. LCDarray1 = "loop.... ";
  333. LCDarray2 = "....";
  334. LCD_print(LCDarray1, LCDarray2, LCDtim/10);
  335. */
  336. #endif
  337. #ifndef DISABLE_LOOP
  338. #include "___main/__main_setup.h"
  339. #endif
  340. #ifdef DISABLE_LOOP
  341. #include "___DEBUG/___DEBUG_DISABLE_SETUP.h"
  342. #endif
  343. }
  344. //#if Active_ControllerID == _ControllerID
  345. // byte data[8] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
  346. //#endif
  347. //String LCDarray1 ;
  348. //String LCDarray2 ;
  349. unsigned long time;
  350. #include "___loop/_LOOP_LATENCY_COUNTER.h"
  351. void loop() {
  352. register long time;
  353. time = millis();
  354. #include "___loop/___loop_init.h"
  355. #if defined(HAS__PCINT_setup)
  356. #include "_PCINT/_PCINT_loop.h"
  357. #endif
  358. #if defined(HAS_ROTTARY_SW)
  359. #include "_ROTTARY_SW/_ROTTARY_SW_loop.h"
  360. #endif
  361. #ifdef DISABLE_LOOP
  362. #include "___DEBUG/___DEBUG_DISABLE_LOOP.h"
  363. #endif
  364. #include "___loop/__main_loop_top.h"
  365. if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END(ARDUINO_LOOP_LATENCY__MAIN_END_A, ARDUINO_LOOP_LATENCY_CONTROL_FLAG_NONE) <= ARDUINO_LOOP_LATENCY_COUNTER_INIT ) {
  366. #if defined(DEBUG)
  367. #ifndef DISABLE_LOOP
  368. if(DEBUG_ACTION_TRIG == 1) Serial.print("] Time: " ); Serial.println(time);
  369. #endif
  370. #endif
  371. if(DEBUG_ACTION_TRIG == 1 or (time % 100000 == 0)) {
  372. #if defined(DEBUG_ACTION_TRIG_ENABLE)
  373. Serial.print("Time: " ); Serial.println(time);
  374. #endif
  375. }
  376. #ifndef DISABLE_LOOP
  377. if(DEBUG_ACTION_TRIG == 1) {
  378. #if defined(DEBUG)
  379. Serial.print("#331_L1 main loop top ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init ");
  380. Serial.println(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
  381. Serial.print("#331_L2 main loop top ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init=[");
  382. Serial.println(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
  383. Serial.print(" true["); Serial.print(true); Serial.print("] false["); Serial.print(false);
  384. Serial.println("] ");
  385. #endif
  386. }
  387. #if defined(DEBUG_DISPLAY)
  388. Serial.print("#532 Will TODO bug when too many mesgs to queue ..DISPLAY_pos_seq_T[");
  389. Serial.print(DISPLAY_pos_seq_A_NEXT , BIN); Serial.print("]+[ "); Serial.print(DISPLAY_pos_seq_A_IMMEDIATE , BIN); Serial.print("] ==[ "); Serial.print(DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE , BIN);
  390. Serial.print("] DISPLAY_TARGET_T 128["); Serial.print(DISPLAY_TARGET_DISPLAY128, BIN);Serial.print("] bin[");
  391. Serial.println("] ");
  392. #endif
  393. Slave_Ports_Status__DISPLAY_TARGET(
  394. Slave_Ports_Status_A ,
  395. Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
  396. 0 ,
  397. DISPLAY_A ,
  398. DISPLAY_T_ARDUINO_ATTR_ARRAY_A ,
  399. DISPLAY_PHYSICAL_CHAR_A,
  400. DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE ,
  401. "PORTS [" ,
  402. DISPLAY_TARGET_DISPLAY128,
  403. time,
  404. time + ARDUINO_time_seq_id_A_INCREMENT
  405. //queue
  406. ,Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
  407. TASK_TYPE_T__EMPTY__JUST_PASSED_ARG__,
  408. TASK_PORT_ASSOC_EMPTY
  409. );
  410. #else
  411. #include "___DEBUG/___DEBUG_DISABLE_LOOP_MAIN_A.h"
  412. #endif
  413. }
  414. // Serial.println(time);
  415. #include "___loop/_SlaveID_loop1.h" //todo PCINT
  416. #include "___loop/_ControllerID_loop1.h" //todo make default
  417. #include "___loop/__main_loop_end.h"
  418. // DISPLAY_DEV.setCursor(10,10);
  419. // DISPLAY_DEV.print(" Test307");
  420. /*
  421. DISPLAY__print_ANY(
  422. DISPLAY_T_ARDUINO_ATTR_ARRAY_A ,
  423. DISPLAY_PHYSICAL_CHAR_A,
  424. DISPLAY_pos_seq_A_NEXT,
  425. "123456789012345678901234567890"
  426. ); */
  427. //delay(10);
  428. if(DEBUG_ACTION_TRIG != DEBUG_LAST_ACTION_TRIG) {
  429. #if defined(DEBUG_LAST_ACTION_TRIG_ENABLE)
  430. Serial.print("#534 DEBUG_ACTION_TRIG[");Serial.print(DEBUG_ACTION_TRIG);Serial.print("] "); Serial.print("] LAST_DEBUG_ACTION_TRIG[");Serial.print(DEBUG_LAST_ACTION_TRIG);Serial.println("] ");
  431. #endif
  432. // Serial.print("] COUNTER__MAIN_A["); Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A);
  433. // Serial.print("] COUNTER__MAIN_END_A["); Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A);
  434. }
  435. DEBUG_LAST_ACTION_TRIG = DEBUG_ACTION_TRIG ;
  436. }
  437. #include "_PCINT/_PCINT_func_loop.h" //todo empty implement display etc
  438. #include "_Slave_Ports_func_loop.h" //todo implement