From f7e92d4e0788667d9e94ec2b6409a744b4f75d84 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 9 May 2021 19:38:27 +0200 Subject: [PATCH] LVGL Fix warning when sending NULL instead of an instance --- lib/libesp32_lvgl/LVGL/library.json | 3 --- tasmota/xdrv_52_2_berry_native.ino | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/libesp32_lvgl/LVGL/library.json b/lib/libesp32_lvgl/LVGL/library.json index f0ec9b28d..9012204f0 100644 --- a/lib/libesp32_lvgl/LVGL/library.json +++ b/lib/libesp32_lvgl/LVGL/library.json @@ -7,9 +7,6 @@ "type": "git", "url": "https://github.com/lvgl/lvgl.git" }, - "build": { - "includeDir": "." - }, "license": "MIT", "homepage": "https://lvgl.io", "frameworks": "*", diff --git a/tasmota/xdrv_52_2_berry_native.ino b/tasmota/xdrv_52_2_berry_native.ino index 065ac0546..5f9eccd72 100644 --- a/tasmota/xdrv_52_2_berry_native.ino +++ b/tasmota/xdrv_52_2_berry_native.ino @@ -310,7 +310,12 @@ int32_t be_convert_single_elt(bvm *vm, int32_t idx, const char * arg_type = null // check if simple type was a match if (provided_type) { - if ((arg_type_len != 1) || ((arg_type[0] != provided_type) && arg_type[0] != '.') ) { + bool type_ok = false; + type_ok = (arg_type[0] == '.'); // any type is accepted + type_ok = type_ok || (arg_type[0] == provided_type); // or type is a match + type_ok = type_ok || (ret == 0 && arg_type_len != 1); // or NULL is accepted for an instance + + if (!type_ok) { berry_log_P("Unexpected argument type '%c', expected '%s'", provided_type, arg_type); } return ret;