Added play time support along with elapsed time support code.

pull/7/head
midilab 7 years ago
parent 7ba44d1c05
commit eabbc69a66
  1. 8
      src/uClock.cpp
  2. 3
      src/uClock.h

@ -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;

@ -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();
};

Loading…
Cancel
Save