diff --git a/components/driver/test_apps/.build-test-rules.yml b/components/driver/test_apps/.build-test-rules.yml index cea2987e20..f9d3c10bb1 100644 --- a/components/driver/test_apps/.build-test-rules.yml +++ b/components/driver/test_apps/.build-test-rules.yml @@ -54,10 +54,6 @@ components/driver/test_apps/legacy_mcpwm_driver: components/driver/test_apps/legacy_pcnt_driver: disable: - if: SOC_PCNT_SUPPORTED != 1 - disable_test: - - if: IDF_TARGET == "esp32c5" - temporary: true - reason: target test failed # TODO [ESP32C5] IDF-10341 depends_filepatterns: - components/driver/deprecated/**/*pcnt* diff --git a/components/driver/test_apps/legacy_pcnt_driver/main/test_legacy_pcnt.c b/components/driver/test_apps/legacy_pcnt_driver/main/test_legacy_pcnt.c index 9c2c4a9287..80bd8657f3 100644 --- a/components/driver/test_apps/legacy_pcnt_driver/main/test_legacy_pcnt.c +++ b/components/driver/test_apps/legacy_pcnt_driver/main/test_legacy_pcnt.c @@ -30,16 +30,12 @@ #define PCNT_CTRL_VCC_IO 1 #define PCNT_CTRL_GND_IO 0 #else -#define PULSE_IO 12 +#define PULSE_IO 0 #define PCNT_INPUT_IO 4 #define PCNT_CTRL_VCC_IO 5 #define PCNT_CTRL_GND_IO 2 #endif -#define HIGHEST_LIMIT 10 -#define LOWEST_LIMIT 0 -#define MAX_THRESHOLD 5 -#define MIN_THRESHOLD 0 #define PCNT_CTRL_HIGH_LEVEL 1 #define PCNT_CTRL_LOW_LEVEL 0 @@ -407,6 +403,7 @@ TEST_CASE("PCNT_basic_function_test", "[pcnt]") // use LEDC to produce the pulse, then the PCNT to count it produce_pulse(); + vTaskDelay(10 / portTICK_PERIOD_MS); // ensure LEDC is working pcnt_test_io_config(PCNT_CTRL_HIGH_LEVEL); // initialize first, the initial value should be 0 diff --git a/components/driver/test_apps/legacy_pcnt_driver/pytest_legacy_pcnt.py b/components/driver/test_apps/legacy_pcnt_driver/pytest_legacy_pcnt.py index 68f8593a26..46eddeb18e 100644 --- a/components/driver/test_apps/legacy_pcnt_driver/pytest_legacy_pcnt.py +++ b/components/driver/test_apps/legacy_pcnt_driver/pytest_legacy_pcnt.py @@ -7,7 +7,7 @@ from pytest_embedded import Dut @pytest.mark.esp32 @pytest.mark.esp32s2 @pytest.mark.esp32s3 -# @pytest.mark.esp32c5 # TODO [ESP32C5] IDF-10341 +@pytest.mark.esp32c5 @pytest.mark.esp32c6 @pytest.mark.esp32h2 @pytest.mark.esp32p4 diff --git a/docs/en/api-reference/peripherals/pcnt.rst b/docs/en/api-reference/peripherals/pcnt.rst index d3998235c0..365d6c9f6f 100644 --- a/docs/en/api-reference/peripherals/pcnt.rst +++ b/docs/en/api-reference/peripherals/pcnt.rst @@ -163,6 +163,8 @@ It is recommended to remove the unused watch point by :cpp:func:`pcnt_unit_remov When a watch step and a watch point are triggered at the same time (i.e. at the same absolute point), the callback function only gets called by once. + The step increment will be reset to 0 when the count reaches the high/low limit value. Please do not rely too much on the exact step interval. + .. code:: c // add positive direction watch step with 100 step intervals diff --git a/docs/zh_CN/api-reference/peripherals/pcnt.rst b/docs/zh_CN/api-reference/peripherals/pcnt.rst index 565a8ddeea..8f47f0b9b8 100644 --- a/docs/zh_CN/api-reference/peripherals/pcnt.rst +++ b/docs/zh_CN/api-reference/peripherals/pcnt.rst @@ -163,6 +163,8 @@ PCNT 单元可被设置为观察几个特定的数值,这些被观察的数值 当观察步进和观察点同时被触发时,回调函数只会被调用一次。 + 当计数达到上/下限值时,步进增量会被重置为 0,请勿过分依赖于精确的步进间隔。 + .. code:: c // add positive direction step notify with 100 step intervals