diff options
author | vg <vgm+dev@devys.org> | 2022-07-01 22:54:25 +0200 |
---|---|---|
committer | vg <vgm+dev@devys.org> | 2022-07-01 22:54:25 +0200 |
commit | 34688156142634c8b786557a7575c754d65c7f46 (patch) | |
tree | 57429578ee68c12b7d2aa8163bbe7d8bba7604e9 /two_hosts_auto_powerswitch | |
parent | ecc4e90c3b33179d8eeefdbbb3c083893d3a1c5c (diff) | |
download | avr-master.tar.gz avr-master.tar.bz2 avr-master.zip |
Diffstat (limited to 'two_hosts_auto_powerswitch')
-rw-r--r-- | two_hosts_auto_powerswitch/readme.rst | 41 | ||||
-rw-r--r-- | two_hosts_auto_powerswitch/readme_flowchart.asciio | bin | 0 -> 26794 bytes |
2 files changed, 41 insertions, 0 deletions
diff --git a/two_hosts_auto_powerswitch/readme.rst b/two_hosts_auto_powerswitch/readme.rst index 7eac7fe..2a4617d 100644 --- a/two_hosts_auto_powerswitch/readme.rst +++ b/two_hosts_auto_powerswitch/readme.rst @@ -122,3 +122,44 @@ in another location, one does not need the associated devices to be on). In my case, the wake-on-lan was an exception to the normal usage of my computer, so I made the skip choice to be in the workflow. + +State machines +============== + +- debouncing buttons state tables:: + + #0 button released [pin change interrupt] -> debounce start [timeout] + -> timeout [button pressed] -> #1 + event button_down + -> timeout [button released] -> #0 + + #1 button pressed [timeout] -> first up [timeout] -> debounce [timeout] + -> timeout [button pressed] -> #1 + -> timeout [button released] -> #0 + event button_up + +Ex of a transition table: +State Event Next state Transition function +stopped play_event playing do_play +playing stop_event stopped do_stop +playing pause_event paused do_pause +paused play_event playing do_resume +paused stop_event stopped do_stop + +ex of fsm implem for another language: +https://github.com/hyperandroid/Automata + +ex of fsm implem in c: +https://github.com/gitrealname/ofsm + +formal description in yaml ? + +fsm0: + initialstate: state0 + state0: + enter: action_enter + exit: action_exit + events: + - event: ok + nextstate: state1 + - event: ... + state1: + ... diff --git a/two_hosts_auto_powerswitch/readme_flowchart.asciio b/two_hosts_auto_powerswitch/readme_flowchart.asciio Binary files differnew file mode 100644 index 0000000..91aa2cc --- /dev/null +++ b/two_hosts_auto_powerswitch/readme_flowchart.asciio |