state_tx.h 855 B

123456789101112131415161718192021222324252627282930
  1. #ifndef _STATE_TX_H_
  2. #define _STATE_TX_H_
  3. #include <cinttypes>
  4. enum StateID; ///< Forward-declared identifier type for application states
  5. /**
  6. * @brief Transition modes defining how the state machine behaves after completing a state.
  7. */
  8. enum StateTxMode
  9. {
  10. NO_OP, ///< No Operation
  11. REFRESH, ///< Refresh after end()
  12. WAIT, ///< Wait between states
  13. REFRESH_WAIT, ///< Refresh then wait
  14. ERROR ///< Immediately cancel
  15. };
  16. /**
  17. * @brief Structure containing metadata for state transitions and timing.
  18. */
  19. struct StateTx
  20. {
  21. StateID id; ///< Target state identifier
  22. StateTxMode mode{NO_OP}; ///< Transition mode (defaults to NO_OP)
  23. uint64_t wait{0}; ///< Wait duration in milliseconds or ticks (defaults to 0)
  24. };
  25. #endif // _STATE_TX_H_