Added basic Logger with 4 modes.
This commit is contained in:
@@ -35,7 +35,7 @@ bool timeToStop(unsigned long now) {
|
||||
if (player.isPlaying) {
|
||||
uint64_t stopTime = player.startTime + player.duration;
|
||||
if (now >= stopTime) {
|
||||
Serial.println("TIMER: Total Duration Reached");
|
||||
LOG_DEBUG("TIMER: Total Duration Reached");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -46,10 +46,9 @@ bool timeToStop(unsigned long now) {
|
||||
bool timeToPause(unsigned long now) {
|
||||
if (player.isPlaying && player.loop_duration > 0) {
|
||||
uint64_t pauseTimeLimit = player.loopStartTime + player.loop_duration;
|
||||
Serial.printf("PTL: %lu // NOW: ",pauseTimeLimit);
|
||||
Serial.println(now);
|
||||
LOG_DEBUG("PTL: %lu // NOW: %d",pauseTimeLimit, now);
|
||||
if (now >= pauseTimeLimit && !player.isPaused) {
|
||||
Serial.println("TIMER: Segment Duration Reached");
|
||||
LOG_DEBUG("TIMER: Segment Duration Reached");
|
||||
player.pauseTime = now;
|
||||
return true;
|
||||
}
|
||||
@@ -62,7 +61,7 @@ bool timeToResume(unsigned long now) {
|
||||
if (player.isPaused) {
|
||||
uint64_t resumeTime = player.pauseTime + player.interval;
|
||||
if (now >= resumeTime) {
|
||||
Serial.println("TIMER: Pause Duration Reached");
|
||||
LOG_DEBUG("TIMER: Pause Duration Reached");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user