From 373735d5290c3d0869fe014e4bd93e5d4824c89b Mon Sep 17 00:00:00 2001 From: barthess Date: Sun, 18 Sep 2011 11:50:31 +0000 Subject: [PATCH] EXT_WAKEUP test minor improvements. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3340 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32F1xx/EXT_WAKEUP/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/testhal/STM32F1xx/EXT_WAKEUP/main.c b/testhal/STM32F1xx/EXT_WAKEUP/main.c index 36442fa58..26c8f9433 100644 --- a/testhal/STM32F1xx/EXT_WAKEUP/main.c +++ b/testhal/STM32F1xx/EXT_WAKEUP/main.c @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - #include "ch.h" #include "hal.h" @@ -87,7 +86,7 @@ static void cmd_reboot(BaseChannel *chp, int argc, char *argv[]){ return; } chprintf(chp, "rebooting...\r\n"); - SCB->SCR |= SCB_AIRCR_SYSRESETREQ_Msk; + NVIC_SystemReset(); } static void cmd_sleep(BaseChannel *chp, int argc, char *argv[]){ @@ -96,9 +95,9 @@ static void cmd_sleep(BaseChannel *chp, int argc, char *argv[]){ chprintf(chp, "Usage: sleep\r\n"); return; } - chprintf(chp, "going to sleep...\r\ntype any character to wake up..."); + chprintf(chp, "Going to sleep. Type any character to wake up.\r\n"); - chThdSleepMilliseconds(200); // timeout to print message in terminal + chThdSleepMilliseconds(200); // time to print out message in terminal extChannelEnable(&EXTD1, 10); chThdSleepMilliseconds(5); @@ -154,8 +153,10 @@ int main(void) { * Normal main() thread activity, in this demo it enables and disables the * button EXT channel using 5 seconds intervals. */ + + chThdSleepMilliseconds(2000); // timeuot to differ reboot and wake up from sleep while (TRUE) { - chThdSleepMilliseconds(250); + chThdSleepMilliseconds(100); palTogglePad(IOPORT3, GPIOC_LED); } }