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()
195195 // Phase 1. -- run the test code.
196196 Semaphore sem (0 , 1 );
197197 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 ) {
199199 TEST_ASSERT_MESSAGE (0 , " Dev-host communication error." );
200200 return ;
201201 }
202+ wait_us (SERIAL_FLUSH_TIME_US); // Wait for the serial buffers to flush.
202203 Watchdog &watchdog = Watchdog::get_instance ();
203204 TEST_ASSERT_FALSE (watchdog.is_running ());
204205 TEST_ASSERT_TRUE (watchdog.start (TIMEOUT_MS));
205206 TEST_ASSERT_TRUE (watchdog.is_running ());
206207 // Watchdog should fire before twice the timeout value.
207208 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.
209209 if (!sleep_manager_can_deep_sleep ()) {
210210 TEST_ASSERT_MESSAGE (0 , " Deepsleep should be allowed." );
211211 }
Original file line number Diff line number Diff line change @@ -189,14 +189,14 @@ void test_deepsleep_reset()
189189 watchdog_config_t config = { TIMEOUT_MS };
190190 Semaphore sem (0 , 1 );
191191 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 ) {
193193 TEST_ASSERT_MESSAGE (0 , " Dev-host communication error." );
194194 return ;
195195 }
196+ wait_us (SERIAL_FLUSH_TIME_US); // Wait for the serial buffers to flush.
196197 TEST_ASSERT_EQUAL (WATCHDOG_STATUS_OK, hal_watchdog_init (&config));
197198 // Watchdog should fire before twice the timeout value.
198199 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.
200200 if (!sleep_manager_can_deep_sleep ()) {
201201 TEST_ASSERT_MESSAGE (0 , " Deepsleep should be allowed." );
202202 }
You can’t perform that action at this time.
0 commit comments