Skip to content

Commit

Permalink
added send_from_isr method
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed Jan 24, 2024
1 parent ecffbdb commit 3ea1c80
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 1 deletion.
5 changes: 5 additions & 0 deletions gantry/core/tasks_proto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ void gantry::queues::QueueClient::send_motor_driver_queue(
motor_driver_queue->try_write(m);
}

void gantry::queues::QueueClient::send_motor_driver_queue_isr(
const tmc2130::tasks::TaskMessage& m) {
static_cast<void>(motor_driver_queue->try_write_isr(m));
}

void gantry::queues::QueueClient::send_move_group_queue(
const move_group_task::TaskMessage& m) {
move_group_queue->try_write(m);
Expand Down
5 changes: 5 additions & 0 deletions gantry/core/tasks_rev1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ void gantry::queues::QueueClient::send_motor_driver_queue(
motor_driver_queue->try_write(m);
}

void gantry::queues::QueueClient::send_motor_driver_queue_isr(
const tmc2160::tasks::TaskMessage& m) {
static_cast<void>(motor_driver_queue->try_write_isr(m));
}

void gantry::queues::QueueClient::send_move_group_queue(
const move_group_task::TaskMessage& m) {
move_group_queue->try_write(m);
Expand Down
5 changes: 5 additions & 0 deletions gripper/core/tasks_z.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ void z_tasks::QueueClient::send_motor_driver_queue(
tmc2130_driver_queue->try_write(m);
}

void z_tasks::QueueClient::send_motor_driver_queue_isr(
const tmc2130::tasks::TaskMessage& m) {
static_cast<void>(tmc2130_driver_queue->try_write_isr(m));
}

void z_tasks::QueueClient::send_move_group_queue(
const move_group_task::TaskMessage& m) {
move_group_queue->try_write(m);
Expand Down
5 changes: 5 additions & 0 deletions head/core/tasks_proto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ void head_tasks::MotorQueueClient::send_motor_driver_queue(
motor_queue->try_write(m);
}

void head_tasks::MotorQueueClient::send_motor_driver_queue_isr(
const tmc2130::tasks::TaskMessage& m) {
static_cast<void>(motor_queue->try_write_isr(m));
}

void head_tasks::MotorQueueClient::send_move_group_queue(
const move_group_task::TaskMessage& m) {
move_group_queue->try_write(m);
Expand Down
5 changes: 5 additions & 0 deletions head/core/tasks_rev1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ void head_tasks::MotorQueueClient::send_motor_driver_queue(
motor_queue->try_write(m);
}

void head_tasks::MotorQueueClient::send_motor_driver_queue_isr(
const tmc::tasks::TaskMessage& m) {
static_cast<void>(motor_queue->try_write_isr(m));
}

void head_tasks::MotorQueueClient::send_move_group_queue(
const move_group_task::TaskMessage& m) {
move_group_queue->try_write(m);
Expand Down
2 changes: 2 additions & 0 deletions include/gantry/core/queues.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ struct QueueClient : can::message_writer::MessageWriter {

void send_motor_driver_queue(const tmc::tasks::TaskMessage& m);

void send_motor_driver_queue_isr(const tmc::tasks::TaskMessage& m);

void send_move_group_queue(const move_group_task::TaskMessage& m);

void send_move_status_reporter_queue(
Expand Down
2 changes: 2 additions & 0 deletions include/gripper/core/tasks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ struct QueueClient : can::message_writer::MessageWriter {

void send_motor_driver_queue(const tmc2130::tasks::TaskMessage& m);

void send_motor_driver_queue_isr(const tmc2130::tasks::TaskMessage& m);

void send_move_group_queue(const move_group_task::TaskMessage& m);

void send_move_status_reporter_queue(
Expand Down
2 changes: 2 additions & 0 deletions include/head/core/queues.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ struct MotorQueueClient : can::message_writer::MessageWriter {

void send_motor_driver_queue(const tmc::tasks::TaskMessage& m);

void send_motor_driver_queue_isr(const tmc::tasks::TaskMessage& m);

void send_move_group_queue(const move_group_task::TaskMessage& m);

void send_move_status_reporter_queue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ class MotorInterruptHandler {
.severity = severity,
.error_code = err_code});
if (err_code == can::ids::ErrorCode::motor_driver_error_detected) {
driver_client.send_motor_driver_queue(
driver_client.send_motor_driver_queue_isr(
can::messages::ReadMotorDriverErrorStatusRequest{.message_index =
message_index});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class MotorDriverTask {
template <typename Client>
concept TaskClient = requires(Client client, const TaskMessage& m) {
{client.send_motor_driver_queue(m)};
{client.send_motor_driver_queue_isr(m)};
};

} // namespace tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class MotorDriverTask {
template <typename Client>
concept TaskClient = requires(Client client, const TaskMessage& m) {
{client.send_motor_driver_queue(m)};
{client.send_motor_driver_queue_isr(m)};
};

} // namespace tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ using GearTaskMessage = typename ::utils::VariantCat<
template <typename Client>
concept TaskClient = requires(Client client, const TaskMessage& m) {
{client.send_motor_driver_queue(m)};
{client.send_motor_driver_queue_isr(m)};
};

/**
Expand Down
2 changes: 2 additions & 0 deletions include/pipettes/core/gear_motor_tasks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ struct QueueClient : can::message_writer::MessageWriter {

void send_motor_driver_queue(const tmc2160::tasks::gear::TaskMessage& m);

void send_motor_driver_queue_isr(const tmc2160::tasks::gear::TaskMessage& m);

void send_move_group_queue(
const pipettes::tasks::move_group_task::TaskMessage& m);

Expand Down
8 changes: 8 additions & 0 deletions include/pipettes/core/linear_motor_tasks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ struct QueueClient : can::message_writer::MessageWriter {
driver_queue->try_write(m);
}

void send_motor_driver_queue_isr(const tmc2130::tasks::TaskMessage& m) const {
static_cast<void>(driver_queue->try_write_isr(m));
}

freertos_message_queue::FreeRTOSMessageQueue<tmc2130::tasks::TaskMessage>*
driver_queue{nullptr};
};
Expand Down Expand Up @@ -173,6 +177,10 @@ struct QueueClient : can::message_writer::MessageWriter {
driver_queue->try_write(m);
}

void send_motor_driver_queue_isr(const tmc2160::tasks::TaskMessage& m) const {
static_cast<void>(driver_queue->try_write_isr(m));
}

freertos_message_queue::FreeRTOSMessageQueue<tmc2160::tasks::TaskMessage>*
driver_queue{nullptr};
};
Expand Down
2 changes: 2 additions & 0 deletions include/pipettes/core/tasks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ struct QueueClient : can::message_writer::MessageWriter {

void send_motor_driver_queue(const tmc2130::tasks::TaskMessage& m);

void send_motor_driver_queue_isr(const tmc2130::tasks::TaskMessage& m);

void send_move_group_queue(const move_group_task::TaskMessage& m);

void send_move_status_reporter_queue(
Expand Down
5 changes: 5 additions & 0 deletions pipettes/core/gear_motor_tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ void gear_motor_tasks::QueueClient::send_motor_driver_queue(
driver_queue->try_write(m);
}

void gear_motor_tasks::QueueClient::send_motor_driver_queue_isr(
const tmc2160::tasks::gear::TaskMessage& m) {
static_cast<void>(driver_queue->try_write_isr(m));
}

void gear_motor_tasks::QueueClient::send_move_group_queue(
const pipettes::tasks::move_group_task::TaskMessage& m) {
move_group_queue->try_write(m);
Expand Down

0 comments on commit 3ea1c80

Please sign in to comment.