added tone request gateway before actually swithcing the pin
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Seconds.cpp
|
||||
*
|
||||
* Created on: 10.09.2020
|
||||
* Author: flori
|
||||
*/
|
||||
#include "Seconds.h"
|
||||
|
||||
uint32_t Seconds::lastMillisShifted = 0;
|
||||
uint32_t Seconds::seconds = 0;
|
||||
uint32_t Seconds::secondsOverflow = 0;
|
||||
boolean volatile Seconds::semaphore = false;
|
||||
|
||||
|
||||
|
||||
uint32_t Seconds::Get(void)
|
||||
{
|
||||
uint32_t secRet;
|
||||
uint32_t secNow = millis() / 1000;
|
||||
|
||||
if (secNow < seconds)
|
||||
{
|
||||
secondsOverflow += seconds + 1;
|
||||
}
|
||||
seconds = secNow;
|
||||
|
||||
secRet = seconds + secondsOverflow;
|
||||
|
||||
return secRet;
|
||||
}
|
||||
Reference in New Issue
Block a user