Skip to content

Commit

Permalink
✨ (SM): Add DeepSleep state onExit's action
Browse files Browse the repository at this point in the history
  • Loading branch information
YannLocatelli committed Feb 15, 2024
1 parent e0f4855 commit f8bb984
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libs/RobotKit/include/StateMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ namespace sm::action {
auto operator()(irc &rc) const { rc.suspendHardwareForDeepSleep(); }
};

struct wake_up {
auto operator()(irc &rc) const { rc.wakeUp(); }

Check warning on line 184 in libs/RobotKit/include/StateMachine.h

View check run for this annotation

Codecov / codecov/patch

libs/RobotKit/include/StateMachine.h#L184

Added line #L184 was not covered by tests
};

struct reset_emergency_stop_counter {
auto operator()(irc &rc) const { rc.resetEmergencyStopCounter(); }
};
Expand Down Expand Up @@ -235,6 +239,7 @@ struct StateMachine {
//, sm::state::sleeping + event<sm::event::deep_sleep_timeout_did_end> = sm::state::deep_sleeping

, sm::state::deep_sleeping + boost::sml::on_entry<_> / sm::action::suspend_hardware_for_deep_sleep {}
, sm::state::deep_sleeping + boost::sml::on_exit<_> / sm::action::wake_up {}

, sm::state::charging + boost::sml::on_entry<_> / (sm::action::start_deep_sleep_timeout {}, sm::action::start_charging_behavior {} )
, sm::state::charging + boost::sml::on_exit<_> / (sm::action::stop_deep_sleep_timeout {}, sm::action::stop_charging_behavior {} )
Expand Down

0 comments on commit f8bb984

Please sign in to comment.