Procházet zdrojové kódy

修复单次触发alarm,重复使用不启动定时器的bug

Eric LGF před 2 roky
rodič
revize
6deab5e93d
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      components/drivers/rtc/alarm.c

+ 4 - 0
components/drivers/rtc/alarm.c

@@ -281,7 +281,11 @@ static void alarm_update(rt_uint32_t event)
         else
         {
             if (_container.current != RT_NULL)
+            {
                 alarm_set(_container.current);
+                if (!(_container.current->flag & RT_ALARM_STATE_START))
+                    _container.current = RT_NULL;
+            }
         }
     }
     rt_mutex_release(&_container.mutex);