Daiki Kato
/
Sleep_test_no_OS
This is a sample to make sleep without using OS.
main.cpp
- Committer:
- dkato
- Date:
- 2016-11-18
- Revision:
- 0:19a3b76f6ca9
- Child:
- 1:ec156833bab2
File content as of revision 0:19a3b76f6ca9:
#include "mbed.h" InterruptIn button(USER_BUTTON0); DigitalOut led1(LED1); static void interrupt_button(void) { // do nothing } int main() { int test_cnt = 0; button.fall(&interrupt_button); button.rise(&interrupt_button); while (true) { // Transition to Sleep Mode __WFI(); led1 = !led1; printf("%d\n", test_cnt++); } }