diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-18 11:50:31 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-18 11:50:31 +0000 |
commit | 373735d5290c3d0869fe014e4bd93e5d4824c89b (patch) | |
tree | 1f4ac5b06a774c61311449bc047f8d390c236fe4 | |
parent | 94edbcb6cb917c1e5c34384c134cd661dda81d7a (diff) | |
download | ChibiOS-373735d5290c3d0869fe014e4bd93e5d4824c89b.tar.gz ChibiOS-373735d5290c3d0869fe014e4bd93e5d4824c89b.tar.bz2 ChibiOS-373735d5290c3d0869fe014e4bd93e5d4824c89b.zip |
EXT_WAKEUP test minor improvements.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3340 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | testhal/STM32F1xx/EXT_WAKEUP/main.c | 11 |
1 files 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 <http://www.gnu.org/licenses/>.
*/
-
#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);
}
}
|