Skip to content

Commit 88ebb8f

Browse files
committed
include: zephyr: drivers: stepper: refactor trinamic ramp get macro
Since the motor is now made a child of the controller, the macro to pull the ramp parameters are now refactored to pull it out of the node. Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
1 parent 3c3f8c6 commit 88ebb8f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

include/zephyr/drivers/stepper/stepper_trinamic.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extern "C" {
5454
#define TMC_RAMP_IHOLD_IRUN_MIN 0
5555
#define TMC_RAMP_IHOLDDELAY_MAX GENMASK(3, 0)
5656
#define TMC_RAMP_IHOLDDELAY_MIN 0
57-
#define TMC_RAMP_VACTUAL_SHIFT 22
57+
#define TMC_RAMP_VACTUAL_SHIFT 23
5858
#define TMC_RAMP_XACTUAL_SHIFT 31
5959

6060
/* TMC50XX specific */
@@ -194,11 +194,11 @@ struct tmc_ramp_generator_data {
194194

195195
#define TMC_RAMP_DT_SPEC_GET_TMC51XX(node) \
196196
{ \
197-
TMC_RAMP_DT_SPEC_GET_COMMON(DT_DRV_INST(node)) \
198-
.tpowerdown = DT_INST_PROP(node, tpowerdown), \
199-
.tpwmthrs = DT_INST_PROP(node, tpwmthrs), \
200-
.tcoolthrs = DT_INST_PROP(node, tcoolthrs), \
201-
.thigh = DT_INST_PROP(node, thigh), \
197+
TMC_RAMP_DT_SPEC_GET_COMMON(node) \
198+
.tpowerdown = DT_PROP(node, tpowerdown), \
199+
.tpwmthrs = DT_PROP(node, tpwmthrs), \
200+
.tcoolthrs = DT_PROP(node, tcoolthrs), \
201+
.thigh = DT_PROP(node, thigh), \
202202
}
203203

204204
/**

0 commit comments

Comments
 (0)