Skip to content

Commit 60a3a4e

Browse files
author
Jamie Smith
authored
Fix overflow issue causing common tickers test to intermittently fail (ARMmbed#57)
* Fix overflow issue causing common tickers test to intermittently fail (ARMmbed#44) * Tabs -> spaces
1 parent 1d44be2 commit 60a3a4e

File tree

1 file changed

+2
-2
lines changed
  • hal/tests/TESTS/mbed_hal/common_tickers

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ void ticker_interrupt_test(void)
221221
uint8_t run_count = 0;
222222
const ticker_info_t *p_ticker_info = intf->get_info();
223223

224-
overflow_protect();
225-
226224
for (uint32_t i = 0; i < (sizeof(ticker_timeout) / sizeof(uint32_t)); i++) {
225+
// If needed, delay until we can run the test without overflowing the ticker.
226+
overflow_protect();
227227

228228
/* Skip timeout if less than max allowed execution time of set_interrupt() - 20 us */
229229
if (TICKS_TO_US(ticker_timeout[i], p_ticker_info->frequency) < (MAX_FUNC_EXEC_TIME_US + DELTA_FUNC_EXEC_TIME_US)) {

0 commit comments

Comments
 (0)