pcnt_unit_clear_count() function
Clear PCNT pulse count value to zero
Arguments
unit
PCNT unit handle created by `pcnt_new_unit()`
Return value
- ESP_OK: Clear PCNT pulse count successfully - ESP_ERR_INVALID_ARG: Clear PCNT pulse count failed because of invalid argument - ESP_FAIL: Clear PCNT pulse count failed because of other error
Notes
It's recommended to call this function after adding a watch point by `pcnt_unit_add_watch_point()`, so that the newly added watch point is effective immediately. This function is allowed to run within ISR context This function will be placed into IRAM if `CONFIG_PCNT_CTRL_FUNC_IN_IRAM`, so that it's allowed to be executed when Cache is disabled
pcnt_unit_clear_count() calls 6 functions:
![]()
pcnt_unit_clear_count()
pcnt_unit_clear_count() reads 6 variables and writes 1 variable:
![]()
pcnt_unit_clear_count()