make green and red leds similarly controlled
[pulsecounter.git] / Pulsecounter-Prog.c
1 #include "Pulsecounter.h"\r
2 #include "Hal.h"\r
3 \r
4 static void buttonHandler(void);\r
5 \r
6 void main() {\r
7     Hal_init();\r
8     Hal_buttonEnable(buttonHandler);\r
9     Pulsecounter_start();\r
10     Hal_idleLoop();\r
11 }\r
12 \r
13 static void buttonHandler(void) {\r
14     Hal_greenLedOn();\r
15     Hal_redLedOn();\r
16     Hal_delay(500);\r
17     Hal_greenLedOff();\r
18     Hal_redLedOff();\r
19     Pulsecounter_event3_indicate();\r
20 }\r
21 \r
22 /* -------- SCHEMA CALLBACKS -------- */\r
23 \r
24 void Pulsecounter_connectHandler(void) {\r
25     Hal_connected();\r
26 }\r
27 \r
28 void Pulsecounter_disconnectHandler(void) {\r
29     Hal_disconnected();\r
30 }\r
31 \r
32 void Pulsecounter_event3_fetch(Pulsecounter_event3_t* const output) {\r
33     *output = buttonCnt;\r
34 }\r
35 \r
36 void Pulsecounter_event4_fetch(Pulsecounter_event4_t* const output) {\r
37     *output = 4;\r
38 }\r
39 \r
40 void Pulsecounter_event5_fetch(Pulsecounter_event5_t* const output) {\r
41     *output = 5;\r
42 }\r