Procházet zdrojové kódy

update:lua支持us级timer,但是由于脚本运行延迟,不建议使用小于100us的应用,而且需要留出提前量

alienwalker před 3 roky
rodič
revize
2bb01d15b6
1 změnil soubory, kde provedl 9 přidání a 1 odebrání
  1. 9 1
      application/src/luat_timer_air105.c

+ 9 - 1
application/src/luat_timer_air105.c

@@ -89,7 +89,15 @@ int luat_timer_start(luat_timer_t* timer) {
     timers[timerIndex] = timer;
     
     timer->os_timer = os_timer;
-    return Timer_StartMS(os_timer, timer->timeout, timer->repeat);
+    if (timer->type)
+    {
+    	return Timer_StartUS(os_timer, timer->timeout, timer->repeat);
+    }
+    else
+    {
+    	return Timer_StartMS(os_timer, timer->timeout, timer->repeat);
+    }
+
 }
 
 int luat_timer_stop(luat_timer_t* timer) {