Very simple cooperative round-robin task scheduler. See examples.

Dependents:   Garage_Control

Files at this revision

API Documentation at this revision

Comitter:
AjK
Date:
Fri Mar 04 13:55:15 2011 +0000
Parent:
3:95ec5c83c2fe
Commit message:
1.3 See ChangeLoh.h

Changed in this revision

ChangeLog.h Show annotated file Show diff for this revision Revisions of this file
Examples/example3.h Show annotated file Show diff for this revision Revisions of this file
diff -r 95ec5c83c2fe -r 49652acb6806 ChangeLog.h
--- a/ChangeLog.h	Fri Mar 04 13:10:39 2011 +0000
+++ b/ChangeLog.h	Fri Mar 04 13:55:15 2011 +0000
@@ -1,5 +1,8 @@
 /*
 
+1.3     04/Mar/2011
+        Added even more documentation.
+        
 1.2     04/Mar/2011
         Added extra documentation.
         
diff -r 95ec5c83c2fe -r 49652acb6806 Examples/example3.h
--- a/Examples/example3.h	Fri Mar 04 13:10:39 2011 +0000
+++ b/Examples/example3.h	Fri Mar 04 13:55:15 2011 +0000
@@ -58,9 +58,14 @@
 DigitalOut led4(LED4);
 
 void f1(SimpleTask *task) {
-    // wait(1); 
-    t1 = Ton::On;
+    // wait(1);     
+    if (!t1.isRunning()) {
+        t1 = Ton::On;
+        // Code that should execute once before the wait() goes here.
+        // ...
+    }        
     if (t1) {
+        // This code will be executed once the timer times out.
         led1 = !led1; 
         t1.reset();
     }