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 0:2653983c73e9, committed 2017-01-07
- Comitter:
- dhpt
- Date:
- Sat Jan 07 04:32:00 2017 +0000
- Commit message:
- rtos test
Changed in this revision
diff -r 000000000000 -r 2653983c73e9 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Jan 07 04:32:00 2017 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include "rtos.h"
+
+DigitalOut myled1(LED1);
+DigitalOut myled2(LED2);
+
+Timer t;
+
+void thread_LED2(void)
+{
+ float st, ct;
+ t.start();
+ while(1) {
+ st = t.read_ms();
+ myled2 = 1;
+ wait(0.2);
+ myled2 = 0;
+ wait(0.2);
+ ct = t.read_ms();
+ Thread::wait((uint32_t)(1000.0 - (ct - st)));
+
+ }
+}
+
+
+int main()
+{
+ Thread thread(thread_LED2);
+ while(1) {
+
+ myled1 = 1;
+ wait(0.2);
+ myled1 = 0;
+ wait(0.2);
+
+ }
+}
diff -r 000000000000 -r 2653983c73e9 mbed-rtos.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Sat Jan 07 04:32:00 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-rtos/#58563e6cba1e
diff -r 000000000000 -r 2653983c73e9 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Jan 07 04:32:00 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/99b5ccf27215 \ No newline at end of file