Sfoglia il codice sorgente

mcpwm: fix wrong capture edge

morris 5 anni fa
parent
commit
e85a444cd0
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      components/soc/esp32/include/hal/mcpwm_ll.h

+ 2 - 2
components/soc/esp32/include/hal/mcpwm_ll.h

@@ -680,9 +680,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);
 }