Skip to content

ssm: Add cleanup state feature

Benjamin Berg requested to merge benzea/cleanup-states into master

In some situations one may want to guarantee that the last steps of an SSM are run even when the SSM is completed early or failed.

This can easily be done by making fpi_ssm_mark_completed jump to the next cleanup stage when called (this also includes mark_failed). Due to the mechanism, it is still possible to explicitly jump cleanup states by using fpi_ssm_jump_to_state, including a jump to the final state in order to skip all cleanup states.


So, I am thinking this might be a solution to the power button shield issue. i.e. with this, we just need to mark turning off the button shield as a cleanup stage, and it is guaranteed to run.

CC: @bogerwang @FengJungle @3v1n0

Edited by Benjamin Berg

Merge request reports