64 bit Timer Class.
Diff: Timer64.cpp
- Revision:
- 2:e89b02820e93
- Parent:
- 1:497fba179833
- Child:
- 3:8396d3e6eb62
diff -r 497fba179833 -r e89b02820e93 Timer64.cpp --- a/Timer64.cpp Sun Mar 27 20:18:44 2016 +0000 +++ b/Timer64.cpp Sun Mar 27 20:44:54 2016 +0000 @@ -63,7 +63,7 @@ { if (!_timerInitialized) { - return(TIMER64_ERROR_NOT_INITIALIZED); + return(TIMER64_WARNING_ALREADY_RELEASED); } if (_timerRunning) @@ -87,17 +87,14 @@ return(TIMER64_ERROR_NOT_INITIALIZED); } - if (!_timerRunning) - { - _tickerStartTimeUsec = ticker_read(_ticker_data); - _timerRunning = true; - _rollOverCheckTimer->start(_rollOverCheckTimerPeriodInMsec); - } - else + if (_timerRunning) { return(TIMER64_WARNING_ALREADY_RUNNING); } - + + _tickerStartTimeUsec = ticker_read(_ticker_data); + _timerRunning = true; + _rollOverCheckTimer->start(_rollOverCheckTimerPeriodInMsec); return(TIMER64_OK); } @@ -108,16 +105,14 @@ return(TIMER64_ERROR_NOT_INITIALIZED); } - if (_timerRunning) - { - read_us(); - _timerRunning = false; - _rollOverCheckTimer->stop(); - } - else + if (!_timerRunning) { return(TIMER64_WARNING_ALREADY_STOPPED); } + + read_us(); + _timerRunning = false; + _rollOverCheckTimer->stop(); return(TIMER64_OK); }