Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau committed Aug 8, 2024
1 parent 17809d9 commit 33a621b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion stm32-modules/flex-stacker/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<void(tasks::FirmwareTasks::QueueAggregator *)>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ 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;
if (step_count == 0) {
step_motor(m_id);
}
}

private:
MotorID m_id;
uint32_t step_count = 0;
};

} // namespace motor_driver_policy
} // namespace motor_interrupt_controller

0 comments on commit 33a621b

Please sign in to comment.