diff --git a/Firmware/MotorControl/axis.cpp b/Firmware/MotorControl/axis.cpp index f9406558..58c46663 100644 --- a/Firmware/MotorControl/axis.cpp +++ b/Firmware/MotorControl/axis.cpp @@ -75,7 +75,6 @@ static void step_cb_wrapper(void* ctx) { // @brief Sets up all components of the axis, // such as gate driver and encoder hardware. void Axis::setup() { - encoder_.setup(); motor_.setup(); } diff --git a/Firmware/MotorControl/main.cpp b/Firmware/MotorControl/main.cpp index d31bbd13..3cc077ea 100644 --- a/Firmware/MotorControl/main.cpp +++ b/Firmware/MotorControl/main.cpp @@ -235,6 +235,10 @@ int odrive_main(void) { axes[i]->setup(); } + for(auto axis : axes){ + axis->encoder_.setup(); + } + // Start PWM and enable adc interrupts/callbacks start_adc_pwm();