From e9671ee04f08606d844d5b8f45fd2c84d7feaae3 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Wed, 9 Nov 2022 10:34:13 +0800 Subject: [PATCH 1/2] esp_timer: fix ESP_TIMER_ISR dispatch method due to off by one error --- components/esp_timer/test_apps/main/test_esp_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp_timer/test_apps/main/test_esp_timer.c b/components/esp_timer/test_apps/main/test_esp_timer.c index ee3aa7dd85..d88343229f 100644 --- a/components/esp_timer/test_apps/main/test_esp_timer.c +++ b/components/esp_timer/test_apps/main/test_esp_timer.c @@ -959,7 +959,7 @@ static void timer_isr_callback(void* arg) int64_t now = esp_timer_get_time(); int64_t dt = now - old_time[num_timer]; old_time[num_timer] = now; - if (num_timer == 1) { + if (num_timer == 0) { esp_rom_printf("(%lld): \t\t\t\t timer ISR, dt: %lld us\n", now, dt); assert(xPortInIsrContext()); } else { @@ -971,7 +971,7 @@ static void timer_isr_callback(void* arg) TEST_CASE("Test ESP_TIMER_ISR dispatch method", "[esp_timer]") { TEST_ESP_OK(esp_timer_dump(stdout)); - int timer[2]= {1, 2}; + int timer[2]= {0, 1}; const esp_timer_create_args_t periodic_timer1_args = { .callback = &timer_isr_callback, .dispatch_method = ESP_TIMER_ISR, From 8d24aa1760966966fbd07f326f21d6289513d475 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Wed, 9 Nov 2022 10:48:04 +0800 Subject: [PATCH 2/2] ci: fix esp_timer 26 MHz not being assigned to correct runner --- .../esp_timer/test_apps/pytest_esp_timer_ut.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/components/esp_timer/test_apps/pytest_esp_timer_ut.py b/components/esp_timer/test_apps/pytest_esp_timer_ut.py index 20b5319184..4587730bdb 100644 --- a/components/esp_timer/test_apps/pytest_esp_timer_ut.py +++ b/components/esp_timer/test_apps/pytest_esp_timer_ut.py @@ -10,7 +10,6 @@ CONFIGS = [ pytest.param('single_core', marks=[pytest.mark.esp32]), pytest.param('freertos_compliance', marks=[pytest.mark.esp32]), pytest.param('isr_dispatch_esp32', marks=[pytest.mark.esp32]), - pytest.param('26mhz_esp32c2', marks=[pytest.mark.esp32c2]), ] @@ -31,3 +30,18 @@ def test_esp_timer_psram(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests') dut.write('*') dut.expect_unity_test_output(timeout=240) + + +@pytest.mark.esp32c2 +@pytest.mark.xtal_26mhz +@pytest.mark.parametrize( + 'config, baud', + [ + ('26mhz_esp32c2', '74880'), + ], + indirect=True, +) +def test_esp_timer_esp32c2_xtal_26mhz(dut: Dut) -> None: + dut.expect_exact('Press ENTER to see the list of tests') + dut.write('*') + dut.expect_unity_test_output(timeout=240)