diff options
| author | panky-codes <pankaj.sarathy1992@gmail.com> | 2021-03-13 13:53:37 (GMT) |
|---|---|---|
| committer | panky-codes <pankaj.sarathy1992@gmail.com> | 2021-03-13 13:53:37 (GMT) |
| commit | d409643b8eadd934849e2ffb749590e2ea672fb3 (patch) | |
| tree | 5f051b7287102dd0074fdc927ef5ed812ca73fe6 /src/displayapp/screens/StopWatch.cpp | |
| parent | 02824d0671b558e5a36188df4cbc729b571dad1a (diff) | |
Added some comments for clarity. Ready for review. Tested.
Diffstat (limited to 'src/displayapp/screens/StopWatch.cpp')
| -rw-r--r-- | src/displayapp/screens/StopWatch.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp index 9abf984..b00fc4b 100644 --- a/src/displayapp/screens/StopWatch.cpp +++ b/src/displayapp/screens/StopWatch.cpp @@ -85,7 +85,19 @@ StopWatch::~StopWatch() { } bool StopWatch::Refresh() { - + // @startuml CHIP8_state + // State "INIT" as init + // State "RUNNING" as run + // State "HALTED" as halt + + // [*] --> init + // init -> run : press play + // run -> run : press lap + // run --> halt : press pause + // halt --> run : press play + // halt --> init : press stop + // @enduml + // Copy paste the above plantuml text to visualize the state diagram switch (currentState) { // Init state when an user first opens the app // and when a stop/reset button is pressed @@ -132,7 +144,7 @@ bool StopWatch::Refresh() { if (lapBuffer[0]) { lv_label_set_text_fmt(lapTwoText, "#%d %d:%d:%d", lapNr, lapBuffer[0]->mins, lapBuffer[0]->secs, lapBuffer[0]->msecs); } - // Reset the bool to avoid setting the text in each cycle + // Reset the bool to avoid setting the text in each cycle until there is a change lapPressed = false; } |
