Thread example
Diff: main.cpp
- Revision:
- 3:4090b465745c
- Parent:
- 2:47c9c24b49fc
- Child:
- 4:19bf8c7e9b56
--- a/main.cpp Tue Oct 31 13:46:40 2017 +0000
+++ b/main.cpp Fri Sep 20 15:11:07 2019 +0000
@@ -23,7 +23,7 @@
{
while (true) {
redLED = !redLED;
- Thread::wait(2000);
+ ThisThread::sleep_for(2000);
}
}
@@ -32,7 +32,7 @@
{
while (true) {
yellowLED = !yellowLED;
- Thread::wait(1000);
+ ThisThread::sleep_for(1000);
}
}
@@ -49,8 +49,8 @@
//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
}
}