feat(esp_timer): Re-enable tests on ESP32P4

esp_timer example test requires Light Sleep support.
This commit is contained in:
Konstantin Kondrashov
2024-01-30 13:39:23 +02:00
parent d92cd1b7ec
commit 2b909f99d5
8 changed files with 13 additions and 25 deletions

View File

@@ -71,11 +71,7 @@ examples/system/esp_timer:
disable:
- if: IDF_TARGET in ["esp32p4"]
temporary: true
reason: target(s) is not supported yet # TODO: IDF-7529
disable_test:
- if: IDF_TARGET in ["esp32c6", "esp32h2"]
temporary: true
reason: lack of runner
reason: Light Sleep support TBD # TODO: IDF-7528
depends_components:
- esp_timer

View File

@@ -70,7 +70,7 @@ void app_main(void)
int64_t t2 = esp_timer_get_time();
ESP_LOGI(TAG, "Woke up from light sleep, time since boot: %lld us", t2);
assert(llabs((t2 - t1) - 500000) < 1000);
assert(llabs((t2 - t1) - 500000) < 1200);
/* Let the timer run for a little bit more */
usleep(2000000);

View File

@@ -1,6 +1,5 @@
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import logging
import pytest
@@ -29,7 +28,7 @@ ONE_SHOT_TIMER_PERIOD = 5000000
@pytest.mark.supported_targets
@pytest.mark.temp_skip_ci(targets=['esp32c6', 'esp32h2', 'esp32p4'], reason='c6/h2/p4 support TBD') # TODO: IDF-8979
@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='Light Sleep support TBD') # TODO: IDF-7528
@pytest.mark.generic
@pytest.mark.parametrize(
'config',
@@ -60,7 +59,7 @@ def test_esp_timer(dut: Dut) -> None:
one_shot_timer_time = int(match.group(1))
diff = start_time + ONE_SHOT_TIMER_PERIOD - one_shot_timer_time
logging.info('One-shot timer, time: {} us, diff: {}'.format(one_shot_timer_time, diff))
assert abs(diff) < 350
assert abs(diff) < 400
match = dut.expect(RESTART_REGEX, timeout=3)
start_time = int(match.group(1))
@@ -82,7 +81,7 @@ def test_esp_timer(dut: Dut) -> None:
logging.info('Enter sleep: {}, exit sleep: {}, slept: {}'.format(
sleep_enter_time, sleep_exit_time, sleep_time))
assert abs(sleep_time - LIGHT_SLEEP_TIME) < 1000
assert abs(sleep_time - LIGHT_SLEEP_TIME) < 1200
for i in range(5, 7):
match = dut.expect(PERIODIC_TIMER_REGEX, timeout=2)