Skip to content

Commit 19c795c

Browse files
authored
Merge pull request #7224 from OpenNuvoton/nuvoton_fix_greentea_deepsleep
Fix Greentea test code with deepsleep
2 parents 0658544 + 39a6fa9 commit 19c795c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

TESTS/mbed_drivers/timeout/timeout_tests.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,19 @@ void test_deepsleep(void)
305305
LowPowerTimer timer;
306306

307307
/*
308-
* Since deepsleep() may shut down the UART peripheral, we wait for 10ms
308+
* Since deepsleep() may shut down the UART peripheral, we wait for 20ms
309309
* to allow for hardware serial buffers to completely flush.
310+
*
311+
* Take NUMAKER_PFM_NUC472 as an example:
312+
* Its UART peripheral has 16-byte Tx FIFO. With baud rate set to 9600, flush
313+
* Tx FIFO would take: 16 * 8 * 1000 / 9600 = 13.3 (ms). So set wait time to
314+
* 20ms here for safe.
310315
311316
* This should be replaced with a better function that checks if the
312317
* hardware buffers are empty. However, such an API does not exist now,
313318
* so we'll use the wait_ms() function for now.
314319
*/
315-
wait_ms(10);
320+
wait_ms(20);
316321

317322
timer.start();
318323
timeout.attach_callback(mbed::callback(sem_callback, &sem), delay_us);

0 commit comments

Comments
 (0)