P5_Automation_can-dev-res.ino 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  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 HAS__PCINT_setup //to allow interrupts
  90. #define HAS__jm_Scheduler //to allow planned actions blink etc
  91. #if defined(HAS__jm_Scheduler)
  92. #include "jm_Scheduler.h"
  93. #endif
  94. //Debug level
  95. //#define DEBUG 5
  96. //#define DISABLE_LOOP //To debug and disable any output
  97. #include "___main/__main_struct.h"
  98. #include "___main/__main_trigger_struct.h"
  99. #include "___main/__main_struct_funct.h"
  100. #include "___main/__main_struct_limits.h"
  101. #include "_time_struct.h"
  102. #include "_DRIVER_STATUS/_DRIVER_STATUS_struct.h"
  103. #include "___main/__main_I2C_struc.h"
  104. #include "___main/__main_static.h"
  105. #include "___main/__main_auto.h"
  106. #include "___main/__main_register.h"
  107. #include "___main/__main_extern.h"
  108. #include "___template/__STORAGE_ARRAY_func.h" //testing
  109. #define _ControllerID 0x101
  110. #define _Slave1_ID 0x103
  111. //#include "Active_ControllerID_0x103.h"
  112. //#define Active_ControllerID _ControllerID
  113. //#define Active_ControllerID _Slave1_ID
  114. #include "___CONFIG/config_Active_ControllerID.h" //there kleep id of device
  115. //#include "config_Slave_Ports_LOCAL_0x101_init.h" //there kleep config of this id device
  116. #if defined(DEBUG)
  117. #define DPRINT(...) Serial.print(__VA_ARGS__)
  118. #define DPRINTLN(...) Serial.println(__VA_ARGS__)
  119. #define DRINTF(...) Serial.print(F(__VA_ARGS__))
  120. #define DPRINTLNF(...) Serial.println(F(__VA_ARGS__))
  121. DPRINTLN("#125 [DEBUG ENABLED]");
  122. //DPRINTLN(0xC0FFEEul,DEC);
  123. //DPRINTLN(12648430ul,HEX);
  124. #else
  125. #define DPRINT(...) //blank line
  126. #define DPRINTLN(...) //blank line
  127. #define DPRINTF(...) //blank line
  128. #define DPRINTLNF(...) //blank line
  129. #endif
  130. #if Active_ControllerID == 0x101
  131. #include "___CONFIG/0x101/config_Active_ControllerID_0x101.h"
  132. #endif
  133. #if Active_ControllerID == 0x103
  134. #include "___CONFIG/0x103/config_Active_ControllerID_0x103.h" //there kleep config of this id device
  135. #endif
  136. #if defined(HAS_TFT_ILI9163C)
  137. #include "_TFT_ILI9163C_config.h"
  138. #endif
  139. #include "_DISPLAY_struct.h"
  140. #include "_Port_ID_sruct.h"
  141. #include "_TASK_TYPES_struct.h"
  142. #include "_Slave_Ports_Status_QUEUE_struct.h"
  143. //#include "Slave_Ports_Status_QUEUE.h"
  144. #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_struct.h"
  145. #include "_CAN/_CAN_config.h"
  146. #if defined(HAS_ROTTARY_SW)
  147. #include "_ROTTARY_SW/_ROTTARY_SW_config.h"
  148. #endif
  149. #if defined(HAS_I2C_driver_Adafruit_PWMServoDriver)
  150. #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_config.h"
  151. #endif
  152. #if defined(HAS_ROTTARY_SW)
  153. #include "_ROTTARY_SW/_ROTTARY_SW_struct.h"
  154. #endif
  155. #include "Queue.h"
  156. //#include "TPQ.h"
  157. Queue<int> _Slave_Ports_queue = Queue<int>(ARDUINO_ARRAY_INDEX_LIMIT_QUEUE);
  158. Queue<int> TEST_QUEUE = Queue<int>(ARDUINO_ARRAY_INDEX_LIMIT_QUEUE);
  159. #if Active_ControllerID == _ControllerID
  160. String lcdPattern = "s" ;
  161. #endif
  162. #if Active_ControllerID == _Slave1_ID
  163. String lcdPattern = "." ;
  164. #endif
  165. //BEGIN 1602
  166. #if defined(HAS_LCD1602)
  167. #include <LiquidCrystal.h>
  168. // initialize the library with the numbers of the interface pins
  169. //LiquidCrystal lcd(4, 6, 10, 11, 12, 13);
  170. //LiquidCrystal lcd(4, 6, 53, 51, 50, 52 );
  171. #include "_LCD1602_struct.h"
  172. // #include "_LCD1602_init.h"
  173. #endif
  174. //#if defined(HAS_TFT_ILI9163C)
  175. #include "_TFT_ILI9163C_struct.h"
  176. //#endif
  177. #if defined(HAS__PCINT_setup)
  178. #include "_PCINT/_PCINT_struct.h" //pins MYPIN1 MYPIN2 MYPIN3
  179. #endif
  180. //BEGIN CAN
  181. #include "_CAN/_CAN_init.h"
  182. //EOF CAN
  183. //REMOTE PORTS DEFINITIONS
  184. #include "_PortTypes_struct.h"
  185. #include "_PortStates_struct.h"
  186. #include "_Port_Exp_state_ttl_struct.h"
  187. #include "_Port_Broadcast_state_struct.h"
  188. #include "_Port_I2C_driver_struct.h"
  189. #include "_Slave_Ports_Status_struct.h"
  190. #include "_CAN/_Slave_Ports_Protocol_CAN_struct.h"
  191. #if defined(HAS_TFT_ILI9163C)
  192. #include "_TFT_ILI9163C_func.h"
  193. #endif
  194. #if defined(HAS_I2C_driver_Adafruit_PWMServoDriver)
  195. #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_func.h"
  196. #endif
  197. #include "_TASK_TYPES_func.h"
  198. #include "_Slave_Ports_Status_QUEUE_add_func.h"
  199. #include "_DISPLAY_add_record_func.h"
  200. #include "_DISPLAY_func.h"
  201. #if defined(HAS_LCD1602)
  202. #include "_LCD1602_func.h"
  203. //#include "_LCD1602_init.h"
  204. #endif
  205. #include "_CAN/_CAN_func.h"
  206. #if defined(HAS_ROTTARY_SW)
  207. #include "_ROTTARY_SW/_ROTTARY_SW_func.h"
  208. #endif
  209. #include "_time_func.h"
  210. #include "_Slave_Ports_ttl_decrement_func.h"
  211. #include "_Slave_Ports_broadcast_func.h"
  212. #include "_Slave_Ports_I2C_func.h"
  213. #include "_DISPLAY_queue_pop_func.h"
  214. #include "_Slave_Ports_Status_QUEUE_func.h"
  215. #include "_Slave_Ports_Protocol_CAN_func.h"
  216. #include "_Slave_Ports_Status_func.h"
  217. #include "_Slave_Ports.h"
  218. // #include "_Slave_Ports_ttl_decrement_POP.h"
  219. // #define _CAN_P_0x102_PWM0x00_0 { _Slave1_ID , "PWM", 0x00, 0 }
  220. //#define _CAN_P_0x102_PWMServoDriver0x40
  221. // #define Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver();
  222. // Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x40);
  223. // #define __CSpin 53 // 10 // chip select
  224. #if defined(HAS_LCD1602)
  225. #include "_LCD1602_init.h"
  226. #endif
  227. #if defined(HAS_TFT_ILI9163C)
  228. #include "_TFT_ILI9163C_init.h"
  229. #endif
  230. #include "_DISPLAY_init.h"
  231. #if defined(HAS_ROTTARY_SW)
  232. #include "_ROTTARY_SW/_ROTTARY_SW_init.h" //empty
  233. #endif
  234. #if defined(HAS__PCINT_setup)
  235. #include "_PCINT/_PCINT_init.h"
  236. #endif
  237. #include "___CONFIG/config_Slave_Ports_LOCAL_init.h"
  238. #if Active_ControllerID == 0x101
  239. #include "___CONFIG/0x101/config_Slave_Ports_LOCAL_0x101_init.h"
  240. #endif
  241. #if Active_ControllerID == 0x103
  242. #include "___CONFIG/0x103/config_Slave_Ports_LOCAL_0x103_init.h"
  243. #endif
  244. #if defined(HAS_I2C_driver_Adafruit_PWMServoDriver)
  245. #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_init.h"
  246. #endif
  247. #include "___main/__main_init.h"
  248. #ifdef DISABLE_LOOP
  249. #include "___DEBUG/___DEBUG_DISABLE_INIT.h"
  250. #endif
  251. void setup() { //REMEMBER NOT INITIALIZE ANY VARIABLES OR ARRAYS
  252. Serial.begin(115200);
  253. #if defined(DEBUG) || defined(DEBUG_QUEUE)
  254. Serial.println("#329 Serial.begin(115200)");
  255. #endif
  256. // Serial.begin(9600);
  257. // Serial.println("#233 setup" );
  258. // _LCD_print_queue.push(1);
  259. // _LCD_print_queue.push(2);
  260. // _LCD_print_queue.push(3);
  261. //String character = "Geas";
  262. //char b = abc.charAt(0);
  263. //int b_ascii_value = b;
  264. // LCD_print_background_add( _LCD_print_buffors, 0, 0, 0, "W", 5000, 6000);
  265. // LCD_print_background_add( _LCD_print_buffors, 1, 0, 0, "H", 5000, 6000);
  266. // LCD_print_background_add( _LCD_print_buffors, 2, 0, 0, "W", 5000, 6000);
  267. // LCD_print_background_add( _LCD_print_buffors, 3, 0, 0, "K", 5000, 6000);
  268. //todo PCINT service
  269. #if defined(DISABLE_LOOP) || defined(DEBUG)
  270. Serial.println("#375 will include ___main/__main_I2C_setup.h");
  271. #endif
  272. #include "___main/__main_I2C_setup.h"
  273. #if defined(HAS__PCINT_setup)
  274. #include "_PCINT/_PCINT_setup.h" //empty
  275. #endif
  276. #if defined(HAS_ROTTARY_SW)
  277. #include "_ROTTARY_SW/_ROTTARY_SW_setup.h" //Attach interrupts
  278. #endif
  279. /* TODO
  280. String LCDarray1="CAN_1602_LCD "; //the string to print onthe LCD
  281. String LCDarray2="Testing id "; //the string to print onthe LCD
  282. LCDarray2.concat(String(Active_ControllerID, HEX) ) ;
  283. */
  284. #if defined(HAS_I2C_driver_Adafruit_PWMServoDriver)
  285. #if defined(DISABLE_LOOP) || defined(DEBUG) || defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
  286. Serial.println("#401 will include /_I2C_driver_Adafruit_PWMServoDriver_setup.h");
  287. #endif
  288. #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_setup.h"
  289. #endif
  290. // put your setup code here, to run once:
  291. #if defined(HAS_LCD1602)
  292. #include "_LCD1602_setup.h"
  293. #endif
  294. #if defined(HAS_TFT_ILI9163C)
  295. #include "_TFT_ILI9163C_setup.h"
  296. #endif
  297. //BEGIN CAN
  298. #include "_CAN/_CAN_setup.h"
  299. #if defined(HAS_LCD1602)
  300. /* todo
  301. LCDarray1 = "loop.... ";
  302. LCDarray2 = "....";
  303. LCD_print(LCDarray1, LCDarray2, LCDtim/10);
  304. */
  305. #endif
  306. #ifndef DISABLE_LOOP
  307. #include "___main/__main_setup.h"
  308. #endif
  309. #ifdef DISABLE_LOOP
  310. #include "___DEBUG/___DEBUG_DISABLE_SETUP.h"
  311. #endif
  312. }
  313. //#if Active_ControllerID == _ControllerID
  314. // byte data[8] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
  315. //#endif
  316. //String LCDarray1 ;
  317. //String LCDarray2 ;
  318. unsigned long time;
  319. ARDUINO_LOOP_LATENCY_T ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END( ARDUINO_LOOP_LATENCY_T
  320. ARDUINO_LOOP_LATENCY__MAIN_END_A) {
  321. static ARDUINO_LOOP_LATENCY_COUNTER_T ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A = ARDUINO_LOOP_LATENCY__MAIN_END_A;
  322. if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A == 0 ) {
  323. ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A = ARDUINO_LOOP_LATENCY__MAIN_END_A;
  324. #if defined(DEBUG)
  325. Serial.print("] COUNTER__MAIN_END_A["); Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A); Serial.print("] C["); Serial.print(ARDUINO_LOOP_LATENCY__MAIN_END_A); Serial.println("] ");
  326. #endif
  327. } else {
  328. return ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A-- ;
  329. }
  330. }
  331. ARDUINO_LOOP_LATENCY_T ARDUINO_LOOP_LATENCY_COUNTER__MAIN( ARDUINO_LOOP_LATENCY_T
  332. ARDUINO_LOOP_LATENCY__MAIN_A) {
  333. static ARDUINO_LOOP_LATENCY_COUNTER_T ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A = ARDUINO_LOOP_LATENCY__MAIN_A;
  334. if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A == 0 ) {
  335. #if defined(DEBUG)
  336. Serial.print("] COUNTER__MAIN_A["); Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A); Serial.print("] C["); Serial.print(ARDUINO_LOOP_LATENCY__MAIN_A); Serial.println("] ");
  337. #endif
  338. ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A = ARDUINO_LOOP_LATENCY__MAIN_A;
  339. } else {
  340. return ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A-- ;
  341. }
  342. }
  343. void loop() {
  344. register long time;
  345. time = millis();
  346. #include "___loop/___loop_init.h"
  347. #if defined(HAS__PCINT_setup)
  348. #include "_PCINT/_PCINT_loop.h"
  349. #endif
  350. #if defined(HAS_ROTTARY_SW)
  351. #include "_ROTTARY_SW/_ROTTARY_SW_loop.h"
  352. #endif
  353. #ifdef DISABLE_LOOP
  354. #include "___DEBUG/___DEBUG_DISABLE_LOOP.h"
  355. #endif
  356. #include "___loop/__main_loop_top.h"
  357. if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END(ARDUINO_LOOP_LATENCY__MAIN_END_A) <= ARDUINO_LOOP_LATENCY_COUNTER_INIT ) {
  358. #if defined(DEBUG)
  359. #ifndef DISABLE_LOOP
  360. if(DEBUG_ACTION_TRIG == 1) Serial.print("] Time: " ); Serial.println(time);
  361. #endif
  362. #endif
  363. if(DEBUG_ACTION_TRIG == 1 or (time % 100000 == 0)) {
  364. Serial.print("Time: " ); Serial.println(time);
  365. }
  366. #ifndef DISABLE_LOOP
  367. if(DEBUG_ACTION_TRIG == 1) {
  368. #if defined(DEBUG)
  369. Serial.print("#331_L1 main loop top ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init ");
  370. Serial.println(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
  371. Serial.print("#331_L2 main loop top ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init=[");
  372. Serial.println(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
  373. Serial.print(" true["); Serial.print(true); Serial.print("] false["); Serial.print(false);
  374. Serial.println("] ");
  375. #endif
  376. }
  377. #if defined(DEBUG_DISPLAY)
  378. Serial.print("#532 Will TODO bug when too many mesgs to queue ..DISPLAY_pos_seq_T[");
  379. 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);
  380. Serial.print("] DISPLAY_TARGET_T 128["); Serial.print(DISPLAY_TARGET_DISPLAY128, BIN);Serial.print("] bin[");
  381. Serial.println("] ");
  382. #endif
  383. Slave_Ports_Status__DISPLAY_TARGET(
  384. Slave_Ports_Status_A ,
  385. Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
  386. 0 ,
  387. DISPLAY_A ,
  388. DISPLAY_T_ARDUINO_ATTR_ARRAY_A ,
  389. DISPLAY_PHYSICAL_CHAR_A,
  390. DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE ,
  391. "PORTS [" ,
  392. DISPLAY_TARGET_DISPLAY128,
  393. time,
  394. time + ARDUINO_time_seq_id_A_INCREMENT
  395. //queue
  396. ,Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
  397. TASK_TYPE_T__EMPTY__JUST_PASSED_ARG__,
  398. TASK_PORT_ASSOC_EMPTY
  399. );
  400. #else
  401. #include "___DEBUG/___DEBUG_DISABLE_LOOP_MAIN_A.h"
  402. #endif
  403. }
  404. // Serial.println(time);
  405. #include "___loop/_SlaveID_loop1.h" //todo PCINT
  406. #include "___loop/_ControllerID_loop1.h" //todo make default
  407. #include "___loop/__main_loop_end.h"
  408. // DISPLAY_DEV.setCursor(10,10);
  409. // DISPLAY_DEV.print(" Test307");
  410. /*
  411. DISPLAY__print_ANY(
  412. DISPLAY_T_ARDUINO_ATTR_ARRAY_A ,
  413. DISPLAY_PHYSICAL_CHAR_A,
  414. DISPLAY_pos_seq_A_NEXT,
  415. "123456789012345678901234567890"
  416. ); */
  417. delay(10);
  418. if(DEBUG_ACTION_TRIG != DEBUG_LAST_ACTION_TRIG) {
  419. 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("] ");
  420. // Serial.print("] COUNTER__MAIN_A["); Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A);
  421. // Serial.print("] COUNTER__MAIN_END_A["); Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A);
  422. }
  423. DEBUG_LAST_ACTION_TRIG = DEBUG_ACTION_TRIG ;
  424. }
  425. #include "_PCINT/_PCINT_func_loop.h" //todo empty implement display etc
  426. #include "_Slave_Ports_func_loop.h" //todo implement