diff --git a/src/uClock.cpp b/src/uClock.cpp index 7b0ca8f..d769f2b 100755 --- a/src/uClock.cpp +++ b/src/uClock.cpp @@ -58,6 +58,7 @@ void uClockClass::init() indiv96th_counter = 0; inmod6_counter = 0; pll_x = 220; + start_timer = 0; // // Configure timers and prescale @@ -113,6 +114,8 @@ void uClockClass::start() void uClockClass::stop() { + start_timer = 0; + if (mode == INTERNAL_CLOCK) { state = PAUSED; } else { @@ -315,6 +318,11 @@ uint32_t uClockClass::getNowTimer() return _timer; } +uint32_t uClockClass::getPlayTime() +{ + return start_timer; +} + } } // end namespace umodular::clock umodular::clock::uClockClass uClock; diff --git a/src/uClock.h b/src/uClock.h index ab89487..f00250d 100755 --- a/src/uClock.h +++ b/src/uClock.h @@ -119,7 +119,8 @@ class uClockClass { uint8_t getNumberOfMinutes(uint32_t time); uint8_t getNumberOfHours(uint32_t time); uint8_t getNumberOfDays(uint32_t time); - uint32_t uClockClass::getNowTimer(); + uint32_t getNowTimer(); + uint32_t getPlayTime(); };