diff --git a/stm32-modules/flex-stacker/firmware/main.cpp b/stm32-modules/flex-stacker/firmware/main.cpp index 01aae6e27..efb7db7e8 100644 --- a/stm32-modules/flex-stacker/firmware/main.cpp +++ b/stm32-modules/flex-stacker/firmware/main.cpp @@ -3,8 +3,8 @@ #include "firmware/freertos_tasks.hpp" #include "firmware/system_stm32g4xx.h" #include "ot_utils/freertos/freertos_task.hpp" -#include "task.h" #include "systemwide.h" +#include "task.h" using EntryPoint = std::function; diff --git a/stm32-modules/flex-stacker/firmware/motor_control/freertos_motor_task.cpp b/stm32-modules/flex-stacker/firmware/motor_control/freertos_motor_task.cpp index 65d21cce2..e11f7e30c 100644 --- a/stm32-modules/flex-stacker/firmware/motor_control/freertos_motor_task.cpp +++ b/stm32-modules/flex-stacker/firmware/motor_control/freertos_motor_task.cpp @@ -3,18 +3,19 @@ #include "firmware/motor_hardware.h" #include "firmware/motor_policy.hpp" #include "flex-stacker/motor_task.hpp" -#include "ot_utils/freertos/freertos_timer.hpp" #include "motor_interrupt.hpp" -#include "systemwide.h" +#include "ot_utils/freertos/freertos_timer.hpp" #include "stm32g4xx_it.h" +#include "systemwide.h" namespace motor_control_task { - -static auto x_motor_interrupt = motor_interrupt_controller::MotorInterruptController(MotorID::MOTOR_X); -static auto z_motor_interrupt = motor_interrupt_controller::MotorInterruptController(MotorID::MOTOR_Z); -static auto l_motor_interrupt = motor_interrupt_controller::MotorInterruptController(MotorID::MOTOR_L); - +static auto x_motor_interrupt = + motor_interrupt_controller::MotorInterruptController(MotorID::MOTOR_X); +static auto z_motor_interrupt = + motor_interrupt_controller::MotorInterruptController(MotorID::MOTOR_Z); +static auto l_motor_interrupt = + motor_interrupt_controller::MotorInterruptController(MotorID::MOTOR_L); enum class Notifications : uint8_t { INCOMING_MESSAGE = 1, diff --git a/stm32-modules/include/flex-stacker/firmware/motor_interrupt.hpp b/stm32-modules/include/flex-stacker/firmware/motor_interrupt.hpp index f6a09f85d..db4afb225 100644 --- a/stm32-modules/include/flex-stacker/firmware/motor_interrupt.hpp +++ b/stm32-modules/include/flex-stacker/firmware/motor_interrupt.hpp @@ -7,7 +7,7 @@ namespace motor_interrupt_controller { class MotorInterruptController { public: - MotorInterruptController(MotorID m_id): m_id(m_id) {} + MotorInterruptController(MotorID m_id) : m_id(m_id) {} void tick() { unstep_motor(m_id); step_count = (step_count + 1) % 20000; @@ -15,9 +15,10 @@ class MotorInterruptController { step_motor(m_id); } } + private: MotorID m_id; uint32_t step_count = 0; }; -} // namespace motor_driver_policy +} // namespace motor_interrupt_controller