Motion: initialize axes in the same order as the enumeration

pull/47/head
Yuri D'Elia 2021-07-06 16:44:20 +02:00
parent 2875e61484
commit be30314634
1 changed files with 10 additions and 10 deletions

View File

@ -39,15 +39,6 @@ static constexpr MotorMode DefaultMotorMode(const config::AxisConfig &axis) {
/// Static axis configuration
static constexpr AxisParams axisParams[NUM_AXIS] = {
// Idler
{
.name = 'I',
.params = { .idx = Idler, .dirOn = config::idler.dirOn, .csPin = IDLER_CS_PIN, .stepPin = IDLER_STEP_PIN, .sgPin = IDLER_SG_PIN, .uSteps = config::idler.uSteps },
.currents = { .vSense = config::idler.vSense, .iRun = config::idler.iRun, .iHold = config::idler.iHold },
.mode = DefaultMotorMode(config::idler),
.jerk = config::idler.jerk,
.accel = config::idler.accel,
},
// Pulley
{
.name = 'P',
@ -66,6 +57,15 @@ static constexpr AxisParams axisParams[NUM_AXIS] = {
.jerk = config::selector.jerk,
.accel = config::selector.accel,
},
// Idler
{
.name = 'I',
.params = { .idx = Idler, .dirOn = config::idler.dirOn, .csPin = IDLER_CS_PIN, .stepPin = IDLER_STEP_PIN, .sgPin = IDLER_SG_PIN, .uSteps = config::idler.uSteps },
.currents = { .vSense = config::idler.vSense, .iRun = config::idler.iRun, .iHold = config::idler.iHold },
.mode = DefaultMotorMode(config::idler),
.jerk = config::idler.jerk,
.accel = config::idler.accel,
},
};
class Motion {
@ -160,9 +160,9 @@ private:
/// Dynamic axis data
AxisData axisData[NUM_AXIS] = {
DataForAxis(Idler),
DataForAxis(Pulley),
DataForAxis(Selector),
DataForAxis(Idler),
};
};