From cbb15ad9ac58c1df622f911daaa3a33bb2d5c5a6 Mon Sep 17 00:00:00 2001 From: Rajkumar Kanagaraj Date: Tue, 31 Mar 2020 17:14:49 +0100 Subject: [PATCH] ThisThread::sleep_for is asserted when the PWM test case calls this API with IRQ masked, so wait_us is used to fix this issue as PWM testes to be executed with interrupt disabled to avoid context switch. --- TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp b/TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp index 489f68be3f..5220221a10 100644 --- a/TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp +++ b/TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp @@ -127,11 +127,11 @@ void fpga_pwm_period_fill_test(PinName pin, uint32_t period_ms, uint32_t fill_pr break; } - ThisThread::sleep_for(period_ms); + wait_us(PERIOD_US(period_ms)); tester.io_metrics_start(); - ThisThread::sleep_for(NUM_OF_PERIODS * period_ms); + wait_us(NUM_OF_PERIODS * PERIOD_US(period_ms)); tester.io_metrics_stop(); core_util_critical_section_exit();