Prechádzať zdrojové kódy

fix: 生成lvgl绑定代码时应该忽略lv_debug和lv_task by @chenxiahuaxu

Wendal Chen 4 rokov pred
rodič
commit
83dc9dd74f

+ 0 - 38
components/lvgl/gen/luat_lv_gen.h

@@ -934,44 +934,6 @@ int luat_lv_color_to_hsv(lua_State *L);
     {"color_rgb_to_hsv", luat_lv_color_rgb_to_hsv, 0},\
     {"color_to_hsv", luat_lv_color_to_hsv, 0},\
 
-// prefix lv_misc lv_debug
-int luat_lv_debug_check_null(lua_State *L);
-int luat_lv_debug_check_mem_integrity(lua_State *L);
-int luat_lv_debug_check_str(lua_State *L);
-int luat_lv_debug_log_error(lua_State *L);
-
-#define LUAT_LV_DEBUG_RLT     {"debug_check_null", luat_lv_debug_check_null, 0},\
-    {"debug_check_mem_integrity", luat_lv_debug_check_mem_integrity, 0},\
-    {"debug_check_str", luat_lv_debug_check_str, 0},\
-    {"debug_log_error", luat_lv_debug_log_error, 0},\
-
-// prefix lv_misc lv_task
-int luat_lv_task_handler(lua_State *L);
-int luat_lv_task_create_basic(lua_State *L);
-int luat_lv_task_create(lua_State *L);
-int luat_lv_task_del(lua_State *L);
-int luat_lv_task_set_prio(lua_State *L);
-int luat_lv_task_set_period(lua_State *L);
-int luat_lv_task_ready(lua_State *L);
-int luat_lv_task_set_repeat_count(lua_State *L);
-int luat_lv_task_reset(lua_State *L);
-int luat_lv_task_enable(lua_State *L);
-int luat_lv_task_get_idle(lua_State *L);
-int luat_lv_task_get_next(lua_State *L);
-
-#define LUAT_LV_TASK_RLT     {"task_handler", luat_lv_task_handler, 0},\
-    {"task_create_basic", luat_lv_task_create_basic, 0},\
-    {"task_create", luat_lv_task_create, 0},\
-    {"task_del", luat_lv_task_del, 0},\
-    {"task_set_prio", luat_lv_task_set_prio, 0},\
-    {"task_set_period", luat_lv_task_set_period, 0},\
-    {"task_ready", luat_lv_task_ready, 0},\
-    {"task_set_repeat_count", luat_lv_task_set_repeat_count, 0},\
-    {"task_reset", luat_lv_task_reset, 0},\
-    {"task_enable", luat_lv_task_enable, 0},\
-    {"task_get_idle", luat_lv_task_get_idle, 0},\
-    {"task_get_next", luat_lv_task_get_next, 0},\
-
 
 // group lv_themes
 // prefix lv_themes lv_theme

+ 1 - 2
components/lvgl/gen/lv_misc/luat_lv_color.c

@@ -1,5 +1,4 @@
-
-
+

 #include "luat_base.h"
 #include "lvgl.h"
 #include "luat_lvgl.h"

+ 0 - 45
components/lvgl/gen/lv_misc/luat_lv_debug.c

@@ -1,45 +0,0 @@
-

-#include "luat_base.h"
-#include "lvgl.h"
-#include "luat_lvgl.h"
-
-
-//  bool lv_debug_check_null(void* p)
-int luat_lv_debug_check_null(lua_State *L) {
-    LV_DEBUG("CALL lv_debug_check_null");
-    void* p = (void*)lua_touserdata(L, 1);
-    bool ret;
-    ret = lv_debug_check_null(p);
-    lua_pushboolean(L, ret);
-    return 1;
-}
-
-//  bool lv_debug_check_mem_integrity()
-int luat_lv_debug_check_mem_integrity(lua_State *L) {
-    LV_DEBUG("CALL lv_debug_check_mem_integrity");
-    bool ret;
-    ret = lv_debug_check_mem_integrity();
-    lua_pushboolean(L, ret);
-    return 1;
-}
-
-//  bool lv_debug_check_str(void* str)
-int luat_lv_debug_check_str(lua_State *L) {
-    LV_DEBUG("CALL lv_debug_check_str");
-    void* str = (void*)lua_touserdata(L, 1);
-    bool ret;
-    ret = lv_debug_check_str(str);
-    lua_pushboolean(L, ret);
-    return 1;
-}
-
-//  void lv_debug_log_error(char* msg, uint64_t value)
-int luat_lv_debug_log_error(lua_State *L) {
-    LV_DEBUG("CALL lv_debug_log_error");
-    char* msg = (char*)luaL_checkstring(L, 1);
-    uint64_t value;
-    // miss arg convert
-    lv_debug_log_error(msg ,value);
-    return 0;
-}
-

+ 0 - 118
components/lvgl/gen/lv_misc/luat_lv_task.c

@@ -1,118 +0,0 @@
-

