Преглед изворни кода

add:增加微秒定时的c接口

alienwalker пре 2 година
родитељ
комит
30f88f935f
2 измењених фајлова са 4 додато и 0 уклоњено
  1. 1 0
      luat/include/luat_rtos_legacy.h
  2. 3 0
      luat/modules/luat_lib_mcu.c

+ 1 - 0
luat/include/luat_rtos_legacy.h

@@ -40,6 +40,7 @@ void luat_mutex_release(void *mutex);
 /* ----------------------------------- timer ----------------------------------- */
 /* ----------------------------------- timer ----------------------------------- */
 void *luat_create_rtos_timer(void *cb, void *param, void *task_handle);
 void *luat_create_rtos_timer(void *cb, void *param, void *task_handle);
 int luat_start_rtos_timer(void *timer, uint32_t ms, uint8_t is_repeat);
 int luat_start_rtos_timer(void *timer, uint32_t ms, uint8_t is_repeat);
+int luat_start_rtos_timer_us(void *timer, uint32_t us);
 void luat_stop_rtos_timer(void *timer);
 void luat_stop_rtos_timer(void *timer);
 void luat_release_rtos_timer(void *timer);
 void luat_release_rtos_timer(void *timer);
 
 

+ 3 - 0
luat/modules/luat_lib_mcu.c

@@ -218,7 +218,10 @@ static int l_mcu_set_xtal(lua_State* L) {
     return 0;
     return 0;
 }
 }
 // #endif
 // #endif
+#ifdef LUAT_COMPILER_NOWEAK
+#else
 LUAT_WEAK void luat_mcu_set_hardfault_mode(int mode) {;}
 LUAT_WEAK void luat_mcu_set_hardfault_mode(int mode) {;}
+#endif
 /*
 /*
 mcu死机时处理模式,目前只有EC618平台适用
 mcu死机时处理模式,目前只有EC618平台适用
 @api mcu.hardfault(mode)
 @api mcu.hardfault(mode)