Skip to content

Commit

Permalink
rework dir pin management in pulse counter
Browse files Browse the repository at this point in the history
  • Loading branch information
gin66 committed Aug 25, 2024
1 parent 450f552 commit b071c10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/FastAccelStepper_idf4_esp32_pcnt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ bool FastAccelStepper::attachToPulseCounter(uint8_t pcnt_unit,
gpio_matrix_in(step_pin, sig_idx[pcnt_unit], 0);
gpio_iomux_in(step_pin, sig_idx[pcnt_unit]); // test failure without this call
if (dir_pin != PIN_UNDEFINED) {
pinMode(dir_pin, OUTPUT);
gpio_matrix_out(dir_pin, 0x100, false, false);
gpio_matrix_in(dir_pin, ctrl_idx[pcnt_unit], 0);
gpio_iomux_in(dir_pin, ctrl_idx[pcnt_unit]);
pinMode(dir_pin, OUTPUT);
}

pcnt_counter_clear(cfg.unit);
Expand Down

0 comments on commit b071c10

Please sign in to comment.