소스 검색

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 ----------------------------------- */
 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_us(void *timer, uint32_t us);
 void luat_stop_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;
 }
 // #endif
+#ifdef LUAT_COMPILER_NOWEAK
+#else
 LUAT_WEAK void luat_mcu_set_hardfault_mode(int mode) {;}
+#endif
 /*
 mcu死机时处理模式,目前只有EC618平台适用
 @api mcu.hardfault(mode)