Skip to content

Commit

Permalink
put event fn in state
Browse files Browse the repository at this point in the history
  • Loading branch information
MarwanMashaly1 committed Jun 22, 2024
1 parent e6919cf commit 555737d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 0 additions & 2 deletions boards/recovery/src/state_machine/states/descent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ impl State for Descent {
})
}

// sample code for event handling it is not complete and will not work shouldn't be used
// this is an event function that is called when an event is passed to the state to see if it should transition if relevant
fn event(&mut self, event: RocketEvents) -> Option<RocketStates> {
match event {
RocketEvents::DeployDrogue(_) => transition!(self, TerminalDescent),
Expand Down
11 changes: 5 additions & 6 deletions boards/recovery/src/state_machine/states/terminal_descent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ impl State for TerminalDescent {
}
})
}
}

fn event(&mut self, event: RocketEvents) -> Option<RocketStates> {
match event {
RocketEvents::DeployMain(_) => transition!(self, WaitForRecovery),
_ => {}
fn event(&mut self, event: RocketEvents) -> Option<RocketStates> {
match event {
RocketEvents::DeployMain(_) => transition!(self, WaitForRecovery),
_ => {}
}
}
}

Expand Down

0 comments on commit 555737d

Please sign in to comment.