Răsfoiți Sursa

fix: https://gitee.com/openLuat/LuatOS/issues/I3S5XL VM退出后重启时间被延长了1000倍

Wendal Chen 4 ani în urmă
părinte
comite
f63fb3d3b8

+ 3 - 3
bsp/sysp/port/luat_base_sysp.c

@@ -100,9 +100,9 @@ void luat_os_standy(int timeout) {
     return; // nop
 }
 
-void luat_ota_reboot(int timeout) {
-  if (timeout > 0)
-    luat_timer_mdelay(timeout * 1000);
+void luat_ota_reboot(int timeout_ms) {
+  if (timeout_ms > 0)
+    luat_timer_mdelay(timeout_ms);
   luat_os_reboot(1);
 }
 

+ 3 - 3
bsp/win32/port/luat_base_win32.c

@@ -115,9 +115,9 @@ void luat_os_standy(int timeout) {
     return; // nop
 }
 
-void luat_ota_reboot(int timeout) {
-  if (timeout > 0)
-    luat_timer_mdelay(timeout * 1000);
+void luat_ota_reboot(int timeout_ms) {
+  if (timeout_ms > 0)
+    luat_timer_mdelay(timeout_ms);
   exit(0);
 }
 

+ 1 - 1
luat/include/luat_ota.h

@@ -18,6 +18,6 @@
 #endif
 
 int luat_ota_update_or_rollback(void);
-void luat_ota_reboot(int timeout);
+void luat_ota_reboot(int timeout_ms);
 
 #endif

+ 5 - 5
luat/modules/luat_ota.c

@@ -36,9 +36,9 @@ int luat_ota_mark_rollback(void) {
 static void luat_bin_exec_update(void);
 static void luat_bin_exec_rollback(void);
 
-LUAT_WEAK void luat_ota_reboot(int timeout) {
-  if (timeout > 0)
-    luat_timer_mdelay(timeout * 1000);
+LUAT_WEAK void luat_ota_reboot(int timeout_ms) {
+  if (timeout_ms > 0)
+    luat_timer_mdelay(timeout_ms);
   luat_os_reboot(1);
 }
 
@@ -63,13 +63,13 @@ int luat_ota_update_or_rollback(void) {
   if (luat_ota_need_update()) {
     luat_ota_exec_update();
     LLOGW("update: reboot at 5 secs");
-    luat_ota_reboot(5);
+    luat_ota_reboot(5000);
     return 1;
   }
   if (luat_ota_need_rollback()) {
     luat_ota_exec_rollback();
     LLOGW("rollback: reboot at 5 secs");
-    luat_ota_reboot(5);
+    luat_ota_reboot(5000);
     return 1;
   }
   return 0;