From f7c21372ca2791a8a1578f72ec8ccd97e760c07f Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Mon, 28 Apr 2025 17:17:24 +0200 Subject: [PATCH] change(newlib): Added unit tests for usleep and sleep_for functions This commit adds unit tests to verify the basic functionality of usleep() and this_thread::sleep_for() std functions. --- .../test_apps/legacy_mcpwm_driver/main/test_legacy_mcpwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/driver/test_apps/legacy_mcpwm_driver/main/test_legacy_mcpwm.c b/components/driver/test_apps/legacy_mcpwm_driver/main/test_legacy_mcpwm.c index a3980cbf58..acc1065098 100644 --- a/components/driver/test_apps/legacy_mcpwm_driver/main/test_legacy_mcpwm.c +++ b/components/driver/test_apps/legacy_mcpwm_driver/main/test_legacy_mcpwm.c @@ -159,7 +159,7 @@ static uint32_t pcnt_get_pulse_number(pcnt_unit_handle_t pwm_pcnt_unit, int capt int count_value = 0; TEST_ESP_OK(pcnt_unit_clear_count(pwm_pcnt_unit)); TEST_ESP_OK(pcnt_unit_start(pwm_pcnt_unit)); - usleep(capture_window_ms * 1000); + vTaskDelay(pdMS_TO_TICKS(capture_window_ms)); TEST_ESP_OK(pcnt_unit_stop(pwm_pcnt_unit)); TEST_ESP_OK(pcnt_unit_get_count(pwm_pcnt_unit, &count_value)); printf("count value: %d\r\n", count_value);