Skip to content

Commit

Permalink
do not stop movement when other pin interrupts
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau committed Nov 20, 2024
1 parent 1085aba commit 68c546d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions stm32-modules/include/flex-stacker/flex-stacker/motor_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,15 +411,17 @@ class MotorTask {
auto visit_message(const messages::GPIOInterruptMessage& m, Policy& policy)
-> void {
static_cast<void>(m);
static_cast<void>(policy);
_z_controller.stop_movement(0, true);
_x_controller.stop_movement(0, false);
_l_controller.stop_movement(0, false);
if (policy.is_diag0_pin(m.pin)) {
send_error_message(Error::MOTOR_STALL_DETECTED);
} else {
} else if (policy.is_estop_pin(m.pin)) {
send_error_message(Error::ESTOP_TRIGGERED);
} else {
// don't care about other interrupts
return;
}
_z_controller.stop_movement(0, true);
_x_controller.stop_movement(0, false);
_l_controller.stop_movement(0, false);
}

/**
Expand Down

0 comments on commit 68c546d

Please sign in to comment.