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.
Fork of LMiC by
Revision 2:002940b52fb4, committed 2015-09-16
- Comitter:
- janjongboom
- Date:
- Wed Sep 16 14:51:01 2015 +0000
- Parent:
- 1:d3b7bde3995c
- Commit message:
- sdafdrsa
Changed in this revision
oslmic.cpp | Show annotated file Show diff for this revision Revisions of this file |
oslmic.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/oslmic.cpp Tue Mar 31 13:36:56 2015 +0000 +++ b/oslmic.cpp Wed Sep 16 14:51:01 2015 +0000 @@ -103,3 +103,22 @@ } } } + +void os_inner_loop () { + osjob_t* j = NULL; + hal_disableIRQs(); + // check for runnable jobs + if(OS.runnablejobs) { + j = OS.runnablejobs; + OS.runnablejobs = j->next; + } else if(OS.scheduledjobs && hal_checkTimer(OS.scheduledjobs->deadline)) { // check for expired timed jobs + j = OS.scheduledjobs; + OS.scheduledjobs = j->next; + } else { // nothing pending +// hal_sleep(); // wake by irq (timer already restarted) + } + hal_enableIRQs(); + if(j) { // run job callback + j->func(j); + } +}
--- a/oslmic.h Tue Mar 31 13:36:56 2015 +0000 +++ b/oslmic.h Wed Sep 16 14:51:01 2015 +0000 @@ -81,6 +81,7 @@ void radio_irq_handler (u1_t dio); void os_init (void); void os_runloop (void); +void os_inner_loop (void); //================================================================================