Skip to content

Commit 3cb1ca2

Browse files
Fix common tickers test
1 parent dcb3b2d commit 3cb1ca2

File tree

1 file changed

+5
-4
lines changed
  • hal/tests/TESTS/mbed_hal/common_tickers

1 file changed

+5
-4
lines changed

hal/tests/TESTS/mbed_hal/common_tickers/main.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,9 @@ void ticker_disable_test()
278278
intf->set_interrupt(intf->read() + ticksFor100us);
279279
intf->disable_interrupt();
280280

281-
// Verify that it does not fire
282-
wait_us(200);
281+
// Verify that it does not fire. Note that we cannot use wait_us here as it uses the us ticker
282+
// which is currently suspended.
283+
wait_ns(200000);
283284
TEST_ASSERT_EQUAL_INT(0, intFlag);
284285

285286
// Now reset the interrupt again.
@@ -289,11 +290,11 @@ void ticker_disable_test()
289290
TEST_ASSERT_EQUAL_INT_MESSAGE(0, intFlag, "Ticker fired during set_interrupt() while disabled! Check that set_interrupt() function clears pending timer compare.");
290291

291292
// Still not yet
292-
wait_us(20);
293+
wait_ns(20000);
293294
TEST_ASSERT_EQUAL_INT(0, intFlag);
294295

295296
// NOW it should have fired
296-
wait_us(170);
297+
wait_ns(170000);
297298
TEST_ASSERT_EQUAL_INT(1, intFlag);
298299
}
299300

0 commit comments

Comments
 (0)