feat: added statistics

This commit is contained in:
2025-12-24 12:30:14 +03:00
parent deb882beb6
commit 2060a56b55
4 changed files with 56 additions and 3 deletions

View File

@@ -64,6 +64,16 @@ extern "C"
bool is_initialized; /*!< Encoder initialization flag. */
} zh_encoder_handle_t;
/**
* @brief Structure for error statistics storage.
*/
typedef struct
{
uint32_t event_post_error; /*!< Number of event post error. */
uint32_t queue_overflow_error; /*!< Number of queue overflow error. */
uint32_t min_stack_size; /*!< Minimum free stack size. */
} zh_encoder_stats_t;
ESP_EVENT_DECLARE_BASE(ZH_ENCODER);
/**
@@ -124,6 +134,18 @@ extern "C"
*/
esp_err_t zh_encoder_reset(zh_encoder_handle_t *handle);
/**
* @brief Get error statistics.
*
* @return Pointer to the statistics structure.
*/
const zh_encoder_stats_t *zh_encoder_get_stats(void);
/**
* @brief Reset error statistics.
*/
void zh_encoder_reset_stats(void);
#ifdef __cplusplus
}
#endif