From ad415b14a4e086bb51b23cad76aeae174605f296 Mon Sep 17 00:00:00 2001 From: Alexey Zholtikov Date: Sun, 27 Sep 2026 11:42:10 +0300 Subject: [PATCH] style: updated comments --- include/zh_tachometer.h | 7 +++---- zh_tachometer.c | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/zh_tachometer.h b/include/zh_tachometer.h index 93277fe..9537746 100644 --- a/include/zh_tachometer.h +++ b/include/zh_tachometer.h @@ -5,7 +5,7 @@ * and ESP-Timer to measure rotational speed in RPM. * * The module leverages the ESP-IDF PCNT peripheral in quadrature decoder mode - * to count encoder pulses and an ESP-Timer running at 10 Hz to sample the + * to count encoder pulses and an ESP-Timer running at 100 Hz to sample the * accumulated count and compute RPM. The result is a non-blocking, RTOS-friendly * interface suitable for motor speed monitoring. * @@ -71,7 +71,7 @@ extern "C" /** * @brief Initialize the tachometer with the provided configuration. * - * Allocates a handle, configures the ESP-Timer (10 Hz sampling), and sets up + * Allocates a handle, configures the ESP-Timer (100 Hz sampling), and sets up * the PCNT peripheral in quadrature decoder mode with glitch filtering. * * @param[in] config Pointer to the initialization configuration (must not be NULL) @@ -79,10 +79,9 @@ extern "C" * * @return ESP_OK on success * @return ESP_ERR_INVALID_ARG if `config` or `handle` is NULL, or `encoder_pulses` is zero - * @return ESP_ERR_INVALID_STATE if the handle is already initialized. + * @return ESP_ERR_INVALID_STATE if the handle is already initialized * @return ESP_ERR_NO_MEM if memory allocation fails * @return ESP_FAIL if PCNT initialization or configuration failed - * */ esp_err_t zh_tachometer_init(const zh_tachometer_init_config_t *config, zh_tachometer_handle_t **handle); diff --git a/zh_tachometer.c b/zh_tachometer.c index 003eaa2..2c251f6 100644 --- a/zh_tachometer.c +++ b/zh_tachometer.c @@ -30,6 +30,8 @@ * * @note This structure is opaque to callers and must only be accessed * through the public API functions. + * @warning The timer callback runs from ISR context and must not call + * blocking or long-running operations. */ struct _zh_tachometer_handle_t {