From 09f5bc736ba27b174c62212f42d3316a4ea6ed2e Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 11 Mar 2025 22:07:45 +0800 Subject: [PATCH] fix(pcnt): a typo in the PCNT_LL_MIN_LIM Closes https://github.com/espressif/esp-idf/issues/15554 --- components/esp_driver_pcnt/src/pulse_cnt.c | 2 +- components/hal/esp32/include/hal/pcnt_ll.h | 2 +- components/hal/esp32c5/include/hal/pcnt_ll.h | 2 +- components/hal/esp32c6/include/hal/pcnt_ll.h | 2 +- components/hal/esp32h2/include/hal/pcnt_ll.h | 2 +- components/hal/esp32p4/include/hal/pcnt_ll.h | 2 +- components/hal/esp32s2/include/hal/pcnt_ll.h | 2 +- components/hal/esp32s3/include/hal/pcnt_ll.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/esp_driver_pcnt/src/pulse_cnt.c b/components/esp_driver_pcnt/src/pulse_cnt.c index 2dc6e5e2eb..3143c12f3f 100644 --- a/components/esp_driver_pcnt/src/pulse_cnt.c +++ b/components/esp_driver_pcnt/src/pulse_cnt.c @@ -203,7 +203,7 @@ esp_err_t pcnt_new_unit(const pcnt_unit_config_t *config, pcnt_unit_handle_t *re esp_err_t ret = ESP_OK; pcnt_unit_t *unit = NULL; ESP_GOTO_ON_FALSE(config && ret_unit, ESP_ERR_INVALID_ARG, err, TAG, "invalid argument"); - ESP_GOTO_ON_FALSE(config->low_limit < 0 && config->high_limit > 0 && config->low_limit >= PCNT_LL_MIN_LIN && + ESP_GOTO_ON_FALSE(config->low_limit < 0 && config->high_limit > 0 && config->low_limit >= PCNT_LL_MIN_LIM && config->high_limit <= PCNT_LL_MAX_LIM, ESP_ERR_INVALID_ARG, err, TAG, "invalid limit range:[%d,%d]", config->low_limit, config->high_limit); if (config->intr_priority) { diff --git a/components/hal/esp32/include/hal/pcnt_ll.h b/components/hal/esp32/include/hal/pcnt_ll.h index be3d83241b..066c3d9763 100644 --- a/components/hal/esp32/include/hal/pcnt_ll.h +++ b/components/hal/esp32/include/hal/pcnt_ll.h @@ -31,7 +31,7 @@ extern "C" { #define PCNT_LL_GET_HW(num) (((num) == 0) ? (&PCNT) : NULL) #define PCNT_LL_MAX_GLITCH_WIDTH 1023 #define PCNT_LL_MAX_LIM SHRT_MAX -#define PCNT_LL_MIN_LIN SHRT_MIN +#define PCNT_LL_MIN_LIM SHRT_MIN typedef enum { PCNT_LL_WATCH_EVENT_INVALID = -1, diff --git a/components/hal/esp32c5/include/hal/pcnt_ll.h b/components/hal/esp32c5/include/hal/pcnt_ll.h index 491303725c..94d57af102 100644 --- a/components/hal/esp32c5/include/hal/pcnt_ll.h +++ b/components/hal/esp32c5/include/hal/pcnt_ll.h @@ -21,7 +21,7 @@ extern "C" { #define PCNT_LL_GET_HW(num) (((num) == 0) ? (&PCNT) : NULL) #define PCNT_LL_MAX_GLITCH_WIDTH 1023 #define PCNT_LL_MAX_LIM SHRT_MAX -#define PCNT_LL_MIN_LIN SHRT_MIN +#define PCNT_LL_MIN_LIM SHRT_MIN typedef enum { PCNT_LL_WATCH_EVENT_INVALID = -1, diff --git a/components/hal/esp32c6/include/hal/pcnt_ll.h b/components/hal/esp32c6/include/hal/pcnt_ll.h index 4bf6469589..1b2a50d722 100644 --- a/components/hal/esp32c6/include/hal/pcnt_ll.h +++ b/components/hal/esp32c6/include/hal/pcnt_ll.h @@ -28,7 +28,7 @@ extern "C" { #define PCNT_LL_GET_HW(num) (((num) == 0) ? (&PCNT) : NULL) #define PCNT_LL_MAX_GLITCH_WIDTH 1023 #define PCNT_LL_MAX_LIM SHRT_MAX -#define PCNT_LL_MIN_LIN SHRT_MIN +#define PCNT_LL_MIN_LIM SHRT_MIN typedef enum { PCNT_LL_WATCH_EVENT_INVALID = -1, diff --git a/components/hal/esp32h2/include/hal/pcnt_ll.h b/components/hal/esp32h2/include/hal/pcnt_ll.h index f8b21a1642..d4740c5603 100644 --- a/components/hal/esp32h2/include/hal/pcnt_ll.h +++ b/components/hal/esp32h2/include/hal/pcnt_ll.h @@ -31,7 +31,7 @@ extern "C" { #define PCNT_LL_GET_HW(num) (((num) == 0) ? (&PCNT) : NULL) #define PCNT_LL_MAX_GLITCH_WIDTH 1023 #define PCNT_LL_MAX_LIM SHRT_MAX -#define PCNT_LL_MIN_LIN SHRT_MIN +#define PCNT_LL_MIN_LIM SHRT_MIN typedef enum { PCNT_LL_WATCH_EVENT_INVALID = -1, diff --git a/components/hal/esp32p4/include/hal/pcnt_ll.h b/components/hal/esp32p4/include/hal/pcnt_ll.h index c01ed77b4e..15b9256a56 100644 --- a/components/hal/esp32p4/include/hal/pcnt_ll.h +++ b/components/hal/esp32p4/include/hal/pcnt_ll.h @@ -29,7 +29,7 @@ extern "C" { #define PCNT_LL_GET_HW(num) (((num) == 0) ? (&PCNT) : NULL) #define PCNT_LL_MAX_GLITCH_WIDTH 1023 #define PCNT_LL_MAX_LIM SHRT_MAX -#define PCNT_LL_MIN_LIN SHRT_MIN +#define PCNT_LL_MIN_LIM SHRT_MIN typedef enum { PCNT_LL_WATCH_EVENT_INVALID = -1, diff --git a/components/hal/esp32s2/include/hal/pcnt_ll.h b/components/hal/esp32s2/include/hal/pcnt_ll.h index 6047342cab..313f4083f5 100644 --- a/components/hal/esp32s2/include/hal/pcnt_ll.h +++ b/components/hal/esp32s2/include/hal/pcnt_ll.h @@ -29,7 +29,7 @@ extern "C" { #define PCNT_LL_GET_HW(num) (((num) == 0) ? (&PCNT) : NULL) #define PCNT_LL_MAX_GLITCH_WIDTH 1023 #define PCNT_LL_MAX_LIM SHRT_MAX -#define PCNT_LL_MIN_LIN SHRT_MIN +#define PCNT_LL_MIN_LIM SHRT_MIN typedef enum { PCNT_LL_WATCH_EVENT_INVALID = -1, diff --git a/components/hal/esp32s3/include/hal/pcnt_ll.h b/components/hal/esp32s3/include/hal/pcnt_ll.h index d00563a2cd..6fbb5b9247 100644 --- a/components/hal/esp32s3/include/hal/pcnt_ll.h +++ b/components/hal/esp32s3/include/hal/pcnt_ll.h @@ -28,7 +28,7 @@ extern "C" { #define PCNT_LL_GET_HW(num) (((num) == 0) ? (&PCNT) : NULL) #define PCNT_LL_MAX_GLITCH_WIDTH 1023 #define PCNT_LL_MAX_LIM SHRT_MAX -#define PCNT_LL_MIN_LIN SHRT_MIN +#define PCNT_LL_MIN_LIM SHRT_MIN typedef enum { PCNT_LL_WATCH_EVENT_INVALID = -1,