| 28 | // |
| 29 | template<int inum> |
| 30 | class DefectiveSwitch |
| 31 | : public tinyfsm::Fsm< DefectiveSwitch<inum> > |
| 32 | { |
| 33 | public: |
| 34 | static constexpr unsigned int defect_level = (inum * 2); |
| 35 | |
| 36 | static void reset(void) { |
| 37 | on_counter = 0; |
| 38 | } |
| 39 | |
| 40 | /* default reaction for unhandled events */ |
| 41 | void react(tinyfsm::Event const &) { }; |
| 42 | |
| 43 | virtual void react(Toggle const &) { }; |
| 44 | virtual void entry(void) { }; /* entry actions in some states */ |
| 45 | void exit(void) { }; /* no exit actions */ |
| 46 | |
| 47 | protected: |
| 48 | static unsigned int on_counter; |
| 49 | }; |
| 50 | |
| 51 | // state variable definitions |
| 52 | template<int inum> |
nothing calls this directly
no outgoing calls
no test coverage detected