@@ -30,9 +30,7 @@ struct tmc50xx_config {
30
30
struct tmc50xx_stepper_data {
31
31
struct k_work_delayable stallguard_dwork ;
32
32
/* Work item to run the callback in a thread context. */
33
- #ifdef CONFIG_STEPPER_ADI_TMC50XX_RAMPSTAT_POLL
34
33
struct k_work_delayable rampstat_callback_dwork ;
35
- #endif
36
34
/* device pointer required to access config in k_work */
37
35
const struct device * stepper ;
38
36
stepper_event_callback_t callback ;
@@ -177,7 +175,6 @@ static void stallguard_work_handler(struct k_work *work)
177
175
}
178
176
}
179
177
180
- #ifdef CONFIG_STEPPER_ADI_TMC50XX_RAMPSTAT_POLL
181
178
182
179
static void execute_callback (const struct device * dev , const enum stepper_event event )
183
180
{
@@ -297,8 +294,6 @@ static void rampstat_work_handler(struct k_work *work)
297
294
}
298
295
}
299
296
300
- #endif
301
-
302
297
static int tmc50xx_stepper_enable (const struct device * dev )
303
298
{
304
299
LOG_DBG ("Enabling Stepper motor controller %s" , dev -> name );
@@ -486,11 +481,9 @@ static int tmc50xx_stepper_move_to(const struct device *dev, const int32_t micro
486
481
k_work_reschedule (& data -> stallguard_dwork ,
487
482
K_MSEC (config -> sg_velocity_check_interval_ms ));
488
483
}
489
- #ifdef CONFIG_STEPPER_ADI_TMC50XX_RAMPSTAT_POLL
490
484
if (data -> callback ) {
491
485
rampstat_work_reschedule (& data -> rampstat_callback_dwork );
492
486
}
493
- #endif
494
487
return 0 ;
495
488
}
496
489
@@ -546,11 +539,9 @@ static int tmc50xx_stepper_run(const struct device *dev, const enum stepper_dire
546
539
k_work_reschedule (& data -> stallguard_dwork ,
547
540
K_MSEC (config -> sg_velocity_check_interval_ms ));
548
541
}
549
- #ifdef CONFIG_STEPPER_ADI_TMC50XX_RAMPSTAT_POLL
550
542
if (data -> callback ) {
551
543
rampstat_work_reschedule (& data -> rampstat_callback_dwork );
552
544
}
553
- #endif
554
545
return 0 ;
555
546
}
556
547
@@ -695,10 +686,8 @@ static int tmc50xx_stepper_init(const struct device *dev)
695
686
}
696
687
#endif
697
688
698
- #if CONFIG_STEPPER_ADI_TMC50XX_RAMPSTAT_POLL
699
689
k_work_init_delayable (& data -> rampstat_callback_dwork , rampstat_work_handler );
700
690
rampstat_work_reschedule (& data -> rampstat_callback_dwork );
701
- #endif
702
691
err = tmc50xx_stepper_set_micro_step_res (dev , stepper_config -> default_micro_step_res );
703
692
if (err != 0 ) {
704
693
return - EIO ;
0 commit comments