Skip to content

Commit 745af42

Browse files
andre-stefanovjilaypandya
authored andcommitted
drivers: stepper: Invert GPIO en-pin for TMC22xx
Correct the GPIO pin states for enabling and disabling the stepper motor controller. The enable logic was accidentally inverted, causing improper activation and deactivation of the device. This change ensures proper functionality as per the intended design. Signed-off-by: Andre Stefanov <[email protected]>
1 parent 4306e99 commit 745af42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/stepper/adi_tmc/tmc22xx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ static int tmc22xx_stepper_enable(const struct device *dev)
3030
const struct tmc22xx_config *config = dev->config;
3131

3232
LOG_DBG("Enabling Stepper motor controller %s", dev->name);
33-
return gpio_pin_set_dt(&config->enable_pin, 1);
33+
return gpio_pin_set_dt(&config->enable_pin, 0);
3434
}
3535

3636
static int tmc22xx_stepper_disable(const struct device *dev)
3737
{
3838
const struct tmc22xx_config *config = dev->config;
3939

4040
LOG_DBG("Disabling Stepper motor controller %s", dev->name);
41-
return gpio_pin_set_dt(&config->enable_pin, 0);
41+
return gpio_pin_set_dt(&config->enable_pin, 1);
4242
}
4343

4444
static int tmc22xx_stepper_set_micro_step_res(const struct device *dev,

0 commit comments

Comments
 (0)