diff --git a/libraries/tests/rtos/mbed/timer/main.cpp b/libraries/tests/rtos/mbed/timer/main.cpp index 3cf00b6809..c606f993a8 100644 --- a/libraries/tests/rtos/mbed/timer/main.cpp +++ b/libraries/tests/rtos/mbed/timer/main.cpp @@ -5,8 +5,20 @@ DigitalOut LEDs[4] = { DigitalOut(LED1), DigitalOut(LED2), DigitalOut(LED3), DigitalOut(LED4) }; +void print_char(char c = '*') +{ + printf("%c", c); + fflush(stdout); +} + void blink(void const *n) { - LEDs[(int)n] = !LEDs[(int)n]; + static int counter = 0; + const int led_id = int(n); + LEDs[led_id] = !LEDs[led_id]; + if (++counter == 75) { + print_char(); + counter = 0; + } } int main(void) { @@ -14,11 +26,11 @@ int main(void) { RtosTimer led_2_timer(blink, osTimerPeriodic, (void *)1); RtosTimer led_3_timer(blink, osTimerPeriodic, (void *)2); RtosTimer led_4_timer(blink, osTimerPeriodic, (void *)3); - - led_1_timer.start(2000); - led_2_timer.start(1000); - led_3_timer.start(500); - led_4_timer.start(250); - + + led_1_timer.start(200); + led_2_timer.start(100); + led_3_timer.start(50); + led_4_timer.start(25); + Thread::wait(osWaitForever); } diff --git a/workspace_tools/tests.py b/workspace_tools/tests.py index ce05b852d1..c48d2c45c1 100644 --- a/workspace_tools/tests.py +++ b/workspace_tools/tests.py @@ -536,6 +536,9 @@ TESTS = [ "id": "RTOS_7", "description": "Timer", "source_dir": join(TEST_DIR, "rtos", "mbed", "timer"), "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + "duration": 15, + "automated": True, + "host_test": "wait_us_auto" }, { "id": "RTOS_8", "description": "ISR",