Compare commits
12 Commits
75aa68bae2
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 34f4799c2f | |||
|
|
5ab2981ba2 | ||
|
|
b35e6e6a22 | ||
|
|
72f43d9060 | ||
|
|
d48fb874c1 | ||
|
|
2a155fd752 | ||
|
|
3d1c318b19 | ||
|
|
aeb2554e95 | ||
|
|
70f80452fc | ||
| 14cb929b7c | |||
| b428b0cd76 | |||
| 1f091485ac |
BIN
01-task_description/SWESemesterProject.pdf
Normal file
BIN
01-task_description/SWESemesterProject.pdf
Normal file
Binary file not shown.
BIN
02-UML/PDF/Deployement.pdf
Normal file
BIN
02-UML/PDF/Deployement.pdf
Normal file
Binary file not shown.
BIN
02-UML/PDF/ST_APP.pdf
Normal file
BIN
02-UML/PDF/ST_APP.pdf
Normal file
Binary file not shown.
BIN
02-UML/PDF/ST_BLINKER.pdf
Normal file
BIN
02-UML/PDF/ST_BLINKER.pdf
Normal file
Binary file not shown.
BIN
02-UML/PDF/ST_BUTTON.pdf
Normal file
BIN
02-UML/PDF/ST_BUTTON.pdf
Normal file
Binary file not shown.
BIN
02-UML/PDF/ST_CLICK_HANDLER.pdf
Normal file
BIN
02-UML/PDF/ST_CLICK_HANDLER.pdf
Normal file
Binary file not shown.
BIN
02-UML/PDF/Sequence.pdf
Normal file
BIN
02-UML/PDF/Sequence.pdf
Normal file
Binary file not shown.
BIN
02-UML/PDF/UseCase.pdf
Normal file
BIN
02-UML/PDF/UseCase.pdf
Normal file
Binary file not shown.
BIN
02-UML/PDF/class.pdf
Normal file
BIN
02-UML/PDF/class.pdf
Normal file
Binary file not shown.
BIN
02-UML/PDF/testDiagram.pdf
Normal file
BIN
02-UML/PDF/testDiagram.pdf
Normal file
Binary file not shown.
226
02-UML/ST_APP.uxf
Normal file
226
02-UML/ST_APP.uxf
Normal file
@@ -0,0 +1,226 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<diagram program="umlet" version="15.1">
|
||||
<zoom_level>12</zoom_level>
|
||||
<element>
|
||||
<id>UMLSpecialState</id>
|
||||
<coordinates>
|
||||
<x>936</x>
|
||||
<y>168</y>
|
||||
<w>24</w>
|
||||
<h>24</h>
|
||||
</coordinates>
|
||||
<panel_attributes>type=initial</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>564</x>
|
||||
<y>228</y>
|
||||
<w>768</w>
|
||||
<h>48</h>
|
||||
</coordinates>
|
||||
<panel_attributes>WAIT</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>936</x>
|
||||
<y>180</y>
|
||||
<w>36</w>
|
||||
<h>72</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=-></panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;40.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>564</x>
|
||||
<y>384</y>
|
||||
<w>168</w>
|
||||
<h>48</h>
|
||||
</coordinates>
|
||||
<panel_attributes>ST_BLINKER_L</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>1188</x>
|
||||
<y>384</y>
|
||||
<w>144</w>
|
||||
<h>288</h>
|
||||
</coordinates>
|
||||
<panel_attributes>ST_BLINKER_W</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>852</x>
|
||||
<y>504</y>
|
||||
<w>168</w>
|
||||
<h>48</h>
|
||||
</coordinates>
|
||||
<panel_attributes>ST_BLINKER_R</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>1248</x>
|
||||
<y>264</y>
|
||||
<w>120</w>
|
||||
<h>144</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<->
|
||||
evLongClick</panel_attributes>
|
||||
<additional_attributes>10.0;100.0;10.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>564</x>
|
||||
<y>624</y>
|
||||
<w>456</w>
|
||||
<h>48</h>
|
||||
</coordinates>
|
||||
<panel_attributes>ST_BLINKER_LR</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>1008</x>
|
||||
<y>636</y>
|
||||
<w>204</w>
|
||||
<h>48</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=evLongClick</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;150.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>1008</x>
|
||||
<y>516</y>
|
||||
<w>204</w>
|
||||
<h>48</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=evLongClick</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;150.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>720</x>
|
||||
<y>396</y>
|
||||
<w>492</w>
|
||||
<h>48</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=evLongClick</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;390.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>576</x>
|
||||
<y>264</y>
|
||||
<w>120</w>
|
||||
<h>144</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=evClickL(n)</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;100.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>696</x>
|
||||
<y>264</y>
|
||||
<w>168</w>
|
||||
<h>144</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=evClickL / evEndL
|
||||
</panel_attributes>
|
||||
<additional_attributes>10.0;100.0;10.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>576</x>
|
||||
<y>420</y>
|
||||
<w>120</w>
|
||||
<h>228</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=evClickR(n)</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;170.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>696</x>
|
||||
<y>420</y>
|
||||
<w>180</w>
|
||||
<h>228</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=evClickR / evEndR</panel_attributes>
|
||||
<additional_attributes>10.0;170.0;10.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>864</x>
|
||||
<y>264</y>
|
||||
<w>120</w>
|
||||
<h>264</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=evClickR(n)</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;200.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>984</x>
|
||||
<y>264</y>
|
||||
<w>180</w>
|
||||
<h>264</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=evClickR / evEndR</panel_attributes>
|
||||
<additional_attributes>10.0;200.0;10.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>864</x>
|
||||
<y>540</y>
|
||||
<w>120</w>
|
||||
<h>108</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=evClickL(n)</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;70.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>984</x>
|
||||
<y>540</y>
|
||||
<w>168</w>
|
||||
<h>108</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=evClickL / evEndL</panel_attributes>
|
||||
<additional_attributes>10.0;70.0;10.0;10.0</additional_attributes>
|
||||
</element>
|
||||
</diagram>
|
||||
183
02-UML/ST_BLINKER.uxf
Normal file
183
02-UML/ST_BLINKER.uxf
Normal file
@@ -0,0 +1,183 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<diagram program="umlet" version="15.1">
|
||||
<zoom_level>17</zoom_level>
|
||||
<element>
|
||||
<id>UMLSpecialState</id>
|
||||
<coordinates>
|
||||
<x>646</x>
|
||||
<y>51</y>
|
||||
<w>34</w>
|
||||
<h>34</h>
|
||||
</coordinates>
|
||||
<panel_attributes>type=initial</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>646</x>
|
||||
<y>68</y>
|
||||
<w>153</w>
|
||||
<h>153</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
evBLInit</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;70.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>510</x>
|
||||
<y>187</y>
|
||||
<w>306</w>
|
||||
<h>85</h>
|
||||
</coordinates>
|
||||
<panel_attributes>ST_WAIT
|
||||
--
|
||||
remainBlinks = 3;</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>510</x>
|
||||
<y>374</y>
|
||||
<w>306</w>
|
||||
<h>102</h>
|
||||
</coordinates>
|
||||
<panel_attributes>ST_ON
|
||||
--
|
||||
if(blink3) remainBlinks--
|
||||
-.
|
||||
/ entry: turnOn()</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>646</x>
|
||||
<y>459</y>
|
||||
<w>153</w>
|
||||
<h>136</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
evTimer</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;60.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>544</x>
|
||||
<y>561</y>
|
||||
<w>238</w>
|
||||
<h>102</h>
|
||||
</coordinates>
|
||||
<panel_attributes>ST_OFF
|
||||
--
|
||||
-.
|
||||
/ entry: turnOff()</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>646</x>
|
||||
<y>646</y>
|
||||
<w>153</w>
|
||||
<h>153</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
evTimer</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;70.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>527</x>
|
||||
<y>255</y>
|
||||
<w>272</w>
|
||||
<h>153</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=evBlinkN
|
||||
m2=/ nBlinkIsOn = true</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;70.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>765</x>
|
||||
<y>255</y>
|
||||
<w>289</w>
|
||||
<h>153</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=evBlink
|
||||
m2=/ nBlinkIsOn = false</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;70.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLSpecialState</id>
|
||||
<coordinates>
|
||||
<x>629</x>
|
||||
<y>765</y>
|
||||
<w>68</w>
|
||||
<h>68</h>
|
||||
</coordinates>
|
||||
<panel_attributes>type=decision</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>442</x>
|
||||
<y>408</y>
|
||||
<w>221</w>
|
||||
<h>442</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=[else]</panel_attributes>
|
||||
<additional_attributes>110.0;230.0;10.0;230.0;10.0;10.0;40.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>680</x>
|
||||
<y>204</y>
|
||||
<w>391</w>
|
||||
<h>646</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
m1=[remainBlinks==0]</panel_attributes>
|
||||
<additional_attributes>10.0;350.0;210.0;350.0;210.0;10.0;80.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLClass</id>
|
||||
<coordinates>
|
||||
<x>1462</x>
|
||||
<y>0</y>
|
||||
<w>952</w>
|
||||
<h>527</h>
|
||||
</coordinates>
|
||||
<panel_attributes>BLINKER
|
||||
--
|
||||
+state: BLINKER_STATES
|
||||
+tON: uint16_t
|
||||
+tOFF: uint16_t
|
||||
+blink3: bool
|
||||
+nBlink: uint8_t
|
||||
+turnOn: blinkerCallBack
|
||||
+turnOff: blinkerCallBack
|
||||
--
|
||||
+BLINKER_init(me: BLINKER*): void
|
||||
+BLINKER_defineCallBack(f: fBlinkerCallBack, param: void*): blinkerCallBack
|
||||
+BLINKER_starBehaviour(me: BLINKER*): void
|
||||
+BLINKER_setTurnOn(me: BLINKER*, callBack: blinkerCallBack): void
|
||||
+BLINKER_setTurnOff(me: BLINKER*, callBack: blinkerCallBack): void
|
||||
+BLINKER_blink3(me: BLINKER*): void
|
||||
+BLINKER_blink(me: BLINKER*): void
|
||||
+BLINKER_processEvent(mev: Event*): bool
|
||||
+BLINKER_endBlink(me: BLINKER*): void</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
</diagram>
|
||||
@@ -4,8 +4,8 @@
|
||||
<element>
|
||||
<id>UMLSpecialState</id>
|
||||
<coordinates>
|
||||
<x>1160</x>
|
||||
<y>200</y>
|
||||
<x>860</x>
|
||||
<y>80</y>
|
||||
<w>40</w>
|
||||
<h>40</h>
|
||||
</coordinates>
|
||||
@@ -15,8 +15,8 @@
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>680</x>
|
||||
<y>520</y>
|
||||
<x>380</x>
|
||||
<y>400</y>
|
||||
<w>280</w>
|
||||
<h>80</h>
|
||||
</coordinates>
|
||||
@@ -26,8 +26,8 @@
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>1400</x>
|
||||
<y>520</y>
|
||||
<x>1100</x>
|
||||
<y>400</y>
|
||||
<w>280</w>
|
||||
<h>80</h>
|
||||
</coordinates>
|
||||
@@ -37,8 +37,8 @@
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>1520</x>
|
||||
<y>580</y>
|
||||
<x>1220</x>
|
||||
<y>460</y>
|
||||
<w>180</w>
|
||||
<h>240</h>
|
||||
</coordinates>
|
||||
@@ -49,8 +49,8 @@ evPBPoll</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>1160</x>
|
||||
<y>220</y>
|
||||
<x>860</x>
|
||||
<y>100</y>
|
||||
<w>180</w>
|
||||
<h>180</h>
|
||||
</coordinates>
|
||||
@@ -61,8 +61,8 @@ evPBInit</panel_attributes>
|
||||
<element>
|
||||
<id>UMLSpecialState</id>
|
||||
<coordinates>
|
||||
<x>1140</x>
|
||||
<y>360</y>
|
||||
<x>840</x>
|
||||
<y>240</y>
|
||||
<w>80</w>
|
||||
<h>80</h>
|
||||
</coordinates>
|
||||
@@ -72,8 +72,8 @@ evPBInit</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>800</x>
|
||||
<y>380</y>
|
||||
<x>500</x>
|
||||
<y>260</y>
|
||||
<w>380</w>
|
||||
<h>180</h>
|
||||
</coordinates>
|
||||
@@ -84,8 +84,8 @@ m1=[pB==1]</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>800</x>
|
||||
<y>580</y>
|
||||
<x>500</x>
|
||||
<y>460</y>
|
||||
<w>180</w>
|
||||
<h>180</h>
|
||||
</coordinates>
|
||||
@@ -96,8 +96,8 @@ evPBPoll</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>1200</x>
|
||||
<y>380</y>
|
||||
<x>900</x>
|
||||
<y>260</y>
|
||||
<w>380</w>
|
||||
<h>180</h>
|
||||
</coordinates>
|
||||
@@ -108,8 +108,8 @@ m1=[pB==0]</panel_attributes>
|
||||
<element>
|
||||
<id>UMLSpecialState</id>
|
||||
<coordinates>
|
||||
<x>780</x>
|
||||
<y>720</y>
|
||||
<x>480</x>
|
||||
<y>600</y>
|
||||
<w>80</w>
|
||||
<h>80</h>
|
||||
</coordinates>
|
||||
@@ -119,8 +119,8 @@ m1=[pB==0]</panel_attributes>
|
||||
<element>
|
||||
<id>UMLSpecialState</id>
|
||||
<coordinates>
|
||||
<x>1500</x>
|
||||
<y>780</y>
|
||||
<x>1200</x>
|
||||
<y>660</y>
|
||||
<w>80</w>
|
||||
<h>80</h>
|
||||
</coordinates>
|
||||
@@ -130,8 +130,8 @@ m1=[pB==0]</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>880</x>
|
||||
<y>440</y>
|
||||
<x>580</x>
|
||||
<y>320</y>
|
||||
<w>660</w>
|
||||
<h>440</h>
|
||||
</coordinates>
|
||||
@@ -142,8 +142,8 @@ m1=[pB==1] / pbPress()</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>840</x>
|
||||
<y>440</y>
|
||||
<x>540</x>
|
||||
<y>320</y>
|
||||
<w>660</w>
|
||||
<h>380</h>
|
||||
</coordinates>
|
||||
@@ -155,8 +155,8 @@ m1=[pB==0] / pbRelease()</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>600</x>
|
||||
<y>440</y>
|
||||
<x>300</x>
|
||||
<y>320</y>
|
||||
<w>220</w>
|
||||
<h>380</h>
|
||||
</coordinates>
|
||||
@@ -167,8 +167,8 @@ m1=[else]</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>1560</x>
|
||||
<y>440</y>
|
||||
<x>1260</x>
|
||||
<y>320</y>
|
||||
<w>220</w>
|
||||
<h>440</h>
|
||||
</coordinates>
|
||||
@@ -179,8 +179,8 @@ m1=[else]</panel_attributes>
|
||||
<element>
|
||||
<id>UMLNote</id>
|
||||
<coordinates>
|
||||
<x>1000</x>
|
||||
<y>880</y>
|
||||
<x>700</x>
|
||||
<y>760</y>
|
||||
<w>400</w>
|
||||
<h>100</h>
|
||||
</coordinates>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<element>
|
||||
<id>UMLSpecialState</id>
|
||||
<coordinates>
|
||||
<x>700</x>
|
||||
<x>520</x>
|
||||
<y>20</y>
|
||||
<w>40</w>
|
||||
<h>40</h>
|
||||
@@ -15,9 +15,9 @@
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>700</x>
|
||||
<x>520</x>
|
||||
<y>40</y>
|
||||
<w>180</w>
|
||||
<w>160</w>
|
||||
<h>180</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
@@ -27,7 +27,7 @@ evCHInit</panel_attributes>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>580</x>
|
||||
<x>400</x>
|
||||
<y>180</y>
|
||||
<w>280</w>
|
||||
<h>80</h>
|
||||
@@ -38,7 +38,7 @@ evCHInit</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>700</x>
|
||||
<x>520</x>
|
||||
<y>240</y>
|
||||
<w>200</w>
|
||||
<h>180</h>
|
||||
@@ -50,9 +50,9 @@ evPBPress</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>700</x>
|
||||
<x>520</x>
|
||||
<y>440</y>
|
||||
<w>240</w>
|
||||
<w>220</w>
|
||||
<h>180</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=->
|
||||
@@ -62,7 +62,7 @@ evPBRelease</panel_attributes>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>540</x>
|
||||
<x>360</x>
|
||||
<y>380</y>
|
||||
<w>360</w>
|
||||
<h>80</h>
|
||||
@@ -73,7 +73,7 @@ evPBRelease</panel_attributes>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>540</x>
|
||||
<x>360</x>
|
||||
<y>580</y>
|
||||
<w>360</w>
|
||||
<h>80</h>
|
||||
@@ -84,7 +84,7 @@ evPBRelease</panel_attributes>
|
||||
<element>
|
||||
<id>UMLState</id>
|
||||
<coordinates>
|
||||
<x>540</x>
|
||||
<x>360</x>
|
||||
<y>780</y>
|
||||
<w>360</w>
|
||||
<h>80</h>
|
||||
@@ -95,7 +95,7 @@ evPBRelease</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>700</x>
|
||||
<x>520</x>
|
||||
<y>640</y>
|
||||
<w>200</w>
|
||||
<h>180</h>
|
||||
@@ -107,7 +107,7 @@ evPBPress</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>840</x>
|
||||
<x>660</x>
|
||||
<y>200</y>
|
||||
<w>560</w>
|
||||
<h>280</h>
|
||||
@@ -119,7 +119,7 @@ m1=evCHtimer / chLongClick()</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>840</x>
|
||||
<x>660</x>
|
||||
<y>200</y>
|
||||
<w>560</w>
|
||||
<h>480</h>
|
||||
@@ -131,7 +131,7 @@ m1=evCHtimer / chSingleClick()</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>840</x>
|
||||
<x>660</x>
|
||||
<y>200</y>
|
||||
<w>560</w>
|
||||
<h>660</h>
|
||||
@@ -143,7 +143,7 @@ m1=evCHtimer / chDoubleClick()</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>840</x>
|
||||
<x>660</x>
|
||||
<y>200</y>
|
||||
<w>560</w>
|
||||
<h>700</h>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
408
02-UML/class.uxf
Normal file
408
02-UML/class.uxf
Normal file
@@ -0,0 +1,408 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<diagram program="umlet" version="15.1">
|
||||
<zoom_level>9</zoom_level>
|
||||
<element>
|
||||
<id>UMLClass</id>
|
||||
<coordinates>
|
||||
<x>45</x>
|
||||
<y>603</y>
|
||||
<w>279</w>
|
||||
<h>216</h>
|
||||
</coordinates>
|
||||
<panel_attributes>Button
|
||||
bg=yellow
|
||||
transparency=0
|
||||
layer=1
|
||||
--
|
||||
- id: uint8_t
|
||||
- state: STATE
|
||||
- press: callBack
|
||||
- release: callBack
|
||||
--
|
||||
+ init(uint8_t id): void
|
||||
+ init_HW(): void
|
||||
+ defineCallBack(fCallBack f, void* p): callBack
|
||||
+ setPressCallBack(callBack c): void
|
||||
+ setReleaseCallBack(callBack c): void
|
||||
+ isPressed(): void
|
||||
+ startBehaviour(): void
|
||||
+ processEvent(Event* ev): void</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLClass</id>
|
||||
<coordinates>
|
||||
<x>783</x>
|
||||
<y>495</y>
|
||||
<w>279</w>
|
||||
<h>243</h>
|
||||
</coordinates>
|
||||
<panel_attributes>ClickHandler
|
||||
bg=yellow
|
||||
transparency=0
|
||||
layer=1
|
||||
--
|
||||
- state: STATE
|
||||
- longClick: callBack
|
||||
- singleClick: callBack
|
||||
- doubleClick: callBack
|
||||
--
|
||||
+ init(Button b): void
|
||||
+ defineCallBack(fCallBack f, void* p): callBack
|
||||
+ startBehaviour(): void
|
||||
+ setLongClickCallBack(callBack c): void
|
||||
+ setSingleClickCallBack(callBack c): void
|
||||
+ setDoubleClickCallBack(callBack c): void
|
||||
+ processEvent(Event* ev): bool
|
||||
-.
|
||||
- buttonPress(): void
|
||||
- buttonRelease(): void</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLClass</id>
|
||||
<coordinates>
|
||||
<x>387</x>
|
||||
<y>729</y>
|
||||
<w>180</w>
|
||||
<h>108</h>
|
||||
</coordinates>
|
||||
<panel_attributes>Led
|
||||
bg=yellow
|
||||
transparency=0
|
||||
layer=1
|
||||
--
|
||||
- id: uint8_t
|
||||
--
|
||||
+ init(uint8_t id): void
|
||||
+ init_HW(): void
|
||||
-.
|
||||
+ on(): void
|
||||
+ off(): void</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>315</x>
|
||||
<y>639</y>
|
||||
<w>486</w>
|
||||
<h>36</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<<<<->
|
||||
m2=-b</panel_attributes>
|
||||
<additional_attributes>520.0;10.0;10.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLClass</id>
|
||||
<coordinates>
|
||||
<x>1098</x>
|
||||
<y>468</y>
|
||||
<w>279</w>
|
||||
<h>369</h>
|
||||
</coordinates>
|
||||
<panel_attributes>Blinker
|
||||
bg=yellow
|
||||
transparency=0
|
||||
layer=1
|
||||
--
|
||||
- state: STATE
|
||||
- tON: uint16_t
|
||||
- tOFF: uint16_t
|
||||
- nBlink: uint8_t
|
||||
- nBlinkIsOn: bool
|
||||
- remainBlinks: uint8_t
|
||||
- turnOn: callBack
|
||||
- turnOff: callBack
|
||||
- finished: callBack
|
||||
--
|
||||
+ init(): void
|
||||
+ defineCallBack(fCallBack f, void* p): callBack
|
||||
+ setTurnOnCallBack(callBack c): void
|
||||
+ setTurnOffCallBack(callBack c): void
|
||||
+ setFinishedCallBack(callBack c): void
|
||||
+ defineNblink(uint8_t n): void
|
||||
+ setTimeOn(uint16_t t): void
|
||||
+ setTimeOff(uint16_t t): void
|
||||
-.
|
||||
+ startBehaviour(): void
|
||||
+ processEvent(Event* ev): void
|
||||
+ blinkN(): void
|
||||
+ blink(): void
|
||||
+ endBlink(): void
|
||||
+ toggle(): void</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLClass</id>
|
||||
<coordinates>
|
||||
<x>801</x>
|
||||
<y>216</y>
|
||||
<w>126</w>
|
||||
<h>108</h>
|
||||
</coordinates>
|
||||
<panel_attributes>Factory
|
||||
bg=yellow
|
||||
transparency=0
|
||||
layer=1
|
||||
--
|
||||
+ init(): void
|
||||
+ build(): void
|
||||
+ start(): void</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLPackage</id>
|
||||
<coordinates>
|
||||
<x>117</x>
|
||||
<y>288</y>
|
||||
<w>324</w>
|
||||
<h>117</h>
|
||||
</coordinates>
|
||||
<panel_attributes>mcc_generated_files
|
||||
bg=pink
|
||||
transparency=0
|
||||
layer=0</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLPackage</id>
|
||||
<coordinates>
|
||||
<x>729</x>
|
||||
<y>117</y>
|
||||
<w>720</w>
|
||||
<h>288</h>
|
||||
</coordinates>
|
||||
<panel_attributes>app
|
||||
bg=pink
|
||||
transparency=0
|
||||
layer=0</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLPackage</id>
|
||||
<coordinates>
|
||||
<x>18</x>
|
||||
<y>513</y>
|
||||
<w>585</w>
|
||||
<h>378</h>
|
||||
</coordinates>
|
||||
<panel_attributes>board
|
||||
bg=pink
|
||||
transparency=0
|
||||
layer=0</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLPackage</id>
|
||||
<coordinates>
|
||||
<x>729</x>
|
||||
<y>423</y>
|
||||
<w>720</w>
|
||||
<h>468</h>
|
||||
</coordinates>
|
||||
<panel_attributes>middleware
|
||||
bg=pink
|
||||
transparency=0
|
||||
layer=0</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLClass</id>
|
||||
<coordinates>
|
||||
<x>1134</x>
|
||||
<y>162</y>
|
||||
<w>207</w>
|
||||
<h>198</h>
|
||||
</coordinates>
|
||||
<panel_attributes>App
|
||||
bg=yellow
|
||||
transparency=0
|
||||
layer=1
|
||||
--
|
||||
- state: STATE
|
||||
--
|
||||
+ init(): void
|
||||
-.
|
||||
+ startBehaviour(): void
|
||||
+ processEvent(Event* ev): void
|
||||
- clickL(): void
|
||||
- clickLn(): void
|
||||
- clickR(): void
|
||||
- clickRn(): void
|
||||
- endL(): void
|
||||
- endR(): void
|
||||
- longClick(): void</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>171</x>
|
||||
<y>396</y>
|
||||
<w>72</w>
|
||||
<h>225</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.>
|
||||
m1=<<import>></panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;230.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>405</x>
|
||||
<y>396</y>
|
||||
<w>72</w>
|
||||
<h>351</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.>
|
||||
m1=<<import>></panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;370.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>252</x>
|
||||
<y>252</y>
|
||||
<w>567</w>
|
||||
<h>369</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<<<<<->
|
||||
m2= +b1..b3</panel_attributes>
|
||||
<additional_attributes>610.0;10.0;300.0;10.0;300.0;270.0;10.0;270.0;10.0;390.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>531</x>
|
||||
<y>288</y>
|
||||
<w>288</w>
|
||||
<h>459</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<<<<<->
|
||||
m2= +11..l10</panel_attributes>
|
||||
<additional_attributes>300.0;10.0;200.0;10.0;200.0;340.0;10.0;340.0;10.0;490.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>846</x>
|
||||
<y>315</y>
|
||||
<w>81</w>
|
||||
<h>198</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<<<<<->
|
||||
m2=+ch1..ch3</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;200.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>918</x>
|
||||
<y>234</y>
|
||||
<w>234</w>
|
||||
<h>36</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<<<<<->
|
||||
m2=+app</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;240.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>918</x>
|
||||
<y>297</y>
|
||||
<w>324</w>
|
||||
<h>189</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<<<<<->
|
||||
m2=+blL</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;150.0;10.0;150.0;150.0;310.0;150.0;310.0;190.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>918</x>
|
||||
<y>279</y>
|
||||
<w>360</w>
|
||||
<h>207</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<<<<<->
|
||||
m2=+blR</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;160.0;10.0;160.0;160.0;350.0;160.0;350.0;210.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>918</x>
|
||||
<y>261</y>
|
||||
<w>396</w>
|
||||
<h>225</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<<<<<->
|
||||
m2=+blB</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;170.0;10.0;170.0;170.0;390.0;170.0;390.0;230.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLPackage</id>
|
||||
<coordinates>
|
||||
<x>27</x>
|
||||
<y>117</y>
|
||||
<w>630</w>
|
||||
<h>117</h>
|
||||
</coordinates>
|
||||
<panel_attributes>xf
|
||||
bg=pink
|
||||
transparency=0
|
||||
layer=0</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>63</x>
|
||||
<y>225</y>
|
||||
<w>72</w>
|
||||
<h>396</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.>
|
||||
<<import>></panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;420.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>612</x>
|
||||
<y>225</y>
|
||||
<w>504</w>
|
||||
<h>603</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.>
|
||||
<<import>></panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;650.0;540.0;650.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>630</x>
|
||||
<y>225</y>
|
||||
<w>171</w>
|
||||
<h>315</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.>
|
||||
<<import>></panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;330.0;170.0;330.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>648</x>
|
||||
<y>171</y>
|
||||
<w>504</w>
|
||||
<h>36</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.>
|
||||
<<import>></panel_attributes>
|
||||
<additional_attributes>10.0;20.0;540.0;20.0</additional_attributes>
|
||||
</element>
|
||||
</diagram>
|
||||
76
02-UML/singleLeftClick.puml
Normal file
76
02-UML/singleLeftClick.puml
Normal file
@@ -0,0 +1,76 @@
|
||||
@startuml
|
||||
'https://plantuml.com/sequence-diagram
|
||||
actor User as usr
|
||||
participant "Pb L" as pbL
|
||||
participant "Pb R" as pbR
|
||||
participant "LED L" as ledL
|
||||
participant "LED R" as ledR
|
||||
|
||||
|
||||
== Single click ==
|
||||
|
||||
group Single click left
|
||||
usr -\ pbL ++: pressButton
|
||||
usr -\ pbL : releaseButton
|
||||
pbL -> ledL --++ : blink
|
||||
usr -\ pbL ++: pressButton
|
||||
usr -\ pbL : releaseButton
|
||||
pbL -> ledL -- : endBlink
|
||||
deactivate ledL
|
||||
end
|
||||
|
||||
group Single click right
|
||||
usr -\ pbR ++: pressButton
|
||||
usr -\ pbR : releaseButton
|
||||
pbR -> ledR --++ : blink
|
||||
usr -\ pbR ++: pressButton
|
||||
usr -\ pbR : releaseButton
|
||||
pbR -> ledR -- : endBlink
|
||||
deactivate ledR
|
||||
end
|
||||
|
||||
== Double click ==
|
||||
|
||||
group Double click left
|
||||
usr -\ pbL ++: pressButton
|
||||
usr -\ pbL : releaseButton
|
||||
usr -\ pbL : pressButton
|
||||
pbL -> ledL --++ : blink
|
||||
note right ledL: blink 3x
|
||||
ledL ->x ledL -- : finished
|
||||
end
|
||||
|
||||
group Double click right
|
||||
usr -\ pbR ++: pressButton
|
||||
usr -\ pbR : releaseButton
|
||||
usr -\ pbR : pressButton
|
||||
pbR -> ledR --++ : blink
|
||||
note right ledR: blink 3x
|
||||
ledR ->x ledR -- : finished
|
||||
end
|
||||
|
||||
== Long click ==
|
||||
|
||||
group Long click left
|
||||
usr -\ pbL ++: pressButton
|
||||
pbL -> ledR--: blink
|
||||
activate ledL
|
||||
activate ledR
|
||||
usr -\ pbL ++: pressButton
|
||||
pbL -> ledR -- : endBlink
|
||||
deactivate ledL
|
||||
deactivate ledR
|
||||
end
|
||||
|
||||
group Long click right
|
||||
usr -\ pbR ++: pressButton
|
||||
pbR -> ledR--: blink
|
||||
activate ledL
|
||||
activate ledR
|
||||
usr -\ pbL ++: pressButton
|
||||
pbL -> ledR -- : endBlink
|
||||
deactivate ledL
|
||||
deactivate ledR
|
||||
end
|
||||
|
||||
@enduml
|
||||
1
02-UML/testDiagram.svg
Normal file
1
02-UML/testDiagram.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 25 KiB |
216
03-software/ch/kb28/blinkerProject/app/app.c
Normal file
216
03-software/ch/kb28/blinkerProject/app/app.c
Normal file
@@ -0,0 +1,216 @@
|
||||
/**
|
||||
* @author R<>mi Heredero (remi@heredero.ch)
|
||||
* @version 1.0.0
|
||||
* @date 2023-06-15
|
||||
*/
|
||||
|
||||
#include "app.h"
|
||||
#include "factory/factory.h"
|
||||
#include "../middleware/blinker.h"
|
||||
#include "../middleware/clickHandler.h"
|
||||
|
||||
void clickL(APP* me){
|
||||
POST(me, &APP_processEvent, evAPclickL, 0, 0);
|
||||
}
|
||||
void clickLn(APP* me){
|
||||
POST(me, &APP_processEvent, evAPclickLn, 0, 0);
|
||||
}
|
||||
void clickR(APP* me){
|
||||
POST(me, &APP_processEvent, evAPclickR, 0, 0);
|
||||
}
|
||||
void clickRn(APP* me){
|
||||
POST(me, &APP_processEvent, evAPclickRn, 0, 0);
|
||||
}
|
||||
void endL(APP* me){
|
||||
POST(me, &APP_processEvent, evAPendL, 0, 0);
|
||||
}
|
||||
void endR(APP* me){
|
||||
POST(me, &APP_processEvent, evAPendR, 0, 0);
|
||||
}
|
||||
void longClick(APP* me){
|
||||
POST(me, &APP_processEvent, evAPlongClick, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void APP_init(APP* me){
|
||||
|
||||
me->state = STAP_INIT;
|
||||
|
||||
CLICK_HANDLER_setSingleClickCallback(ch1(), CLICK_HANDLER_defineCallBack(&clickL, me));
|
||||
CLICK_HANDLER_setSingleClickCallback(ch3(), CLICK_HANDLER_defineCallBack(&clickR, me));
|
||||
|
||||
CLICK_HANDLER_setDoubleClickCallback(ch1(), CLICK_HANDLER_defineCallBack(&clickLn, me));
|
||||
CLICK_HANDLER_setDoubleClickCallback(ch3(), CLICK_HANDLER_defineCallBack(&clickRn, me));
|
||||
|
||||
CLICK_HANDLER_setLongClickCallback(ch1(), CLICK_HANDLER_defineCallBack(&longClick, me));
|
||||
CLICK_HANDLER_setLongClickCallback(ch3(), CLICK_HANDLER_defineCallBack(&longClick, me));
|
||||
|
||||
BLINKER_setFinished(blL(), BLINKER_defineCallBack(&endL, me));
|
||||
BLINKER_setFinished(blR(), BLINKER_defineCallBack(&endR, me));
|
||||
|
||||
}
|
||||
|
||||
void APP_startBehaviour(APP* me){
|
||||
POST(me, &APP_processEvent, evAPinit, 0, 0);
|
||||
}
|
||||
|
||||
bool APP_processEvent(Event* ev){
|
||||
bool processed = false;
|
||||
APP* me = (APP*) Event_getTarget(ev);
|
||||
APP_STATES oldState = me->state;
|
||||
evIDT evid = Event_getId(ev);
|
||||
|
||||
switch(me->state) { // In state
|
||||
case STAP_INIT:
|
||||
if(evid == evAPinit) {
|
||||
me->state = STAP_WAIT;
|
||||
}
|
||||
break;
|
||||
|
||||
case STAP_WAIT:
|
||||
if(evid == evAPclickL) {
|
||||
me->state = STAP_BLINKER_L;
|
||||
BLINKER_blink(blL());
|
||||
}
|
||||
if(evid == evAPclickLn) {
|
||||
me->state = STAP_BLINKER_L;
|
||||
BLINKER_blinkN(blL());
|
||||
}
|
||||
if(evid == evAPclickR) {
|
||||
me->state = STAP_BLINKER_R;
|
||||
BLINKER_blink(blR());
|
||||
}
|
||||
if(evid == evAPclickRn) {
|
||||
me->state = STAP_BLINKER_R;
|
||||
BLINKER_blinkN(blR());
|
||||
}
|
||||
if(evid == evAPlongClick) {
|
||||
me->state = STAP_BLINKER_W;
|
||||
BLINKER_blink(blB());
|
||||
}
|
||||
break;
|
||||
|
||||
case STAP_BLINKER_L:
|
||||
if(evid == evAPclickR){
|
||||
me->state = STAP_BLINKER_LR;
|
||||
BLINKER_blink(blR());
|
||||
}
|
||||
if(evid == evAPclickRn){
|
||||
me->state = STAP_BLINKER_LR;
|
||||
BLINKER_blinkN(blR());
|
||||
}
|
||||
if(evid == evAPclickL) {
|
||||
me->state = STAP_WAIT;
|
||||
BLINKER_endBlink(blL());
|
||||
}
|
||||
if(evid == evAPendL) {
|
||||
me->state = STAP_WAIT;
|
||||
}
|
||||
if(evid == evAPlongClick) {
|
||||
me->state = STAP_BLINKER_W;
|
||||
BLINKER_endBlink(blL());
|
||||
BLINKER_blink(blB());
|
||||
}
|
||||
break;
|
||||
|
||||
case STAP_BLINKER_R:
|
||||
if(evid == evAPclickL){
|
||||
me->state = STAP_BLINKER_LR;
|
||||
BLINKER_blink(blL());
|
||||
}
|
||||
if(evid == evAPclickLn){
|
||||
me->state = STAP_BLINKER_LR;
|
||||
BLINKER_blinkN(blL());
|
||||
}
|
||||
if(evid == evAPclickR) {
|
||||
me->state = STAP_WAIT;
|
||||
BLINKER_endBlink(blR());
|
||||
}
|
||||
if(evid == evAPendR) {
|
||||
me->state = STAP_WAIT;
|
||||
}
|
||||
if(evid == evAPlongClick) {
|
||||
me->state = STAP_BLINKER_W;
|
||||
BLINKER_endBlink(blR());
|
||||
BLINKER_blink(blB());
|
||||
}
|
||||
break;
|
||||
|
||||
case STAP_BLINKER_LR:
|
||||
if(evid == evAPclickR) {
|
||||
me->state = STAP_BLINKER_L;
|
||||
BLINKER_endBlink(blR());
|
||||
}
|
||||
if(evid == evAPendR) {
|
||||
me->state = STAP_BLINKER_L;
|
||||
}
|
||||
if(evid == evAPclickL) {
|
||||
me->state = STAP_BLINKER_R;
|
||||
BLINKER_endBlink(blL());
|
||||
}
|
||||
if(evid == evAPendL) {
|
||||
me->state = STAP_BLINKER_R;
|
||||
}
|
||||
if(evid == evAPlongClick) {
|
||||
me->state = STAP_BLINKER_W;
|
||||
BLINKER_endBlink(blL());
|
||||
BLINKER_endBlink(blR());
|
||||
BLINKER_blink(blB());
|
||||
}
|
||||
break;
|
||||
|
||||
case STAP_BLINKER_W:
|
||||
if(evid == evAPlongClick){
|
||||
me->state = STAP_WAIT;
|
||||
BLINKER_endBlink(blB());
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if(oldState != me->state) {
|
||||
switch(oldState) { // on exit
|
||||
case STAP_INIT:
|
||||
break;
|
||||
|
||||
case STAP_WAIT:
|
||||
break;
|
||||
|
||||
case STAP_BLINKER_L:
|
||||
break;
|
||||
|
||||
case STAP_BLINKER_R:
|
||||
break;
|
||||
|
||||
case STAP_BLINKER_LR:
|
||||
break;
|
||||
|
||||
case STAP_BLINKER_W:
|
||||
break;
|
||||
}
|
||||
|
||||
switch(me->state) { // on entry
|
||||
case STAP_INIT:
|
||||
break;
|
||||
|
||||
case STAP_WAIT:
|
||||
break;
|
||||
|
||||
case STAP_BLINKER_L:
|
||||
break;
|
||||
|
||||
case STAP_BLINKER_R:
|
||||
break;
|
||||
|
||||
case STAP_BLINKER_LR:
|
||||
break;
|
||||
|
||||
case STAP_BLINKER_W:
|
||||
break;
|
||||
|
||||
}
|
||||
processed = true;
|
||||
}
|
||||
return processed;
|
||||
}
|
||||
40
03-software/ch/kb28/blinkerProject/app/app.h
Normal file
40
03-software/ch/kb28/blinkerProject/app/app.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* @author R<>mi Heredero (remi@heredero.ch)
|
||||
* @version 1.0.0
|
||||
* @date 2023-06-17
|
||||
*/
|
||||
#ifndef APP_H
|
||||
#define APP_H
|
||||
|
||||
#include "../xf/xf.h"
|
||||
|
||||
typedef enum {
|
||||
STAP_INIT,
|
||||
STAP_WAIT,
|
||||
STAP_BLINKER_L,
|
||||
STAP_BLINKER_R,
|
||||
STAP_BLINKER_LR,
|
||||
STAP_BLINKER_W
|
||||
} APP_STATES;
|
||||
|
||||
typedef enum {
|
||||
evAPinit = 150,
|
||||
evAPclickL,
|
||||
evAPclickLn,
|
||||
evAPclickR,
|
||||
evAPclickRn,
|
||||
evAPendL,
|
||||
evAPendR,
|
||||
evAPlongClick
|
||||
} APP_EVENTS;
|
||||
|
||||
typedef struct {
|
||||
APP_STATES state; // Actual state
|
||||
} APP;
|
||||
|
||||
void APP_init(APP* me);
|
||||
void APP_startBehaviour(APP* me);
|
||||
bool APP_processEvent(Event* ev);
|
||||
|
||||
#endif /* APP_H */
|
||||
|
||||
@@ -62,13 +62,20 @@ CLICK_HANDLER* ch3() {
|
||||
return &theFactory.ch3_;
|
||||
}
|
||||
|
||||
BLINKER* blA() {
|
||||
return &theFactory.blA_;
|
||||
BLINKER* blL() {
|
||||
return &theFactory.blL_;
|
||||
}
|
||||
BLINKER* blR() {
|
||||
return &theFactory.blR_;
|
||||
}
|
||||
BLINKER* blB() {
|
||||
return &theFactory.blB_;
|
||||
}
|
||||
|
||||
APP* app() {
|
||||
return &theFactory.app_;
|
||||
}
|
||||
|
||||
//initialize all objects
|
||||
void Factory_init() {
|
||||
LED_init(l1(), 1);
|
||||
@@ -106,31 +113,36 @@ void Factory_init() {
|
||||
CLICK_HANDLER_init(ch2(), b2());
|
||||
CLICK_HANDLER_init(ch3(), b3());
|
||||
|
||||
BLINKER_init(blA());
|
||||
BLINKER_init(blL());
|
||||
BLINKER_init(blR());
|
||||
BLINKER_init(blB());
|
||||
|
||||
APP_init(app());
|
||||
|
||||
}
|
||||
|
||||
void warningBlink(void* on_){
|
||||
bool on = (bool)on_;
|
||||
BLINKER_endBlink(blL());
|
||||
BLINKER_endBlink(blR());
|
||||
if(on) {
|
||||
LED_on(l1());
|
||||
LED_on(l10());
|
||||
} else {
|
||||
LED_off(l1());
|
||||
LED_off(l10());
|
||||
}
|
||||
}
|
||||
|
||||
//connect objects if required
|
||||
void Factory_build() {
|
||||
BLINKER_defineNblink(blA(), 3);
|
||||
BLINKER_defineNblink(blB(), 5);
|
||||
|
||||
BLINKER_setTimeOn(blA(), 20);
|
||||
BLINKER_setTimeOff(blA(), 480);
|
||||
|
||||
BLINKER_setTurnOn(blA(), BLINKER_defineCallBack(&LED_on, l1()));
|
||||
BLINKER_setTurnOff(blA(), BLINKER_defineCallBack(&LED_off, l1()));
|
||||
BLINKER_setTurnOn(blB(), BLINKER_defineCallBack(&LED_on, l10()));
|
||||
BLINKER_setTurnOff(blB(), BLINKER_defineCallBack(&LED_off, l10()));
|
||||
|
||||
CLICK_HANDLER_setSingleClickCallback(ch1(), CLICK_HANDLER_defineCallBack(&BLINKER_blink, blA()));
|
||||
CLICK_HANDLER_setDoubleClickCallback(ch1(), CLICK_HANDLER_defineCallBack(&BLINKER_endBlink, blA()));
|
||||
CLICK_HANDLER_setLongClickCallback(ch1(), CLICK_HANDLER_defineCallBack(&BLINKER_blinkN, blA()));
|
||||
|
||||
CLICK_HANDLER_setSingleClickCallback(ch3(), CLICK_HANDLER_defineCallBack(&BLINKER_blink, blB()));
|
||||
CLICK_HANDLER_setDoubleClickCallback(ch3(), CLICK_HANDLER_defineCallBack(&BLINKER_endBlink, blB()));
|
||||
CLICK_HANDLER_setLongClickCallback(ch3(), CLICK_HANDLER_defineCallBack(&BLINKER_blinkN, blB()));
|
||||
BLINKER_setTurnOn(blL(), BLINKER_defineCallBack(&LED_on, l1()));
|
||||
BLINKER_setTurnOff(blL(), BLINKER_defineCallBack(&LED_off, l1()));
|
||||
BLINKER_setTurnOn(blR(), BLINKER_defineCallBack(&LED_on, l10()));
|
||||
BLINKER_setTurnOff(blR(), BLINKER_defineCallBack(&LED_off, l10()));
|
||||
BLINKER_setTurnOn(blB(), BLINKER_defineCallBack(&warningBlink, true));
|
||||
BLINKER_setTurnOff(blB(), BLINKER_defineCallBack(&warningBlink, false));
|
||||
|
||||
}
|
||||
|
||||
@@ -142,6 +154,8 @@ void Factory_start() {
|
||||
CLICK_HANDLER_startBehaviour(ch1());
|
||||
CLICK_HANDLER_startBehaviour(ch2());
|
||||
CLICK_HANDLER_startBehaviour(ch3());
|
||||
BLINKER_starBehaviour(blA());
|
||||
BLINKER_starBehaviour(blL());
|
||||
BLINKER_starBehaviour(blR());
|
||||
BLINKER_starBehaviour(blB());
|
||||
APP_startBehaviour(app());
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "../../board/button/button.h"
|
||||
#include "../../middleware/clickHandler.h"
|
||||
#include "../../middleware/blinker.h"
|
||||
#include "../app.h"
|
||||
|
||||
typedef struct {
|
||||
LED l1_;
|
||||
@@ -32,8 +33,10 @@ typedef struct {
|
||||
CLICK_HANDLER ch1_;
|
||||
CLICK_HANDLER ch2_;
|
||||
CLICK_HANDLER ch3_;
|
||||
BLINKER blA_;
|
||||
BLINKER blL_;
|
||||
BLINKER blR_;
|
||||
BLINKER blB_;
|
||||
APP app_;
|
||||
} Factory;
|
||||
|
||||
|
||||
@@ -61,7 +64,10 @@ CLICK_HANDLER* ch1();
|
||||
CLICK_HANDLER* ch2();
|
||||
CLICK_HANDLER* ch3();
|
||||
|
||||
BLINKER* blA();
|
||||
BLINKER* blL();
|
||||
BLINKER* blR();
|
||||
BLINKER* blB();
|
||||
|
||||
APP* app();
|
||||
|
||||
#endif
|
||||
@@ -37,6 +37,10 @@ void BLINKER_setTurnOff(BLINKER* me, blinkerCallBack callBack) {
|
||||
me->turnOff = callBack;
|
||||
}
|
||||
|
||||
void BLINKER_setFinished(BLINKER* me, blinkerCallBack callBack){
|
||||
me->finished = callBack;
|
||||
}
|
||||
|
||||
void BLINKER_defineNblink(BLINKER* me, uint8_t n){
|
||||
me->nBlink = n;
|
||||
}
|
||||
@@ -101,6 +105,7 @@ bool BLINKER_processEvent(Event* ev) {
|
||||
if(evid == evBLtimer) {
|
||||
if(me->remainBlinks == 0) {
|
||||
me->state = STBL_WAIT;
|
||||
if(me->finished.fCallBack != NULL) me->finished.fCallBack(me->finished.param);
|
||||
} else {
|
||||
me->state = STBL_ON;
|
||||
POST(me, &BLINKER_processEvent, evBLtimer, me->tON, 0);
|
||||
@@ -111,7 +116,7 @@ bool BLINKER_processEvent(Event* ev) {
|
||||
}
|
||||
|
||||
if(oldState != me->state) {
|
||||
switch(me->state) {
|
||||
switch(me->state) { // on entry
|
||||
case STBL_INIT:
|
||||
break;
|
||||
|
||||
@@ -126,9 +131,25 @@ bool BLINKER_processEvent(Event* ev) {
|
||||
if(me->turnOff.fCallBack != NULL) me->turnOff.fCallBack(me->turnOff.param);
|
||||
break;
|
||||
}
|
||||
processed = true;
|
||||
}
|
||||
return processed;
|
||||
}
|
||||
|
||||
void BLINKER_endBlink(BLINKER* me) {
|
||||
me->remainBlinks = 0;
|
||||
}
|
||||
|
||||
void BLINKER_toggle(BLINKER* me){
|
||||
switch(me->state) {
|
||||
case STBL_WAIT:
|
||||
BLINKER_blink(me);
|
||||
break;
|
||||
case STBL_OFF:
|
||||
BLINKER_endBlink(me);
|
||||
break;
|
||||
case STBL_ON:
|
||||
BLINKER_endBlink(me);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @author R<>mi Heredero (remi@heredero.ch)
|
||||
* @version. 1.0.0
|
||||
* @version 1.0.0
|
||||
* @date 2023-06-15
|
||||
*/
|
||||
|
||||
@@ -39,6 +39,7 @@ typedef struct {
|
||||
uint8_t remainBlinks; // Actual remain blink
|
||||
blinkerCallBack turnOn; // Callback for turnOn
|
||||
blinkerCallBack turnOff; // Calbback for turnOff
|
||||
blinkerCallBack finished; // Callback for finish n blink
|
||||
}BLINKER;
|
||||
|
||||
/**
|
||||
@@ -75,6 +76,13 @@ void BLINKER_setTurnOn(BLINKER* me, blinkerCallBack callBack);
|
||||
*/
|
||||
void BLINKER_setTurnOff(BLINKER* me, blinkerCallBack callBack);
|
||||
|
||||
/**
|
||||
* Set callback event functions for when the blinker has blink n times
|
||||
* @param me the blinker itseld
|
||||
* @param callBack callBack function when the blinker has blink n times
|
||||
*/
|
||||
void BLINKER_setFinished(BLINKER* me, blinkerCallBack callBack);
|
||||
|
||||
/**
|
||||
* define number of time the Blinker have to blink
|
||||
* @param me the blinker itself
|
||||
@@ -120,6 +128,8 @@ bool BLINKER_processEvent(Event* ev);
|
||||
*/
|
||||
void BLINKER_endBlink(BLINKER* me);
|
||||
|
||||
void BLINKER_toggle(BLINKER* me);
|
||||
|
||||
|
||||
#endif /* BLINKER_H */
|
||||
|
||||
|
||||
@@ -147,5 +147,7 @@ bool CLICK_HANDLER_processEvent(Event* ev) {
|
||||
case STCH_DOUBLE_CLICK:
|
||||
break;
|
||||
}
|
||||
processed = true;
|
||||
}
|
||||
return processed;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<logicalFolder name="factory" displayName="factory" projectFiles="true">
|
||||
<itemPath>ch/kb28/blinkerProject/app/factory/factory.h</itemPath>
|
||||
</logicalFolder>
|
||||
<itemPath>ch/kb28/blinkerProject/app/app.h</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="board" displayName="board" projectFiles="true">
|
||||
<logicalFolder name="button" displayName="button" projectFiles="true">
|
||||
@@ -28,7 +29,7 @@
|
||||
</logicalFolder>
|
||||
<logicalFolder name="middleware" displayName="middleware" projectFiles="true">
|
||||
<itemPath>ch/kb28/blinkerProject/middleware/clickHandler.h</itemPath>
|
||||
<itemPath>ch/kb28/blinkerProject/middleware/blinker.c</itemPath>
|
||||
<itemPath>ch/kb28/blinkerProject/middleware/blinker.h</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="xf" displayName="xf" projectFiles="true">
|
||||
<itemPath>ch/kb28/blinkerProject/xf/ireactive.h</itemPath>
|
||||
@@ -48,6 +49,7 @@
|
||||
<itemPath>ch/kb28/blinkerProject/app/factory/factory.c</itemPath>
|
||||
</logicalFolder>
|
||||
<itemPath>ch/kb28/blinkerProject/app/main.c</itemPath>
|
||||
<itemPath>ch/kb28/blinkerProject/app/app.c</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="board" displayName="board" projectFiles="true">
|
||||
<logicalFolder name="button" displayName="button" projectFiles="true">
|
||||
@@ -68,7 +70,7 @@
|
||||
</logicalFolder>
|
||||
<logicalFolder name="middleware" displayName="middleware" projectFiles="true">
|
||||
<itemPath>ch/kb28/blinkerProject/middleware/clickHandler.c</itemPath>
|
||||
<itemPath>ch/kb28/blinkerProject/middleware/blinker.h</itemPath>
|
||||
<itemPath>ch/kb28/blinkerProject/middleware/blinker.c</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="xf" displayName="xf" projectFiles="true">
|
||||
<itemPath>ch/kb28/blinkerProject/xf/xf.c</itemPath>
|
||||
@@ -95,7 +97,7 @@
|
||||
<platformTool>PICkit3PlatformTool</platformTool>
|
||||
<languageToolchain>XC8</languageToolchain>
|
||||
<languageToolchainVersion>2.41</languageToolchainVersion>
|
||||
<platform>2</platform>
|
||||
<platform>3</platform>
|
||||
</toolsSet>
|
||||
<packs>
|
||||
<pack name="PIC18F-K_DFP" vendor="Microchip" version="1.7.134"/>
|
||||
|
||||
BIN
HerederoRemiSemProj.zip
Normal file
BIN
HerederoRemiSemProj.zip
Normal file
Binary file not shown.
23
README.md
23
README.md
@@ -1,2 +1,25 @@
|
||||
# blinkerProject
|
||||
## Purpose
|
||||
This project is made during the 4th semester of study in Industrial Systems at the University of Engineering in Sion, Wallis, Switzerland. It is used to learn the basics of software design and c on a PIC18F.
|
||||
|
||||
## Description
|
||||
The project is a simple blinker with two buttons and two leds
|
||||
- Click the first button: led1 starts blinking
|
||||
- Click the first button again: led1 stops blinking
|
||||
- Click the second button: led10 starts blinking
|
||||
- Click the second button again: led10 stops blinking
|
||||
- Double click the first button: led1 blinks three times
|
||||
- Double click the second button: led10 blinks three times
|
||||
- Long click either the first or the second button: led1 and led10 start blinking
|
||||
- Long click either the first or the second button again: led1 and led10 stop
|
||||
blinking
|
||||
|
||||
You'll find complet description of the project in the folder "01-task_description".
|
||||
You'll find all the diagrams description in UML in the folder "02-UML".
|
||||
Finally you'll find all the code in the folder "03-software".
|
||||
|
||||
A test diagram as been made and no error has been found.
|
||||
|
||||
## TODO
|
||||
- [ ] change the button class for add callback method like other class
|
||||
- [ ] change all "defineCallBack" method and define it directly in the setter
|
||||
Reference in New Issue
Block a user