|
@ -35,14 +35,21 @@ namespace ah { |
|
|
mMax = 0; |
|
|
mMax = 0; |
|
|
mPrevMillis = millis(); |
|
|
mPrevMillis = millis(); |
|
|
mTsMillis = mPrevMillis % 1000; |
|
|
mTsMillis = mPrevMillis % 1000; |
|
|
|
|
|
mFastTicker = false; |
|
|
resetTicker(); |
|
|
resetTicker(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
virtual void loop(void) { |
|
|
virtual void loop(void) { |
|
|
mMillis = millis(); |
|
|
mMillis = millis(); |
|
|
mDiff = mMillis - mPrevMillis; |
|
|
mDiff = mMillis - mPrevMillis; |
|
|
if (mDiff < 1000) |
|
|
if (mDiff < 1000) { |
|
|
|
|
|
if (mFastTicker) { |
|
|
|
|
|
mDiffSeconds = 0; |
|
|
|
|
|
checkTicker(); |
|
|
|
|
|
mFastTicker = false; |
|
|
|
|
|
} |
|
|
return; |
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
mDiffSeconds = 1; |
|
|
mDiffSeconds = 1; |
|
|
if (mDiff < 2000) |
|
|
if (mDiff < 2000) |
|
@ -127,6 +134,8 @@ namespace ah { |
|
|
mTicker[i].isTimestamp = isTimestamp; |
|
|
mTicker[i].isTimestamp = isTimestamp; |
|
|
strncpy(mTicker[i].name, name, 5); |
|
|
strncpy(mTicker[i].name, name, 5); |
|
|
mTicker[i].name[5]=0; |
|
|
mTicker[i].name[5]=0; |
|
|
|
|
|
if (timeout == 0 && reload == false) |
|
|
|
|
|
mFastTicker = true; |
|
|
if(mMax == i) |
|
|
if(mMax == i) |
|
|
mMax = i + 1; |
|
|
mMax = i + 1; |
|
|
return i; |
|
|
return i; |
|
@ -162,6 +171,7 @@ namespace ah { |
|
|
uint32_t mMillis = 0, mPrevMillis = 0, mDiff = 0; |
|
|
uint32_t mMillis = 0, mPrevMillis = 0, mDiff = 0; |
|
|
uint8_t mDiffSeconds = 0; |
|
|
uint8_t mDiffSeconds = 0; |
|
|
uint8_t mMax = 0; |
|
|
uint8_t mMax = 0; |
|
|
|
|
|
bool mFastTicker; |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|