Skip to content

Commit 4888ff2

Browse files
committed
Fix Greentea test common_tickers failed
1. Disable ticker interrupt which would interfere with fire_interrupt speed test 2. Enlarge test period to avoid timeout error
1 parent ab7b93c commit 4888ff2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

TESTS/mbed_hal/common_tickers/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,14 @@ void ticker_speed_test(void)
473473

474474
/* ---- Test fire_interrupt function. ---- */
475475
counter = NUM_OF_CALLS;
476+
/* Disable ticker interrupt which would interfere with speed test */
477+
core_util_critical_section_enter();
476478
start = us_ticker_read();
477479
while (counter--) {
478480
intf->fire_interrupt();
479481
}
480482
stop = us_ticker_read();
483+
core_util_critical_section_exit();
481484

482485
TEST_ASSERT(diff_us(start, stop, us_ticker_info) < (NUM_OF_CALLS * (MAX_FUNC_EXEC_TIME_US + DELTA_FUNC_EXEC_TIME_US)));
483486

@@ -569,7 +572,7 @@ utest::v1::status_t lp_ticker_teardown(const Case *const source, const size_t pa
569572

570573
utest::v1::status_t test_setup(const size_t number_of_cases)
571574
{
572-
GREENTEA_SETUP(30, "default_auto");
575+
GREENTEA_SETUP(80, "default_auto");
573576
return verbose_test_setup_handler(number_of_cases);
574577
}
575578

0 commit comments

Comments
 (0)