Skip to content

Commit

Permalink
don't set bad state unless it's a homing failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Feb 6, 2025
1 parent b3cdebc commit 998f653
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,10 @@ class MotorInterruptHandler {
_has_active_move = false;
tick_count = 0x0;
stall_handled = false;
if (buffered_move.stop_condition != 0 &&
if ((buffered_move.check_stop_condition(
MoveStopCondition::limit_switch_backoff) ||
buffered_move.check_stop_condition(
MoveStopCondition::limit_switch)) &&
ack_msg_id == AckMessageId::complete_without_condition) {
in_good_state = false;
}
Expand Down
2 changes: 1 addition & 1 deletion motor-control/tests/test_motor_stall_handling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ SCENARIO("motor handler stall detection") {
}
THEN("an error is sent.") {
// should be 2 but idk why this runs more than once
REQUIRE(test_objs.reporter.messages.size() == 3);
REQUIRE(test_objs.reporter.messages.size() == 2);
REQUIRE(!test_objs.hw.position_flags.check_flag(
Flags::stepper_position_ok));
}
Expand Down

0 comments on commit 998f653

Please sign in to comment.