2019
Revision 3:40d2f4b36756, committed 2019-09-20
- Comitter:
- noutram
- Date:
- Fri Sep 20 15:11:33 2019 +0000
- Parent:
- 2:47c9c24b49fc
- Child:
- 5:5f579d4074a0
- Commit message:
- 2019
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed-os.lib | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Oct 31 13:46:40 2017 +0000
+++ b/main.cpp Fri Sep 20 15:11:33 2019 +0000
@@ -16,14 +16,14 @@
DigitalIn SW2(PE_14);
//Create thread objects
-Thread t1, t2;
+Thread t1, t2, t3;
//Thread
void Function1()
{
while (true) {
redLED = !redLED;
- Thread::wait(2000);
+ ThisThread::sleep_for(2000);
}
}
@@ -32,7 +32,16 @@
{
while (true) {
yellowLED = !yellowLED;
- Thread::wait(1000);
+ ThisThread::sleep_for(1000);
+ }
+}
+
+//Green Flashing
+void Function3()
+{
+ while (true) {
+ greenLED = !greenLED;
+ ThisThread::sleep_for(500);
}
}
@@ -46,11 +55,12 @@
//Create and run threads (C function pointers)
t1.start(Function1);
t2.start(Function2);
-
+ t3.start(Function3);
+
//Main thread loop
while(1) {
- //Thread::wait(osWaitForever);
- Thread::wait(5000);
+ //ThisThread::sleep_for(osWaitForever);
+ ThisThread::sleep_for(5000);
printf("Main is Awake\n"); //Should not happen when osWaitForever is used
}
}
--- a/mbed-os.lib Tue Oct 31 13:46:40 2017 +0000 +++ b/mbed-os.lib Fri Sep 20 15:11:33 2019 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#e62a1b9236b44e70ae3b0902dc538481c04d455b +https://github.com/ARMmbed/mbed-os/#1bf6b20df9d3cd5f29f001ffc6f0d0fcbbb96118