A Ton (Timer On) is used to provide an \'on delay\' system so as to avoid using wait()
Dependents: NEWlcd_menu_v2 Garage_Control
Diff: Ton.h
- Revision:
- 3:123a1b30970a
- Parent:
- 2:aa908ad1559a
--- a/Ton.h Fri Mar 04 13:43:51 2011 +0000 +++ b/Ton.h Fri Mar 04 14:15:47 2011 +0000 @@ -93,13 +93,15 @@ * @return true if active, false otherwise. */ bool isRunning(void) { + bool b = false; switch (_mode) { case InputResets: - return _lastInput; + b = _lastInput; break; case InputPauses: - return _counter > 0; + b = _counter > 0; } + return b; } /** setTime