From ceab7daea8818c1f5b6ab3678149a3295bce5c20 Mon Sep 17 00:00:00 2001 From: morris Date: Fri, 22 Jan 2021 16:15:38 +0800 Subject: [PATCH] mcpwm: fix wrong capture edge --- components/hal/esp32/include/hal/mcpwm_ll.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/hal/esp32/include/hal/mcpwm_ll.h b/components/hal/esp32/include/hal/mcpwm_ll.h index 350c5da187..e1446fc6c8 100644 --- a/components/hal/esp32/include/hal/mcpwm_ll.h +++ b/components/hal/esp32/include/hal/mcpwm_ll.h @@ -684,9 +684,9 @@ static inline mcpwm_capture_on_edge_t mcpwm_ll_get_captured_edge(mcpwm_dev_t *mc if (cap_sig == 0) { edge = mcpwm->cap_status.cap0_edge; } else if (cap_sig == 1) { - edge = mcpwm->cap_status.cap0_edge; + edge = mcpwm->cap_status.cap1_edge; } else { //2 - edge = mcpwm->cap_status.cap0_edge; + edge = mcpwm->cap_status.cap2_edge; } return (edge? MCPWM_NEG_EDGE: MCPWM_POS_EDGE); }