aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/NRF51/NRF51822/WDG/main.c
diff options
context:
space:
mode:
authorFabio Utzig <utzig@utzig.org>2016-04-10 21:11:14 -0300
committerFabio Utzig <utzig@utzig.org>2016-04-10 21:11:14 -0300
commit16dd3d3f35dd0d6326b12a23d3e7cc54b2f1ecd5 (patch)
tree9c9f9c7aafc53cf39a3ad94f0472caef05aa0086 /testhal/NRF51/NRF51822/WDG/main.c
parentef40620f3c013f785fbd9a9043ed53a370e699ac (diff)
parentb72393fff0b6449d839b8a8464c199b7e9146159 (diff)
downloadChibiOS-Contrib-16dd3d3f35dd0d6326b12a23d3e7cc54b2f1ecd5.tar.gz
ChibiOS-Contrib-16dd3d3f35dd0d6326b12a23d3e7cc54b2f1ecd5.tar.bz2
ChibiOS-Contrib-16dd3d3f35dd0d6326b12a23d3e7cc54b2f1ecd5.zip
Merge pull request #48 from utzig/fix-nrf51-port
Fix nrf51 port
Diffstat (limited to 'testhal/NRF51/NRF51822/WDG/main.c')
-rw-r--r--testhal/NRF51/NRF51822/WDG/main.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/testhal/NRF51/NRF51822/WDG/main.c b/testhal/NRF51/NRF51822/WDG/main.c
index 741d84f..cdbf89b 100644
--- a/testhal/NRF51/NRF51822/WDG/main.c
+++ b/testhal/NRF51/NRF51822/WDG/main.c
@@ -16,12 +16,10 @@
#include "ch.h"
#include "hal.h"
-
-
void timeout_callback(void) {
- palTogglePad(IOPORT1, LED2);
- palTogglePad(IOPORT1, LED3);
- palTogglePad(IOPORT1, LED4);
+ palTogglePad(IOPORT1, LED2);
+ palTogglePad(IOPORT1, LED3);
+ palTogglePad(IOPORT1, LED4);
}
/*
@@ -39,27 +37,24 @@ int main(void) {
halInit();
chSysInit();
-
palSetPad(IOPORT1, LED1);
WDGConfig WDG_config = {
- .flags.pause_on_sleep = 0,
- .flags.pause_on_halt = 0,
- .timeout_ms = 5000,
- .callback = timeout_callback
+ .flags.pause_on_sleep = 0,
+ .flags.pause_on_halt = 0,
+ .timeout_ms = 5000,
+ .callback = timeout_callback
};
wdgStart(&WDGD1, &WDG_config);
-
-
/*
* Normal main() thread activity, in this demo it does nothing.
*/
while (true) {
if (palReadPad(IOPORT1, BTN1) == 0) {
- palTogglePad(IOPORT1, LED1);
- wdgReset(&WDGD1);
+ palTogglePad(IOPORT1, LED1);
+ wdgReset(&WDGD1);
}
chThdSleepMilliseconds(500);
}