Skip to content

Commit 0fd1e7e

Browse files
committed
Call thread_sleep_for to sleep
This function is more generic as it decides the appropriate call to make depending on whether an RTOS is present or not.
1 parent 7d8d9b5 commit 0fd1e7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: main.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
#include "mbed.h"
7-
#include "ThisThread.h"
7+
#include "platform/mbed_thread.h"
88
#include "stats_report.h"
99

1010
DigitalOut led1(LED1);
@@ -21,7 +21,7 @@ int main()
2121
while (true) {
2222
// Blink LED and wait 0.5 seconds
2323
led1 = !led1;
24-
ThisThread::sleep_for(SLEEP_TIME);
24+
thread_sleep_for(SLEEP_TIME);
2525

2626
if ((0 == count) || (PRINT_AFTER_N_LOOPS == count)) {
2727
// Following the main thread wait, report on the current system status

0 commit comments

Comments
 (0)