Apparenlty I changed something

Fork of LMiC by Semtech

Files at this revision

API Documentation at this revision

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
diff -r d3b7bde3995c -r 002940b52fb4 oslmic.cpp
--- 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);
+    }
+}
diff -r d3b7bde3995c -r 002940b52fb4 oslmic.h
--- 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);
 
 //================================================================================