|
@@ -78,7 +78,7 @@ TUBE_CALLBACK(2)
|
|
|
Timeout Tube3UpdateTimeout;
|
|
|
TUBE_CALLBACK(3)
|
|
|
|
|
|
-void FadeInOutDigit(int T, int D, int Duration) {
|
|
|
+void FadeInOutDigit(int T, int D, int Duration, bool HighPrio = false) {
|
|
|
for (int i = 0; i < NUM_DIGITS; i++) {
|
|
|
Tubes[T].Digits[i].CurrentState = Decrementing;
|
|
|
}
|
|
@@ -88,6 +88,13 @@ void FadeInOutDigit(int T, int D, int Duration) {
|
|
|
Tubes[T].FadeDuration = Duration;
|
|
|
Tubes[T].LastActiveDigit = D;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (Tubes[T].Refresh && HighPrio) {
|
|
|
+ Tubes[T].RefreshLastDigit = D;
|
|
|
+ }
|
|
|
+
|
|
|
if (T == 0) {
|
|
|
Tube0UpdateTimeout.attach_us(Tube0UpdateCallback, REFRESH_RATE_US);
|
|
|
} else if (T == 1) {
|
|
@@ -238,16 +245,16 @@ int main() {
|
|
|
|
|
|
|
|
|
if (startup || prevHour / 10 != nextHour / 10) {
|
|
|
- FadeInOutDigit(0, (nextHour / 10 != 0) ? nextHour / 10 : -1 , DIGIT_FADE_DURATION_US);
|
|
|
+ FadeInOutDigit(0, (nextHour / 10 != 0) ? nextHour / 10 : -1 , DIGIT_FADE_DURATION_US, true);
|
|
|
}
|
|
|
if (startup || prevHour % 10 != nextHour % 10) {
|
|
|
- FadeInOutDigit(1, nextHour % 10, DIGIT_FADE_DURATION_US);
|
|
|
+ FadeInOutDigit(1, nextHour % 10, DIGIT_FADE_DURATION_US, true);
|
|
|
}
|
|
|
if (startup || prevMinute / 10 != nextMinute / 10) {
|
|
|
- FadeInOutDigit(2, nextMinute / 10, DIGIT_FADE_DURATION_US);
|
|
|
+ FadeInOutDigit(2, nextMinute / 10, DIGIT_FADE_DURATION_US, true);
|
|
|
}
|
|
|
if (startup || prevMinute % 10 != nextMinute % 10) {
|
|
|
- FadeInOutDigit(3, nextMinute % 10, DIGIT_FADE_DURATION_US);
|
|
|
+ FadeInOutDigit(3, nextMinute % 10, DIGIT_FADE_DURATION_US, true);
|
|
|
}
|
|
|
|
|
|
Dot.CurrentState = (Dot.CurrentState == Decrementing) ? Incrementing : Decrementing;
|