File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
mbed_drivers/watchdog_reset Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -195,17 +195,17 @@ void test_deepsleep_reset()
195
195
// Phase 1. -- run the test code.
196
196
Semaphore sem (0 , 1 );
197
197
LowPowerTimeout lp_timeout;
198
- if (send_reset_notification (¤t_case, 2 * TIMEOUT_MS) == false ) {
198
+ if (send_reset_notification (¤t_case, 2 * TIMEOUT_MS + SERIAL_FLUSH_TIME_MS ) == false ) {
199
199
TEST_ASSERT_MESSAGE (0 , " Dev-host communication error." );
200
200
return ;
201
201
}
202
+ wait_us (SERIAL_FLUSH_TIME_US); // Wait for the serial buffers to flush.
202
203
Watchdog &watchdog = Watchdog::get_instance ();
203
204
TEST_ASSERT_FALSE (watchdog.is_running ());
204
205
TEST_ASSERT_TRUE (watchdog.start (TIMEOUT_MS));
205
206
TEST_ASSERT_TRUE (watchdog.is_running ());
206
207
// Watchdog should fire before twice the timeout value.
207
208
lp_timeout.attach_us (mbed::callback (release_sem, &sem), 1000ULL * (2 * TIMEOUT_MS));
208
- wait_us (SERIAL_FLUSH_TIME_US); // Wait for the serial buffers to flush.
209
209
if (!sleep_manager_can_deep_sleep ()) {
210
210
TEST_ASSERT_MESSAGE (0 , " Deepsleep should be allowed." );
211
211
}
Original file line number Diff line number Diff line change @@ -189,14 +189,14 @@ void test_deepsleep_reset()
189
189
watchdog_config_t config = { TIMEOUT_MS };
190
190
Semaphore sem (0 , 1 );
191
191
LowPowerTimeout lp_timeout;
192
- if (send_reset_notification (¤t_case, 2 * TIMEOUT_MS) == false ) {
192
+ if (send_reset_notification (¤t_case, 2 * TIMEOUT_MS + SERIAL_FLUSH_TIME_MS ) == false ) {
193
193
TEST_ASSERT_MESSAGE (0 , " Dev-host communication error." );
194
194
return ;
195
195
}
196
+ wait_us (SERIAL_FLUSH_TIME_US); // Wait for the serial buffers to flush.
196
197
TEST_ASSERT_EQUAL (WATCHDOG_STATUS_OK, hal_watchdog_init (&config));
197
198
// Watchdog should fire before twice the timeout value.
198
199
lp_timeout.attach_us (mbed::callback (release_sem, &sem), 1000ULL * (2 * TIMEOUT_MS));
199
- wait_us (SERIAL_FLUSH_TIME_US); // Wait for the serial buffers to flush.
200
200
if (!sleep_manager_can_deep_sleep ()) {
201
201
TEST_ASSERT_MESSAGE (0 , " Deepsleep should be allowed." );
202
202
}
You can’t perform that action at this time.
0 commit comments