From 2c1bada7678d916d259b39aaadbd09d1587d3c9a Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 15 Sep 2026 11:45:51 +0800 Subject: [PATCH] fix(ana_cmpr): adjust delta_us tolerance for ESP32-H4 capture timestamps test The overhead of trigger_scan() is ~10 us * resample_limit (3) = ~30 us, plus the 100 us delay inserted between two trigger_scan() calls, so the total delta_us on ESP32-H4 should be around 130 us. Widen the assertion window accordingly. --- .../test_apps/analog_comparator/main/test_ana_cmpr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/esp_driver_ana_cmpr/test_apps/analog_comparator/main/test_ana_cmpr.cpp b/components/esp_driver_ana_cmpr/test_apps/analog_comparator/main/test_ana_cmpr.cpp index 78f4ab3e845..86c0709c47c 100644 --- a/components/esp_driver_ana_cmpr/test_apps/analog_comparator/main/test_ana_cmpr.cpp +++ b/components/esp_driver_ana_cmpr/test_apps/analog_comparator/main/test_ana_cmpr.cpp @@ -493,7 +493,9 @@ TEST_CASE("ana_cmpr capture timestamps", "[ana_cmpr]") printf("ana_cmpr capture timestamps: current=%" PRIu32 ", previous=%" PRIu32 ", delta_ticks=%" PRIu32 ", delta_us=%" PRIu32 "\r\n", current, previous, delta_ticks, delta_us); #if CONFIG_IDF_TARGET_ESP32H4 - TEST_ASSERT_UINT_WITHIN(50, 100, delta_us); + // the overhead of trigger_scan() is ~10 us * resample_limit (3) = ~30 us, + // plus the 100 us delay we inserted, so the total delta_us should be around 130 us + TEST_ASSERT_UINT_WITHIN(30, 130, delta_us); #else // We insert ~100 us delay between two trigger_scan() calls. TEST_ASSERT_UINT_WITHIN(20, 100, delta_us);