Skip to content

Commit af4f32e

Browse files
author
Janne Kiiskila
committed
Replace wait() with ThisThread::sleep_for()
As the wait() API has been deprecated, let's use what the deprecation note proposed instead. wait() used floats as input parameter (1 = 1 second), the sleep_for uses milliseconds. Ref; https://os.mbed.com/docs/mbed-os/v5.15/mbed-os-api-doxy/namespacertos_1_1_this_thread.html
1 parent 88d9218 commit af4f32e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ int main(void)
229229
} else if (in_char == 'r') {
230230
(void) fcc_storage_delete(); // When 'r' is pressed, erase storage and reboot the board.
231231
printf("Storage erased, rebooting the device.\n\n");
232-
wait(1);
232+
ThisThread::sleep_for(1*1000);
233233
NVIC_SystemReset();
234234
} else if (in_char > 0 && in_char != 0x03) { // Ctrl+C is 0x03 in Mbed OS and Linux returns negative number
235235
value_increment(); // Simulate button press

0 commit comments

Comments
 (0)