From f87324f87488e15a6e961e1a0f1e791145e7be79 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Tue, 18 Oct 2022 09:55:08 +0200 Subject: [PATCH] LVGL fix get text --- .../lv_binding_berry/generate/be_lv_c_mapping.h | 6 +++--- lib/libesp32_lvgl/lv_binding_berry/tools/convert.py | 2 +- .../tasmota_xdrv_driver/xdrv_52_3_berry_tasmota_global.ino | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h index 7c99171d3..5d7cb5ed9 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h +++ b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h @@ -876,7 +876,7 @@ const be_ntv_func_def_t lv_dropdown_func[] = { { "get_options", { (const void*) &lv_dropdown_get_options, "s", "(lv.lv_obj)" } }, { "get_selected", { (const void*) &lv_dropdown_get_selected, "i", "(lv.lv_obj)" } }, { "get_selected_highlight", { (const void*) &lv_dropdown_get_selected_highlight, "b", "(lv.lv_obj)" } }, - { "get_selected_str", { (const void*) &lv_dropdown_get_selected_str, "", "(lv.lv_obj)ci" } }, + { "get_selected_str", { (const void*) &lv_dropdown_get_selected_str, "", "(lv.lv_obj)si" } }, { "get_symbol", { (const void*) &lv_dropdown_get_symbol, "s", "(lv.lv_obj)" } }, { "get_text", { (const void*) &lv_dropdown_get_text, "s", "(lv.lv_obj)" } }, { "is_open", { (const void*) &lv_dropdown_is_open, "b", "(lv.lv_obj)" } }, @@ -899,7 +899,7 @@ const be_ntv_func_def_t lv_label_func[] = { { "get_letter_pos", { (const void*) &lv_label_get_letter_pos, "", "(lv.lv_obj)i(lv.lv_point)" } }, { "get_long_mode", { (const void*) &lv_label_get_long_mode, "i", "(lv.lv_obj)" } }, { "get_recolor", { (const void*) &lv_label_get_recolor, "b", "(lv.lv_obj)" } }, - { "get_text", { (const void*) &lv_label_get_text, "c", "(lv.lv_obj)" } }, + { "get_text", { (const void*) &lv_label_get_text, "s", "(lv.lv_obj)" } }, { "get_text_selection_end", { (const void*) &lv_label_get_text_selection_end, "i", "(lv.lv_obj)" } }, { "get_text_selection_start", { (const void*) &lv_label_get_text_selection_start, "i", "(lv.lv_obj)" } }, { "ins_text", { (const void*) &lv_label_ins_text, "", "(lv.lv_obj)is" } }, @@ -929,7 +929,7 @@ const be_ntv_func_def_t lv_roller_func[] = { { "get_option_cnt", { (const void*) &lv_roller_get_option_cnt, "i", "(lv.lv_obj)" } }, { "get_options", { (const void*) &lv_roller_get_options, "s", "(lv.lv_obj)" } }, { "get_selected", { (const void*) &lv_roller_get_selected, "i", "(lv.lv_obj)" } }, - { "get_selected_str", { (const void*) &lv_roller_get_selected_str, "", "(lv.lv_obj)ci" } }, + { "get_selected_str", { (const void*) &lv_roller_get_selected_str, "", "(lv.lv_obj)si" } }, { "set_options", { (const void*) &lv_roller_set_options, "", "(lv.lv_obj)s(lv.lv_roller_mode)" } }, { "set_selected", { (const void*) &lv_roller_set_selected, "", "(lv.lv_obj)ii" } }, { "set_visible_row_count", { (const void*) &lv_roller_set_visible_row_count, "", "(lv.lv_obj)i" } }, diff --git a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py index a8f4ba4ad..4890009c4 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py +++ b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py @@ -35,7 +35,7 @@ return_types = { "int32_t": "i", "void *": ".", "const void *": ".", - "char *": "c", + "char *": "s", "uint8_t *": "c", "const char *": "s", "constchar *": "s", # special construct diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota_global.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota_global.ino index 417bac186..854b3522c 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota_global.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota_global.ino @@ -36,6 +36,7 @@ extern "C" { 4, /* number of elements */ nullptr, (const be_ctypes_structure_item_t[4]) { + // Warning: fields below need to be in alphabetical order { "devices_present", offsetof(TasmotaGlobal_t, devices_present), 0, 0, ctypes_u8, 0 }, { "fast_loop_enabled", offsetof(TasmotaGlobal_t, berry_fast_loop_enabled), 0, 0, ctypes_u8, 0 }, { "restart_flag", offsetof(TasmotaGlobal_t, restart_flag), 0, 0, ctypes_u8, 0 }, @@ -47,10 +48,11 @@ extern "C" { 2, /* number of elements */ nullptr, (const be_ctypes_structure_item_t[2]) { + // Warning: fields below need to be in alphabetical order { "bootcount", offsetof(TSettings, bootcount), 0, 0, ctypes_u16, 0 }, { "sleep", offsetof(TSettings, sleep), 0, 0, ctypes_u8, 0 }, }}; } -#endif // USE_BERRY \ No newline at end of file +#endif // USE_BERRY