a.binder 5 years ago
parent
commit
8313ff9653
100 changed files with 158 additions and 8734 deletions
  1. 0 178
      SE/stuff/P5_Automation_can-dev-res zjeb-0000/doc/P5_Automation_can-dev.graphml
  2. BIN
      SE/stuff/P5_Automation_can-dev-res zjeb-0000/doc/P5_Automation_can-dev.numbers
  3. 158 0
      SE/stuff/P5_Automation_can-dev-res-working-1930/___SUBMODULES___/radio_tx/radio_tx.ino
  4. 0 629
      SE/stuff/P5_Automation_can-dev-res/P5_Automation_can-dev-res.ino
  5. 0 2
      SE/stuff/P5_Automation_can-dev-res/_CAN/_CAN_config.h
  6. 0 151
      SE/stuff/P5_Automation_can-dev-res/_CAN/_CAN_func.h
  7. 0 9
      SE/stuff/P5_Automation_can-dev-res/_CAN/_CAN_init.h
  8. 0 114
      SE/stuff/P5_Automation_can-dev-res/_CAN/_CAN_setup.h
  9. 0 243
      SE/stuff/P5_Automation_can-dev-res/_CAN/_Slave_Ports_Protocol_CAN_struct.h
  10. 0 52
      SE/stuff/P5_Automation_can-dev-res/_DRIVER_STATUS/_DRIVER_STATUS_struct.h
  11. 0 3
      SE/stuff/P5_Automation_can-dev-res/_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_config.h
  12. 0 303
      SE/stuff/P5_Automation_can-dev-res/_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_func.h
  13. 0 21
      SE/stuff/P5_Automation_can-dev-res/_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_init.h
  14. 0 39
      SE/stuff/P5_Automation_can-dev-res/_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_setup.h
  15. 0 73
      SE/stuff/P5_Automation_can-dev-res/_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_struct.h
  16. 0 266
      SE/stuff/P5_Automation_can-dev-res/_LCD1602_func.h
  17. 0 9
      SE/stuff/P5_Automation_can-dev-res/_LCD1602_init.h
  18. 0 2
      SE/stuff/P5_Automation_can-dev-res/_LCD1602_setup.h
  19. 0 86
      SE/stuff/P5_Automation_can-dev-res/_LCD1602_struct.h
  20. 0 459
      SE/stuff/P5_Automation_can-dev-res/_PCINT/_PCINT-dev.h
  21. 0 0
      SE/stuff/P5_Automation_can-dev-res/_PCINT/_PCINT_func_loop.h
  22. 0 19
      SE/stuff/P5_Automation_can-dev-res/_PCINT/_PCINT_init.h
  23. 0 48
      SE/stuff/P5_Automation_can-dev-res/_PCINT/_PCINT_loop.h
  24. 0 15
      SE/stuff/P5_Automation_can-dev-res/_PCINT/_PCINT_setup.h
  25. 0 42
      SE/stuff/P5_Automation_can-dev-res/_PCINT/_PCINT_struct.h
  26. 0 13
      SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW/_ROTTARY_SW_config.h
  27. 0 88
      SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW/_ROTTARY_SW_func.h
  28. 0 1
      SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW/_ROTTARY_SW_init.h
  29. 0 120
      SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW/_ROTTARY_SW_loop.h
  30. 0 55
      SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW/_ROTTARY_SW_setup.h
  31. 0 10
      SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW/_ROTTARY_SW_struct.h
  32. 0 20
      SE/stuff/P5_Automation_can-dev-res/_SlaveID_setup.h
  33. 0 11
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports.h
  34. 0 332
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_I2C_func.h
  35. 0 18
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_Protocol_CAN_func.h
  36. 0 166
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_Status_QUEUE_struct.h
  37. 0 292
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_Status_func.h
  38. 0 41
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_func_loop.h
  39. 0 3
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_ttl_decrement.h
  40. 0 23
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_ttl_decrement_func.h
  41. 0 29
      SE/stuff/P5_Automation_can-dev-res/_TASK_TYPES_func.h
  42. 0 27
      SE/stuff/P5_Automation_can-dev-res/_TFT_ILI9163C_config.h
  43. 0 262
      SE/stuff/P5_Automation_can-dev-res/_TFT_ILI9163C_func.h
  44. 0 17
      SE/stuff/P5_Automation_can-dev-res/_TFT_ILI9163C_init.h
  45. 0 14
      SE/stuff/P5_Automation_can-dev-res/_TFT_ILI9163C_setup.h
  46. 0 65
      SE/stuff/P5_Automation_can-dev-res/_TFT_ILI9163C_struct.h
  47. 0 18
      SE/stuff/P5_Automation_can-dev-res/__PORTS/_PortStates_struct.h
  48. 0 20
      SE/stuff/P5_Automation_can-dev-res/__PORTS/_PortTypes_struct.h
  49. 0 12
      SE/stuff/P5_Automation_can-dev-res/__PORTS/_Port_Broadcast_state_struct.h
  50. 0 7
      SE/stuff/P5_Automation_can-dev-res/__PORTS/_Port_Exp_state_ttl_struct.h
  51. 0 6
      SE/stuff/P5_Automation_can-dev-res/__PORTS/_Port_I2C_driver_struct.h
  52. 0 1
      SE/stuff/P5_Automation_can-dev-res/__PORTS/_Port_ID_sruct.h
  53. 0 99
      SE/stuff/P5_Automation_can-dev-res/__PORTS/_Slave_Ports_Status_struct.h
  54. 0 33
      SE/stuff/P5_Automation_can-dev-res/__PORTS/_TASK_TYPES_struct.h
  55. 0 123
      SE/stuff/P5_Automation_can-dev-res/__QUEUE/_Slave_Ports_Status_QUEUE_add_func.h
  56. 0 430
      SE/stuff/P5_Automation_can-dev-res/__QUEUE/_Slave_Ports_Status_QUEUE_func.h
  57. 0 120
      SE/stuff/P5_Automation_can-dev-res/__QUEUE/_Slave_Ports_action_func.h
  58. 0 397
      SE/stuff/P5_Automation_can-dev-res/__QUEUE/_Slave_Ports_broadcast_func.h
  59. 0 28
      SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x11/config_Active_ControllerID_0x11.h
  60. 0 119
      SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x11/config_Slave_Ports_LOCAL_0x11_init.h
  61. 0 14
      SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x13/config_Active_ControllerID_0x13.h
  62. 0 118
      SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x13/config_Slave_Ports_LOCAL_0x13_init.h
  63. 0 17
      SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x14/config_Active_ControllerID_0x14.h
  64. 0 114
      SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x14/config_Slave_Ports_LOCAL_0x14_init.h
  65. 0 108
      SE/stuff/P5_Automation_can-dev-res/___CONFIG/config_Slave_Ports_LOCAL_init.h
  66. 0 32
      SE/stuff/P5_Automation_can-dev-res/___DEBUG/0x11/___DEBUG_DISABLE_INIT__0x11.h
  67. 0 162
      SE/stuff/P5_Automation_can-dev-res/___DEBUG/0x11/___DEBUG_DISABLE_LOOP__0x11.h
  68. 0 38
      SE/stuff/P5_Automation_can-dev-res/___DEBUG/0x11/___DEBUG_DISABLE_SETUP__0x11.h
  69. 0 0
      SE/stuff/P5_Automation_can-dev-res/___DEBUG/0x13/___DEBUG_DISABLE_INIT__0x13.h
  70. 0 26
      SE/stuff/P5_Automation_can-dev-res/___DEBUG/0x13/___DEBUG_DISABLE_LOOP__0x13.h
  71. 0 25
      SE/stuff/P5_Automation_can-dev-res/___DEBUG/0x13/___DEBUG_DISABLE_SETUP__0x13.h
  72. 0 13
      SE/stuff/P5_Automation_can-dev-res/___DEBUG/___DEBUG_DISABLE_INIT.h
  73. 0 24
      SE/stuff/P5_Automation_can-dev-res/___DEBUG/___DEBUG_DISABLE_LOOP.h
  74. 0 1
      SE/stuff/P5_Automation_can-dev-res/___DEBUG/___DEBUG_DISABLE_LOOP_MAIN_A.h
  75. 0 14
      SE/stuff/P5_Automation_can-dev-res/___DEBUG/___DEBUG_DISABLE_SETUP.h
  76. 0 8
      SE/stuff/P5_Automation_can-dev-res/___loop/_ControllerID_loop1.h
  77. 0 42
      SE/stuff/P5_Automation_can-dev-res/___loop/_LOOP_LATENCY_COUNTER.h
  78. 0 44
      SE/stuff/P5_Automation_can-dev-res/___loop/_SlaveID_loop1.h
  79. 0 24
      SE/stuff/P5_Automation_can-dev-res/___loop/___loop_init.h
  80. 0 78
      SE/stuff/P5_Automation_can-dev-res/___loop/__main_loop_end.h
  81. 0 115
      SE/stuff/P5_Automation_can-dev-res/___loop/__main_loop_top.h
  82. 0 6
      SE/stuff/P5_Automation_can-dev-res/___main/__main_I2C_setup.h
  83. 0 75
      SE/stuff/P5_Automation_can-dev-res/___main/__main_I2C_struc.h
  84. 0 15
      SE/stuff/P5_Automation_can-dev-res/___main/__main_auto.h
  85. 0 42
      SE/stuff/P5_Automation_can-dev-res/___main/__main_extern.h
  86. 0 19
      SE/stuff/P5_Automation_can-dev-res/___main/__main_init.h
  87. 0 40
      SE/stuff/P5_Automation_can-dev-res/___main/__main_register.h
  88. 0 28
      SE/stuff/P5_Automation_can-dev-res/___main/__main_setup.h
  89. 0 22
      SE/stuff/P5_Automation_can-dev-res/___main/__main_static.h
  90. 0 293
      SE/stuff/P5_Automation_can-dev-res/___main/__main_struct.h
  91. 0 619
      SE/stuff/P5_Automation_can-dev-res/___main/__main_struct_funct.h
  92. 0 32
      SE/stuff/P5_Automation_can-dev-res/___main/__main_struct_limits.h
  93. 0 12
      SE/stuff/P5_Automation_can-dev-res/___main/__main_trigger_struct.h
  94. 0 36
      SE/stuff/P5_Automation_can-dev-res/___template/__STORAGE_ARRAY_func.h
  95. 0 0
      SE/stuff/P5_Automation_can-dev-res/__icon/__icon.h
  96. 0 57
      SE/stuff/P5_Automation_can-dev-res/_bak/TPQxxx.xxhxxx
  97. 0 181
      SE/stuff/P5_Automation_can-dev-res/_bak/_DISPLAY_func.bakh.h
  98. 0 78
      SE/stuff/P5_Automation_can-dev-res/_bak/_DISPLAY_struct.bakh.h
  99. 0 208
      SE/stuff/P5_Automation_can-dev-res/_bak/_Slave_Ports_Status_func.bakh.h
  100. 0 171
      SE/stuff/P5_Automation_can-dev-res/_bak/_TFT_ILI9163C_func.bakh.h

+ 0 - 178
SE/stuff/P5_Automation_can-dev-res zjeb-0000/doc/P5_Automation_can-dev.graphml

@@ -1,178 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:java="http://www.yworks.com/xml/yfiles-common/1.0/java" xmlns:sys="http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
-  <!--Created by yEd 3.20-->
-  <key attr.name="Description" attr.type="string" for="graph" id="d0"/>
-  <key for="port" id="d1" yfiles.type="portgraphics"/>
-  <key for="port" id="d2" yfiles.type="portgeometry"/>
-  <key for="port" id="d3" yfiles.type="portuserdata"/>
-  <key attr.name="url" attr.type="string" for="node" id="d4"/>
-  <key attr.name="description" attr.type="string" for="node" id="d5"/>
-  <key for="node" id="d6" yfiles.type="nodegraphics"/>
-  <key for="graphml" id="d7" yfiles.type="resources"/>
-  <key attr.name="url" attr.type="string" for="edge" id="d8"/>
-  <key attr.name="description" attr.type="string" for="edge" id="d9"/>
-  <key for="edge" id="d10" yfiles.type="edgegraphics"/>
-  <graph edgedefault="directed" id="G">
-    <data key="d0" xml:space="preserve"/>
-    <node id="n0" yfiles.foldertype="group">
-      <data key="d4" xml:space="preserve"/>
-      <data key="d5"/>
-      <data key="d6">
-        <y:ProxyAutoBoundsNode>
-          <y:Realizers active="0">
-            <y:GroupNode>
-              <y:Geometry height="403.6427812757149" width="571.4121822784651" x="102.0727830960135" y="0.0"/>
-              <y:Fill color="#CAECFF84" transparent="false"/>
-              <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
-              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="571.4121822784651" x="0.0" xml:space="preserve" y="0.0">ARDUINO_ARRAY_INDEX_NEXT_LOCK</y:NodeLabel>
-              <y:Shape type="roundrectangle"/>
-              <y:State closed="false" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
-              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
-              <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
-            </y:GroupNode>
-            <y:GroupNode>
-              <y:Geometry height="50.0" width="50.0" x="125.18188736681896" y="697.3150684931506"/>
-              <y:Fill color="#CAECFF84" transparent="false"/>
-              <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
-              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="50.0" x="0.0" xml:space="preserve" y="0.0">2</y:NodeLabel>
-              <y:Shape type="roundrectangle"/>
-              <y:State closed="true" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
-              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
-              <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
-            </y:GroupNode>
-          </y:Realizers>
-        </y:ProxyAutoBoundsNode>
-      </data>
-      <graph edgedefault="directed" id="n0:">
-        <node id="n0::n0">
-          <data key="d5"/>
-          <data key="d6">
-            <y:ShapeNode>
-              <y:Geometry height="26.306243341383833" width="212.84095460149962" x="117.0727830960135" y="180.998046875"/>
-              <y:Fill color="#FFCC00" transparent="false"/>
-              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
-              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="155.34765625" x="28.74664917574981" xml:space="preserve" y="4.086715420691917">ARDUINO_ATTR_ARRAY_A<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
-              <y:Shape type="hexagon"/>
-            </y:ShapeNode>
-          </data>
-        </node>
-        <node id="n0::n1" yfiles.foldertype="group">
-          <data key="d4" xml:space="preserve"/>
-          <data key="d5"/>
-          <data key="d6">
-            <y:ProxyAutoBoundsNode>
-              <y:Realizers active="0">
-                <y:GroupNode>
-                  <y:Geometry height="351.9767656507149" width="452.72136665249303" x="205.7635987219856" y="36.666015625"/>
-                  <y:Fill color="#F5F5F5" transparent="false"/>
-                  <y:BorderStyle color="#000000" type="dashed" width="1.0"/>
-                  <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#EBEBEB" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="39.33203125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="452.72136665249303" x="0.0" xml:space="preserve" y="0.0">ARDUINO_ATTR_ARRAY_A
-.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A </y:NodeLabel>
-                  <y:Shape type="roundrectangle"/>
-                  <y:State closed="false" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
-                  <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
-                  <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="5" rightF="5.1138426789099185" top="0" topF="0.0"/>
-                </y:GroupNode>
-                <y:GroupNode>
-                  <y:Geometry height="50.0" width="50.0" x="186.20668702619673" y="88.73540613566405"/>
-                  <y:Fill color="#F5F5F5" transparent="false"/>
-                  <y:BorderStyle color="#000000" type="dashed" width="1.0"/>
-                  <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#EBEBEB" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="50.0" x="0.0" xml:space="preserve" y="0.0">1</y:NodeLabel>
-                  <y:Shape type="roundrectangle"/>
-                  <y:State closed="true" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
-                  <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
-                  <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
-                </y:GroupNode>
-              </y:Realizers>
-            </y:ProxyAutoBoundsNode>
-          </data>
-          <graph edgedefault="directed" id="n0::n1:">
-            <node id="n0::n1::n0">
-              <data key="d5"/>
-              <data key="d6">
-                <y:ShapeNode>
-                  <y:Geometry height="26.306243341383833" width="342.97160214680184" x="262.00745932336235" y="90.998046875"/>
-                  <y:Fill color="#FFCC00" transparent="false"/>
-                  <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
-                  <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="276.021484375" x="33.47505888590092" xml:space="preserve" y="4.086715420691917">ARDUINO_ARRAY_ATTR_INDEX__TO_INITIALIZE<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
-                  <y:Shape type="hexagon"/>
-                </y:ShapeNode>
-              </data>
-            </node>
-            <node id="n0::n1::n1" yfiles.foldertype="group">
-              <data key="d4" xml:space="preserve"/>
-              <data key="d5"/>
-              <data key="d6">
-                <y:ProxyAutoBoundsNode>
-                  <y:Realizers active="0">
-                    <y:GroupNode>
-                      <y:Geometry height="238.16381159172613" width="417.6075239735831" x="220.7635987219856" y="135.4789696839888"/>
-                      <y:Fill color="#F5F5F5" transparent="false"/>
-                      <y:BorderStyle color="#000000" type="dashed" width="1.0"/>
-                      <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#EBEBEB" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="417.6075239735831" x="0.0" xml:space="preserve" y="0.0">ARDUINO_ARRAY_ATTR_INDEX__INITIALIZED</y:NodeLabel>
-                      <y:Shape type="roundrectangle"/>
-                      <y:State closed="false" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
-                      <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
-                      <y:BorderInsets bottom="63" bottomF="63.38751331723233" left="7" leftF="7.285052859135192" right="25" rightF="25.199760274383493" top="15" topF="14.676405328868668"/>
-                    </y:GroupNode>
-                    <y:GroupNode>
-                      <y:Geometry height="50.0" width="50.0" x="418.609348094333" y="99.53756746983879"/>
-                      <y:Fill color="#F5F5F5" transparent="false"/>
-                      <y:BorderStyle color="#000000" type="dashed" width="1.0"/>
-                      <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#EBEBEB" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="50.0" x="0.0" xml:space="preserve" y="0.0">1</y:NodeLabel>
-                      <y:Shape type="roundrectangle"/>
-                      <y:State closed="true" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
-                      <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
-                      <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
-                    </y:GroupNode>
-                  </y:Realizers>
-                </y:ProxyAutoBoundsNode>
-              </data>
-              <graph edgedefault="directed" id="n0::n1::n1:">
-                <node id="n0::n1::n1::n0">
-                  <data key="d5"/>
-                  <data key="d6">
-                    <y:ShapeNode>
-                      <y:Geometry height="26.306243341383833" width="265.3809478338447" x="307.3952072936703" y="186.82139063785746"/>
-                      <y:Fill color="#FFCC00" transparent="false"/>
-                      <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
-                      <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="226.251953125" x="19.564497354422315" xml:space="preserve" y="4.086715420691917">ARDUINO_ARRAY_ATTR_INDEX__LOCK<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
-                      <y:Shape type="hexagon"/>
-                    </y:ShapeNode>
-                  </data>
-                </node>
-                <node id="n0::n1::n1::n1">
-                  <data key="d5"/>
-                  <data key="d6">
-                    <y:ShapeNode>
-                      <y:Geometry height="26.306243341383833" width="342.97160214680184" x="255.19976027438344" y="212.64278127571492"/>
-                      <y:Fill color="#FFCC00" transparent="false"/>
-                      <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
-                      <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="266.646484375" x="38.16255888590092" xml:space="preserve" y="4.086715420691917">ARDUINO_ARRAY_ATTR_INDEX__TO_COMMIT<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
-                      <y:Shape type="hexagon"/>
-                    </y:ShapeNode>
-                  </data>
-                </node>
-                <node id="n0::n1::n1::n2">
-                  <data key="d5"/>
-                  <data key="d6">
-                    <y:ShapeNode>
-                      <y:Geometry height="26.306243341383833" width="342.97160214680184" x="243.0486515811208" y="268.94902461709876"/>
-                      <y:Fill color="#FFCC00" transparent="false"/>
-                      <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
-                      <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="285.314453125" x="28.82857451090092" xml:space="preserve" y="4.086715420691917">ARDUINO_ARRAY_ATTR_INDEX__TO_INCREMENT<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
-                      <y:Shape type="hexagon"/>
-                    </y:ShapeNode>
-                  </data>
-                </node>
-              </graph>
-            </node>
-          </graph>
-        </node>
-      </graph>
-    </node>
-  </graph>
-  <data key="d7">
-    <y:Resources/>
-  </data>
-</graphml>

BIN
SE/stuff/P5_Automation_can-dev-res zjeb-0000/doc/P5_Automation_can-dev.numbers


+ 158 - 0
SE/stuff/P5_Automation_can-dev-res-working-1930/___SUBMODULES___/radio_tx/radio_tx.ino

@@ -0,0 +1,158 @@
+/*
+ * See documentation at https://nRF24.github.io/RF24
+ * See License information at root directory of this library
+ * Author: Brendan Doherty (2bndy5)
+ */
+
+/**
+ * A simple example of sending data from 1 nRF24L01 transceiver to another.
+ *
+ * This example was written to be used on 2 devices acting as "nodes".
+ * Use the Serial Monitor to change each node's behavior.
+ */
+#include <SPI.h>
+#include "printf.h"
+#include "RF24.h"
+
+#define RF24_ce_pin 10
+#define RF24_csn_pin 11 
+
+// instantiate an object for the nRF24L01 transceiver
+//RF24 radio(RF24_ce_pin, RF24_csn_pin); // using pin 7 for the CE pin, and pin 8 for the CSN pin
+RF24 radio(10, 11); // using pin 7 for the CE pin, and pin 8 for the CSN pin
+
+// Let these addresses be used for the pair
+uint8_t address[][6] = {"1Node", "2Node"};
+// It is very helpful to think of an address as a path instead of as
+// an identifying device destination
+
+// to use different addresses on a pair of radios, we need a variable to
+// uniquely identify which address this radio will use to transmit
+bool radioNumber = 1; // 0 uses address[0] to transmit, 1 uses address[1] to transmit
+
+// Used to control whether this node is sending or receiving
+bool role = true ;//false;  // true = TX role, false = RX role
+
+// For this example, we'll be using a payload containing
+// a single float number that will be incremented
+// on every successful transmission
+float payload = 0.0;
+
+void setup() {
+
+  Serial.begin(115200);
+  while (!Serial) {
+    // some boards need to wait to ensure access to serial over USB
+  }
+
+  // initialize the transceiver on the SPI bus
+  if (!radio.begin()) {
+    Serial.println(F("radio hardware is not responding!!"));
+    while (1) {} // hold in infinite loop
+  }
+
+  // print example's introductory prompt
+  Serial.println(F("RF24/examples/GettingStarted"));
+
+  // To set the radioNumber via the Serial monitor on startup
+  Serial.println(F("Which radio is this? Enter '0' or '1'. Defaults to '0'"));
+  while (!Serial.available()) {
+    // wait for user input
+  }
+  char input = Serial.parseInt();
+  radioNumber = input == 1;
+  Serial.print(F("radioNumber = "));
+  Serial.println((int)radioNumber);
+
+  // role variable is hardcoded to RX behavior, inform the user of this
+  Serial.println(F("*** PRESS 'T' to begin transmitting to the other node"));
+
+  // Set the PA Level low to try preventing power supply related problems
+  // because these examples are likely run with nodes in close proximity to
+  // each other.
+  radio.setPALevel(RF24_PA_LOW);  // RF24_PA_MAX is default.
+
+  // save on transmission time by setting the radio to only transmit the
+  // number of bytes we need to transmit a float
+  radio.setPayloadSize(sizeof(payload)); // float datatype occupies 4 bytes
+
+  // set the TX address of the RX node into the TX pipe
+  radio.openWritingPipe(address[radioNumber]);     // always uses pipe 0
+
+  // set the RX address of the TX node into a RX pipe
+  radio.openReadingPipe(1, address[!radioNumber]); // using pipe 1
+
+  // additional setup specific to the node's role
+  if (role) {
+    radio.stopListening();  // put radio in TX mode
+  } else {
+    radio.startListening(); // put radio in RX mode
+  }
+
+  // For debugging info
+  // printf_begin();             // needed only once for printing details
+  // radio.printDetails();       // (smaller) function that prints raw register values
+  // radio.printPrettyDetails(); // (larger) function that prints human readable data
+
+} // setup
+
+void loop() {
+
+  if (role) {
+    // This device is a TX node
+
+    unsigned long start_timer = micros();                    // start the timer
+    bool report = radio.write(&payload, sizeof(float));      // transmit & save the report
+    unsigned long end_timer = micros();                      // end the timer
+
+    if (report) {
+      Serial.print(F("Transmission successful! "));          // payload was delivered
+      Serial.print(F("Time to transmit = "));
+      Serial.print(end_timer - start_timer);                 // print the timer result
+      Serial.print(F(" us. Sent: "));
+      Serial.println(payload);                               // print payload sent
+      payload += 0.01;                                       // increment float payload
+    } else {
+      Serial.println(F("Transmission failed or timed out")); // payload was not delivered
+    }
+
+    // to make this example readable in the serial monitor
+    delay(1000);  // slow transmissions down by 1 second
+
+  } else {
+    // This device is a RX node
+
+    uint8_t pipe;
+    if (radio.available(&pipe)) {             // is there a payload? get the pipe number that recieved it
+      uint8_t bytes = radio.getPayloadSize(); // get the size of the payload
+      radio.read(&payload, bytes);            // fetch payload from FIFO
+      Serial.print(F("Received "));
+      Serial.print(bytes);                    // print the size of the payload
+      Serial.print(F(" bytes on pipe "));
+      Serial.print(pipe);                     // print the pipe number
+      Serial.print(F(": "));
+      Serial.println(payload);                // print the payload's value
+    }
+  } // role
+
+  if (Serial.available()) {
+    // change the role via the serial monitor
+
+    char c = toupper(Serial.read());
+    if (c == 'T' && !role) {
+      // Become the TX node
+
+      role = true;
+      Serial.println(F("*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK"));
+      radio.stopListening();
+
+    } else if (c == 'R' && role) {
+      // Become the RX node
+
+      role = false;
+      Serial.println(F("*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK"));
+      radio.startListening();
+    }
+  }
+
+} // loop

+ 0 - 629
SE/stuff/P5_Automation_can-dev-res/P5_Automation_can-dev-res.ino

@@ -1,629 +0,0 @@
-/* P5_Automation_can-dev
- * 2020-06 testing communications CAN for integrate further with Procesy5
- * A.Binder
- * Uses: 
- * LCD1602 - big 2x16 character display
- * TFT_ILI9163C 128x128 lcd display
- * MCP_2515 - can port controller
- * //#define HAS_I2C_driver_Adafruit_PWMServoDriver
- * controls
- * Slave ports via:     
- * I2C      
- * PCA9685 - 16port 12bit PWM driver - can controll 16 eg. LEDs which can be 0....12V dimmed=]                
- * todo 74HC595 - Serial to Parallel Shifting-Out - from 8 ports to many if connected in paraller
- *       based on https://www.arduino.cc/en/tutorial/ShiftOut 
- * or 16 servos               
- * - can have addressed many of PCA9685 on I2C bus - so can controll over 64 ports      
- * to be added another devices tested
- * todo Rottary Swich { GND, +, SW, DT, CLK } - to provide LCD menu access
-
- *  TODO structure of port is in _Slave_Ports.h  
- *     _Slave_Port _Slave_Ports[] = {
-        {"CAN", 0x102, 0x80, 0x00, 0, 0x00, 0x00 },
-        {"CAN",  - Base port origin protocol
-          0x102,  - Base port origin protocol address
-           0x80, -  int PortTypes;  0xFF  =  1111 1111
-                                    0x01  =  0000 0001  = PWM port
-                                    {
-                                      bit 1 - PWM port
-                                      bit 2 - not allocated
-                                      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
-                                    },
-            0x00, int Address -  local address on e.g. I2C bus - 0x40 etc                     
-            0x00, - int LocalPort - local port number when used e.g. I2C extension
-             0x01 - 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
-                                              }, 
-               0x6d - testowy ttl - 10 sekund do przedawnienia stanu portu w tablicy i koniecznosci odswiezenia tablicy
-               } 
-        };
-        - to be optimalized for inegration
-        - to allow of subscribe ports
-        - to allow of concurent routing
-        - to allow new port detectioj
-        - to allow creating ports dependencies e.g. IF 
-            - port has value
-            - port AND port 
-            THEN
-            - set port
-           - probably should be avilable creations of virtual ports which would describe 
-            - state of port AND port etc... 
- *  TO BE INTEGRATED WITH p5 
- *    - interface and WFST
- *  TO BE INGEGRATED WITH MARLIN 3D PRINTERS - machine and automation purpose
- *    - controll remote ports via g-code 
- *    - allows interrupts
- *   TO ALLOW OF NEXT PACKETS TYPES WITH DIFFERENT MEANINGS
- *    - dimming
- *    logic
- */
-
-//#define HAS_DEBUG_ACTION_TRIG
-//#define DEBUG_I2C //to debug _Slave_Ports_I2C_POP etc
-//#define HAS_TFT_ILI9163C 
-//#define HAS_LCD1602 
-//#define HAS_ROTTARY_SW
-
-//#define DEBUG_I2C_driver_Adafruit_PWMServoDriver
-//#define DEBUG_CAN
-//#define DEBUG_QUEUE
-//#define DEBUG_QUEUE_ASSERT
-//#define DEBUG_QUEUE_WAIT 500
-//#define DEBUG_STRUCT_INIT
-//#define DEBUG_STORAGE_QUEUE_TEST 
-//#define DEBUG_ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE
-//#define DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK
-//#define HAS__PCINT_setup //to allow interrupts
-//#define DEBUG_TASK_TYPE_T_Slave_Ports_broadcast____
-//#define DEBUG_TASK_TYPE_T_DISPLAY_queue_pop________
-//#define DEBUG_TASK_TYPE_T_Slave_Ports_set_I2C______
-//#define DEBUG_QUEUE_ASSERT todo not working
-//#define DEBUG_LAST_ACTION_TRIG_ENABLE
-#define DISABLE_DISPLAY__add_record 
-#define DISPLAY_array16_T_is_DISPLAY_string_T 
-#define ENABLE_DISPLAY_MENU
-//#define DISABLE_ANY_PRINT //when uno ?
-//#define DISPLAY_MENU_SELECTOR_DEBUG 
-//#define DISPLAY__print_menu_DELAY 500 
-//#define DISABLE_TASK_TYPE_T_Broadcast_state_LOW
-
-#define Sprintln(a) (Serial.println(a))
-/*
-Then instead of
-
-Serial.println(F("Hello world!"));
-write
-
-Sprintln(F("Hello world!"));
-etc. To deactivate the Serial printing, define the macro empty:
-
-#define Sprintln(a) 
-
-
-*/
-
-
-
-#include "___CONFIG/config_Active_ControllerID.h" //there kleep id of device
-
-
-#define HAS__jm_Scheduler //to allow planned actions blink etc
-
-#if defined(HAS__jm_Scheduler)
-    #include "jm_Scheduler.h"
-#endif
-
-//Debug level
-//#define DEBUG 5 
-//#define DISABLE_LOOP //To debug and disable any output
-
-
-#include "___main/__main_struct.h"
-#include "___main/__main_trigger_struct.h"
-#include "___main/__main_struct_funct.h"
-
-
-#include "___main/__main_struct_limits.h"
-#include "_time_struct.h"
-#include "_DRIVER_STATUS/_DRIVER_STATUS_struct.h"
-
-#include "___main/__main_I2C_struc.h"
-#include "___main/__main_static.h"
-#include "___main/__main_auto.h"
-#include "___main/__main_register.h"
-#include "___main/__main_extern.h"
-#include "__icon/__icon.h"
-
-#include "___template/__STORAGE_ARRAY_func.h" //testing
-
-#define  _ControllerID   0x11 
-
-#define  _Slave1_ID   0x13 
-
-
-
-//#include "Active_ControllerID_0x103.h"
-//#define Active_ControllerID _ControllerID 
-//#define Active_ControllerID _Slave1_ID 
-
-
-//#include "config_Slave_Ports_LOCAL_0x101_init.h" //there kleep config of this id device
-
-#define print_SEP_RT "]"
-#if defined(DEBUG)
-#define DPRINT(...)    Serial.print(__VA_ARGS__)
-#define DPRINTLN(...)  Serial.println(__VA_ARGS__)
-#define DRINTF(...)    Serial.print(F(__VA_ARGS__))
-#define DPRINTLNF(...) Serial.println(F(__VA_ARGS__))
-        DPRINTLN("#125 [DEBUG ENABLED]");    
-        //DPRINTLN(0xC0FFEEul,DEC);
-        //DPRINTLN(12648430ul,HEX);
-#else
-#define DPRINT(...)     //blank line
-#define DPRINTLN(...)   //blank line
-#define DPRINTF(...)    //blank line
-#define DPRINTLNF(...)  //blank line
-
-#endif
-
-#if Active_ControllerID == 0x11 
-    const int Active_ControllerID_HEX = 0x11 ;
-     #include "___CONFIG/0x11/config_Active_ControllerID_0x11.h"
-#endif
-
-
-#if Active_ControllerID == 0x13 
-    const int Active_ControllerID_HEX = 0x13 ;
-    #include "___CONFIG/0x13/config_Active_ControllerID_0x13.h"  //there kleep config of this id device
-#endif
-
-
-
-#if Active_ControllerID == 0x14 
-    const int Active_ControllerID_HEX = 0x14 ;
-    #include "___CONFIG/0x14/config_Active_ControllerID_0x14.h"  //there kleep config of this id device
-#endif
-
-
-
-
-
-#if defined(HAS_TFT_ILI9163C)
-    #include "_TFT_ILI9163C_config.h"
-#endif
-#include "__DISPLAY/_DISPLAY_struct.h"
-#include "__PORTS/_Port_ID_sruct.h"
-
-#include "__PORTS/_TASK_TYPES_struct.h"
-#include "_Slave_Ports_Status_QUEUE_struct.h"
-//#include "Slave_Ports_Status_QUEUE.h"
-
-
-#include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_struct.h"
-
-#include "_CAN/_CAN_config.h"
-
-#if defined(HAS_ROTTARY_SW)
- #include "_ROTTARY_SW/_ROTTARY_SW_config.h"
-#endif
-
-
-
-#if defined(HAS_I2C_driver_Adafruit_PWMServoDriver)
- #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_config.h"
-#endif
-
-#if defined(HAS_ROTTARY_SW)
-    #include "_ROTTARY_SW/_ROTTARY_SW_struct.h"
-#endif
-
-#include "Queue.h"
-//#include "TPQ.h"
- Queue<int> _Slave_Ports_queue = Queue<int>(ARDUINO_ARRAY_INDEX_LIMIT_QUEUE);
- Queue<int> TEST_QUEUE = Queue<int>(ARDUINO_ARRAY_INDEX_LIMIT_QUEUE);
-
-
- #if Active_ControllerID == _ControllerID 
-    String lcdPattern = "s" ;
-   
- #endif
- #if Active_ControllerID == _Slave1_ID 
-    String lcdPattern = "." ;
-    
- #endif
-
-//BEGIN 1602
-#if defined(HAS_LCD1602)
-  #include <LiquidCrystal.h>
-  // initialize the library with the numbers of the interface pins
-  //LiquidCrystal lcd(4, 6, 10, 11, 12, 13);
-  //LiquidCrystal lcd(4, 6, 53, 51, 50, 52  );
-  #include "_LCD1602_struct.h"
- // #include "_LCD1602_init.h"
-#endif
-
-
-//#if defined(HAS_TFT_ILI9163C)
-  #include "_TFT_ILI9163C_struct.h"
-//#endif
-
-
-#if defined(HAS__PCINT_setup)
-    #include "_PCINT/_PCINT_struct.h"  //pins MYPIN1 MYPIN2 MYPIN3
-#endif
-
-
-//BEGIN CAN
-
-
-#include "_CAN/_CAN_init.h"
-//EOF CAN
-
-
-
-
-
- //REMOTE PORTS DEFINITIONS
- #include "__PORTS/_PortTypes_struct.h"
- #include "__PORTS/_PortStates_struct.h"
- #include "__PORTS/_Port_Exp_state_ttl_struct.h"
- #include "__PORTS/_Port_Broadcast_state_struct.h"
- #include "__PORTS/_Port_I2C_driver_struct.h"
- #include "__PORTS/_Slave_Ports_Status_struct.h"
- #include "_CAN/_Slave_Ports_Protocol_CAN_struct.h"
- 
- #if defined(HAS_TFT_ILI9163C)
-  #include "_TFT_ILI9163C_func.h"
- #endif   
-
-
-
-#if defined(HAS_I2C_driver_Adafruit_PWMServoDriver)
-    #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_func.h"
-#endif
-#include "_TASK_TYPES_func.h"
-#include "__QUEUE/_Slave_Ports_Status_QUEUE_add_func.h"
-#include "__DISPLAY/_DISPLAY_add_record_func.h"
-#include "__DISPLAY/_DISPLAY_func.h"
-
-#if defined(HAS_LCD1602)
-  #include "_LCD1602_func.h"
-  //#include "_LCD1602_init.h"
-#endif
-
-
-
-
-
-#if defined(HAS_ROTTARY_SW)
- #include "_ROTTARY_SW/_ROTTARY_SW_func.h"
-#endif
-
-#include "_time_func.h"
-
-#include "_Slave_Ports_ttl_decrement_func.h"
-#include "__QUEUE/_Slave_Ports_broadcast_func.h"
-#include "_Slave_Ports_I2C_func.h"
-#include "__QUEUE/_Slave_Ports_action_func.h"
-
-#include "__DISPLAY/_DISPLAY_queue_pop_func.h"
-#include "__QUEUE/_Slave_Ports_Status_QUEUE_func.h"
-
-#include "_Slave_Ports_Protocol_CAN_func.h"
-#include "_Slave_Ports_Status_func.h"
-
-#include "_CAN/_CAN_func.h"
-
-
-  #include "_Slave_Ports.h"
- // #include "_Slave_Ports_ttl_decrement_POP.h"
-  // #define _CAN_P_0x102_PWM0x00_0 { _Slave1_ID , "PWM", 0x00, 0 } 
-   //#define _CAN_P_0x102_PWMServoDriver0x40
-   
-    // #define   Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver();
-  //    Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x40);
-
-
-// #define __CSpin 53 // 10 //  chip select
- 
- 
- 
-#if defined(HAS_LCD1602)
-  #include "_LCD1602_init.h"
-#endif
-
-#if defined(HAS_TFT_ILI9163C)
-  #include "_TFT_ILI9163C_init.h"
-#endif
-
- 
-#include "__DISPLAY/_DISPLAY_init.h"
-
-
-  
-
-#if defined(HAS_ROTTARY_SW)
- #include "_ROTTARY_SW/_ROTTARY_SW_init.h"  //empty
-#endif
-
-
-
-#if defined(HAS__PCINT_setup)
-     #include "_PCINT/_PCINT_init.h"
-#endif
-
-#include "___CONFIG/config_Slave_Ports_LOCAL_init.h"
-
-
-#if Active_ControllerID == 0x11 
-     #include "___CONFIG/0x11/config_Slave_Ports_LOCAL_0x11_init.h"
-#endif
-
-
-#if Active_ControllerID == 0x13 
-    #include "___CONFIG/0x13/config_Slave_Ports_LOCAL_0x13_init.h"
-#endif
-
-
-
-
-#if Active_ControllerID == 0x14
-    #include "___CONFIG/0x14/config_Slave_Ports_LOCAL_0x14_init.h"
-#endif
-
-
-#if defined(HAS_I2C_driver_Adafruit_PWMServoDriver)
- #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_init.h"
-#endif
-
-
-
-
-#include "___main/__main_init.h"
-
- #ifdef DISABLE_LOOP 
-        #include "___DEBUG/___DEBUG_DISABLE_INIT.h"
-    #endif
-
-
-
-
-
-
-
-void setup() {  //REMEMBER NOT INITIALIZE ANY VARIABLES OR ARRAYS
-    Serial.begin(115200);
-    
-#if defined(DEBUG) || defined(DEBUG_QUEUE)
-         Serial.println("#329 Serial.begin(115200)");
-#endif
-
-
-//    Serial.begin(9600);
-//    Serial.println("#233 setup" );
-// _LCD_print_queue.push(1);
-// _LCD_print_queue.push(2);
-// _LCD_print_queue.push(3);
-
-//String character = "Geas";
-//char b = abc.charAt(0); 
-//int b_ascii_value = b;
-
- // LCD_print_background_add( _LCD_print_buffors,            0,           0,           0,              "W",              5000,              6000);
- // LCD_print_background_add( _LCD_print_buffors,            1,           0,           0,              "H",              5000,              6000);
- // LCD_print_background_add( _LCD_print_buffors,            2,           0,           0,              "W",              5000,              6000);
- // LCD_print_background_add( _LCD_print_buffors,            3,           0,           0,              "K",              5000,              6000);
-
- 
-//todo PCINT service
-#if defined(DISABLE_LOOP) || defined(DEBUG)
-         Serial.println("#375 will include ___main/__main_I2C_setup.h");
-#endif
-#include "___main/__main_I2C_setup.h"
-
-
-#if defined(HAS__PCINT_setup)
-    #include "_PCINT/_PCINT_setup.h" //empty
-#endif
-
-
-#if defined(HAS_ROTTARY_SW)
- #include "_ROTTARY_SW/_ROTTARY_SW_setup.h"  //Attach interrupts
-#endif
-
-
-/* TODO
- String LCDarray1="CAN_1602_LCD           ";  //the string to print onthe LCD
- String LCDarray2="Testing id   ";  //the string to print onthe LCD
- LCDarray2.concat(String(Active_ControllerID, HEX) ) ;
- */
-
-
-#if defined(HAS_I2C_driver_Adafruit_PWMServoDriver)        
-            #if  defined(DISABLE_LOOP) || defined(DEBUG) || defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                     Serial.println("#401 will include /_I2C_driver_Adafruit_PWMServoDriver_setup.h");
-            #endif
-    
-         #include "_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_setup.h"
-#endif
-  
-  // put your setup code here, to run once:
-  #if defined(HAS_LCD1602)
-   #include "_LCD1602_setup.h"
-  #endif
-
-  #if defined(HAS_TFT_ILI9163C)
-    #include "_TFT_ILI9163C_setup.h"
-  #endif 
- 
-  //BEGIN CAN
-  #include "_CAN/_CAN_setup.h"
- 
-   #if defined(HAS_LCD1602) 
-   /* todo 
-      LCDarray1 = "loop.... ";
-      LCDarray2 = "....";
-     LCD_print(LCDarray1, LCDarray2, LCDtim/10);
-     */
-    #endif
-
-
-
-    #ifndef DISABLE_LOOP 
-     #include "___main/__main_setup.h"
-    #endif
-
- #ifdef DISABLE_LOOP 
-        #include "___DEBUG/___DEBUG_DISABLE_SETUP.h"
-    #endif
-
-
-
-}
-
-    //#if Active_ControllerID == _ControllerID
-     // byte data[8] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
-    //#endif
-
-  //String LCDarray1 ;
-  //String LCDarray2 ;
-
-
-  unsigned long time;
-  
-                
-   #include "___loop/_LOOP_LATENCY_COUNTER.h"
-
-
-
-
-
-void loop() {
-register long time;
-  time = millis();
-#include "___loop/___loop_init.h"
- 
-#if defined(HAS__PCINT_setup)
-  #include "_PCINT/_PCINT_loop.h"
-#endif 
-
- 
- 
-#if defined(HAS_ROTTARY_SW)
-    #include "_ROTTARY_SW/_ROTTARY_SW_loop.h"
-#endif
- 
-
-
-
-    #ifdef DISABLE_LOOP 
-        #include "___DEBUG/___DEBUG_DISABLE_LOOP.h"
-    #endif
-    #include "___loop/__main_loop_top.h"
-    
-    
-    
-    
-    if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END(ARDUINO_LOOP_LATENCY__MAIN_END_A, ARDUINO_LOOP_LATENCY_CONTROL_FLAG_NONE) <= ARDUINO_LOOP_LATENCY_COUNTER_INIT ) {
-        #if defined(DEBUG)
-            #ifndef DISABLE_LOOP            
-                if(DEBUG_ACTION_TRIG == 1)                            Serial.print("] Time: " );   Serial.println(time);
-                 
-            #endif
-        #endif 
-        if(DEBUG_ACTION_TRIG == 1 or (time % 100000 == 0)) {
-            #if defined(DEBUG_ACTION_TRIG_ENABLE)
-                Serial.print("Time: " );   Serial.println(time);
-            #endif
-        }
-            #ifndef DISABLE_LOOP
-                if(DEBUG_ACTION_TRIG == 1) {
-                      #if defined(DEBUG)
-                      Serial.print("#331_L1 main loop top   ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init  ");
-                      Serial.println(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
-                        Serial.print("#331_L2 main loop top ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init=[");
-                           Serial.println(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
-                           Serial.print("   true[");  Serial.print(true); Serial.print("]   false[");  Serial.print(false);
-                           Serial.println("] ");  
-                       #endif
-               }
-               
-               #if defined(DEBUG_DISPLAY)
-               
-                Serial.print("#532 Will  TODO bug when too many mesgs to queue ..DISPLAY_pos_seq_T[");
-                     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);
-                     Serial.print("]  DISPLAY_TARGET_T 128["); Serial.print(DISPLAY_TARGET_DISPLAY128, BIN);Serial.print("]  bin[");
-                     Serial.println("]   ");
-               #endif 
-               
-               Slave_Ports_Status__DISPLAY_TARGET(
-                     Slave_Ports_Status_A ,
-                     Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
-                      0 ,
-                       DISPLAY_A ,
-                         DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                         DISPLAY_PHYSICAL_CHAR_A, 
-                    DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE ,
-                    "PORTS [" ,
-                    DISPLAY_TARGET_DISPLAY128,
-                   time,
-                    time + ARDUINO_time_seq_id_A_INCREMENT
-                     //queue
-                    ,Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                    TASK_TYPE_T__EMPTY__JUST_PASSED_ARG__,
-                    TASK_PORT_ASSOC_EMPTY
-                 );
-              #else 
-                
-                #include "___DEBUG/___DEBUG_DISABLE_LOOP_MAIN_A.h"
-              #endif
-}
- // Serial.println(time);
-      #include "___loop/_SlaveID_loop1.h" //todo PCINT
-      #include "___loop/_ControllerID_loop1.h"  //todo make default
-  
-  #include "___loop/__main_loop_end.h"
-  // DISPLAY_DEV.setCursor(10,10);
-  //   DISPLAY_DEV.print(" Test307");
-  /*
-  DISPLAY__print_ANY(
-                    DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                    DISPLAY_PHYSICAL_CHAR_A,
-                    DISPLAY_pos_seq_A_NEXT,
-                    "123456789012345678901234567890" 
-        );     */
-        
-  //delay(10);
-  
-    if(DEBUG_ACTION_TRIG != DEBUG_LAST_ACTION_TRIG)   {
-       #if defined(DEBUG_LAST_ACTION_TRIG_ENABLE)
-        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("] ");
-       #endif 
-     //   Serial.print("] COUNTER__MAIN_A["); Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A);
-     //   Serial.print("] COUNTER__MAIN_END_A["); Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A);
-    }
-  DEBUG_LAST_ACTION_TRIG = DEBUG_ACTION_TRIG ;
-  
-}
-
-
-
-#include "_PCINT/_PCINT_func_loop.h" //todo empty implement display etc
-#include "_Slave_Ports_func_loop.h" //todo implement

+ 0 - 2
SE/stuff/P5_Automation_can-dev-res/_CAN/_CAN_config.h

@@ -1,2 +0,0 @@
-#define CAN_CSpin 53 
-#define CAN_INTpin 10

+ 0 - 151
SE/stuff/P5_Automation_can-dev-res/_CAN/_CAN_func.h

@@ -1,151 +0,0 @@
-void CAN_READ(
-        Slave_Ports_Status_T* Slave_Ports_Status_A ,
-                Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_T*            Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T*      Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_T*  Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                DISPLAY_T*  DISPLAY_A ,  DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A, long time
-) {
-          // If pin 2 is low, read receive buffer
-            {
-              CAN0.readMsgBuf(&CANrxId, &CANlen, CANrxBuf); // Read data: len = data length, buf = data byte(s)
-               #if not defined(DISABLE_ANY_PRINT)
-                    Serial.print("#5555CAN_READ read ID: ");
-                    Serial.print(CANrxId, HEX);
-                    Serial.print(" Data: [");Serial.print(CANlen); Serial.print("]"); 
-                #endif
-            
-                if(CANlen == CAN_MSG_DATA8_LEN) {
-                
-                    
-                
-                   //     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_MSG8_BIT_1_T CAN_MSG8_BIT_1_A = CANrxBuf[0] ;//< 0x10
-                         CAN_MSG8_BIT_2_T CAN_MSG8_BIT_2_A = CANrxBuf[1] ;
-                         CAN_MSG8_BIT_3_T CAN_MSG8_BIT_3_A = CANrxBuf[2] ;
-                         CAN_MSG8_BIT_4_T CAN_MSG8_BIT_4_A = CANrxBuf[3] ;
-                         CAN_MSG8_BIT_5_T CAN_MSG8_BIT_5_A = CANrxBuf[4] ;
-                         CAN_MSG8_BIT_6_T CAN_MSG8_BIT_6_A = CANrxBuf[5] ;
-                         CAN_MSG8_BIT_7_T CAN_MSG8_BIT_7_A = CANrxBuf[6] ;
-                         CAN_MSG8_BIT_8_T CAN_MSG8_BIT_8_A = CANrxBuf[7] ;
-                         
-                   #if not defined(DISABLE_ANY_PRINT) 
-                  // Serial.print();
-                   
-                   Serial.print("1.REM::");Serial.print(CAN_MSG8_BIT_1_A, HEX);
-                   Serial.print(", 2.SEND:");Serial.print(CAN_MSG8_BIT_2_A, HEX);
-                   Serial.print(", PortID.3:");Serial.print(CAN_MSG8_BIT_3_A, BIN);
-                   Serial.print(", PortTyp.4:");Serial.print(CAN_MSG8_BIT_4_A, BIN);
-                   Serial.print(", ExpS.5:");Serial.print(CAN_MSG8_BIT_5_A, BIN);
-                   Serial.print(", ExpT.6:");Serial.print(CAN_MSG8_BIT_6_A, HEX);
-                   Serial.print(", BcSt.7:");Serial.print(CAN_MSG8_BIT_7_A, HEX);
-                   Serial.print(", TaskT?.8:");Serial.print(CAN_MSG8_BIT_8_A, HEX);Serial.println(" ] ");
-                   
-                   
-                    Serial.println("64[ Debug STD]")   ;                             
-                                   for(int i = 0; i<CANlen; i++)           // Print each byte of the data
-                                    {
-                                     Serial.print("[");Serial.print(i);Serial.print("]");
-                                      if(CANrxBuf[i] < 0x10)                // If data byte is less than 0x10, add a leading zero
-                                      {
-                                        Serial.print("0");
-                                 
-                                      }
-                                      Serial.print(CANrxBuf[i], HEX);
-                                      Serial.print(" ");
-                         }
-                   
-                    #endif
-                    
-                    if(CAN_MSG8_BIT_2_A == _CAN_REMOTE_ID ) {
-                    
-                            if(CAN_MSG8_BIT_8_A == TASK_TYPE_T_Slave_Ports_broadcast____) {
-                             #if not defined(DISABLE_ANY_PRINT)
-                                Serial.println("[CAN_MSG8_BIT_8_A]==[T_BCAST]->[ADD][PORTS]")   ;
-                                #endif      
-                                        Slave_Ports_Status_add_port(
-                                                                       Slave_Ports_Status_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_T_TO_DELETE_A,
-                                                                           Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                                                                       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 ,
-                                                                       time, 0
-                                                                       );
-                                } else if(CAN_MSG8_BIT_8_A == TASK_TYPE_T_request_set_new_Exp_state) { // if(CAN_MSG8_BIT_8_A == TASK_TYPE_T_Slave_Ports_broadcast____)
-                                   /*CAN_MSG8_A_Slave_Ports_Protocol_CAN_request_set_new_Exp_state_T
-                                       1 _Slave_Ports_Protocol_CAN_A._CAN_REMOTE_ID; // 0xFF;
-                                       2  = _Slave_Ports_Protocol_CAN_A._CAN_SENDER_ID; // 0xFF;
-                                       3 =_Slave_Ports_Protocol_CAN_A.Port_ID ; //0xFF;
-                                       4 = _Slave_Ports_Protocol_CAN_A.PortTypes ;//0xFF;
-                                       5 = _Slave_Ports_Protocol_CAN_A.Exp_state; // 0xFF;
-                                       6   _Slave_Ports_Protocol_CAN_A.Exp_state_ttl ;// 0xFF;
-                                       7=  _Slave_Ports_Protocol_CAN_A.Exp_state_level_A;// 0xFF;
-                                        8 =  _Slave_Ports_Protocol_CAN_A._CAN_8; // 0xFF;
-                                   */
-                                   
-                                    #if not defined(DISABLE_ANY_PRINT)
-                                      Serial.println("[CAN_MSG8_BIT_8_A]==[request_set_new_Exp_state]->[SET][PORTS]")   ;
-                                      #endif      
-                                       TASK_PORT_ASSOC_T TASK_PORT_ASSOC_A={
-                                         CAN_MSG8_BIT_3_A,
-                                         CAN_MSG8_BIT_1_A,
-                                         0
-                                        };
-                                       Slave_Ports_action_func(Slave_Ports_Status_QUEUE_A,  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A, Slave_Ports_Status_A , Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
-                                         TASK_TYPE_T_request_set_new_Exp_state , TASK_PORT_ASSOC_A,  time, time, ARDUINO_ARRAY_INDEX_NOT_SET ,  
-                                         CAN_MSG8_BIT_5_A , CAN_MSG8_BIT_7_A);
-                                    
-                                
-                                } else {
-                                 #if not defined(DISABLE_ANY_PRINT)
-                                    Serial.println("81[CAN][RECV][UNKNOWN][CAN_MSG8_BIT_8_A][")   ;
-                                    Serial.print(CAN_MSG8_BIT_8_A, HEX) ;
-                                    Serial.print("] ");
-                                    #endif   
-                                }
-                      } else { //if(CAN_MSG8_BIT_2_A == _CAN_REMOTE_ID ) {
-                                #if not defined(DISABLE_ANY_PRINT)
-                                    Serial.println("81[CAN][RECV][ERROR][_CAN_REMOTE_ID<>CAN_MSG8_BIT_2_A][")   ;
-                                    Serial.print(CAN_MSG8_BIT_2_A, HEX) ; Serial.print("]["); Serial.print(_CAN_REMOTE_ID, HEX) ;
-                                    Serial.print("] ");
-                                #endif
-                      }      
-                
-              } else { //if(CANlen == CAN_MSG_DATA8_LEN) 
-              
-             #if not defined(DISABLE_ANY_PRINT)
-                        for(int i = 0; i<CANlen; i++)           // Print each byte of the data
-                         {
-                           if(CANrxBuf[i] < 0x10)                // If data byte is less than 0x10, add a leading zero
-                           {
-                             Serial.print("0");
-                      
-                           }
-                           Serial.print(CANrxBuf[i], HEX);
-                           Serial.print(" ");
-                       
-                            
-                         }
-                   #endif
-                }
-             
-              Serial.println();
-  
-              
-         //   else Serial.println(" [CAN] [NOT][digitalRead(CAN_INTpin)] ");
-    
-          }
-    }

+ 0 - 9
SE/stuff/P5_Automation_can-dev-res/_CAN/_CAN_init.h

@@ -1,9 +0,0 @@
-
-#include <mcp_can.h>
-#include <SPI.h>
-
-long unsigned int CANrxId;
-unsigned char CANlen = 0;
-unsigned char CANrxBuf[8];
-//const int CAN_CSpin = 53 , CAN_INTpin = 10 ;
-MCP_CAN CAN0(CAN_CSpin);                          // Set CS to pin 10

+ 0 - 114
SE/stuff/P5_Automation_can-dev-res/_CAN/_CAN_setup.h

@@ -1,114 +0,0 @@
- //if(CAN0.begin(MCP_STDEXT, CAN_500KBPS, MCP_16MHZ) == CAN_OK) {
-
-#if defined(DEBUG_CAN) ||  defined(DEBUG)
-    Serial.print("#44 _CAN_setup.h will CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ) == CAN_OK ");
-#endif
-
-  if(CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ) == CAN_OK) {
-     /* TODO 
-     LCDarray1="MCP2515 Init Okay";
-     LCDarray2="500KBPS 16MHZ";
-     Serial.print(LCDarray1 + LCDarray2);
-     */
-            
-         #if  defined(DEBUG_CAN) || defined(DEBUG)
-             Serial.print("       [CAN_OK]   ");
-         #endif
-
-    #if defined(HAS_LCD1602)
-     /* TODO
-      LCD_print(LCDarray1, LCDarray2, LCDtim/5);
-      */
-    #endif
-    #if defined(HAS_TFT_ILI9163C)
-      /* TODO   delay(LCDtim);  
-      DISPLAY_DEV.setCursor(0,20); 
-      DISPLAY_DEV.print("MCP2515 Init Okay!!\r\n");
-      delay(LCDtim);
-      */ 
-    #endif
-  } else { 
-  
-          #if defined(DEBUG_CAN) || defined(DEBUG)
-             Serial.print("  #33     [CAN_ERROR]   ");
-         #endif
-
-  
-    /* TODO LCDarray1 = "MCP2515 Init Failed";
-     LCDarray2 = "CAN_CSpin: "; 
-     LCDarray2.concat(CAN_CSpin);  
-     LCDarray2.concat("CAN_INTpin: ");
-     LCDarray2.concat(CAN_INTpin);    
-    Serial.print(LCDarray1);
-    */
-      #if defined(HAS_LCD1602)
-          //LCD_print(LCDarray1, LCDarray2, LCDtim / 2 ) ;
-      #endif
-        /* TODO 
-      #if defined(HAS_TFT_ILI9163C)
-        delay(LCDtim);  
-        DISPLAY_DEV.setCursor(0,20); 
-        DISPLAY_DEV.print(LCDarray1);
-        delay(LCDtim); 
-         DISPLAY_DEV.setCursor(0,50); 
-         DISPLAY_DEV.print(LCDarray2);
-         delay(LCDtim); 
-      #endif
-      */
-  }
-
-
-//       #if Active_ControllerID == _Slave1_ID 
-        //#include "_SlaveID_setup.h" TODO FILTERS
-//       #elif Active_ControllerID == _ControllerID
-  /*       TODO  LCDarray1 = "Master Module       ";
-          LCDarray2 = "enabling remotes        ";
-          */
-      // #endif
-    //    Serial.println("");
-         #if defined(HAS_LCD1602)
-           /* TODO 
-          LCD_print(LCDarray1, LCDarray2, LCDtim / 5 ) ;
-          delay(LCDtim * 10); 
-          */
-         #endif
-         #if defined(HAS_TFT_ILI9163C)
-         /* TODO AAdelay(LCDtim);  
-          DISPLAY_DEV.setCursor(0,30); 
-          DISPLAY_DEV.print(LCDarray1); DISPLAY_DEV.print(" ");
-          DISPLAY_DEV.print(LCDarray2);
-
-          delay(LCDtim);
-          */ 
-         #endif
-         
-          #if defined(DEBUG_CAN) || defined(DEBUG)
-             Serial.print("  #366 will    [CAN0.setMode(MCP_NORMAL)]   ");
-         #endif
-
-  
-        CAN0.setMode(MCP_NORMAL);                // Change to normal mode to allow messages to be transmitted
-        pinMode(CAN_INTpin, INPUT);                       // Setting pin 2 for /INT input
-
-
-#if defined(HAS__PCINT_setup)
-        #if defined(DISABLE_LOOP) ||  defined(DEBUG)
-                     Serial.println("will  attachPinChangeInterrupt(CAN_INTpin, CAN_READ, RISING)");
-            #endif
-      attachPinChangeInterrupt(CAN_INTpin, CAN_READ, RISING); //FALLING //RISING 
-
-#endif
-
-
-         #if defined(DEBUG_CAN) || defined(DEBUG)
-             Serial.println("  #94 EOF   MCP can setup.  ");
-         #endif
-
-
-
-
-
-
-
-
-  //EOF CAN

+ 0 - 243
SE/stuff/P5_Automation_can-dev-res/_CAN/_Slave_Ports_Protocol_CAN_struct.h

@@ -1,243 +0,0 @@
-
-
-
-typedef INT8U CAN_MSG8_BIT_T ; //JEDEN BIT WIADOMOSCI CAN
-
-typedef CAN_MSG8_BIT_T CAN_MSG8_BIT_1_T ;
-typedef CAN_MSG8_BIT_T CAN_MSG8_BIT_2_T ;
-typedef CAN_MSG8_BIT_T CAN_MSG8_BIT_3_T ;
-typedef CAN_MSG8_BIT_T CAN_MSG8_BIT_4_T ;
-typedef CAN_MSG8_BIT_T CAN_MSG8_BIT_5_T ;
-typedef CAN_MSG8_BIT_T CAN_MSG8_BIT_6_T ;
-typedef CAN_MSG8_BIT_T CAN_MSG8_BIT_7_T ;
-typedef CAN_MSG8_BIT_T CAN_MSG8_BIT_8_T ;
-
-
-typedef  CAN_MSG8_BIT_T CAN_MSG8_T[8] ;
-
-//typedef int _SENDER_T  ;
-
-const int _CAN_REMOTE_ID_BROADCAST = 0xFF ;
-const int CAN_MSG_DATA8_LEN = 8 ;
-
-typedef int _REMOTE_Controller_ID_T ;
-
-typedef int _LOCAL_Controller_ID_T ;
-typedef int _CAN_SENDER_ID_T ; 
-typedef int _CAN_REMOTE_ID_T ; 
-
-const int _CAN_8_EMPTY = 0x07 ;
-//#define _Slave_ID_BROADCAST_T  _Slave_ID_BROADCAST  0xFF ; 
-
- #if ! defined(Active_ControllerID)
-    #error "#9 not defined Active_ControllerID"
- 
- #endif 
- 
- //byte sndStat = CAN0.sendMsgBuf(_Slave_Ports[i]._Slave_ID, 0, 8, data);
-
- //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};
-
- 
- 
- 
- struct _Slave_Ports_Protocol_CAN_message_S {
-  _CAN_REMOTE_ID_T _CAN_REMOTE_ID  ;   // 1remote id - use FF for broadcast
-    const _CAN_SENDER_ID_T _CAN_SENDER_ID = Active_ControllerID_HEX ; //2 sender //Device which orginated port 
-  int  Port_ID ; //3 global id for device //const char * const _Protocol;
-  PortTypes_T  PortTypes;  //4 0xFF  =  1111 1111 s
-  //int  Address ; //
-  //int  LocalPort; //
-  Exp_state_T  Exp_state;    //5
-  int  Exp_state_ttl;  //6
-  int  Broadcast_state;  //7
-  const int _CAN_8 = 0x04 ; //int(TASK_TYPE_T_Slave_Ports_broadcast____ ) ; // _CAN_8_EMPTY  ; //0x07 ; //8 - nbot used
-} ;
- 
- 
- 
- struct _Slave_Ports_Protocol_CAN_broadcast_S {
-  const _CAN_REMOTE_ID_T  _CAN_REMOTE_ID = _CAN_REMOTE_ID_BROADCAST ;   // 1remote id - use FF for broadcast
-  const _CAN_SENDER_ID_T  _CAN_SENDER_ID = Active_ControllerID_HEX ; //2 sender //Device which orginated port 
-  int  Port_ID ; //3 global id for device //const char * const _Protocol;
-  PortTypes_T  PortTypes;  //4 0xFF  =  1111 1111 s
-  //int  Address ; //
-  //int  LocalPort; //
-  Exp_state_T  Exp_state;    //5
-  int  Exp_state_ttl;  //6
-  int  Broadcast_state;  //7
-  const int _CAN_8 = 0x04; // int(TASK_TYPE_T_Slave_Ports_broadcast____) ; // _CAN_8_EMPTY; //0x07 ; //8 - nbot used
-} ;
-
- 
-typedef struct _Slave_Ports_Protocol_CAN_broadcast_S _Slave_Ports_Protocol_CAN_broadcast_T;
-
-
-
-
- 
- struct _Slave_Ports_Protocol_CAN_request_set_new_Exp_state_S {
-  _CAN_REMOTE_ID_T  _CAN_REMOTE_ID ;   // 1remote id - use FF for broadcast
-  const _CAN_SENDER_ID_T  _CAN_SENDER_ID = Active_ControllerID_HEX ; //2 sender //Device which orginated port 
-  int  Port_ID ; //3 global id for device //const char * const _Protocol;
-  PortTypes_T  PortTypes;  //4 0xFF  =  1111 1111 s
-  Exp_state_T  Exp_state;    //5
-  int  Exp_state_ttl;  //6
-  Exp_state_level_T  Exp_state_level_A;  //6
-  const int _CAN_8 = 0x03; // TASK_TYPE_T_request_set_new_Exp_state = 0x03 ; // _CAN_8_EMPTY; //0x07 ; //8 - nbot used
-} ;
-
-typedef struct _Slave_Ports_Protocol_CAN_request_set_new_Exp_state_S _Slave_Ports_Protocol_CAN_request_set_new_Exp_state_T ;
-
-
-
-typedef int _CAN_SEND_1_T  ; //1 byte = 0
-typedef int _CAN_SEND_2_T  ; //2 byte = 8 
-
- struct _Slave_Ports_Protocol_CAN_SEND_S {
-     const _CAN_SENDER_ID_T _CAN_SENDER_ID = Active_ControllerID_HEX ;
-     const  _CAN_SEND_1_T  _CAN_SEND_1 = 0 ;
-     const  _CAN_SEND_2_T  _CAN_SEND_2 = 8 ;
-     _Slave_Ports_Protocol_CAN_broadcast_T _Slave_Ports_Protocol_CAN_broadcast_A ;
-} ;
-
-
-typedef  byte _Slave_Ports_Protocol_CAN_broadcast_AS[8]  ;
-
-
-
-
-byte CAN_broadcast_to_data(_Slave_Ports_Protocol_CAN_broadcast_T 
-            &_Slave_Ports_Protocol_CAN_broadcast_A//,CAN_MSG8_T CAN_MSG8_A
-            ) {
-        //_Slave_Ports_Protocol_CAN_broadcast_AS
-        
-            //CAN_MSG8_BIT_1_T
-            byte CAN_MSG8_BIT_1_A = _Slave_Ports_Protocol_CAN_broadcast_A._CAN_REMOTE_ID;
-            CAN_MSG8_BIT_2_T CAN_MSG8_BIT_2_A = _Slave_Ports_Protocol_CAN_broadcast_A._CAN_SENDER_ID ;
-            CAN_MSG8_BIT_3_T CAN_MSG8_BIT_3_A = _Slave_Ports_Protocol_CAN_broadcast_A.Port_ID;
-            CAN_MSG8_BIT_4_T CAN_MSG8_BIT_4_A = _Slave_Ports_Protocol_CAN_broadcast_A.PortTypes ;
-            CAN_MSG8_BIT_5_T CAN_MSG8_BIT_5_A = _Slave_Ports_Protocol_CAN_broadcast_A.Exp_state;
-            CAN_MSG8_BIT_6_T CAN_MSG8_BIT_6_A = _Slave_Ports_Protocol_CAN_broadcast_A.Exp_state_ttl ;
-            CAN_MSG8_BIT_7_T CAN_MSG8_BIT_7_A = _Slave_Ports_Protocol_CAN_broadcast_A.Broadcast_state;
-            CAN_MSG8_BIT_8_T CAN_MSG8_BIT_8_A = _Slave_Ports_Protocol_CAN_broadcast_A._CAN_8;
-            
-         #if not defined(DISABLE_ANY_PRINT)
-                Serial.print("#80 CAN_broadcast_to_data   [  ");
-                   Serial.print(" "); Serial.print("1["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A._CAN_REMOTE_ID); Serial.print(".");   Serial.print(CAN_MSG8_BIT_1_A);  Serial.print("] ");
-                   Serial.print(" "); Serial.print("2["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A._CAN_SENDER_ID); Serial.print(".");   Serial.print(CAN_MSG8_BIT_2_A);  Serial.print("] ");
-                   Serial.print(" "); Serial.print("3["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A.Port_ID); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("4["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A.PortTypes); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("5["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A.Exp_state); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("6["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A.Exp_state_ttl); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("7["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A.Broadcast_state); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("8["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A._CAN_8); Serial.print("]  "); 
-                Serial.println("   "); 
-          #endif
-       byte  return_c[8] = {
-                       // 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07
-                      // CAN_MSG8_BIT_1_A , // _Slave_Ports_Protocol_CAN_broadcast_A._CAN_REMOTE_ID,
-                       0xFF,
-                         _Slave_Ports_Protocol_CAN_broadcast_A._CAN_SENDER_ID ,
-                         _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,
-                         4 //_Slave_Ports_Protocol_CAN_broadcast_A._CAN_8
-                        
-                      } ;
-        
-        return return_c;
-        
-}
-
-
-
-
-void CAN_MSG8_A_ptr(_Slave_Ports_Protocol_CAN_broadcast_T 
-            &_Slave_Ports_Protocol_CAN_broadcast_A ,
-            byte* CAN_MSG8_A
-            ) {
-        //_Slave_Ports_Protocol_CAN_broadcast_AS
-        
-            //CAN_MSG8_BIT_1_T
-          
-        //#ifdef DEBUG_CAN
-         #if not defined(DISABLE_ANY_PRINT)
-                Serial.print("#155 CAN_broadcast_to_data_ptr   [  ");
-                   Serial.print(" "); Serial.print("1["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A._CAN_REMOTE_ID); Serial.print("] ");
-                   Serial.print(" "); Serial.print("2["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A._CAN_SENDER_ID); Serial.print("] ");
-                   Serial.print(" "); Serial.print("3["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A.Port_ID); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("4["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A.PortTypes); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("5["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A.Exp_state); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("6["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A.Exp_state_ttl); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("7["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A.Broadcast_state); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("8["); Serial.print(_Slave_Ports_Protocol_CAN_broadcast_A._CAN_8); Serial.print("]  "); 
-                Serial.println("   ");
-            #endif 
-        // #endif
-         CAN_MSG8_A[0] = _Slave_Ports_Protocol_CAN_broadcast_A._CAN_REMOTE_ID; // 0xFF;
-         CAN_MSG8_A[1] = _Slave_Ports_Protocol_CAN_broadcast_A._CAN_SENDER_ID; // 0xFF;
-         CAN_MSG8_A[2] =_Slave_Ports_Protocol_CAN_broadcast_A.Port_ID ; //0xFF;
-          CAN_MSG8_A[3] = _Slave_Ports_Protocol_CAN_broadcast_A.PortTypes ;//0xFF;
-         CAN_MSG8_A[4] = _Slave_Ports_Protocol_CAN_broadcast_A.Exp_state; // 0xFF;
-          CAN_MSG8_A[5] =  _Slave_Ports_Protocol_CAN_broadcast_A.Exp_state_ttl ;// 0xFF;
-         CAN_MSG8_A[6] =  _Slave_Ports_Protocol_CAN_broadcast_A.Broadcast_state;// 0xFF;
-          CAN_MSG8_A[7] =  _Slave_Ports_Protocol_CAN_broadcast_A._CAN_8; // 0xFF;
-        
-}
-
-
-
-
-void CAN_MSG8_A_Slave_Ports_Protocol_CAN_request_set_new_Exp_state_T(_Slave_Ports_Protocol_CAN_request_set_new_Exp_state_T 
-            &_Slave_Ports_Protocol_CAN_A ,
-            byte* CAN_MSG8_A
-            ) {
-        //_Slave_Ports_Protocol_CAN_broadcast_AS
-        
-            //CAN_MSG8_BIT_1_T
-          
-        //#ifdef DEBUG_CAN
-         #if not defined(DISABLE_ANY_PRINT)
-                Serial.print("#155 CAN_broadcast_to_data_ptr   [  ");
-                   Serial.print(" "); Serial.print("1["); Serial.print(_Slave_Ports_Protocol_CAN_A._CAN_REMOTE_ID); Serial.print("] ");
-                   Serial.print(" "); Serial.print("2["); Serial.print(_Slave_Ports_Protocol_CAN_A._CAN_SENDER_ID); Serial.print("] ");
-                   Serial.print(" "); Serial.print("3["); Serial.print(_Slave_Ports_Protocol_CAN_A.Port_ID); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("4["); Serial.print(_Slave_Ports_Protocol_CAN_A.PortTypes); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("5["); Serial.print(_Slave_Ports_Protocol_CAN_A.Exp_state); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("6["); Serial.print(_Slave_Ports_Protocol_CAN_A.Exp_state_ttl); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("7["); Serial.print(_Slave_Ports_Protocol_CAN_A.Exp_state_level_A); Serial.print("]  ");
-                   Serial.print(" "); Serial.print("8["); Serial.print(_Slave_Ports_Protocol_CAN_A._CAN_8); Serial.print("]  "); 
-                Serial.println("   "); 
-                #endif
-        // #endif
-         CAN_MSG8_A[0] = _Slave_Ports_Protocol_CAN_A._CAN_REMOTE_ID; // 0xFF;
-         CAN_MSG8_A[1] = _Slave_Ports_Protocol_CAN_A._CAN_SENDER_ID; // 0xFF;
-         CAN_MSG8_A[2] =_Slave_Ports_Protocol_CAN_A.Port_ID ; //0xFF;
-          CAN_MSG8_A[3] = _Slave_Ports_Protocol_CAN_A.PortTypes ;//0xFF;
-         CAN_MSG8_A[4] = _Slave_Ports_Protocol_CAN_A.Exp_state; // 0xFF;
-          CAN_MSG8_A[5] =  _Slave_Ports_Protocol_CAN_A.Exp_state_ttl ;// 0xFF;
-         CAN_MSG8_A[6] =  _Slave_Ports_Protocol_CAN_A.Exp_state_level_A;// 0xFF;
-          CAN_MSG8_A[7] =  _Slave_Ports_Protocol_CAN_A._CAN_8; // 0xFF;
-        
-}
-
-
-
-
-
-
-void CAN_data_debug(byte data[8]) {
-    int i;
-     #if not defined(DISABLE_ANY_PRINT)
-    Serial.print("#102 CAN_data_debug   [  ");
-    for(i=0; i<8; i++) {
-        Serial.print(" "); Serial.print(i+1); Serial.print("["); Serial.print(data[i]); Serial.print("."); Serial.print(data[i], HEX); Serial.print("] "); 
-    }
-    Serial.println("   ");
-    #endif 
-}
-
-

+ 0 - 52
SE/stuff/P5_Automation_can-dev-res/_DRIVER_STATUS/_DRIVER_STATUS_struct.h

@@ -1,52 +0,0 @@
-
-typedef byte ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T ; //status inicjalizacji drivera
-
-typedef ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T ARDUINO_ARRAY_INDEX_DRIVER_REQUEST_T ;
-  //typedef byte  ARDUINO_DRIVER_STATUS_T ;
-
-typedef ARDUINO_ARRAY_INDEX_T ARDUINO_ARRAY_INDEX_DRIVER_T ; //DO NP INDEX GDIZE JEST ZAINCJALIZOWANY JAKIS HANDLER  Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A ...
-
-
-
-const ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T  ARDUINO_ARRAY_INDEX_DRIVER_STATUS_ERROR       = B00000001 ; //like when function didnt found associated record for such port
-const ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T  ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_ADD      = B00000010 ; //like when function didnt found associated record for such port
-const ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T  ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_INIT_A   = B00000100 ; // to init - e.g. Adafruit_PWMServoDriver_A[i].Adafruit_PWMServoDriver_V = Adafruit_PWMServoDriver(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A);  status inicjalizacji drivera
-const ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T  ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_SETUP_A  = B00001000 ; //like in setup loop Adafruit_PWMServoDriver_A[i].Adafruit_PWMServoDriver_V.begin(); status inicjalizacji drivera
-const ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T  ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_SETVAL_A = B00001000 ; //like Adafruit_PWMServoDriver_A[i].Adafruit_PWMServoDriver_V.setPWM(LocalPort, PWM_MIN, PWM_MAX); status inicjalizacji drivera
-
-
-
-
-
-
-/*  
-  const ARDUINO_DRIVER_STATUS_T ARDUINO_DRIVER_UNDEFINED            = B00000000  ;
-  const ARDUINO_DRIVER_STATUS_T ARDUINO_DRIVER_UNSET                = B00000001  ;
-  const ARDUINO_DRIVER_STATUS_T ARDUINO_DRIVER_INITIALIZED          = B00000010  ;
-  const ARDUINO_DRIVER_STATUS_T ARDUINO_DRIVER_INITIALIZED_BEGIN    = B00000100  ;
-  const ARDUINO_DRIVER_STATUS_T ARDUINO_DRIVER_INITIALIZED_FREQ     = B00001000  ;
-  
-*/
-
-
-
-struct ARDUINO_ARRAY_DRIVER_T {
-    ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A ;
-};
-
-struct ARDUINO_DRIVER_ATTR_ARRAY_S {
-    ARDUINO_ARRAY_INDEX_CURRENT_T ARDUINO_ARRAY_INDEX_CURRENT_A ;
-    ARDUINO_ARRAY_INDEX_LAST_T ARDUINO_ARRAY_INDEX_LAST_A ;
-    ARDUINO_ARRAY_COUNT_T ARDUINO_ARRAY_COUNT_A ;
-    ARDUINO_ARRAY_INDEX_LIMIT_T ARDUINO_ARRAY_INDEX_LIMIT_A;
-    ARDUINO_ARRAY_INDEX_NEXT_T ARDUINO_ARRAY_INDEX_NEXT_A ;
-    ARDUINO_ARRAY_time_min_run_MIN_T ARDUINO_ARRAY_time_min_run_MIN_A ;
-    ARDUINO_ARRAY_INDEX_time_min_run_MIN_T ARDUINO_ARRAY_INDEX_time_min_run_MIN_A ;
-};
-
-
-
-
-
-//void ARDUINO_ARRAY_DRIVER__add(ARDUINO_ARRAY_DRIVER_T* ARDUINO_ARRAY_DRIVER_A, 
- //   )

+ 0 - 3
SE/stuff/P5_Automation_can-dev-res/_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_config.h

@@ -1,3 +0,0 @@
-//I2C_driver_Adafruit_PWMServoDriver
- 
-//Adafruit_PWMServoDriver__add(Adafruit_PWMServoDriver_A,Adafruit_PWMServoDriver_ATTR_ARRAY_A);

+ 0 - 303
SE/stuff/P5_Automation_can-dev-res/_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_func.h

@@ -1,303 +0,0 @@
-
-
- 
- 
- // Adafruit_PWMServoDriver  Adafruit_PWMServoDriver_0X40 = Adafruit_PWMServoDriver(0x41);
-  
-  
- //disabled
- 
-  
-  
-  
-  
- int Adafruit_PWMServoDriver_init_all(Adafruit_PWMServoDriver_T* Adafruit_PWMServoDriver_A) {
-    int i;
-    //int *ptrNumber;
-    for(i=1;i<=ARDUINO_ARRAY_INDEX_LIMIT_PORTS_I2C ; i++) {
-       // if(not(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A == 0 )) {
-       if(Adafruit_PWMServoDriver_A[i].ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A == ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_INIT_A ) {
-            //Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A = I2C_ADDRESS_A;
-            //Adafruit_PWMServoDriver _class_cntr = Adafruit_PWMServoDriver(I2C_ADDRESS_A) ;
-            Serial.print("#39 PWMServoDriver  init for  i["); Serial.print(i);  Serial.print("]  I2C_ADDRESS_A["); Serial.print(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A); Serial.println("]");
-            Adafruit_PWMServoDriver_A[i].Adafruit_PWMServoDriver_V = Adafruit_PWMServoDriver(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A);
-        }
-    }
-    return 1;
-  }
-
-  
-  
- int Adafruit_PWMServoDriver_begin_all(Adafruit_PWMServoDriver_T* Adafruit_PWMServoDriver_A) {
-  int i;
-    for(i=1;i<=ARDUINO_ARRAY_INDEX_LIMIT_PORTS_I2C ; i++) {
-        //if(not(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A == 0)) {
-        if(Adafruit_PWMServoDriver_A[i].ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A == ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_SETUP_A ) {
-            Adafruit_PWMServoDriver_A[i].Adafruit_PWMServoDriver_V.begin();
-             Serial.print("#577 setPWM  begin ["); Serial.print(i);  Serial.println("]");
-            break;
-        }
-    }
-    return 1;
-  }
-  
-  
-
- int Adafruit_PWMServoDriver_init(Adafruit_PWMServoDriver_T* Adafruit_PWMServoDriver_A, 
- I2C_ADDRESS_T I2C_ADDRESS_A ) {
-    int i;
-    //int *ptrNumber;
-    for(i=1;i<=ARDUINO_ARRAY_INDEX_LIMIT_PORTS_I2C ; i++) {
-        if( Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A == I2C_ADDRESS_A and 
-            Adafruit_PWMServoDriver_A[i].ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A == ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_INIT_A ) {
-            Serial.print("#577 init PWMServoDriver ERROR already initialized   I2C_ADDRESS_A ["); Serial.print(I2C_ADDRESS_A);  Serial.println("]");
-        } else if(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A == 0 || Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A == I2C_ADDRESS_A) {
-            Adafruit_PWMServoDriver_A[i].ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A = ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_SETUP_A;
-            Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A = I2C_ADDRESS_A;
-            //Adafruit_PWMServoDriver _class_cntr = Adafruit_PWMServoDriver(I2C_ADDRESS_A) ;
-            Adafruit_PWMServoDriver_A[i].Adafruit_PWMServoDriver_V = Adafruit_PWMServoDriver(I2C_ADDRESS_A);
-            Serial.print("#577 init PWMServoDriver    ["); Serial.print(i);  Serial.println("]");
-            break;
-        }
-    }
-    return 1;
-  }
-
- int Adafruit_PWMServoDriver_begin(Adafruit_PWMServoDriver_T* Adafruit_PWMServoDriver_A,I2C_ADDRESS_T I2C_ADDRESS_A) {
-  int i;
-    for(i=1;i<=ARDUINO_ARRAY_INDEX_LIMIT_PORTS_I2C ; i++) {
-        if(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A == I2C_ADDRESS_A) {
-            Adafruit_PWMServoDriver_A[i].Adafruit_PWMServoDriver_V.begin();
-             Serial.print("#577 setPWM  begin ["); Serial.print(i);  Serial.println("]");
-            break;
-        }
-    }
-    return 1;
-  }
-
-
-
-
-
-int Adafruit_PWMServoDriver_setPWM(Adafruit_PWMServoDriver_T* Adafruit_PWMServoDriver_A,
- I2C_ADDRESS_T I2C_ADDRESS_A, int  LocalPort, int PWM_MIN, int PWM_MAX) {
- int i;
-    for(i=1;i<=ARDUINO_ARRAY_INDEX_LIMIT_PORTS_I2C ; i++) {
-        if(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A == I2C_ADDRESS_A ) {
-            Adafruit_PWMServoDriver_A[i].Adafruit_PWMServoDriver_V.setPWM(LocalPort, PWM_MIN, PWM_MAX);
-            Serial.print("#577 setPWM i["); Serial.print(i);  Serial.println("]"); 
-            break;
-        }
-    }
-    return 1;
-  } 
-
-
-
-
-ARDUINO_ARRAY_PRIMARY_KET_T Adafruit_PWMServoDriver__get_PRIMARY_KET_T(Adafruit_PWMServoDriver_T* Adafruit_PWMServoDriver_A, 
-Adafruit_PWMServoDriver_ATTR_ARRAY_T  &Adafruit_PWMServoDriver_ATTR_ARRAY_A,
- I2C_ADDRESS_T I2C_ADDRESS_A) {
- ARDUINO_ARRAY_PRIMARY_KET_T i;
-    for(i=ARDUINO_ARRAY_INDEX_FIRST;i<=Adafruit_PWMServoDriver_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ; i++) {
-        if(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A == I2C_ADDRESS_A ) {
-            if(Adafruit_PWMServoDriver_A[i].ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A  == ARDUINO_ARRAY_INDEX_DRIVER_STATUS_ERROR ) {
-             Serial.print("#83E I2C PWMServoDriver    ID["); Serial.print(i);  Serial.print(" ] STATUS ERR["); Serial.print(Adafruit_PWMServoDriver_A[i].ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A, BIN);  Serial.println("] ");
-            } else {
-            Serial.print("#83E I2C PWMServoDriver    ID["); Serial.print(i);  Serial.print(" ] STATUS ["); Serial.print(Adafruit_PWMServoDriver_A[i].ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A, BIN);  Serial.println("] ");
-           return i;
-            break;
-            }
-        }
-    }
-    return 0;
-  }
-
-
-
-
-ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T  Adafruit_PWMServoDriver__get_DRIVER_STATUS_T(Adafruit_PWMServoDriver_T* Adafruit_PWMServoDriver_A,  
- Adafruit_PWMServoDriver_ATTR_ARRAY_T  &Adafruit_PWMServoDriver_ATTR_ARRAY_A,
-I2C_ADDRESS_T I2C_ADDRESS_A) {
- ARDUINO_ARRAY_PRIMARY_KET_T i;
-    for(i=1;i<=ARDUINO_ARRAY_INDEX_LIMIT_PORTS_I2C ; i++) {
-        if(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A == I2C_ADDRESS_A ) {
-           return Adafruit_PWMServoDriver_A[i].ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A;
-            break;
-        }
-    }
-    return ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_ADD;
-  }
-
-
-
-
- 
- ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T Adafruit_PWMServoDriver__add(Adafruit_PWMServoDriver_T* Adafruit_PWMServoDriver_A,
-        Adafruit_PWMServoDriver_ATTR_ARRAY_T  &Adafruit_PWMServoDriver_ATTR_ARRAY_A , 
-        I2C_ADDRESS_T I2C_ADDRESS_A, ARDUINO_ARRAY_INDEX_DRIVER_REQUEST_T ARDUINO_ARRAY_INDEX_DRIVER_REQUEST_A
-        
-        ) {
-        
-        
-        //return ARDUINO_ARRAY_INDEX_DRIVER_STATUS_ERROR;
-        
-        if(ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_ADD == Adafruit_PWMServoDriver__get_DRIVER_STATUS_T(
-                                Adafruit_PWMServoDriver_A, Adafruit_PWMServoDriver_ATTR_ARRAY_A, I2C_ADDRESS_A))  {
-                    Adafruit_PWMServoDriver_A[Adafruit_PWMServoDriver_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A].I2C_ADDRESS_A = I2C_ADDRESS_A;
-                    Adafruit_PWMServoDriver_A[Adafruit_PWMServoDriver_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A].ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A = ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_SETUP_A;
-                    
-                     Serial.print("#138 PWMServoDriver__add I2C_ADDRESS_A[");  Serial.print(I2C_ADDRESS_A);   Serial.println("]  ");   Serial.print(" INDEX_NEXT_A[");  Serial.print(Adafruit_PWMServoDriver_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A);   Serial.print("]  REQUEST ?["); Serial.print(ARDUINO_ARRAY_INDEX_DRIVER_REQUEST_A, BIN);   Serial.print("]  Result?[");
-                    ARDUINO_ATTR_ARRAY_S__commit_added_element(Adafruit_PWMServoDriver_ATTR_ARRAY_A , Adafruit_PWMServoDriver_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A) ;
-                     Serial.print(" COMMIT() now INDEX_CURR_A[");  Serial.print(Adafruit_PWMServoDriver_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A); 
-                    Adafruit_PWMServoDriver_A[Adafruit_PWMServoDriver_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A].Adafruit_PWMServoDriver_V = Adafruit_PWMServoDriver(I2C_ADDRESS_A) ;
-                     
-                            Serial.print("     [init OK? ]   "); 
-                         
-                    Adafruit_PWMServoDriver_A[Adafruit_PWMServoDriver_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A].Adafruit_PWMServoDriver_V.begin()      ;
-                         Serial.print(" [begin OK? ]    "); 
-                         
-                    Adafruit_PWMServoDriver_A[Adafruit_PWMServoDriver_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A].Adafruit_PWMServoDriver_V.setPWMFreq(PortTypes_PWM_FREQ_DEFAULT) ;
-                     /*    Serial.print(" [setPWMFreq OFF ]    "); 
-                      Adafruit_PWMServoDriver_A[Adafruit_PWMServoDriver_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A].Adafruit_PWMServoDriver_V.setPWM(2, 0, 0) ;
-                      Adafruit_PWMServoDriver_A[Adafruit_PWMServoDriver_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A].Adafruit_PWMServoDriver_V.setPWM(3, 0, 0) ;
-                     */
-                  Serial.println("    [setPWMfreq  ON OK? ]    ");        
-                  Adafruit_PWMServoDriver_A[Adafruit_PWMServoDriver_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A].ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A = ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_SETVAL_A;
-                  return ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_SETVAL_A ;
-        } else {
-        
-        
-                  int i;
-                 //int *ptrNumber;
-                 for(i=1;i<=Adafruit_PWMServoDriver_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A ; i++) {
-                     if(not(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A == 0 )) {
-                         //Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A = I2C_ADDRESS_A;
-                         //Adafruit_PWMServoDriver _class_cntr = Adafruit_PWMServoDriver(I2C_ADDRESS_A) ;
-                         Adafruit_PWMServoDriver_A[i].Adafruit_PWMServoDriver_V = Adafruit_PWMServoDriver(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A);
-                         return ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_INIT_A ;
-                     }
-                 }
-                 return ARDUINO_ARRAY_INDEX_DRIVER_STATUS_ERROR ;
-        }
- }
-  
-  
-  
-
-
-
-
-void Adafruit_PWMServoDriver__print_status(Adafruit_PWMServoDriver_T* Adafruit_PWMServoDriver_A) {
- Serial.println("#99 Adafruit_PWMServoDriver__print_status ");
- ARDUINO_ARRAY_PRIMARY_KET_T i;
-    for(i=1;i<=ARDUINO_ARRAY_INDEX_LIMIT_PORTS_I2C ; i++) {
-       Serial.print(" i["); Serial.print(i); 
-       Serial.print("] I2C_ADDRESS_A[");  Serial.print(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A);
-       Serial.print("] ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A[");  Serial.print(Adafruit_PWMServoDriver_A[i].ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A, BIN);
-       Serial.println("] ");  
-    }
-    //return 1;
-  }
-
-
-
-
- //int Adafruit_PWMServoDriver_init_I = Adafruit_PWMServoDriver_init(Adafruit_PWMServoDriver_A, I2C_ADDRESS_AA);
- 
- int Adafruit_PWMServoDriver_init_I = Adafruit_PWMServoDriver_init_all(Adafruit_PWMServoDriver_A);
-
- 
-
-/*
-Adafruit_PWMServoDriver Adafruit_PWMServoDriver_F(I2C_ADDRESS_T I2C_ADDRESS_A) {
-    return * new Adafruit_PWMServoDriver(I2C_ADDRESS_A);
-}
-
-struct Adafruit_PWMServoDriver_S {
-        Adafruit_PWMServoDriver *Adafruit_PWMServoDriver_V ;
-    };
-
-
-
-Adafruit_PWMServoDriver_T Adafruit_PWMServoDriver_A = {
-    &Adafruit_PWMServoDriver_F(0x41)
-} ; 
-*/
-/*
-Adafruit_PWMServoDriver *Adafruit_PWMServoDriver_T[10];
-
- Adafruit_PWMServoDriver_T[0] = new Adafruit_PWMServoDriver(0x41);
-*/
-//Adafruit_PWMServoDriver Adafruit_PWMServoDriver_T[42] = new Adafruit_PWMServoDriver(0x42);
-
-
-//analog_reads[0]->member_function();       
-
-
-/*
-const size_t ANALOG_SIZE = 3;
-ResponsiveAnalogRead analog_reads[ANALOG_SIZE] = {
-    ResponsiveAnalogRead(A0, true),
-    ResponsiveAnalogRead(A1, true),
-    ResponsiveAnalogRead(A2, true)
-};
-
-
-Patching the library
-If you really want to initialize the array in setup(), then you can patch the file ResponsiveAnalogRead.h from the library:
-
-Add default values to all the parameters of the constructor. For example:
-ResponsiveAnalogRead(int pin=0, bool sleepEnable=0, float snapMultiplier=0.01);
-Add a method for setting the pin after initialization:
-void setPin(int newPin) { pin = newPin; pinMode(pin, INPUT); }
-The first change will enable you to compile your code as-is. The second change will allow you to update the objects in setup() rather than overwriting them (which I don't find very elegant):
-
-for (size_t i = 0; i < ANALOG_SIZE; i++) {
-    analog_reads[i].setPin(ANALOG_PINS[i]);
-    analog_reads[i].enableSleep();
-}
-Note that using the default constructor now has the side effect of setting pin 0 to input. This should not be a big deal, as the constructor is called before setup(), and all the IO pins are inputs at this point. If you want nevertheless to void that side effect, then set the default pin to -1, and patch the constructor to only configure the pin if it's not -1.
-
-Patching the library creates a maintenance burden though: you will have to reapply the patch each time the library is updated. This may not be that bad if you know how to git rebase or git merge, but ideally you would want to get a pull request accepted by the original maintainer.
-
-Edit: Before patching the library, consider weighting in this issue and using this fork.
-*/                    
-                                          //          
-                           //  ARDUINO_DRIVER_STATUS_T  Adafruit_PWMServoDriver_A =    ARDUINO_DRIVER_INITIALIZED_FREQ ;
-                             
-                               // Adafruit_PWMServoDriver_0X40.setPWM(0, 0, 200;
-                               //   Adafruit_PWMServoDriver_0X40.setPWM(0, 0, map(180, 0, 180, SERVOMIN, SERVOMAX));
-
-//I2C_driver_Adafruit_PWMServoDriver
-
-
-/*
-   Serial.println("pwm1.setPWM(0, 1024, 2000");
-  pwm1.setPWM(0, 1024, 3072);
-    delay(2500);
-    
-  
-  Serial.println("pwm1.setPWM(0, 2000, 3072");
-  pwm1.setPWM(0, 2000, 3072);
-  delay(2500);
-
-
- Serial.println("pwm1.setPWM(0, 3072, 2000");
-  pwm1.setPWM(0, 3072, 2000 );
-  delay(2500);
-
-
-  Serial.println("pwm1.setPWM(0, 1024, 3072");
-  pwm1.setPWM(0, 1024, 3072);
-  delay(2500);
-
-Serial.println("pwm1.setPWM(0, 4096, 0");
-   pwm1.setPWM(0, 4096, 0);
-  delay(2500);
-  
-   Serial.println("pwm1.setPWM(0, 0, 4096");
-   pwm1.setPWM(0, 0, 4096);
-  delay(2500);
-  
-}*/

+ 0 - 21
SE/stuff/P5_Automation_can-dev-res/_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_init.h

@@ -1,21 +0,0 @@
-//I2C_driver_Adafruit_PWMServoDriver
-
-
-//Adafruit_PWMServoDriver  Adafruit_PWMServoDriver_0X40 = Adafruit_PWMServoDriver(0x40);
-//Adafruit_PWMServoDriver  Adafruit_PWMServoDriver_0X41 = Adafruit_PWMServoDriver(0x41);
-
- 
- 
- //Adafruit_PWMServoDriver  Adafruit_PWMServoDriver_0X40 = Adafruit_PWMServoDriver(0x40);
- 
- /*
- 
- ARDUINO_METHOD_ARRAY_A = {
-        {    Adafruit_PWMServoDriver_A = Adafruit_PWMServoDriver(0x41) }
-    } ;
-    
-    */
-    
-   // TPQ<Adafruit_PWMServoDriver> Adafruit_PWMServoDriver_TPQ = TPQ<Adafruit_PWMServoDriver>(10);
-    
-    //Adafruit_PWMServoDriver_TPQ.push(Adafruit_PWMServoDriver Adafruit_PWMServoDriver_Q = Adafruit_PWMServoDriver(0x40));

+ 0 - 39
SE/stuff/P5_Automation_can-dev-res/_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_setup.h

@@ -1,39 +0,0 @@
-//  pwm1.begin();
-//  pwm1.setPWMFreq(1600);  // This is the maximum PWM frequency
-//  pwm1.setPWMFreq(50);  // This is the maximum PWM frequency
-
-
-#if defined(DISABLE_LOOP) || defined(DEBUG) || defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-         Serial.println("BEGIN #include _I2C_driver_Adafruit_PWMServoDriver_setup.h ");
-        Adafruit_PWMServoDriver__print_status(Adafruit_PWMServoDriver_A);
-#endif
-
-/*
-Adafruit_PWMServoDriver_0X40.begin(); 
-Adafruit_PWMServoDriver_0X40.setPWMFreq(PortTypes_PWM_FREQ_DEFAULT);
- Adafruit_PWMServoDriver_0X40.setPWM(3, 0, 0);
-  
-  
-   Adafruit_PWMServoDriver_0X40.setPWM(2, 0, 0);
-   */
-
-/* Adafruit_PWMServoDriver__add(Adafruit_PWMServoDriver_A,Adafruit_PWMServoDriver_ATTR_ARRAY_A);
-
-int Adafruit_PWMServoDriver_begin_all_R = Adafruit_PWMServoDriver_begin_all(Adafruit_PWMServoDriver_A); 
-*/
-/* redefine
-Adafruit_PWMServoDriver_0X40.begin();//Adafruit_PWMServoDriver_0X40
-Adafruit_PWMServoDriver_0X40.setPWMFreq(PortTypes_PWM_FREQ_DEFAULT);
-
-     Adafruit_PWMServoDriver_0X40.setPWM(3, 1024, 2500);
-  
-  
-   Adafruit_PWMServoDriver_0X40.setPWM(7, 1024, 2500);
-*/
-
-
-
-
-#if defined(DISABLE_LOOP) || defined(DEBUG)
-         Serial.println("END #include _I2C_driver_Adafruit_PWMServoDriver_setup.h ");
-#endif

+ 0 - 73
SE/stuff/P5_Automation_can-dev-res/_I2C_driver_Adafruit_PWMServoDriver/_I2C_driver_Adafruit_PWMServoDriver_struct.h

@@ -1,73 +0,0 @@
-//I2C_driver_Adafruit_PWMServoDriver
-#include <Wire.h>
-#include <Adafruit_PWMServoDriver.h>
-
-
-
-/*
-
-
-Board 0:  Address = 0x40  Offset = binary 00000 (no jumpers required)
-Board 1:  Address = 0x41  Offset = binary 00001 (bridge A0 as in the photo above)
-Board 2:  Address = 0x42  Offset = binary 00010 (bridge A1)
-Board 3:  Address = 0x43  Offset = binary 00011 (bridge A0 & A1)
-Board 4:  Address = 0x44  Offset = binary 00100 (bridge A2)
-
-*/
-
-/*
-struct ARDUINO_METHOD_ARRAY_S { //TODO TO ASSOCIATE CLASS METHODS BY INDEX
-    Adafruit_PWMServoDriver Adafruit_PWMServoDriver_A(I2C_ADDRESS_T I2C_ADDRESS_A ) ;
-};
-
-typedef struct ARDUINO_METHOD_ARRAY_S ARDUINO_METHOD_ARRAY_T ;
-*/
-
-
-
-//Adafruit_PWMServoDriver Adafruit_PWMServoDriver_T[0] = new Adafruit_PWMServoDriver(0x41);
-
-
-typedef struct ARDUINO_ATTR_ARRAY_S  Adafruit_PWMServoDriver_ATTR_ARRAY_T;
-
-static Adafruit_PWMServoDriver_ATTR_ARRAY_T  Adafruit_PWMServoDriver_ATTR_ARRAY_A =  //[ARDUINO_ATTR_ARRAY_S_INDEX] 
-        {    ARDUINO_ARRAY_INDEX_CURRENT_INIT ,
-             ARDUINO_ARRAY_INDEX_LAST_INIT ,
-             ARDUINO_ARRAY_COUNT_T_INIT ,
-             ARDUINO_ARRAY_INDEX_LIMIT_PORTS , 
-             ARDUINO_ARRAY_INDEX_NEXT_INIT,
-             ARDUINO_ARRAY_time_min_run_MIN_INIT,
-             ARDUINO_ARRAY_INDEX_time_min_run_MIN_INIT  
-              }
-    ;
-
-
-struct Adafruit_PWMServoDriver_S {
-        //USE I2C_ARRAY_DRIVER_T;
-            I2C_ADDRESS_T I2C_ADDRESS_A;
-            // USE ARDUINO_ARRAY_DRIVER_T;
-              ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A ;
-        Adafruit_PWMServoDriver Adafruit_PWMServoDriver_V ;
-        
-    };
-  
-  typedef struct Adafruit_PWMServoDriver_S Adafruit_PWMServoDriver_T;
-  
-  static Adafruit_PWMServoDriver_T Adafruit_PWMServoDriver_A[ARDUINO_ARRAY_INDEX_LIMIT_PORTS_I2C]={};
-  
-  
-  
-  
- 
-  
-  /*
-  
-  static Adafruit_PWMServoDriver_T Adafruit_PWMServoDriver_A[5] = {
-       { I2C_ADDRESS_0x40 }
-       //,
-      // { I2C_ADDRESS_0x41 },
-      // { I2C_ADDRESS_0x42 },
-      // { I2C_ADDRESS_0x43 },
-      // { I2C_ADDRESS_0x44 }
-  };
- */

+ 0 - 266
SE/stuff/P5_Automation_can-dev-res/_LCD1602_func.h

@@ -1,266 +0,0 @@
-
-
-void LCD_print_background_add(_LCD_print_bufforT* _LCD_print_buffors, int screenID, int cursor1, int cursor2, char character ,long time_seq_id, long time_min_run ) {
-  //time_seq_id - used to maintain single display context
-  //time_max - used to how much time to keep in displayed text
- // Serial.println("  runned LCD_print_background_screen_add bbuf:  ");
-     // Serial.print(sizeof(_LCD_print_buffors));
-       Serial.print("CB:");
-      int curr_buf_ind;
-      int i ;
-       for(i=1;i<=100;i++) {
-          if(_LCD_print_buffors[i].screenID<=0) {
-            Serial.print("i<=0[");   Serial.print(i);   Serial.print("]");  
-            curr_buf_ind = i; 
-            //if(_LCD_print_buffors[i + 1].screenID<=0)
-            break;
-          }
-       }
-              Serial.print(curr_buf_ind);   Serial.print(".  ");
-//char b = character.charAt(0); 
-   Serial.print(" added lcd buf at ind "); Serial.println(curr_buf_ind );
-   int b_ascii_value = character;
-_LCD_print_buffors[curr_buf_ind] = { screenID , cursor1 , cursor2, b_ascii_value, time_seq_id , time_min_run} ;
-/*
-     _LCD_print_buffors[screenID].screenID=screenID ;
-     _LCD_print_buffors[screenID].cursor1=cursor1 ;
-     _LCD_print_buffors[screenID].cursor2=cursor2 ;
-     _LCD_print_buffors[screenID].character=b_ascii_value ;
-     _LCD_print_buffors[screenID].time_seq_id=time_seq_id ;
-     _LCD_print_buffors[screenID].time_min_run=time_min_run ;
-     */
-}
-
-
-void LCD_print_background_screen_add(_LCD_print_screensT* _LCD_print_screens, int screenID,long time_seq_id, long time_min_run, char LCDarray1, char LCDarray2 ) {
-  //time_seq_id - used to maintain single display context
-  //time_max - used to how much time to keep in displayed text
-  
-     _LCD_print_screens[screenID].screenID=screenID ;
-     _LCD_print_screens[screenID].time_seq_id=time_seq_id ;
-     _LCD_print_screens[screenID].time_min_run=time_min_run ;
-     _LCD_print_screens[screenID].LCDarray1=LCDarray1 ;
-     _LCD_print_screens[screenID].LCDarray2=LCDarray2 ;
-   Serial.print(" added to screen a1  "); Serial.println(String(LCDarray1) );
- 
-    //  unsigned char LCDarray2buf[16];
-    //   LCDarray2.toCharArray(LCDarray2buf, 15);
-  /*
-                                     for ( int positionCounter1 = 0;
-                                        positionCounter1 < 24; positionCounter1++)
-                                            {
-                                              LCD_print_background_add( _LCD_print_buffors,            screenID,           positionCounter1,           0,              LCDarray1[positionCounter1],              time_seq_id,              time_min_run);
-                                              Serial.print("A.");
-                                            }
-                                         
-                                     for ( int positionCounter2 = 0;
-                                        positionCounter2 < 24; positionCounter2++)
-                                            {
-                                            LCD_print_background_add( _LCD_print_buffors,            screenID,           positionCounter2,           1,              LCDarray2[positionCounter2],              time_seq_id,              time_min_run);
-                                            }
-         Serial.print(" :");
-        Serial.print(sizeof(_LCD_print_buffors));
-       Serial.print(" :");
-       */
-}
-
-
-//  _LCD_print_bufforT  _LCD_print_bufforss[] = {  0 , 0, "T", 10000, 50000 } ;
-
-
-void LCD_print_background(int cursor1, int cursor2, int character ,long time_seq_id, long time_min_run ) {
-  //time_seq_id - used to maintain single display context
-  //time_max - used to how much time to keep in displayed text
-}
-
-
- 
-
-void _LCD_print_screens_list(_LCD_print_screensT* _LCD_print_screens ) {
- int i;
-
-
-   Serial.print("sizeof(_LCD_print_screens): ");
-    Serial.println(sizeof(_LCD_print_screens));
- for(i=0;i<=10;i++) { //sizeof(_LCD_print_buffors)
-          Serial.print(" $i[");
-          Serial.print(i);
-
-          Serial.print("] screenID: ");
-          Serial.print(_LCD_print_screens[i].screenID);
-
-
-           String str((char*) _LCD_print_screens[i].LCDarray1);
-
-          Serial.print(" LCDarray1 ph: ");
-          Serial.println( str);
-
-
-          Serial.print(" LCDarray1 len: ");
-          Serial.println( sizeof(str));
-         
-         
-          Serial.print(" LCDarray1: ");
-          Serial.println( Serial.println((char*) _LCD_print_screens[i].LCDarray1) );
-     
-           Serial.print(" LCDarray2: ");
-          Serial.write(_LCD_print_screens[i].LCDarray2);
-
-           Serial.print(" time_seq_id: ");
-           
-          Serial.write( _LCD_print_screens[i].time_seq_id );
-          
-
-       
-           Serial.print(" time_seq_id: ");
-          Serial.println(_LCD_print_screens[i].time_seq_id);
-
-        
-
-      
-        }
-      
-}
-
-
-void _LCD_print_buffors_list(_LCD_print_bufforT* _LCD_print_buffors, int LCDtim ) {
- int i;
-   Serial.print("sizeof(_LCD_print_buffors): ");
-    Serial.println(sizeof(_LCD_print_buffors));
- for(i=0;i<=100;i++) { //sizeof(_LCD_print_buffors)
-          Serial.print(" $i[");
-          Serial.print(i);
-
-          Serial.print("] _LCD_print_buffors screenID: ");
-          Serial.print(_LCD_print_buffors[i].screenID);
-          
-          Serial.print(" cursor1: ");
-          Serial.print(_LCD_print_buffors[i].cursor1);
-           Serial.print(" cursor2: ");
-          Serial.print(_LCD_print_buffors[i].cursor2);
-
-           Serial.print(" character: ");
-           
-          Serial.write( _LCD_print_buffors[i].character );
-          
-
-       
-           Serial.print(" time_seq_id: ");
-          Serial.print(_LCD_print_buffors[i].time_seq_id);
-
-          Serial.print(" time_min_run: ");  
-          Serial.println(_LCD_print_buffors[i].time_min_run);
-
-      
-        }
-        lcd.setCursor(0,0); 
-       lcd.print("print_buffors");  // Print a message to the LCD.
-        lcd.setCursor(0,1); 
-         lcd.print(String( _LCD_print_buffors[0].character)); 
-          lcd.print(" , "); 
-           lcd.print(String( _LCD_print_buffors[1].character)); 
-         delay(LCDtim * 5);
-}
-
-void LCD_print(String LCDarray1, String LCDarray2 ,int LCDtim) {
-
-      delay(LCDtim);   
-      unsigned char LCDarray1buf[16];
-      LCDarray1.toCharArray(LCDarray1buf, 16);
- 
-      unsigned char LCDarray2buf[16];
-       LCDarray2.toCharArray(LCDarray2buf, 16);
-
-     // lcd.setCursor(0,0); 
-     // lcd.print(LCDarray1);
-     // lcd.setCursor(0,1); 
-     // lcd.print(LCDarray1);
-
-                                        lcd.setCursor(16,0); 
- 
-                                         for ( int positionCounter1 = 0;
-                                        positionCounter1 <= 24 ;//LCDarray1.length(); // 24;
-                                        positionCounter1++)
-                                            {
-                                              lcd.scrollDisplayLeft();  //Scrolls the contents of the display one space to the left.
-                                              if(positionCounter1 >= LCDarray1.length())  lcd.print(" ");
-                                              else lcd.print(LCDarray1[positionCounter1]);  // Print a message to the LCD.
-                                              delay(LCDtim);  //wait for 250 microseconds
-                                              if(positionCounter1==10) delay(LCDtim *7 ); 
-                                            }
-                                          //  lcd.clear();  //Clears the LCD screen and positions the cursor in the upper-left corner.
-
-
-
-
-                                          
-                                          lcd.setCursor(16,1); 
-                                         for ( int positionCounter2 = 0;
-                                        positionCounter2 <= 24;//LCDarray2.length();//24; 
-                                        positionCounter2++)
-                                            {
-                                              lcd.scrollDisplayLeft();  //Scrolls the contents of the display one space to the left.
-                                              if(positionCounter2 >= LCDarray2.length())  lcd.print(" "); 
-                                              else lcd.print(LCDarray2[positionCounter2]);  // Print a message to the LCD.
-                                              delay(LCDtim);  //wait for 250 microseconds
-                                               if(positionCounter2==10) delay(LCDtim *7 );
-                                            }
-                                            delay(LCDtim  * 5);  //wait for 250 microseconds
-                                          //  lcd.clear();  //Clears the LCD screen and positions the cursor in the upper-left corner.
-                                           
-
-      
-      delay(LCDtim);   
-
-      
-
-/*
-
-struct record
-{
-   int bookId;
-   int qtyInStock;
-
-};
-typedef struct record Record;
-
-void sold(int id, Record* records) {
-  int i;
-  for(i=0;i<3;i++) {
-    if(records[i].bookId == id) {
-      records[i].qtyInStock--;
-    }
-  }
-}
-*/
-/*
-void updateId(int id, int new_id, Record* records) {
-  int i;
-  for(i=0;i<3;i++) {
-    if(records[i].bookId == id) {
-        records[i].bookid = new_id;
-    }
-  }
-}
-*/
-/*
-void updateQty(int id, int new_qty, Record* records) {
-  int i;
-  for(i=0;i<3;i++) {
-    if(records[i].bookId == id) {
-        records[i].qtyInStock = new_qty;
-    }
-  }
-}
-*/
-
-
-}           
-                            
-String make_str16(String str){
-    for(int i = 0; i < (16 - str.length()); i++)
-        str += ' ';  
-    return str;
-}
-                
-                     

+ 0 - 9
SE/stuff/P5_Automation_can-dev-res/_LCD1602_init.h

@@ -1,9 +0,0 @@
-                            
-
-Queue<int> _LCD_print_queue = Queue<int>(5);
-
-
- _LCD_print_bufforT _LCD_print_buffors[1];
- _LCD_print_screensT _LCD_print_screens[10];
-
-                 

+ 0 - 2
SE/stuff/P5_Automation_can-dev-res/_LCD1602_setup.h

@@ -1,2 +0,0 @@
- lcd.begin(16, 2);
-     //LCD_print(LCDarray1, LCDarray2, LCDtim/5);

+ 0 - 86
SE/stuff/P5_Automation_can-dev-res/_LCD1602_struct.h

@@ -1,86 +0,0 @@
-                            
-
-
- 
- struct _LCD_print_bufforS {
-  int screenID;
-  int cursor1;
-  int cursor2;
- int character ;
- long time_seq_id;
- long time_min_run;
-} ;
-
-typedef struct _LCD_print_bufforS _LCD_print_bufforT;
-
-//struct LCDarray1S {
-//   char LCDarray1[16];
-//}
-
-struct _LCD_print_screenS {
-  int screenID;
-  char LCDarray1;
-  char LCDarray2;
-   long time_seq_id;
-   long time_min_run;
-  // _LCD_print_bufforT ;
-} ;
-
-
-typedef struct _LCD_print_screenS _LCD_print_screensT;
-
-   int b_ascii_value = character;
-
-
-      
-
-/*
-
-struct record
-{
-   int bookId;
-   int qtyInStock;
-
-};
-typedef struct record Record;
-
-void sold(int id, Record* records) {
-  int i;
-  for(i=0;i<3;i++) {
-    if(records[i].bookId == id) {
-      records[i].qtyInStock--;
-    }
-  }
-}
-*/
-/*
-void updateId(int id, int new_id, Record* records) {
-  int i;
-  for(i=0;i<3;i++) {
-    if(records[i].bookId == id) {
-        records[i].bookid = new_id;
-    }
-  }
-}
-*/
-/*
-void updateQty(int id, int new_qty, Record* records) {
-  int i;
-  for(i=0;i<3;i++) {
-    if(records[i].bookId == id) {
-        records[i].qtyInStock = new_qty;
-    }
-  }
-}
-*/
-
-
-}           
-                            
-String make_str16(String str){
-    for(int i = 0; i < (16 - str.length()); i++)
-        str += ' ';  
-    return str;
-}
-                
-                                      

+ 0 - 459
SE/stuff/P5_Automation_can-dev-res/_PCINT/_PCINT-dev.h

@@ -1,459 +0,0 @@
-/*
-attachInterrupt(digitalPinToInterrupt(pin), ISR, mode) (recommended)
-attachInterrupt(interrupt, ISR, mode) (not recommended)
-attachInterrupt(pin, ISR, mode) (Not recommended. Additionally, this syntax only works on Arduino SAMD Boards, Uno WiFi Rev2, Due, and 101.)
-
-
-Parameters
-interrupt: the number of the interrupt. Allowed data types: int.
-pin: the Arduino pin number.
-ISR: the ISR to call when the interrupt occurs; this function must take no parameters and return nothing. This function is sometimes referred to as an interrupt service routine.
-mode: defines when the interrupt should be triggered. Four constants are predefined as valid values:
-
-LOW to trigger the interrupt whenever the pin is low,
-
-CHANGE to trigger the interrupt whenever the pin changes value
-
-RISING to trigger when the pin goes from low to high,
-
-FALLING for when the pin goes from high to low.
-
-The Due, Zero and MKR1000 boards allow also:
-
-HIGH to trigger the interrupt whenever the pin is high.
-
-
-
-
-onst byte ledPin = 13;
-const byte interruptPin = 2;
-volatile byte state = LOW;
-
-void setup() {
-  pinMode(ledPin, OUTPUT);
-  pinMode(interruptPin, INPUT_PULLUP);
-  attachInterrupt(digitalPinToInterrupt(interruptPin), blink, CHANGE);
-}
-
-void loop() {
-  digitalWrite(ledPin, state);
-}
-
-void blink() {
-  state = !state;
-}
-
-
-
-
-
-BOARD               INT.0         INT.1         INT.2       INT.3         INT.4         INT.5
-Uno, Ethernet         2             3
-Mega2560              2             3            21          20             19            18
-32u4 based (e.g 
-Leonardo, Micro)      3             2             0           1             7
-
-*/
-
-
-/*
- *
- 
- http://arduinowo.pl/przerwania-typu-pcint-klawiatura/
- http://arduinowo.pl/generatory/pin_int/
-
- 
- 
- */
-
-
- 
- // FOR ATMEGA
-   
-//  void setup ()
-
-  #include <avr/interrupt.h> 
-
-  #define   sei()
-  #define   cli()
-
- // Macros for writing interrupt handler functions
-#define   ISR(vector, attributes)
-#define   SIGNAL(vector)
-#define   EMPTY_INTERRUPT(vector)
-#define   ISR_ALIAS(vector, target_vector)
-#define   reti() 
-#define   BADISR_vect
-
-
-//ISR attributes
-#define   ISR_BLOCK
-#define   ISR_NOBLOCK
-#define   ISR_NAKED
-#define   ISR_ALIASOF(target_vector)
-
-/*
- Introduction to avr-libc's interrupt handling
-
-It's nearly impossible to find compilers that agree on how to handle interrupt code. Since the C language tries to stay away from machine dependent details, each compiler writer is forced to design their method of support.
-
-In the AVR-GCC environment, the vector table is predefined to point to interrupt routines with predetermined names. By using the appropriate name, your routine will be called when the corresponding interrupt occurs. The device library provides a set of default interrupt routines, which will get used if you don't define your own.
-
-Patching into the vector table is only one part of the problem. The compiler uses, by convention, a set of registers when it's normally executing compiler-generated code. It's important that these registers, as well as the status register, get saved and restored. The extra code needed to do this is enabled by tagging the interrupt function with __attribute__((signal)).
-
-These details seem to make interrupt routines a little messy, but all these details are handled by the Interrupt API. An interrupt routine is defined with ISR(). This macro register and mark the routine as an interrupt handler for the specified peripheral. The following is an example definition of a handler for the ADC interrupt.
- */
-
-/*ISR(ADC_vect)
-{
-    // user code here
-}
-*/
-/*
- Catch-all interrupt vector
-
-If an unexpected interrupt occurs (interrupt is enabled and no handler is installed, which usually indicates a bug), then the default action is to reset the device by jumping to the reset vector. You can override this by supplying a function named BADISR_vect which should be defined with ISR() as such. (The name BADISR_vect is actually an alias for __vector_default. The latter must be used inside assembly code in case <avr/interrupt.h> is not included.)
-
-//#include <avr/interrupt.h>
-*/
-/*
-ISR(BADISR_vect)
-{
-    // user code here
-}
- */
-
-/*Nested interrupts
-
-The AVR hardware clears the global interrupt flag in SREG before entering an interrupt vector. 
-Thus, normally interrupts will remain disabled inside the handler until the handler exits, where the RETI instruction
-(that is emitted by the compiler as part of the normal function epilogue for an interrupt handler) will eventually re-enable further interrupts. For that reason,
-interrupt handlers normally do not nest. For most interrupt handlers, this is the desired behaviour, for some it is even required in order to prevent infinitely 
-recursive interrupts (like UART interrupts, or level-triggered external interrupts). In rare circumstances though it might be desired to re-enable the global 
-interrupt flag as early as possible in the interrupt handler, in order to not defer any other interrupt more than absolutely needed. This could be done using an sei() 
-instruction right at the beginning of the interrupt handler, but this still leaves few instructions inside the compiler-generated function prologue to run with global
-interrupts disabled. The compiler can be instructed to insert an SEI instruction right at the beginning of an interrupt handler by declaring the handler the following way:
-
-*/
-
-ISR(PCINT0_vect, ISR_NOBLOCK)
-{
- // ...
-}
-//where XXX_vect is the name of a valid interrupt vector for the MCU type in question, as explained below.
-
-/*
-Two vectors sharing the same code
-
-In some circumstances, the actions to be taken upon two different interrupts might be completely identical so a single implementation for the ISR would suffice. 
-For example, pin-change interrupts arriving from two different ports could logically signal an event that is independent from the actual port (and thus interrupt vector)
-where it happened. Sharing interrupt vector code can be accomplished using the ISR_ALIASOF() attribute to the ISR macro:
-*/
-/*
-ISR(PCINT0_vect)
-{
-
-  //...
-  // Code to handle the event.
-}
-
-ISR(PCINT1_vect, ISR_ALIASOF(PCINT0_vect));
-*/
-/*
-Note
-There is no body to the aliased ISR.
-Note that the ISR_ALIASOF() feature requires GCC 4.2 or above (or a patched version of GCC 4.1.x).
-See the documentation of the ISR_ALIAS() macro for an implementation which is less elegant but could be applied to all compiler versions.
-
-
-*/
-
-/*
-Empty interrupt service routines
-In rare circumstances, in interrupt vector does not need any code to be implemented at all. The vector must be declared anyway, so when the interrupt triggers it won't
-execute the BADISR_vect code (which by default restarts the application).
-
-This could for example be the case for interrupts that are solely enabled for the purpose of getting the controller out of sleep_mode().
-
-A handler for such an interrupt vector can be declared using the EMPTY_INTERRUPT() macro:
-
-*/
-  #define EMPTY_INTERRUPT  (   vector  ) 
-
-//  Note There is no body to this macro.
-
-
-
-/*
-Manually defined ISRs
-
-In some circumstances, the compiler-generated prologue and epilogue of the ISR might not be optimal for the job, and a manually defined ISR could be considered particularly to speedup the interrupt handling.
-
-One solution to this could be to implement the entire ISR as manual assembly code in a separate (assembly) file. See Combining C and assembly source files for an example of how to implement it that way.
-
-Another solution is to still implement the ISR in C language but take over the compiler's job of generating the prologue and epilogue. 
-This can be done using the ISR_NAKED attribute to the ISR() macro. Note that the compiler does not generate anything as prologue or epilogue,
-so the final reti() must be provided by the actual implementation. SREG must be manually saved if the ISR code modifies it, and the compiler-implied assumption 
-of __zero_reg__ always being 0 could be wrong (e. g. when interrupting right after of a MUL instruction).
-
-ISR(TIMER1_OVF_vect, ISR_NAKED)
-{
-  PORTB |= _BV(0);  // results in SBI which does not affect SREG
-  reti();
-}
-
-*/ 
-
-
-/*
-Choosing the vector: Interrupt vector names
-
-The interrupt is chosen by supplying one of the symbols in following table.
-
-There are currently two different styles present for naming the vectors. One form uses names starting with SIG_, followed by a relatively verbose but arbitrarily chosen name describing the interrupt vector. 
-This has been the only available style in avr-libc up to version 1.2.x.
-
-Starting with avr-libc version 1.4.0, a second style of interrupt vector names has been added, where a short phrase for the vector description is followed by _vect. 
-The short phrase matches the vector name as described in the datasheet of the respective device (and in Atmel's XML files), with spaces replaced by an underscore and other non-alphanumeric characters dropped. 
-Using the suffix _vect is intented to improve portability to other C compilers available for the AVR that use a similar naming convention.
-
-The historical naming style might become deprecated in a future release, so it is not recommended for new projects.
-
-Note
-being usable as an interrupt function, is not actually wired into the interrupt vector table. The compiler will generate a warning if it detects a suspiciously looking name of a ISR() 
-function (i.e. one that after macro replacement does not start with "__vector_").
-
-Vector name               Old vector name            Description                 Applicable for device
-ADC_vect                  SIG_ADC                    ADC Conversion Complete      AT90S2333, AT90S4433, AT90S4434, AT90S8535, AT90PWM216, AT90PWM2B, AT90PWM316, AT90PWM3B, AT90PWM3, AT90PWM2, AT90PWM1, AT90CAN128, AT90CAN32, AT90CAN64, ATmega103, ATmega128, ATmega1284P, ATmega16, ATmega163, ATmega165, ATmega165P, ATmega168P, ATmega169, ATmega169P, ATmega32, ATmega323, ATmega325, ATmega3250, ATmega3250P, ATmega328P, ATmega329, ATmega3290, ATmega3290P, ATmega48P, ATmega64, ATmega645, ATmega6450, ATmega649, ATmega6490, ATmega8, ATmega8535, ATmega88P, ATmega168, ATmega48, ATmega88, ATmega640, ATmega1280, ATmega1281, ATmega2560, ATmega2561, ATmega324P, ATmega164P, ATmega644P, ATmega644, ATtiny13, ATtiny15, ATtiny26, ATtiny43U, ATtiny48, ATtiny24, ATtiny44, ATtiny84, ATtiny45, ATtiny25, ATtiny85, ATtiny261, ATtiny461, ATtiny861, AT90USB1287, AT90USB1286, AT90USB647, AT90USB646
-
- */
-
-char attributes;
- 
-#define ISR  (   vector, attributes )   
-
-/*
- Introduces an interrupt handler function (interrupt service routine) that runs with global interrupts initially disabled by default with no attributes specified.
-
-The attributes are optional and alter the behaviour and resultant generated code of the interrupt routine. Multiple attributes may be used for a single function, with a space seperating each attribute.
-
-Valid attributes are ISR_BLOCK, ISR_NOBLOCK, ISR_NAKED and ISR_ALIASOF(vect).
-
-vector must be one of the interrupt vector names that are valid for the particular MCU type.
- */
-
-#define ISR_ALIAS  (   vector, target_vector  )   
-/*
-Aliases a given vector to another one in the same manner as the ISR_ALIASOF attribute for the ISR() macro. Unlike the ISR_ALIASOF attribute macro however, this is compatible for all versions of GCC rather than just GCC version 4.2 onwards.
-
-Note
-This macro creates a trampoline function for the aliased macro. This will result in a two cycle penalty for the aliased vector compared to the ISR the vector is aliased to, due to the JMP/RJMP opcode used.
-Deprecated:
-For new code, the use of ISR(..., ISR_ALIASOF(...)) is recommended.
-Example:
-
-    1 ISR(INT0_vect)
-    2 {
-    3     PORTB = 42;
-    4 }
-    5 
-    6 ISR_ALIAS(INT1_vect, INT0_vect);
- */
-
- #define ISR_ALIASOF (   target_vector ) 
-//The ISR is linked to another ISR, specified by the vect parameter. This is compatible with GCC 4.2 and greater only.
-//Use this attribute in the attributes parameter of the ISR macro.
-
-
-#define ISR_BLOCK
-
-/*
- Identical to an ISR with no attributes specified. Global interrupts are initially disabled by the AVR hardware when entering the ISR, without the compiler modifying this state.
-Use this attribute in the attributes parameter of the ISR macro.
- */
-
- #define ISR_NAKED
-/*
- ISR is created with no prologue or epilogue code. The user code is responsible for preservation of the machine state including the SREG register, as well as placing a reti() at the end of the interrupt routine.
-
-Use this attribute in the attributes parameter of the ISR macro.
- */
-
-#define ISR_NOBLOCK
-/*
- ISR runs with global interrupts initially enabled. The interrupt enable flag is activated by the compiler as early as possible within the ISR to ensure minimal processing delay for nested interrupts.
-
-This may be used to create nested ISRs, however care should be taken to avoid stack overflows, or to avoid infinitely entering the ISR for those cases where the AVR hardware does not clear the respective interrupt flag before entering the ISR.
-
-Use this attribute in the attributes parameter of the ISR macro.
- */
-
-
-
-#define reti  (   ) 
-/*
- Returns from an interrupt routine, enabling global interrupts. This should be the last command executed before leaving an ISR defined with the ISR_NAKED attribute.
-
-This macro actually compiles into a single line of assembly, so there is no function call overhead.
- */
-
-
-#define sei  (   ) 
-/*
- Enables interrupts by setting the global interrupt mask. This function actually compiles into a single line of assembly, so there is no function call overhead. However, the macro also implies a memory barrier which can cause additional loss of optimization.
-
-In order to implement atomic access to multi-byte objects, consider using the macros from <util/atomic.h>, rather than implementing them manually with cli() and sei().
- */
-
-#define SIGNAL  (   vector  ) 
-/*
- Introduces an interrupt handler function that runs with global interrupts initially disabled.
-
-This is the same as the ISR macro without optional attributes.
-
-Deprecated:
-Do not use SIGNAL() in new code. Use ISR() instead.
- */
-
-
-  pinMode(ROTTARY_SW_sw, INPUT_PULLUP);
-  pinMode(ROTTARY_SW_dt, INPUT_PULLUP);
-  //Set PCIE0 to enable PCMSK0 scan.
- /* 
-  PCICR |= (1 << PCIE0);
-  //Set PCINT0 (digital input 8) to trigger an interrupt on state change.
-  PCMSK0 |= (1 << PCINT10);   //Set PCINT0 (digital input 14) to trigger an interrupt on state change.
-  PCMSK0 |= (1 << PCINT9);  //Set PCINT0 (digital input 15) to trigger an interrupt on state change.
-  PCMSK0 |= (1 << PCINT4);  //Set PCINT0 (digital input 10) to trigger an interrupt on state change.
-  PCMSK0 |= (1 << PCINT5);  //Set PCINT0 (digital input 11) to trigger an interrupt on state change.
-  PCMSK0 |= (1 << PCINT6);  //Set PCINT0 (digital input 12) to trigger an interrupt on state change.
-  PCMSK0 |= (1 << PCINT7);  //Set PCINT0 (digital input 13) to trigger an interrupt on state change.
-  */  
-  /*
-  void loop ()
-{
-  channel_1 = map(receiver_input_channel_1, fromLow, fromHigh, toLow, toHigh);
-  channel_2 = map(receiver_input_channel_2, fromLow, fromHigh, toLow, toHigh);
-  channel_3 = map(receiver_input_channel_3, fromLow, fromHigh, toLow, toHigh);
-  channel_4 = map(receiver_input_channel_4, fromLow, fromHigh, toLow, toHigh);
-  channel_5 = map(receiver_input_channel_5, fromLow, fromHigh, toLow, toHigh);
-  channel_6 = map(receiver_input_channel_6, fromLow, fromHigh, toLow, toHigh);
-
-// debug
-  Serial.print("Channel 1 = ");
-  Serial.print(channel_1);
-  Serial.print('\t');
-  Serial.print("Channel 2 = ");
-  Serial.print(channel_2);
-  Serial.print('\t');
-  Serial.print("Channel 3 = ");
-  Serial.print(channel_3);
-  Serial.print('\t');
-  Serial.print("Channel 4 = ");
-  Serial.print(channel_4);
-  Serial.print('\t');
-  Serial.print("Channel 5 = ");
-  Serial.print(channel_5);
-  Serial.print('\t');
-  Serial.print("Channel 6 = ");
-  Serial.print(channel_6);
-  Serial.print('\n');
-
-}
-
-*/
-
-/*
-
-ISR(PCINT0_vect)
-{
-  current_time = micros();
-  //Channel 1=========================================
-  if(PINB & B00000001)
-  {                                        //Is input 8 high?
-  if(last_channel_1 == 0)
-  {                                   //Input 8 changed from 0 to 1
-    last_channel_1 = 1;                                      //Remember current input state
-    timer_1 = current_time;                                  //Set timer_1 to current_time
-  }
-  }
-  else if(last_channel_1 == 1)
-  {                                //Input 8 is not high and changed from 1 to 0
-    last_channel_1 = 0;                                        //Remember current input state
-    receiver_input_channel_1 = current_time - timer_1;         //Channel 1 is current_time - timer_1
-  }
-  //Channel 2=========================================
-  if(PINB & B00000010 )
-  {                                       //Is input 9 high?
-    if(last_channel_2 == 0)
-    {                                   //Input 9 changed from 0 to 1
-      last_channel_2 = 1;                                      //Remember current input state
-      timer_2 = current_time;                                  //Set timer_2 to current_time
-    }
-  }
-  else if(last_channel_2 == 1)
-  {                                //Input 9 is not high and changed from 1 to 0
-    last_channel_2 = 0;                                        //Remember current input state
-    receiver_input_channel_2 = current_time - timer_2;         //Channel 2 is current_time - timer_2
-  }
-  //Channel 3=========================================
-  if(PINB & B00000100 )
-  {                                       //Is input 10 high?
-    if(last_channel_3 == 0)
-    {                                   //Input 10 changed from 0 to 1
-      last_channel_3 = 1;                                      //Remember current input state
-      timer_3 = current_time;                                  //Set timer_3 to current_time
-    }
-  }
-  else if(last_channel_3 == 1)
-  {                                //Input 10 is not high and changed from 1 to 0
-    last_channel_3 = 0;                                        //Remember current input state
-    receiver_input_channel_3 = current_time - timer_3;         //Channel 3 is current_time - timer_3
-
-  }
-  //Channel 4=========================================
-  if(PINB & B00001000 )
-  {                                       //Is input 11 high?
-    if(last_channel_4 == 0)
-    {                                   //Input 11 changed from 0 to 1
-      last_channel_4 = 1;                                      //Remember current input state
-      timer_4 = current_time;                                  //Set timer_4 to current_time
-    }
-  }
-  else if(last_channel_4 == 1)
-  {                                //Input 11 is not high and changed from 1 to 0
-    last_channel_4 = 0;                                        //Remember current input state
-    receiver_input_channel_4 = current_time - timer_4;         //Channel 4 is current_time - timer_4
-  }
-  //Channel 5=========================================
-  if(PINB & B00010000)
-  {
-    if(last_channel_5 == 0)
-    {
-      last_channel_5 = 1;
-      timer_5 = current_time;        
-    }    
-  }
-  else if(last_channel_5 == 1)
-  {
-      last_channel_5 = 0;
-      receiver_input_channel_5 = current_time - timer_5;
-  }
-  //Channel 6=========================================
-  if(PINB & B00100000)
-  {
-    if(last_channel_6 == 0)
-    {
-      last_channel_6 = 1;
-      timer_6 = current_time;
-    }    
-  }
-  else if(last_channel_6 == 1)
-  {
-    last_channel_6 = 0;
-    receiver_input_channel_6 = current_time - timer_6;    
-  }
-}
-  
-*/
-  

+ 0 - 0
SE/stuff/P5_Automation_can-dev-res/_PCINT/_PCINT_func_loop.h


+ 0 - 19
SE/stuff/P5_Automation_can-dev-res/_PCINT/_PCINT_init.h

@@ -1,19 +0,0 @@
-#include <PinChangeInt.h>
-
-
-
-// Do not use any Serial.print() in this function. Serial.print() uses interrupts, and is not compatible
-// with an interrupt routine...!
-void quicfunc() {
-  latest_interrupted_pin=PCintPort::arduinoPin;
-  interrupt_count[latest_interrupted_pin]++;
-};
-
-// You can assign any number of functions to different pins. How cool is that?
-void pin3func() {
-  pin3Count++;
-   Serial.println("pin3func TRIG");
-}
-
-//uint8_t i;
-//uint8_t currentPIN3Count=0;

+ 0 - 48
SE/stuff/P5_Automation_can-dev-res/_PCINT/_PCINT_loop.h

@@ -1,48 +0,0 @@
-/* uint8_t count;
-  Serial.print(".");
- // delay(1000);                                // every second,
-  for (i=0; i < TOTAL_PINS; i++) {
-    if (interrupt_count[i] != 0) {            // look at all the interrupted pins
-      count=interrupt_count[i];               // store its count since the last iteration
-      interrupt_count[i]=0;                   // and reset it to 0.
-      Serial.print("Count for pin ");
-      if (i == 50) { Serial.print("MISO"); }  // then tell the user what it was, in a friendly way.
-      else if (i == 51) { Serial.print("MOSI"); }
-      else if (i == 52) { Serial.print("SCK"); }
-      else if (i == 53) { Serial.print("SS"); }
-      else if (i < FIRST_ANALOG_PIN) {
-        Serial.print("D");
-        Serial.print(i, DEC);
-      } else {
-        Serial.print("A");
-        Serial.print(i-FIRST_ANALOG_PIN, DEC);
-      }
-      Serial.print(" is ");
-      Serial.println(count, DEC);
-    }
-  }
-  if (currentPIN3Count != pin3Count) {        // Print our monotonically increasing counter (no reset to 0)
-      Serial.print(PIN3TEXT);
-      Serial.print(" count update: "); Serial.print(pin3Count, DEC); Serial.println();
-      currentPIN3Count=pin3Count;
-  }
-
-  */
-/*
- Serial.print("Port : A8 " );
- Serial.print(A8);
-Serial.print(" digitalPinToPort(A8)::: " );
- Serial.println( digitalPinToPort(A8));
-
- 
- Serial.print("Port : A9 " );
- Serial.print(A9);
-Serial.print(" digitalPinToPort(A9)::: " );
- Serial.println( digitalPinToPort(A9));
-
- 
- Serial.print("Port : A10 " );
- Serial.print(A10);
-Serial.print(" digitalPinToPort(A10)::: " );
- Serial.println( digitalPinToPort(A10));
- */

+ 0 - 15
SE/stuff/P5_Automation_can-dev-res/_PCINT/_PCINT_setup.h

@@ -1,15 +0,0 @@
-/*  pinMode(MYPIN1, INPUT_PULLUP);
-  attachPinChangeInterrupt(MYPIN1, quicfunc, FALLING);  // add more attachInterrupt code as required
-  pinMode(MYPIN2, INPUT_PULLUP);
-  attachPinChangeInterrupt(MYPIN2, quicfunc, FALLING);
-  pinMode(MYPIN3, INPUT_PULLUP);
-  attachPinChangeInterrupt(MYPIN3, pin3func, CHANGE);
-  */
- 
-//  pinMode(ROTTARY_SW_sw, INPUT);     //set the pin to input
-//  digitalWrite(ROTTARY_SW_sw, HIGH); //use the internal pullup resistor
-  
-
-#if defined(DISABLE_LOOP) // || DEBUG
-         Serial.println("#included _PCINT/_PCINT_setup.h ");
-#endif

+ 0 - 42
SE/stuff/P5_Automation_can-dev-res/_PCINT/_PCINT_struct.h

@@ -1,42 +0,0 @@
-#if ! ( defined __AVR_ATmega2560__ || defined __AVR_ATmega1280__ || defined __AVR_ATmega1281__ || defined __AVR_ATmega2561__ || defined __AVR_ATmega640__ )
-    #error "This sketch only works on chips in the ATmega2560 family."
-#endif
-
-
-
-// PIN NAMING
-// For the Analog Input pins used as digital input pins, you can call them 14, 15, 16, etc.
-// or you can use A0, A1, A2, etc. (the Arduino code will properly recognize the symbolic names,
-// for example, pinMode(A0, INPUT_PULLUP);
-
-// For Arduino MEGA (AT2560-based), besides the regular pins and the A (analog) pins,
-// you have 4 more pins with defined names:
-// SS   = 53
-// MOSI = 51
-// MISO = 50
-// SCK  = 52
-
-// NOW CHOOSE PINS
-
-
-#define FIRST_ANALOG_PIN 54
-#define TOTAL_PINS 69 //97 // 69 // But only 18 of them (not including RX0) are PinChangeInt-compatible
-                      // Don't use RX0 (Arduino pin 0) in this program- it won't work this is the
-                      // pin that Serial.print() uses!
-// See the Arduino and the chip documentation for more details.
-#define MYPIN1 ROTTARY_SW_clk // ROTTARY_SW_sw // ROTTARY_SW_sw // SS
-#define MYPIN2 ROTTARY_SW_dt // SCK
-#define MYPIN3 ROTTARY_SW_sw  // A8 //ROTTARY_SW_sw // MOSI
-//#define MYPIN4 ROTTARY_SW_sw  // A8 //ROTTARY_SW_sw // MOSI
-
-#define PIN3TEXT "ROTTARY_SW_sw " // This will say what MYPIN3 is, on the serial monitor
-
-volatile uint8_t latest_interrupted_pin;
-volatile uint8_t interrupt_count[TOTAL_PINS]={0}; // possible arduino pins
-volatile uint8_t pin3Count=0;
-
-/*
-volatile unsigned int encoder0Pos = 0;
-static boolean rotating = false;
-
-*/

+ 0 - 13
SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW/_ROTTARY_SW_config.h

@@ -1,13 +0,0 @@
-// rottary switch ports 
-#define ROTTARY_SW_sw A8 // 62 // A8 //A8 //53 // 89 // = A8
-#define ROTTARY_SW_dt  A9 // 90 // = A9
-#define ROTTARY_SW_clk A10  // 91 // = A10
-
-/*
- LOW to trigger the interrupt whenever the pin is low,
-CHANGE to trigger the interrupt whenever the pin changes value
-RISING to trigger when the pin goes from low to high,
-FALLING for when the pin goes from high to low.
-The Due, Zero and MKR1000 boards allow also:
-HIGH to trigger the interrupt whenever the pin is high.
- */

+ 0 - 88
SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW/_ROTTARY_SW_func.h

@@ -1,88 +0,0 @@
-
-
-
-#ifndef HAS_ROTTARY_SW
-    #error Need to have HAS_ROTTARY_SW
-#endif
-
-
-#ifndef HAS__PCINT_setup
-    #error Need to have HAS__PCINT_setup
-#endif
-
- // You can assign any number of functions to different pins. How cool is that?
-void ROTTARY_SW_sw_INT() {
-    triggerCount++;
-   Serial.print("ROTTARY_SW_sw_INT TRIG[");Serial.print(triggerCount); Serial.println("] ");
-   
-}
-
-/*
-void ROTTARY_SW_dt_INT() {
-   Serial.println("ROTTARY_SW_dt_INT TRIG");
-}
-void ROTTARY_SW_clk_INT() {
-   Serial.println("ROTTARY_SW_clk_INT TRIG");
-}
-*/
-
-void ROTTARY_SW_dt_INT() {
- cli(); //stop interrupts happening before we read pin values
-  reading1 = digitalRead(ROTTARY_SW_clk) ;
-  reading2 = digitalRead(ROTTARY_SW_dt);
-  //reading = PIND & 0xC; //read all eight pin values then strip away all but pinA and pinB's values
-  if (reading1 == 1 and reading1 == 1 and aFlag) { //check that we have both pins at detent (HIGH) and that we are expecting detent on this pin's rising edge
-    
-    if(encoderPos == ARDUINO_SIZE_MIN_encoderPos) {
-    } else {
-        encoderPos --; //increment the encoder's position count
-    }
-    bFlag = 0; //reset flags for the next turn
-    aFlag = 0; //reset flags for the next turn
-  }  else if (reading1  == 0 and reading2  == 1) {
-   bFlag = 1; //signal that we're expecting pinA to signal the transition to detent from free rotation
-  }
-  sei(); //restart interrupts
- /* #ifdef DEBUG
-  if(DEBUG > 4) {
-    Serial.print("dt_: #[");  
-    //Serial.print(encoderPos); Serial.print("] R1[");  Serial.print(reading1); Serial.print("] R2[");  Serial.print(reading2); Serial.print("] aFlag["); Serial.print(aFlag);   Serial.print("] bFlag["); Serial.print(bFlag); 
-     Serial.println("] "); }
-   #endif
-   */
-}
-
-void ROTTARY_SW_clk_INT(){
-
- cli(); //stop interrupts happening before we read pin values
-
-  reading1 = digitalRead(ROTTARY_SW_clk) ;
-  reading2 = digitalRead(ROTTARY_SW_dt);
-  //reading = PIND & 0xC; //read all eight pin values then strip away all but pinA and pinB's values
-  if (reading1 == 1 and reading2 == 1 && bFlag) { //check that we have both pins at detent (HIGH) and that we are expecting detent on this pin's rising edge
-    
-    
-    if(encoderPos == ARDUINO_SIZE_MAX_encoderPos) {
-    } else {
-        encoderPos ++; //increment the encoder's position count
-    }
-    bFlag = 0; //reset flags for the next turn
-    aFlag = 0; //reset flags for the next turn
-     
-  //  Serial.print("clkA: #[");  Serial.print(encoderPos); Serial.print("] R1["); Serial.print(reading1); Serial.print("] R2[");  Serial.print(reading2); Serial.print("] AFlag["); Serial.print(aFlag);   Serial.print("] bFlag["); Serial.print(bFlag);  Serial.println("] ");
-
-  }  else if (reading1 == 1  ) {
-   aFlag = 1; //signal that we're expecting pinA to signal the transition to detent from free rotation
-  }
-  sei(); //restart interrupts
-   /* #ifdef DEBUG
-    if(DEBUG > 4) {
-   // Serial.println("clkA: #["); 
-     //Serial.print(encoderPos); 
-     //Serial.print("] R1["); //Serial.print(reading1); //Serial.print("] R2[");  Serial.print(reading2); Serial.print("] AFlag["); Serial.print(aFlag);   Serial.print("] bFlag["); Serial.print(bFlag);  
-   // Serial.println("] "); 
-   }
-   #endif   
-   */
-}
-

+ 0 - 1
SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW/_ROTTARY_SW_init.h

@@ -1 +0,0 @@
-

+ 0 - 120
SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW/_ROTTARY_SW_loop.h

@@ -1,120 +0,0 @@
- 
- 
- if(triggerCount != triggerCountOld) {
- 
-    Serial.print(" ROT_TRIG[");  Serial.print(triggerCount);  Serial.print("] ");  
-   
-   
-   DISPLAY_MENU_SELECTOR(DISPLAY_A ,
-            DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-            DISPLAY_PHYSICAL_CHAR_A, 
-            Slave_Ports_Status_A , Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
-           // DISPLAY_MENU_ITEM_INDEX_A ,
-             time ,
-            0 , 
-        //DISPLAY_MENU_SELECTOR_STATUS_A , //; //which mode - provide func
-        DISPLAY_MENU_SELECTOR_SWITCH_UNKNOWN,  //DISPLAY_MENU_SELECTOR_SWITCH_NOT_PUSHED //DISPLAY_MENU_SELECTOR_SWITCH_PUSHED //DISPLAY_MENU_SELECTOR_SWITCH_UNKNOWN
-        oldEncPos , //DISPLAY_MENU_SELECTOR_oldEncPos_A , //; //values
-         encoderPos, // DISPLAY_MENU_SELECTOR_encoderPos_A
-         triggerCountOld , triggerCount 
-       ) ;
-   triggerCountOld =  triggerCount ;
-   
- 
- }
- 
- 
- if(oldEncPos != encoderPos) {
- 
-    
-    static I2C_INDEX_DRIVER_T I2C_INDEX_DRIVER_A ;
- 
-    Serial.print(" ROT_SW[");  Serial.print(encoderPos);  Serial.print("] ");  
-    
-    DISPLAY_MENU_SELECTOR(DISPLAY_A ,
-            DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-            DISPLAY_PHYSICAL_CHAR_A, 
-            Slave_Ports_Status_A , Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
-           // DISPLAY_MENU_ITEM_INDEX_A ,
-             time ,
-            0 , 
-        //DISPLAY_MENU_SELECTOR_STATUS_A , //; //which mode - provide func
-        DISPLAY_MENU_SELECTOR_SWITCH_UNKNOWN,  //DISPLAY_MENU_SELECTOR_SWITCH_NOT_PUSHED //DISPLAY_MENU_SELECTOR_SWITCH_PUSHED //DISPLAY_MENU_SELECTOR_SWITCH_UNKNOWN
-        oldEncPos , //DISPLAY_MENU_SELECTOR_oldEncPos_A , //; //values
-         encoderPos, // DISPLAY_MENU_SELECTOR_encoderPos_A
-         triggerCountOld , triggerCount 
-       ) ;
-    
-    oldEncPos = encoderPos;
-  //  int pwmVal = encoderPos * 5 ;
-  //  if (pwmVal == 0 ) pwmVal = 1; 
-   
-   /*TASK_PORT_ASSOC_T TASK_PORT_ASSOC_A={
-        2,
-        Active_ControllerID_HEX,
-        0
-   };
-   */
-  /* TASK_PORT_ASSOC_T TASK_PORT_ASSOC_A={
-        1,
-        0x13,
-        0
-   };
-   */
-   /*
-   Slave_Ports_action_func(Slave_Ports_Status_QUEUE_A,  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A, Slave_Ports_Status_A ,
-    Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A , TASK_TYPE_T_request_set_new_Exp_state , //TASK_TYPE_T TASK_TYPE_A,
-    //ARDUINO_ARRAY_ATTR_T Slave_Ports_Status_T_INDEX , //index of port we want to manipulate
-    TASK_PORT_ASSOC_A, //
-    time, 
-    time, //, 
-    ARDUINO_ARRAY_INDEX_NOT_SET , //ARDUINO_ARRAY_INDEX_T DISPLAY_ARDUINO_ARRAY_INDEX_A , 
-    Exp_state_ON_USE_LEVEL ,
-    encoderPos  //Exp_state_level_T Exp_state_level_A 
-   );
-   
-   ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END(ARDUINO_LOOP_LATENCY__MAIN_END_A, ARDUINO_LOOP_LATENCY_CONTROL_FLAG_BYPASS );
-        
-       */ 
-                
-           /*     
-                 if(not(I2C_INDEX_DRIVER_A > 0)) {
-                 //I2C_INDEX_DRIVER_A = Adafruit_PWMServoDriver__get_PRIMARY_KET_T(Adafruit_PWMServoDriver_A,  I2C_ADDRESS_0x40) ;
-                  I2C_INDEX_DRIVER_A = Adafruit_PWMServoDriver__get_PRIMARY_KET_T(   Adafruit_PWMServoDriver_A,Adafruit_PWMServoDriver_ATTR_ARRAY_A ,   0x40);
-                 }
-                  Serial.print("#550 CLK_AAdafruit_PWMServoDriver: #[");  Serial.print(encoderPos);
-                  Serial.print("] I2C_INDEX_DRIVER_A [");  Serial.print(I2C_INDEX_DRIVER_A); 
-                   Serial.println(" ] ");   
-                  //Adafruit_PWMServoDriver_0X40.setPWM(1, 0, map(encoderPos, 0, 180, SERVOMIN, SERVOMAX));
-                 // Adafruit_PWMServoDriver_0X40.setPWM(2, encoderPos * 5, encoderPos * 50);
-                  if(I2C_INDEX_DRIVER_A>0)  Adafruit_PWMServoDriver_A[I2C_INDEX_DRIVER_A].Adafruit_PWMServoDriver_V.setPWM(2, pwmVal, pwmVal * 10);
-        */
-
-//DISPLAY_DEV.print("#550 CLK_AAdafruit_PWMServoD");
-
-/*
-DISPLAY__CURSOR_Y_CHARS__SET(DISPLAY_PHYSICAL_CHAR_A, 
-                                DISPLAY_CURSOR_Y_CHARS_ROTTARY_SW_DEBUG);
-          DISPLAY_array16_T  DISPLAY_array16_AA="" ;
-          //( "OUT I2C 0X40[2]" + encoderPos * 5 , 2), //message,                
-          String message = "OUT I2C 0X40[2] V:";
-              message.concat(String(pwmVal));
-              message.toCharArray(DISPLAY_array16_AA, message.length());
-                     DISPLAY__print(
-                          DISPLAY_A ,
-                          DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                          DISPLAY_PHYSICAL_CHAR_A, 
-                           DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE,
-                            DISPLAY_array16_AA,
-                            DISPLAY_TARGET_DISPLAY128,
-                          time, // time_seq_id_T time_seq_id_A;
-                           time+5000, //time_min_run_T time_min_run_A;
-                          //queue
-                         Slave_Ports_Status_QUEUE_A,Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                         TASK_TYPE_T_Slave_Ports_broadcast____  ,  //TASK_TYPE_A,
-                         {  } //TASK_PORT_ASSOC_A Slave_Ports_Status_A[i].Port_ID
-                         
-                         ); 
-*/
-
-  }

+ 0 - 55
SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW/_ROTTARY_SW_setup.h

@@ -1,55 +0,0 @@
-
-
-#if defined(DISABLE_LOOP) || defined(DEBUG)
-         Serial.println("BEGIN #include _ROTTARY_SW_setup.h ");
-#endif
-
-#if defined(HAS__PCINT_setup)
-
-    
-    #ifdef defined(DISABLE_LOOP) || defined(DEBUG)
-             Serial.println("will  attachPinChangeInterrupt(ROTTARY_SW_sw, ROTTARY_SW_sw_INT, FALLING); ");
-    #endif
-  attachPinChangeInterrupt(ROTTARY_SW_sw, ROTTARY_SW_sw_INT, FALLING);  // add more attachInterrupt code as required
-    #if defined(DISABLE_LOOP) ||  defined(DEBUG)
-             Serial.println("will  pinMode(ROTTARY_SW_sw, INPUT_PULLUP) ");
-    #endif
-  pinMode(ROTTARY_SW_sw, INPUT_PULLUP);
-  
-    #if defined(DISABLE_LOOP) ||  defined(DEBUG)
-             Serial.println("will  attachPinChangeInterrupt(ROTTARY_SW_dt, ROTTARY_SW_dt_INT, RISING)");
-    #endif
-  attachPinChangeInterrupt(ROTTARY_SW_dt, ROTTARY_SW_dt_INT, RISING); //FALLING //RISING 
-    #if defined(DISABLE_LOOP) ||  defined(DEBUG)
-             Serial.println("will  pinMode(ROTTARY_SW_dt, INPUT_PULLUP)");
-    #endif
-  pinMode(ROTTARY_SW_dt, INPUT_PULLUP);
-   #if defined(DISABLE_LOOP) ||  defined(DEBUG)
-             Serial.println("will  attachPinChangeInterrupt(ROTTARY_SW_clk, ROTTARY_SW_clk_INT, RISING)");
-    #endif
-  attachPinChangeInterrupt(ROTTARY_SW_clk, ROTTARY_SW_clk_INT, RISING); //CHANGE
-  #if defined(DISABLE_LOOP) ||  defined(DEBUG)
-             Serial.println("pinMode(ROTTARY_SW_clk, INPUT_PULLUP)");
-    #endif
-  pinMode(ROTTARY_SW_clk, INPUT_PULLUP);
-  
-  
-/*
-  attachPinChangeInterrupt(ROTTARY_SW_dt, ROTTARY_SW_dt_FALLING, FALLING); //FALLING //RISING
-  attachPinChangeInterrupt(ROTTARY_SW_dt, ROTTARY_SW_dt_RISING, RISING); //FALLING //RISING 
- 
-  pinMode(ROTTARY_SW_dt, INPUT_PULLUP);
-  attachPinChangeInterrupt(ROTTARY_SW_clk, ROTTARY_SW_clk_FALLING, FALLING); //CHANGE
-  attachPinChangeInterrupt(ROTTARY_SW_clk, ROTTARY_SW_clk_RISING, RISING); //CHANGE
-
-  pinMode(ROTTARY_SW_clk, INPUT_PULLUP);
-  
-  */
-  
-#endif
-
-
-
-#if defined(DISABLE_LOOP) ||  defined(DEBUG)
-         Serial.println("END #include _ROTTARY_SW_setup.h ");
-#endif

+ 0 - 10
SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW/_ROTTARY_SW_struct.h

@@ -1,10 +0,0 @@
-volatile byte aFlag = 0; // let's us know when we're expecting a rising edge on pinA to signal that the encoder has arrived at a detent
-volatile byte bFlag = 0; // let's us know when we're expecting a rising edge on pinB to signal that the encoder has arrived at a detent (opposite direction to when aFlag is set)
-volatile byte encoderPos = 0; //this variable stores our current value of encoder position. Change to int or uin16_t instead of byte if you want to record a larger range than 0-255
-volatile byte oldEncPos = 0; //stores the last encoder position value so we can compare to the current reading and see if it has changed (so we know when to print to the serial monitor)
-
-volatile byte reading1 = 0; //somewhere to store the direct values we read from our interrupt pins before checking to see if we have moved a whole detent
-volatile byte reading2 = 0; //somewhere to store the direct values we read from our interrupt pins before checking to see if we have moved a whole detent
-
-volatile byte triggerCount = 0;
-volatile byte triggerCountOld = 0; 

+ 0 - 20
SE/stuff/P5_Automation_can-dev-res/_SlaveID_setup.h

@@ -1,20 +0,0 @@
-
-
-        /*LCDarray1 = "Slave Module ";
-        LCDarray2 = "enabling filters";
-        */
-        //CAN0.init_Mask(0,0,0x010F0000);                // Init first mask...
-        //CAN0.init_Filt(0,0,0x01000000);                // Init first filter...
-        //CAN0.init_Filt(1,0,0x01010000);                // Init second filter...
-        
-        //CAN0.init_Mask(1,0,0x010F0000);                // Init second mask... 
-        //CAN0.init_Filt(2,0,0x01030000);                // Init third filter...
-        //CAN0.init_Filt(3,0,0x01040000);                // Init fouth filter...
-        //CAN0.init_Filt(4,0,0x01060000);                // Init fifth filter...
-        //CAN0.init_Filt(5,0,0x01070000);                // Init sixth filter...
-        
-        //CAN0.init_Mask(0, 0, 0x01FF);                         
-        //CAN0.init_Filt(0, 0, 0x103); 
-  
-        //CAN.init_Mask(1, 0, 0x04FF);   
-        //CAN.init_Filt(1, 0, 0x4C0); 

+ 0 - 11
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports.h

@@ -1,11 +0,0 @@
-//_Slave_Ports.h
-
-#include "_Slave_Ports_ttl_decrement.h"
-//#include "_Slave_Ports_Protocol.h"
-
-//#include "Slave_Ports_Status_S.h"
-
-
-
-
-

+ 0 - 332
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_I2C_func.h

@@ -1,332 +0,0 @@
-//_Slave_Ports_I2C_func.h
- void _Slave_Ports_I2C_POP( //maintain tasks
-    Slave_Ports_Status_QUEUE_T*  Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A,
-    int _Slave_Ports_queue_pop ,  
-    Slave_Ports_Status_T* Slave_Ports_Status_A,
-     Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T  &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
-      //display
-        DISPLAY_T* DISPLAY_A ,
-        DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-        DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A, 
-            DISPLAY_pos_seq_T DISPLAY_pos_seq_A,
-            DISPLAY_array16_T DISPLAY_array16_A,
-            DISPLAY_TARGET_T DISPLAY_TARGET_A,
-            time_seq_id_T time_seq_id_A,
-            time_min_run_T time_min_run_A
-        //tasks
-        ,TASK_TYPE_T TASK_TYPE_A,
-        TASK_PORT_ASSOC_T &TASK_PORT_ASSOC_A   , 
-        Adafruit_PWMServoDriver_T* Adafruit_PWMServoDriver_A
-    ) {     //{1
-    
-    
-    #if defined(DISABLE_LOOP) ||  defined(DEBUG) ||  defined(DEBUG_I2C)
-        
-     Serial.print("#234 _Slave_Ports_I2C_POP  _Slave_Ports_queue_pop["); Serial.print(_Slave_Ports_queue_pop);  Serial.println("]");
-    #endif
-    
-  //  I2C_INDEX_DRIVER_T I2C_INDEX_DRIVER_A ;
-    //auto I2C_INDEX_DRIVER_T I2C_INDEX_DRIVER_A  ;
-    
-    
-    
-    
-
-            DISPLAY__CURSOR_Y_CHARS__SET(DISPLAY_PHYSICAL_CHAR_A, 
-                                DISPLAY_CURSOR_Y_CHARS_DEBUG);
-           DISPLAY__print(
-                          DISPLAY_A ,
-                          DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                          DISPLAY_PHYSICAL_CHAR_A, 
-                           DISPLAY_pos_seq_A | DISPLAY_pos_seq_A_IMMEDIATE,
-                            DISPLAY_array16_A,
-                            DISPLAY_TARGET_A,
-                           time_seq_id_A,
-                           time_min_run_A
-                          //queue
-                        , Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A,
-                         TASK_TYPE_A,
-                         TASK_PORT_ASSOC_A
-                        
-                          ); 
-          #if defined(DISABLE_LOOP) ||  defined(DEBUG) ||  defined(DEBUG_I2C) || defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-               Serial.print("#200 Slave_Ports_I2C_POP  #COUNT_A[");   Serial.print(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A);
-                Serial.print("] INDEX_LAST[");                       Serial.print(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A);
-                Serial.print("] INDEX_CURRENT[");                    Serial.print(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A);
-                Serial.print("] INDEX_NEXT[");                       Serial.print(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A);
-                Serial.print("] time_min_run_MIN[");                 Serial.print(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_time_min_run_MIN_A);
-                Serial.print("] INDEX_time_min_run_MIN[");           Serial.print(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_time_min_run_MIN_A);
-          #endif      
-          
-             //    if(Slave_Ports_Status_QUEUE_A[_Slave_Ports_queue_pop].TASK_PORT_ASSOC_A[1].Port_ID > 0 ) {
-             //       Serial.println("#544A TASK_PORT_ASSOC_A unsupported individual"); 
-             //    } 
-                           
-               
-    int i;
-    int res;
-    int i_first;
-    int i_max ; 
-    if(TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX > 0) {
-        Serial.println("51[ACTION][USE][ASSOC]");
-        i_first = TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX ; 
-        i_max = TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX ;
-    } else {
-        i_first = ARDUINO_ARRAY_INDEX_FIRST;
-        i_max = (ARDUINO_ARRAY_INDEX_FIRST + Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A) ;
-    }
-    
-    for(i=i_first;i <= i_max ;i++) {
-     #if defined(DEBUG) || defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                Serial.print("#69PWC [i[");    Serial.print(i);    Serial.print("] I2CP[");   Serial.print(Slave_Ports_Status_A[i].I2C_port);   Serial.print("]TTL[");  Serial.print(Slave_Ports_Status_A[i].Exp_state_ttl);  Serial.println("] ");                 
-            #endif
-      if(Slave_Ports_Status_A[i].PortTypes & PortTypes_I2C) { //{2 BIN TEST
-            if(Slave_Ports_Status_A[i].Exp_state_ttl > Exp_state_ttl_FRESH ) {
-                    #if defined(DEBUG) || defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                        Serial.print("#71PWC[");  Serial.print(Slave_Ports_Status_A[i].I2C_port);   Serial.print("]TTL--[");  Serial.print(Slave_Ports_Status_A[i].Exp_state_ttl);
-                    #endif
-            Slave_Ports_Status_A[i].Exp_state_ttl = Slave_Ports_Status_A[i].Exp_state_ttl - 10; //todo  (TASK_TYPE_T_Slave_Ports_set_I2C______time_min_run_MIN_A_INCREMENT_A / 1000 )
-            } else if(1==1 ) { //{3//Slave_Ports_Status_A[i].Exp_state_ttl <= Exp_state_ttl_FRESH
-             #if defined(DEBUG) || defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                //if(DEBUG > 4) { //{4
-               Serial.print("#311 ttl min i2c for: I2C_port[");  Serial.print(Slave_Ports_Status_A[i].I2C_port);   Serial.print("] ttl[");  Serial.print(Slave_Ports_Status_A[i].Exp_state_ttl);
-                 Serial.print(" Port_ID[");  Serial.print(Slave_Ports_Status_A[i].Port_ID);   Serial.println("]  ");   Serial.print(" #[");  Serial.print(i);   Serial.println("]  "); 
-                 //} //{4
-             #endif
-               
-                    if(Slave_Ports_Status_A[i].I2C_driver == I2C_driver_Adafruit_PWMServoDriver) {
-                          //ARDUINO_ARRAY_PRIMARY_KET_T  Adafruit_PWMServoDriver__get_PRIMARY_KET_A = Adafruit_PWMServoDriver__get_PRIMARY_KET_T(
-                      
-                      //find port status
-                                if(ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_ADD == Adafruit_PWMServoDriver__get_DRIVER_STATUS_T(
-                                          Adafruit_PWMServoDriver_A, Adafruit_PWMServoDriver_ATTR_ARRAY_A, Slave_Ports_Status_A[i].Address)) {
-                                         #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                           Serial.println("#80 I2C  [ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_ADD]   "); 
-                                           #endif
-                                           ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T Adafruit_PWMServoDriver__add_A = Adafruit_PWMServoDriver__add(Adafruit_PWMServoDriver_A,Adafruit_PWMServoDriver_ATTR_ARRAY_A,Slave_Ports_Status_A[i].Address,  ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_SETVAL_A) ;
-                                           
-                                                 if(ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_SETVAL_A == Adafruit_PWMServoDriver__add_A) {
-                                                  #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                                          Serial.println("#83 I2C [ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_SETVAL_A]   ");
-                                                      #endif    
-                                                     //   ARDUINO_ARRAY_PRIMARY_KET_T I2C_INDEX_DRIVER_A =   Adafruit_PWMServoDriver__get_PRIMARY_KET_T(Adafruit_PWMServoDriver_A,Adafruit_PWMServoDriver_ATTR_ARRAY_A,Slave_Ports_Status_A[i].Address);
-                                                          
-                                                          
-                                                 } else {
-                                                   #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                                       Serial.print("#83E I2C ADD   else ");  Serial.print(Adafruit_PWMServoDriver__add_A, BIN);  Serial.println(" ] ");
-                                                   #endif
-                                                 }
-                                           
-                                    }
-                      
-                      
-                      
-                       I2C_INDEX_DRIVER_T   I2C_INDEX_DRIVER_A = Adafruit_PWMServoDriver__get_PRIMARY_KET_T(   Adafruit_PWMServoDriver_A,Adafruit_PWMServoDriver_ATTR_ARRAY_A ,   Slave_Ports_Status_A[i].Address);
-                                
-                            if(I2C_INDEX_DRIVER_A > 0 ) {//Slave_Ports_Status_A[i].Address == I2C_ADDRESS_0x40 ) {
-                                  /*  if(I2C_ADDRESS_0x40_A == ARDUINO_DRIVER_UNDEFINED) {
-                                       // Adafruit_PWMServoDriver  Adafruit_PWMServoDriver_0X40 = Adafruit_PWMServoDriver(0x40);
-                                        I2C_ADDRESS_0x40_A = ARDUINO_DRIVER_INITIALIZED ;
-                                      //  Adafruit_PWMServoDriver_0X40.begin();
-                                        I2C_ADDRESS_0x40_A = ARDUINO_DRIVER_INITIALIZED_BEGIN ;
-                                         Adafruit_PWMServoDriver_0X40.setPWMFreq(PortTypes_PWM_FREQ_DEFAULT);
-                                        I2C_ADDRESS_0x40_A = ARDUINO_DRIVER_INITIALIZED_FREQ ;
-                                       
-                                    }
-                                    */
-                                    #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                    Serial.print("#112 I2C [ADD]    [OK[   #");  Serial.print(I2C_INDEX_DRIVER_A);  Serial.println(" ] ");
-                                    #endif
-                                    
-                                                  
-                                     #if  defined(DEBUG) > 7  || defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                         Serial.print("#["); Serial.print(i);  Serial.print("] ");Serial.print("#154   before PWM   Exp_state_ttl[");
-                                        Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state_ttl)); Serial.print("]  PortTypes[");
-                                        Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].PortTypes)); Serial.print("]  Broadcast_state[");
-                                        Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.print("]  Broadcast_state[");
-                                        Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Broadcast_state)); Serial.println("] ");
-                                         Serial.print("#121  Exp_state[  ");
-                                                    if(Slave_Ports_Status_A[i].Exp_state |  Exp_state_SET )   Serial.print(" [ | SET ] ");
-                                                    if(Slave_Ports_Status_A[i].Exp_state &  Exp_state_SET )   Serial.print(" [ & SET ] ");
-                                                    if(Slave_Ports_Status_A[i].Exp_state |  Exp_state_ERROR )   Serial.print(" [ | ERR ] ");
-                                                    if(Slave_Ports_Status_A[i].Exp_state &  Exp_state_ERROR )   Serial.print(" [ & ERR ] ");
-                                                        if(Slave_Ports_Status_A[i].Exp_state |  Exp_state_OFF )   Serial.print(" [ | OFF ] ");
-                                                        if(Slave_Ports_Status_A[i].Exp_state &  Exp_state_OFF )   Serial.print(" [ & OFF ] ");     
-                                                        if(Slave_Ports_Status_A[i].Exp_state ==  Exp_state_OFF )   Serial.print(" [ = OFF ] ");    
-                                                        //if !( ( z & care_bits ) ^ match_bits )                                                 
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & Exp_state_SET ) ^ Exp_state_SET ))  Serial.print(" [ ^ SET ] ");
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & B00000000 ) ^ Exp_state_SET ))  Serial.print(" [ + SET ] ");
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & B11111111 ) ^ Exp_state_SET ))  Serial.print(" [ # SET ] ");
-                                                           if (!( ( Slave_Ports_Status_A[i].Exp_state & Exp_state_OFF ) ^ Exp_state_OFF ))  Serial.print(" [ ^ OFF ] ");
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & B00000000 ) ^ Exp_state_OFF ))  Serial.print(" [ + OFF ] ");
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & B11111111 ) ^ Exp_state_OFF ))  Serial.print(" [ # OFF ] ");
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & B11111110 ) ^ B00000001 ))  Serial.print(" [ < OFF ] ");
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & B00000001 ) ^ B11111110 ))  Serial.println(" [ > OFF ] ");
-                                      #endif          
-                      
-                             //   Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
-                             //       Slave_Ports_Status_A[i].Broadcast_state =  Broadcast_state_FULL_FRESH ; 
-                                      
-                                    
-                                    
-                                    if(Slave_Ports_Status_A[i].PortTypes & PortTypes_SERVO) {
-                                                Sprintln(F("#147   [PortTypes_SERVO]  [")); Serial.print(Exp_state_ON_USE_LEVEL, BIN); Sprintln(F("] ")); 
-                                                if(Slave_Ports_Status_A[i].Exp_state & Exp_state_ON_USE_LEVEL) {
-                                                        #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                                        Sprintln(F("[SERVO] [Exp_state_ON_USE_LEVEL]"));        
-                                                        #endif
-                                                         Serial.print("[SERVO]->[PORT["); Serial.print(Slave_Ports_Status_A[i].LocalPort); Serial.println("]  ");
-                                                        Adafruit_PWMServoDriver_A[I2C_INDEX_DRIVER_A].Adafruit_PWMServoDriver_V.setPWM(Slave_Ports_Status_A[i].LocalPort, 0, map(Slave_Ports_Status_A[i].Exp_state_level_A , 0, 180, SERVOMIN, SERVOMAX));
-                                                        Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state | Exp_state_SET; //TODO BITTEST
-                                                        Slave_Ports_Status_A[i].Exp_state = ~ Exp_state_SET_REQ_SEND; //TODO BITTEST
-                                                        //Serial.print("[D209]Aft[");Serial.print(Slave_Ports_Status_A[i].Exp_state , BIN);Serial.print("]");
-                                                        Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
-                                                } else if(Slave_Ports_Status_A[i].Exp_state & Exp_state_ON) {
-                                                         Adafruit_PWMServoDriver_A[I2C_INDEX_DRIVER_A].Adafruit_PWMServoDriver_V.setPWM(Slave_Ports_Status_A[i].LocalPort, 0, map(90, 0, 180, SERVOMIN, SERVOMAX));
-                                                         #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                                          Serial.print("#149 I2C_driver PortTypes_SERVO->ON Exp_state [SET]"); Serial.print(Slave_Ports_Status_A[i].Exp_state); Serial.print("]   after   [");
-                                                         #endif
-                                                         Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state | Exp_state_SET; //TODO TEST
-                                                            Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.println("]  ");
-                                                         Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
-                                                } else if(Slave_Ports_Status_A[i].Exp_state & Exp_state_OFF)  {
-                                                         Adafruit_PWMServoDriver_A[I2C_INDEX_DRIVER_A].Adafruit_PWMServoDriver_V.setPWM(Slave_Ports_Status_A[i].LocalPort, 0, map(0, 0, 180, SERVOMIN, SERVOMAX));
-                                                         #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                                           Serial.print("#155 I2C_driver PortTypes_SERVO->OFF Exp_state [SET]"); Serial.print(Slave_Ports_Status_A[i].Exp_state); Serial.print("]   after   [");
-                                                          #endif
-                                                         Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state | Exp_state_SET; //TODO TEST
-                                                         Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.println("]  ");
-                                                         Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
-                                                }
-                                    } else {
-                                    #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                     Serial.print("#163   [PortTypes*]   ");
-                                     #endif
-                                                    
-                                                    if(Slave_Ports_Status_A[i].Exp_state & Exp_state_ON_USE_LEVEL ) { //TODO BINTEST
-                                                        //Adafruit_PWMServoDriver_A[I2C_INDEX_DRIVER_A].Adafruit_PWMServoDriver_V.setPWM(Slave_Ports_Status_A[i].LocalPort, Slave_Ports_Status_A[i].Exp_state_level_A * 16, Slave_Ports_Status_A[i].Exp_state_level_A * 16); //todo  Exp_state_ON_USE_LEVEL
-                                                        Adafruit_PWMServoDriver_A[I2C_INDEX_DRIVER_A].Adafruit_PWMServoDriver_V.setPWM(Slave_Ports_Status_A[i].LocalPort,  Slave_Ports_Status_A[i].Exp_state_level_A, Slave_Ports_Status_A[i].Exp_state_level_A * 16); //todo  Exp_state_ON_USE_LEVEL
-                                                        #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                                        Serial.print("#149 I2C_driver ->Exp_state_ON_USE_LEVEL Exp_state [SET]"); Serial.print(Slave_Ports_Status_A[i].Exp_state); Serial.print("]   after   [");
-                                                        #endif
-                                                        //Serial.print("[I2C_INDEX_DRIVER_A[");Serial.print(I2C_INDEX_DRIVER_A);Serial.print("] [LocalPort["); Serial.print(Slave_Ports_Status_A[i].LocalPort); Serial.print("]  "); 
-                                                        //Serial.print("[D209]Bef[");Serial.print(Slave_Ports_Status_A[i].Exp_state, BIN);Serial.print("]");
-                                                        Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state | Exp_state_SET; //TODO BITTEST
-                                                        Slave_Ports_Status_A[i].Exp_state = ~ Exp_state_SET_REQ_SEND; //TODO BITTEST
-                                                        //Serial.print("[D209]Aft[");Serial.print(Slave_Ports_Status_A[i].Exp_state , BIN);Serial.print("]");
-                                                        Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
-                                                    } else if(Slave_Ports_Status_A[i].Exp_state & Exp_state_ON ) { //TODO BINTEST
-                                                        Adafruit_PWMServoDriver_A[I2C_INDEX_DRIVER_A].Adafruit_PWMServoDriver_V.setPWM(Slave_Ports_Status_A[i].LocalPort, 1000, 1000); //todo  Exp_state_ON_USE_LEVEL
-                                                        #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                                        Serial.print("#149 I2C_driver ->ON Exp_state [SET]"); Serial.print(Slave_Ports_Status_A[i].Exp_state); Serial.print("]   after   [");
-                                                        #endif 
-                                                        Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state | Exp_state_SET; //TODO BITTEST
-                                                        Slave_Ports_Status_A[i].Exp_state =  ~ Exp_state_SET_REQ_SEND; //TODO BITTEST
-                                                        Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.println("]  ");
-                                                        Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
-                                                    } else if(Slave_Ports_Status_A[i].Exp_state & Exp_state_OFF ){ //TODO BINTEST
-                                                        Adafruit_PWMServoDriver_A[I2C_INDEX_DRIVER_A].Adafruit_PWMServoDriver_V.setPWM(Slave_Ports_Status_A[i].LocalPort, 0, 0);
-                                                        #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                                        Serial.print("#149 I2C_driver ->OFF Exp_state [SET]"); Serial.print(Slave_Ports_Status_A[i].Exp_state); Serial.print("]   after   [");
-                                                        #endif 
-                                                        Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state | Exp_state_SET; //TODO BITTEST
-                                                        Slave_Ports_Status_A[i].Exp_state =  ~ Exp_state_SET_REQ_SEND; //TODO BITTEST
-                                                        Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.println("]  ");
-                                                        Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
-                                                    } else if(Slave_Ports_Status_A[i].Exp_state & Exp_state_BLINK ){ //TODO BINTEST
-                                                        #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                                             Serial.print("#168 I2C_driver ->BLINK [Exp_state_ERROR]  before]"); Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.println("]  after [");
-                                                         #endif
-                                                         Adafruit_PWMServoDriver_A[I2C_INDEX_DRIVER_A].Adafruit_PWMServoDriver_V.setPWM(Slave_Ports_Status_A[i].LocalPort, 0,2000);
-                                                      //   delay(1000);
-                                                         Adafruit_PWMServoDriver_A[I2C_INDEX_DRIVER_A].Adafruit_PWMServoDriver_V.setPWM(Slave_Ports_Status_A[i].LocalPort, 0,1000);
-                                                         Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state | Exp_state_ERROR; //TODO BITTEST
-                                                           Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.println("]  ");
-                                                         Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
-                                                    } else {
-                                                    #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                                     Serial.print("#183 I2C_driver [UNSUPP] [Exp_state_ERROR]  before]"); Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.println("]  after [");
-                                                     #endif
-                                                          Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state | Exp_state_SET | Exp_state_ERROR; //TODO BITTEST
-                                                      Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.println("]  ");
-                                                     Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
-                                                    }
-                                     }           
-                                 
-                                 
-                                        #if defined(DEBUG) > 6 || defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                            Serial.println(""); Serial.println(i);  Serial.print(" #126   after PWM    Exp_state_ttl[");
-                                            Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state_ttl)); Serial.print("]  Exp_state[");
-                                            Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.print("]  Broadcast_state[");
-                                            Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Broadcast_state)); Serial.println("] ");
-                                                Serial.print("#170  Exp_state[  ");
-                                                    if(Slave_Ports_Status_A[i].Exp_state |  Exp_state_SET )   Serial.print(" [ | SET ] ");//blad
-                                                    if(Slave_Ports_Status_A[i].Exp_state &  Exp_state_SET )   Serial.print(" [ & SET ] ");//opcjonalnie set
-                                                    if(Slave_Ports_Status_A[i].Exp_state |  Exp_state_ERROR )   Serial.print(" [ | ERR ] ");//blad 
-                                                    if(Slave_Ports_Status_A[i].Exp_state &  Exp_state_ERROR )   Serial.print(" [ & ERR ] "); //opcjonalnie err
-                                                     if(Slave_Ports_Status_A[i].Exp_state |  Exp_state_OFF )   Serial.print(" [ | OFF ] ");//blad
-                                                    if(Slave_Ports_Status_A[i].Exp_state &  Exp_state_OFF )   Serial.print(" [ & OFF ] "); //dziala opcjonalnie off
-                                                    if(Slave_Ports_Status_A[i].Exp_state ==  Exp_state_OFF )   Serial.print(" [ = OFF ] "); //dziala only off                                              
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & Exp_state_SET ) ^ Exp_state_SET ))  Serial.print(" [ ^ SET ] ");//opcjonalnie ste
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & B00000000 ) ^ Exp_state_SET ))  Serial.print(" [ + SET ] "); //not working
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & Exp_state_OFF ) ^ Exp_state_OFF ))  Serial.print(" [ ^ OFF ] ");//opcjonalnie off
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & B00000000 ) ^ Exp_state_OFF ))  Serial.print(" [ + OFF ] "); //not working
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & B11111111 ) ^ Exp_state_OFF ))  Serial.print(" [ # OFF ] ");//only off
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & B11111110 ) ^ B00000001 ))  Serial.print(" [ < OFF ] "); //not working
-                                                        if (!( ( Slave_Ports_Status_A[i].Exp_state & B00000001 ) ^ B11111110 ))  Serial.print(" [ > OFF ] "); //not working
-                                                        
-                                                        
-                                                        //if ((Slave_Ports_Status_A[i].Exp_state & Exp_state_SET) == (x & 0x0f)) {
-                                                          // match
-                                                        //}
-
-                                                    
-                                                Serial.println("]  ");
-                                         #endif
-                                          #if defined(DEBUG_CAN) || defined(DEBUG) || defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                                Serial.println("  [#222] ");  Serial.println("  [#222] ");  Serial.println("  [#222] ");
-                                           #endif
-                            } else {
-                                #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                    Serial.print("#183 I2C_driver [UNPLANNED][ADDRES]  +[Exp_state_ERROR] +[Exp_state_SET] before]"); Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.println("]  after [");
-                                #endif 
-                               Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state | Exp_state_SET | Exp_state_ERROR; //TODO BITTEST
-                                #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                                Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.println("]  ");
-                                #endif 
-                               Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
-                            }
-                            
-                    
-                    
-                    } else {
-                        #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                               Serial.print("#232 I2C_driver [unsupported]  +[Exp_state_ERROR] +[Exp_state_SET] before]"); Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.println("]  after [");
-                        #endif
-                          Slave_Ports_Status_A[i].Exp_state = Slave_Ports_Status_A[i].Exp_state | Exp_state_SET | Exp_state_ERROR; //TODO BITTEST
-                          #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-                           Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state)); Serial.println("]  ");
-                          #endif
-                          Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
-                    }
-                
-               
-                }  else {
-                        #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver) 
-                        Serial.print("    #249  #i["); Serial.print(i); Serial.println("]     ");
-                        #endif
-                }
-        
-      } else {
-      
-      
-         #if defined(DEBUG_I2C_driver_Adafruit_PWMServoDriver)
-            Serial.print("#242  #i["); Serial.print(i); Serial.println("]     ");
-            Serial.print("Exp_state_ttl"); Serial.print(Slave_Ports_Status_A[i].Exp_state_ttl);Serial.print("] ");
-         #endif
-       }//if 3
-    } //for 2
-
- } //func 1
-//#endif

+ 0 - 18
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_Protocol_CAN_func.h

@@ -1,18 +0,0 @@
-
-
-void _Slave_Ports_Protocol_CAN_broadcast_AF(_Slave_Ports_Protocol_CAN_broadcast_T _Slave_Ports_Protocol_CAN_broadcast_A, byte* _Slave_Ports_Protocol_CAN_broadcast_B ) {
-   //byte dataa = {10, 12, 13, 4, 5, 6, 7, 8}; 
-    //   return dataa;
-     _Slave_Ports_Protocol_CAN_broadcast_B[1] = _Slave_Ports_Protocol_CAN_broadcast_A._CAN_REMOTE_ID ;
-     _Slave_Ports_Protocol_CAN_broadcast_B[2] = _Slave_Ports_Protocol_CAN_broadcast_A._CAN_SENDER_ID ;
-     _Slave_Ports_Protocol_CAN_broadcast_B[3] = _Slave_Ports_Protocol_CAN_broadcast_A.Port_ID ;
-     _Slave_Ports_Protocol_CAN_broadcast_B[4] = _Slave_Ports_Protocol_CAN_broadcast_A.PortTypes ;
-     _Slave_Ports_Protocol_CAN_broadcast_B[5] = _Slave_Ports_Protocol_CAN_broadcast_A.Exp_state ;
-     _Slave_Ports_Protocol_CAN_broadcast_B[6] = _Slave_Ports_Protocol_CAN_broadcast_A.Exp_state_ttl ;
-     _Slave_Ports_Protocol_CAN_broadcast_B[7] = _Slave_Ports_Protocol_CAN_broadcast_A.Broadcast_state ;
-     _Slave_Ports_Protocol_CAN_broadcast_B[8] = _Slave_Ports_Protocol_CAN_broadcast_A._CAN_8 ;
-        
-        
-}
-
-

+ 0 - 166
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_Status_QUEUE_struct.h

@@ -1,166 +0,0 @@
-
-
-typedef int QUEUE_ID_T ;
-
-
-
-     struct Slave_Ports_Status_QUEUE_S {
-      QUEUE_ID_T QUEUE_ID_A ; //current queue task
-       TASK_TYPE_T TASK_TYPE_A ; 
-        TASK_PORT_ASSOC_T TASK_PORT_ASSOC_A; //todo link
-       time_seq_id_T time_seq_id;
-       time_min_run_T time_min_run;
-       ARDUINO_ARRAY_INDEX_T DISPLAY_ARDUINO_ARRAY_INDEX_A; //to assoc with display
-    } ;
-    
-    
-    typedef struct Slave_Ports_Status_QUEUE_S Slave_Ports_Status_QUEUE_T;
-
-
-
-
-Slave_Ports_Status_QUEUE_T Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_LIMIT_QUEUE];
-
-typedef struct ARDUINO_ATTR_ARRAY_S Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_T ;
-
-
-static Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_T Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A =  //[ARDUINO_ATTR_ARRAY_S_INDEX] 
-        {    ARDUINO_ARRAY_INDEX_CURRENT_INIT ,
-             ARDUINO_ARRAY_INDEX_LAST_INIT ,
-             ARDUINO_ARRAY_COUNT_T_INIT ,
-             ARDUINO_ARRAY_INDEX_LIMIT_QUEUE , 
-             ARDUINO_ARRAY_INDEX_NEXT_INIT,
-             ARDUINO_ARRAY_time_min_run_MIN_INIT,
-             ARDUINO_ARRAY_INDEX_time_min_run_MIN_INIT,
-             ARDUINO_QUEUE_FLAG_INIT,
-             ARDUINO_ARRAY_ATTR_QUEUE_BACK_INIT,
-             ARDUINO_ARRAY_ATTR_QUEUE_COUNT_INIT, 
-             ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_INIT, 
-             ARDUINO_ARRAY_ATTR_QUEUE_FRONT_INIT ,
-             ARDUINO_ARRAY_ATTR_QUEUE_PEEK_INIT 
-              }
-    ;
-    
-
-ARDUINO_FUNC_STATIC_ID_COUNTER_T Slave_Ports_Status_QUEUE_STATIC_ID_COUNTER_T(){
-    static int ARDUINO_FUNC_STATIC_ID_COUNTER_A =  ARDUINO_FUNC_STATIC_ID_COUNTER_INIT ;
-        return ARDUINO_FUNC_STATIC_ID_COUNTER_A++ ;
-}
-
-//PUSH = ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_A & ARDUINO_ARRAY_ATTR_QUEUE_ACTION_ADD & ARDUINO_ARRAY_ATTR_QUEUE_FRONT
-//POP = ARDUINO_ARRAY_ATTR_QUEUE_PEEK & ARDUINO_ARRAY_ATTR_QUEUE_ACTION_ADD
-
-#ifdef Slave_Ports_Status_QUEUE_STATIC_ID_COUNTER
-void Slave_Ports_Status_QUEUE_STATIC_ID_COUNTER(
-        ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_T& ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_A,
-        ARDUINO_ARRAY_ATTR_QUEUE_COUNT_T& ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A ,
-        ARDUINO_ARRAY_ATTR_QUEUE_PEEK_T& ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A ,
-        ARDUINO_ARRAY_ATTR_QUEUE_BACK_T ARDUINO_ARRAY_ATTR_QUEUE_BACK_A ,
-        ARDUINO_ARRAY_ATTR_QUEUE_FRONT_T ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A,
-        ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_T ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_A
-        ){
-        static ARDUINO_ARRAY_ATTR_QUEUE_T ARDUINO_ARRAY_ATTR_QUEUE_A = {
-             ARDUINO_ARRAY_INDEX_LIMIT_QUEUE,
-             0 , //ARDUINO_ARRAY_ATTR_QUEUE_COUNT_INIT ,
-             1, //ARDUINO_ARRAY_ATTR_QUEUE_PEEK_INIT ,
-             1, //ARDUINO_ARRAY_ATTR_QUEUE_BACK_INIT ,
-             1 //ARDUINO_ARRAY_ATTR_QUEUE_FRONT_INIT
-        };
-        
-        
-        static ARDUINO_ARRAY_QUEUE_TABLE_T Slave_Ports_Status_QUEUE_TABLE_A[ARDUINO_ARRAY_INDEX_LIMIT_QUEUE] ;
-        
-        // int tokens[ARDUINO_ARRAY_INDEX_LIMIT_QUEUE] ;
-        /* template
-         //ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_A
-            ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A
-            ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A
-            ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A
-            ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A
-        */
-        
-        int i;
-        int oldest ;
-        
-        
-     //   ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A = ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A ;
- 
-        
-        Serial.print(ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_A,BIN);
-        if((ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_A & ARDUINO_ARRAY_ATTR_QUEUE_ACTION_ADD )
-         and (ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_A & ARDUINO_ARRAY_ATTR_QUEUE_FRONT) ) {
-         Serial.print(" [PUSH] "); Serial.print(ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_A,BIN);
-                if((ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A + 1) >= ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_A) {
-                        ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A = ARDUINO_ARRAY_INDEX__next__looop(ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_A,   ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A);
-                        ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A = ARDUINO_ARRAY_INDEX__next__looop(ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_A,   ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A);
-                    //    ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A = ARDUINO_ARRAY_INDEX__next__looop(ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_A,   ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A );
-                } else {
-                    ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A++;
-                    ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A = ARDUINO_ARRAY_INDEX__next__looop(ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_A,   ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A);
-                    ARDUINO_ARRAY_ATTR_QUEUE_BACK_A  = ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A ;
-                }
-                
-              //  RDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A ;
-              //  RDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A ;
-                
-                if(ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A == ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A) {
-                   //is forward pointer peek tez przestawiamy
-                    ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A = ARDUINO_ARRAY_INDEX__next__looop(ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_A,   ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A);
-                 //   ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A =  ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A ; 
-                 } else {
-                    Serial.print(" [E1] "); 
-                }
-                
-                
-        } 
-        
-         if((ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_A & ARDUINO_ARRAY_ATTR_QUEUE_ACTION_ADD) and (ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_A & ARDUINO_ARRAY_ATTR_QUEUE_BACK)) {
-          Serial.print(" [POP] ");
-                    if(ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A == ARDUINO_ARRAY_INDEX__next__looop(ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_A,  ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A )) { //jak kolejka mala to nie wchodzimy na siebie
-                      Serial.print("  [EMPTY] "); 
-                        //RDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A = ARDUINO_ARRAY_INDEX__next__looop(ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_A,  ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A );
-
-                       //ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A = ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A ; 
-                      //ARDUINO_ARRAY_ATTR_QUEUE_BACK_A = 0;
-                    } else if( ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A > 1) {
-                            ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A--;
-                         //   ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A = ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A ; 
-                            ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A = ARDUINO_ARRAY_INDEX__next__looop(ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_A,  ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A );
-                            
-                    }
-         }
-        
-        ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A = ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A ;
-        ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A = ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A ; 
-        ARDUINO_ARRAY_ATTR_QUEUE_BACK_A = ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A  ;
-        Serial.print(" [CNT= ");  Serial.print(ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A); Serial.print("]   ");
-        Serial.print(" [FRONT "); Serial.print(ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A); Serial.print("]   ");
-        Serial.print(" [BACK ");  Serial.print(ARDUINO_ARRAY_ATTR_QUEUE_BACK_A); Serial.print("]   ");
-      //  Serial.print(" [PEEK ");  Serial.print(ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A); Serial.print("]   ");
-          Serial.println();
-        
- 
-}
-
-#endif
-/*
-
- struct _Slave_Ports_queue_tasksS {
-  int queueID;
-  int _Slave_Ports_queue_task_type ; /*
-              { 0x01 _Slave_Ports_ttl_decrement, 
-                 0x02  request_confirm_Exp_state ,
-                 0x03  request_set_new_Exp_state,
-                 0x04 
-                  }
-  
-  int _Slave_Port_link; //todo link
- long time_seq_id;
- long time_min_run;
-} ;
-
-typedef struct _Slave_Ports_queue_tasksS _Slave_Ports_queue_tasksT;
-
-
-
-*/

+ 0 - 292
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_Status_func.h

@@ -1,292 +0,0 @@
-#include <limits.h>
- void Slave_Ports_Status_add_port(
- Slave_Ports_Status_T* Slave_Ports_Status_A , 
- Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
-  Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_T*            Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
-  Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T*      Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
-  Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_T*  Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                int  Port_ID,
-                int  _Slave_ID,
-                PortTypes_T  PortTypes,
-                int  Address,
-                int  LocalPort,
-                Exp_state_T  Exp_state,
-                Exp_state_ttl_T  Exp_state_ttl,
-                Broadcast_state_T  Broadcast_state,
-                int I2C_port,
-                //int I2C_driver
-                I2C_driver_T I2C_driver, 
-                IS_Local_T IS_Local_A,
-                time_seq_id_T time_seq_id, 
-                time_min_run_T time_min_run 
-                )
-{
-
-                                       #if defined(DEBUG)
-                                                     Serial.print("#2444 Slave_Ports_Status_add_port[DEBUG] # BEFORE COUNT["); Serial.print(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A);
-                                                      Serial.print("] INDEX_LAST["); Serial.print( Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A);
-                                                      Serial.print("] INDEX_CURRENT["); Serial.print( Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A);
-                                                      Serial.print("] NEXT_A["); Serial.print( Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A);
-                                                     Serial.println("]  ");
-                                      #endif   
-
-        //int i = Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A ;
-        int i = Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;
-        //if(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A == 0) {
-          if(i == ARDUINO_ARRAY_INDEX_CORRUPT) {
-               
-                // Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A ++;
-                          Slave_Ports_Status_A[i].Port_ID=0;
-                          Slave_Ports_Status_A[i]._Slave_ID=0x00;
-                          Slave_Ports_Status_A[i].PortTypes=PortTypes_NOT_SET;
-                          Slave_Ports_Status_A[i].Address=0x00;
-                          Slave_Ports_Status_A[i].LocalPort=0;
-                          Slave_Ports_Status_A[i].Exp_state=Exp_state_ERROR;
-                          Slave_Ports_Status_A[i].Exp_state_ttl=0x00;
-                          Slave_Ports_Status_A[i].Broadcast_state=0x00;
-                          Slave_Ports_Status_A[i].I2C_port=0x00;
-                         // Slave_Ports_Status_A[i].I2C_driver=0x00;
-                          Slave_Ports_Status_A[i].IS_Local_A=IS_Local_FALSE;
-                
-                
-                ARDUINO_ATTR_ARRAY_S__commit_added_element(
-                          Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A , 
-                         i); //Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A
-                
-                //ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A
-                                
-                 //Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A ++;   
-            }
-    
-    
-            //valid if is uniq
-            boolean found  ;
-            found = false ; 
-            int found_id ; 
-            for(i = ARDUINO_ARRAY_INDEX_FIRST; i<= Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A  ; i++ ) {
-                    //when add context  - we should TTL_broadcast ourselves
-                   
-                if((Slave_Ports_Status_A[i].Port_ID == Port_ID) and (Slave_Ports_Status_A[i]._Slave_ID == _Slave_ID ))  {
-                    found = true ;
-                        Serial.print("+D");Serial.print(i);
-                        found_id = i;
-                   }
-            }
-               
-               
-               if(found == false ) {
-                    
-                      i = Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A ;
-                    
-                    Slave_Ports_Status_A[i].Port_ID = Port_ID ;
-                    Slave_Ports_Status_A[i]._Slave_ID = _Slave_ID ;
-                    Slave_Ports_Status_A[i].PortTypes = PortTypes ;
-                    Slave_Ports_Status_A[i].Address = Address ;
-                    Slave_Ports_Status_A[i].LocalPort = LocalPort ;
-                    Slave_Ports_Status_A[i].Exp_state = Exp_state ;
-                    Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl ;
-                    Slave_Ports_Status_A[i].Broadcast_state = Broadcast_state ;
-                    Slave_Ports_Status_A[i].I2C_port = I2C_port ;
-                    Slave_Ports_Status_A[i].I2C_driver = I2C_driver ;
-                    Slave_Ports_Status_A[i].IS_Local_A = IS_Local_A;
-                  //  Slave_Ports_Status_A[Slave_Ports_Status_T_ARDUINO_ARRAY_COUNT_A + 1].I2C_driver = I2C_driver_F(I2C_driver) ;
-                            ARDUINO_ATTR_ARRAY_S__commit_added_element(
-                                          Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A , 
-                                          i);//Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A
-                  
-                  #if defined(DISABLE_TASK_TYPE_T_Broadcast_state_LOW)
-                  #else
-                   _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                     TASK_TYPE_T_Broadcast_state_LOW______  ,TASK_PORT_ASSOC_EMPTY ,time_seq_id, time_seq_id + 50000  , ARDUINO_ARRAY_INDEX_NOT_SET ) ;
-                  #endif
-                     
-               } else {
-                    //duplicated
-                    //update
-                    Serial.print("[found][");Serial.print(found); Serial.print("] found_id[");Serial.print(found_id); Serial.print("] ");
-                     if(Broadcast_state>0) Slave_Ports_Status_A[found_id].Broadcast_state = Broadcast_state ;
-                     if(Exp_state>0) Slave_Ports_Status_A[found_id].Exp_state = Exp_state ;
-                     if(Exp_state_ttl>0) Slave_Ports_Status_A[found_id].Exp_state_ttl = Exp_state_ttl ;
-                     if(Slave_Ports_Status_A[found_id].IS_gone_A == IS_gone_TRUE) Slave_Ports_Status_A[found_id].IS_gone_A = IS_gone_FALSE;
-                 
-               }
-}
-
-
- void Slave_Ports_Status__DISPLAY_TARGET(
-        Slave_Ports_Status_T* Slave_Ports_Status_A ,
-        Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
-        Port_ID_T  Port_ID ,
-        //display
-        DISPLAY_T* DISPLAY_A ,
-        DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-        DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A, 
-            DISPLAY_pos_seq_T DISPLAY_pos_seq_A,
-            #if defined(DISPLAY_array16_T_is_DISPLAY_string_T)
-                DISPLAY_string_T DISPLAY_string_ASSSS,
-            #else
-                DISPLAY_array16_T DISPLAY_array16_A,
-             #endif
-            
-            DISPLAY_TARGET_T DISPLAY_TARGET_A,
-            time_seq_id_T time_seq_id_A,
-            time_min_run_T time_min_run_A
-        //queue
-        ,Slave_Ports_Status_QUEUE_T* Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-        //tasks
-        TASK_TYPE_T TASK_TYPE_A,
-        TASK_PORT_ASSOC_T TASK_PORT_ASSOC_A
-  )
-   {
-   
-                String title = "Ports of 0x" ; title.concat(String(Active_ControllerID_HEX , HEX));                 title.concat(" ");
-                     
-                   
-
-        int i_pos = 1;    
-        int i;
-                      
-                       DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].ARDUINO_ARRAY_INDEX_CURRENT_A = 1 ;
-                       DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_SIZE_X_CHARS_MIN_A = 0 ;
-                       DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_SIZE_Y_CHARS_MIN_A = 0 ;
-                       DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_SIZE_X_CHARS_MAX_A = 0  ;
-                       DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_SIZE_Y_CHARS_MAX_A = 8 ;// DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_Y_CHARS_A  ;
-                     
-                    
-                    
-                     
-                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[1].DISPLAY_CURSOR_X_CHARS_A =  0 ;
-                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[1].DISPLAY_CURSOR_Y_CHARS_A = 0 ;
-
-                     title.toCharArray(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[1].DISPLAY_char_A, title.length() + 1);
-                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[1].DISPLAY_string_A = "NULL_SHB" ;// "Ports"; //DISPLAY_string_A ;
-                     
-                     
-                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[1].DISPLAY_COLOR_A =  0x0004 ;
-                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[1].DISPLAY_MENU_ITEM_FLAG_A = DISPLAY_MENU_ITEM_FLAG_INITIALIZED  ;
-                           
-       
-       
-        
-        for(i=ARDUINO_ARRAY_INDEX_FIRST ; i<=Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ; i++) {//i <= Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A
-           DISPLAY_array16_T  DISPLAY_array16_AA="" ;
-           DISPLAY_array16_T  DISPLAY_array16_AB="" ;
-        
-           
-            
-            
-             if(Slave_Ports_Status_A[i].Port_ID > 0 ) {
-            
-                   i_pos ++ ;
-                   
-                      String message = "";
-                       String message2 ;
-                   
-                     
-                       
-                      message.concat(i);
-                      message.concat(".");
-                      message.concat(Slave_Ports_Status_A[i].Port_ID )  ; 
-                      message.concat(" ");
-                      
-                       if(Slave_Ports_Status_A[i].PortTypes & PortTypes_SERVO ) {
-                            message.concat("S");
-                       }
-                       if(Slave_Ports_Status_A[i].PortTypes & PortTypes_SERVO_360 ) {
-                            message.concat("3");
-                       }
-                      
-                         if(Slave_Ports_Status_A[i].IS_gone_A == IS_gone_TRUE) {
-                             message2 = message ; message2.concat(" [---] ");
-                         } else {
-                              message2 = message  ; message2.concat(" ");//E:
-                      
-                              message2.concat(" ");// B:
-                               
-                                   message2.concat(Slave_Ports_Status_A[i].Exp_state_ttl/10 )  ;
-                      
-                                              message2.concat(" ");// B:
-                                               message2.concat(Slave_Ports_Status_A[i].Broadcast_state/10 )  ;
-                                           if(Slave_Ports_Status_A[i].IS_Local_A == IS_Local_TRUE) {
-                                               message2.concat(" L");// B:
-                                          } else if(Slave_Ports_Status_A[i].IS_Local_A == IS_Local_FALSE) {
-                                               message2.concat(" R");// B:
-                                          } 
-                                        if(Slave_Ports_Status_A[i].Exp_state & Exp_state_ON_USE_LEVEL ) {
-                                         message2.concat(" ["); message2.concat(Slave_Ports_Status_A[i].Exp_state_level_A); message2.concat("] ");
-                                           /*if(Slave_Ports_Status_A[i].Exp_state_level_A < 10 ) message2.concat(" [___] ");//E:
-                                           else if(Slave_Ports_Status_A[i].Exp_state_level_A < 100 )  message2.concat("  [#___] ");//E:
-                                           else if(Slave_Ports_Status_A[i].Exp_state_level_A < 1000 ) message2.concat("  [##__] ");//E:
-                                           else if(Slave_Ports_Status_A[i].Exp_state_level_A < 2000 ) message2.concat("  [###_] ");//E:
-                                           else if(Slave_Ports_Status_A[i].Exp_state_level_A >= 2000 ) message2.concat(" [####] ");//E:
-                                           */
-                                         }
-                                         
-                                         
-                                       if(Slave_Ports_Status_A[i].Exp_state & Exp_state_SET_REQ_SEND ) {
-                                        message2.concat(">*");//E:
-                                       } else if(Slave_Ports_Status_A[i].Exp_state & Exp_state_SET ) {
-                                        message2.concat("*");//E:
-                                         
-                                          } else  if (!( ( Slave_Ports_Status_A[i].Exp_state & Exp_state_SET ) ^ Exp_state_SET ))  {
-                                          message2.concat(" ** ");//E:
-                                          } else {
-                                           message2.concat(" ?");//E: 
-                                 
-                                 
-                                 
-                                      
-                                 
-                                 
-                                 }
-                               
-                                 
-                          
-                 
-                        
-             // String message = "P ";  message.concat(Slave_Ports_Status_A[i].Port_ID)  ;  message.concat(" ");
-                
-                if(i >= (ARDUINO_ARRAY_INDEX_LIMIT_DISPLAY_MENU_ITEM_A - 1)) {
-                    Serial.print( "[DISPL][LIMIT][HIT]" ) ;
-                } else {
-             
-                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[i+1].DISPLAY_CURSOR_X_CHARS_A =  0 ;
-                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[i+1].DISPLAY_CURSOR_Y_CHARS_A = i ;
-                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[i+1].DISPLAY_string_A = message2 ;
-message2.toCharArray(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[i+1].DISPLAY_char_A, message2.length() + 1);
-                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[i+1].DISPLAY_COLOR_A = BLACK  ;
-                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[i+1].DISPLAY_MENU_ITEM_FLAG_A = DISPLAY_MENU_ITEM_FLAG_INITIALIZED  ;
-                     DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[i+1].ARDUINO_ARRAY_INDEX_A = i  ;
-                }
-             
-                //DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[i+1].DISPLAY_CURSOR_X_CHARS_A =  0 ;
-                //DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[i+1].DISPLAY_CURSOR_Y_CHARS_A = i ;
-                //DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[i+1].DISPLAY_string_A = "test123123" ;
-                //DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[i+1].DISPLAY_COLOR_A = BLACK  ;
-                //DISPLAY_PHYSICAL_CHAR_A.DISPLAY_MENU_A[1].DISPLAY_MENU_ITEM_A[i+1].DISPLAY_MENU_ITEM_FLAG_A = DISPLAY_MENU_ITEM_FLAG_INIT  ;
-                
-               }
-             }
-            
-            
-            
-            
-            
-           
-            #if defined(HAS_TFT_ILI9163C)
-           
-               DISPLAY__print_menu( DISPLAY_A ,DISPLAY_T_ARDUINO_ATTR_ARRAY_A , DISPLAY_PHYSICAL_CHAR_A, 
-                         1,  //DISPLAY_MENU_ITEM_INDEX_T DISPLAY_MENU_ITEM_INDEX_A
-                         time_seq_id_A, (time_seq_id_A + 5000) 
-                          );  
-                
-              #endif
-           
-        
-            
-        }
-   
-   }  
-   
-   
- 

+ 0 - 41
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_func_loop.h

@@ -1,41 +0,0 @@
-
-void _Slave_Ports_ttl_decrement ();
-
-void _Slave_Ports_action_queue ();  //request_confirm_Exp_state  //request_set__new_Exp_state
-
-//void LCD_print_background_screen_add(_LCD_print_screensT* _LCD_print_screens, int screenID,long time_seq_id, long time_min_run, String LCDarray1, String LCDarray2 ) {
-  //time_seq_id - used to maintain single display context
-  //time_max - used to how much time to keep in displayed text
-  
-    
-void _Slave_Ports_message_CAN_to_queue(); //
-void  _Slave_Ports_message_queue_to_CAN() ;//
-void  _Slave_Ports_message_queue_to_PWM() ;//
-
-/*
-  int queueID;
-  int _Slave_Ports_queue_task ; /*
-              { 0x01 _Slave_Ports_ttl_decrement, 
-                 0x02  request_confirm_Exp_state ,
-                 0x03  request_set__new_Exp_state }
-
- */
-
-
-
-/*
- 
-void _LCD_print_screens_list(_LCD_print_screensT* _LCD_print_screens ) {
- int i;
-
-
-   Serial.print("sizeof(_LCD_print_screens): ");
-    Serial.println(sizeof(_LCD_print_screens));
- for(i=0;i<=10;i++) { //sizeof(_LCD_print_buffors)
-          Serial.print(" $i[");
-          Serial.print(i);
-
-          Serial.print("] screenID: ");
-          Serial.print(_LCD_print_screens[i].screenID);
-
- */

+ 0 - 3
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_ttl_decrement.h

@@ -1,3 +0,0 @@
- 
- 
- //void _Slave_Ports_queue__add( _Slave_Ports_queue_tasksT* _Slave_Ports_queue_tasks_LIST,int _Slave_Ports_queue_task_type,int _Slave_Port_link,long time_seq_id, long time_min_run //, 

+ 0 - 23
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_ttl_decrement_func.h

@@ -1,23 +0,0 @@
-//_Slave_Ports_ttl_decrement_POP.h
-
-//#ifndef _Slave_Ports_ttl_decrement_POP_F
-
-//#define _Slave_Ports_ttl_decrement_POP_F
-
- void _Slave_Ports_ttl_decrement_POP(Slave_Ports_Status_QUEUE_T*  Slave_Ports_Status_QUEUE_A,
- Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A,
- int _Slave_Ports_queue_pop ,  Slave_Ports_Status_T* Slave_Ports_Status_A) {
-     Serial.print("#213 _Slave_Ports_ttl_decrement_POP.   sizeof Slave_Ports_Status_A[");     Serial.print(sizeof(Slave_Ports_Status_A));
-    int i;
-    for(i=0;i<=100;i++) {
-      if(Slave_Ports_Status_A[i].LocalPort > 0) {
-            if(Slave_Ports_Status_A[i].Exp_state_ttl == Exp_state_ttl_TO_REFRESH ) {
-               Serial.print("#217 ttl min for: LocalPort[");  Serial.print(Slave_Ports_Status_A[i].LocalPort);   Serial.print("] ttl[");  Serial.print(Slave_Ports_Status_A[i].Exp_state_ttl);
-                 Serial.print(" Port_ID[");  Serial.print(Slave_Ports_Status_A[i].Port_ID);   Serial.println("]  ");   Serial.print(" id[");  Serial.print(i);   Serial.println("]  "); 
-            }
-
-      }
-    }
-
- } 
-//#endif

+ 0 - 29
SE/stuff/P5_Automation_can-dev-res/_TASK_TYPES_func.h

@@ -1,29 +0,0 @@
-
-
-void _Slave_Ports_queue_task_type_DESC( int _Slave_Ports_queue_task_type ) {//, int* res        
-         switch (_Slave_Ports_queue_task_type) {
-                case TASK_TYPE_T_Slave_Ports_ttl_decrement:   
-                  Serial.println("TASK_TYPE_T_Slave_Ports_ttl_decrement");
-                  break;
-                case TASK_TYPE_T_request_confirm_Exp_state:   
-                  Serial.println("TASK_TYPE_T_request_confirm_Exp_state");
-                  break;
-                case TASK_TYPE_T_request_set_new_Exp_state:  
-                  Serial.println("TASK_TYPE_T_request_set_new_Exp_state");
-                  break;
-                case TASK_TYPE_T_Slave_Ports_broadcast____:  
-                  Serial.println("TASK_TYPE_T_Slave_Ports_broadcast____");
-                  break;
-                case TASK_TYPE_T_Slave_Ports_set_I2C______:  
-                  Serial.println("TASK_TYPE_T_Slave_Ports_set_I2C______");
-                  break;
-                 case TASK_TYPE_T_DISPLAY_queue_pop________:  
-                  Serial.println("TASK_TYPE_T_DISPLAY_queue_pop________");
-                  break;
-                 case TASK_TYPE_T__EMPTY__JUST_PASSED_ARG__:  
-                  Serial.println("TASK_TYPE_T__EMPTY__JUST_PASSED_ARG__");
-                  break;
-                  
-                Serial.println("106 unknown _Slave_Ports_queue_task_type");
-          }
-}

+ 0 - 27
SE/stuff/P5_Automation_can-dev-res/_TFT_ILI9163C_config.h

@@ -1,27 +0,0 @@
- #define TFT_ILI9163C_CSpin 7 // __CSpin // 53 // 10 //  chip select
-
-  #define TFT_ILI9163C_DCpin 8 // A0   data/command pin.   sometimes called DC, RS, ...
-
-  #define TFT_ILI9163C__RSTpin 9 //reset pin.   you must connect.   (or pullup)
-  //#define __SDA 51 //11 //+ bidirectional data pin.   Connect to MOSI
-  //#define __SCK 52 //13 //+ clock.   sometimes called SCLK, SCL, ...
-  
-  
-//#define __144_RED_PCB__
-#define __144_BLACK_PCB__
-	//#define __22_RED_PCB__
-	
-	#define _TFTWIDTH  		128//the REAL W resolution of the TFT
-	#define _TFTHEIGHT 		128//the REAL H resolution of the TFT
-	#define _GRAMWIDTH      	128
-	#define _GRAMHEIGH      	160//Heh? Yes! My display uses offset!
-	#define _GRAMSIZE		_GRAMWIDTH * _GRAMHEIGH //
-	#define __COLORSPC		1// 1:GBR - 0:RGB
-	#define __GAMMASET3		//uncomment for another gamma (1,2,3)
-	#define __OFFSET		32//this is the offset of my display, 160 - 128 = 32
-	//#define __OFFSET		0//this is the offset of my display, 160 - 128 = 32
-
-  
-  #include <SPI.h>
-  #include <Adafruit_GFX.h>
-  #include <TFT_ILI9163C.h>

+ 0 - 262
SE/stuff/P5_Automation_can-dev-res/_TFT_ILI9163C_func.h

@@ -1,262 +0,0 @@
-//   DISPLAY_DEV.setCursor(0,60); 
-//   DISPLAY_DEV.print(LCDarray1); DISPLAY_DEV.print(" "); DISPLAY_DEV.print(LCDarray2);
-
-
- TFT_ILI9163C DISPLAY_DEV = TFT_ILI9163C(TFT_ILI9163C_CSpin, TFT_ILI9163C_DCpin, TFT_ILI9163C__RSTpin);
-
-//defineScrollArea
-//scroll
-//startPushData(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
-//	void 		pushData(uint16_t color);
-//	void 		endPushData();
-//fillRect(int16_t x, int16_t y, int16_t w, int16_t h,uint16_t color),
-//				setRotation(uint8_t r),
-//drawPixel(int16_t x, int16_t y, uint16_t color),
-//				drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color),
-//				drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color),
-
-/*
- 
-void TFT_ILI9163C_BASE::defineScrollArea(uint16_t tfa, uint16_t bfa){
-    tfa += __OFFSET ;
-    int16_t vsa = _GRAMHEIGH - tfa - bfa;
-    if (vsa >= 0) {
-        writecommand(CMD_VSCLLDEF);
-        writedata16(tfa);
-        writedata16(vsa);
-        writedata16(bfa);
-    }
-}
- 
-void TFT_ILI9163C_BASE::scroll(uint16_t ssa) {
-    if (ssa <= _TFTHEIGHT) {
-        writecommand(CMD_VSSTADRS);
-        writedata16(ssa + __OFFSET);
-    }
-}
- 
-  
-  int16_t getCursorX(void) const { return cursor_x; }
-
-    @brief      Get text cursor Y location
-    @returns    Y coordinate in pixels
-  int16_t getCursorY(void) const { return cursor_y; };
-  
-  
-  write - 
-
-
-  tft.fillScreen();
-  unsigned long start = micros();
-  tft.setCursor(0, 0);
-  tft.setTextColor(WHITE);  
-  tft.setTextSize(1);
-  tft.println("Hello World!");
-  tft.setTextColor(YELLOW); 
-  tft.setTextSize(2);
-  tft.println(1234.56);
-  tft.setTextColor(RED);    
-  tft.setTextSize(3);
-  tft.println(0xDEAD, HEX);
-  tft.println();
-  tft.setTextColor(GREEN);
-  tft.setTextSize(4);
-  tft.println("Hello");
-  return micros() - start;
-
-*/
-
-
-
-void DISPLAY_DEV__CURSOR_Y_CHARS__SET(DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A, 
-                DISPLAY_CURSOR_Y_CHARS_T DISPLAY_CURSOR_Y_CHARS_A 
-                ) { 
-                DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A = DISPLAY_CURSOR_Y_CHARS_A ;
-                DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_X_CHARS_A = 0 ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
-
-#if defined(ENABLE_DISPLAY_MENU)
-#else
-                DISPLAY_DEV.setCursor(0,
-                            DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A * DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-
-         //DISPLAY_DEV.clearScreen();
-                 DISPLAY_DEV.fillRect(0, 
-                  (  DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A + 1 ) * DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A,
-                    DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_PX_A , 
-                    DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A , GREEN);
-#endif               
-         
-}
-
-
-void DISPLAY_DEV__CURSOR__clearScreen(DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A) { 
-
-        
-        #if defined(ENABLE_DISPLAY_MENU)
-        #else
-
-         DISPLAY_DEV.setCursor(0,0);
-         //DISPLAY_DEV.clearScreen();
-          DISPLAY_DEV.fillRect(0, 0, DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_PX_A , DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A  ,BLUE),
-         DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A = 0 ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
-         DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_X_CHARS_A = 0 ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
-         
-    #endif
-}
-
-
-void DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A
-    ) { 
-    
-            
-        #if defined(ENABLE_DISPLAY_MENU)
-        #else
-    
-    if(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A + 1 >= DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_Y_CHARS_A) {//[ARDUINO_ATTR_ARRAY_S_INDEX]
-        DISPLAY_DEV.setCursor(0,0);
-         //DISPLAY_DEV.clearScreen();
-       DISPLAY_DEV.fillRect(0, 0, DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_PX_A , DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A  ,BLUE) ;   
-         DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A = 0 ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
-         DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_X_CHARS_A = 0 ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
-    } else {
-    
-         DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A ++ ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
-         DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_X_CHARS_A = 0 ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
-         
-         DISPLAY_DEV.setCursor(0,DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A * DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-         DISPLAY_DEV.fillRect(0, DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A * DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A, DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_PX_A , DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A  ,BLUE);
-    }
-    
-           #if defined(DEBUG)
-                if(DEBUG > 6) {     
-                     Serial.print("#83 Dspl Y:["); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-                     Serial.print("] #MaxY:["); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_Y_CHARS_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-                     Serial.print("]  maxX:["); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-                     Serial.print("]  x_A:["); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_x_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-                     
-                     //Serial.print("] #YxF:["); Serial.print(&DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A *  DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-                     Serial.println("] "); 
-                }
-            #endif
-            #endif
-}
-
-
-
-
-
-
-void  DISPLAY_DEV_CTRL__println(DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A, 
-
-
-    
-
-                                #if defined(DISPLAY_array16_T_is_DISPLAY_string_T)
-                                  DISPLAY_string_T DISPLAY_string_A,
-                                #else
-                                   DISPLAY_array16_T DISPLAY_array16_A ,
-                                #endif
-                               
-                                 
-                                DISPLAY_pos_seq_T DISPLAY_pos_seq_A
-                                ) {
-                                
-                                    
-        #if defined(ENABLE_DISPLAY_MENU)
-        #else
-                                
-                                DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ; 
-                             
-                             
-                                                            
-                                 
-                                  #if defined(DISPLAY_array16_T_is_DISPLAY_string_T)
-                                        if(DISPLAY_pos_seq_A & DISPLAY_pos_seq_A_CLEARSCREEN) DISPLAY_DEV__CURSOR__clearScreen(DISPLAY_PHYSICAL_CHAR_A) ;
-                                  
-                                            DISPLAY_DEV.print(DISPLAY_string_A);
-                                         // DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ;
-                                          
-                                         #else
-                                        
-                                                
-                                                   
-                                                   String message(DISPLAY_array16_A);
-                                                 #if defined(ENABLE_DISPLAY_MENU)
-                                                 #else
-                                                    if(DISPLAY_pos_seq_A & DISPLAY_pos_seq_A_CLEARSCREEN) DISPLAY_DEV__CURSOR__clearScreen(DISPLAY_PHYSICAL_CHAR_A) ;
-                                                 #endif
-                                                 
-                                                 int parts =  floor(message.length()/ DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A ) ; //( message.length() + 100)
-                                                 if(message.length() >= DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A and parts == 1) parts ++; 
-                                                 else if(parts == 0) parts = 1;
-                                                 int substr_begin = 0 ;
-                                                 int substr_end = 0 ;
-                                                 int i;
-                                                 
-                                                  #if defined(DEBUG) 
-                                                   if(DEBUG > 6) {  
-                                                      Serial.print("#34 arr16"); Serial.print(DISPLAY_array16_A);
-                                                      Serial.print("] #34 sizeof["); Serial.print(message.length());
-                                                      Serial.print("] #34 String["); Serial.print(message);
-                                                      Serial.print("] #34 frag"); Serial.print( message.substring(2, 5));
-                                                      Serial.print("] parts["); Serial.print( parts);
-                                                      Serial.print("] yC["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A);
-                                                      Serial.println("] "); 
-                                                      }
-                                                  #endif
-                                                 
-                                                 int bufi;
-                                                 char buf[1];
-                                                 for(i = 1 ; i<= parts; i++) {
-                                                     //myString.substring(from, to)
-                                                     substr_end = substr_begin + DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A ;
-                                                         DISPLAY_DEV.print(message.substring(substr_begin, substr_end));
-                                                        /*BUG TODO ERROR IF UNCOMMENTED*/
-                                                        
-                                                        
-                                                        
-                                                        
-                                                       /* for(bufi = 0; bufi <= 16; bufi++) {
-                                                            message.substring(substr_begin + bufi, substr_begin + bufi + 1).toCharArray(buf,1);
-                                                             //DISPLAY_DEV.print(buf.substring(bufi, bufi+1));
-                                                             DISPLAY_DEV.print(buf[0]);
-                                                        }
-                                                        */
-                                                         #if defined(DEBUG)
-                                                           if(DEBUG > 6) {  
-                                                                 Serial.print("#112 msg part["); Serial.print(i);
-                                                                Serial.print("]  beg["); Serial.print(substr_begin);
-                                                                Serial.print("]  end["); Serial.print(substr_end);
-                                                                Serial.print("]  frag["); Serial.print(message.substring(substr_begin, substr_end));
-                                                                Serial.print("] yC["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A);
-                                                                Serial.println("] ");
-                                                               } 
-                                                          #endif
-                                                          
-                                                         substr_begin = substr_end + 1;
-                                                         if( parts >= 1 and not(parts == i)) {
-                                                             
-                                                              DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ;
-                                                         } //else if(i == parts) {
-                                                           //  DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ;
-                                                        // }
-                                                 } 
-                                                 /*BUG TODO ERROR IF UNCOMMENTED
-                                                 // Serial.end();    // Ends the serial communication once all data is received
-                                                 //Serial.begin(115200);  
-                                                // delay(400);
-                                                // if (Serial.available()) Serial.write("aaaa49 ");
-                                                 //delay(100);
-                                                // if (Serial.available()) Serial.println("bbbb49 ");
-                                               //  else  Serial.println("cccc49 ");
-                                               */
-                                                
-                                        
-                                        
-                                #endif
-                        #endif         
-                              
-            }
-            
-            
-            

+ 0 - 17
SE/stuff/P5_Automation_can-dev-res/_TFT_ILI9163C_init.h

@@ -1,17 +0,0 @@
-  //#define TFT_ILI9163C_CSpin __CSpin // 53 // 10 //  chip select
-
-
- 
-
-  
-  // Color definitions
- 
-
- // TFT_ILI9163C display = TFT_ILI9163C(TFT_ILI9163C_CSpin, TFT_ILI9163C_DCpin, TFT_ILI9163C__RSTpin);
- // float p = 3.1415926;
-
-
-     //DISPLAY_DEV.begin();
-     
-     
-     

+ 0 - 14
SE/stuff/P5_Automation_can-dev-res/_TFT_ILI9163C_setup.h

@@ -1,14 +0,0 @@
-
-  //float p = 3.1415926;
-  //  TFT_ILI9163C display = TFT_ILI9163C(TFT_ILI9163C_CSpin, TFT_ILI9163C_DCpin, TFT_ILI9163C__RSTpin);
-     DISPLAY_DEV.begin();
-     
-     //DISPLAY_DEV.defineScrollArea(10,100);
-     //@param  s  Desired text size. 1 is default 6x8, 2 is 12x16, 3 is 18x24, etc
-     // DISPLAY_DEV.setTextSize(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_x_A , DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A);
-     DISPLAY_DEV.clearScreen();
-     DISPLAY_DEV.setCursor(0,0);
-    // DISPLAY_DEV.print(LCDarray1);
-    // DISPLAY_DEV.setCursor(0,10);
-    // DISPLAY_DEV.print(LCDarray2);
-     

+ 0 - 65
SE/stuff/P5_Automation_can-dev-res/_TFT_ILI9163C_struct.h

@@ -1,65 +0,0 @@
-
-
-//typedef struct DISPLAY_PHYSICAL_CHAR_S _TFT_ILI9163C_struct
-
-   DISPLAY_PHYSICAL_X_PX_T DISPLAY_PHYSICAL_X_PX_A = 128;
-   DISPLAY_PHYSICAL_Y_PX_T DISPLAY_PHYSICAL_Y_PX_A = 128 ;
-
-DISPLAY_CURSOR_X_CHARS_T DISPLAY_CURSOR_X_CHARS_A = 0;
-DISPLAY_CURSOR_Y_CHARS_T DISPLAY_CURSOR_Y_CHARS_A = 0;
-
-const    DISPLAY_textsize_x_T DISPLAY_textsize_x_A = 6.3; //5 nominal
-const    DISPLAY_textsize_y_T DISPLAY_textsize_y_A = 10; //8 nominal
-
- DISPLAY_PHYSICAL_X_CHARS_T DISPLAY_PHYSICAL_X_CHARS_A = DISPLAY_PHYSICAL_X_PX_A /  DISPLAY_textsize_x_A ; //todo to test
-
- DISPLAY_PHYSICAL_Y_CHARS_T DISPLAY_PHYSICAL_Y_CHARS_A = DISPLAY_PHYSICAL_Y_PX_A / DISPLAY_textsize_y_A ; //todo to test
-
-
-  //struct DISPLAY_PHYSICAL_CHAR_T {  DISPLAY_PHYSICAL_CHAR_S ; } DISPLAY_PHYSICAL_CHAR_A  ;
-  
- typedef  struct DISPLAY_PHYSICAL_CHAR_S DISPLAY_PHYSICAL_CHAR_T  ;
-
-
-/*
-struct DISPLAY_PHYSICAL_CHAR_S {
-           DISPLAY_PHYSICAL_X_CHARS_T DISPLAY_PHYSICAL_X_CHARS_A;
-        } DISPLAY_PHYSICAL_CHAR_AA;
-         
-    */
-//DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A = DISPLAY_PHYSICAL_X_CHARS_A ;
-
-   
-    //DISPLAY_PHYSICAL_CHAR_T  DISPLAY_PHYSICAL_CHAR_A;
-    
-   /* struct DISPLAY_PHYSICAL_CHAR_S DISPLAY_PHYSICAL_CHAR_A[1] ;
-    
-    DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A = DISPLAY_PHYSICAL_X_CHARS_A ;
-    DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_Y_CHARS_A =            20 ;
-    DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_X_CHARS_A =                 0 ; 
-    DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A =                 0 ;
-    DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_x_A =                 DISPLAY_textsize_x_A ;
-    DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A =                 DISPLAY_textsize_y_A ;
-     */
-          
-         /* {
-                 DISPLAY_PHYSICAL_X_CHARS_A,
-                 20 ,
-                 0, 
-                 0,
-                 DISPLAY_textsize_x_A,
-                 DISPLAY_textsize_y_A
-          }
-          */
-         //DISPLAY_PHYSICAL_CHAR_T 
-        DISPLAY_PHYSICAL_CHAR_T   DISPLAY_PHYSICAL_CHAR_A =   { 
-                 DISPLAY_PHYSICAL_X_PX_A ,
-                 DISPLAY_PHYSICAL_Y_PX_A ,
-                 DISPLAY_PHYSICAL_X_CHARS_A,
-                 DISPLAY_PHYSICAL_Y_CHARS_A ,
-                 DISPLAY_CURSOR_X_CHARS_A,
-                 DISPLAY_CURSOR_Y_CHARS_A,
-                 DISPLAY_textsize_x_A,
-                 DISPLAY_textsize_y_A }
-          ;
-      

+ 0 - 18
SE/stuff/P5_Automation_can-dev-res/__PORTS/_PortStates_struct.h

@@ -1,18 +0,0 @@
-
-typedef  byte Exp_state_T ;
-
- const  Exp_state_T Exp_state_UNSET        =  B00000000 ; 
- const  Exp_state_T Exp_state_OFF          =  B00000001 ; 
- const  Exp_state_T Exp_state_ON           =  B00000010 ;
- const  Exp_state_T Exp_state_ON_USE_LEVEL =  B00000100 ; // use Exp_state_level 0-255
- const  Exp_state_T Exp_state_BLINK        =  B00001000 ;
- const  Exp_state_T Exp_state_SET_REQ_SEND =  B00100000 ; //when was initialized and set output
- const  Exp_state_T Exp_state_SET          =  B01000000 ; //when was initialized and set output
- const  Exp_state_T Exp_state_ERROR        =  B10000000 ;
- 
- //const  Exp_state_T Exp_state_TOGGLE     =  B10000000 ;
-
-
- //const    Exp_state_OFF  0x01
- //#define    Exp_state_ON  0x02
-

+ 0 - 20
SE/stuff/P5_Automation_can-dev-res/__PORTS/_PortTypes_struct.h

@@ -1,20 +0,0 @@
-//USED IN _Slave_Ports_Status_struct.h
-
-typedef  byte PortTypes_T ;
- const  PortTypes_T PortTypes_NOT_SET       =  B00000000 ;
- const  PortTypes_T PortTypes_PWM           =  B00000001 ; 
- const  PortTypes_T PortTypes_I2C           =  B00000010 ; // 0x02
- const  PortTypes_T PortTypes_EXP           =  B00000100 ; // 0x03
- const  PortTypes_T PortTypes_SERVO         =  B00001000 ; // 0x03
- const  PortTypes_T PortTypes_SERVO_360     =  B00010000 ; // 0x03
-
-
- const  PortTypes_T PortTypes_P2M_EXP_I2C =  PortTypes_PWM | PortTypes_I2C | PortTypes_EXP  ; //0x07 ; //TODO BITTEST
- const  PortTypes_T PortTypes_PWM_EXP_I2C =  PortTypes_PWM | PortTypes_I2C | PortTypes_EXP  ; //0x07 ; //TODO BITTEST
-
-
-
-
-typedef int PortTypes_PWM_FREQ ;
-
-const PortTypes_PWM_FREQ PortTypes_PWM_FREQ_DEFAULT = 50 ; 

+ 0 - 12
SE/stuff/P5_Automation_can-dev-res/__PORTS/_Port_Broadcast_state_struct.h

@@ -1,12 +0,0 @@
-
-typedef int Broadcast_state_T ; 
-
-const Broadcast_state_T  Broadcast_state_TO_REFRESH = 1; //0x01 ;
-
-
-const Broadcast_state_T  Broadcast_state_FRESH = 30 ;// 0x30 ;
-
-const Broadcast_state_T  Broadcast_state_LOW = 3 ;// 0x30 ;
-
-const Broadcast_state_T  Broadcast_state_FULL_FRESH = 150; //0xFF ;
-

+ 0 - 7
SE/stuff/P5_Automation_can-dev-res/__PORTS/_Port_Exp_state_ttl_struct.h

@@ -1,7 +0,0 @@
-
-typedef int Exp_state_ttl_T ; 
-
-const Exp_state_ttl_T  Exp_state_ttl_TO_REFRESH = 1 ; //0x01 ;
-const Exp_state_ttl_T  Exp_state_ttl_FRESH = 30 ;//0x30 ;
-const Exp_state_ttl_T  Exp_state_ttl_FULL_FRESH = 254 ;
-const Exp_state_ttl_T  Exp_state_ttl_IS_ACTIVE = 200; // 0xFF ; //will countdown

+ 0 - 6
SE/stuff/P5_Automation_can-dev-res/__PORTS/_Port_I2C_driver_struct.h

@@ -1,6 +0,0 @@
-
-typedef int I2C_driver_T ; 
-
-const I2C_driver_T  EI2C_driver_NOT_USED_ = 0x00 ;
-const I2C_driver_T  I2C_driver_Adafruit_PWMServoDriver = 0x01 ;
-

+ 0 - 1
SE/stuff/P5_Automation_can-dev-res/__PORTS/_Port_ID_sruct.h

@@ -1 +0,0 @@
-typedef int Port_ID_T ; 

+ 0 - 99
SE/stuff/P5_Automation_can-dev-res/__PORTS/_Slave_Ports_Status_struct.h

@@ -1,99 +0,0 @@
-
-
-//#ifndef Slave_Ports_Status_S_h
-//#define Slave_Ports_Status_S_h
-
-
-
-typedef boolean IS_Local_T ;
-const IS_Local_T IS_Local_FALSE = false ;
-const IS_Local_T IS_Local_TRUE = true ;
-
-typedef boolean IS_gone_T ;
-const IS_gone_T IS_gone_TRUE = true ; 
-const IS_gone_T IS_gone_FALSE = false ; 
-
-#define I2C_port_DEFAULT 0x01
-
-
-typedef byte Exp_state_level_T ;
-
- struct Slave_Ports_Status_S {
-  Port_ID_T  Port_ID ; //global id for device //const char * const _Protocol;
-  int  _Slave_ID; //Device which orginated port   //remote id - use FF for broadcast
-  PortTypes_T  PortTypes;  //0xFF  =  1111 1111 s
-                                          /*
-                                          {
-                                      bit 1 - PWM port
-                                      bit 2 - on I2C managed port
-                                      bit 3 - expanded port with LocalPort address
-                                      bit 4 - not allocated
-                                      bit 2 - not allocated
-                                      bit 5 - not allocated
-                                      bit 6 - not allocated
-                                      bit 7 - not allocated
-                                      bit 8 - not allocated
-                                    } 
-                                           */
- // byte has_Address;
-  int  Address ;
- // byte has_Local_Port;
-  int  LocalPort;
-  Exp_state_T  Exp_state;                  /*0xFF  =  1111 1111
-                                    0x00  =  0000 0001  = OFF = 0V
-                                    0x01  =  0000 0002  = 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
-                                    }*/
-  Exp_state_ttl_T  Exp_state_ttl;  // 0x01 = odswiezyc
-  Broadcast_state_T  Broadcast_state; //0x00 - not broadcast; 0x01
-  int I2C_port ; //0x01 - default port, 0x00 - not I2C connected
-  I2C_driver_T I2C_driver; //0x00 - not driver, 0x01 Adafruit_PWMServoDriver.h
-  IS_Local_T IS_Local_A; // Define if port is local or remote added
-  IS_gone_T IS_gone_A; // Define port is gone timoiuted
-  Exp_state_level_T Exp_state_level_A ;
-} ;
-
-typedef struct Slave_Ports_Status_S Slave_Ports_Status_T;
-
-typedef struct ARDUINO_ATTR_ARRAY_S Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T;
-
-
-typedef struct ARDUINO_ARRAY_INDEX_TABLE_S         Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_T ; //DEFAULT INDEX TABLE
-typedef struct ARDUINO_ARRAY_INDEX_T_TO_DELETE_S   Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T;
-typedef struct ARDUINO_ARRAY_ASSOC_TABLE_S         Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_T ;//ASSOC FIELD Port_ID TO INDEX OF ARRAY
-typedef struct ARDUINO_ARRAY_ASSOC_TABLE_S         Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Ports_I2C_T ; //to associate exact ports to i2c
-
-
-//void ARDUINO_ARRAY_INDEX_TABLE_INIT(
-    Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_T             Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A[ARDUINO_ARRAY_INDEX_LIMIT_PORTS]        = {};
-    Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T       Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A[ARDUINO_ARRAY_INDEX_T_TO_DELETE_S_LIMIT]  = {};  
-    Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_T   Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A[ARDUINO_ARRAY_INDEX_LIMIT_PORTS] = {};
-    Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Ports_I2C_T Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Ports_I2C_A[ARDUINO_ARRAY_INDEX_LIMIT_PORTS] = {}; //todo port assoc type todo
-//);
-
-
-static    Slave_Ports_Status_T  Slave_Ports_Status_A[ARDUINO_ARRAY_INDEX_LIMIT_PORTS] = {};
-    
- static   Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T  Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A =  //[ARDUINO_ATTR_ARRAY_S_INDEX] 
-        {    ARDUINO_ARRAY_INDEX_CURRENT_INIT ,
-             ARDUINO_ARRAY_INDEX_LAST_INIT ,
-             ARDUINO_ARRAY_COUNT_T_INIT ,
-             ARDUINO_ARRAY_INDEX_LIMIT_PORTS , 
-             ARDUINO_ARRAY_INDEX_NEXT_INIT,
-             ARDUINO_ARRAY_time_min_run_MIN_INIT,
-             ARDUINO_ARRAY_INDEX_time_min_run_MIN_INIT  
-              }
-    ;
-    
-    
-    int * _TEST_GLOBAL = 10; 
-    

+ 0 - 33
SE/stuff/P5_Automation_can-dev-res/__PORTS/_TASK_TYPES_struct.h

@@ -1,33 +0,0 @@
-
-typedef int TASK_TYPE_T ;
-
-
-const TASK_TYPE_T TASK_TYPE_T_NOT_USED_________________ = 0x00 ;
-const TASK_TYPE_T TASK_TYPE_T_Slave_Ports_ttl_decrement = 0x01 ;
-const TASK_TYPE_T TASK_TYPE_T_request_confirm_Exp_state = 0x02 ;
-const TASK_TYPE_T TASK_TYPE_T_request_set_new_Exp_state = 0x03 ;
-const TASK_TYPE_T TASK_TYPE_T_Slave_Ports_broadcast____ = 0x04 ;
-const TASK_TYPE_T TASK_TYPE_T_Slave_Ports_set_I2C______ = 0x05 ;
-const TASK_TYPE_T TASK_TYPE_T_DISPLAY_queue_pop________ = 0x06 ;
-const TASK_TYPE_T TASK_TYPE_T__EMPTY__JUST_PASSED_ARG__ = 0x07 ;
-const TASK_TYPE_T TASK_TYPE_T_Exp_state_BLINK_TOGGLE___ = 0x08 ;
-
-const TASK_TYPE_T TASK_TYPE_T_Exp_state_OFF____________ = 0x09 ;
-const TASK_TYPE_T TASK_TYPE_T_Exp_state_ON_____________ = 0x10 ;
-const TASK_TYPE_T TASK_TYPE_T_Broadcast_state_LOW______ = 0x11 ;
-
-//const TASK_TYPE_T TASK_TYPE_T_Debug_Queue_Functions____ = 0x09 ;
-
-
-
-
-struct TASK_PORT_ASSOC_S {
-    Port_ID_T  Port_ID;
-    int  _Slave_ID;
-    ARDUINO_ARRAY_ATTR_T Slave_Ports_Status_T_INDEX; //optional index
-} ; //To associate some port to TASK
-
-typedef struct TASK_PORT_ASSOC_S TASK_PORT_ASSOC_T ;
-
-const TASK_PORT_ASSOC_T TASK_PORT_ASSOC_EMPTY = {};
-

+ 0 - 123
SE/stuff/P5_Automation_can-dev-res/__QUEUE/_Slave_Ports_Status_QUEUE_add_func.h

@@ -1,123 +0,0 @@
-
-
-//TODO HOW TO USE
-//time_seq_id   - to detect event of duplicated or flood kind of sth... to eventually not add next 
-//time_min_run  - to protect - that no more of this kind of task should be before time_min_run 
-
-ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_queue__add( Slave_Ports_Status_QUEUE_T* Slave_Ports_Status_QUEUE_A, 
-     Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A,
-    TASK_TYPE_T TASK_TYPE_A,
-    TASK_PORT_ASSOC_T TASK_PORT_ASSOC_A, //
-    time_seq_id_T time_seq_id, 
-    time_min_run_T time_min_run , //, 
-    ARDUINO_ARRAY_INDEX_T DISPLAY_ARDUINO_ARRAY_INDEX_A //optionally
-    //int _Slave_Ports_queue_peek , int _Slave_Ports_queue_push , int _Slave_Ports_queue_peek_new
-    ) {
-    
-    #if defined(DEBUG_QUEUE)
-      Serial.println(".");
-          Serial.print("#152 _Slave_Ports_queue__add  TASK_TYPE_A[");
-           Serial.print(TASK_TYPE_A); Serial.print(" [");  _Slave_Ports_queue_task_type_DESC(TASK_TYPE_A); Serial.print("] ");
-    #endif
-           
-      
-      
-  
-        
-     //  int _Slave_Ports_queue_peek = _Slave_Ports_queue.peek() ;
-     //  int _Slave_Ports_queue_back = _Slave_Ports_queue.back() ;
-     //  int _Slave_Ports_queue_push_new_ref;
-      // if(_Slave_Ports_queue_back > _Slave_Ports_queue_peek)
-     
-      
-      
-         
-      #if  defined(DEBUG_QUEUE)
-            Serial.println("[#22] [DEBUG_QUEUE]  RDUINO_ATTR_ARRAY_S__display[ ");  
-            ARDUINO_ATTR_ARRAY_S__display(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A) ;
-           // Serial.print("]  [OLD_QUEUE]   cur peek[");
-            //Serial.print(_Slave_Ports_queue_peek);  Serial.print("] cur back[");  Serial.print(_Slave_Ports_queue_back); 
-            
-            
-            Sprintln(F("]    new push["));
-            #if defined(DEBUG_QUEUE_WAIT)
-                Serial.print("  [delay][");Serial.print(DEBUG_QUEUE_WAIT); Serial.print("]  ");    
-                delay(DEBUG_QUEUE_WAIT);
-            #endif
-      #endif
-      
-      
-      
-      
-      //CONTROLLING ARR SIZE
-      //ARDUINO_ARRAY_INDEX_CURRENT_T Slave_Ports_Status_QUEUE_T_INDEX_CURRENT_A =  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;
-      
-     //ARDUINO_ARRAY_INDEX_NEXT_T Slave_Ports_Status_QUEUE_NEXT_A;
-      //ARDUINO_ARRAY_INDEX_NEXT_T Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A=ARDUINO_ARRAY_INDEX_NEXT_LOCK(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A,Slave_Ports_ATTR_QUEUE_A) ; //TODOARDUINO_ARRAY_INDEX_CURRENT_T Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A =  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A ;
-       //first index next
-       #if defined(DEBUG_STORAGE_QUEUE_TEST)
-        Serial.println(""); ARDUINO_ATTR_ARRAY_S__display(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A);
-       #endif
-       
-       
-       //DETECT_LATENCY
-       //time_seq_id   - to detect event of duplicated or flood kind of sth... to eventually not add next 
-       //time_min_run  - to protect - that no more of this kind of task should be before time_min_run 
-            //test if previous time_min_run of same task type isnt > time_seq_id
-       
-       
-       
-       
-       ARDUINO_ARRAY_INDEX_NEXT_T Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A = ARDUINO_ARRAY_INDEX_NEXT_LOCK(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A);
-      // ARDUINO_ARRAY_ATTR_QUEUE_T Slave_Ports_ATTR_QUEUE_A = ARDUINO_ARRAY_ATTR_QUEUE(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A);
-      
-       #if defined(DEBUG_STORAGE_QUEUE_TEST)
-            Serial.print(" 54[DEBUG_STORAGE_QUEUE_TEST][ADD] ");
-            if(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__LOCK ) Serial.print(" [ERROR] [SHOULD][ARDUINO_ARRAY_ATTR_INDEX__LOCK] ");
-            ARDUINO_ATTR_ARRAY_S__display(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A);
-            Serial.print("  ARDUINO_ARRAY_INDEX_NEXT_LOCK_A["); Serial.print(Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A);Serial.print("]  "); 
-          
-              Serial.println("EOF 54[DEBUG_STORAGE_QUEUE_TEST][ADD] ");Serial.println("]");
-            
-    #endif
-      
-      
-      
-      if(Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A <= 0) { //ARDUINO_ARRAY_INDEX_LIMIT_QUEUE
-      Serial.println("] "); Serial.print("[#41] [ERROR] [DEBUG_QUEUE] [INDEX_NEXT_A ==0??] = [");
-        Serial.print(Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A) ; Serial.print("]  ");   
-        Serial.print("TASK_TYPE_A["); Serial.print(TASK_TYPE_A); Serial.print("]");    
-        //ARDUINO_ATTR_ARRAY_S__INDEX_NEXT_rotate(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A,
-        //ARDUINO_QUEUE_FLAG_CANNOT_OVERWRITE , millis() ) ;
-      } else {
-      
-            #if defined(DEBUG_QUEUE)      
-                 Serial.print("]#810A   [USING] [INDEX_NEXT_A]=[LOCK["); 
-                 
-                  //Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A =  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A ;
-                         Serial.print( Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A);   Serial.print("]  [");
-                         Serial.print("   [Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A[");Serial.print(Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A);Serial.print("]]   ");
-            #endif
-                  Slave_Ports_Status_QUEUE_A[Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A].QUEUE_ID_A = Slave_Ports_Status_QUEUE_STATIC_ID_COUNTER_T() ; //Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A ; //todo should be counter //_Slave_Ports_queue_back + 1 ;
-                  Slave_Ports_Status_QUEUE_A[Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A].TASK_TYPE_A = TASK_TYPE_A ;
-                  Slave_Ports_Status_QUEUE_A[Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A].TASK_PORT_ASSOC_A=TASK_PORT_ASSOC_A ;
-                  Slave_Ports_Status_QUEUE_A[Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A].time_seq_id=time_seq_id ;
-                  Slave_Ports_Status_QUEUE_A[Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A].time_min_run=time_min_run ;
-                  
-                   Slave_Ports_Status_QUEUE_A[Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A].DISPLAY_ARDUINO_ARRAY_INDEX_A = DISPLAY_ARDUINO_ARRAY_INDEX_A ;
-                   //ARDUINO_ATTR_ARRAY_S__commit_added_element(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A, Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A ) ;
-               ARDUINO_FUNCT_INIT_RESULT_T   ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE_A = ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A, Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A,
-                   //ARDUINO_QUEUE_FLAG_QUEUE,
-                   ARDUINO_QUEUE_ELEMENT_FLAG_STANDARD  ) ;
-                   #if defined(DEBUG_QUEUE)
-                        Serial.print(" after [COMMIT] new QUEUE_ID_A["); Serial.print(Slave_Ports_Status_QUEUE_A[Slave_Ports_Status_QUEUE_T_INDEX_NEXT_A].QUEUE_ID_A ); Serial.print("]    ");
-                         Serial.print(" COMIT[RES]["); Serial.print(ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE_A); Serial.print("] ");
-                        Serial.print(" NEXT["); Serial.print(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A ); Serial.print("] ");
-                        Serial.print(" PEEK["); Serial.print(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A ); Serial.print("] ");
-                        Serial.print(" COUNT["); Serial.print(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A ); Serial.println("] ");
-                     #endif
-              return true ;
-      }
-    
-}
-

+ 0 - 430
SE/stuff/P5_Automation_can-dev-res/__QUEUE/_Slave_Ports_Status_QUEUE_func.h

@@ -1,430 +0,0 @@
-
-  
-
-void _Slave_Ports_queue__INIT( Slave_Ports_Status_QUEUE_T* Slave_Ports_Status_QUEUE_A, 
-    Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A
-    ) {
-                #if defined(DEBUG_STRUCT_INIT) || defined(DEBUG_QUEUE)
-                  Serial.print("#7AA _Slave_Ports_queue__INIT [FLAG][");
-                                Serial.print(ARDUINO_QUEUE_FLAG_QUEUE,BIN);Serial.print("] + [ ");
-                                Serial.print(ARDUINO_QUEUE_FLAG_CANNOT_OVERWRITE, BIN);Serial.print("] +  [ ");Serial.print(ARDUINO_QUEUE_FLAG_QUEUE | ARDUINO_QUEUE_FLAG_CANNOT_OVERWRITE, BIN); Serial.println("]   ");
-                #endif
-  ARDUINO_ATTR_ARRAY_S__init(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A, 
-  ARDUINO_ARRAY_INDEX_LIMIT_QUEUE,
-   ARDUINO_QUEUE_FLAG_QUEUE | ARDUINO_QUEUE_FLAG_CANNOT_OVERWRITE);
-  
-   //INIT 2015
-  ARDUINO_ARRAY_INDEX_CURRENT_T i =  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;
-   if(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A == ARDUINO_ARRAY_INDEX_CORRUPT) {
-        Slave_Ports_Status_QUEUE_A[i].QUEUE_ID_A = 0;
-        Slave_Ports_Status_QUEUE_A[i].TASK_TYPE_A = TASK_TYPE_T_NOT_USED_________________;
-        Slave_Ports_Status_QUEUE_A[i].TASK_PORT_ASSOC_A = {} ;
-        Slave_Ports_Status_QUEUE_A[i].time_seq_id = 0;
-        Slave_Ports_Status_QUEUE_A[i].time_min_run = 0;
-        
-        
-            ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A , i, //current index,
-                         //ARDUINO_QUEUE_FLAG_QUEUE , 
-                         ARDUINO_QUEUE_ELEMENT_FLAG_INITIAL_CORRUPT
-                         );
-        
-      //  ARDUINO_ATTR_ARRAY_S__commit_added_element(
-        //                  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A , 
-          //               i);
-        //#ifdef DEBUG_QUEUE
-        #if defined(DEBUG_STRUCT_INIT) || defined(DEBUG_QUEUE)
-             Serial.println("[#22] _Slave_Ports_queue__INIT  [OK] ");
-        #endif
-   }
-   
-                
-   
-}
-
-
-
-
-//Queue<_Slave_Ports_queueT> _Slave_Ports_queue = Queue<_Slave_Ports_queueT>(5);
-void _Slave_Ports_queue__list( Slave_Ports_Status_QUEUE_T* Slave_Ports_Status_QUEUE_A,
-    Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A
-    ) {
-      int i;
-      #if defined(DEBUG_QUEUE)
-        Serial.println("#100[QUEUE][LIST]");
-       #endif
-    
-   // #if defined(DEBUG) || defined(DEBUG_QUEUE)
-        ARDUINO_ATTR_ARRAY_S__display(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A);
-   // #endif
-    //Serial.println(sizeof(Slave_Ports_Status_QUEUE_A));
-        for(i=Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A;i>=(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A+Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A) ;i--) { //sizeof(_LCD_print_buffors)
-
-          if(Slave_Ports_Status_QUEUE_A[i].QUEUE_ID_A == 0 and
-                 Slave_Ports_Status_QUEUE_A[i].TASK_TYPE_A == 0 and
-                // Slave_Ports_Status_QUEUE_A[i].TASK_PORT_ASSOC_A == {} and 
-                 Slave_Ports_Status_QUEUE_A[i].time_seq_id == 0 and 
-                 Slave_Ports_Status_QUEUE_A[i].time_min_run == 0 ) {
-            
-          } else {
-          
-          #if  defined(DEBUG_QUEUE)
-                Serial.print(" $i[");
-                Serial.print(i);
-
-                 Serial.print("] QUEUE_ID_A: [");
-                Serial.print(Slave_Ports_Status_QUEUE_A[i].QUEUE_ID_A);
-                 Serial.print("] TASK_TYPE_A: [");
-                                 Serial.print(Slave_Ports_Status_QUEUE_A[i].TASK_TYPE_A);
-                  Serial.print("] desc: [");
-                 //Slave_Ports_queue_task_type_DESC(Slave_Ports_Status_QUEUE_A[i].TASK_TYPE_A);
-                 //char res;
-                 // res = _Slave_Ports_queue_task_type_DESC(Slave_Ports_Status_QUEUE_A[i]._Slave_Ports_queue_task_type);  Serial.print(res);
-                  
-                //  Serial.print(" - map[");  Serial.print(_Slave_Ports_queue_task_type_LIST[Slave_Ports_Status_QUEUE_A[i].TASK_TYPE_A]);  Serial.print("]");
-             #endif 
-               _Slave_Ports_queue_task_type_DESC(Slave_Ports_Status_QUEUE_A[i].TASK_TYPE_A) ; //(res); //_Slave_Ports_queue_task_type_DESC(Slave_Ports_Status_QUEUE_A[i]._Slave_Ports_queue_task_type
-
-              #if  defined(DEBUG_QUEUE)
-                 Serial.print("] TASK_PORT_ASSOC_A:[");
-                Serial.print(Slave_Ports_Status_QUEUE_A[i].TASK_PORT_ASSOC_A.Port_ID);
-                     
-                     
-                    Serial.print("] time_seq_id: ");
-                Serial.print(Slave_Ports_Status_QUEUE_A[i].time_seq_id);
-
-                     Serial.print("] time_min_run: ");
-                Serial.println(Slave_Ports_Status_QUEUE_A[i].time_min_run);
-                #endif
-                }
-  
-        }
-}
-
-
-
-
-
- void _Slave_Ports_queue__POP(
-         Slave_Ports_Status_QUEUE_T* Slave_Ports_Status_QUEUE_A, 
-        Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-       /* int _Slave_Ports_queue_count, 
-        int _Slave_Ports_queue_pop, 
-        int Slave_Ports_ATTR_QUEUE_FRONT_A, 
-        int Slave_Ports_ATTR_QUEUE_BACK_A,
-        int Slave_Ports_ATTR_QUEUE_PEEK_A,*/
-        int LCDtim,   
-    Slave_Ports_Status_T* Slave_Ports_Status_A ,
-     Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
-     Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_T*            Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
-     Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T*      Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
-     Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_T*  Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A
-     ,
-      DISPLAY_T*  DISPLAY_A , 
-      DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A,
-      DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A,
-     Adafruit_PWMServoDriver_T* Adafruit_PWMServoDriver_A, long time
- ) {
- 
- #if defined(DEBUG_QUEUE_ASSERT)
- 
-       /* Serial.println("#5[DEB][F][Q][POP]");
-        Serial.print(" COUNT[");Serial.print(Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_COUNT_A);Serial.print("] ");
-        Serial.print(" LIMIT[");Serial.print(Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_INDEX_LIMIT_A);Serial.print("] ");
-        Serial.print(" NEXT[");Serial.print(Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_INDEX_NEXT_A);Serial.print("] ");
-        Serial.print(" QUEUE#[");Serial.print(ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A);Serial.print("] ");
-        Serial.print(" QPEEK[");Serial.print(ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A);Serial.print("] ");
-        */
-      int  DEBUG_QUEUE_ASSERT_BEF_POP_COUNT_A = Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_COUNT_A ;
-      int  DEBUG_QUEUE_ASSERT_BEF_POP_INDEX_LIMIT_A = Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_INDEX_LIMIT_A ;
-      int  DEBUG_QUEUE_ASSERT_BEF_POP_INDEX_NEXT_A = Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_INDEX_NEXT_A ;
-      int  DEBUG_QUEUE_ASSERT_BEF_POP_QUEUE_COUNT_A = Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A ;
-      int  DEBUG_QUEUE_ASSERT_BEF_POP_COUNT_A = Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_COUNT_A ;
-      int  DEBUG_QUEUE_ASSERT_BEF_POP_QUEUE_PEEK_A = Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A ;
-        
-#endif
- 
-      
-  ARDUINO_ARRAY_INDEX_NEXT_LOCK_T ARDUINO_ARRAY_INDEX_POP_LOCK_A = ARDUINO_ARRAY_INDEX_POP_LOCK(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A);
-
-
-
- #if defined(DEBUG_QUEUE_ASSERT)
- 
-      int  DEBUG_QUEUE_ASSERT_AFT_POP_COUNT_A = Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_COUNT_A ;
-     int   DEBUG_QUEUE_ASSERT_AFT_POP_INDEX_LIMIT_A = Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_INDEX_LIMIT_A ;
-     int   DEBUG_QUEUE_ASSERT_AFT_POP_INDEX_NEXT_A = Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_INDEX_NEXT_A ;
-     int   DEBUG_QUEUE_ASSERT_AFT_POP_QUEUE_COUNT_A = Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A ;
-     ARDUINO_ARRAY_COUNT_T   DEBUG_QUEUE_ASSERT_AFT_POP_COUNT_A = Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_COUNT_A ;
-     int   DEBUG_QUEUE_ASSERT_AFT_POP_QUEUE_PEEK_A = Slave_Ports_Status_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A ;
-        
-         if(DEBUG_QUEUE_ASSERT_BEF_POP_QUEUE_COUNT_A > 0 and (DEBUG_QUEUE_ASSERT_BEF_POP_COUNT_A != DEBUG_QUEUE_ASSERT_BEF_POP_QUEUE_COUNT_A)) { 
-                Serial.println("#162[DEBUG_QUEUE_ASSERT][ERR] [BEF_POP_COUNT_A["); Serial.print(DEBUG_QUEUE_ASSERT_BEF_POP_COUNT_A); Serial.print("]]!=[BEF_POP_QUEUE_COUNT_A["); Serial.print(DEBUG_QUEUE_ASSERT_AFT_BEF_QUEUE_COUNT_A); Serial.primt("]]");
-                Delay(1000);
-        }
-        
-        
-        if(DEBUG_QUEUE_ASSERT_AFT_POP_QUEUE_COUNT_A > 0 and (DEBUG_QUEUE_ASSERT_BEF_POP_COUNT_A != DEBUG_QUEUE_ASSERT_BEF_POP_QUEUE_COUNT_A)) { 
-                Serial.println("#162[DEBUG_QUEUE_ASSERT][ERR] [AFT_POP_COUNT_A["); Serial.print(DEBUG_QUEUE_ASSERT_AFT_POP_COUNT_A); Serial.print("]]!=[AFT_POP_QUEUE_COUNT_A["); Serial.print(DEBUG_QUEUE_ASSERT_AFT_POP_QUEUE_COUNT_A); Serial.primt("]]");
-                Delay(1000);
-        }
-        
-        
-        
-        if(DEBUG_QUEUE_ASSERT_BEF_POP_QUEUE_COUNT_A > 1 and ( DEBUG_QUEUE_ASSERT_AFT_POP_QUEUE_COUNT_A != (DEBUG_QUEUE_ASSERT_BEF_POP_QUEUE_COUNT_A - 1))) { 
-                Serial.println("#174[DEBUG_QUEUE_ASSERT][ERR] [AFT_POP_QUEUE_COUNT_A["); Serial.print(DEBUG_QUEUE_ASSERT_AFT_POP_COUNT_A); Serial.print("]]!=[BEF_POP_QUEUE_COUNT_A -1["); Serial.print(DEBUG_QUEUE_ASSERT_BEF_POP_QUEUE_COUNT_A); Serial.primt("]]");
-                Delay(1000);
-        }
-        
-        
-        if(DEBUG_QUEUE_ASSERT_BEF_POP_QUEUE_COUNT_A > 1 and ( DEBUG_QUEUE_ASSERT_AFT_POP_QUEUE_PEEK_A != (DEBUG_QUEUE_ASSERT_BEF_POP_QUEUE_PEEK_A + 1))) { 
-                Serial.println("#180[DEBUG_QUEUE_ASSERT][ERR] [AFT_POP_QUEUE_PEEK_A["); Serial.print(DEBUG_QUEUE_ASSERT_AFT_POP_QUEUE_PEEK_A); Serial.print("]]!=[BEF_POP_QUEUE_PEEK_A + 1["); Serial.print(DEBUG_QUEUE_ASSERT_BEF_POP_QUEUE_PEEK_A); Serial.primt("]]");
-                Delay(1000);
-        }
-        
-        
-        
-        
-#endif
- 
-
-
-
- // ARDUINO_ARRAY_ATTR_QUEUE_T Slave_Ports_ATTR_QUEUE_A = ARDUINO_ARRAY_ATTR_QUEUE(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A) ;//ARDUINO_ARRAY_INDEX_CURRENT_T Slave_Ports_ATTR_QUEUE_PEEK_A ;// = Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;
-    #if  defined(DEBUG_QUEUE)
-        Serial.println("136 after ARDUINO_ARRAY_INDEX_POP_LOCK"); ARDUINO_ATTR_ARRAY_S__display(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A);
-        Serial.print(" [POP_LOCK][");Serial.print(ARDUINO_ARRAY_INDEX_POP_LOCK_A); Serial.print("] ");
-        Serial.print(" COUNT_MAX["); Serial.print(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A); 
-       Serial.print("] COUNT_A["); Serial.print(Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A); Serial.print("] ");
-    #endif   
-                   _Slave_Ports_queue_task_type_DESC(Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A) ; 
-   
-   // if (_Slave_Ports_queue_count > 0) {
-   if(ARDUINO_ARRAY_INDEX_POP_LOCK_A > 0) {
-                        
-                if(Slave_Ports_Status_QUEUE_A[ ARDUINO_ARRAY_INDEX_POP_LOCK_A ].QUEUE_ID_A == 0 and
-                //Slave_Ports_Status_QUEUE_A[_Slave_Ports_queue_pop].QUEUE_ID_A == 0 and
-                //  Slave_Ports_Status_QUEUE_A[_Slave_Ports_queue_pop].TASK_TYPE_A == 0 and
-                    Slave_Ports_Status_QUEUE_A[  ARDUINO_ARRAY_INDEX_POP_LOCK_A ].TASK_TYPE_A == 0 and
-                    //Slave_Ports_Status_QUEUE_A[_Slave_Ports_queue_pop].TASK_PORT_ASSOC_A == 0 and 
-                    //  Slave_Ports_Status_QUEUE_A[_Slave_Ports_queue_pop].time_seq_id == 0 and 
-                    Slave_Ports_Status_QUEUE_A[ ARDUINO_ARRAY_INDEX_POP_LOCK_A ].time_seq_id == 0 and
-                    //    Slave_Ports_Status_QUEUE_A[_Slave_Ports_queue_pop].time_min_run == 0 ) {
-                    Slave_Ports_Status_QUEUE_A[ ARDUINO_ARRAY_INDEX_POP_LOCK_A ].time_min_run == 0 ) {
-        
-                  #if defined(DEBUG)  || defined(DEBUG_QUEUE)
-                    // if(DEBUG > 6) {
-                                   Serial.print("#166  [DEBUG]  Error with queue [INDEX_CURR]=["); Serial.print(ARDUINO_ARRAY_INDEX_POP_LOCK_A);
-                                   Serial.println("]  ");
-                             //      }
-                    #endif    
-              } else { //if all zeros
-        
-        
-                     if(Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].time_min_run > time) {
-                           #if defined(DEBUG_QUEUE)
-                            Serial.print("#182 QUEUE reassign .time_seq_id > millis()  time_seq_id[");     Serial.print( Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].time_seq_id); 
-                            Serial.print("]  millis()["); Serial.print(time);
-                            Serial.print("]  TASK_TYPE_A["); Serial.print(Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A);
-                            Serial.print("]  Will wait() to next ["); Serial.print(Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].time_seq_id);
-                            Serial.print("]  #["); Serial.print(ARDUINO_ARRAY_INDEX_POP_LOCK_A);  Serial.print("]  ID["); Serial.print(Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].QUEUE_ID_A);  Serial.println("]  ");
-                           #endif  
-                            _Slave_Ports_queue__add( Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A , 
-                                Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A,
-                                Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_PORT_ASSOC_A,
-                                Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].time_seq_id,
-                                Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].time_min_run,
-                                Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A
-                              );
-                              #if defined(DEBUG_QUEUE)
-                               Serial.print("[WILL DELETE REC]     millis()["); Serial.print(time);
-                              #endif
-                              Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A]={} ; //TODO delete by func 
-
-
-                        //TODO CALL STORAGE ROUND ROBIN
-            
-                     } else if(Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A == TASK_TYPE_T_Slave_Ports_ttl_decrement) {
-                            #if  defined(DEBUG_QUEUE)
-                                      Serial.print("#224 running _Slave_Ports_ttl_decrement = ");     Serial.println( Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A); Serial.println("]");     
-                            #endif                              
-                                      
-                                      _Slave_Ports_ttl_decrement_POP(Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A,  ARDUINO_ARRAY_INDEX_POP_LOCK_A ,  Slave_Ports_Status_A ) ;  
-                                    Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A]={} ;  
-                                      //TODO STORAGE
-                     } else if(Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A == TASK_TYPE_T_Slave_Ports_broadcast____) {
-                            #if  defined(DEBUG_QUEUE)
-                                      Serial.print("#337 running _Slave_Ports_broadcast = ");     Serial.println( Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A); Serial.println("]");
-                            #endif
-                                     // #include "_Slave_Ports_ttl_decrement.h"
-                                     _Slave_Ports_broadcast_POP(                                     
-                                                 Slave_Ports_Status_QUEUE_A, 
-                                                 Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                                                 Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A, 
-                                                 ARDUINO_ARRAY_INDEX_POP_LOCK_A, 
-                                                 Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A, 
-                                                 Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A,
-                                                 ARDUINO_ARRAY_INDEX_POP_LOCK_A,
-                                                 LCDtim,   
-                                              Slave_Ports_Status_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_T_TO_DELETE_A,
-                                              Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                                               DISPLAY_A , 
-                                               DISPLAY_T_ARDUINO_ATTR_ARRAY_A,
-                                               DISPLAY_PHYSICAL_CHAR_A,
-                                               time
-                                        
-                                     /*Slave_Ports_Status_QUEUE_A, 
-                                            _Slave_Ports_queue_pop ,  
-                                            Slave_Ports_Status_A, 
-                                            LCDtim ,
-                                            DISPLAY_A ,
-                                            DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                                            DISPLAY_PHYSICAL_CHAR_A
-                                            */
-                                            ) ;
-                                      Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A]={} ;    //todo storage
-                     } else if(Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A == TASK_TYPE_T_DISPLAY_queue_pop________ ) {
-                      #if  defined(DEBUG_QUEUE)
-                       Serial.print("#212 DISPLAY TASK_TYPE_A[");     Serial.print( Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A);
-                             Serial.println("] ");
-                     #endif   
-                        _Slave_Ports_queue_task_type_DESC(Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A) ;
-                     
-                            
-                               // #include "_DISPLAY_queue_pop_func.h"
-                                #if defined(DISABLE_TASK_TYPE_T_DISPLAY_queue_pop________)
-                                    #if defined(DEBUG_TASK_TYPE_T_DISPLAY_queue_pop________)
-                                        Serial.println("#250 [DISABLE_TASK_TYPE_T_DISPLAY_queue_pop________]");   
-                                        Serial.print(" DISPLAY_array16_A["); Serial.print(DISPLAY_A[Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A].DISPLAY_array16_A); Serial.print("] ");
-                                        Serial.print(" DISPLAY_pos_seq_A["); Serial.print(DISPLAY_A[Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A].DISPLAY_pos_seq_A, BIN); Serial.print("] ");
-                                        Serial.print(" DISPLAY_TARGET_A["); Serial.print(DISPLAY_A[Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A].DISPLAY_TARGET_A, BIN); Serial.print("] ");
-                                        Serial.print(" DISPLAY_ARDUINO_ARRAY_INDEX_A["); Serial.print(Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A); Serial.print("] ");
-                                    #endif
-                                    
-                                  Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A]={} ;   //todo storage
-                                  #if defined(DEBUG_TASK_TYPE_T_DISPLAY_queue_pop________)
-                                   Serial.print("#201 DELETED DISPLAY TASK_TYPE_A #[");     Serial.print( ARDUINO_ARRAY_INDEX_POP_LOCK_A);Serial.println("] ");
-                                  #endif 
-                                #else
-                                Serial.println("3047[Display Text:["); Serial.print(DISPLAY_A[Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A].DISPLAY_string_A);Serial.print("] ");
-                                    #if defined(DEBUG_TASK_TYPE_T_DISPLAY_queue_pop________)
-                                        Serial.print(" DISPLAY_array16_A["); Serial.print(DISPLAY_A[Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A].DISPLAY_array16_A); Serial.print("] ");
-                                        Serial.print("#201 DELETING DISPLAY TASK_TYPE_A #[");     Serial.print( ARDUINO_ARRAY_INDEX_POP_LOCK_A);Serial.println("] ");
-                                    #endif
-                                                    DISPLAY__print( DISPLAY_A ,
-                                                    DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                                                    DISPLAY_PHYSICAL_CHAR_A, 
-                                                    DISPLAY_A[Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A].DISPLAY_pos_seq_A,
-                                                    #if defined(DISPLAY_array16_T_is_DISPLAY_string_T)
-                                                        DISPLAY_A[Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A].DISPLAY_string_A ,
-                                                    #else
-                                                        DISPLAY_A[Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A].DISPLAY_array16_A,
-                                                    #endif
-                                                    DISPLAY_A[Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A].DISPLAY_TARGET_A,
-                                                    DISPLAY_A[Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A].time_seq_id_A,
-                                                    DISPLAY_A[Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A].time_min_run_A,
-                                                    //queue
-                                                    Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                                                    Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A,
-                                                    Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_PORT_ASSOC_A);
-                                                                           
-                                        Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A]={} ;   //todo storage
-                                  #endif    
-                                        
-                      } else if(Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A == TASK_TYPE_T_Slave_Ports_set_I2C______) {
-                                #if defined(DEBUG_TASK_TYPE_T_Slave_Ports_set_I2C______)
-                                      Serial.print("#221 running TASK_TYPE_T_Slave_Ports_set_I2C______ = ");     Serial.println( Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A); Serial.println("]");
-                                #endif
-                                      //#include "_Slave_Ports_ttl_decrement.h"
-                                      _Slave_Ports_I2C_POP(
-                                        //Slave_Ports_Status_QUEUE_A, _Slave_Ports_queue_pop ,  Slave_Ports_Status_A 
-                                         Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                                         ARDUINO_ARRAY_INDEX_POP_LOCK_A ,  
-                                         Slave_Ports_Status_A,
-                                          Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
-                                           //display
-                                             DISPLAY_A ,
-                                             DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                                             DISPLAY_PHYSICAL_CHAR_A, 
-                                                 DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE, //initial set
-                                                 "#233 Setting I2C" , //DISPLAY_array16_A,
-                                                  DISPLAY_TARGET_ANY , //DISPLAY_TARGET_A, - setting
-                                                  Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].time_seq_id, 
-                                                  Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].time_min_run,
-                                             //tasks
-                                               Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A,
-                                               Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_PORT_ASSOC_A,
-                                                Adafruit_PWMServoDriver_A
-                                        ) ;  
-                                         Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A]={} ;   //todo storage
-                                         
-                        
-                     } else if(Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A == TASK_TYPE_T_Broadcast_state_LOW______ ) {      
-                        #if defined(DEBUG_QUEUE)
-                            Serial.print(" [Q]BCAST>LOW ");
-                        #endif
-                        TASK_TYPE_T_Broadcast_state_LOW(Slave_Ports_Status_A, Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A);
-                                  
-                     } else {
-                        
-                             Serial.print("$177 Error unsupported type TASK_TYPE_A[");     Serial.print( Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A);
-                             _Slave_Ports_queue_task_type_DESC(Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A) ;
-                             Serial.println("] REASSIGN NEXT QUEUE FOR FURTHER ACTION");     
-                             _Slave_Ports_queue__add( Slave_Ports_Status_QUEUE_A,  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                                Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_TYPE_A,
-                                Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].TASK_PORT_ASSOC_A,
-                                time, 
-                                time+  ARDUINO_time_seq_id_A_INCREMENT ,
-                                Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A].DISPLAY_ARDUINO_ARRAY_INDEX_A
-                              );
-                              Slave_Ports_Status_QUEUE_A[ARDUINO_ARRAY_INDEX_POP_LOCK_A]={} ;  
-                              //TODO STORAGE
-                     }
-
-                    
-              }
-
-
-   
-  } else {
-    
-    /*
-    String LCDarray1 = "Nothing to";
-    String LCDarray2 = "process...";
-    //LCDarray2.reserve(16);
-    Serial.print(LCDarray1); 
-    Serial.println(LCDarray2); 
-*/
-   //  Serial.print("#32 String LCDarray2 len"); 
-    // int LCDarray2_length = LCDarray2.length;
-   /*  Serial.print(LCDarray2.length()); 
-     Serial.println("] now "); 
-     LCDarray2 = make_str16(LCDarray2);
-    Serial.print(LCDarray2.length()); 
-     Serial.println("]  next #338"); 
-
-      for(int i = 0; i < (17 - LCDarray2.length()); i++)
-        LCDarray2 += 'x';  
-       
-      Serial.print(LCDarray2.length()); 
-     Serial.println("]  "); 
- */
-    /* todo 
-    Serial.print(" #364 scount "); 
-     Serial.print(_Slave_Ports_queue_count); 
-     Serial.print(" _Slave_Ports_queue.front(): "); 
-     Serial.print(Slave_Ports_ATTR_QUEUE_FRONT_A); 
-     Serial.print(" _Slave_Ports_queue.back(): "); 
-     Serial.print(Slave_Ports_ATTR_QUEUE_BACK_A); 
-     Serial.print(" _Slave_Ports_queue.peek(): "); 
-     Serial.println(Slave_Ports_ATTR_QUEUE_PEEK_A); 
-     */
-//     LCD_print(LCDarray1, LCDarray2, LCDtim / 3 ) ;
-  }
- }
-
-
-
-

+ 0 - 120
SE/stuff/P5_Automation_can-dev-res/__QUEUE/_Slave_Ports_action_func.h

@@ -1,120 +0,0 @@
-
-#if defined(Slave_Ports_action_func_h)
-
-#else 
-
-#define Slave_Ports_action_func_h
-
-void Slave_Ports_action_func(
-Slave_Ports_Status_QUEUE_T* Slave_Ports_Status_QUEUE_A, 
-     Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A,
-    Slave_Ports_Status_T* Slave_Ports_Status_A ,
-    Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
-    TASK_TYPE_T TASK_TYPE_A,
-    //ARDUINO_ARRAY_ATTR_T Slave_Ports_Status_T_INDEX , //index of port we want to manipulate
-    TASK_PORT_ASSOC_T &TASK_PORT_ASSOC_A, //
-    long time_seq_id, 
-    long time_min_run , //, 
-    ARDUINO_ARRAY_INDEX_T DISPLAY_ARDUINO_ARRAY_INDEX_A , 
-    Exp_state_T Exp_state_A ,
-    Exp_state_level_T Exp_state_level_A 
-    )  {
-    int i;
-    int flag_sent_CAN = 0;
-    int flag_set_LOCAL = 0 ;
-    
-    if(TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX > 0 ) {
-        if(Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX].Port_ID > 0 ) {
-                Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX].Exp_state = Exp_state_A ; 
-                Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX].Exp_state_ttl = Exp_state_ttl_TO_REFRESH ;
-                Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX].Exp_state_level_A = Exp_state_level_A ;
-                if(Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX].IS_Local_A == IS_Local_TRUE) flag_set_LOCAL ++ ;
-                if(Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX].IS_Local_A == IS_Local_FALSE) flag_sent_CAN ++ ;
-                //_Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                //     TASK_TYPE_T_request_set_new_Exp_state  ,TASK_PORT_ASSOC_A ,time_seq_id, time_min_run  , ARDUINO_ARRAY_INDEX_NOT_SET ) ;    
-        }
-        
-    } else if((TASK_PORT_ASSOC_A.Port_ID > 0) and (TASK_PORT_ASSOC_A._Slave_ID >0)) {
-        for(i = ARDUINO_ARRAY_INDEX_FIRST ; i<= Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ; i++) {
-                if((Slave_Ports_Status_A[i].Port_ID == TASK_PORT_ASSOC_A.Port_ID) and (Slave_Ports_Status_A[i]._Slave_ID == TASK_PORT_ASSOC_A._Slave_ID)) {
-                      Slave_Ports_Status_A[i].Exp_state = Exp_state_A ; 
-                      Slave_Ports_Status_A[i].Exp_state_level_A = Exp_state_level_A ;
-                     Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_TO_REFRESH ;
-                     TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX = i ;
-                     if(Slave_Ports_Status_A[i].IS_Local_A == IS_Local_TRUE) flag_set_LOCAL ++ ;
-                      if(Slave_Ports_Status_A[i].IS_Local_A == IS_Local_FALSE) flag_sent_CAN ++ ;
-                   // _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                   //  TASK_TYPE_T_request_set_new_Exp_state  ,TASK_PORT_ASSOC_A ,time_seq_id, time_min_run  , ARDUINO_ARRAY_INDEX_NOT_SET ) ; 
-                }
-        }          
-    
-    } else {
-    
-      Serial.println("25[ACTION][ERR]");
-    }
-    
-    if(flag_sent_CAN > 0 ) {
-        Serial.println("51[ACTION][CAN][todo]");
-    
-    
-    
-                                 _Slave_Ports_Protocol_CAN_request_set_new_Exp_state_T CAN_request_set_new_Exp_state_T={};
-                                    CAN_request_set_new_Exp_state_T._CAN_REMOTE_ID = Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX]._Slave_ID;
-                                  //  CAN_broadcast_A._CAN_SENDER_ID = Active_ControllerID_HEX ;
-                                    CAN_request_set_new_Exp_state_T.Port_ID = Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX].Port_ID ;
-                                    CAN_request_set_new_Exp_state_T.PortTypes = Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX].PortTypes ; 
-                                    CAN_request_set_new_Exp_state_T.Exp_state = Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX].Exp_state ;
-                                    CAN_request_set_new_Exp_state_T.Exp_state_ttl = Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX].Exp_state_ttl ;
-                                    CAN_request_set_new_Exp_state_T.Exp_state_level_A = Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX].Exp_state_level_A ;
-                                   // CAN_broadcast_A._CAN_8 = TASK_TYPE_T_Slave_Ports_broadcast____ ;
-                       
-                         // CAN_broadcast_A._CAN_8 = _CAN_8_EMPTY ;
-                         
-    
-    
-                       byte CAN_MSG8_A_Slave_Ports_Protocol_CAN_request_set_new_Exp_state_A[8];
-                       CAN_MSG8_A_Slave_Ports_Protocol_CAN_request_set_new_Exp_state_T(CAN_request_set_new_Exp_state_T,CAN_MSG8_A_Slave_Ports_Protocol_CAN_request_set_new_Exp_state_A);
-                       CAN_data_debug(CAN_MSG8_A_Slave_Ports_Protocol_CAN_request_set_new_Exp_state_A);
-    
-    
-                    String message ; 
-                    byte sndStat = CAN0.sendMsgBuf(Active_ControllerID_HEX, 0, 8, CAN_MSG8_A_Slave_Ports_Protocol_CAN_request_set_new_Exp_state_A); 
-                    delay(200);
-                     if(sndStat == CAN_OK){
-                     
-                      Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX].Exp_state = Slave_Ports_Status_A[TASK_PORT_ASSOC_A.Slave_Ports_Status_T_INDEX].Exp_state |  Exp_state_SET_REQ_SEND ;
-                     message = "SND CAN REQ "; message.concat(Exp_state_level_A) ; message.concat(" ");
-                      DISPLAY__CURSOR_Y_CHARS__SET(DISPLAY_PHYSICAL_CHAR_A, DISPLAY_CURSOR_Y_CHARS_CAN_DEBUG);
-                       DISPLAY__print( DISPLAY_A ,DISPLAY_T_ARDUINO_ATTR_ARRAY_A ,  DISPLAY_PHYSICAL_CHAR_A,  DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE, //TODO BITTEST
-                          message, DISPLAY_TARGET_DISPLAY128, time_seq_id , time_min_run, Slave_Ports_Status_QUEUE_A,  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A , TASK_TYPE_T_request_set_new_Exp_state  , TASK_PORT_ASSOC_A); 
-                      } else {
-                      message = "ERR SND CAN REQ "; message.concat(Exp_state_level_A) ; message.concat(" ");
-                      DISPLAY__CURSOR_Y_CHARS__SET(DISPLAY_PHYSICAL_CHAR_A, DISPLAY_CURSOR_Y_CHARS_CAN_DEBUG);
-                       DISPLAY__print( DISPLAY_A ,DISPLAY_T_ARDUINO_ATTR_ARRAY_A ,  DISPLAY_PHYSICAL_CHAR_A,  DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE, //TODO BITTEST
-                          message, DISPLAY_TARGET_DISPLAY128, time_seq_id , time_min_run, Slave_Ports_Status_QUEUE_A,  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A , TASK_TYPE_T_request_set_new_Exp_state  , TASK_PORT_ASSOC_A);
-                      }
-                     
-    
-    
-    } else if(flag_set_LOCAL > 0 ) {
-        Serial.println("51[ACTION][LOCAL][ADD][TASK_TYPE_T_Slave_Ports_set_I2C______]");
-         _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                     TASK_TYPE_T_Slave_Ports_set_I2C______  ,TASK_PORT_ASSOC_A ,time_seq_id, time_min_run  , ARDUINO_ARRAY_INDEX_NOT_SET ) ; 
-    }
-           
-   
-    }
-
-#endif
-
-/*
-
-
-struct TASK_PORT_ASSOC_S {
-    Port_ID_T  Port_ID;
-} ; //To associate some port to TASK
-
-
- ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add = _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                     TASK_TYPE_T_Slave_Ports_set_I2C______  ,TASK_PORT_ASSOC_EMPTY ,time, time  , ARDUINO_ARRAY_INDEX_NOT_SET ) ;
-                     */

+ 0 - 397
SE/stuff/P5_Automation_can-dev-res/__QUEUE/_Slave_Ports_broadcast_func.h

@@ -1,397 +0,0 @@
-
-
-
-
-void TASK_TYPE_T_Broadcast_state_LOW(Slave_Ports_Status_T* Slave_Ports_Status_A, 
-        Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A
-        ) {
-           int i;
-                     for(i=ARDUINO_ARRAY_INDEX_FIRST;i<= Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;i++) { //Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A // ARDUINO_ARRAY_INDEX_LIMIT_PORTS
-                              if(Slave_Ports_Status_A[i].IS_Local_A == IS_Local_TRUE) {
-                                      if(Slave_Ports_Status_A[i].IS_gone_A == IS_gone_TRUE) {
-                                       } else {
-                                            if(Slave_Ports_Status_A[i].Broadcast_state > Broadcast_state_LOW ) {
-                                                        Slave_Ports_Status_A[i].Broadcast_state = Broadcast_state_LOW ;
-                                                        Serial.print(" #11[BCAST][SET][LOW][");Serial.print(i);Serial.print("] "); 
-                                            }
-                                                        
-                                           
-                                        }
-                              }
-                              
-                       }
-           
-        }
-
-
-
- void _Slave_Ports_broadcast_POP(
-         Slave_Ports_Status_QUEUE_T* Slave_Ports_Status_QUEUE_A, 
-        Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-        int _Slave_Ports_queue_count, 
-        int ARDUINO_ARRAY_INDEX_POP_LOCK_A, 
-        int _Slave_Ports_queue_front, 
-        int _Slave_Ports_queue_back,
-        int _Slave_Ports_queue_peek,
-        int LCDtim,   
-         Slave_Ports_Status_T* Slave_Ports_Status_A ,
-          Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
-          Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_T*            Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
-          Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T*      Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
-          Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_T*  Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-           DISPLAY_T*  DISPLAY_A , 
-           DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A,
-           DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A,
-           long time
- /*Slave_Ports_Status_QUEUE_T*  Slave_Ports_Status_QUEUE_A, 
- int ARDUINO_ARRAY_INDEX_POP_LOCK_A ,  
- Slave_Ports_Status_T*  Slave_Ports_Status_A, 
- int LCDtim , 
-   DISPLAY_T* DISPLAY_A ,
-   DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-   DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A
-   */
-  ) {
-        #if defined(DEBUG_TASK_TYPE_T_Slave_Ports_broadcast____)
-            Serial.print("#251 _Slave_Ports_broadcast_POP INDEX_CURRENT_A["); Serial.print(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A); Serial.println("] "); 
-            
-        #endif 
-          int i;
-          for(i=ARDUINO_ARRAY_INDEX_FIRST;i<= Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;i++) { //Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A // ARDUINO_ARRAY_INDEX_LIMIT_PORTS
-            if(Slave_Ports_Status_A[i].IS_Local_A == IS_Local_TRUE) {  
-            Serial.print(" Broadcast_state[");Serial.print(Slave_Ports_Status_A[i].Broadcast_state);Serial.print("] Broadcast_state_FRESH["); Serial.print(Broadcast_state_FRESH); Serial.print("] ");
-            
-            if(Slave_Ports_Status_A[i].Broadcast_state <= Broadcast_state_FRESH) {
-                    
-                    
-                    #if defined(DEBUG) || defined(DEBUG_CAN) ||  defined(DEBUG_TASK_TYPE_T_Slave_Ports_broadcast____)
-                        //if(DEBUG > 4) {
-                            Serial.print("#43 ind:"); Serial.print(i);  Serial.print("] IS_Local_A:");
-                            Serial.print(Slave_Ports_Status_A[i].IS_Local_A);
-                            Serial.print(" , ID:"); 
-                            Serial.print(Slave_Ports_Status_A[i].Port_ID, HEX); Serial.print(" , PortTypes:");
-                            Serial.print(Slave_Ports_Status_A[i].PortTypes, HEX); Serial.print(" , Addr:"); Serial.print(Slave_Ports_Status_A[i].Address, HEX);
-                            Serial.print(" , Local:"); Serial.print(Slave_Ports_Status_A[i].LocalPort);
-                            Serial.print(" , Exp state:"); Serial.print(Slave_Ports_Status_A[i].Exp_state);
-                            Serial.print(" , Exp_state_ttl"); Serial.println(Slave_Ports_Status_A[i].Exp_state_ttl);  
-                            //Serial.print("#2111 *_TEST_GLOBAL["); Serial.print(*_TEST_GLOBAL); Serial.println("] ");
-                           // Serial.print(" #2111B &_TEST_GLOBAL"); Serial.print(_TEST_GLOBAL); Serial.println("] ");
-                       //    }
-                    #endif
-                     
-                     
-                     
-                         
-                                    
-                                   #if defined(DISABLE_TASK_TYPE_T_DISPLAY_queue_pop________)
-                                     #else
-                                     #if defined(DISPLAY_array16_T_is_DISPLAY_string_T)
-                                     
-                                                 String message = "1CAN BCAST "; message.concat(i); message.concat(".");  message.concat( Slave_Ports_Status_A[i].Port_ID );  message.concat(" >>>");
-                                                // DISPLAY__CURSOR_Y_CHARS__SET(DISPLAY_PHYSICAL_CHAR_A, 
-                                                  //            DISPLAY_CURSOR_Y_CHARS_CAN_DEBUG);
-                                                         DISPLAY__print(
-                                                                 DISPLAY_A ,
-                                                                 DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                                                                 DISPLAY_PHYSICAL_CHAR_A, 
-                                                                  DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE, //TODO BITTEST
-                                                                  message , // DISPLAY_array16_I( "#53 BCAST  " + char( Slave_Ports_Status_A[i].Port_ID  ) , 2), //message,
-                                                                   DISPLAY_TARGET_DISPLAY128,
-                                                                  time , // time_seq_id_T time_seq_id_A;
-                                                                  time+ARDUINO_time_seq_id_A_INCREMENT, //time_min_run_T time_min_run_A;
-                                                                 //queue
-                                                                Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                                                                TASK_TYPE_T_Slave_Ports_broadcast____  ,  //TASK_TYPE_A,
-                                                                { Slave_Ports_Status_A[i].Port_ID } //TASK_PORT_ASSOC_A
-                                                                
-                                                                ); 
-                                        #else
-                                          String message = "1CAN BCAST "; message.concat(i); message.concat(".");  message.concat( Slave_Ports_Status_A[i].Port_ID );  message.concat(" >>>                        "); 
-                                               DISPLAY_array16_T  DISPLAY_array16_AA="" ;
-                                                   message.toCharArray(DISPLAY_array16_AA, 16);
-                                        
-                                             DISPLAY__CURSOR_Y_CHARS__SET(DISPLAY_PHYSICAL_CHAR_A, 
-                                                  DISPLAY_CURSOR_Y_CHARS_CAN_DEBUG);
-                                             DISPLAY__print(
-                                                     DISPLAY_A ,
-                                                     DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                                                     DISPLAY_PHYSICAL_CHAR_A, 
-                                                      DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE, //TODO BITTEST
-                                                       DISPLAY_array16_AA , // DISPLAY_array16_I( "#53 BCAST  " + char( Slave_Ports_Status_A[i].Port_ID  ) , 2), //message,
-                                                       DISPLAY_TARGET_DISPLAY128,
-                                                      time , // time_seq_id_T time_seq_id_A;
-                                                      time+ARDUINO_time_seq_id_A_INCREMENT, //time_min_run_T time_min_run_A;
-                                                     //queue
-                                                    Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                                                    TASK_TYPE_T_Slave_Ports_broadcast____  ,  //TASK_TYPE_A,
-                                                    { Slave_Ports_Status_A[i].Port_ID } //TASK_PORT_ASSOC_A
-                                                    
-                                                    ); 
-                                     #endif      
-                                      
-                                         
-                                     #endif
-                          
-                          #if defined(DEBUG_TASK_TYPE_T_Slave_Ports_broadcast____)
-                             Serial.println("#66A Prepared data");
-                          #endif
-                            
-                          #if defined(DISABLE_TASK_TYPE_T_DISPLAY_queue_pop________)
-                                     #else
-                                     DISPLAY__CURSOR_Y_CHARS__SET(DISPLAY_PHYSICAL_CHAR_A, 
-                                                     DISPLAY_CURSOR_Y_CHARS_CAN_DEBUG);
-                             #endif
-                               DISPLAY_array16_T  DISPLAY_array16_AAA="" ;
-                               //( "OUT I2C 0X40[2]" + encoderPos * 5 , 2), //message,          
-                                          _Slave_Ports_Protocol_CAN_broadcast_T CAN_broadcast_A={};
-                                               // CAN_broadcast_A._CAN_REMOTE_ID = _CAN_REMOTE_ID_BROADCAST ;
-                                              //  CAN_broadcast_A._CAN_SENDER_ID = Active_ControllerID_HEX ;
-                                                CAN_broadcast_A.Port_ID = Slave_Ports_Status_A[i].Port_ID ;
-                                                CAN_broadcast_A.PortTypes = Slave_Ports_Status_A[i].PortTypes ; 
-                                                CAN_broadcast_A.Exp_state = Slave_Ports_Status_A[i].Exp_state ;  
-                                                CAN_broadcast_A.Exp_state_ttl = Slave_Ports_Status_A[i].Exp_state_ttl ;
-                                                CAN_broadcast_A.Broadcast_state = Broadcast_state_FULL_FRESH ; //Slave_Ports_Status_A[i].Broadcast_state ;
-                                               // CAN_broadcast_A._CAN_8 = TASK_TYPE_T_Slave_Ports_broadcast____ ;
-                                   
-                                     // CAN_broadcast_A._CAN_8 = _CAN_8_EMPTY ;
-                                     
-                          /* byte CAN_broadcast_A[8] = {_CAN_REMOTE_ID_BROADCAST, 
-                                                        Active_ControllerID_HEX, 
-                                                        Slave_Ports_Status_A[i].Port_ID, 
-                                                        Slave_Ports_Status_A[i].PortTypes, 
-                                                        Slave_Ports_Status_A[i].Exp_state , 
-                                                        Slave_Ports_Status_A[i].Exp_state_ttl,
-                                                        Slave_Ports_Status_A[i].Broadcast_state,
-                                                        TASK_TYPE_T_Slave_Ports_broadcast____ };
-                        */
-                          
-                            #if defined(DISABLE_TASK_TYPE_T_DISPLAY_queue_pop________)
-                                     #else
-                                     
-                                      #if defined(DISPLAY_array16_T_is_DISPLAY_string_T)
-                                            message = "2CAN BCAST "; message.concat(i); message.concat(".");  message.concat(Slave_Ports_Status_A[i].Port_ID);  message.concat(" >>>");
-                                                DISPLAY__print(
-                                                DISPLAY_A ,
-                                                DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                                                DISPLAY_PHYSICAL_CHAR_A, 
-                                                 DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE,
-                                                  message,
-                                                  DISPLAY_TARGET_DISPLAY128,
-                                                 time , // time_seq_id_T time_seq_id_A;
-                                                 time+5000, //time_min_run_T time_min_run_A;
-                                                //queue
-                                               Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A,
-                                               TASK_TYPE_T_Slave_Ports_broadcast____  ,  //TASK_TYPE_A,
-                                               {  } //TASK_PORT_ASSOC_A Slave_Ports_Status_A[i].Port_ID
-                                               
-                                               ); 
-                                      #else
-                                        message = "2CAN BCAST "; message.concat(i); message.concat(".");  message.concat(Slave_Ports_Status_A[i].Port_ID);  message.concat(" >>>                        "); 
-                      
-                                             message.toCharArray(DISPLAY_array16_AAA, 16);
-                                  DISPLAY__print(
-                                       DISPLAY_A ,
-                                       DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                                       DISPLAY_PHYSICAL_CHAR_A, 
-                                        DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE,
-                                         DISPLAY_array16_AAA,
-                                         DISPLAY_TARGET_DISPLAY128,
-                                        time , // time_seq_id_T time_seq_id_A;
-                                        time+5000, //time_min_run_T time_min_run_A;
-                                       //queue
-                                      Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A,
-                                      TASK_TYPE_T_Slave_Ports_broadcast____  ,  //TASK_TYPE_A,
-                                      {  } //TASK_PORT_ASSOC_A Slave_Ports_Status_A[i].Port_ID
-                                      
-                                      ); 
-                                      #endif
-                                     
-                                   
-                                #endif
-                        
-                        
-                        
-                     //    byte sndStat = CAN0.sendMsgBuf(Slave_Ports_Status_A[i].Port_ID, 0, 8, data);
-                         //byte CAN_broadcast_A8[8];
-                          
-                                             
-                        byte CAN_MSG8_A[8];
-                       CAN_MSG8_A_ptr(CAN_broadcast_A,CAN_MSG8_A);
-                        
-                         // #if defined(DEBUG_CAN) || defined(DEBUG_TASK_TYPE_T_Slave_Ports_broadcast____)
-                           Serial.println("#139 deb CAN_MSG8_A_ptr");    
-                        //  #endif
-                         
-                             
-                                                 //Serial.println("#135 deb CAN_broadcast_A9");
-                                                // {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}
-                                              //   byte CAN_broadcast_A9[8] = {0xFF, 0x101, 0x02, 0x03, 0x04, 0x05, 0x07,  0x08};
-                       //  CAN_data_debug(CAN_broadcast_A9);
-                         byte sndStat = CAN0.sendMsgBuf(Active_ControllerID_HEX, 0, 8, CAN_MSG8_A);  CAN_data_debug(CAN_MSG8_A);   //CAN_MSG8_A
-                         delay(200);
-                      //    byte sndStat ;
-                                  if(sndStat == CAN_OK){
-                                  Slave_Ports_Status_A[i].Broadcast_state =  Broadcast_state_FULL_FRESH ;
-                                  #if defined(DEBUG_TASK_TYPE_T_Slave_Ports_broadcast____)
-                                    Serial.println("#921 Message Sent Successfully!");
-                                  #endif   
-                                     //String LCDarray1 = "Message Sent";
-                                     //String LCDarray2 = "Successfully";
-                                     
-                                     
-                                         #if defined(DISABLE_TASK_TYPE_T_DISPLAY_queue_pop________)
-                                                  #else
-                                                                 #if defined(DISPLAY_array16_T_is_DISPLAY_string_T)
-                                                                 message = "3CAN SEND " ; message.concat(i); message.concat(".");  message.concat(Slave_Ports_Status_A[i].Port_ID);  message.concat(" >>>");
-                                                                  DISPLAY__CURSOR_Y_CHARS__SET(DISPLAY_PHYSICAL_CHAR_A, 
-                                                                         DISPLAY_CURSOR_Y_CHARS_CAN_DEBUG);
-                                                                       DISPLAY__print( DISPLAY_A ,
-                                                                                        DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                                                                                        DISPLAY_PHYSICAL_CHAR_A, 
-                                                                                         DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE, //TODO BITTEST
-                                                                                          message, //message,
-                                                                                          DISPLAY_TARGET_DISPLAY128,
-                                                                                         time , // time_seq_id_T time_seq_id_A;
-                                                                                         time + 5000, //time_min_run_T time_min_run_A;
-                                                                                        //queue
-                                                                                       Slave_Ports_Status_QUEUE_A,  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                                                                                       TASK_TYPE_T_Slave_Ports_broadcast____  ,  //TASK_TYPE_A,
-                                                                                       { Slave_Ports_Status_A[i].Port_ID } //TASK_PORT_ASSOC_A
-                                                                                       ); 
-                                                                 #else
-                                                                      DISPLAY_array16_T  DISPLAY_array16_AAAA="" ;
-                                                                      message = "3CAN SEND " ; message.concat(i); message.concat(".");  message.concat(Slave_Ports_Status_A[i].Port_ID);  message.concat(" >>>                        "); 
-                                            
-                                                                         message.toCharArray(DISPLAY_array16_AAAA, 16);
-                                                                       DISPLAY__CURSOR_Y_CHARS__SET(DISPLAY_PHYSICAL_CHAR_A, 
-                                                                         DISPLAY_CURSOR_Y_CHARS_CAN_DEBUG);
-                                                                       DISPLAY__print( DISPLAY_A ,
-                                                                                        DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                                                                                        DISPLAY_PHYSICAL_CHAR_A, 
-                                                                                         DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE, //TODO BITTEST
-                                                                                          DISPLAY_array16_AAAA, //message,
-                                                                                          DISPLAY_TARGET_DISPLAY128,
-                                                                                         time , // time_seq_id_T time_seq_id_A;
-                                                                                         time + 5000, //time_min_run_T time_min_run_A;
-                                                                                        //queue
-                                                                                       Slave_Ports_Status_QUEUE_A,  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                                                                                       TASK_TYPE_T_Slave_Ports_broadcast____  ,  //TASK_TYPE_A,
-                                                                                       { Slave_Ports_Status_A[i].Port_ID } //TASK_PORT_ASSOC_A
-                                                                                       ); 
-                                                                 #endif
-                                              
-                                                     #endif 
-                                             #ifdef DEBUG_CAN || defined(DEBUG_TASK_TYPE_T_Slave_Ports_broadcast____)
-                                                Serial.print("#155 after CAN_SEND update  [Broadcast_state_FULL_FRESH]   for i[");
-                                                Serial.print(i);  Serial.println("] "); 
-                                                Serial.print("#154   before   Exp_state_ttl[");
-                                                //Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state_ttl)); Serial.print("]  Broadcast_state[");
-                                                //Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Broadcast_state)); Serial.println("] ");
-                                              #endif          
-                              
-                                     //   Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl_IS_ACTIVE ;
-                                             
-                                                 #if  defined(DEBUG_CAN) || defined(DEBUG_TASK_TYPE_T_Slave_Ports_broadcast____)
-                                                  Serial.print("#164   after    Exp_state_ttl[");
-                                                    //Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Exp_state_ttl)); Serial.print("]  Broadcast_state[");
-                                                    //Serial.print(BIN8_to_STRING(Slave_Ports_Status_A[i].Broadcast_state)); Serial.println("] ");
-                                                 
-                                                 #endif
-                                               
-                                                      
-                                                      
-                                  } else {
-                                  #if defined(DEBUG_TASK_TYPE_T_Slave_Ports_broadcast____)
-                                    Serial.print("Error Sending Message...  [");    Serial.print(sndStat);  Serial.println("]   ");
-                                    #endif  
-                                     #if defined(DISABLE_TASK_TYPE_T_DISPLAY_queue_pop________)
-                                                  #else
-                                                   #if defined(DISPLAY_array16_T_is_DISPLAY_string_T)
-                                                    message =     "4CAN ERR " ; message.concat(i); message.concat(".");  message.concat(Slave_Ports_Status_A[i].Port_ID);  message.concat(" >>>");
-                                                    DISPLAY__print( DISPLAY_A ,  DISPLAY_T_ARDUINO_ATTR_ARRAY_A , DISPLAY_PHYSICAL_CHAR_A,  DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE,  message, DISPLAY_TARGET_DISPLAY128,
-                                                                              time , // time_seq_id_T time_seq_id_A;
-                                                                              time +5000, //time_min_run_T time_min_run_A;
-                                                                             //queue
-                                                                            Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                                                                            TASK_TYPE_T_Slave_Ports_broadcast____  ,  //TASK_TYPE_A,
-                                                                            { Slave_Ports_Status_A[i].Port_ID } //TASK_PORT_ASSOC_A
-                                                                            ); 
-                                                   #else
-                                                              DISPLAY_array16_T  DISPLAY_array16_AAAAA="" ;
-                                                          message =     "4CAN ERR " ; message.concat(i); message.concat(".");  message.concat(Slave_Ports_Status_A[i].Port_ID);  message.concat(" >>>                        "); 
-                                                          message.toCharArray(DISPLAY_array16_AAAAA, 16);
-                                                         DISPLAY__print( DISPLAY_A ,
-                                                                            DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                                                                            DISPLAY_PHYSICAL_CHAR_A, 
-                                                                             DISPLAY_pos_seq_A_NEXT | DISPLAY_pos_seq_A_IMMEDIATE, //TODO BITTEST
-                                                                              DISPLAY_array16_AAAAA,//DISPLAY_array16_I( "#107MSG ERROR " + char( Slave_Ports_Status_A[i].Port_ID  ) , 2), //message,
-                                                                              DISPLAY_TARGET_DISPLAY128,
-                                                                             time , // time_seq_id_T time_seq_id_A;
-                                                                             time +5000, //time_min_run_T time_min_run_A;
-                                                                            //queue
-                                                                           Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                                                                           TASK_TYPE_T_Slave_Ports_broadcast____  ,  //TASK_TYPE_A,
-                                                                           { Slave_Ports_Status_A[i].Port_ID } //TASK_PORT_ASSOC_A
-                                                                           ); 
-                                                   #endif
-                                               
-                                    #endif
-                                    //String LCDarray1 = "Error Sending";
-                                    //String LCDarray2 = "Message...";
-                                  }
-        
-                                    
-                        } else if(Slave_Ports_Status_A[i].Broadcast_state > Broadcast_state_FRESH)  { //if Bcast to refresh
-                                 
-                                Serial.print("#238[BCAST]--[");Serial.print(Slave_Ports_Status_A[i].Broadcast_state);Serial.print("] "); 
-                                
-                                //Slave_Ports_Status_A[i].Broadcast_state =  Slave_Ports_Status_A[i].Broadcast_state - (TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A_INCREMENT_A / 1000)  ; //(TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A_INCREMENT_A / 1000)
-                                Slave_Ports_Status_A[i].Broadcast_state = BYTE_SAFE_DECREMENT_TO_LIMIT(Broadcast_state_TO_REFRESH,  Slave_Ports_Status_A[i].Broadcast_state, (TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A_INCREMENT_A / 1000) );
-                        
-                        }
-                } else if(Slave_Ports_Status_A[i].IS_Local_A == IS_Local_FALSE and Slave_Ports_Status_A[i]._Slave_ID > 0 and Slave_Ports_Status_A[i].Port_ID > 0 ) {
-                
-                    Serial.print("#331[BCAST][ELSE]"); Serial.print(i);  Serial.print("] IS_Local_A:");
-                    Serial.print(Slave_Ports_Status_A[i].IS_Local_A);
-                    Serial.print("] ");  Serial.print("[DELETE PORT?]");
-                    
-                    if((Slave_Ports_Status_A[i].Broadcast_state - (TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A_INCREMENT_A / 1000) ) < 0 ) //( TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A_INCREMENT_A / 1000 )
-                        Slave_Ports_Status_A[i].IS_gone_A = IS_gone_TRUE ;
-                    //Slave_Ports_Status_A[i].Broadcast_state = Slave_Ports_Status_A[i].Broadcast_state - (TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A_INCREMENT_A / 1000)  ; //
-                    Slave_Ports_Status_A[i].Broadcast_state = BYTE_SAFE_DECREMENT_TO_LIMIT( Broadcast_state_TO_REFRESH,  Slave_Ports_Status_A[i].Broadcast_state, (TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A_INCREMENT_A / 1000)   ) ;
-                
-                } else { //if(Slave_Ports_Status_A[i].IS_Local_A == IS_Local_TRUE) {
-                 #if defined(DEBUG) //|| defined(DEBUG_CAN) || defined(DEBUG_TASK_TYPE_T_Slave_Ports_broadcast____)
-                //if(DEBUG > 4) {
-                    Serial.print("#147 BCAST NOT SENT  ind:"); Serial.print(i);  Serial.print("] IS_Local_A:");
-                    Serial.print(Slave_Ports_Status_A[i].IS_Local_A);
-                    Serial.print(" , ID:"); 
-                    Serial.print(Slave_Ports_Status_A[i].Port_ID, HEX); Serial.print(" , PortTypes:");
-                    Serial.print(Slave_Ports_Status_A[i].PortTypes, HEX); Serial.print(" , Addr:"); Serial.print(Slave_Ports_Status_A[i].Address, HEX);
-                    Serial.print(" , Local:"); Serial.print(Slave_Ports_Status_A[i].LocalPort);
-                    Serial.print(" , Exp state:"); Serial.print(Slave_Ports_Status_A[i].Exp_state);
-                    Serial.print(" , Exp_state_ttl"); Serial.println(Slave_Ports_Status_A[i].Exp_state_ttl);  
-                    Serial.print("#2111 *_TEST_GLOBAL"); Serial.print(*_TEST_GLOBAL); Serial.println("]");
-                  // }
-                  #endif
-                
-                }
-
-
-                          
-                                
-                     
-
-             
-
-
-                
-            }
-          
-
- } //EOF _Slave_Ports_broadcast_POP
- 
- 
- 
- 
- 

+ 0 - 28
SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x11/config_Active_ControllerID_0x11.h

@@ -1,28 +0,0 @@
-
-//there kleep config of this id device#define HAS_TFT_ILI9163C 
-// #define HAS_LCD1602 
-#define HAS_ROTTARY_SW
-#define HAS_TFT_ILI9163C
-#define HAS_I2C_driver_Adafruit_PWMServoDriver 
-//#define DEBUG_I2C_driver_Adafruit_PWMServoDriver
-#define HAS__PCINT_setup //to allow interrupts
-
-//#define DISABLE_TASK_TYPE_T_DISPLAY_queue_pop________
-//#error
-//#define DEBUG 5 
-
-//#define DISABLE_LOOP //To debug and disable any output
-
-//#define DEBUG_I2C
-//#define HAS_DEBUG_ACTION_TRIG
-//#define DEBUG_CAN
-
-//#define DEBUG_DISPLAY
-
-//#define DEBUG_QUEUE
-
-//#define DEBUG_QUEUE_ASSERT
-
-//#define DEBUG_QUEUE_WAIT 500
-//#define DEBUG_STORAGE_QUEUE_TEST
-//#define DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK

+ 0 - 119
SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x11/config_Slave_Ports_LOCAL_0x11_init.h

@@ -1,119 +0,0 @@
-
-ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
-                Slave_Ports_Status_T* Slave_Ports_Status_A ,
-                Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_T*            Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T*      Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_T*  Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                
-                DISPLAY_T*  DISPLAY_A ,  DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A,
-                time_seq_id_T time_seq_id,  time_min_run_T time_min_run 
-                //,*DISPLAY_PHYSICAL_CHAR_A //DISPLAY_PHYSICAL_CHAR_T 
-                ) {
-
-   //DISPLAY_T_ARDUINO_ATTR_ARRAY_A[ARDUINO_ATTR_ARRAY_S_INDEX].ARDUINO_ARRAY_INDEX_CURRENT_INIT ++;
-     #if defined(DEBUG) 
-                                  if(DEBUG > 6) {  
-                Serial.println("#4444 _Slave_Ports_LOCAL_init");
-                }
-     #endif
-      
-                  Slave_Ports_Status_add_port(
-                                Slave_Ports_Status_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_T_TO_DELETE_A,
-                                    Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                                1,  // int  Port_ID,
-                                Active_ControllerID_HEX ,  //int  _Slave_ID,
-                                PortTypes_PWM_EXP_I2C, //int  PortTypes,
-                                0x40 ,  //int  Address,
-                                0 , //int  LocalPort,
-                                Exp_state_OFF, //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, 
-                                time_seq_id, time_min_run 
-                                );
-                                
-                                
-                  Slave_Ports_Status_add_port(
-                                Slave_Ports_Status_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_T_TO_DELETE_A,
-                                    Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                                2,  // int  Port_ID,
-                                Active_ControllerID_HEX ,  //int  _Slave_ID,
-                                PortTypes_PWM_EXP_I2C | PortTypes_SERVO  ,// | PortTypes_SERVO //int  PortTypes,
-                                0x40 ,  //int  Address,
-                                1 , //int  LocalPort,
-                                Exp_state_OFF, //int  Exp_state,
-                                Exp_state_ttl_TO_REFRESH , //Exp_state_ttl_TO_REFRESH, //int  Exp_state_ttl,
-                                Broadcast_state_FULL_FRESH, //Broadcast_state_TO_REFRESH, //int  Broadcast_state,
-                                I2C_port_DEFAULT, //int I2C_port,
-                                I2C_driver_Adafruit_PWMServoDriver ,//int I2C_driver
-                                IS_Local_TRUE ,
-                                time_seq_id, time_min_run
-                                );
-                                
-                 Slave_Ports_Status_add_port(
-                                Slave_Ports_Status_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_T_TO_DELETE_A,
-                                    Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                                3,  // int  Port_ID,
-                                Active_ControllerID_HEX ,  //int  _Slave_ID,
-                                PortTypes_PWM_EXP_I2C , //int  PortTypes,
-                                0x40 ,  //int  Address,
-                                3 , //int  LocalPort,
-                                Exp_state_OFF, //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 ,
-                                time_seq_id, time_min_run
-                                );
-                                
-                                
-                                
-                                
-                    /*    DISPLAY__print_ANY(
-                    DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                    DISPLAY_PHYSICAL_CHAR_A,
-                    DISPLAY_pos_seq_A_NEXT,
-                    "#4 _Slave_Ports_LOCAL_init");             
-                 
-                 */
-                 
-                                              //1234567890123456
-                 //DISPLAY_array16_T DISPLAY_array16_AA ;
-                 // DISPLAY_array16_AA[16]= "#50 Added ports ";
-                 
-                 //DISPLAY_array16_AA.toCharArray(DISPLAY_array16_AA,16);
-               #if  defined(DISABLE_DISPLAY__add_record)
-               #else  
-                 DISPLAY__add_record(
-                       DISPLAY_A ,
-                      DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                      DISPLAY_PHYSICAL_CHAR_A, 
-                          DISPLAY_pos_seq_A_NEXT ,
-                           //"012345678901234" , 
-                           "#50 Added ports ",//DISPLAY_array16_A
-                          DISPLAY_TARGET_DISPLAY128,
-                          time_seq_id, //time_seq_id_A,
-                           time_seq_id + 5000 //time_min_run_A =
-                           //QUEUE
-                           , Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A, 
-                            TASK_TYPE_T__EMPTY__JUST_PASSED_ARG__,
-                            TASK_PORT_ASSOC_EMPTY
-                 );
-               #endif
-                    
-    return true ;
-
-}

+ 0 - 14
SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x13/config_Active_ControllerID_0x13.h

@@ -1,14 +0,0 @@
-
-//there kleep config of this id device
-#define HAS_TFT_ILI9163C 
-// #define HAS_LCD1602 
-//#define HAS_ROTTARY_SW
-//#define HAS__PCINT_setup //to allow interrupts
-
-#define HAS_I2C_driver_Adafruit_PWMServoDriver 
-
-
-//#define DEBUG 5 
-//#define DISABLE_LOOP //To debug and disable any output
-
-#define DISABLE_TASK_TYPE_T_DISPLAY_queue_pop________

+ 0 - 118
SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x13/config_Slave_Ports_LOCAL_0x13_init.h

@@ -1,118 +0,0 @@
-
-ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
-                Slave_Ports_Status_T* Slave_Ports_Status_A ,
-                Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_T*            Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T*      Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_T*  Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                
-                DISPLAY_T*  DISPLAY_A ,  DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A,
-                time_seq_id_T time_seq_id,  time_min_run_T time_min_run
-                //,*DISPLAY_PHYSICAL_CHAR_A //DISPLAY_PHYSICAL_CHAR_T 
-                ) {
-
-   //DISPLAY_T_ARDUINO_ATTR_ARRAY_A[ARDUINO_ATTR_ARRAY_S_INDEX].ARDUINO_ARRAY_INDEX_CURRENT_INIT ++;
-     #if defined(DEBUG) 
-                                  if(DEBUG > 6) {  
-                Serial.println("#4444 _Slave_Ports_LOCAL_init");
-                }
-     #endif
-      
-                  Slave_Ports_Status_add_port(
-                                Slave_Ports_Status_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_T_TO_DELETE_A,
-                                    Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                                1,  // int  Port_ID,
-                                Active_ControllerID_HEX ,  //int  _Slave_ID,
-                                PortTypes_PWM_EXP_I2C, // PortTypes_SERVO , //int  PortTypes,
-                                0x40 ,  //int  Address,
-                                1 , //int  LocalPort,
-                                Exp_state_OFF, //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 , 
-                                time_seq_id, time_min_run 
-                                );
-                                
-                                
-                  Slave_Ports_Status_add_port(
-                                Slave_Ports_Status_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_T_TO_DELETE_A,
-                                    Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                                2,  // int  Port_ID,
-                                Active_ControllerID ,  //int  _Slave_ID,
-                                PortTypes_P2M_EXP_I2C | PortTypes_SERVO | PortTypes_SERVO_360 , //int  PortTypes,
-                                0x40 ,  //int  Address,
-                                4 , //int  LocalPort,
-                                Exp_state_UNSET, //Exp_state_OFF, //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, 
-                                time_seq_id, time_min_run 
-                                );
-                                
-                                 Slave_Ports_Status_add_port(
-                                Slave_Ports_Status_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_T_TO_DELETE_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 | PortTypes_SERVO , //int  PortTypes,
-                                0x40 ,  //int  Address,
-                                3 , //int  LocalPort,
-                                Exp_state_UNSET, //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 ,
-                                time_seq_id, time_min_run
-                                );
-                                
-                                
-                                
-                             
-                    /*    DISPLAY__print_ANY(
-                    DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                    DISPLAY_PHYSICAL_CHAR_A,
-                    DISPLAY_pos_seq_A_NEXT,
-                    "#4 _Slave_Ports_LOCAL_init");             
-                 
-                 */
-                 
-                                              //1234567890123456
-                  // DISPLAY_array16_T DISPLAY_array16_AA ;
-                  //DISPLAY_array16_AA[16]= "#50 Added ports ";
-                 
-                  #if  defined(DISABLE_DISPLAY__add_record)
-               #else  
-                 DISPLAY__add_record(
-                       DISPLAY_A ,
-                      DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                      DISPLAY_PHYSICAL_CHAR_A, 
-                          DISPLAY_pos_seq_A_NEXT ,
-                         //"012345678901234" , //
-                         "#50 Added ports ",//DISPLAY_array16_A
-                          DISPLAY_TARGET_DISPLAY128,
-                          time_seq_id, //time_seq_id_A,
-                          time_seq_id + 5000 //time_min_run_A =
-                           //QUEUE
-                           , Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                            TASK_TYPE_T__EMPTY__JUST_PASSED_ARG__,
-                            TASK_PORT_ASSOC_EMPTY
-                 );
-                #endif 
-                    
-    return true ;
-
-}

+ 0 - 17
SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x14/config_Active_ControllerID_0x14.h

@@ -1,17 +0,0 @@
-
-//there kleep config of this id device
-//#define HAS_TFT_ILI9163C 
-// #define HAS_LCD1602 
-//#define HAS_ROTTARY_SW
-//#define HAS__PCINT_setup //to allow interrupts
-
-#define HAS_I2C_driver_Adafruit_PWMServoDriver 
-
-
-//#define DEBUG 5 
-//#define DISABLE_LOOP //To debug and disable any output
-
-//#define DISABLE_TASK_TYPE_T_DISPLAY_queue_pop________
-
-
-#define DISABLE_ANY_PRINT //when uno ?

+ 0 - 114
SE/stuff/P5_Automation_can-dev-res/___CONFIG/0x14/config_Slave_Ports_LOCAL_0x14_init.h

@@ -1,114 +0,0 @@
-
-ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_LOCAL_init(
-                Slave_Ports_Status_T* Slave_Ports_Status_A ,
-                Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_T*            Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T*      Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_T*  Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                
-                DISPLAY_T*  DISPLAY_A ,  DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A
-                //,*DISPLAY_PHYSICAL_CHAR_A //DISPLAY_PHYSICAL_CHAR_T 
-                ) {
-
-   //DISPLAY_T_ARDUINO_ATTR_ARRAY_A[ARDUINO_ATTR_ARRAY_S_INDEX].ARDUINO_ARRAY_INDEX_CURRENT_INIT ++;
-     #if defined(DEBUG) 
-                                  if(DEBUG > 6) {  
-                Serial.println("#4444 _Slave_Ports_LOCAL_init");
-                }
-     #endif
-      
-                  Slave_Ports_Status_add_port(
-                                Slave_Ports_Status_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_T_TO_DELETE_A,
-                                    Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                                1,  // int  Port_ID,
-                                Active_ControllerID_HEX ,  //int  _Slave_ID,
-                                PortTypes_PWM_EXP_I2C, // PortTypes_SERVO , //int  PortTypes,
-                                0x40 ,  //int  Address,
-                                1 , //int  LocalPort,
-                                Exp_state_OFF, //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 
-                                );
-                                
-                           /*     
-                  Slave_Ports_Status_add_port(
-                                Slave_Ports_Status_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_T_TO_DELETE_A,
-                                    Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                                2,  // int  Port_ID,
-                                Active_ControllerID ,  //int  _Slave_ID,
-                                PortTypes_P2M_EXP_I2C , //int  PortTypes,
-                                0x40 ,  //int  Address,
-                                2 , //int  LocalPort,
-                                Exp_state_OFF, //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 
-                                );
-                                
-                                 Slave_Ports_Status_add_port(
-                                Slave_Ports_Status_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_T_TO_DELETE_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 
-                                );
-                                
-                                
-                                
-                           */     
-                    /*    DISPLAY__print_ANY(
-                    DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                    DISPLAY_PHYSICAL_CHAR_A,
-                    DISPLAY_pos_seq_A_NEXT,
-                    "#4 _Slave_Ports_LOCAL_init");             
-                 
-                 */
-                 
-                                              //1234567890123456
-                  // DISPLAY_array16_T DISPLAY_array16_AA ;
-                  //DISPLAY_array16_AA[16]= "#50 Added ports ";
-                 
-                  #if  defined(DISABLE_DISPLAY__add_record)
-               #else  
-                 DISPLAY__add_record(
-                       DISPLAY_A ,
-                      DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                      DISPLAY_PHYSICAL_CHAR_A, 
-                          DISPLAY_pos_seq_A_NEXT ,
-                         //"012345678901234" , //
-                         "#50 Added ports ",//DISPLAY_array16_A
-                          DISPLAY_TARGET_DISPLAY128,
-                          time_seq_id, //time_seq_id_A,
-                          time_seq_id + 5000 //time_min_run_A =
-                           //QUEUE
-                           , Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                            TASK_TYPE_T__EMPTY__JUST_PASSED_ARG__,
-                            TASK_PORT_ASSOC_EMPTY
-                 );
-                #endif 
-                    
-    return true ;
-
-}

+ 0 - 108
SE/stuff/P5_Automation_can-dev-res/___CONFIG/config_Slave_Ports_LOCAL_init.h

@@ -1,108 +0,0 @@
-
-//default ports of any device
-
-ARDUINO_FUNCT_INIT_RESULT_T _Slave_Ports_DEFAULT_LOCAL_init(
-                Slave_Ports_Status_T* Slave_Ports_Status_A ,
-                Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A ,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_T*            Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T*      Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
-                 Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_T*  Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                
-                DISPLAY_T*  DISPLAY_A ,  DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A
-                //,*DISPLAY_PHYSICAL_CHAR_A //DISPLAY_PHYSICAL_CHAR_T 
-                ) {
-
-   //DISPLAY_T_ARDUINO_ATTR_ARRAY_A[ARDUINO_ATTR_ARRAY_S_INDEX].ARDUINO_ARRAY_INDEX_CURRENT_INIT ++;
-     #if defined(DEBUG) 
-                                  if(DEBUG > 6) {  
-                Serial.println("#3333 _Slave_Ports_DEFAULT_LOCAL_init");
-                }
-     #endif
-      
-               /*   Slave_Ports_Status_add_port(
-                                Slave_Ports_Status_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_T_TO_DELETE_A,
-                                    Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                                1,  // int  Port_ID,
-                                Active_ControllerID ,  //int  _Slave_ID,
-                                PortTypes_P2M_EXP_I2C + PortTypes_SERVO , //int  PortTypes,
-                                0x40 ,  //int  Address,
-                                1 , //int  LocalPort,
-                                Exp_state_OFF, //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 
-                                );
-                                
-                                
-                  Slave_Ports_Status_add_port(
-                                Slave_Ports_Status_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_T_TO_DELETE_A,
-                                    Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                                2,  // int  Port_ID,
-                                Active_ControllerID ,  //int  _Slave_ID,
-                                PortTypes_P2M_EXP_I2C , //int  PortTypes,
-                                0x40 ,  //int  Address,
-                                2 , //int  LocalPort,
-                                Exp_state_OFF, //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 
-                                );
-                                
-                                 Slave_Ports_Status_add_port(
-                                Slave_Ports_Status_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_T_TO_DELETE_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 
-                                );
-                                
-                                
-                                */
-                                
-                    /*    DISPLAY__print_ANY(
-                    DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                    DISPLAY_PHYSICAL_CHAR_A,
-                    DISPLAY_pos_seq_A_NEXT,
-                    "#4 _Slave_Ports_LOCAL_init");             
-                 
-                 */
-               /*  DISPLAY__add_record(
-                       DISPLAY_A ,
-                      DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                      DISPLAY_PHYSICAL_CHAR_A, 
-                          DISPLAY_pos_seq_A_NEXT ,
-                          "#50 Added default ports ",//DISPLAY_array16_A
-                          DISPLAY_TARGET_DISPLAY128,
-                          millis(), //time_seq_id_A,
-                           millis() + 5000 //time_min_run_A =
-                           //QUEUE
-                           , Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A, 
-                            TASK_TYPE_T__EMPTY__JUST_PASSED_ARG__,
-                            TASK_PORT_ASSOC_EMPTY
-                 );
-     
-                 */   
-    return true ;
-
-}

+ 0 - 32
SE/stuff/P5_Automation_can-dev-res/___DEBUG/0x11/___DEBUG_DISABLE_INIT__0x11.h

@@ -1,32 +0,0 @@
-/*Queue<Adafruit_PWMServoDriver> Adafruit_PWMServoDriver_A = Queue<Adafruit_PWMServoDriver>(10);
-
-
-
-Adafruit_PWMServoDriver_A.push(Adafruit_PWMServoDriver(0x40));
-
-*/
-
-
-  
-  
-  
-/*
-Serial.print("68 will inimt powm I2C_ADDRESS_AA[");
-Serial.println("");*/
-
-
-//Serial.print("#7666 after[");
-
-/*
-
- int Adafruit_PWMServoDriver_setPWMFreq(Adafruit_PWMServoDriver_T* Adafruit_PWMServoDriver_A,I2C_ADDRESS_T I2C_ADDRESS_A) {
-  int i;
-    for(i=1;i<=ARDUINO_ARRAY_INDEX_LIMIT_PORTS ; i++) {
-        if(Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A == I2C_ADDRESS_A) {
-            Adafruit_PWMServoDriver_A[i].Adafruit_PWMServoDriver_V->setPWM(7,100,1000);
-            break;
-        }
-    }
-    return 1;
-  }
-*/

+ 0 - 162
SE/stuff/P5_Automation_can-dev-res/___DEBUG/0x11/___DEBUG_DISABLE_LOOP__0x11.h

@@ -1,162 +0,0 @@
-
-//if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END(ARDUINO_LOOP_LATENCY__MAIN_END_A) <= ARDUINO_LOOP_LATENCY_COUNTER_INIT )  {
-
-static int tested = 0;
-
-
-    
-    /*
-        Serial.println("11123123");
-TEST_QUEUE.push(10);
-
-TEST_QUEUE.push(10);
- Serial.println("WILL POP");
-     Serial.println(TEST_QUEUE.pop());
- }
- */
-
-/*
-if(tested == 0) { 
-
-
-Serial.println("#45 testing Slave_Ports_Status_QUEUE_STATIC_ID_COUNTER_T");
-
-
-
- ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_T QUEUE_COUNT_MAX_A = 6;
-        ARDUINO_ARRAY_ATTR_QUEUE_COUNT_T QUEUE_COUNT_A = 0;
-        ARDUINO_ARRAY_ATTR_QUEUE_PEEK_T QUEUE_PEEK_A ;
-        ARDUINO_ARRAY_ATTR_QUEUE_BACK_T QUEUE_BACK_A ;
-        ARDUINO_ARRAY_ATTR_QUEUE_FRONT_T QUEUE_FRONT_A;
-      
-        
-        Slave_Ports_Status_QUEUE_STATIC_ID_COUNTER( 
-                            QUEUE_COUNT_MAX_A, 
-                            QUEUE_COUNT_A, QUEUE_PEEK_A, 
-                            QUEUE_BACK_A , QUEUE_FRONT_A,
-                            ARDUINO_ARRAY_ATTR_QUEUE_ACTION_SET | ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX
-        );
-        
-        
-        
-        
-        
-        
-}
-
-
- else if(tested ==2) {
-  ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_T QUEUE_COUNT_MAX_A = 20;
-        ARDUINO_ARRAY_ATTR_QUEUE_COUNT_T QUEUE_COUNT_A = 0;
-        ARDUINO_ARRAY_ATTR_QUEUE_PEEK_T QUEUE_PEEK_A ;
-        ARDUINO_ARRAY_ATTR_QUEUE_BACK_T QUEUE_BACK_A ;
-        ARDUINO_ARRAY_ATTR_QUEUE_FRONT_T QUEUE_FRONT_A;
-
-    Slave_Ports_Status_QUEUE_STATIC_ID_COUNTER( 
-                            QUEUE_COUNT_MAX_A, 
-                            QUEUE_COUNT_A, QUEUE_PEEK_A, 
-                            QUEUE_BACK_A , QUEUE_FRONT_A,
-                            ARDUINO_ARRAY_ATTR_QUEUE_ACTION_GET | ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX
-        );
-} 
-
- if(tested ==3) {  Serial.println("tested["); Serial.print(tested); Serial.println("]  ");
-  ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_T QUEUE_COUNT_MAX_A = 30;
-        ARDUINO_ARRAY_ATTR_QUEUE_COUNT_T QUEUE_COUNT_A = 0;
-        ARDUINO_ARRAY_ATTR_QUEUE_PEEK_T QUEUE_PEEK_A ;
-        ARDUINO_ARRAY_ATTR_QUEUE_BACK_T QUEUE_BACK_A ;
-        ARDUINO_ARRAY_ATTR_QUEUE_FRONT_T QUEUE_FRONT_A;
-
-    Slave_Ports_Status_QUEUE_STATIC_ID_COUNTER( 
-                            QUEUE_COUNT_MAX_A, 
-                            QUEUE_COUNT_A, QUEUE_PEEK_A, 
-                            QUEUE_BACK_A , QUEUE_FRONT_A,
-                            ARDUINO_ARRAY_ATTR_QUEUE_ACTION_SET & ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX
-        );
-}  
-
- if(tested >=4 and tested < 15) {
-
- Serial.print("####5555");Serial.print(tested); Serial.println("]  ");
-  ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_T QUEUE_COUNT_MAX_A = 30;
-        ARDUINO_ARRAY_ATTR_QUEUE_COUNT_T QUEUE_COUNT_A = 0;
-        ARDUINO_ARRAY_ATTR_QUEUE_PEEK_T QUEUE_PEEK_A ;
-        ARDUINO_ARRAY_ATTR_QUEUE_BACK_T QUEUE_BACK_A ;
-        ARDUINO_ARRAY_ATTR_QUEUE_FRONT_T QUEUE_FRONT_A;
-
-    Slave_Ports_Status_QUEUE_STATIC_ID_COUNTER( 
-                            QUEUE_COUNT_MAX_A, 
-                            QUEUE_COUNT_A, QUEUE_PEEK_A, 
-                            QUEUE_BACK_A , QUEUE_FRONT_A,
-                            ARDUINO_ARRAY_ATTR_QUEUE_ACTION_ADD | ARDUINO_ARRAY_ATTR_QUEUE_FRONT
-        );
-        
-        
-       
-        
-        
-        
-        
-        
-        
-        
-        
-}
-*//*
-ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_T QUEUE_COUNT_MAX_A = 30;
-        ARDUINO_ARRAY_ATTR_QUEUE_COUNT_T QUEUE_COUNT_A = 0;
-        ARDUINO_ARRAY_ATTR_QUEUE_PEEK_T QUEUE_PEEK_A ;
-        ARDUINO_ARRAY_ATTR_QUEUE_BACK_T QUEUE_BACK_A ;
-        ARDUINO_ARRAY_ATTR_QUEUE_FRONT_T QUEUE_FRONT_A;
-
-
- if(tested >15 and tested  <25 ) {
-            Serial.print("####666  stopniowe popowanie  #[");  Serial.print(tested); Serial.println("]  ");
-                    Slave_Ports_Status_QUEUE_STATIC_ID_COUNTER( 
-                                       QUEUE_COUNT_MAX_A, 
-                                       QUEUE_COUNT_A, QUEUE_PEEK_A, 
-                                       QUEUE_BACK_A , QUEUE_FRONT_A,
-                                       ARDUINO_ARRAY_ATTR_QUEUE_ACTION_ADD | ARDUINO_ARRAY_ATTR_QUEUE_BACK
-                   );
-        }
-        
-
-tested++;        
-//}
-*/
-   /* Adafruit_PWMServoDriver_0X40.setPWM(2, 1024, 2500);
-   Adafruit_PWMServoDriver_0X40.setPWM(3, 1024, 2500);
-   Adafruit_PWMServoDriver_0X40.setPWM(7, 1024, 2500);
-  
-   Adafruit_PWMServoDriver_0X40.setPWM(3, 50, 2500);
-   Adafruit_PWMServoDriver_0X40.setPWM(7, 50, 2500);
-
-
-*/
-/*
-Serial.print("#1111 Before set by Adafruit_PWMServoDriver_setPWM  pwm .. port 2: 500,1000 ["); 
- Adafruit_PWMServoDriver_init_I = Adafruit_PWMServoDriver_setPWM(Adafruit_PWMServoDriver_A, 
-        I2C_ADDRESS_AA, 2, 500, 1000);
-
-Serial.print("] afrer pwm .. port 3: 500,1000 [");
-Adafruit_PWMServoDriver_init_I = Adafruit_PWMServoDriver_setPWM(Adafruit_PWMServoDriver_A, 
-        I2C_ADDRESS_AA, 3, 500, 1000);
-Serial.print("] afrer pwm .. port 7: 500,1000 [");
-Adafruit_PWMServoDriver_init_I = Adafruit_PWMServoDriver_setPWM(Adafruit_PWMServoDriver_A, 
-        I2C_ADDRESS_AA, 7, 500, 1000);
-        
-Serial.print("#444C55 after set by Adafruit_PWMServoDriver_setPWM  with res ");
-Serial.println(Adafruit_PWMServoDriver_init_I);
-
- delay(1000); Serial.println("#10 pwm ports  2 3 and 7 set  low:  50 50");
- 
- Adafruit_PWMServoDriver_init_I = Adafruit_PWMServoDriver_setPWM(Adafruit_PWMServoDriver_A, 
-        I2C_ADDRESS_AA, 2, 50, 50);
-
-
-Adafruit_PWMServoDriver_init_I = Adafruit_PWMServoDriver_setPWM(Adafruit_PWMServoDriver_A, 
-        I2C_ADDRESS_AA, 3, 50, 50);
-
-Adafruit_PWMServoDriver_init_I = Adafruit_PWMServoDriver_setPWM(Adafruit_PWMServoDriver_A, 
-        I2C_ADDRESS_AA, 7, 50, 50);
-        */

+ 0 - 38
SE/stuff/P5_Automation_can-dev-res/___DEBUG/0x11/___DEBUG_DISABLE_SETUP__0x11.h

@@ -1,38 +0,0 @@
-/*
-int Adafruit_PWMServoDriver_init_I ;
-
-Serial.println("#444 . pwm config will");
-
- Adafruit_PWMServoDriver_init_I = Adafruit_PWMServoDriver_begin(Adafruit_PWMServoDriver_A, 
-            I2C_ADDRESS_AA);
-
-
-
-Serial.println("#444B after - pwm in loop be set");
-
-*/
-/*
-
-
- Serial.println("Adafruit_PWMServoDriver_A[0].setPWM(7, 50, 50)");
-Adafruit_PWMServoDriver_A[0].setPWM(7, 50, 50);
-delay(1000);
- Serial.println("Adafruit_PWMServoDriver_A[0].setPWM(7, 550, 550)");
-Adafruit_PWMServoDriver_A[0].setPWM(7, 550, 550);
-
-
-
-
-
-/*
-Adafruit_PWMServoDriver Adafruit_PWMServoDriver_BEGIN_F(I2C_ADDRESS_T I2C_ADDRESS_A) {
-    return *  Adafruit_PWMServoDriver->begin();
-}
-
-
-struct Adafruit_PWMServoDriver_BEGIN_S {
-        Adafruit_PWMServoDriver *Adafruit_PWMServoDriver_BEGIN_V ;
-    };
-
-typedef struct Adafruit_PWMServoDriver_BEGIN_S Adafruit_PWMServoDriver_BEGIN_T
-*/

+ 0 - 0
SE/stuff/P5_Automation_can-dev-res/___DEBUG/0x13/___DEBUG_DISABLE_INIT__0x13.h


+ 0 - 26
SE/stuff/P5_Automation_can-dev-res/___DEBUG/0x13/___DEBUG_DISABLE_LOOP__0x13.h

@@ -1,26 +0,0 @@
-/*
-
-
- Serial.println("Adafruit_PWMServoDriver_A[0].setPWM(7, 50, 50)");
-Adafruit_PWMServoDriver_A[0].setPWM(7, 50, 50);
-delay(1000);
- Serial.println("Adafruit_PWMServoDriver_A[0].setPWM(7, 550, 550)");
-Adafruit_PWMServoDriver_A[0].setPWM(7, 550, 550);
-
-
-
-
-
-/*
-Adafruit_PWMServoDriver Adafruit_PWMServoDriver_BEGIN_F(I2C_ADDRESS_T I2C_ADDRESS_A) {
-    return *  Adafruit_PWMServoDriver->begin();
-}
-
-
-struct Adafruit_PWMServoDriver_BEGIN_S {
-        Adafruit_PWMServoDriver *Adafruit_PWMServoDriver_BEGIN_V ;
-    };
-
-typedef struct Adafruit_PWMServoDriver_BEGIN_S Adafruit_PWMServoDriver_BEGIN_T
-*/
-

+ 0 - 25
SE/stuff/P5_Automation_can-dev-res/___DEBUG/0x13/___DEBUG_DISABLE_SETUP__0x13.h

@@ -1,25 +0,0 @@
-/*
-
-
- Serial.println("Adafruit_PWMServoDriver_A[0].setPWM(7, 50, 50)");
-Adafruit_PWMServoDriver_A[0].setPWM(7, 50, 50);
-delay(1000);
- Serial.println("Adafruit_PWMServoDriver_A[0].setPWM(7, 550, 550)");
-Adafruit_PWMServoDriver_A[0].setPWM(7, 550, 550);
-
-
-
-
-
-/*
-Adafruit_PWMServoDriver Adafruit_PWMServoDriver_BEGIN_F(I2C_ADDRESS_T I2C_ADDRESS_A) {
-    return *  Adafruit_PWMServoDriver->begin();
-}
-
-
-struct Adafruit_PWMServoDriver_BEGIN_S {
-        Adafruit_PWMServoDriver *Adafruit_PWMServoDriver_BEGIN_V ;
-    };
-
-typedef struct Adafruit_PWMServoDriver_BEGIN_S Adafruit_PWMServoDriver_BEGIN_T
-*/

+ 0 - 13
SE/stuff/P5_Automation_can-dev-res/___DEBUG/___DEBUG_DISABLE_INIT.h

@@ -1,13 +0,0 @@
-
-
-
-
-#if Active_ControllerID == 0x101 
-     #include "0x101/___DEBUG_DISABLE_INIT__0x101.h"
-#endif
-
-
-#if Active_ControllerID == 0x103 
-    #include "0x103/___DEBUG_DISABLE_INIT__0x103.h" 
-#endif
-

+ 0 - 24
SE/stuff/P5_Automation_can-dev-res/___DEBUG/___DEBUG_DISABLE_LOOP.h

@@ -1,24 +0,0 @@
-
-//register ARDUINO_STATE_T LED_BUILTIN_STATE_A  = false ;
-
-
-/*
-if(time % 1000) {
-    Serial.print("time: ["); Serial.print(time) ; Serial.println("] "); 
-  //  LED_BUILTIN_STATE_A = !LED_BUILTIN_STATE_A ;
-  //  digitalWrite(LED_BUILTIN, LED_BUILTIN_STATE_A);   // turn the LED on (HIGH is the voltage level)
-  
-  //digitalWrite(LED_BUILTIN, LED_BUILTIN_STATE);    // turn the LED off by making the voltage LOW
-   
-}
-*/
-
-#if Active_ControllerID == 0x101 
-     #include "0x101/___DEBUG_DISABLE_LOOP__0x101.h"
-#endif
-
-
-#if Active_ControllerID == 0x103 
-    #include "0x103/___DEBUG_DISABLE_LOOP__0x103.h" 
-#endif
-

+ 0 - 1
SE/stuff/P5_Automation_can-dev-res/___DEBUG/___DEBUG_DISABLE_LOOP_MAIN_A.h

@@ -1 +0,0 @@
- Serial.print("time: ["); Serial.print(time) ; Serial.println("] ");

+ 0 - 14
SE/stuff/P5_Automation_can-dev-res/___DEBUG/___DEBUG_DISABLE_SETUP.h

@@ -1,14 +0,0 @@
-
-
- pinMode(LED_BUILTIN, OUTPUT);
-
-
-#if Active_ControllerID == 0x101 
-     #include "0x101/___DEBUG_DISABLE_SETUP__0x101.h"
-#endif
-
-
-#if Active_ControllerID == 0x103 
-    #include "0x103/___DEBUG_DISABLE_SETUP__0x103.h" 
-#endif
-

+ 0 - 8
SE/stuff/P5_Automation_can-dev-res/___loop/_ControllerID_loop1.h

@@ -1,8 +0,0 @@
-// send data:  ID = 0x100, Standard CAN Frame, Data length = 8 bytes, 'data' = array of data bytes to send
-          //byte sndStat = CAN0.sendMsgBuf(0x100, 0, 8, data);
-         
-          
-          
-     
-          
-        

+ 0 - 42
SE/stuff/P5_Automation_can-dev-res/___loop/_LOOP_LATENCY_COUNTER.h

@@ -1,42 +0,0 @@
-  ARDUINO_LOOP_LATENCY_T ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END( ARDUINO_LOOP_LATENCY_T 
-                        ARDUINO_LOOP_LATENCY__MAIN_END_A, 
-                    ARDUINO_LOOP_LATENCY_CONTROL_FLAG_T ARDUINO_LOOP_LATENCY_CONTROL_FLAG_A
-                        )  {
-                    static ARDUINO_LOOP_LATENCY_COUNTER_T  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A = ARDUINO_LOOP_LATENCY__MAIN_END_A;
-                    if(ARDUINO_LOOP_LATENCY_CONTROL_FLAG_A == ARDUINO_LOOP_LATENCY_CONTROL_FLAG_BYPASS) {
-                       ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A =  ARDUINO_LOOP_LATENCY_COUNTER_INIT ;
-                       #if defined(DEBUG)
-                                  Serial.print("] ARDUINO_LOOP_LATENCY_CONTROL_FLAG_BYPASS["); 
-                          #endif
-                    } else {
-                            if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A == 0 ) {
-                                ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A = ARDUINO_LOOP_LATENCY__MAIN_END_A;
-                                  #if defined(DEBUG)
-                                  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("] ");
-                                  #endif
-                            } else {
-                                return ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A-- ;
-                            }
-                    }
-                }
-                
-                                
-                                
-                                
-                                
-                                
-                                
-                                
-                ARDUINO_LOOP_LATENCY_T ARDUINO_LOOP_LATENCY_COUNTER__MAIN( ARDUINO_LOOP_LATENCY_T 
-                        ARDUINO_LOOP_LATENCY__MAIN_A)  {
-                    static ARDUINO_LOOP_LATENCY_COUNTER_T  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A = ARDUINO_LOOP_LATENCY__MAIN_A;
-                    
-                    if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A == 0 ) {
-                         #if defined(DEBUG)
-                         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("] ");
-                         #endif 
-                        ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A = ARDUINO_LOOP_LATENCY__MAIN_A;
-                    } else {
-                        return ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A-- ;
-                    }
-                }

+ 0 - 44
SE/stuff/P5_Automation_can-dev-res/___loop/_SlaveID_loop1.h

@@ -1,44 +0,0 @@
-if(!digitalRead(CAN_INTpin))                    // If pin 2 is low, read receive buffer
-          {
-         CAN_READ(
-         Slave_Ports_Status_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_T_TO_DELETE_A,
-                  Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-               DISPLAY_A , DISPLAY_T_ARDUINO_ATTR_ARRAY_A, 
-               time
-         );
-       /*  
-         
-            CAN0.readMsgBuf(&CANrxId, &CANlen, CANrxBuf); // Read data: len = data length, buf = data byte(s)
-            Serial.print("#4444 read ID: ");
-            Serial.print(CANrxId, HEX);
-            Serial.print(" Data: ");
-           
-            for(int i = 0; i<CANlen; i++)           // Print each byte of the data
-            {
-              if(CANrxBuf[i] < 0x10)                // If data byte is less than 0x10, add a leading zero
-              {
-                Serial.print("0");
-         
-              }
-              Serial.print(CANrxBuf[i], HEX);
-              Serial.print(" ");
-          
-               
-            }
-            Serial.println();
-
-
-*/
-         
-
-
-
-
-
-
-            
-          }
-  

+ 0 - 24
SE/stuff/P5_Automation_can-dev-res/___loop/___loop_init.h

@@ -1,24 +0,0 @@
-
-
-//register ARDUINO_LOOP_LATENCY_COUNTER_T  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A = 0 ;// = ARDUINO_LOOP_LATENCY_COUNTER_INIT ; //WILL decrement
-//register ARDUINO_LOOP_LATENCY_COUNTER_T  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A = ARDUINO_LOOP_LATENCY_COUNTER_INIT ; //WILL DECREMENT
-
-
-
-
-
-    static ARDUINO_LOOP_LATENCY_T      ARDUINO_LOOP_LATENCY__MAIN_A = 250 ; //EVERY 10 LOOPS INIT THIS LATENCY
-    static ARDUINO_LOOP_LATENCY_T     ARDUINO_LOOP_LATENCY__MAIN_END_A = 500 ; //EVERY 10 LOOPS INIT THIS LATENCY
-
-
-
-
-
-register ARDUINO_FUNCT_INIT_RESULT_T ARDUINO_LOOP_INITIALIZED_A = 0;
-
-
-
-static ARDUINO_ARRAY_time_min_run_MIN_T TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A = TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A_INCREMENT_A ;
-
-static ARDUINO_ARRAY_time_min_run_MIN_T TASK_TYPE_T_Slave_Ports_set_I2C______time_min_run_MIN_A = TASK_TYPE_T_Slave_Ports_set_I2C______time_min_run_MIN_A_INCREMENT_A  ;
-

+ 0 - 78
SE/stuff/P5_Automation_can-dev-res/___loop/__main_loop_end.h

@@ -1,78 +0,0 @@
-
-//static ARDUINO_LOOP_LATENCY_T     ARDUINO_LOOP_LATENCY__MAIN_END_A = 10000 ; //EVERY 10 LOOPS INIT THIS LATENCY
-
-
-if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END(ARDUINO_LOOP_LATENCY__MAIN_END_A, ARDUINO_LOOP_LATENCY_CONTROL_FLAG_NONE ) <= ARDUINO_LOOP_LATENCY_COUNTER_INIT )  {
-           
-             #if defined(DISABLE_LOOP) ||  defined(DEBUG)
-                if(DEBUG_ACTION_TRIG != DEBUG_LAST_ACTION_TRIG) { 
-                 Serial.print("#4 main_loop_end  will    _Slave_Ports_queue__list"); 
-                 }
-             #endif  
-            
-            #ifndef DISABLE_LOOP
-             #if defined(DEBUG_ACTION_TRIG_ENABLED)
-               Serial.print("#11534   DEBUG_ACTION_TRIG[");Serial.print(DEBUG_ACTION_TRIG);
-             #endif
-      //  Serial.print("] COUNTER__MAIN_A["); Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A);
-       
-            #if defined(DEBUG_QUEUE)
-             _Slave_Ports_queue__list(Slave_Ports_Status_QUEUE_A,Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A) ;
-             #endif 
-            /*  int _Slave_Ports_queue_count = _Slave_Ports_queue.count();
-              int _Slave_Ports_queue_front = _Slave_Ports_queue.front();
-              int _Slave_Ports_queue_back =  _Slave_Ports_queue.back();
-              int _Slave_Ports_queue_peek = _Slave_Ports_queue.peek();
-              int _Slave_Ports_queue_pop = _Slave_Ports_queue.pop();
-              */
-              #if defined(DISABLE_LOOP) || defined(DEBUG)
-                if(DEBUG_ACTION_TRIG != DEBUG_LAST_ACTION_TRIG)   {
-                    Serial.print("#14 main_loop_end  ");  
-                     //Serial.print(_Slave_Ports_queue_count); 
-                     Serial.println("] ");
-                 }
-               #endif
-             _Slave_Ports_queue__POP(
-                     Slave_Ports_Status_QUEUE_A, 
-                     Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                   /* GARBAGE_TO_REMOVE_ASSOC_EMPTY , //_Slave_Ports_queue_count, 
-                    GARBAGE_TO_REMOVE_ASSOC_EMPTY , //_Slave_Ports_queue_pop, 
-                    GARBAGE_TO_REMOVE_ASSOC_EMPTY , //_Slave_Ports_queue_front, 
-                    GARBAGE_TO_REMOVE_ASSOC_EMPTY, //_Slave_Ports_queue_back,
-                    GARBAGE_TO_REMOVE_ASSOC_EMPTY,// _Slave_Ports_queue_peek,
-                   */
-                    LCDtim, 
-                    
-                            Slave_Ports_Status_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_T_TO_DELETE_A,
-                             Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A
-                             ,
-                              DISPLAY_A , 
-                              DISPLAY_T_ARDUINO_ATTR_ARRAY_A,
-                              DISPLAY_PHYSICAL_CHAR_A,
-                               Adafruit_PWMServoDriver_A, time
-             );
-             
-            #endif 
- 
- 
- }
- 
- /*
-if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A <= ARDUINO_LOOP_LATENCY_COUNTER_INIT )  {
-    #ifndef DISABLE_LOOP
-     if(DEBUG_ACTION_TRIG != DEBUG_LAST_ACTION_TRIG) {  
-        Serial.print("#39  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A");   Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A); Serial.println("] ");
-     }
-    #endif
-    ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A = ARDUINO_LOOP_LATENCY__MAIN_END_A ;
-     
-} else {
-    ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A ++ ;
-}
-*/
-  //_LCD_print_buffors_list(_LCD_print_buffors) ;
-  //_LCD_print_screens_list(_LCD_print_screens);
-  

+ 0 - 115
SE/stuff/P5_Automation_can-dev-res/___loop/__main_loop_top.h

@@ -1,115 +0,0 @@
-
-
-//ARDUINO_FUNCT_INIT_RESULT_T ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add ;
-
-if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN(ARDUINO_LOOP_LATENCY__MAIN_A) <= ARDUINO_LOOP_LATENCY_COUNTER_INIT ) {        
-//if(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A <= ARDUINO_LOOP_LATENCY_COUNTER_INIT ) {
-
-            // Serial.print("] COUNTER__MAIN_END_A["); Serial.print(ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END(ARDUINO_LOOP_LATENCY__MAIN_END_A));  Serial.println("] ");
-            if(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init == true ){
-                        #ifndef DISABLE_LOOP
-                            #ifdef DEBUG
-                                if(DEBUG_ACTION_TRIG != DEBUG_LAST_ACTION_TRIG)  {
-                                     Serial.println(" ");
-                                    Serial.print("#331__BBB main loop top bypassed  ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init  ");
-                                    Serial.print(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
-                                    Serial.println("]");
-                                    }
-                             #endif
-                         #endif
-                    }  else { 
-                             #ifdef DEBUG
-                             DEBUG_ACTION_TRIG ++;
-                              if(DEBUG_ACTION_TRIG != DEBUG_LAST_ACTION_TRIG)  {
-                                 Serial.print("#331___ccc main loop top ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init=[");
-                                 Serial.print(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
-                                 Serial.println("]");
-                                 }
-                             #endif
-                             ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init = 
-                                     _Slave_Ports_LOCAL_init(
-                                             Slave_Ports_Status_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_T_TO_DELETE_A,
-                                                                Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                                             DISPLAY_A , DISPLAY_T_ARDUINO_ATTR_ARRAY_A ,
-                                             time, 0
-                                             //, DISPLAY_PHYSICAL_CHAR_A
-                                        );
-                                        
-                                         #ifdef DEBUG
-                                          if(DEBUG_ACTION_TRIG != DEBUG_LAST_ACTION_TRIG)  {
-                                            Serial.print("#331_AAA main loop top   ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init  ");
-                                            Serial.println(ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init);
-                                            }
-                                          #endif
-                                //test
-                                  #if defined(DISPLAY_array16_T_is_DISPLAY_string_T)
-                                    #else
-                            //    DISPLAY__print_loop(0,8,"t1234567890", 11 , DISPLAY__print_loop_ACTION_ADD);
-                                  #endif
-                                
-                                
-                                        
-                        }
-            
-            
-            
-            if(ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add == true) {
-               #ifndef DISABLE_LOOP
-                #if defined(DEBUG)
-                if(DEBUG_ACTION_TRIG != DEBUG_LAST_ACTION_TRIG) {
-                     Serial.println(" ");
-                    Serial.print("#75 main loop top bypassed  ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add=[");
-                    Serial.print(ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add);
-                    Serial.println("]");
-                    }
-               #endif
-              #endif
-            } else {
-                 #if defined(DEBUG)
-                 DEBUG_ACTION_TRIG ++;
-                 if(DEBUG_ACTION_TRIG != DEBUG_LAST_ACTION_TRIG) {
-                    Serial.println(" ");
-                    Serial.print("#777 main loop top ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add=[");
-                    Serial.print(ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add);
-                    Serial.println("]");
-                    }
-                 #endif
-            ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add = _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-             TASK_TYPE_T_Slave_Ports_broadcast____ ,TASK_PORT_ASSOC_EMPTY ,time, time , ARDUINO_ARRAY_INDEX_NOT_SET ) ;  //        "_Slave_Ports_broadcast", //4
-            ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add = _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,  // + ARDUINO_time_seq_id_A_INCREMENT 
-             TASK_TYPE_T_Slave_Ports_set_I2C______ ,TASK_PORT_ASSOC_EMPTY ,time, time, ARDUINO_ARRAY_INDEX_NOT_SET) ;  //"_Slave_Ports_set_I2C" //5  - to set ports associated on PW
-            //ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add = _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A,   Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A , TASK_TYPE_T_DISPLAY_queue_pop________ ,TASK_PORT_ASSOC_EMPTY ,millis(), millis() + ARDUINO_time_seq_id_A_INCREMENT , ) ;  //"_Slave_Ports_set_I2C" //5  - to set ports associated on PW
-            }
-            
-            #if defined(DISPLAY_array16_T_is_DISPLAY_string_T)
-            #else
-          //  DISPLAY__print_loop(0,7,"", 0 , DISPLAY__print_loop_ACTION_POP);
-            #endif
-            
-            if(time > TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A) {
-                    #if defined(DEBUG)
-                        Serial.print("[ #777 time > TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A][");Serial.print(TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A);Serial.print(print_SEP_RT);
-                        Serial.print("time[");Serial.print(time);Serial.print(print_SEP_RT);
-                    #endif 
-                TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A = time + TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A_INCREMENT_A ;
-                    ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add = _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                     TASK_TYPE_T_Slave_Ports_broadcast____ ,TASK_PORT_ASSOC_EMPTY ,time, time  , ARDUINO_ARRAY_INDEX_NOT_SET ) ;  //        "_Slave_Ports_broadcast", //4
-            
-            }
-            
-            if(time > TASK_TYPE_T_Slave_Ports_set_I2C______time_min_run_MIN_A) {
-                #if defined(DEBUG)
-                        Serial.print(" [ #104 time > TASK_TYPE_T_Slave_Ports_set_I2C______time_min_run_MIN_A][");Serial.print(TASK_TYPE_T_Slave_Ports_set_I2C______time_min_run_MIN_A);Serial.print(print_SEP_RT);
-                        Serial.print("time[");Serial.print(time);Serial.print(print_SEP_RT);
-                    #endif 
-                TASK_TYPE_T_Slave_Ports_set_I2C______time_min_run_MIN_A = time + TASK_TYPE_T_Slave_Ports_set_I2C______time_min_run_MIN_A_INCREMENT_A  ;
-                ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add = _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                     TASK_TYPE_T_Slave_Ports_set_I2C______  ,TASK_PORT_ASSOC_EMPTY ,time, time  , ARDUINO_ARRAY_INDEX_NOT_SET ) ;  //        "_Slave_Ports_broadcast", //4
-            }
-            
-
-
-}

+ 0 - 6
SE/stuff/P5_Automation_can-dev-res/___main/__main_I2C_setup.h

@@ -1,6 +0,0 @@
-
-
-
-ARDUINO_ARRAY_INDEX_TABLE_S__init(I2C_ARRAY_INDEX_TABLE_A,I2C_ARDUINO_ATTR_ARRAY_A,ARDUINO_ARRAY_INDEX_LIMIT_PORTS_I2C,ARDUINO_QUEUE_FLAG_CANNOT_OVERWRITE);
-
-ARDUINO_ARRAY_INDEX_TABLE_S__add_void(I2C_ARRAY_INDEX_TABLE_A,I2C_ARDUINO_ATTR_ARRAY_A,I2C_ADDRESS_0x40);

+ 0 - 75
SE/stuff/P5_Automation_can-dev-res/___main/__main_I2C_struc.h

@@ -1,75 +0,0 @@
-
-typedef int I2C_ADDRESS ;
-typedef int I2C_ADDRESS_T ;
-
-
-
-typedef ARDUINO_ARRAY_INDEX_DRIVER_T I2C_INDEX_DRIVER_T; 
-
-
-
-const I2C_ADDRESS_T  I2C_ADDRESS_0x40  = 0x40 ;
-const I2C_ADDRESS_T  I2C_ADDRESS_0x41  = 0x41 ;
-const I2C_ADDRESS_T  I2C_ADDRESS_0x42  = 0x42 ;
-const I2C_ADDRESS_T  I2C_ADDRESS_0x43  = 0x43 ;
-const I2C_ADDRESS_T  I2C_ADDRESS_0x44  = 0x44 ; 
-
-
-//static ARDUINO_ARRAY_INDEX_T ARDUINO_ARRAY_INDEX_T;
-
-
-
-struct I2C_ARRAY_DRIVER_S {
-    I2C_ADDRESS_T I2C_ADDRESS_A;
-   // ARDUINO_ARRAY_DRIVER_T;
-   ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T ARDUINO_ARRAY_INDEX_DRIVER_STATUS_A ;
-};
-
-typedef I2C_ARRAY_DRIVER_S I2C_ARRAY_DRIVER_T ;
-
-typedef struct ARDUINO_ATTR_ARRAY_S I2C_ARDUINO_ATTR_ARRAY_T;
-
-static ARDUINO_ARRAY_INDEX_TABLE_T I2C_ARRAY_INDEX_TABLE_A[ARDUINO_ARRAY_INDEX_LIMIT_PORTS_I2C] = {} ; //TO KEEP INDEXES 
-
-static I2C_ARDUINO_ATTR_ARRAY_T  I2C_ARDUINO_ATTR_ARRAY_A = {} ;
-/*
-static I2C_ARDUINO_ATTR_ARRAY_T  I2C_ARDUINO_ATTR_ARRAY_A =  //[ARDUINO_ATTR_ARRAY_S_INDEX] 
-        {    ARDUINO_ARRAY_INDEX_CURRENT_INIT ,
-             ARDUINO_ARRAY_INDEX_LAST_INIT ,
-             ARDUINO_ARRAY_COUNT_T_INIT ,
-             ARDUINO_ARRAY_INDEX_LIMIT_PORTS , 
-             ARDUINO_ARRAY_INDEX_NEXT_INIT,
-             ARDUINO_ARRAY_time_min_run_MIN_INIT,
-             ARDUINO_ARRAY_INDEX_time_min_run_MIN_INIT  
-              }
-    ;
-*/
-//struct ARDUINO_ARRAY_INDEX_T I2C_INDEX_DRIVER_T ; //DO NP INDEX GDIZE JEST ZAINCJALIZOWANY JAKIS HANDLER  Adafruit_PWMServoDriver_A[i].I2C_ADDRESS_A ...
- 
-static  I2C_ARRAY_DRIVER_T  I2C_ARRAY_DRIVER_A[5]={} ; //
-
-
-//I2C_ARRAY_INDEX_TABLE_A__init = 
-//ARDUINO_ARRAY_INDEX_TABLE_S__init(I2C_ARRAY_INDEX_TABLE_A,I2C_ARDUINO_ATTR_ARRAY_A,ARDUINO_ARRAY_INDEX_LIMIT_PORTS_I2C);
-
-//ARDUINO_ARRAY_INDEX_TABLE_S__add_void(I2C_ARRAY_INDEX_TABLE_A,I2C_ARDUINO_ATTR_ARRAY_A,I2C_ADDRESS_0x40);
-
-
-
-//ARDUINO_ARRAY_INDEX_TABLE_S__add_void(I2C_ARRAY_INDEX_A,I2C_ARDUINO_ATTR_ARRAY_A,I2C_ADDRESS_0x40);
-
-         /*
-void I2C_INDEX_DRIVER__add(I2C_INDEX_DRIVER_T*  I2C_INDEX_DRIVER_A, I2C_ARDUINO_ATTR_ARRAY_T  &I2C_ARDUINO_ATTR_ARRAY_A) {
-        I2C_INDEX_DRIVER_A[1].I2C_ADDRESS_A = I2C_ADDRESS_0x40 ;
-        I2C_INDEX_DRIVER_A[2].ARDUINO_ARRAY_INDEX_DRIVER_STATUS_T = ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_INIT_A ;
-};
-*/
-/*
-I2C_INDEX_DRIVER_A[1] = { //todo dynamic
-        I2C_ADDRESS_0x40 , //I2C_ADDRESS_T I2C_ADDRESS_A;
-        ARDUINO_ARRAY_INDEX_DRIVER_STATUS_TO_INIT_A //ARDUINO_ARRAY_DRIVER_T;
-    };
-*/
-
-
-

+ 0 - 15
SE/stuff/P5_Automation_can-dev-res/___main/__main_auto.h

@@ -1,15 +0,0 @@
-
-
-
-
-//auto int degrees;
-
-
-
-
-
-// ARDUINO_ARRAY_INDEX_DRIVER_T ARDUINO_ARRAY_INDEX_DRIVER_A = NULL ; //global 
-
-// ARDUINO_ARRAY_INDEX_T I2C_INDEX_DRIVER_A ;
-
-

+ 0 - 42
SE/stuff/P5_Automation_can-dev-res/___main/__main_extern.h

@@ -1,42 +0,0 @@
-/*
-The extern Storage Class
-The extern storage class is used to give a reference of a global variable that is visible to ALL 
-the program files. When you use 'extern', the variable cannot be initialized however, 
-it points the variable name at a storage location that has been previously defined.
-
-When you have multiple files and you define a global variable or function, which will also be used in
- other files, then extern will be used in another file to provide the reference of defined variable
-  or function.  Just for understanding, extern is used to declare a global variable or 
-  function in another file.
-
-The extern modifier is most commonly used when there are two or more files sharing the same global 
-variables or functions as explained below.
-
-First File: main.c
-
-#include <stdio.h>
- 
-int count ;
-extern void write_extern();
- 
-main() {
-   count = 5;
-   write_extern();
-}
-Second File: support.c
-
-#include <stdio.h>
- 
-extern int count;
- 
-void write_extern(void) {
-   printf("count is %d\n", count);
-}
-Here, extern is being used to declare count in the second file, where as it has its definition in the first 
-file, main.c. Now, compile these two files as follows −
-
-$gcc main.c support.c
-It will produce the executable program a.out. When this program is executed, it produces the following result −
-
-count is 5
-*/

+ 0 - 19
SE/stuff/P5_Automation_can-dev-res/___main/__main_init.h

@@ -1,19 +0,0 @@
-
-
-
-ARDUINO_FUNCT_INIT_RESULT_T ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add ;
-ARDUINO_FUNCT_INIT_RESULT_T ARDUINO_FUNCT_INIT_RESULT__Slave_Ports_LOCAL_init ;
-
-
-
-
-
-/*
-ARDUINO_LOOP_LATENCY_T      ARDUINO_LOOP_LATENCY__MAIN_A = 100 ; //EVERY 10 LOOPS INIT THIS LATENCY
-ARDUINO_LOOP_LATENCY_COUNTER_T  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A = 0 ;// = ARDUINO_LOOP_LATENCY_COUNTER_INIT ; //WILL decrement
-
-
-
-
-ARDUINO_LOOP_LATENCY_T     ARDUINO_LOOP_LATENCY__MAIN_END_A = 100 ; //EVERY 10 LOOPS INIT THIS LATENCY
-ARDUINO_LOOP_LATENCY_COUNTER_T  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A = ARDUINO_LOOP_LATENCY_COUNTER_INIT ; //WILL DECREMENT*/

+ 0 - 40
SE/stuff/P5_Automation_can-dev-res/___main/__main_register.h

@@ -1,40 +0,0 @@
-/*
-
-The register Storage Class
-The register storage class is used to define local variables that should be stored 
-in a register instead of RAM.
- This means that the variable has a maximum size equal to the register 
- size (usually one word) and can't have the unary '&' operator applied to it 
- (as it does not have a memory location).
-
-{
-   register int  miles;
-}
-The register should only be used for variables that require quick access 
-such as counters. It should also be noted that defining 'register' 
-does not mean that the variable will be stored in a register. 
-It means that it MIGHT be stored in a register depending on hardware and 
-implementation restrictions.
-
-*/
-
-
-/*
-A register variable cannot be used as a "global" variable, 
-because file scope variables have static storage, 
-thus by definition they have an address. register variables are exactly the contrary, 
-that are variables for which you, the programmer, promise to never take their address.
- So combining the two makes not much sense.
-
-BTW, the error message that you get is not very helpful. 
-It seems that your compiler is referring to an extension that allows to fix 
-a register variable to a particular hardware register. If you post such an error 
-message please also give an indication which compiler and/or platform you are using.
-*/
-
-
-//register ARDUINO_LOOP_LATENCY_T       
-//register ARDUINO_LOOP_LATENCY__MAIN_A  ; //EVERY 10 LOOPS INIT THIS LATENCY
-//register ARDUINO_LOOP_LATENCY_T          ARDUINO_LOOP_LATENCY__MAIN_END_A  ; //EVERY 10 LOOPS INIT THIS LATENCY
-//register ARDUINO_LOOP_LATENCY_COUNTER_T  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A ;
-//register ARDUINO_LOOP_LATENCY_COUNTER_T  ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A = NULL ; //WILL decrement

+ 0 - 28
SE/stuff/P5_Automation_can-dev-res/___main/__main_setup.h

@@ -1,28 +0,0 @@
-//__main_setup.h
-//_Slave_Ports_queue.push(_LCD_print_queue.peek() + 1);
- Serial.println("#298 _Slave_Ports_queue__list");
- _Slave_Ports_queue__INIT(Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A);
-_Slave_Ports_queue__list(Slave_Ports_Status_QUEUE_A , Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A);
-  int _Slave_Ports_queue_peek =  _Slave_Ports_queue.peek() ;
-//  int _Slave_Ports_queue_push = _Slave_Ports_queue.push(_Slave_Ports_queue.peek() + 1) ; 
-  //int _Slave_Ports_queue_peek_new = _Slave_Ports_queue.peek() ; _Slave_Ports_queue__add(  *Slave_Ports_Status_QUEUE_A, 0x01 ,0x00 ,100, 5000 ) ;  // _Slave_Ports_queue_peek, _Slave_Ports_queue.push(_Slave_Ports_queue.peek() + 1), _Slave_Ports_queue.peek());
- 
- //  _Slave_Ports_queue_peek =  _Slave_Ports_queue.peek() ; 
-   //_Slave_Ports_queue_push =  _Slave_Ports_queue.push(_Slave_Ports_queue.peek() + 1) ;  
-   //_Slave_Ports_queue_peek_new = _Slave_Ports_queue.peek() ; 
-//_Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A, 0x02 ,0x00 ,100, 5000, _Slave_Ports_queue_peek, _Slave_Ports_queue.push(_Slave_Ports_queue.peek() + 1), _Slave_Ports_queue.peek());
-//   _Slave_Ports_queue_peek =  _Slave_Ports_queue.peek() ; 
-   //_Slave_Ports_queue_push =  _Slave_Ports_queue.push(_Slave_Ports_queue.peek() + 1) ; 
-  // _Slave_Ports_queue_peek_new = _Slave_Ports_queue.peek() ; 
-//_Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A, 0x03 ,0x00 ,100, 5000, _Slave_Ports_queue_peek, 
-//_Slave_Ports_queue.push(_Slave_Ports_queue.peek() + 1),
-//_Slave_Ports_queue.peek());
-
- Serial.println("#301 _Slave_Ports_queue__list");
-_Slave_Ports_queue__list(Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A);
-Serial.print("#304 _Slave_Ports_queue.count(), "); Serial.println(_Slave_Ports_queue.count());
-  
-   
- //  _Slave_Ports_queue__add(  Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A , 0x03 ,0x00 ,100, 5000 ) ;  
- //Serial.println("#323 _Slave_Ports_queue__list"); _Slave_Ports_queue__list(Slave_Ports_Status_QUEUE_A);
-// Serial.print("#324 _Slave_Ports_queue.count(), "); Serial.println(_Slave_Ports_queue.count());

+ 0 - 22
SE/stuff/P5_Automation_can-dev-res/___main/__main_static.h

@@ -1,22 +0,0 @@
-/*
-
-
-The static Storage Class
-The static storage class instructs the compiler to keep a local variable
- in existence during the life-time of the program instead of creating and 
- destroying it each time it comes into and goes out of scope. Therefore, 
- making local variables static allows them to maintain their values between 
- function calls.
-
-The static modifier may also be applied to global variables. When this is done, 
-it causes that variable's scope to be restricted to the file in which it is declared.
-
-In C programming, when static is used on a global variable, it causes only one 
-copy of that member to be shared by all the objects of its class.
-
-*/
-
-
-
-static ARDUINO_ARRAY_time_min_run_MIN_T  ARDUINO_ARRAY_time_min_run_MIN_A; 
-

+ 0 - 293
SE/stuff/P5_Automation_can-dev-res/___main/__main_struct.h

@@ -1,293 +0,0 @@
-/*
-
-https://www.tutorialspoint.com/cprogramming/c_storage_classes.htm
-
-A storage class defines the scope (visibility) and life-time of variables and/or functions within a C Program. They precede the type that they modify. We have four different storage classes in a C program −
-
-auto
-register
-static
-extern
-
-
-
-The auto Storage Class
-The auto storage class is the default storage class for all local variables.
-
-{
-   int mount;
-   auto int month;
-}
-The example above defines two variables with in the same storage class.
- 'auto' can only be used within functions, i.e., local variables.
-
-*/
-
-
-//GLOBAL TYPES
-typedef int GARBAGE_TO_REMOVE_ASSOC_T ; //Old not usable pointer to remove
-const GARBAGE_TO_REMOVE_ASSOC_T GARBAGE_TO_REMOVE_ASSOC_EMPTY = 0 ;
-
-typedef byte ARDUINO_OPTIONS_T ; 
-
-typedef int  ARDUINO_SIZE_T ; //for display etc
-
-
-typedef boolean  ARDUINO_STATE_T ; //for states of ports etc
-
-
-//EOF GLOBAL TYPES
-
-typedef ARDUINO_SIZE_T  ARDUINO_SIZE_MIN_T ; //for display etc
-typedef ARDUINO_SIZE_T  ARDUINO_SIZE_MAX_T ; //for display etc
-typedef int ARDUINO_FUNC_STATIC_ID_COUNTER_T ;   //for static function couter
-
-
-
-
-const ARDUINO_FUNC_STATIC_ID_COUNTER_T ARDUINO_FUNC_STATIC_ID_COUNTER_INIT = 0 ;
-
-typedef int ARDUINO_LOOP_LATENCY_T;
-typedef int ARDUINO_LOOP_LATENCY_COUNTER_T; //WILL increment
-const ARDUINO_LOOP_LATENCY_COUNTER_T ARDUINO_LOOP_LATENCY_COUNTER_INIT = 1 ; //
-typedef ARDUINO_LOOP_LATENCY_T  ARDUINO_LOOP_LATENCY_TASK_T; //to limit e.g. rottary button rapid transactions
-
-typedef byte ARDUINO_LOOP_LATENCY_CONTROL_FLAG_T ;
-const ARDUINO_LOOP_LATENCY_CONTROL_FLAG_T ARDUINO_LOOP_LATENCY_CONTROL_FLAG_NONE   = B00000000 ;
-const ARDUINO_LOOP_LATENCY_CONTROL_FLAG_T ARDUINO_LOOP_LATENCY_CONTROL_FLAG_BYPASS = B00000001 ;
-
-typedef bool ARDUINO_FUNCT_INIT_RESULT_T ;
-
-typedef int ARDUINO_ARRAY_INDEX_T ; //for controll arrays behaviour
-typedef int ARDUINO_ARRAY_ATTR_T ; //for controll arrays behaviour
-
-typedef  int ARDUINO_ARRAY_PRIMARY_KET_T ; 
-
-typedef ARDUINO_ARRAY_ATTR_T ARDUINO_ARRAY_INDEX_CURRENT_T ; //porzadkowo do przegladania co jest biezacym pointerem
-typedef ARDUINO_ARRAY_ATTR_T ARDUINO_ARRAY_INDEX_LAST_T ; //porzadkowo co jest ostatnim elementem
-
-typedef ARDUINO_ARRAY_ATTR_T ARDUINO_ARRAY_INDEX_NEXT_T ; //porzadkowo co jest ostatnim elementem
-typedef ARDUINO_ARRAY_ATTR_T ARDUINO_ARRAY_COUNT_T ; //current count elements - porzadkowo
-
-typedef ARDUINO_ARRAY_ATTR_T  ARDUINO_ARRAY_INDEX_LIMIT_T ;
-
-typedef ARDUINO_ARRAY_INDEX_T ARDUINO_ARRAY_INDEX_TO_DELETE ; 
-
-typedef long ARDUINO_ARRAY_time_min_run_MIN_T ;
-
-typedef ARDUINO_ARRAY_ATTR_T ARDUINO_ARRAY_INDEX_time_min_run_MIN_T ; 
-
-
-
-
-//DO OBSLUGI KOLEJEK
-typedef ARDUINO_ARRAY_ATTR_T ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_T ;
-typedef ARDUINO_ARRAY_ATTR_T ARDUINO_ARRAY_ATTR_QUEUE_FRONT_T ;
-typedef ARDUINO_ARRAY_ATTR_T ARDUINO_ARRAY_ATTR_QUEUE_BACK_T ;
-typedef ARDUINO_ARRAY_ATTR_T ARDUINO_ARRAY_ATTR_QUEUE_COUNT_T ;
-typedef ARDUINO_ARRAY_ATTR_T ARDUINO_ARRAY_ATTR_QUEUE_PEEK_T ;
-
-
-
-struct ARDUINO_ARRAY_ATTR_QUEUE_S {
-    ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_T ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_A;
-    ARDUINO_ARRAY_ATTR_QUEUE_COUNT_T ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A ;
-    ARDUINO_ARRAY_ATTR_QUEUE_PEEK_T ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A ;
-    ARDUINO_ARRAY_ATTR_QUEUE_BACK_T ARDUINO_ARRAY_ATTR_QUEUE_BACK_A ;
-    ARDUINO_ARRAY_ATTR_QUEUE_FRONT_T ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A;
-};
-
-    
-    /*
-    typedef ARDUINO_OPTIONS_T ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_T; //     [#109 ELSE] 100100]
-    const ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_T ARDUINO_ARRAY_ATTR_QUEUE_ACTION_GET = B00000001 ;
-    const ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_T ARDUINO_ARRAY_ATTR_QUEUE_ACTION_SET = B00000010 ;
-    const ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_T ARDUINO_ARRAY_ATTR_QUEUE_ACTION_ADD = B00000100 ; //add back == pop
-    const ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_T ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX  = B00001000 ;
-    const ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_T ARDUINO_ARRAY_ATTR_QUEUE_COUNT      = B00010000 ;
-    const ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_T ARDUINO_ARRAY_ATTR_QUEUE_PEEK       = B00100000 ; //
-    const ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_T ARDUINO_ARRAY_ATTR_QUEUE_FRONT      = B01000000 ; //newest set+read(add)
-    const ARDUINO_ARRAY_ATTR_QUEUE_OPTIONS_T ARDUINO_ARRAY_ATTR_QUEUE_BACK       = B10000000 ;//add back == pop
-    
-    
-    */
- 
-typedef struct ARDUINO_ARRAY_ATTR_QUEUE_S ARDUINO_ARRAY_ATTR_QUEUE_T ;
-
-const ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_T ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_INIT = ARDUINO_FUNC_STATIC_ID_COUNTER_INIT ;
-const ARDUINO_ARRAY_ATTR_QUEUE_COUNT_T ARDUINO_ARRAY_ATTR_QUEUE_COUNT_INIT         = ARDUINO_FUNC_STATIC_ID_COUNTER_INIT ;
-const ARDUINO_ARRAY_ATTR_QUEUE_PEEK_T ARDUINO_ARRAY_ATTR_QUEUE_PEEK_INIT           = ARDUINO_FUNC_STATIC_ID_COUNTER_INIT ;
-const ARDUINO_ARRAY_ATTR_QUEUE_BACK_T ARDUINO_ARRAY_ATTR_QUEUE_BACK_INIT           = ARDUINO_FUNC_STATIC_ID_COUNTER_INIT ;
-const ARDUINO_ARRAY_ATTR_QUEUE_FRONT_T ARDUINO_ARRAY_ATTR_QUEUE_FRONT_INIT         = ARDUINO_FUNC_STATIC_ID_COUNTER_INIT ;
-
-
-
-
-
-
-typedef byte ARDUINO_QUEUE_FLAG_T  ;
-
-
-
-typedef ARDUINO_QUEUE_FLAG_T  ARDUINO_QUEUE_ELEMENT_FLAG_T ; //type to be inside array to control
-const ARDUINO_QUEUE_ELEMENT_FLAG_T ARDUINO_QUEUE_ELEMENT_FLAG_INITIAL_CORRUPT = B00000001 ; //type of empty initial array records
-const ARDUINO_QUEUE_ELEMENT_FLAG_T ARDUINO_QUEUE_ELEMENT_FLAG_COMIT_CONTEXT   = B00000010 ; //to handle this flag by functions - shows that is expected sturcture
-const ARDUINO_QUEUE_ELEMENT_FLAG_T ARDUINO_QUEUE_ELEMENT_FLAG_COMIT_LOCKED    = B00000100 ; //when locked commit
-const ARDUINO_QUEUE_ELEMENT_FLAG_T ARDUINO_QUEUE_ELEMENT_FLAG_STANDARD        = B00001000 ; //type of empty initial array records
-
-
-
-const ARDUINO_QUEUE_FLAG_T  ARDUINO_QUEUE_FLAG_INIT                      = B00000000 ;  //just to init
-const ARDUINO_QUEUE_FLAG_T  ARDUINO_QUEUE_FLAG_INITIALIZED               = B00000001 ;  //
-const ARDUINO_QUEUE_FLAG_T  ARDUINO_QUEUE_FLAG_RESTRICT_INDEX            = B00000010 ;  //no loose index changes
-const ARDUINO_QUEUE_FLAG_T  ARDUINO_QUEUE_FLAG_CAN_OVERWRITE             = B00000100 ; //data can be overwrited
-const ARDUINO_QUEUE_FLAG_T  ARDUINO_QUEUE_FLAG_USE_ELEMENT_FLAG_T        = B00001000 ; //delete order etc use ARDUINO_QUEUE_ELEMENT_FLAG_T in childs
-const ARDUINO_QUEUE_FLAG_T  ARDUINO_QUEUE_FLAG_CANNOT_OVERWRITE          = B00010000 ; //data can be overwrited
-const ARDUINO_QUEUE_FLAG_T  ARDUINO_QUEUE_FLAG_NOT_SPECIFIED             = B00100000 ; //not specified
-const ARDUINO_QUEUE_FLAG_T  ARDUINO_QUEUE_FLAG_QUEUE                     = B01000000 ; //USE ARDUINO_ARRAY_ATTR_QUEUE_BACK_A +  ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A + rotate
-const ARDUINO_QUEUE_FLAG_T  ARDUINO_QUEUE_FLAG_FULL_ONLY_POP             = B10000000 ; // WHEN QUEUE FULL - DISALLOW TO NEW RECORDS
-
-
-
-typedef  ARDUINO_OPTIONS_T ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_T; //do obslygi kluczy
-
-
-const ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_T ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_INIT      = B00000000 ; //initial state
-
-const ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_T ARDUINO_ARRAY_ATTR_INDEX__TO_INITIALIZE    = B00000000 ; //initial state
-const ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_T ARDUINO_ARRAY_ATTR_INDEX__INITIALIZED      = B00000001 ; //initial state
-const ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_T ARDUINO_ARRAY_ATTR_INDEX__TO_COMMIT        = B00000010 ; 
-const ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_T ARDUINO_ARRAY_ATTR_INDEX__TO_INCREMENT     = B00000100 ; 
-const ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_T ARDUINO_ARRAY_ATTR_INDEX__READY_TO_QUERY   = B00001000 ;
-const ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_T ARDUINO_ARRAY_ATTR_INDEX__INCREMENTED      = B00001000 ; //same as READY_TO_QUERY  
-const ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_T ARDUINO_ARRAY_ATTR_INDEX__LOCK             = B00010000 ;  //use  typedef ARDUINO_ARRAY_INDEX_NEXT_T ARDUINO_ARRAY_INDEX_NEXT_LOCK_A
-
-const ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_T ARDUINO_ARRAY_ATTR_INDEX__HAS_ERRORS       = B00100000 ; 
-
- typedef ARDUINO_ARRAY_INDEX_NEXT_T ARDUINO_ARRAY_INDEX_NEXT_LOCK_T ;
-
-
-struct ARDUINO_ATTR_ARRAY_S {
-    ARDUINO_ARRAY_INDEX_CURRENT_T ARDUINO_ARRAY_INDEX_CURRENT_A ;
-    ARDUINO_ARRAY_INDEX_LAST_T ARDUINO_ARRAY_INDEX_LAST_A ; //mzoe byc usabvle do pointerowania rejestru dalej
-    ARDUINO_ARRAY_COUNT_T ARDUINO_ARRAY_COUNT_A ;
-    ARDUINO_ARRAY_INDEX_LIMIT_T ARDUINO_ARRAY_INDEX_LIMIT_A;
-    ARDUINO_ARRAY_INDEX_NEXT_T ARDUINO_ARRAY_INDEX_NEXT_A ;
-    ARDUINO_ARRAY_time_min_run_MIN_T ARDUINO_ARRAY_time_min_run_MIN_A ;
-    ARDUINO_ARRAY_INDEX_time_min_run_MIN_T ARDUINO_ARRAY_INDEX_time_min_run_MIN_A ;
-    ARDUINO_QUEUE_FLAG_T ARDUINO_QUEUE_FLAG_A ;
-    ARDUINO_ARRAY_ATTR_QUEUE_BACK_T ARDUINO_ARRAY_ATTR_QUEUE_BACK_A ; //ostatni zabrany element
-    ARDUINO_ARRAY_ATTR_QUEUE_COUNT_T ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A ; //kolejka elementow
-    ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_T ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A ;
-    ARDUINO_ARRAY_ATTR_QUEUE_FRONT_T ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A ;
-    ARDUINO_ARRAY_ATTR_QUEUE_PEEK_T ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A; 
- 
-};
-
-typedef ARDUINO_ATTR_ARRAY_S ARDUINO_ATTR_ARRAY_T;
-
-struct ARDUINO_ARRAY_INDEX_T_TO_DELETE_S {
-    ARDUINO_ARRAY_INDEX_TO_DELETE ARDUINO_ARRAY_INDEX_TO_DELETE_A ;
-};
-
-struct ARDUINO_ARRAY_INDEX_TABLE_S { //to controll elements - like deletion etc
-      ARDUINO_ARRAY_INDEX_T ARDUINO_ARRAY_INDEX_A ;
-      //int ARDUINO_ARRAY_INDEX_A ;
-};
-
-typedef ARDUINO_ARRAY_INDEX_TABLE_S ARDUINO_ARRAY_INDEX_TABLE_T;
-
-struct ARDUINO_ARRAY_ASSOC_TABLE_S {  //to associate and cache
-   ARDUINO_ARRAY_INDEX_T ARDUINO_ARRAY_INDEX_A ; //indexed name of sth
-};
-
-struct ARDUINO_ARRAY_QUEUE_TABLE_S { //to controll elements - like deletion etc
-      ARDUINO_ARRAY_INDEX_T ARDUINO_ARRAY_INDEX_A ;
-      ARDUINO_QUEUE_FLAG_T ARDUINO_QUEUE_FLAG_T ;
-      //int ARDUINO_ARRAY_INDEX_A ;
-};
-
-typedef struct ARDUINO_ARRAY_QUEUE_TABLE_S ARDUINO_ARRAY_QUEUE_TABLE_T ;
-
-//typedef ARDUINO_ARRAY_ATTR_T ARDUINO_ARRAY_DRIVER
-
-
-
-
-
-
-const ARDUINO_ARRAY_INDEX_T  ARDUINO_ARRAY_INDEX_NOT_SET = 0  ; //for controll arrays behaviour
-const ARDUINO_ARRAY_INDEX_T  ARDUINO_ARRAY_INDEX_CORRUPT = 0  ; //for controll arrays behaviour
-const ARDUINO_ARRAY_INDEX_T  ARDUINO_ARRAY_INDEX_FIRST = 1  ; //for controll arrays behaviour
-
-const ARDUINO_ARRAY_COUNT_T ARDUINO_ARRAY_COUNT_T_INIT = 0 ; //current count elements - porzadkowo
-const ARDUINO_ARRAY_INDEX_CURRENT_T ARDUINO_ARRAY_INDEX_CURRENT_INIT = 0 ;  //
-const ARDUINO_ARRAY_INDEX_LAST_T ARDUINO_ARRAY_INDEX_LAST_INIT = 0 ;
-const ARDUINO_ARRAY_INDEX_NEXT_T ARDUINO_ARRAY_INDEX_NEXT_INIT = 1;
-
-const  ARDUINO_ARRAY_time_min_run_MIN_T ARDUINO_ARRAY_time_min_run_MIN_INIT = 0 ;
-const  ARDUINO_ARRAY_time_min_run_MIN_T ARDUINO_ARRAY_time_min_run_MIN_NOT_SET = 1 ;
-
-const  ARDUINO_ARRAY_INDEX_time_min_run_MIN_T ARDUINO_ARRAY_INDEX_time_min_run_MIN_INIT = 0 ;
-
-const int ARDUINO_time_seq_id_A_INCREMENT = 1000 ; 
-
-const ARDUINO_ARRAY_INDEX_T ARDUINO_ATTR_ARRAY_S_INDEX = ARDUINO_ARRAY_INDEX_FIRST ;
-
-//const ARDUINO_FUNCT_INIT_RESULT_T ARDUINO_FUNCT_INIT_RESULT_T_
-
-//#define membersof(x) (sizeof(x) / sizeof(x[0]))
-
- #define BLACK   0x0000
-  #define BLUE    0x001F
-  #define RED     0xF800
-  #define GREEN   0x07E0
-  #define CYAN    0x07FF
-  #define MAGENTA 0xF81F
-  #define YELLOW  0xFFE0  
-  #define WHITE   0xFFFF
-  
-
-
-
-#define SERVOMIN  150 // this is the 'minimum' pulse length count (out of 4096)
-#define SERVOMAX  600 // this is the 'maximum' pulse length count (out of 4096)
-
-
-
-
-#define ArrayElementSize(x) (sizeof()/sizeof(x[0]))
-
-
-/* n = digitalRead(encoder0PinA);
-  if ((encoder0PinALast == LOW) && (n == HIGH)) {
-    if (digitalRead(encoder0PinB) == LOW) {
-      encoder0Pos--;
-    } else {
-      encoder0Pos++;
-    }
-    Serial.print (encoder0Pos);
-    Serial.print ("/");
-  }
-  encoder0PinALast = n;
-  
-  
-
-typedef ARDUINO_ROTTARY_ENC_DIR_S 
-
-  val = encoder_direction();
-  
-  
-  */
-  
-  
-  /*
-  
-class MyObject{
-    uint8_t aByte;  //one byte of memory
-    uint16_t aInt;  //two bytes of memory
-};
-
-MyObject anObject;  //create an instance of MyObject 
-  
-  */

+ 0 - 619
SE/stuff/P5_Automation_can-dev-res/___main/__main_struct_funct.h

@@ -1,619 +0,0 @@
-//PROTOTYPES HOW TO USE ORDER ELEMENTS
-#include <limits.h>
-
-void ARDUINO_ARRAY_INDEX_TABLE__SYNC_CURRENT( //when added to main table - do it
-    //MAIN_TABLE_T, MAIN_TABLE_A,
-    //optional ARDUINO_ARRAY_ASSOC_TABLE_S ARDUINO_ARRAY_ASSOC_TABLE_A,
-    ARDUINO_ARRAY_INDEX_TABLE_S* ARDUINO_ARRAY_INDEX_TABLE_A,
-    ARDUINO_ATTR_ARRAY_S* ARDUINO_ATTR_ARRAY_A
-    //ASSOC TABLE
-    
-    ) {
-
-
-}
-
-
-
-void ARDUINO_ARRAY_ASSOC_TABLE_commit_added_element(
-    ARDUINO_ATTR_ARRAY_S &ARDUINO_ATTR_ARRAY_A , 
-    ARDUINO_ARRAY_ASSOC_TABLE_S* ARDUINO_ARRAY_ASSOC_TABLE_A,
-    ARDUINO_ARRAY_INDEX_T* ARDUINO_ARRAY_INDEX_A,
-    ARDUINO_ARRAY_PRIMARY_KET_T ARDUINO_ARRAY_PRIMARY_KET_A
-    ) {
- 
-    int i = ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;
-
-}
-
-
-
-
-
-void ARDUINO_ATTR_ARRAY_S__commit_added_element(
-    ARDUINO_ATTR_ARRAY_S &ARDUINO_ATTR_ARRAY_A , 
-    ARDUINO_ARRAY_INDEX_CURRENT_T ARDUINO_ARRAY_INDEX_CURRENT_A //current index,
-    ) { //when added new element call this func
-    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A = ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;
-    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A = ARDUINO_ARRAY_INDEX_CURRENT_A ;
-    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A = ARDUINO_ARRAY_INDEX_CURRENT_A + 1 ;
-    if(ARDUINO_ARRAY_INDEX_CURRENT_A == ARDUINO_ARRAY_INDEX_CORRUPT ) {
-    } else {
-        ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A++ ;
-    }
-     
-     
- }
-
-
-
-void ARDUINO_ATTR_ARRAY_S__init(  //to init attr list table[1]
-    ARDUINO_ATTR_ARRAY_T &ARDUINO_ATTR_ARRAY_A, 
-    ARDUINO_ARRAY_INDEX_LIMIT_T ARDUINO_ARRAY_INDEX_LIMIT_A ,//current limit table
-    ARDUINO_QUEUE_FLAG_T ARDUINO_QUEUE_FLAG_A
-    ) {
-            
-                         
-                         #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)
-                              Serial.println("[#89 ] ARDUINO_ATTR_ARRAY_S__init  ");     Serial.print("]   ARDUINO_QUEUE_FLAG_A[ ") ;  Serial.print(ARDUINO_QUEUE_FLAG_A, BIN) ;      Serial.print("]   A&B [ ") ; Serial.print(ARDUINO_QUEUE_FLAG_A & ARDUINO_QUEUE_FLAG_INIT, BIN) ;   Serial.print("]  B & A [ ") ; Serial.print( ARDUINO_QUEUE_FLAG_INIT  & ARDUINO_QUEUE_FLAG_A  ,   BIN) ;  Serial.println(" ]  ") ; 
-                          #endif 
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A = ARDUINO_ARRAY_INDEX_CURRENT_INIT ;
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A = ARDUINO_ARRAY_INDEX_LAST_INIT ;
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A = ARDUINO_ARRAY_COUNT_T_INIT ;
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A = ARDUINO_ARRAY_INDEX_LIMIT_A ; 
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A = ARDUINO_ARRAY_INDEX_NEXT_INIT ;
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_time_min_run_MIN_A = ARDUINO_ARRAY_time_min_run_MIN_INIT ;
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_time_min_run_MIN_A = ARDUINO_ARRAY_INDEX_time_min_run_MIN_INIT ;  
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A  = ARDUINO_ARRAY_ATTR_QUEUE_BACK_INIT ;
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A  = ARDUINO_ARRAY_ATTR_QUEUE_FRONT_INIT ;
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A  = ARDUINO_ARRAY_ATTR_QUEUE_PEEK_INIT ;
-
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A  = ARDUINO_QUEUE_FLAG_INIT | ARDUINO_QUEUE_FLAG_A ; Serial.print(" [?78]  [ARDUINO_QUEUE_FLAG_A] ?"); 
-                                                                                                                                        Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A , BIN); Serial.print("]   ");
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A = ARDUINO_ARRAY_ATTR_QUEUE_COUNT_INIT; //kolejka elementow
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A = ARDUINO_QUEUE_FLAG_INITIALIZED ;//ARDUINO_ARRAY_ATTR_INDEX__TO_INITIALIZE ;
-            
-            if((ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A & ARDUINO_QUEUE_FLAG_INIT ) ) {
-            
-                        #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)
-                              Serial.print(" [ERROR]  [HAS[ARDUINO_QUEUE_FLAG_INIT]]");        
-                          #endif 
-                      
-                      
-                      
-            } else {
-            
-            }
-            
-                 
-    }
-
-
-
-void ARDUINO_ATTR_ARRAY_S__init_complete(ARDUINO_ATTR_ARRAY_T &ARDUINO_ATTR_ARRAY_A  , ARDUINO_ARRAY_INDEX_CURRENT_T ARDUINO_ARRAY_INDEX_CURRENT_A ) {//
-
-    ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A = ARDUINO_QUEUE_FLAG_INITIALIZED  ;
-    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A =   ARDUINO_ARRAY_ATTR_INDEX__INITIALIZED ;
-    //ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A = ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;
-    //ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A =  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A ;
-    //ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A
-    ARDUINO_ATTR_ARRAY_S__commit_added_element(ARDUINO_ATTR_ARRAY_A , ARDUINO_ARRAY_INDEX_CURRENT_A ) ;
-//first init, add value, then complete
-
-}
-
-
-
-void ARDUINO_ARRAY_INDEX_TABLE_S__init( //to init table INDEX
-    ARDUINO_ARRAY_INDEX_TABLE_T* ARDUINO_ARRAY_INDEX_TABLE_A,
-    ARDUINO_ATTR_ARRAY_T &ARDUINO_ATTR_ARRAY_A,
-    ARDUINO_ARRAY_INDEX_LIMIT_T ARDUINO_ARRAY_INDEX_LIMIT_A, //current limit table
-    ARDUINO_QUEUE_FLAG_T ARDUINO_QUEUE_FLAG_A
-    ) {
-           ARDUINO_ATTR_ARRAY_S__init(ARDUINO_ATTR_ARRAY_A, ARDUINO_ARRAY_INDEX_LIMIT_A,ARDUINO_QUEUE_FLAG_A) ; 
-                ARDUINO_ARRAY_INDEX_CURRENT_T  ARDUINO_ARRAY_INDEX_CURRENT_A = ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A;
-               if(ARDUINO_ARRAY_INDEX_CURRENT_A == ARDUINO_ARRAY_INDEX_CORRUPT) {         
-                    ARDUINO_ARRAY_INDEX_TABLE_A[ARDUINO_ARRAY_INDEX_CURRENT_A].ARDUINO_ARRAY_INDEX_A = ARDUINO_ARRAY_INDEX_CORRUPT;
-                    ARDUINO_ATTR_ARRAY_S__commit_added_element( ARDUINO_ATTR_ARRAY_A , ARDUINO_ARRAY_INDEX_CURRENT_A); //__STORAGE_ARRAY_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A
-                    Serial.print("#83 ARDUINO_ARRAY_INDEX_TABLE_S__init  ARDUINO_ARRAY_INDEX_NEXT_A[");
-                     Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A); Serial.println("]  [");
-
-
-                } else {
-                    Serial.println("#83 ERROR element should be corrupted ARDUINO_ARRAY_INDEX_TABLE_S__init");
-                }
-    }
-
-    ARDUINO_ARRAY_INDEX_CURRENT_T ARDUINO_ARRAY_INDEX_TABLE_S__add( //ADD SOME INT ELEMENT OF ARDUINO_ARRAY_INDEX_A
-    ARDUINO_ARRAY_INDEX_TABLE_T* ARDUINO_ARRAY_INDEX_TABLE_A,
-    ARDUINO_ATTR_ARRAY_T &ARDUINO_ATTR_ARRAY_A,
-    int ARDUINO_ARRAY_INDEX_A //ARDUINO_ARRAY_INDEX_T 
-    ) {
-       ARDUINO_ARRAY_INDEX_CURRENT_T  ARDUINO_ARRAY_INDEX_CURRENT_A = ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A;
-               if(ARDUINO_ARRAY_INDEX_CURRENT_A == ARDUINO_ARRAY_INDEX_CORRUPT) {         
-                          
-                    ARDUINO_ARRAY_INDEX_TABLE_A[ARDUINO_ARRAY_INDEX_CURRENT_A].ARDUINO_ARRAY_INDEX_A = ARDUINO_ARRAY_INDEX_CORRUPT;
-                    ARDUINO_ATTR_ARRAY_S__commit_added_element( ARDUINO_ATTR_ARRAY_A , ARDUINO_ARRAY_INDEX_CURRENT_A); //__STORAGE_ARRAY_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A
-                }
-                
-    ARDUINO_ARRAY_INDEX_CURRENT_A = ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A ;
-                            #if  defined(DISABLE_LOOP) || defined(DEBUG)
-                                     Serial.print("#8592 ARDUINO_ARRAY_INDEX_TABLE_S__add  ARDUINO_ARRAY_INDEX_A=[");
-                                     Serial.print(ARDUINO_ARRAY_INDEX_A); Serial.print("] ARDUINO_ARRAY_INDEX_CURRENT_A=[");
-                                     Serial.print(ARDUINO_ARRAY_INDEX_CURRENT_A); Serial.print("]  ..after commit ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A=[");
-                                     
-                            #endif
-        ARDUINO_ARRAY_INDEX_TABLE_A[ARDUINO_ARRAY_INDEX_CURRENT_A].ARDUINO_ARRAY_INDEX_A = ARDUINO_ARRAY_INDEX_A;
-            ARDUINO_ATTR_ARRAY_S__commit_added_element(ARDUINO_ATTR_ARRAY_A , ARDUINO_ARRAY_INDEX_CURRENT_A);
-                 #if defined(DISABLE_LOOP) || defined(DEBUG)
-                 Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A); Serial.println("]  [");
-                 #endif 
-    }
-
-
-void ARDUINO_ARRAY_INDEX_TABLE_S__add_void(
-    ARDUINO_ARRAY_INDEX_TABLE_T* ARDUINO_ARRAY_INDEX_TABLE_A,
-    ARDUINO_ATTR_ARRAY_T &ARDUINO_ATTR_ARRAY_A,
-    int ARDUINO_ARRAY_INDEX_A 
-    ){
-    ARDUINO_ARRAY_INDEX_CURRENT_T ARDUINO_ARRAY_INDEX_CURRENT_A = ARDUINO_ARRAY_INDEX_TABLE_S__add( //ADD SOME INT ELEMENT OF ARDUINO_ARRAY_INDEX_A
-              ARDUINO_ARRAY_INDEX_TABLE_A,
-              ARDUINO_ATTR_ARRAY_A,ARDUINO_ARRAY_INDEX_A 
-              );
-    
-    } 
-
-
-
-
-void ARDUINO_ATTR_ARRAY_S__display(  //to init attr list table[1]
-    ARDUINO_ATTR_ARRAY_T &ARDUINO_ATTR_ARRAY_A) {    
-    
-        #if not defined(DISABLE_ANY_PRINT)
-        Serial.println("   [#139 ARRAY_S__display]   #CURRENT[");
-             Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A); Serial.print("]  #LAST[");
-             Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A); Serial.print("]  #COUNT[");
-             Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A ); Serial.print("]  #LIMIT[");
-             Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A ); Serial.print("]  #NEXT[");
-             Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A); Serial.print("]  @time_min_run[");
-             Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_time_min_run_MIN_A ); Serial.print("]  #time_run_#[");
-             Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_time_min_run_MIN_A );Serial.println("] ");
-             Serial.print("]                #QUEUE_FLAG_A#["); Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A, BIN);Serial.print("]  [");  
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A & ARDUINO_QUEUE_FLAG_INIT) Serial.print(" +[INIT] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A & ARDUINO_QUEUE_FLAG_INITIALIZED) Serial.print(" +[INITIALIZED] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A & ARDUINO_QUEUE_FLAG_RESTRICT_INDEX) Serial.print(" +[RESTRICT_INDEX] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A & ARDUINO_QUEUE_FLAG_CAN_OVERWRITE) Serial.print(" +[CAN_OVERWRITE] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A & ARDUINO_QUEUE_FLAG_USE_ELEMENT_FLAG_T) Serial.print(" +[USE_ELEMENT_FLAG_T] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A & ARDUINO_QUEUE_FLAG_CANNOT_OVERWRITE) Serial.print(" +[CANNOT_OVERWRITE] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A & ARDUINO_QUEUE_FLAG_NOT_SPECIFIED) Serial.print(" +[NOT_SPECIFIED] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A & ARDUINO_QUEUE_FLAG_QUEUE) Serial.print(" +[QUEUE] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_QUEUE_FLAG_A & ARDUINO_QUEUE_FLAG_FULL_ONLY_POP) Serial.print(" +[FULL_ONLY_POP] ");
-            Serial.println("] ");
-            Serial.print("]             #INDEX_OPTIONS_A#["); 
-            Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A, BIN);  Serial.print("]  ["); 
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__TO_INITIALIZE) Serial.print(" +[TO_INITIALIZE] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__INITIALIZED) Serial.print(" +[INITIALIZED] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__TO_COMMIT) Serial.print(" +[TO_COMMIT] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__TO_INCREMENT) Serial.print(" +[TO_INCREMENT] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__READY_TO_QUERY) Serial.print(" +[READY_TO_QUERY] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__INCREMENTED) Serial.print(" +[INCREMENTED] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__LOCK) Serial.print(" +[LOCK] ");
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__HAS_ERRORS) Serial.print(" +[HAS_ERRORS] ");
-                
-             Serial.println("] ");
-             Serial.print("]             QUEUE_BACK[");
-             Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A); Serial.print("]  QUEUE_FRONT["); //ostatni zabrany element
-             Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A); Serial.print("]  QUEUE_PEEK["); 
-             Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A); Serial.print("]  QUEUE_COUNT[");  //todo ostatni element zabierany
-             Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A );  Serial.println("]    ");//kolejka elementow
-             #endif  
-    }
-
-
-
-
-void ARDUINO_ATTR_ARRAY_S__INDEX_NEXT_basic_rotate(ARDUINO_ATTR_ARRAY_T &ARDUINO_ATTR_ARRAY_A){
-    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A =  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;
-    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A = ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A ;
-    
-    if((ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A + 1) >= ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A) {
-        ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A = ARDUINO_ARRAY_INDEX_FIRST ;
-    } else ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A ++ ;
-      
-    if((ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A + 1) >= ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A) {
-        ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A = ARDUINO_ARRAY_INDEX_FIRST ;
-    } else ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A ++ ;    
-    
-    }
-
-
-    //ARDUINO_ARRAY_INDEX_NEXT_T 
-void ARDUINO_ATTR_ARRAY_S__INDEX_NEXT_rotate(  //to maintain limit and set new indexes
-    ARDUINO_ATTR_ARRAY_T &ARDUINO_ATTR_ARRAY_A ,
-   // ARDUINO_QUEUE_FLAG_T ARDUINO_QUEUE_FLAG_A, bez semnsiu fagi
-    ARDUINO_ARRAY_time_min_run_MIN_T ARDUINO_ARRAY_time_min_run_MIN_A  //to provide index pointer to last
-    ) {    
-     #if not defined(DISABLE_ANY_PRINT)
-        Serial.print("   [#156 ARDUINO_ATTR_ARRAY_S__INDEX_NEXT_rotate]   #CURRENT[");
-        if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A <= 0) {
-              Serial.print("  [#157]  [ROTATE ERROR] [NOT SET] [ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A ]  ");
-              Serial.print(" [ROTATE_FORCE] ");
-        
-        } else if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A == ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A) {
-             Serial.print(" [ROTATE_REQUIRED] ");
-        }
-          if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A == ARDUINO_ARRAY_COUNT_T_INIT) {
-            Serial.print(" [ARDUINO_ARRAY_COUNT_A]  [NOT SET ERROR]  [IGNORE] ");
-          }
-             ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A = ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;
-             ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A  = ARDUINO_ARRAY_INDEX_FIRST ;
-             //ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A //NOT CHANGED
-             //ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A// NOT CHANGED
-             ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A = ARDUINO_ARRAY_INDEX_FIRST ;
-             //ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_time_min_run_MIN_A
-             //ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_time_min_run_MIN_A
-            //ARDUINO_QUEUE_FLAG_T ARDUINO_QUEUE_FLAG_A ;
-             // ARDUINO_ARRAY_ATTR_QUEUE_BACK_T ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A ;
-            
-            //ARDUINO_ARRAY_ATTR_QUEUE_COUNT_T ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A ;
-    #endif
-         
-         //validate if ARDUINO_ARRAY_ATTR_QUEUE_BACK_A nie nachodzi
-            return ARDUINO_ARRAY_INDEX_FIRST ;
-   
-     }
-
-
-
-
-
-
-
-
-
-//    ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_T  
-
-
-ARDUINO_FUNCT_INIT_RESULT_T ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE(
-          ARDUINO_ATTR_ARRAY_S &ARDUINO_ATTR_ARRAY_A , 
-          ARDUINO_ARRAY_INDEX_CURRENT_T ARDUINO_ARRAY_INDEX_CURRENT_A, //current index,
-      //    ARDUINO_QUEUE_FLAG_T ARDUINO_QUEUE_FLAG_A  , bez sensu - opcjonalbnei dla rekoru
-          ARDUINO_QUEUE_ELEMENT_FLAG_T ARDUINO_QUEUE_ELEMENT_FLAG_A //flags of records
-      ) { //when added new element call this func
-      
-      #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE)
-      // || DEBUG_QUEUE)
-         #if not defined(DISABLE_ANY_PRINT)
-        Serial.println("[  #297 ARDUINO_ATTR_ARRAY_S__commit_added_element]  [INCREMENTED]  ARDUINO_QUEUE_ELEMENT_FLAG_A[");Serial.print(ARDUINO_QUEUE_ELEMENT_FLAG_A,BIN); Serial.print("]   ");
-        #endif
-      #endif
-      
-    
-    if(ARDUINO_ARRAY_INDEX_CURRENT_A == ARDUINO_ARRAY_INDEX_CORRUPT )  {
-     #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE)
-         #if not defined(DISABLE_ANY_PRINT)
-        Serial.println("[  #2398 commit_added_element]  [ARDUINO_ARRAY_INDEX_CORRUPT] ignored");
-         #endif
-      #endif
-    } else if(ARDUINO_QUEUE_ELEMENT_FLAG_A & ARDUINO_QUEUE_ELEMENT_FLAG_INITIAL_CORRUPT) {
-      #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE)
-        Serial.println("[  #3338 commit_added_element]  [ARDUINO_QUEUE_ELEMENT_FLAG_INITIAL_CORRUPT] ignored");
-      #endif
-    } else {
-        //if should index rotate
-             #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE)
-                Serial.print("[#555 commit_added_element]  [if should index rotate]?? ");
-              #endif
-                if((ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A + 1) >= ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A) {
-                     
-                      #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE)
-                              Serial.print("   +[ARDUINO_ARRAY_COUNT_A][HIT]   ");
-                       #endif
-                           
-                        
-                        
-                        if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A == ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ) {
-                                ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A = ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A ;
-                              #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE)
-                                    Serial.print("+set last[PEEK_A]["); Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A); Serial.print("]  ");
-                               #endif
-                        }
-                        
-
-                } else {        
-                
-                        ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A ++;
-                        ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A ++;   
-                 #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE)
-                      #if not defined(DISABLE_ANY_PRINT)
-                        Serial.print("433[ELSE] [QUEUE++]");
-                        Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A);
-                        Serial.print("] ");
-                     #endif 
-                   #endif
-                
-                
-                }
-                
-                
-                ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A = ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A  ;
-                
-                 if((ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A + 1) >= ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A) {
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A = ARDUINO_ARRAY_INDEX_FIRST ;
-                      #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE)
-                        Serial.print("[NEXT ROTATE]");
-                        Serial.print( ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A);
-                        Serial.print("] ");
-                       #endif
-                    
-                 
-                 } else {
-                    #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE)
-                        Serial.print("[NEXT ++]");
-                        Serial.print( ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A);
-                        Serial.print("] ");
-                       #endif
-                     ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A++ ;
-                 }
-            
-            
-                               
-                        
-                        
-                        ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A = ARDUINO_ARRAY_ATTR_INDEX__READY_TO_QUERY ;
-                        ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A = ARDUINO_ARRAY_INDEX_CURRENT_A ;
-                       
-                        
-                if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A > 0) { } else {
-                    ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A = ARDUINO_ARRAY_INDEX_CURRENT_A ;
-                    #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ATTR_ARRAY_S__commit_added_element_QUEUE)
-                        Serial.print("+init[ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A]["); Serial.print(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A); Serial.print("]  ");
-                   #endif 
-                }
-              return true    ;      
-    }
-     
-    return false;
-    
-}
-/*
-ARDUINO_ARRAY_ATTR_QUEUE_T ARDUINO_ARRAY_ATTR_QUEUE(ARDUINO_ATTR_ARRAY_T &ARDUINO_ATTR_ARRAY_A) {
-        ARDUINO_ARRAY_ATTR_QUEUE_T ARDUINO_ARRAY_ATTR_QUEUE_A = {} ;
-         ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_MAX_A = ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A ;
-         ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A = ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A ;   //  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A ;
-         ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A = ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_BACK_A ;
-         ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A =  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_FRONT_A;
-         ARDUINO_ARRAY_ATTR_QUEUE_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A =  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A;
-         return  ARDUINO_ARRAY_ATTR_QUEUE_A ;
-        }
-
-
-*/
-
-ARDUINO_ARRAY_INDEX_CURRENT_T ARDUINO_ARRAY_INDEX_CURRENT(
-       ARDUINO_ATTR_ARRAY_S &ARDUINO_ATTR_ARRAY_A 
-       ) {
-
-}
-
-
-ARDUINO_ARRAY_INDEX_NEXT_LOCK_T ARDUINO_ARRAY_INDEX_POP_LOCK( ARDUINO_ATTR_ARRAY_S &ARDUINO_ATTR_ARRAY_A){
-                 ARDUINO_ARRAY_INDEX_NEXT_T ARDUINO_ARRAY_INDEX_NEXT_A ;
-                  ARDUINO_ARRAY_INDEX_NEXT_A =  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A ;
-                     #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT) || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                             #if not defined(DISABLE_ANY_PRINT)
-                              Serial.print("  [ARDUINO_ARRAY_INDEX_POP_LOCK]?  ");
-                              #endif       
-                          #endif 
-                 if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A > 0) {
-                                 #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT) || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                                     Serial.print("  [INCREMENT][PEEK]  ");    
-                                 #endif 
-                      
-                            if((ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A + 1) >= ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A) {
-                                  #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT) || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                                     Serial.print("  [INCREMENT][ROTATE]?  ");    
-                                 #endif 
-                                    if(ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A == ARDUINO_ARRAY_INDEX_FIRST) {
-                                          #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT) || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                                              Serial.print("  [INCREMENT][=NEXT][QUEUE FORCE 0]  ");    
-                                          #endif
-                                           ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A = 0;
-                                           ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A = 0 ; //--;
-                                           ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A = 0 ; //--;
-                                    } else {
-                                      #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT) || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                                              Serial.print("  [INCREMENT--][NEXT]=ARDUINO_ARRAY_INDEX_FIRST  ");    
-                                          #endif
-                                           ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A = ARDUINO_ARRAY_INDEX_FIRST ;
-                                           ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A --;
-                                           ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A --;
-                                    }
-                            
-                            } else {
-                                 #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT) || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                                     Serial.print("  [INCREMENT][NOTROTATE]?  ");    
-                                 #endif 
-                                if((ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A + 1) == ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A) {
-                                         #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT) || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                                             Serial.print("  2[INCREMENT][=CURRENT] [QUEUE FORCE 0] ");
-                                         #endif 
-                                                 ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A = 0;
-                                                  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A = 0;
-                                                  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A = 0;
-                                } else {
-                                
-                                         #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT) || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                                             Serial.print("  [POP][NEXT] ");
-                                         #endif 
-                                                  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_PEEK_A++;
-                                                  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A --;
-                                                  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_QUEUE_COUNT_A --;
-                                }
-                            
-                    } 
-                    
-                    } else {
-                                 
-             
-                                        #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT) || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                                             Serial.print("  [POP][EMPTY] ");
-                                         #endif 
-                     }
-                                #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT) || defined(DEBUG_STORAGE_QUEUE_TEST) || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                                             Serial.print("  [POP][RETURNED["); Serial.print(ARDUINO_ARRAY_INDEX_NEXT_A); Serial.println("] ");
-                                         #endif 
-                            return ARDUINO_ARRAY_INDEX_NEXT_A ;
-                 
-    }
-
-
-ARDUINO_ARRAY_INDEX_NEXT_LOCK_T ARDUINO_ARRAY_INDEX_NEXT_LOCK( 
-        ARDUINO_ATTR_ARRAY_S &ARDUINO_ATTR_ARRAY_A//, 
-        //ARDUINO_ARRAY_INDEX_T &ARDUINO_ARRAY_INDEX_A //,
-        //ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_T &ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A
-        //ARDUINO_ARRAY_INDEX_NEXT_T &ARDUINO_ARRAY_INDEX_NEXT_LOCK_A,
-        //Slave_Ports_ATTR_QUEUE_COUNT_MAX_A
-        //Slave_Ports_ATTR_QUEUE_COUNT_A
-        //Slave_Ports_ATTR_QUEUE_BACK_A
-        //Slave_Ports_ATTR_QUEUE_FRONT_A
-        ){
-                 ARDUINO_ARRAY_INDEX_NEXT_T ARDUINO_ARRAY_INDEX_NEXT_A ;
-
-                         #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT) || defined(DEBUG_STORAGE_QUEUE_TEST)  || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                              Serial.print("[ARDUINO_ARRAY_INDEX_NEXT_LOCK] [ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A]?  ");       
-                          #endif 
-            if( ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__TO_INITIALIZE) {
-                        #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT) || defined(DEBUG_STORAGE_QUEUE_TEST)   || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                              Serial.print(" [ARDUINO_ARRAY_ATTR_INDEX__TO_INITIALIZE]? [ERROR]  !=[ARDUINO_ARRAY_ATTR_INDEX__TO_INITIALIZE]  ");       
-                          #endif 
-            } else if(( ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__INITIALIZED)
-                        or ( ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A  & ARDUINO_ARRAY_ATTR_INDEX__READY_TO_QUERY)) {
-                          #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST)   || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                              Serial.print(" [ARDUINO_ARRAY_ATTR_INDEX__INITIALIZE][OK] if->? ");       
-                          #endif 
-        
-            
-                                if( ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__LOCK) {
-                                              #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST)  || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                                                    Serial.print(" &[ARDUINO_ARRAY_ATTR_INDEX__LOCK] [LOCKED] [FALSE] ");       
-                                                #endif 
-                                               // ARDUINO_ARRAY_INDEX_NEXT_LOCK_A = NULL ; 
-                                                return 0;
-                                  } else  if( ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__TO_COMMIT) {
-                                               #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST)   || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                                                    Serial.print(" =[ARDUINO_ARRAY_ATTR_INDEX__TO_COMMIT] [FALSE] ");       
-                                                #endif 
-                                                 return 0;
-                                                
-                                  } else  if(( ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A & ARDUINO_ARRAY_ATTR_INDEX__READY_TO_QUERY)
-                                        or (ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A == ARDUINO_ARRAY_ATTR_INDEX__INITIALIZED )) {
-                                               #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST)   || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                                                    Serial.print(" =[ARDUINO_ARRAY_ATTR_INDEX__TO_INCREMENT][OK]  -> [ARDUINO_ARRAY_ATTR_QUEUE_add_distance] ");       
-                                                #endif 
-                                        //ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A = 
-                                        //ARDUINO_ARRAY_ATTR_QUEUE_add_distance(ARDUINO_ATTR_ARRAY_A ) ;//,  ARDUINO_QUEUE_ELEMENT_FLAG_STANDARD , ARDUINO_ARRAY_INDEX_NEXT_A, ARDUINO_ARRAY_INDEX_A) ;
-                                        
-                                        ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_ATTR_INDEX_OPTIONS_A =  ARDUINO_ARRAY_ATTR_INDEX__LOCK ;
-                                         return  ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A ;
-                                   } else {
-                                            #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST)   || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                                                    Serial.print(" =518[ARDUINO_ARRAY_ATTR_INDEX__TO_INCREMENT][ERROR][ELSE]  ");       
-                                            #endif 
-                                            return 0;
-                                   }
-                    
-                          
-            } else {
-                         #if defined(DEBUG) || defined(DISABLE_LOOP) || defined(DEBUG_QUEUE) || defined(DEBUG_STRUCT_INIT)  || defined(DEBUG_STORAGE_QUEUE_TEST)  || defined(DEBUG_ARDUINO_ARRAY_INDEX_NEXT_LOCK)
-                              Serial.print("  ![ARDUINO_ARRAY_ATTR_INDEX__INITIALIZED] =521[ELSE][ERROR] ");       
-                          #endif
-                          return 0;
-            }
-      
-      
-         
-
-       }
-
-
-/*
-void ARDUINO_ARRAY_COUNT(
-ARDUINO_ARRAY_INDEX_TABLE_S* ARDUINO_ARRAY_INDEX_TABLE_A,
-ARDUINO_ARRAY_INDEX_T_TO_DELETE_S* ARDUINO_ARRAY_INDEX_T_TO_DELETE_A, 
-ARDUINO_ARRAY_INDEX_CURRENT_T* ARDUINO_ARRAY_INDEX_CURRENT_A,
-ARDUINO_ARRAY_INDEX_LAST_T* ARDUINO_ARRAY_INDEX_LAST_A,
-ARDUINO_ARRAY_COUNT_T* ARDUINO_ARRAY_COUNT_A
-) {
-
-
-}
-*/
-
-/*
-
-void ARDUINO_ARRAY_DELETE(
-ARDUINO_ARRAY_INDEX_TABLE_S* ARDUINO_ARRAY_INDEX_TABLE_A,
-ARDUINO_ARRAY_INDEX_T_TO_DELETE_S* ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
-ARDUINO_ARRAY_ASSOC_TABLE_S* ARDUINO_ARRAY_ASSOC_TABLE_A
-);
-
-*/
-
-
-
-
-char DISPLAY_array16_I(char message[], int count){  //to provide messages concat 
-        int i ;
-        String DISPLAY_array16_S ;
-        char DISPLAY_array16_A ;//DISPLAY_array16_T
-        for(i=0;i<=count; i++) {
-            DISPLAY_array16_S = DISPLAY_array16_S + message[i] ; 
-        }
-        DISPLAY_array16_S.toCharArray(DISPLAY_array16_A, DISPLAY_array16_S.length());
-        #ifdef DEBUG 
-            if(DEBUG > 4) {
-                Serial.print("#189 DISPLAY_array16_I ") ; Serial.print(DISPLAY_array16_A); Serial.println(" ] ");
-             }
-        #endif
-        return DISPLAY_array16_A ;
-} 
-
-
-
-
-
- String  BIN8_to_STRING(byte byteA ) {    
-                    String return_A="" ;
-                    for ( size_t mask = 1 << ((sizeof(byteA) * CHAR_BIT) - 1); mask; mask >>= 1 )
-                            {
-                            return_A.concat(byteA & mask ? "1" : "0");
-                            }
-                    //message2.concat(Exp_state_s.substring(1,8));
-                    return return_A ;
-
-}
-
-
-ARDUINO_ARRAY_INDEX_T  ARDUINO_ARRAY_INDEX__next__looop(
-     ARDUINO_ARRAY_INDEX_LIMIT_T ARDUINO_ARRAY_INDEX_LIMIT_A ,
-     ARDUINO_ARRAY_INDEX_CURRENT_T ARDUINO_ARRAY_INDEX_CURRENT_A
-          )  {
-        if(ARDUINO_ARRAY_INDEX_CURRENT_A + 1 >= ARDUINO_ARRAY_INDEX_LIMIT_A) {
-            return ARDUINO_ARRAY_INDEX_FIRST ;
-        } else {
-            return ARDUINO_ARRAY_INDEX_CURRENT_A + 1 ;
-        }
-        
-    
-}
-
-
-
-int BYTE_SAFE_DECREMENT_TO_LIMIT(byte limit_min_with, byte curr_value, int try_decrement ) {
-        if((curr_value - try_decrement) < limit_min_with) return limit_min_with;
-        else {
-        Serial.print(" SAFE DECR detect curr["); Serial.print(curr_value); Serial.print("] decrement[");  Serial.print(try_decrement); Serial.print("]  ");
-         return (curr_value - try_decrement) ;
-         }
-}

+ 0 - 32
SE/stuff/P5_Automation_can-dev-res/___main/__main_struct_limits.h

@@ -1,32 +0,0 @@
-const ARDUINO_ARRAY_INDEX_LIMIT_T  ARDUINO_ATTR_ARRAY_S_LIMIT = 1 ;
-
-const ARDUINO_ARRAY_INDEX_LIMIT_T  ARDUINO_ARRAY_INDEX_T_TO_DELETE_S_LIMIT = 5 ;
-
-
-const ARDUINO_ARRAY_INDEX_LIMIT_T  ARDUINO_ARRAY_INDEX_LIMIT_PORTS = 25 ;
-
-const ARDUINO_ARRAY_INDEX_LIMIT_T  ARDUINO_ARRAY_INDEX_LIMIT_PORTS_I2C = 5 ;
-
-const ARDUINO_ARRAY_INDEX_LIMIT_T  ARDUINO_ARRAY_INDEX_LIMIT_DISPLAY = 5 ;
-
-const ARDUINO_ARRAY_INDEX_LIMIT_T  ARDUINO_ARRAY_INDEX_LIMIT_DISPLAY_MENU = 2 ;
-const ARDUINO_ARRAY_INDEX_LIMIT_T  ARDUINO_ARRAY_INDEX_LIMIT_DISPLAY_MENU_ITEM_A = 8 ;
-
-
-
-const ARDUINO_ARRAY_INDEX_LIMIT_T  ARDUINO_ARRAY_INDEX_LIMIT_QUEUE = 10 ; // 20 ;
-
-
-
-const  ARDUINO_SIZE_MIN_T ARDUINO_SIZE_MIN_encoderPos = 0 ; //for display etc
-const  ARDUINO_SIZE_MAX_T ARDUINO_SIZE_MAX_encoderPos = 256 ; //for display etc
-
-
-
-ARDUINO_ARRAY_time_min_run_MIN_T TASK_TYPE_T_Slave_Ports_broadcast____time_min_run_MIN_A_INCREMENT_A = 30000 ;
-ARDUINO_ARRAY_time_min_run_MIN_T TASK_TYPE_T_Slave_Ports_set_I2C______time_min_run_MIN_A_INCREMENT_A = 20000 ;
-
-
-const ARDUINO_LOOP_LATENCY_TASK_T ARDUINO_LOOP_LATENCY_TASK_ROTTARY_SW_loop_A = 500 ; //how to implement?
-
-const ARDUINO_LOOP_LATENCY_TASK_T ARDUINO_LOOP_LATENCY_DISPLAY_MENU = 1200 ; //how to implement?

+ 0 - 12
SE/stuff/P5_Automation_can-dev-res/___main/__main_trigger_struct.h

@@ -1,12 +0,0 @@
-
-#ifdef  HAS_DEBUG_ACTION_TRIG
-    static byte DEBUG_ACTION_TRIG = 1;
-    static byte DEBUG_LAST_ACTION_TRIG = 0 ; //to trigger actions and limit debug
-    
-    //volatile byte DEBUG_ACTION_TRIG = 0 ; //to trigger actions and limit debug
-    //volatile byte DEBUG_LAST_ACTION_TRIG = 0 ; //to trigger actions and limit debug
-#else
-
-    static byte DEBUG_ACTION_TRIG = 1;
-    static byte DEBUG_LAST_ACTION_TRIG = 0 ; //to trigger actions and limit debug
-#endif

+ 0 - 36
SE/stuff/P5_Automation_can-dev-res/___template/__STORAGE_ARRAY_func.h

@@ -1,36 +0,0 @@
-
-/*
-typedef ARDUINO_ATTR_ARRAY_S __STORAGE_ARRAY_ATTR_ARRAY_T ;
-
-typedef ARDUINO_ARRAY_INDEX_TABLE_S  __STORAGE_ARRAY_T ; //testing
-
- void __STORAGE_ARRAY_ADD(
- __STORAGE_ARRAY_T* __STORAGE_ARRAY_A , 
- __STORAGE_ARRAY_ATTR_ARRAY_T &__STORAGE_ARRAY_ATTR_ARRAY_A)
-    {
-        int i = __STORAGE_ARRAY_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;
-          if(i == ARDUINO_ARRAY_INDEX_CORRUPT) {
-              __STORAGE_ARRAY_A[i].ARDUINO_ARRAY_INDEX_A = i;
-                
-                ARDUINO_ATTR_ARRAY_S__commit_added_element(
-                          __STORAGE_ARRAY_ATTR_ARRAY_A , i); //__STORAGE_ARRAY_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A
-                   
-    }
-      i = __STORAGE_ARRAY_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A ;
-        __STORAGE_ARRAY_A[i].ARDUINO_ARRAY_INDEX_A = i;
-
-            ARDUINO_ATTR_ARRAY_S__commit_added_element(
-                          __STORAGE_ARRAY_ATTR_ARRAY_A , 
-                          i);
-   
-  
-}
-*/
-/*
-typedef int ARDUINO_ARRAY_STORAGE_CLASS_PTR_T ;
-const ARDUINO_ARRAY_STORAGE_CLASS_PTR_T Slave_Ports_Status_QUEUE_STORAGE_CLASS_A  = 1; 
-
-*/
-
-
-

+ 0 - 0
SE/stuff/P5_Automation_can-dev-res/__icon/__icon.h


+ 0 - 57
SE/stuff/P5_Automation_can-dev-res/_bak/TPQxxx.xxhxxx

@@ -1,57 +0,0 @@
-#ifndef TPQ_H
-#define TPQ_H
-
-#include <Arduino.h>
-
-template<class TP>
-class TPQ {
-  private:
-    int _front, _back, _count;
-    TP *_data;
-    int _maxitems;
-  public:
-    TPQ(int maxitems = 256) { 
-      _front = 0;
-      _back = 0;
-      _count = 0;
-      _maxitems = maxitems;
-      _data = new TP[maxitems + 1];   
-    }
-    ~TPQ() {
-      delete[] _data;  
-    }
-    void push(const TP &item);
-    TP peek_item(const TP &item);
-};
-
-
-
-template<class TP>
-void TPQ<TP>::push(const TP &item)
-{
-  if(_count < _maxitems) { // Drops out when full
-    _data[_back++]=item;
-    ++_count;
-    // Check wrap around
-    if (_back > _maxitems)
-      _back -= (_maxitems + 1);
-  }
-}
-
-
-
-
-template<class TP>
-TP TPQ<TP>::peek_item(const TP &item) {
-  if(_count <= 0) return TP(); // Returns empty
-  else { 
-    TP result = item;// T result = _data[_front];
-    //_front++;
-    //--_count;
-     if (_front > _maxitems) 
-      _front -= (_maxitems + 1);
-  return result;
-  }
-}
-
-#endif

+ 0 - 181
SE/stuff/P5_Automation_can-dev-res/_bak/_DISPLAY_func.bakh.h

@@ -1,181 +0,0 @@
-//_DISPLAY_func.h
-
-/* #if defined(HAS_TFT_ILI9163C)
-                                    delay(LCDtim);  
-                                    DISPLAY_DEV.setCursor(0,60); 
-                                    DISPLAY_DEV.print(LCDarray1); DISPLAY_DEV.print(" "); DISPLAY_DEV.print(LCDarray2);
-                              #endif
-                              */
-                              
-                              
-//void _DISPLAY_print
-
-
-void DISPLAY__print_ANY(DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                         DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A,
-                        DISPLAY_pos_seq_T DISPLAY_pos_seq_A,
-                        DISPLAY_array16_T DISPLAY_array16_A){
-              
-                        #if defined(DEBUG)
-                                if(DEBUG > 6) {
-                                    Serial.print("#20 DsplY:[ "); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-                                    Serial.print("] # MaxY:["); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_Y_CHARS_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-                                     Serial.println("] ");
-                                   }
-                                   
-                                     Serial.print("#26 Dspl ATTR CURRENT[ "); Serial.print(DISPLAY_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A);
-                                     Serial.print("] LAST["); Serial.print(DISPLAY_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A); 
-                                     Serial.print("] COUNT["); Serial.print(DISPLAY_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A); 
-                                     Serial.print("] LIMIT["); Serial.print(DISPLAY_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A); 
-                                     Serial.print("]  NEXT:["); Serial.print(DISPLAY_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A); 
-                                     Serial.println("] ");
-                            #endif 
-                
-                 #if defined(HAS_TFT_ILI9163C)
-                       
-                 #endif
-                     #if defined(DEBUG)
-                        if(DEBUG > 6) {
-                             Serial.print(" [HAS_TFT_ILI9163C] ");
-                               Serial.print(" 27[DEBUG] ");
-                           }
-                    #endif 
-                Serial.println("] "); 
-              
-                //todo position current   
-                //todo positions max
-                    #if defined(HAS_TFT_ILI9163C)
-                            DISPLAY_DEV_CTRL__println(DISPLAY_PHYSICAL_CHAR_A, DISPLAY_array16_A) ;
-                    #else 
-                
-                        Serial.println(DISPLAY_array16_A);
-                  
-                    #endif
-                  
-                    #if defined(DEBUG)
-                            //Serial.end(); 
-                            //delay(100);
-                            //Serial.write(" 72[DEBUG] ");
-                    #endif    
-                
-        }
-
-
-
-void DISPLAY__print_IMMEDIATE(
-    DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A, 
-    DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A, 
-     DISPLAY_pos_seq_T DISPLAY_pos_seq_A,
-     DISPLAY_array16_T DISPLAY_array16_A,
-      DISPLAY_TARGET_T DISPLAY_TARGET_A) {
-        
-        if(DISPLAY_TARGET_A & DISPLAY_TARGET_DISPLAY128){ //BIN TEST
-        
-                    #if defined(HAS_TFT_ILI9163C)
-                                #if defined(DEBUG)
-                                            if(DEBUG > 6) {
-                                                    String message(DISPLAY_array16_A);
-                                                   Serial.print("#69A DISPLAY__print_IMMEDIATE [DEBUG] to HAS_TFT_ILI9163C  Len["); Serial.print( message.length());
-                                                     Serial.print("] XM["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A);
-                                                     Serial.print("] YM["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_Y_CHARS_A);
-                                                     Serial.print("] YC["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A);
-                                                    Serial.print("] YF["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A);
-                                                   Serial.println("]  ");
-                                                }
-                                           #endif
-                            DISPLAY_DEV_CTRL__println(DISPLAY_PHYSICAL_CHAR_A, DISPLAY_array16_A) ;
-                    #else 
-                
-                        Serial.println(DISPLAY_array16_A);
-                  
-                    #endif
-                             //   DISPLAY__print_ANY(DISPLAY_T_ARDUINO_ATTR_ARRAY_A, DISPLAY_PHYSICAL_CHAR_A, DISPLAY_pos_seq_A, DISPLAY_array16_A);     
-          } else if(DISPLAY_TARGET_A & DISPLAY_TARGET_ANY){ //BIN TEST
-                                        #if defined(DEBUG)
-                                                if(DEBUG > 6) {
-                                                   Serial.print("#69B DISPLAY__print_IMMEDIATE [DEBUG] to DISPLAY__print_ANY  Seq["); Serial.print(DISPLAY_pos_seq_A , BIN);
-                                                    Serial.print("] Target["); Serial.print(DISPLAY_TARGET_A , BIN);
-                                                   Serial.println("]  ");
-                                                  }
-                                           #endif
-                                DISPLAY__print_ANY(DISPLAY_T_ARDUINO_ATTR_ARRAY_A, DISPLAY_PHYSICAL_CHAR_A, DISPLAY_pos_seq_A, DISPLAY_array16_A);     
-          } else {
-                              #if defined(DEBUG)
-                                    if(DEBUG > 6) {
-                                        Serial.print("#68 DISPLAY__print_IMMEDIATE [DEBUG]  else  Seq["); Serial.print(DISPLAY_pos_seq_A , BIN);
-                                         Serial.print("] Target["); Serial.print(DISPLAY_TARGET_A , BIN);
-                                        Serial.println("]  ");
-                                    }
-                                #endif  
-          }
-
-}
-
-        
-        
-        
-
-
-
- void DISPLAY__print(
-        DISPLAY_T* DISPLAY_A ,
-        DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-        DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A, 
-        DISPLAY_pos_seq_T DISPLAY_pos_seq_A,
-        DISPLAY_array16_T DISPLAY_array16_A,
-        DISPLAY_TARGET_T DISPLAY_TARGET_A,
-        time_seq_id_T time_seq_id_A,
-        time_min_run_T time_min_run_A
-        //queue
-        ,Slave_Ports_Status_QUEUE_T* Slave_Ports_Status_QUEUE_A,
-        TASK_TYPE_T TASK_TYPE_A,
-        TASK_PORT_ASSOC_T TASK_PORT_ASSOC_A
-                )
-                {
-                
-                    #if defined(DEBUG)
-                            Serial.print("#26 Dspl ATTR CURRENT[ "); Serial.print(DISPLAY_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A);
-                                     Serial.print("] LAST["); Serial.print(DISPLAY_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A); 
-                                     Serial.print("] COUNT["); Serial.print(DISPLAY_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A); 
-                                     Serial.print("] LIMIT["); Serial.print(DISPLAY_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LIMIT_A); 
-                                     Serial.print("]  NEXT:["); Serial.print(DISPLAY_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A); 
-                                     Serial.println("] ");
-                    #endif
-                    
-                    if(DISPLAY_pos_seq_A & DISPLAY_pos_seq_A_IMMEDIATE){
-                            #if defined(DEBUG)
-                                    if(DEBUG > 6) {
-                                        Serial.print("#84 DISPLAY__print to DISPLAY__print_IMMEDIATE [DEBUG]  else  Seq["); Serial.print(DISPLAY_pos_seq_A , BIN);
-                                        Serial.print("] Target["); Serial.print(DISPLAY_TARGET_A , BIN); 
-                                        
-                                        Serial.println("]  ");
-                                     }
-                                #endif  
-                           DISPLAY__print_IMMEDIATE(DISPLAY_T_ARDUINO_ATTR_ARRAY_A, DISPLAY_PHYSICAL_CHAR_A, DISPLAY_pos_seq_A,  DISPLAY_array16_A,  DISPLAY_TARGET_A);
-                                     // Serial.print("#28 running _Slave_Ports_ttl_decrement = ");
-                
-                    } else {
-                          #if defined(DEBUG)
-                                 Serial.print("#88 DISPLAY__print [DEBUG]  else  "); Serial.print(DISPLAY_pos_seq_A , BIN);
-                                 Serial.println("]  ");
-                         #endif    
-                         
-                         
-                      DISPLAY__add_record(  DISPLAY_A ,
-                             DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                             DISPLAY_PHYSICAL_CHAR_A, 
-                             DISPLAY_pos_seq_A,
-                             DISPLAY_array16_A,
-                             DISPLAY_TARGET_A,
-                             time_seq_id_A,
-                             time_min_run_A
-                             //queue
-                             , Slave_Ports_Status_QUEUE_A,
-                             TASK_TYPE_A,
-                             TASK_PORT_ASSOC_A
-                         ) ;
-                         
-                    }
-}
-
-

+ 0 - 78
SE/stuff/P5_Automation_can-dev-res/_bak/_DISPLAY_struct.bakh.h

@@ -1,78 +0,0 @@
-
-
-typedef  char DISPLAY_array16_T[16] ;
-
-
- typedef int DISPLAY_PHYSICAL_X_PX_T ;
- typedef int DISPLAY_PHYSICAL_Y_PX_T ;
-
-
- typedef int DISPLAY_PHYSICAL_X_CHARS_T ;
- typedef int DISPLAY_PHYSICAL_Y_CHARS_T ;
-
- typedef int DISPLAY_CURSOR_X_CHARS_T ;
- typedef int DISPLAY_CURSOR_Y_CHARS_T ;
- 
- 
-  typedef int DISPLAY_textsize_T ;
-  typedef DISPLAY_textsize_T DISPLAY_textsize_x_T ;
-  typedef DISPLAY_textsize_T DISPLAY_textsize_y_T ;
-
-
-
-
-
-typedef  int DISPLAY_pos_seq_T ; //reqiested position in LCD
-    const DISPLAY_pos_seq_T DISPLAY_pos_seq_A_EXACT            = B00000001;
-    const DISPLAY_pos_seq_T DISPLAY_pos_seq_A_NEXT             = B00000010;
-    const DISPLAY_pos_seq_T DISPLAY_pos_seq_A_IMMEDIATE        = B00000100;
-    const DISPLAY_pos_seq_T DISPLAY_pos_seq_A_QUEUE            = B00001000;
-    const DISPLAY_pos_seq_T DISPLAY_pos_seq_A_ATTIME           = B00010000;
-    const DISPLAY_pos_seq_T DISPLAY_pos_seq_A_INVALIDAFTER     = B00100000;
-typedef  int DISPLAY_pos_id_T ; //reqiested position id in LCD
-
- 
-typedef int DISPLAY_TARGET_T ;
-
- struct DISPLAY_S {
-      int _queue_id ; //current queue task
-       DISPLAY_pos_seq_T DISPLAY_pos_seq_A = DISPLAY_pos_seq_A_NEXT;
-       DISPLAY_pos_id_T DISPLAY_pos_id_A; //somehow like position id for menus...
-       DISPLAY_array16_T DISPLAY_array16_A ;
-       DISPLAY_TARGET_T DISPLAY_TARGET_A ; 
-       time_seq_id_T time_seq_id_A;
-       time_min_run_T time_min_run_A;
-    } ;
-    
-typedef struct DISPLAY_S DISPLAY_T ;
-    
- 
- struct DISPLAY_PHYSICAL_CHAR_S {
- 
-           DISPLAY_PHYSICAL_X_PX_T DISPLAY_PHYSICAL_X_PX_A ;
-           DISPLAY_PHYSICAL_Y_PX_T DISPLAY_PHYSICAL_Y_PX_A ;
-           DISPLAY_PHYSICAL_X_CHARS_T DISPLAY_PHYSICAL_X_CHARS_A;
-           DISPLAY_PHYSICAL_Y_CHARS_T DISPLAY_PHYSICAL_Y_CHARS_A;
-           DISPLAY_CURSOR_X_CHARS_T DISPLAY_CURSOR_X_CHARS_A;
-           DISPLAY_CURSOR_Y_CHARS_T DISPLAY_CURSOR_Y_CHARS_A ;
-           DISPLAY_textsize_x_T DISPLAY_textsize_x_A;
-           DISPLAY_textsize_y_T DISPLAY_textsize_y_A;
- } ;
- 
- 
- const DISPLAY_TARGET_T  DISPLAY_TARGET_CONSOLE      = B00000001 ;
- const DISPLAY_TARGET_T  DISPLAY_TARGET_LCD16        = B00000010 ;
- const DISPLAY_TARGET_T  DISPLAY_TARGET_DISPLAY128   = B00000100 ;
- const DISPLAY_TARGET_T  DISPLAY_TARGET_ALL          =            DISPLAY_TARGET_CONSOLE | DISPLAY_TARGET_LCD16 | DISPLAY_TARGET_DISPLAY128 ;
- const DISPLAY_TARGET_T  DISPLAY_TARGET_ANY          = B00001000 | DISPLAY_TARGET_CONSOLE | DISPLAY_TARGET_LCD16 | DISPLAY_TARGET_DISPLAY128 ;
- 
- 
- 
- typedef struct ARDUINO_ATTR_ARRAY_S DISPLAY_T_ARDUINO_ATTR_ARRAY_T ;
- 
- 
-
- 
-typedef struct ARDUINO_ARRAY_INDEX_TABLE_S         DISPLAY_ARDUINO_ARRAY_INDEX_TABLE_T ; //DEFAULT INDEX TABLE
-typedef struct ARDUINO_ARRAY_INDEX_T_TO_DELETE_S   DISPLAY_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T;
- typedef ARDUINO_FUNCT_INIT_RESULT_T ARDUINO_FUNCT_INIT_RESULT_Slave_Ports_queue__add_DISPLAY_T ;

+ 0 - 208
SE/stuff/P5_Automation_can-dev-res/_bak/_Slave_Ports_Status_func.bakh.h

@@ -1,208 +0,0 @@
-
- void Slave_Ports_Status_add_port(
- Slave_Ports_Status_T* Slave_Ports_Status_A , 
- Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
-  Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_T*            Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_TABLE_A,
-  Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_T*      Slave_Ports_Status_T_ARDUINO_ARRAY_INDEX_T_TO_DELETE_A,
-  Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_T*  Slave_Ports_Status_T_ARDUINO_ARRAY_ASSOC_TABLE_S_Port_ID_A,
-                int  Port_ID,
-                int  _Slave_ID,
-                PortTypes_T  PortTypes,
-                int  Address,
-                int  LocalPort,
-                Exp_state_T  Exp_state,
-                Exp_state_ttl_T  Exp_state_ttl,
-                Broadcast_state_T  Broadcast_state,
-                int I2C_port,
-                //int I2C_driver
-                I2C_driver_T I2C_driver, 
-                IS_Local_T IS_Local_A
-                )
-{
-
-                                       #if defined(DEBUG)
-                                                     Serial.print("#2444 Slave_Ports_Status_add_port[DEBUG] # BEFORE COUNT["); Serial.print(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A);
-                                                      Serial.print("] INDEX_LAST["); Serial.print( Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A);
-                                                      Serial.print("] INDEX_CURRENT["); Serial.print( Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A);
-                                                      Serial.print("] NEXT_A["); Serial.print( Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A);
-                                                     Serial.println("]  ");
-                                      #endif   
-
-        //int i = Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A ;
-        int i = Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A ;
-        //if(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A == 0) {
-          if(i == ARDUINO_ARRAY_INDEX_CORRUPT) {
-               
-                // Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A ++;
-                          Slave_Ports_Status_A[i].Port_ID=0x00;
-                          Slave_Ports_Status_A[i]._Slave_ID=0x00;
-                          Slave_Ports_Status_A[i].PortTypes=0x00;
-                          Slave_Ports_Status_A[i].Address=0x00;
-                          Slave_Ports_Status_A[i].LocalPort=0x00;
-                          Slave_Ports_Status_A[i].Exp_state=0x00;
-                          Slave_Ports_Status_A[i].Exp_state_ttl=0x00;
-                          Slave_Ports_Status_A[i].Broadcast_state=0x00;
-                          Slave_Ports_Status_A[i].I2C_port=0x00;
-                          Slave_Ports_Status_A[i].I2C_driver=0x00;
-                          Slave_Ports_Status_A[i].IS_Local_A=IS_Local_FALSE;
-                
-                
-                ARDUINO_ATTR_ARRAY_S__commit_added_element(
-                          Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A , 
-                         i); //Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A
-                
-                //ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A
-                                
-                 //Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A ++;   
-    }
-      i = Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A ;
-    
-    Slave_Ports_Status_A[i].Port_ID = Port_ID ;
-    Slave_Ports_Status_A[i]._Slave_ID = _Slave_ID ;
-    Slave_Ports_Status_A[i].PortTypes = PortTypes ;
-    Slave_Ports_Status_A[i].Address = Address ;
-    Slave_Ports_Status_A[i].LocalPort = LocalPort ;
-    Slave_Ports_Status_A[i].Exp_state = Exp_state ;
-    Slave_Ports_Status_A[i].Exp_state_ttl = Exp_state_ttl ;
-    Slave_Ports_Status_A[i].Broadcast_state = Broadcast_state ;
-    Slave_Ports_Status_A[i].I2C_port = I2C_port ;
-    Slave_Ports_Status_A[i].I2C_driver = I2C_driver ;
-    Slave_Ports_Status_A[i].IS_Local_A = IS_Local_A;
-  //  Slave_Ports_Status_A[Slave_Ports_Status_T_ARDUINO_ARRAY_COUNT_A + 1].I2C_driver = I2C_driver_F(I2C_driver) ;
-            ARDUINO_ATTR_ARRAY_S__commit_added_element(
-                          Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A , 
-                          i);//Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A
-   
-  
-}
-
-
- void Slave_Ports_Status__DISPLAY_TARGET(
-        Slave_Ports_Status_T* Slave_Ports_Status_A ,
-        Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A,
-        Port_ID_T  Port_ID ,
-        //display
-        DISPLAY_T* DISPLAY_A ,
-        DISPLAY_T_ARDUINO_ATTR_ARRAY_T &DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-        DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A, 
-            DISPLAY_pos_seq_T DISPLAY_pos_seq_A,
-            DISPLAY_array16_T DISPLAY_array16_A,
-            DISPLAY_TARGET_T DISPLAY_TARGET_A,
-            time_seq_id_T time_seq_id_A,
-            time_min_run_T time_min_run_A
-        //queue
-        ,Slave_Ports_Status_QUEUE_T* Slave_Ports_Status_QUEUE_A, Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_T &Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-        //tasks
-        TASK_TYPE_T TASK_TYPE_A,
-        TASK_PORT_ASSOC_T TASK_PORT_ASSOC_A
-  )
-   {
-   
-   
-   
-                #if defined(DEBUG)
-                     if(DEBUG > 6) {
-                                   Serial.print("#72 Port_Dspl[DEBUG] #COUNT["); Serial.print(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A);
-                                    Serial.print("] INDEX_LAST["); Serial.print( Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_LAST_A);
-                                    Serial.print("] INDEX_CURRENT["); Serial.print( Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A);
-                                    Serial.print("] NEXT_A["); Serial.print( Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_NEXT_A);
-                                    
-                                    
-                                    
-                                    Serial.print("]   XM["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A);
-                                    Serial.print("] YM["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_Y_CHARS_A);
-                                    Serial.print("] YC["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A);
-                                    Serial.print("] YF["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A);
-                                   Serial.println("]  ");
-                                  }
-                    #endif    
-   
-        String message_init = "" ;
-        DISPLAY_array16_T  DISPLAY_array16_AAT ;
-       // message_init.concat(DISPLAY_array16_A);
-        message_init.concat(" #C:");
-        message_init = message_init +  Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A ;
-        message_init = DISPLAY_array16_A + message_init ;
-        //message_init.concat(Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_COUNT_A , INT );
-        message_init.concat("     ");
-        message_init.toCharArray(DISPLAY_array16_AAT, message_init.length());
-        
-        String message ;
-        String message2 ;
-             DISPLAY__print(
-                          DISPLAY_A ,
-                          DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                          DISPLAY_PHYSICAL_CHAR_A, 
-                           DISPLAY_pos_seq_A,
-                            DISPLAY_array16_AAT,
-                            DISPLAY_TARGET_A,
-                           time_seq_id_A,
-                           time_min_run_A
-                          //queue
-                        , Slave_Ports_Status_QUEUE_A,
-                        Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                         TASK_TYPE_A,
-                         TASK_PORT_ASSOC_A
-                        
-                          ); 
-        int i;
-        for(i=ARDUINO_ARRAY_INDEX_FIRST ; i <= Slave_Ports_Status_T_ARDUINO_ATTR_ARRAY_A.ARDUINO_ARRAY_INDEX_CURRENT_A; i++) {//
-           DISPLAY_array16_T  DISPLAY_array16_AA="" ;
-           DISPLAY_array16_T  DISPLAY_array16_AB="" ;
-        
-            if(Slave_Ports_Status_A[i].Port_ID > 0) {
-            
-                #if defined(DEBUG)
-                            Serial.print("#68 Port_Dspl[DEBUG]  i "); Serial.print(i);
-                            Serial.println("]  ");
-                    #endif    
-                  message = "";
-                 message.concat(":")  ; 
-                 message.concat(i);
-                 message.concat("#");
-                 message.concat(Slave_Ports_Status_A[i].Port_ID )  ; 
-                 message.concat(" ");
-                 // message.toCharArray(DISPLAY_array16_AA, message.length());
-               /*   DISPLAY__print(
-                   DISPLAY_A ,
-                   DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                   DISPLAY_PHYSICAL_CHAR_A, 
-                    DISPLAY_pos_seq_A,
-                     DISPLAY_array16_AA,
-                     DISPLAY_TARGET_A,
-                    time_seq_id_A,
-                    time_min_run_A
-                   ); 
-                   delay(100);
-                  // DISPLAY_array16_AA = 0 ;*/
-                   message2 = message  ; message2.concat("E:");
-                 message2.concat(Slave_Ports_Status_A[i].Exp_state )  ;
-                 message2.concat(" T:");
-                 message2.concat(Slave_Ports_Status_A[i].Exp_state_ttl )  ;
-                 message2.concat(" B:");
-                 message2.concat(Slave_Ports_Status_A[i].Broadcast_state )  ;
-                 //message2.concat(" ");
-                 message2.toCharArray(DISPLAY_array16_AB, message2.length());             
-                
-                 DISPLAY__print(
-                   DISPLAY_A ,
-                   DISPLAY_T_ARDUINO_ATTR_ARRAY_A , 
-                   DISPLAY_PHYSICAL_CHAR_A, 
-                    DISPLAY_pos_seq_A,
-                     DISPLAY_array16_AB,
-                     DISPLAY_TARGET_A,
-                    time_seq_id_A,
-                    time_min_run_A
-                     //queue
-                          , Slave_Ports_Status_QUEUE_A,  Slave_Ports_Status_QUEUE_T_ARDUINO_ATTR_ARRAY_A ,
-                            TASK_TYPE_A,
-                            TASK_PORT_ASSOC_A
-                   ); 
-              // delay(100);
-            }
-        }
-   
-   }  
-   
-   
- 

+ 0 - 171
SE/stuff/P5_Automation_can-dev-res/_bak/_TFT_ILI9163C_func.bakh.h

@@ -1,171 +0,0 @@
-//   DISPLAY_DEV.setCursor(0,60); 
-//   DISPLAY_DEV.print(LCDarray1); DISPLAY_DEV.print(" "); DISPLAY_DEV.print(LCDarray2);
-
-
- TFT_ILI9163C DISPLAY_DEV = TFT_ILI9163C(TFT_ILI9163C_CSpin, TFT_ILI9163C_DCpin, TFT_ILI9163C__RSTpin);
-
-//defineScrollArea
-//scroll
-//startPushData(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
-//	void 		pushData(uint16_t color);
-//	void 		endPushData();
-//fillRect(int16_t x, int16_t y, int16_t w, int16_t h,uint16_t color),
-//				setRotation(uint8_t r),
-//drawPixel(int16_t x, int16_t y, uint16_t color),
-//				drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color),
-//				drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color),
-
-/*
- 
-void TFT_ILI9163C_BASE::defineScrollArea(uint16_t tfa, uint16_t bfa){
-    tfa += __OFFSET ;
-    int16_t vsa = _GRAMHEIGH - tfa - bfa;
-    if (vsa >= 0) {
-        writecommand(CMD_VSCLLDEF);
-        writedata16(tfa);
-        writedata16(vsa);
-        writedata16(bfa);
-    }
-}
- 
-void TFT_ILI9163C_BASE::scroll(uint16_t ssa) {
-    if (ssa <= _TFTHEIGHT) {
-        writecommand(CMD_VSSTADRS);
-        writedata16(ssa + __OFFSET);
-    }
-}
- 
-  
-  int16_t getCursorX(void) const { return cursor_x; }
-
-    @brief      Get text cursor Y location
-    @returns    Y coordinate in pixels
-  int16_t getCursorY(void) const { return cursor_y; };
-  
-  
-  write - 
-
-
-  tft.fillScreen();
-  unsigned long start = micros();
-  tft.setCursor(0, 0);
-  tft.setTextColor(WHITE);  
-  tft.setTextSize(1);
-  tft.println("Hello World!");
-  tft.setTextColor(YELLOW); 
-  tft.setTextSize(2);
-  tft.println(1234.56);
-  tft.setTextColor(RED);    
-  tft.setTextSize(3);
-  tft.println(0xDEAD, HEX);
-  tft.println();
-  tft.setTextColor(GREEN);
-  tft.setTextSize(4);
-  tft.println("Hello");
-  return micros() - start;
-
-*/
-
-void DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A) { 
-    if(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A + 1 >= DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_Y_CHARS_A) {//[ARDUINO_ATTR_ARRAY_S_INDEX]
-        DISPLAY_DEV.setCursor(0,0);
-         //DISPLAY_DEV.clearScreen();
-       DISPLAY_DEV.fillRect(0, 0, DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_PX_A , DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A  ,BLUE),    
-         DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A = 0 ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
-         DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_X_CHARS_A = 0 ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
-    } else {
-    
-         DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A ++ ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
-         DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_X_CHARS_A = 0 ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
-         
-         DISPLAY_DEV.setCursor(0,DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A * DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-         DISPLAY_DEV.fillRect(0, DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A * DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A, DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_PX_A , DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A  ,BLUE);
-    }
-    
-           #if defined(DEBUG)
-                if(DEBUG > 6) {     
-                     Serial.print("#83 Dspl Y:["); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-                     Serial.print("] #MaxY:["); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_Y_CHARS_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-                     Serial.print("]  maxX:["); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-                     Serial.print("]  x_A:["); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_x_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-                     
-                     //Serial.print("] #YxF:["); Serial.print(&DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A *  DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-                     Serial.println("] "); 
-                }
-            #endif
-}
-
-
-
-
-
-
-void  DISPLAY_DEV_CTRL__println(DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A, 
-                                DISPLAY_array16_T DISPLAY_array16_A) {
-                                DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ; 
-                               // DISPLAY_DEV.print(DISPLAY_array16_A);
-                               //  unsigned char LCDarray1buf[16];
-                                 //              DISPLAY_array16_A.toCharArray(LCDarray1buf, 16);
-                                 
-                                  String message(DISPLAY_array16_A);
-                                
-                                 
-                               
-                                int parts =  floor(message.length()/ DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A ) ; //( message.length() + 100)
-                                if(message.length() >= DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A and parts == 1) parts ++; 
-                                else if(parts == 0) parts = 1;
-                                int substr_begin = 0 ;
-                                int substr_end = 0 ;
-                                int i;
-                                
-                                 #if defined(DEBUG) 
-                                  if(DEBUG > 6) {  
-                                     Serial.print("#34 arr16"); Serial.print(DISPLAY_array16_A);
-                                     Serial.print("] #34 sizeof["); Serial.print(message.length());
-                                     Serial.print("] #34 String["); Serial.print(message);
-                                     Serial.print("] #34 frag"); Serial.print( message.substring(2, 5));
-                                     Serial.print("] parts["); Serial.print( parts);
-                                     Serial.print("] yC["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A);
-                                     Serial.println("] "); 
-                                     }
-                                 #endif
-                                
-                                
-                                
-                                for(i = 1 ; i<= parts; i++) {
-                                    //myString.substring(from, to)
-                                    substr_end = substr_begin + DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A ;
-                                    DISPLAY_DEV.print(message.substring(substr_begin, substr_end));
-                                       /*BUG TODO ERROR IF UNCOMMENTED*/
-                                       #if defined(DEBUG)
-                                       if(DEBUG > 6) {  
-                                              Serial.print("#112 msg part["); Serial.print(i);
-                                             Serial.print("]  beg["); Serial.print(substr_begin);
-                                             Serial.print("]  end["); Serial.print(substr_end);
-                                             Serial.print("]  frag["); Serial.print(message.substring(substr_begin, substr_end));
-                                             Serial.print("] yC["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A);
-                                             Serial.println("] ");
-                                            } 
-                                         #endif
-                                         
-                                        substr_begin = substr_end + 1;
-                                        if( parts >= 1 and not(parts == i)) {
-                                            
-                                             DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ;
-                                        } //else if(i == parts) {
-                                          //  DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ;
-                                       // }
-                                } 
-                                /*BUG TODO ERROR IF UNCOMMENTED
-                                // Serial.end();    // Ends the serial communication once all data is received
-                                //Serial.begin(115200);  
-                               // delay(400);
-                               // if (Serial.available()) Serial.write("aaaa49 ");
-                                //delay(100);
-                               // if (Serial.available()) Serial.println("bbbb49 ");
-                              //  else  Serial.println("cccc49 ");
-                              */
-            }
-            
-            
-            

Some files were not shown because too many files changed in this diff