green rosh / Mbed 2 deprecated resetting_program

Dependencies:   mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
greenroshks
Date:
Sat Jun 21 06:46:14 2014 +0000
Commit message:
Resetting program

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Jun 21 06:46:14 2014 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+#include "rtos.h"
+
+Timer t;
+DigitalOut myled(LED1);
+Serial pc(USBTX,USBRX);
+Thread *thp;
+
+void stuff(void const * args)
+{
+   // int a;
+    while(1)
+    {
+        pc.printf("\nhey \n");
+        t.start();
+        pc.getc();
+        t.stop();
+        t.reset();
+        pc.printf("\nGottil\n");
+    }
+}
+int main() 
+{
+   thp = new Thread(stuff);
+   while(1)
+   {
+       if(t.read()>10.0)
+       {
+            t.stop();
+            t.reset();
+            thp->terminate();
+            delete thp;
+            thp=new Thread(stuff);
+            
+            pc.printf("restarted");
+        }
+       
+    }
+   
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Sat Jun 21 06:46:14 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#ac8d036315ed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Jun 21 06:46:14 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/024bf7f99721
\ No newline at end of file