pcnt: fix bug in clear interrupt status

This commit is contained in:
morris 2020-09-16 22:24:40 +08:00
parent 8223278050
commit dcb23c0bc8

View File

@ -286,6 +286,7 @@ static void IRAM_ATTR pcnt_intr_service(void *arg)
uint32_t status;
pcnt_port_t pcnt_port = (pcnt_port_t)arg;
pcnt_hal_get_intr_status(&(p_pcnt_obj[pcnt_port]->hal), &status);
pcnt_hal_clear_intr_status(&(p_pcnt_obj[pcnt_port]->hal), status);
while (status) {
int unit = __builtin_ffs(status) - 1;
@ -295,7 +296,6 @@ static void IRAM_ATTR pcnt_intr_service(void *arg)
(pcnt_isr_func[unit].fn)(pcnt_isr_func[unit].args);
}
}
pcnt_hal_clear_intr_status(&(p_pcnt_obj[pcnt_port]->hal), status);
}
static inline esp_err_t _pcnt_isr_service_install(pcnt_port_t pcnt_port, int intr_alloc_flags)