diff --git a/src/StepperISR_esp32_mcpwm_pcnt.cpp b/src/StepperISR_esp32_mcpwm_pcnt.cpp index e0910e5..cafc1a7 100644 --- a/src/StepperISR_esp32_mcpwm_pcnt.cpp +++ b/src/StepperISR_esp32_mcpwm_pcnt.cpp @@ -2,6 +2,8 @@ #ifdef SUPPORT_ESP32_MCPWM_PCNT +#include + #define DEFAULT_TIMER_H_L_TRANSITION 160 // cannot be updated while timer is running => fix it to 0 @@ -120,7 +122,7 @@ static void IRAM_ATTR apply_command(StepperQueue *queue, uint8_t steps = e->steps; if (e->toggle_dir) { gpio_num_t dirPin = (gpio_num_t)queue->dirPin; - gpio_set_level(dirPin, gpio_get_level(dirPin) ^ 1); + gpio_ll_set_level(&GPIO, dirPin, gpio_ll_get_level(&GPIO, dirPin) ^ 1); } uint16_t ticks = e->ticks; #ifndef __ESP32_IDF_V44__ diff --git a/src/StepperISR_esp32_rmt.cpp b/src/StepperISR_esp32_rmt.cpp index e2b4ca5..fe79b4d 100644 --- a/src/StepperISR_esp32_rmt.cpp +++ b/src/StepperISR_esp32_rmt.cpp @@ -5,6 +5,7 @@ // #define TEST_MODE #include "test_probe.h" +#include // The following concept is in use: // @@ -84,7 +85,7 @@ static void IRAM_ATTR apply_command(StepperQueue *q, bool fill_part_one, // The ongoing command does not contain steps, so change dir here should be // ok gpio_num_t dirPin = (gpio_num_t)q->dirPin; - gpio_set_level(dirPin, gpio_get_level(dirPin) ^ 1); + gpio_ll_set_level(&GPIO, dirPin, gpio_ll_get_level(&GPIO, dirPin) ^ 1); // and delete the request e_curr->toggle_dir = 0; }