Motion: implement InitAxis

pull/47/head
Yuri D'Elia 2021-07-13 20:44:09 +02:00
parent 8f0732a0cc
commit 4160d019be
1 changed files with 8 additions and 2 deletions

View File

@ -5,8 +5,14 @@ namespace motion {
Motion motion;
// TODO: not implemented
void Motion::InitAxis(Axis axis) {}
void Motion::InitAxis(Axis axis) {
for (uint8_t i = 0; i != NUM_AXIS; ++i) {
// disable the axis and re-init the driver: this will clear the internal
// StallGuard data as a result without special handling
Disable(axis);
axisData[axis].drv.Init(axisParams[axis].params);
}
}
void Motion::SetEnabled(Axis axis, bool enabled) {
axisData[axis].drv.SetEnabled(axisParams[axis].params, enabled);