Skip to content

Commit a339b95

Browse files
committedFeb 14, 2021
better default state implementation
1 parent ce23334 commit a339b95

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/OneButton.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ void OneButton::tick(bool activeLevel)
322322
break;
323323

324324
default:
325-
// nothing to do.
325+
// unknown state detected -> reset state machine
326+
_newState(OneButton::OCS_INIT);
326327
break;
327328
} // if
328329

0 commit comments

Comments
 (0)
Please sign in to comment.