Browse Source

Fix MinusFadeOut.

Vladimir N. Shilov 3 years ago
parent
commit
9c75e69d10
1 changed files with 10 additions and 0 deletions
  1. 10 0
      Src/main.c

+ 10 - 0
Src/main.c

@@ -94,9 +94,17 @@ int main(void)
   Color_RGB(0xFF, 0x12, 0x0); // Nixie color. FF1200 or FF7E00 or FFBF00
   showTime();
 
+  uint8_t oldsec;
   /* Infinite loop */
   while (1)
   {
+    oldsec = Clock.Sec;
+    RTC_ReadAll(&Clock);
+    if (oldsec != Clock.Sec) {
+      Flag.RTC_IRQ = 1;
+      ES_PlaceEvent(evNewSecond);
+    }
+
     /* new second interrupt from RTC */
     if (Flag.RTC_IRQ != 0) {
       Flag.RTC_IRQ = 0;
@@ -315,6 +323,8 @@ void MinusFadeOut(void) {
     off += 2;
     if (off < 20) {
       RTOS_SetTask(MinusFadeOut, off, 0);
+    } else {
+      off = 0; on = 20; st = 0;
     }
   } else {
     st = 0;