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:fc3f87b1b901, committed 2017-04-21
- Comitter:
- tulanthoar
- Date:
- Fri Apr 21 19:46:15 2017 +0000
- Commit message:
- copy of mbed-rtos example
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Apr 21 19:46:15 2017 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include "rtos.h"
+
+void print_char(char c = '*')
+{
+ printf("%c", c);
+ fflush(stdout);
+}
+
+DigitalOut led1(LED1);
+
+void print_thread(void const *argument)
+{
+ while (true) {
+ Thread::wait(1000);
+ print_char();
+ }
+}
+
+int main()
+{
+ printf("\n\n*** RTOS basic example ***\n");
+ Thread thread(print_thread, NULL, osPriorityNormal, DEFAULT_STACK_SIZE);
+ while (true) {
+ led1 = !led1;
+ Thread::wait(500);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Fri Apr 21 19:46:15 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-rtos/#58563e6cba1e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Apr 21 19:46:15 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/97feb9bacc10 \ No newline at end of file