-#include "luat_base.h"
-#include "lvgl.h"
-#include "luat_lvgl.h"
-
-
-//  uint32_t lv_task_handler()
-int luat_lv_task_handler(lua_State *L) {
-    LV_DEBUG("CALL lv_task_handler");
-    uint32_t ret;
-    ret = lv_task_handler();
-    lua_pushinteger(L, ret);
-    return 1;
-}
-
-//  lv_task_t* lv_task_create_basic()
-int luat_lv_task_create_basic(lua_State *L) {
-    LV_DEBUG("CALL lv_task_create_basic");
-    lv_task_t* ret = NULL;
-    ret = lv_task_create_basic();
-    if (ret) lua_pushlightuserdata(L, ret); else lua_pushnil(L);
-    return 1;
-}
-
-//  lv_task_t* lv_task_create(lv_task_cb_t task_xcb, uint32_t period, lv_task_prio_t prio, void* user_data)
-int luat_lv_task_create(lua_State *L) {
-    LV_DEBUG("CALL lv_task_create");
-    lv_task_cb_t task_xcb;
-    // miss arg convert
-    uint32_t period = (uint32_t)luaL_checkinteger(L, 2);
-    lv_task_prio_t prio;
-    // miss arg convert
-    void* user_data = (void*)lua_touserdata(L, 4);
-    lv_task_t* ret = NULL;
-    ret = lv_task_create(task_xcb ,period ,prio ,user_data);
-    if (ret) lua_pushlightuserdata(L, ret); else lua_pushnil(L);
-    return 1;
-}
-
-//  void lv_task_del(lv_task_t* task)
-int luat_lv_task_del(lua_State *L) {
-    LV_DEBUG("CALL lv_task_del");
-    lv_task_t* task = (lv_task_t*)lua_touserdata(L, 1);
-    lv_task_del(task);
-    return 0;
-}
-
-//  void lv_task_set_prio(lv_task_t* task, lv_task_prio_t prio)
-int luat_lv_task_set_prio(lua_State *L) {
-    LV_DEBUG("CALL lv_task_set_prio");
-    lv_task_t* task = (lv_task_t*)lua_touserdata(L, 1);
-    lv_task_prio_t prio;
-    // miss arg convert
-    lv_task_set_prio(task ,prio);
-    return 0;
-}
-
-//  void lv_task_set_period(lv_task_t* task, uint32_t period)
-int luat_lv_task_set_period(lua_State *L) {
-    LV_DEBUG("CALL lv_task_set_period");
-    lv_task_t* task = (lv_task_t*)lua_touserdata(L, 1);
-    uint32_t period = (uint32_t)luaL_checkinteger(L, 2);
-    lv_task_set_period(task ,period);
-    return 0;
-}
-
-//  void lv_task_ready(lv_task_t* task)
-int luat_lv_task_ready(lua_State *L) {
-    LV_DEBUG("CALL lv_task_ready");
-    lv_task_t* task = (lv_task_t*)lua_touserdata(L, 1);
-    lv_task_ready(task);
-    return 0;
-}
-
-//  void lv_task_set_repeat_count(lv_task_t* task, int32_t repeat_count)
-int luat_lv_task_set_repeat_count(lua_State *L) {
-    LV_DEBUG("CALL lv_task_set_repeat_count");
-    lv_task_t* task = (lv_task_t*)lua_touserdata(L, 1);
-    int32_t repeat_count = (int32_t)luaL_checkinteger(L, 2);
-    lv_task_set_repeat_count(task ,repeat_count);
-    return 0;
-}
-
-//  void lv_task_reset(lv_task_t* task)
-int luat_lv_task_reset(lua_State *L) {
-    LV_DEBUG("CALL lv_task_reset");
-    lv_task_t* task = (lv_task_t*)lua_touserdata(L, 1);
-    lv_task_reset(task);
-    return 0;
-}
-
-//  void lv_task_enable(bool en)
-int luat_lv_task_enable(lua_State *L) {
-    LV_DEBUG("CALL lv_task_enable");
-    bool en = (bool)lua_toboolean(L, 1);
-    lv_task_enable(en);
-    return 0;
-}
-
-//  uint8_t lv_task_get_idle()
-int luat_lv_task_get_idle(lua_State *L) {
-    LV_DEBUG("CALL lv_task_get_idle");
-    uint8_t ret;
-    ret = lv_task_get_idle();
-    lua_pushinteger(L, ret);
-    return 1;
-}
-
-//  lv_task_t* lv_task_get_next(lv_task_t* task)
-int luat_lv_task_get_next(lua_State *L) {
-    LV_DEBUG("CALL lv_task_get_next");
-    lv_task_t* task = (lv_task_t*)lua_touserdata(L, 1);
-    lv_task_t* ret = NULL;
-    ret = lv_task_get_next(task);
-    if (ret) lua_pushlightuserdata(L, ret); else lua_pushnil(L);
-    return 1;
-}
-

+ 3 - 2
components/lvgl/genapi.py

@@ -192,13 +192,14 @@ def handle_groups(group, path):
         if not name.endswith(".h"):
             continue
         if name in ["lv_obj_style_gen.h", "lv_async.h", "lv_fs.h", "lv_log.h", "lv_mem.h",
-                    "lv_printf.h", "lv_style_gen.h", "lv_timer.h", "lv_indev.h", "lv_img_decoder.h", "lv_img_cache.h", "lv_img_buf.h"]:
+                    "lv_printf.h", "lv_style_gen.h", "lv_timer.h", "lv_indev.h", "lv_img_decoder.h", "lv_img_cache.h", "lv_img_buf.h",
+                    "lv_task.h", "lv_debug.h"]:
             continue
         if name.startswith("lv_draw_") :
             continue
         try :
             #print(">>>>>>>>>>>>" + name)
-            ast = parse_file(os.path.join(path, name), use_cpp=True, cpp_path='''C:/msys32/mingw32/bin/cpp.exe''', cpp_args=['-E', '-Imock', '-I../../../pycparser/utils/fake_libc_include', '-I.', '-I../../lua/include', '-I../../luat/include'])
+            ast = parse_file(os.path.join(path, name), use_cpp=True, cpp_path='''C:/msys64/mingw32/bin/cpp.exe''', cpp_args=['-E', '-Imock', '-I../../../pycparser/utils/fake_libc_include', '-I.', '-I../../lua/include', '-I../../luat/include'])
             v = FuncDefVisitor("lv_" + group, name[:-2])
             v.visit(ast)
         except  Exception :