Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:8ba32924482c, committed 2016-11-18
- Comitter:
- dkato
- Date:
- Fri Nov 18 09:42:04 2016 +0000
- Parent:
- 0:680321964ff9
- Child:
- 2:22bc64c6ee90
- Commit message:
- Add attach_idle_hook().
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Nov 18 08:52:33 2016 +0000
+++ b/main.cpp Fri Nov 18 09:42:04 2016 +0000
@@ -4,6 +4,13 @@
InterruptIn button(USER_BUTTON0);
DigitalOut led1(LED1);
Thread * pTestTask = NULL;
+static int debug_cnt = 0; // for debug
+
+static void idle_hook(void) {
+ __SEV();
+ __WFE();
+ __WFE();
+}
static void interrupt_button(void) {
if (pTestTask != NULL) {
@@ -26,6 +33,7 @@
}
int main() {
+ Thread::attach_idle_hook(idle_hook);
pTestTask = new Thread();
pTestTask->start(test_task);
}