From 039fd65f64ceb0ff9d92a51427011b3a5cd0348f Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 3 Dec 2021 20:10:24 +0100 Subject: [PATCH 01/97] LVGL simplified font code --- tasmota/xdrv_52_3_berry_lvgl.ino | 431 ++++++++++++++----------------- 1 file changed, 195 insertions(+), 236 deletions(-) diff --git a/tasmota/xdrv_52_3_berry_lvgl.ino b/tasmota/xdrv_52_3_berry_lvgl.ino index af435851b..dcf1f9968 100644 --- a/tasmota/xdrv_52_3_berry_lvgl.ino +++ b/tasmota/xdrv_52_3_berry_lvgl.ino @@ -404,6 +404,10 @@ extern "C" { be_return(vm); } + /*********************************************************************************************\ + * Support for lv_fonts + \*********************************************************************************************/ + // load font by name on file-system int lv0_load_font(bvm *vm) { int argc = be_top(vm); if (argc == 1 && be_isstring(vm, 1)) { @@ -421,6 +425,10 @@ extern "C" { be_raise(vm, kTypeError, nullptr); } + /*********************************************************************************************\ + * Support for Freetype fonts + \*********************************************************************************************/ + // load freetype font by name in file-system int lv0_load_freetype_font(bvm *vm) { #ifdef USE_LVGL_FREETYPE int argc = be_top(vm); @@ -448,261 +456,212 @@ extern "C" { #endif // USE_LVGL_FREETYPE } - int lv0_load_montserrat_font(bvm *vm) { - int argc = be_top(vm); - if (argc == 1 && be_isint(vm, 1)) { - const lv_font_t * font = nullptr; - int32_t font_size = be_toindex(vm, 1); + /*********************************************************************************************\ + * Support for embedded fonts in Flash + \*********************************************************************************************/ + // We create tables for Font matching + // Size of `0` indicates end of table + typedef struct { + int16_t size; + const lv_font_t *font; + } lv_font_table_t; - switch (font_size) { + typedef struct { + const char * name; + const lv_font_table_t * table; + } lv_font_names_t; - #if LV_FONT_MONTSERRAT_8 - case 8: - font = &lv_font_montserrat_8; - break; - #endif + // Montserrat Font + const lv_font_table_t lv_montserrat_fonts[] = { + #if LV_FONT_MONTSERRAT_8 + { 8, &lv_font_montserrat_8 }, + #endif + #if LV_FONT_MONTSERRAT_10 + { 10, &lv_font_montserrat_10 }, + #endif + #if LV_FONT_MONTSERRAT_12 + { 12, &lv_font_montserrat_12 }, + #endif + #if LV_FONT_MONTSERRAT_14 + { 14, &lv_font_montserrat_14 }, + #endif + #if LV_FONT_MONTSERRAT_16 + { 16, &lv_font_montserrat_16 }, + #endif + #if LV_FONT_MONTSERRAT_18 + { 18, &lv_font_montserrat_18 }, + #endif + #if LV_FONT_MONTSERRAT_20 + { 20, &lv_font_montserrat_20 }, + #endif + #if LV_FONT_MONTSERRAT_22 + { 22, &lv_font_montserrat_22 }, + #endif + #if LV_FONT_MONTSERRAT_24 + { 24, &lv_font_montserrat_24 }, + #endif + #if LV_FONT_MONTSERRAT_26 + { 26, &lv_font_montserrat_26 }, + #endif + #if LV_FONT_MONTSERRAT_28 + { 28, &lv_font_montserrat_28 }, + #endif + #if LV_FONT_MONTSERRAT_28_COMPRESSED + { 28, &lv_font_montserrat_28_compressed, }, + #endif + #if LV_FONT_MONTSERRAT_30 + { 30, &lv_font_montserrat_30 }, + #endif + #if LV_FONT_MONTSERRAT_32 + { 32, &lv_font_montserrat_32 }, + #endif + #if LV_FONT_MONTSERRAT_34 + { 34, &lv_font_montserrat_34 }, + #endif + #if LV_FONT_MONTSERRAT_36 + { 36, &lv_font_montserrat_36 }, + #endif + #if LV_FONT_MONTSERRAT_38 + { 38, &lv_font_montserrat_38 }, + #endif + #if LV_FONT_MONTSERRAT_40 + { 40, &lv_font_montserrat_40 }, + #endif + #if LV_FONT_MONTSERRAT_42 + { 42, &lv_font_montserrat_42 }, + #endif + #if LV_FONT_MONTSERRAT_44 + { 44, &lv_font_montserrat_44 }, + #endif + #if LV_FONT_MONTSERRAT_46 + { 46, &lv_font_montserrat_46 }, + #endif + #if LV_FONT_MONTSERRAT_48 + { 48, &lv_font_montserrat_48 }, + #endif + { 0, nullptr} + }; - #if LV_FONT_MONTSERRAT_10 - case 10: - font = &lv_font_montserrat_10; - break; - #endif + // Seg7 Font + const lv_font_table_t lv_seg7_fonts[] = { + { 8, &seg7_8 }, + { 10, &seg7_10 }, + { 12, &seg7_12 }, + { 14, &seg7_14 }, + { 16, &seg7_16 }, + { 18, &seg7_18 }, + { 20, &seg7_20 }, + { 24, &seg7_24 }, + { 28, &seg7_28 }, + { 36, &seg7_36 }, + { 48, &seg7_48 }, + }; - #if LV_FONT_MONTSERRAT_12 - case 12: - font = &lv_font_montserrat_12; - break; - #endif + // robotocondensed-latin1 + const lv_font_table_t lv_robotocondensed_fonts[] = { +#if ROBOTOCONDENSED_REGULAR_12_LATIN1 + { 12, &robotocondensed_regular_12_latin1 }, +#endif +#if ROBOTOCONDENSED_REGULAR_14_LATIN1 + { 14, &robotocondensed_regular_14_latin1 }, +#endif +#if ROBOTOCONDENSED_REGULAR_16_LATIN1 + { 16, &robotocondensed_regular_16_latin1 }, +#endif +#if ROBOTOCONDENSED_REGULAR_20_LATIN1 + { 20, &robotocondensed_regular_20_latin1 }, +#endif +#if ROBOTOCONDENSED_REGULAR_22_LATIN1 + { 22, &robotocondensed_regular_22_latin1 }, +#endif +#if ROBOTOCONDENSED_REGULAR_24_LATIN1 + { 24, &robotocondensed_regular_24_latin1 }, +#endif +#if ROBOTOCONDENSED_REGULAR_28_LATIN1 + { 28, &robotocondensed_regular_28_latin1 }, +#endif +#if ROBOTOCONDENSED_REGULAR_32_LATIN1 + { 32, &robotocondensed_regular_32_latin1 }, +#endif +#if ROBOTOCONDENSED_REGULAR_36_LATIN1 + { 36, &robotocondensed_regular_36_latin1 }, +#endif +#if ROBOTOCONDENSED_REGULAR_38_LATIN1 + { 38, &robotocondensed_regular_38_latin1 }, +#endif +#if ROBOTOCONDENSED_REGULAR_40_LATIN1 + { 40, &robotocondensed_regular_40_latin1 }, +#endif +#if ROBOTOCONDENSED_REGULAR_44_LATIN1 + { 44, &robotocondensed_regular_44_latin1 }, +#endif +#if ROBOTOCONDENSED_REGULAR_48_LATIN1 + { 48, &robotocondensed_regular_48_latin1 }, +#endif + }; - #if LV_FONT_MONTSERRAT_14 - case 14: - font = &lv_font_montserrat_14; - break; - #endif + // register all included fonts + const lv_font_names_t lv_embedded_fonts[] = { + { "montserrat", lv_montserrat_fonts }, + { "seg7", lv_seg7_fonts }, +#ifdef USE_LVGL_OPENHASP + { "robotocondensed", lv_robotocondensed_fonts }, +#endif + { nullptr, nullptr} + }; - #if LV_FONT_MONTSERRAT_16 - case 16: - font = &lv_font_montserrat_16; - break; - #endif - - #if LV_FONT_MONTSERRAT_18 - case 18: - font = &lv_font_montserrat_18; - break; - #endif - - #if LV_FONT_MONTSERRAT_20 - case 20: - font = &lv_font_montserrat_20; - break; - #endif - - #if LV_FONT_MONTSERRAT_22 - case 22: - font = &lv_font_montserrat_22; - break; - #endif - - #if LV_FONT_MONTSERRAT_24 - case 24: - font = &lv_font_montserrat_24; - break; - #endif - - #if LV_FONT_MONTSERRAT_26 - case 26: - font = &lv_font_montserrat_26; - break; - #endif - - #if LV_FONT_MONTSERRAT_28 - case 28: - font = &lv_font_montserrat_28; - break; - #endif - - #if LV_FONT_MONTSERRAT_30 - case 30: - font = &lv_font_montserrat_30; - break; - #endif - - #if LV_FONT_MONTSERRAT_32 - case 32: - font = &lv_font_montserrat_32; - break; - #endif - - #if LV_FONT_MONTSERRAT_34 - case 34: - font = &lv_font_montserrat_34; - break; - #endif - - #if LV_FONT_MONTSERRAT_36 - case 36: - font = &lv_font_montserrat_36; - break; - #endif - - #if LV_FONT_MONTSERRAT_38 - case 38: - font = &lv_font_montserrat_38; - break; - #endif - - #if LV_FONT_MONTSERRAT_40 - case 40: - font = &lv_font_montserrat_40; - break; - #endif - - #if LV_FONT_MONTSERRAT_42 - case 42: - font = &lv_font_montserrat_42; - break; - #endif - - #if LV_FONT_MONTSERRAT_44 - case 44: - font = &lv_font_montserrat_44; - break; - #endif - - #if LV_FONT_MONTSERRAT_46 - case 46: - font = &lv_font_montserrat_46; - break; - #endif - - #if LV_FONT_MONTSERRAT_48 - case 48: - font = &lv_font_montserrat_48; - break; - #endif - - #if LV_FONT_MONTSERRAT_28_COMPRESSED - case 28: - font = &lv_font_montserrat_28_compressed; - break; - #endif - - default: - break; - } - - if (font != nullptr) { - be_find_class(vm, "lv.lv_font"); - be_pushcomptr(vm, (void*)font); - be_call(vm, 1); - be_pop(vm, 1); - be_return(vm); - } else { - be_return_nil(vm); + // If size is zero, it is read at arg 1 + int lv_load_embedded_font(bvm *vm, const char * name, int16_t size) { + if (0 == size) { + if (be_top(vm) >= 1 && be_isint(vm, 1)) { + size = be_toindex(vm, 1); } } - be_raise(vm, kTypeError, nullptr); + if (name == nullptr || 0 == size) { + be_raise(vm, "value_error", ""); + } + // first look for font + const lv_font_names_t * font_name_cursor = lv_embedded_fonts; + for (font_name_cursor = lv_embedded_fonts; font_name_cursor->name; font_name_cursor++) { + if (strcmp(name, font_name_cursor->name) == 0) break; // found + } + if (font_name_cursor->name == nullptr) { + be_raisef(vm, "value_error", "unknown font '%s'", name); + } + // scan for font size + const lv_font_table_t * font_entry = font_name_cursor->table; + for (font_entry = font_name_cursor->table; font_entry->size; font_entry++) { + if (font_entry->size == size) break; // found + } + if (font_entry->size == 0) { + be_raisef(vm, "value_error", "unknown font size '%s-%i'", name, size); + } + + be_find_class(vm, "lv.lv_font"); + be_pushcomptr(vm, (void*)font_entry->font); + be_call(vm, 1); + be_pop(vm, 1); + be_return(vm); + } + + int lv0_load_montserrat_font(bvm *vm) { + return lv_load_embedded_font(vm, "montserrat", 0); } int lv0_load_seg7_font(bvm *vm) { - int argc = be_top(vm); - if (argc == 1 && be_isint(vm, 1)) { - const lv_font_t * font = nullptr; - int32_t font_size = be_toindex(vm, 1); - - switch (font_size) { - case 8: font = &seg7_8; break; - case 10: font = &seg7_10; break; - case 12: font = &seg7_12; break; - case 14: font = &seg7_14; break; - case 16: font = &seg7_16; break; - case 18: font = &seg7_18; break; - case 20: font = &seg7_20; break; - case 24: font = &seg7_24; break; - case 28: font = &seg7_28; break; - case 36: font = &seg7_36; break; - case 48: font = &seg7_48; break; - default: break; - } - - if (font != nullptr) { - be_find_class(vm, "lv.lv_font"); - be_pushcomptr(vm, (void*)font); - be_call(vm, 1); - be_pop(vm, 1); - be_return(vm); - } else { - be_return_nil(vm); - } - } - be_raise(vm, kTypeError, nullptr); + return lv_load_embedded_font(vm, "seg7", 0); } int lv0_load_robotocondensed_latin1_font(bvm *vm) { #ifdef USE_LVGL_OPENHASP - int argc = be_top(vm); - if (argc == 1 && be_isint(vm, 1)) { - const lv_font_t * font = nullptr; - int32_t font_size = be_toindex(vm, 1); - - switch (font_size) { -#if ROBOTOCONDENSED_REGULAR_12_LATIN1 - case 12: font = &robotocondensed_regular_12_latin1; break; -#endif -#if ROBOTOCONDENSED_REGULAR_14_LATIN1 - case 14: font = &robotocondensed_regular_14_latin1; break; -#endif -#if ROBOTOCONDENSED_REGULAR_16_LATIN1 - case 16: font = &robotocondensed_regular_16_latin1; break; -#endif -#if ROBOTOCONDENSED_REGULAR_20_LATIN1 - case 20: font = &robotocondensed_regular_20_latin1; break; -#endif -#if ROBOTOCONDENSED_REGULAR_22_LATIN1 - case 22: font = &robotocondensed_regular_22_latin1; break; -#endif -#if ROBOTOCONDENSED_REGULAR_24_LATIN1 - case 24: font = &robotocondensed_regular_24_latin1; break; -#endif -#if ROBOTOCONDENSED_REGULAR_28_LATIN1 - case 28: font = &robotocondensed_regular_28_latin1; break; -#endif -#if ROBOTOCONDENSED_REGULAR_32_LATIN1 - case 32: font = &robotocondensed_regular_32_latin1; break; -#endif -#if ROBOTOCONDENSED_REGULAR_36_LATIN1 - case 36: font = &robotocondensed_regular_36_latin1; break; -#endif -#if ROBOTOCONDENSED_REGULAR_38_LATIN1 - case 38: font = &robotocondensed_regular_38_latin1; break; -#endif -#if ROBOTOCONDENSED_REGULAR_40_LATIN1 - case 40: font = &robotocondensed_regular_40_latin1; break; -#endif -#if ROBOTOCONDENSED_REGULAR_44_LATIN1 - case 44: font = &robotocondensed_regular_44_latin1; break; -#endif -#if ROBOTOCONDENSED_REGULAR_48_LATIN1 - case 48: font = &robotocondensed_regular_48_latin1; break; -#endif - default: break; - } - - if (font != nullptr) { - be_find_class(vm, "lv.lv_font"); - be_pushcomptr(vm, (void*)font); - be_call(vm, 1); - be_pop(vm, 1); - be_return(vm); - } else { - be_return_nil(vm); - } - } + return lv_load_embedded_font(vm, "robotocondensed", 0); #endif // USE_LVGL_OPENHASP be_raise(vm, kTypeError, nullptr); } + /*********************************************************************************************\ + * Tasmota Logo + \*********************************************************************************************/ #include "lvgl_berry/tasmota_logo_64_truecolor_alpha.h" void lv_img_set_tasmota_logo(lv_obj_t * img) { From d6760962cdefb2734ecb7dcaf781097721641844 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 3 Dec 2021 20:12:46 +0100 Subject: [PATCH 02/97] LVGL screenshot in BMP format --- tasmota/xdrv_52_3_berry_lvgl.ino | 44 +++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/tasmota/xdrv_52_3_berry_lvgl.ino b/tasmota/xdrv_52_3_berry_lvgl.ino index af435851b..9a2973df1 100644 --- a/tasmota/xdrv_52_3_berry_lvgl.ino +++ b/tasmota/xdrv_52_3_berry_lvgl.ino @@ -956,11 +956,53 @@ extern "C" { if (!glue) { be_return_nil(vm); } char fname[32]; - snprintf(fname, sizeof(fname), "/screenshot-%d.raw", Rtc.utc_time); + snprintf(fname, sizeof(fname), "/screenshot-%d.bmp", Rtc.utc_time); File f = dfsp->open(fname, "w"); if (f) { glue->setScreenshotFile(&f); + uint32_t bmp_width = lv_disp_get_hor_res(nullptr); + uint32_t bmp_height = lv_disp_get_ver_res(nullptr); + + // write BMP header + static const uint8_t bmp_sign[] = { 0x42, 0x4d }; // BM = Windows + f.write(bmp_sign, sizeof(bmp_sign)); + size_t bmp_size = bmp_width * bmp_height * LV_COLOR_DEPTH / 8 + 0x44; + f.write((uint8_t*)&bmp_size, sizeof(bmp_size)); + uint32_t zero = 0; + f.write((uint8_t*) &zero, sizeof(zero)); // reserved 4-bytes + uint32_t bmp_offset_to_pixels = 0x44; // TODO + f.write((uint8_t*) &bmp_offset_to_pixels, sizeof(bmp_offset_to_pixels)); + + // DIB Header BITMAPINFOHEADER + size_t bmp_dib_header_size = 52; // BITMAPV2INFOHEADER + f.write((uint8_t*) &bmp_dib_header_size, sizeof(bmp_dib_header_size)); + + f.write((uint8_t*) &bmp_width, sizeof(bmp_width)); + f.write((uint8_t*) &bmp_height, sizeof(bmp_height)); + + // rest of header + // BITMAPV2INFOHEADER = 52 bytes header, 40 bytes sub-header + static const uint8_t bmp_dib_header[] = { + 0x01, 0x00, // planes + 16, 0x00, // bits per pixel = 16 + 0x03, 0x00, 0x00, 0x00, // compression = BI_BITFIELDS uncrompressed + 0x00, 0x00, 0x00, 0x00, // Image size, 0 is valid for BI_RGB (uncompressed) TODO + 0x00, 0x00, 0x00, 0x00, // X pixels per meter + 0x00, 0x00, 0x00, 0x00, // Y pixels per meter + 0x00, 0x00, 0x00, 0x00, // Colors in table + 0x00, 0x00, 0x00, 0x00, // Important color count + + // RGB masks + 0x00, 0xF8, 0x00, 0x00, // Red channel mask + 0xE0, 0x07, 0x00, 0x00, // Green channel mask + 0x1F, 0x00, 0x00, 0x00, // Blue channel mask + + 0x00, 0x00, // Padding to align on 4 bytes boundary + }; + f.write(bmp_dib_header, sizeof(bmp_dib_header)); + // now we can write the pixels array + // redraw screen lv_obj_invalidate(lv_scr_act()); lv_refr_now(lv_disp_get_default()); From 581d710a7b1d6c187b88c80cd4a0dbfe75515213 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Fri, 3 Dec 2021 20:33:20 +0100 Subject: [PATCH 03/97] Use toolchains 8.4.0-2021r2 --- platformio_tasmota32.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini index 5ef6f0463..575f9d160 100644 --- a/platformio_tasmota32.ini +++ b/platformio_tasmota32.ini @@ -32,14 +32,14 @@ build_flags = ${esp_defaults.build_flags} -Wl,--wrap=panicHandler -Wl,--wrap=xt_unhandled_exception [core32] -platform = https://github.com/tasmota/platform-espressif32/releases/download/v3.4.0/Tasmota-platform-espressif32.zip +platform = https://github.com/tasmota/platform-espressif32/releases/download/v3.4.1/Tasmota-platform-espressif32.zip platform_packages = build_unflags = ${esp32_defaults.build_unflags} build_flags = ${esp32_defaults.build_flags} [core32solo1] -platform = https://github.com/tasmota/platform-espressif32/releases/download/v3.4.0/Tasmota-platform-espressif32.zip +platform = https://github.com/tasmota/platform-espressif32/releases/download/v3.4.1/Tasmota-platform-espressif32.zip platform_packages = framework-arduinoespressif32 @ https://github.com/tasmota/arduino-esp32/releases/download/2.0.1.1/framework-arduinoespressif32-solo1-release_IDF4.4.tar.gz build_unflags = ${esp32_defaults.build_unflags} build_flags = ${esp32_defaults.build_flags} From 86922aab8c9eb3d0b1fe749f1926d1cd8afa30b1 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Fri, 3 Dec 2021 21:09:19 +0100 Subject: [PATCH 04/97] Toolchains changed --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb781e0d4..804a381a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,10 +12,11 @@ All notable changes to this project will be documented in this file. - (Internal) Range conversion edge values - NimBLE to v.1.3.3 - MQTT TLS dual mode (CA or fingeprint) in same firmware, ``SetOption132 1`` to force fingerprint +- Toolchains for ESP32x changed from 8.4.0-2021r1 to 8.4.0-2021r2 ### Fixed - Tuya dimmer range issue (#13849) -- BLE Memory leak with update NimBLE v.1.3.1 to v.1.3.3 +- BLE Memory leak with update NimBLE v.1.3.1 to v.1.3.3 ## [10.0.0.3] 20211130 ### Added From 490b004ebb03dab262bf055425c412e3b2d575a4 Mon Sep 17 00:00:00 2001 From: logon84 Date: Sat, 4 Dec 2021 02:33:07 +0100 Subject: [PATCH 05/97] Update xdrv_44_miel_hvac.ino --- tasmota/xdrv_44_miel_hvac.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index dd7461d8c..1a97425b8 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -904,7 +904,7 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR("}")); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings")); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings"), MQTT_INFO_RETAIN); } static void From 2437ab117f2af6b5af0bf2dfaffa7154d5bc7f0b Mon Sep 17 00:00:00 2001 From: logon84 Date: Sat, 4 Dec 2021 11:18:13 +0100 Subject: [PATCH 06/97] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 1a97425b8..1c9c97a79 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -904,7 +904,7 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR("}")); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings"), MQTT_INFO_RETAIN); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings"), Settings->flag5.mqtt_info_retain); } static void @@ -945,7 +945,7 @@ miel_hvac_data_response(struct miel_hvac_softc *sc, Response_P(PSTR("{\"Bytes\":\"%s\"}"), ToHex_P((uint8_t *)d, sizeof(*d), hex, sizeof(hex))); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData")); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData"),Settings->flag5.mqtt_info_retain); } static void From 9cc2394d672c34adda3f036168f55307b077e6eb Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 4 Dec 2021 12:02:26 +0100 Subject: [PATCH 07/97] Add shift 74xx595 persistence --- tasmota/settings.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasmota/settings.h b/tasmota/settings.h index 3686b1d42..b488df2e6 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -162,7 +162,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t show_heap_with_timestamp : 1; // bit 16 (v9.5.0.9) - SetOption130 - (Debug) Show heap with logging timestamp uint32_t tuya_allow_dimmer_0 : 1; // bit 17 (v10.0.0.3) - SetOption131 - (Tuya) Allow save dimmer = 0 receved by MCU uint32_t tls_use_fingerprint : 1; // bit 18 (v10.0.0.4) - SetOption132 - (TLS) use fingerprint validation instead of CA based - uint32_t spare19 : 1; // bit 19 + uint32_t shift595_option : 1; // bit 19 (v10.0.0.4) - SetOption133 - (595) uint32_t spare20 : 1; // bit 20 uint32_t spare21 : 1; // bit 21 uint32_t spare22 : 1; // bit 22 @@ -686,8 +686,9 @@ typedef struct { uint8_t weight_change; // E9F uint8_t web_color2[2][3]; // EA0 Needs to be on integer / 3 distance from web_color - uint8_t free_ea6[33]; // EA6 + uint8_t free_ea6[32]; // EA6 + uint8_t shift595; // EC6 uint8_t sta_config; // EC7 uint8_t sta_active; // EC8 uint8_t rule_stop; // EC9 From 3a92189c44eb61a9b8c1c3ced875451a221a5b0a Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 4 Dec 2021 12:26:19 +0100 Subject: [PATCH 08/97] Add command SspmDisplay Add command ``SspmDisplay 0/1`` to change GUI display to powered on relays only. --- tasmota/xdrv_86_esp32_sonoff_spm.ino | 106 +++++++++++++++++---------- 1 file changed, 68 insertions(+), 38 deletions(-) diff --git a/tasmota/xdrv_86_esp32_sonoff_spm.ino b/tasmota/xdrv_86_esp32_sonoff_spm.ino index 9f858691b..afe70b115 100644 --- a/tasmota/xdrv_86_esp32_sonoff_spm.ino +++ b/tasmota/xdrv_86_esp32_sonoff_spm.ino @@ -175,6 +175,7 @@ typedef struct { uint8_t command_sequence; uint8_t mstate; uint8_t last_button; + uint8_t gui_display; bool discovery_triggered; } TSspm; @@ -1082,29 +1083,30 @@ bool SSPMButton(void) { /*********************************************************************************************/ const uint16_t SSPM_SIZE = 128; -const char kSSPMEnergyPhases[] PROGMEM = "%*_f%*_f%*_f%*_f|[%*_f,%*_f,%*_f,%*_f]"; -char* SSPMEnergyFormat(char* result, float* input, uint32_t resolution, bool json) { - char layout[100]; - GetTextIndexed(layout, sizeof(layout), json, kSSPMEnergyPhases); - ext_snprintf_P(result, SSPM_SIZE, layout, resolution, &input[0], resolution, &input[1], resolution, &input[2], resolution, &input[3]); +char* SSPMEnergyFormat(char* result, float* input, uint32_t resolution, uint8_t* indirect, uint8_t offset, uint32_t count) { + result[0] = '\0'; + for (uint32_t i = 0; i < count; i++) { + ext_snprintf_P(result, SSPM_SIZE, PSTR("%s%*_f"), result, resolution, &input[indirect[offset +i]]); + } + ext_snprintf_P(result, SSPM_SIZE, PSTR("%s"), result); return result; } const char HTTP_SSPM_VOLTAGE[] PROGMEM = - "{s}" D_VOLTAGE "%s" D_UNIT_VOLT "{e}"; // {s} = , {m} = , {e} = + "{s}" D_VOLTAGE "%s" D_UNIT_VOLT "{e}"; // {s} = , {m} = , {e} = const char HTTP_SSPM_CURRENT[] PROGMEM = - "{s}" D_CURRENT "%s" D_UNIT_AMPERE "{e}"; + "{s}" D_CURRENT "%s" D_UNIT_AMPERE "{e}"; const char HTTP_SSPM_POWER[] PROGMEM = - "{s}" D_POWERUSAGE_ACTIVE "%s" D_UNIT_WATT "{e}"; + "{s}" D_POWERUSAGE_ACTIVE "%s" D_UNIT_WATT "{e}"; const char HTTP_SSPM_POWER2[] PROGMEM = - "{s}" D_POWERUSAGE_APPARENT "%s" D_UNIT_VA "{e}" - "{s}" D_POWERUSAGE_REACTIVE "%s" D_UNIT_VAR "{e}" - "{s}" D_POWER_FACTOR "%s{e}"; + "{s}" D_POWERUSAGE_APPARENT "%s" D_UNIT_VA "{e}" + "{s}" D_POWERUSAGE_REACTIVE "%s" D_UNIT_VAR "{e}" + "{s}" D_POWER_FACTOR "%s{e}"; const char HTTP_SSPM_ENERGY[] PROGMEM = - "{s}" D_ENERGY_TODAY "%s" D_UNIT_KILOWATTHOUR "{e}" - "{s}" D_ENERGY_YESTERDAY "%s" D_UNIT_KILOWATTHOUR "{e}" - "{s}" D_ENERGY_TOTAL "%s" D_UNIT_KILOWATTHOUR "{e}"; + "{s}" D_ENERGY_TODAY "%s" D_UNIT_KILOWATTHOUR "{e}" + "{s}" D_ENERGY_YESTERDAY "%s" D_UNIT_KILOWATTHOUR "{e}" + "{s}" D_ENERGY_TOTAL "%s" D_UNIT_KILOWATTHOUR "{e}"; void SSPMEnergyShow(bool json) { if (!TasmotaGlobal.devices_present) { return; } // Not ready yet @@ -1152,30 +1154,50 @@ void SSPMEnergyShow(bool json) { } ResponseAppend_P(PSTR("]}")); } else { - Sspm->rotate++; - if (Sspm->rotate >= TasmotaGlobal.devices_present) { - Sspm->rotate = 0; + uint8_t relay[SSPM_MAX_MODULES * 4]; + uint8_t indirect[SSPM_MAX_MODULES * 4]; + + uint32_t index = 0; + power_t power = TasmotaGlobal.power; + for (uint32_t i = 0; i < TasmotaGlobal.devices_present; i++) { + if ((0 == Sspm->gui_display) || + ((1 == Sspm->gui_display) && (power >> i) &1)) { + relay[index] = i +1; + indirect[index] = i; + index++; + } } - uint32_t module = Sspm->rotate >> 2; - uint32_t relay_base = module * 4; - WSContentSend_P(PSTR("{t}{s}")); // First column is empty ({t} = , {s} =
) - for (uint32_t i = 1; i < 5; i++) { - WSContentSend_P(PSTR("L%d"), relay_base +i); + + if (index) { + uint32_t offset = 0; + if (index > 4) { + Sspm->rotate++; + if (Sspm->rotate >= ((index -1) >> 2) << 3) { + Sspm->rotate = 0; + } + offset = (Sspm->rotate >> 2) * 4; + } + uint32_t count = index - offset; + if (count > 4) { count = 4; } + WSContentSend_P(PSTR("
{t}{s}")); // First column is empty ({t} = , {s} = ) + char value_chr[SSPM_SIZE]; + WSContentSend_PD(HTTP_SSPM_VOLTAGE, SSPMEnergyFormat(value_chr, Sspm->voltage[0], Settings->flag2.voltage_resolution, indirect, offset, count)); + WSContentSend_PD(HTTP_SSPM_CURRENT, SSPMEnergyFormat(value_chr, Sspm->current[0], Settings->flag2.current_resolution, indirect, offset, count)); + WSContentSend_PD(HTTP_SSPM_POWER, SSPMEnergyFormat(value_chr, Sspm->active_power[0], Settings->flag2.wattage_resolution, indirect, offset, count)); + char valu2_chr[SSPM_SIZE]; + char valu3_chr[SSPM_SIZE]; + WSContentSend_PD(HTTP_SSPM_POWER2, SSPMEnergyFormat(value_chr, Sspm->apparent_power[0], Settings->flag2.wattage_resolution, indirect, offset, count), + SSPMEnergyFormat(valu2_chr, Sspm->reactive_power[0], Settings->flag2.wattage_resolution, indirect, offset, count), + SSPMEnergyFormat(valu3_chr, Sspm->power_factor[0], 2, indirect, offset, count)); + WSContentSend_PD(HTTP_SSPM_ENERGY, SSPMEnergyFormat(value_chr, Sspm->energy_today[0], Settings->flag2.energy_resolution, indirect, offset, count), + SSPMEnergyFormat(valu2_chr, Sspm->energy_yesterday[0], Settings->flag2.energy_resolution, indirect, offset, count), + SSPMEnergyFormat(valu3_chr, Sspm->energy_total[0], Settings->flag2.energy_resolution, indirect, offset, count)); + WSContentSend_P(PSTR("
) + for (uint32_t i = 0; i < count; i++) { + WSContentSend_P(PSTR("L%d"), relay[offset +i]); + } + WSContentSend_P(PSTR("{e}")); // Last column is units ({e} =
{t}")); // {t} = - Define for next FUNC_WEB_SENSOR } - WSContentSend_P(PSTR(") - char value_chr[SSPM_SIZE]; - WSContentSend_PD(HTTP_SSPM_VOLTAGE, SSPMEnergyFormat(value_chr, Sspm->voltage[module], Settings->flag2.voltage_resolution, json)); - WSContentSend_PD(HTTP_SSPM_CURRENT, SSPMEnergyFormat(value_chr, Sspm->current[module], Settings->flag2.current_resolution, json)); - WSContentSend_PD(HTTP_SSPM_POWER, SSPMEnergyFormat(value_chr, Sspm->active_power[module], Settings->flag2.wattage_resolution, json)); - char valu2_chr[SSPM_SIZE]; - char valu3_chr[SSPM_SIZE]; - WSContentSend_PD(HTTP_SSPM_POWER2, SSPMEnergyFormat(value_chr, Sspm->apparent_power[module], Settings->flag2.wattage_resolution, json), - SSPMEnergyFormat(valu2_chr, Sspm->reactive_power[module], Settings->flag2.wattage_resolution, json), - SSPMEnergyFormat(valu3_chr, Sspm->power_factor[module], 2, json)); - WSContentSend_PD(HTTP_SSPM_ENERGY, SSPMEnergyFormat(value_chr, Sspm->energy_today[module], Settings->flag2.energy_resolution, json), - SSPMEnergyFormat(valu2_chr, Sspm->energy_yesterday[module], Settings->flag2.energy_resolution, json), - SSPMEnergyFormat(valu3_chr, Sspm->energy_total[module], Settings->flag2.energy_resolution, json)); - WSContentSend_P(PSTR("
{e}")); // Last column is units ({e} =
{t}")); // {t} = - Define for next FUNC_WEB_SENSOR } } @@ -1184,10 +1206,10 @@ void SSPMEnergyShow(bool json) { \*********************************************************************************************/ const char kSSPMCommands[] PROGMEM = "SSPM|" // Prefix - "Log|Energy|History|Scan|IamHere" ; + "Log|Energy|History|Scan|IamHere|Display" ; void (* const SSPMCommand[])(void) PROGMEM = { - &CmndSSPMLog, &CmndSSPMEnergy, &CmndSSPMEnergyHistory, &CmndSSPMScan, &CmndSSPMIamHere }; + &CmndSSPMLog, &CmndSSPMEnergy, &CmndSSPMEnergyHistory, &CmndSSPMScan, &CmndSSPMIamHere, &CmndSSPMDisplay }; void CmndSSPMLog(void) { // Report 29 log entries @@ -1222,6 +1244,14 @@ void CmndSSPMIamHere(void) { ResponseCmndDone(); } +void CmndSSPMDisplay(void) { + // Select either all relays or only powered on relays + if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 1)) { + Sspm->gui_display = XdrvMailbox.payload; + } + ResponseCmndNumber(Sspm->gui_display); +} + /*********************************************************************************************\ * Interface \*********************************************************************************************/ From bcbef695ce0a40fff12b1960552d1367f2164d2a Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 4 Dec 2021 13:46:43 +0100 Subject: [PATCH 09/97] Berry sync with upstream --- lib/libesp32/Berry/src/be_class.c | 2 +- lib/libesp32/Berry/src/be_class.h | 2 +- lib/libesp32/Berry/src/be_jsonlib.c | 2 +- lib/libesp32/Berry/src/be_strlib.c | 1 - lib/libesp32/Berry/src/be_vm.c | 14 +++++++------- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/libesp32/Berry/src/be_class.c b/lib/libesp32/Berry/src/be_class.c index a960d4b24..c2042fd39 100644 --- a/lib/libesp32/Berry/src/be_class.c +++ b/lib/libesp32/Berry/src/be_class.c @@ -220,7 +220,7 @@ static binstance* newobject(bvm *vm, bclass *c) /* Instanciate new instance from stack with argc parameters */ /* Pushes the constructor on the stack to be executed if a construtor is found */ /* Returns true if a constructor is found */ -bbool be_class_newobj(bvm *vm, bclass *c, int32_t pos, int argc, int mode) +bbool be_class_newobj(bvm *vm, bclass *c, int pos, int argc, int mode) { bvalue init; binstance *obj = newobject(vm, c); /* create empty object hierarchy from class hierarchy */ diff --git a/lib/libesp32/Berry/src/be_class.h b/lib/libesp32/Berry/src/be_class.h index 59abbab30..405ea6d38 100644 --- a/lib/libesp32/Berry/src/be_class.h +++ b/lib/libesp32/Berry/src/be_class.h @@ -58,7 +58,7 @@ void be_prim_method_bind(bvm *vm, bclass *c, bstring *name, bntvfunc f); void be_closure_method_bind(bvm *vm, bclass *c, bstring *name, bclosure *cl); int be_class_closure_count(bclass *c); void be_class_upvalue_init(bvm *vm, bclass *c); -bbool be_class_newobj(bvm *vm, bclass *c, int32_t pos, int argc, int mode); +bbool be_class_newobj(bvm *vm, bclass *c, int pos, int argc, int mode); int be_instance_member_simple(bvm *vm, binstance *obj, bstring *name, bvalue *dst); int be_instance_member(bvm *vm, binstance *obj, bstring *name, bvalue *dst); int be_class_member(bvm *vm, bclass *obj, bstring *name, bvalue *dst); diff --git a/lib/libesp32/Berry/src/be_jsonlib.c b/lib/libesp32/Berry/src/be_jsonlib.c index 2ee2a4daa..1d7049ea1 100644 --- a/lib/libesp32/Berry/src/be_jsonlib.c +++ b/lib/libesp32/Berry/src/be_jsonlib.c @@ -54,7 +54,7 @@ static int is_object(bvm *vm, const char *class, int idx) } be_remove(vm, -2); } - const char *name = be_classname(vm, idx); + const char *name = be_classname(vm, -1); bbool ret = !strcmp(name, class); be_pop(vm, 1); return ret; diff --git a/lib/libesp32/Berry/src/be_strlib.c b/lib/libesp32/Berry/src/be_strlib.c index e82ec3cf2..53f35607b 100644 --- a/lib/libesp32/Berry/src/be_strlib.c +++ b/lib/libesp32/Berry/src/be_strlib.c @@ -330,7 +330,6 @@ static bstring* string_range(bvm *vm, bstring *str, binstance *range) { bint lower, upper; bint size = str_len(str); /* size of source string */ - // bint size = be_data_size(vm, -1); /* get source list size */ /* get index range */ bvalue temp; be_instance_member(vm, range, be_newstr(vm, "__lower__"), &temp); diff --git a/lib/libesp32/Berry/src/be_vm.c b/lib/libesp32/Berry/src/be_vm.c index dd60e34b7..67519ee39 100644 --- a/lib/libesp32/Berry/src/be_vm.c +++ b/lib/libesp32/Berry/src/be_vm.c @@ -142,7 +142,7 @@ _vm->cf->status = PRIM_FUNC; \ } -static void prep_closure(bvm *vm, int32_t pos, int argc, int mode); +static void prep_closure(bvm *vm, int pos, int argc, int mode); static void attribute_error(bvm *vm, const char *t, bvalue *b, bvalue *c) { @@ -1186,7 +1186,7 @@ newframe: /* a new call frame */ } } -static void prep_closure(bvm *vm, int32_t pos, int argc, int mode) +static void prep_closure(bvm *vm, int pos, int argc, int mode) { bvalue *v, *end; bproto *proto = var2cl(vm->reg + pos)->proto; @@ -1211,7 +1211,7 @@ static void prep_closure(bvm *vm, int32_t pos, int argc, int mode) } } -static void do_closure(bvm *vm, int32_t pos, int argc) +static void do_closure(bvm *vm, int pos, int argc) { // bvalue *v, *end; // bproto *proto = var2cl(reg)->proto; @@ -1225,7 +1225,7 @@ static void do_closure(bvm *vm, int32_t pos, int argc) vm_exec(vm); } -static void do_ntvclos(bvm *vm, int32_t pos, int argc) +static void do_ntvclos(bvm *vm, int pos, int argc) { bntvclos *f = var_toobj(vm->reg + pos); push_native(vm, vm->reg + pos, argc, 0); @@ -1233,7 +1233,7 @@ static void do_ntvclos(bvm *vm, int32_t pos, int argc) ret_native(vm); } -static void do_ntvfunc(bvm *vm, int32_t pos, int argc) +static void do_ntvfunc(bvm *vm, int pos, int argc) { bntvfunc f = var_tontvfunc(vm->reg + pos); push_native(vm, vm->reg + pos, argc, 0); @@ -1241,7 +1241,7 @@ static void do_ntvfunc(bvm *vm, int32_t pos, int argc) ret_native(vm); } -static void do_class(bvm *vm, int32_t pos, int argc) +static void do_class(bvm *vm, int pos, int argc) { if (be_class_newobj(vm, var_toobj(vm->reg + pos), pos, ++argc, 0)) { be_incrtop(vm); @@ -1254,7 +1254,7 @@ void be_dofunc(bvm *vm, bvalue *v, int argc) { be_assert(vm->reg <= v && v < vm->stacktop); be_assert(vm->stack <= vm->reg && vm->reg < vm->stacktop); - int32_t pos = v - vm->reg; + int pos = v - vm->reg; switch (var_type(v)) { case BE_CLASS: do_class(vm, pos, argc); break; case BE_CLOSURE: do_closure(vm, pos, argc); break; From 888cbb999d50fba71d3f81d058cd6cc83c1caba8 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 4 Dec 2021 13:49:06 +0100 Subject: [PATCH 10/97] Rename be_map_release to be_map_compact --- lib/libesp32/Berry/src/be_api.c | 2 +- lib/libesp32/Berry/src/be_class.c | 2 +- lib/libesp32/Berry/src/be_map.c | 2 +- lib/libesp32/Berry/src/be_map.h | 2 +- lib/libesp32/Berry/src/be_module.c | 2 +- lib/libesp32/Berry/src/be_solidifylib.c | 2 +- lib/libesp32/Berry/src/be_var.c | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/libesp32/Berry/src/be_api.c b/lib/libesp32/Berry/src/be_api.c index d883c08d7..79d5c48ff 100644 --- a/lib/libesp32/Berry/src/be_api.c +++ b/lib/libesp32/Berry/src/be_api.c @@ -51,7 +51,7 @@ static void class_init(bvm *vm, bclass *c, const bnfuncinfo *lib) ++slib; } } - be_map_release(vm, c->members); /* clear space */ + be_map_compact(vm, c->members); /* clear space */ } } diff --git a/lib/libesp32/Berry/src/be_class.c b/lib/libesp32/Berry/src/be_class.c index c2042fd39..0f4efb3d5 100644 --- a/lib/libesp32/Berry/src/be_class.c +++ b/lib/libesp32/Berry/src/be_class.c @@ -40,7 +40,7 @@ bclass* be_newclass(bvm *vm, bstring *name, bclass *super) void be_class_compress(bvm *vm, bclass *c) { if (!gc_isconst(c) && c->members) { - be_map_release(vm, c->members); /* clear space */ + be_map_compact(vm, c->members); /* clear space */ } } diff --git a/lib/libesp32/Berry/src/be_map.c b/lib/libesp32/Berry/src/be_map.c index 004406f46..37f9efc62 100644 --- a/lib/libesp32/Berry/src/be_map.c +++ b/lib/libesp32/Berry/src/be_map.c @@ -343,7 +343,7 @@ bmapnode* be_map_val2node(bvalue *value) return (bmapnode *)((size_t)value - sizeof(bmapkey)); } -void be_map_release(bvm *vm, bmap *map) +void be_map_compact(bvm *vm, bmap *map) { (void)vm; if (!gc_isconst(map)) { diff --git a/lib/libesp32/Berry/src/be_map.h b/lib/libesp32/Berry/src/be_map.h index d632f0d0b..7ae76962c 100644 --- a/lib/libesp32/Berry/src/be_map.h +++ b/lib/libesp32/Berry/src/be_map.h @@ -56,6 +56,6 @@ bvalue* be_map_insertstr(bvm *vm, bmap *map, bstring *key, bvalue *value); void be_map_removestr(bvm *vm, bmap *map, bstring *key); bmapnode* be_map_next(bmap *map, bmapiter *iter); bmapnode* be_map_val2node(bvalue *value); -void be_map_release(bvm *vm, bmap *map); +void be_map_compact(bvm *vm, bmap *map); #endif diff --git a/lib/libesp32/Berry/src/be_module.c b/lib/libesp32/Berry/src/be_module.c index c661528a1..0256809af 100644 --- a/lib/libesp32/Berry/src/be_module.c +++ b/lib/libesp32/Berry/src/be_module.c @@ -99,7 +99,7 @@ static bmodule* new_module(bvm *vm, const bntvmodule *nm) obj->table = NULL; /* gc protection */ obj->table = be_map_new(vm); insert_attrs(vm, obj->table, nm); - be_map_release(vm, obj->table); /* clear space */ + be_map_compact(vm, obj->table); /* clear space */ be_stackpop(vm, 1); } return obj; diff --git a/lib/libesp32/Berry/src/be_solidifylib.c b/lib/libesp32/Berry/src/be_solidifylib.c index d8291b365..2b82b44fd 100644 --- a/lib/libesp32/Berry/src/be_solidifylib.c +++ b/lib/libesp32/Berry/src/be_solidifylib.c @@ -42,7 +42,7 @@ static void m_solidify_bvalue(bvm *vm, bvalue * value, const char *classname, co static void m_solidify_map(bvm *vm, bmap * map, const char *class_name) { // compact first - be_map_release(vm, map); + be_map_compact(vm, map); logfmt(" be_nested_map(%i,\n", map->count); diff --git a/lib/libesp32/Berry/src/be_var.c b/lib/libesp32/Berry/src/be_var.c index ebc70ecea..4fee144cd 100644 --- a/lib/libesp32/Berry/src/be_var.c +++ b/lib/libesp32/Berry/src/be_var.c @@ -87,7 +87,7 @@ bvalue* be_global_var(bvm *vm, int index) void be_global_release_space(bvm *vm) { - be_map_release(vm, global(vm).vtab); + be_map_compact(vm, global(vm).vtab); be_vector_release(vm, &global(vm).vlist); } @@ -130,7 +130,7 @@ int be_builtin_new(bvm *vm, bstring *name) void be_bulitin_release_space(bvm *vm) { - be_map_release(vm, builtin(vm).vtab); + be_map_compact(vm, builtin(vm).vtab); be_vector_release(vm, &builtin(vm).vlist); } #else From 2f9172a59f0dac19e09e805b033377378bb67797 Mon Sep 17 00:00:00 2001 From: Barbudor Date: Sat, 4 Dec 2021 15:03:15 +0100 Subject: [PATCH 11/97] fix pulsetime for more than 8 relays/power devices --- tasmota/support_tasmota.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index f3e4fe977..3129c2831 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -1043,7 +1043,7 @@ void Every100mSeconds(void) if (TasmotaGlobal.pulse_timer[i] != 0L) { // Timer active? if (TimeReached(TasmotaGlobal.pulse_timer[i])) { // Timer finished? TasmotaGlobal.pulse_timer[i] = 0L; // Turn off this timer - for (uint32_t j = 0; j < TasmotaGlobal.devices_present; j = j +MAX_PULSETIMERS) { + for (uint32_t j = 0; (i + j) < TasmotaGlobal.devices_present; j = j +MAX_PULSETIMERS) { ExecuteCommandPower(i + j +1, (POWER_ALL_OFF_PULSETIME_ON == Settings->poweronstate) ? POWER_ON : POWER_OFF, SRC_PULSETIMER); } } From 8c12424d78d747f208bdc9ee878898e91b37192f Mon Sep 17 00:00:00 2001 From: jziolkowski Date: Sat, 4 Dec 2021 15:39:00 +0100 Subject: [PATCH 12/97] WIP --- tasmota/i18n.h | 5 ++ tasmota/language/en_GB.h | 6 ++ tasmota/my_user_config.h | 2 + tasmota/settings.h | 5 +- tasmota/settings.ino | 3 + tasmota/tasmota_template.h | 14 ++++- tasmota/xdrv_60_shift595.ino | 114 +++++++++++++++++++++++++++++++++++ 7 files changed, 146 insertions(+), 3 deletions(-) create mode 100644 tasmota/xdrv_60_shift595.ino diff --git a/tasmota/i18n.h b/tasmota/i18n.h index 462774a53..db93df902 100644 --- a/tasmota/i18n.h +++ b/tasmota/i18n.h @@ -716,6 +716,11 @@ #define D_CMND_BR_RUN "" #define D_BR_NOT_STARTED "Berry not started" +// Commands xdrv_60_shift595.ino - 74x595 family shift register driver +#ifdef USE_SHIFT595 +#define D_CMND_SHIFT595_DEVICE_COUNT "Shift595DeviceCount" +#endif + // Commands xsns_02_analog.ino #define D_CMND_ADCPARAM "AdcParam" diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index 79eb011f1..0fed4b222 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -1083,4 +1083,10 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" +// xdrv_60_shift595.ino +#define D_GPIO_SHIFT595_SRCLK "74HC595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74HC595 RCLK" +#define D_GPIO_SHIFT595_OE "74HC595 OE" +#define D_GPIO_SHIFT595_SER "74HC595 SER" + #endif // _LANGUAGE_EN_GB_H_ diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index f04b79d93..d34174a56 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -350,6 +350,8 @@ #define ZIGBEE_DISTINCT_TOPICS false // [SetOption89] Enable unique device topic based on Zigbee device ShortAddr #define ZIGBEE_RMV_ZBRECEIVED false // [SetOption100] Remove ZbReceived form JSON message #define ZIGBEE_INDEX_EP false // [SetOption101] Add the source endpoint as suffix to attributes, ex `Power3` instead of `Power` if sent from endpoint 3 +#define SHIFT595_INVERT_OUTPUTS false // [SetOption133] Don't invert outputs of 74x595 shift register +#define SHIFT595_DEVICE_COUNT 1 // [Shift595Devices] Set the number of connected 74x595 shift registers /*********************************************************************************************\ * END OF SECTION 1 diff --git a/tasmota/settings.h b/tasmota/settings.h index 3686b1d42..02571350a 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -162,7 +162,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t show_heap_with_timestamp : 1; // bit 16 (v9.5.0.9) - SetOption130 - (Debug) Show heap with logging timestamp uint32_t tuya_allow_dimmer_0 : 1; // bit 17 (v10.0.0.3) - SetOption131 - (Tuya) Allow save dimmer = 0 receved by MCU uint32_t tls_use_fingerprint : 1; // bit 18 (v10.0.0.4) - SetOption132 - (TLS) use fingerprint validation instead of CA based - uint32_t spare19 : 1; // bit 19 + uint32_t shift595_invert_outputs : 1; // bit 19 (v10.0.0.5) - SetOption133 - (Shift595) invert outputs of 74x595 shift registers uint32_t spare20 : 1; // bit 20 uint32_t spare21 : 1; // bit 21 uint32_t spare22 : 1; // bit 22 @@ -487,7 +487,8 @@ typedef struct { int32_t energy_kWhyesterday_ph[3]; // 320 int32_t energy_kWhtotal_ph[3]; // 32C - uint8_t free_338[7]; // 338 + uint8_t shift595_device_count; // 338 + uint8_t free_339[6]; // 339 uint8_t tuyamcu_topic; // 33F Manage tuyaSend topic. ex_energy_power_delta on 6.6.0.20, replaced on 8.5.0.1 uint16_t domoticz_update_timer; // 340 diff --git a/tasmota/settings.ino b/tasmota/settings.ino index faee15800..b2a58e2ae 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -1196,6 +1196,9 @@ void SettingsDefaultSet2(void) { flag4.mqtt_tls |= MQTT_TLS_ENABLED; flag4.mqtt_no_retain |= MQTT_NO_RETAIN; + flag5.shift595_invert_outputs |= SHIFT595_INVERT_OUTPUTS; + Settings->shift595_device_count = SHIFT595_DEVICE_COUNT; + Settings->flag = flag; Settings->flag2 = flag2; Settings->flag3 = flag3; diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index bbbce4d01..9e08aedb1 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -176,6 +176,7 @@ enum UserSelectablePins { GPIO_BL0942_RX, // BL0942 Serial interface GPIO_HM330X_SET, // HM330X SET pin (sleep when low) GPIO_HEARTBEAT, GPIO_HEARTBEAT_INV, + GPIO_SHIFT595_SRCLK, GPIO_SHIFT595_RCLK, GPIO_SHIFT595_OE, GPIO_SHIFT595_SER, // 74HC595 Shift register GPIO_SENSOR_END }; enum ProgramSelectablePins { @@ -372,7 +373,11 @@ const char kSensorNames[] PROGMEM = D_SENSOR_BL0942_RX "|" D_SENSOR_HM330X_SET "|" D_SENSOR_HEARTBEAT "|" D_SENSOR_HEARTBEAT "_i|" - ; + +#ifdef USE_SHIFT595 + D_GPIO_SHIFT595_SRCLK "|" D_GPIO_SHIFT595_RCLK "|" D_GPIO_SHIFT595_OE "|" D_GPIO_SHIFT595_SER "|" +#endif +; const char kSensorNamesFixed[] PROGMEM = D_SENSOR_USER; @@ -930,6 +935,13 @@ const uint16_t kGpioNiceList[] PROGMEM = { AGPIO(GPIO_ADC_JOY) + MAX_ADCS, // Joystick AGPIO(GPIO_ADC_PH) + MAX_ADCS, // Analog PH Sensor #endif // ESP32 + +#ifdef USE_SHIFT595 + AGPIO(GPIO_SHIFT595_SRCLK), // 74HC595 shift register + AGPIO(GPIO_SHIFT595_RCLK), + AGPIO(GPIO_SHIFT595_OE), + AGPIO(GPIO_SHIFT595_SER), +#endif }; /*-------------------------------------------------------------------------------------------*\ diff --git a/tasmota/xdrv_60_shift595.ino b/tasmota/xdrv_60_shift595.ino new file mode 100644 index 000000000..6e45194fa --- /dev/null +++ b/tasmota/xdrv_60_shift595.ino @@ -0,0 +1,114 @@ +/* + xdrv_60_shift595.ino - 74x595 shift register family support for Tasmota + + Copyright (C) 2021 Jacek Ziółkowski + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +#ifdef USE_SHIFT595 + +#define XDRV_60 60 + +const char kShift595Commands[] PROGMEM = "|" D_CMND_SHIFT595_DEVICE_COUNT ; +void (* const Shit595Command[])(void) PROGMEM = { &CmndShift595Devices }; + +struct Shift595 { + int8_t pinSRCLK; + int8_t pinRCLK; + int8_t pinSER; + int8_t pinOE; + bool connected = false; + int8_t outputs; + int8_t first = TasmotaGlobal.devices_present; +} Shift595; + +void Shift595Init(void) +{ + if (PinUsed(GPIO_SHIFT595_SRCLK) && PinUsed(GPIO_SHIFT595_RCLK) && PinUsed(GPIO_SHIFT595_SER)) { + Shift595.pinSRCLK = Pin(GPIO_SHIFT595_SRCLK); + pinMode(Shift595.pinSRCLK, OUTPUT); + digitalWrite(Shift595.pinSRCLK, 0); + + Shift595.pinRCLK = Pin(GPIO_SHIFT595_RCLK); + pinMode(Shift595.pinRCLK, OUTPUT); + digitalWrite(Shift595.pinRCLK, 0); + + Shift595.pinSER = Pin(GPIO_SHIFT595_SER); + pinMode(Shift595.pinSER, OUTPUT); + digitalWrite(Shift595.pinSER, 0); + + if (PinUsed(GPIO_SHIFT595_OE)) { + Shift595.pinOE = Pin(GPIO_SHIFT595_OE); + pinMode(Shift595.pinOE, OUTPUT); + digitalWrite(Shift595.pinOE, 1); + } + Shift595.outputs = Settings->shift595_device_count * 8; + TasmotaGlobal.devices_present += Shift595.outputs; + Shift595.connected = true; + AddLog(LOG_LEVEL_DEBUG, PSTR("595: Controlling relays POWER%d to POWER%d"), Shift595.first + 1, Shift595.outputs); + } +} + +void Shift595LatchPin(uint8 pin) { + digitalWrite(pin, 1); + digitalWrite(pin, 0); +} + +void Shift595SwitchRelay(void) +{ + if (Shift595.connected == true) { + for (uint32_t i = 0; i < Shift595.outputs; i++) { + uint8_t relay_state = bitRead(XdrvMailbox.index, Shift595.first + Shift595.outputs -1 -i); + // digitalWrite(Shift595.pinSER, Settings->flag5.shift595_invert_outputs ? !relay_state : relay_state); + digitalWrite(Shift595.pinSER, relay_state); + Shift595LatchPin(Shift595.pinSRCLK); + } + + Shift595LatchPin(Shift595.pinRCLK); + + if (PinUsed(GPIO_SHIFT595_OE)) { + digitalWrite(Shift595.pinOE, 0); + } + } +} + +void CmndShift595Devices(void) { + if ((XdrvMailbox.payload > 0) && (XdrvMailbox.payload <= 4)) { + Settings->shift595_device_count = (1 == XdrvMailbox.payload) ? SHIFT595_DEVICE_COUNT : XdrvMailbox.payload; + TasmotaGlobal.restart_flag = 2; + } + ResponseCmndNumber(Settings->shift595_device_count); +} + +/*********************************************************************************************\ + * Interface +\*********************************************************************************************/ + +bool Xdrv60(uint8_t function) +{ + bool result = false; + switch (function) { + case FUNC_PRE_INIT: + Shift595Init(); + break; + case FUNC_SET_POWER: + Shift595SwitchRelay(); + break; + case FUNC_COMMAND: + result = DecodeCommand(kShift595Commands, Shift595Command); + break; + return result; +} + +#endif // USE_SHIFT595 From 1d3a3ee4151c4044e1888fcb2281e2b246d8537e Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 4 Dec 2021 16:14:08 +0100 Subject: [PATCH 13/97] Make SspmDisplay persistent --- tasmota/settings.h | 2 +- tasmota/xdrv_86_esp32_sonoff_spm.ino | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tasmota/settings.h b/tasmota/settings.h index b488df2e6..eb8ca22bc 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -250,7 +250,7 @@ typedef union { uint32_t sonoff_l1_music_sync : 1; // bit 5 (v9.5.0.5) - CMND_L1MUSICSYNC - Enable sync to music uint32_t influxdb_default : 1; // bit 6 (v9.5.0.5) - Set influxdb initial defaults if 0 uint32_t influxdb_state : 1; // bit 7 (v9.5.0.5) - CMND_IFX - Enable influxdb support - uint32_t spare08 : 1; // bit 8 + uint32_t sspm_display : 1; // bit 8 (v10.0.0.4) - CMND_SSPMDISPLAY - Enable gui display of powered on relays only uint32_t spare09 : 1; // bit 9 uint32_t spare10 : 1; // bit 10 uint32_t spare11 : 1; // bit 11 diff --git a/tasmota/xdrv_86_esp32_sonoff_spm.ino b/tasmota/xdrv_86_esp32_sonoff_spm.ino index afe70b115..eaeb2d758 100644 --- a/tasmota/xdrv_86_esp32_sonoff_spm.ino +++ b/tasmota/xdrv_86_esp32_sonoff_spm.ino @@ -175,7 +175,6 @@ typedef struct { uint8_t command_sequence; uint8_t mstate; uint8_t last_button; - uint8_t gui_display; bool discovery_triggered; } TSspm; @@ -1160,8 +1159,8 @@ void SSPMEnergyShow(bool json) { uint32_t index = 0; power_t power = TasmotaGlobal.power; for (uint32_t i = 0; i < TasmotaGlobal.devices_present; i++) { - if ((0 == Sspm->gui_display) || - ((1 == Sspm->gui_display) && (power >> i) &1)) { + if ((0 == Settings->sbflag1.sspm_display) || + ((1 == Settings->sbflag1.sspm_display) && (power >> i) &1)) { relay[index] = i +1; indirect[index] = i; index++; @@ -1247,9 +1246,9 @@ void CmndSSPMIamHere(void) { void CmndSSPMDisplay(void) { // Select either all relays or only powered on relays if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 1)) { - Sspm->gui_display = XdrvMailbox.payload; + Settings->sbflag1.sspm_display = XdrvMailbox.payload; } - ResponseCmndNumber(Sspm->gui_display); + ResponseCmndNumber(Settings->sbflag1.sspm_display); } /*********************************************************************************************\ From 4d05fb153c1e67cbdc83dac18c002f4b0c57e7f6 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 4 Dec 2021 17:39:04 +0100 Subject: [PATCH 14/97] Remove BlockedLoop detection from ESP32 --- tasmota/support.ino | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/tasmota/support.ino b/tasmota/support.ino index 76ca608e9..303a66e87 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -21,10 +21,15 @@ extern "C" { extern struct rst_info resetInfo; } +#ifdef USE_KNX +bool knx_started = false; +#endif // USE_KNX + /*********************************************************************************************\ * Watchdog extension (https://github.com/esp8266/Arduino/issues/1532) \*********************************************************************************************/ +#ifdef ESP8266 #include Ticker tickerOSWatch; @@ -38,12 +43,7 @@ uint8_t oswatch_blocked_loop = 0; //void OsWatchTicker() IRAM_ATTR; #endif // USE_WS2812_DMA -#ifdef USE_KNX -bool knx_started = false; -#endif // USE_KNX - -void OsWatchTicker(void) -{ +void OsWatchTicker(void) { uint32_t t = millis(); uint32_t last_run = t - oswatch_last_loop_time; @@ -66,27 +66,33 @@ void OsWatchTicker(void) } } -void OsWatchInit(void) -{ +void OsWatchInit(void) { oswatch_blocked_loop = RtcSettings.oswatch_blocked_loop; RtcSettings.oswatch_blocked_loop = 0; oswatch_last_loop_time = millis(); tickerOSWatch.attach_ms(((OSWATCH_RESET_TIME / 3) * 1000), OsWatchTicker); } -void OsWatchLoop(void) -{ +void OsWatchLoop(void) { oswatch_last_loop_time = millis(); // while(1) delay(1000); // this will trigger the os watch } -bool OsWatchBlockedLoop(void) -{ +bool OsWatchBlockedLoop(void) { return oswatch_blocked_loop; } -uint32_t ResetReason(void) -{ +#else // Anything except ESP8266 + +void OsWatchInit(void) {} +void OsWatchLoop(void) {} +bool OsWatchBlockedLoop(void) { + return false; +} + +#endif // ESP8266 + +uint32_t ResetReason(void) { /* user_interface.h REASON_DEFAULT_RST = 0, // "Power on" normal startup by power on @@ -100,9 +106,8 @@ uint32_t ResetReason(void) return ESP_ResetInfoReason(); } -String GetResetReason(void) -{ - if (oswatch_blocked_loop) { +String GetResetReason(void) { + if (OsWatchBlockedLoop()) { char buff[32]; strncpy_P(buff, PSTR(D_JSON_BLOCKED_LOOP), sizeof(buff)); return String(buff); From 8288d74bb2f654f01e27c86c8ef8bd62a8275973 Mon Sep 17 00:00:00 2001 From: jziolkowski Date: Sat, 4 Dec 2021 18:12:41 +0100 Subject: [PATCH 15/97] Reduce the max count of devices to never exceed MAX_RELAYS --- tasmota/xdrv_60_shift595.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xdrv_60_shift595.ino b/tasmota/xdrv_60_shift595.ino index 9bae92196..27200d52f 100644 --- a/tasmota/xdrv_60_shift595.ino +++ b/tasmota/xdrv_60_shift595.ino @@ -83,7 +83,7 @@ void Shift595SwitchRelay(void) } void CmndShift595Devices(void) { - if ((XdrvMailbox.payload > 0) && (XdrvMailbox.payload <= 4)) { + if ((XdrvMailbox.payload > 0) && (XdrvMailbox.payload <= 3)) { Settings->shift595_device_count = (1 == XdrvMailbox.payload) ? SHIFT595_DEVICE_COUNT : XdrvMailbox.payload; TasmotaGlobal.restart_flag = 2; } From 63ff462f53b026ba552fe55a82d9508166e67180 Mon Sep 17 00:00:00 2001 From: jziolkowski Date: Sun, 5 Dec 2021 13:40:01 +0100 Subject: [PATCH 16/97] using pointer for Shift595, refactored pin init --- tasmota/i18n.h | 2 - tasmota/my_user_config.h | 6 ++- tasmota/tasmota_template.h | 2 - tasmota/xdrv_60_shift595.ino | 92 +++++++++++++++++++----------------- 4 files changed, 53 insertions(+), 49 deletions(-) diff --git a/tasmota/i18n.h b/tasmota/i18n.h index db93df902..387ba8f33 100644 --- a/tasmota/i18n.h +++ b/tasmota/i18n.h @@ -717,9 +717,7 @@ #define D_BR_NOT_STARTED "Berry not started" // Commands xdrv_60_shift595.ino - 74x595 family shift register driver -#ifdef USE_SHIFT595 #define D_CMND_SHIFT595_DEVICE_COUNT "Shift595DeviceCount" -#endif // Commands xsns_02_analog.ino #define D_CMND_ADCPARAM "AdcParam" diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index dcdb5acc9..9eb87e186 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -350,8 +350,6 @@ #define ZIGBEE_DISTINCT_TOPICS false // [SetOption89] Enable unique device topic based on Zigbee device ShortAddr #define ZIGBEE_RMV_ZBRECEIVED false // [SetOption100] Remove ZbReceived form JSON message #define ZIGBEE_INDEX_EP false // [SetOption101] Add the source endpoint as suffix to attributes, ex `Power3` instead of `Power` if sent from endpoint 3 -#define SHIFT595_INVERT_OUTPUTS false // [SetOption133] Don't invert outputs of 74x595 shift register -#define SHIFT595_DEVICE_COUNT 1 // [Shift595DeviceCount] Set the number of connected 74x595 shift registers /*********************************************************************************************\ * END OF SECTION 1 @@ -895,6 +893,10 @@ // -- Other sensors/drivers ----------------------- +// #define USE_SHIFT595 + #define SHIFT595_INVERT_OUTPUTS false // [SetOption133] Don't invert outputs of 74x595 shift register + #define SHIFT595_DEVICE_COUNT 1 // [Shift595DeviceCount] Set the number of connected 74x595 shift registers + //#define USE_TM1638 // Add support for TM1638 switches copying Switch1 .. Switch8 (+1k code) //#define USE_HX711 // Add support for HX711 load cell (+1k5 code) // #define USE_HX711_GUI // Add optional web GUI to HX711 as scale (+1k8 code) diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 311ac9388..d8aa87742 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -374,9 +374,7 @@ const char kSensorNames[] PROGMEM = D_SENSOR_HM330X_SET "|" D_SENSOR_HEARTBEAT "|" D_SENSOR_HEARTBEAT "_i|" -#ifdef USE_SHIFT595 D_GPIO_SHIFT595_SRCLK "|" D_GPIO_SHIFT595_RCLK "|" D_GPIO_SHIFT595_OE "|" D_GPIO_SHIFT595_SER "|" -#endif ; const char kSensorNamesFixed[] PROGMEM = diff --git a/tasmota/xdrv_60_shift595.ino b/tasmota/xdrv_60_shift595.ino index 27200d52f..cf9a3868c 100644 --- a/tasmota/xdrv_60_shift595.ino +++ b/tasmota/xdrv_60_shift595.ino @@ -24,60 +24,64 @@ const char kShift595Commands[] PROGMEM = "|" D_CMND_SHIFT595_DEVICE_COUNT ; void (* const Shift595Command[])(void) PROGMEM = { &CmndShift595Devices }; struct Shift595 { - int8_t pinSRCLK; - int8_t pinRCLK; - int8_t pinSER; - int8_t pinOE; - int8_t outputs; - int8_t first = TasmotaGlobal.devices_present; + uint8_t pinSRCLK; + uint8_t pinRCLK; + uint8_t pinSER; + uint8_t pinOE; + uint8_t outputs; + uint8_t first; bool connected = false; -} Shift595; +} *Shift595 = nullptr; + +void Shift595ConfigurePin(uint8_t pin, uint8_t value = 0){ + pinMode(pin, OUTPUT); + digitalWrite(pin, value); +} void Shift595Init(void) { if (PinUsed(GPIO_SHIFT595_SRCLK) && PinUsed(GPIO_SHIFT595_RCLK) && PinUsed(GPIO_SHIFT595_SER)) { - Shift595.pinSRCLK = Pin(GPIO_SHIFT595_SRCLK); - pinMode(Shift595.pinSRCLK, OUTPUT); - digitalWrite(Shift595.pinSRCLK, 0); - - Shift595.pinRCLK = Pin(GPIO_SHIFT595_RCLK); - pinMode(Shift595.pinRCLK, OUTPUT); - digitalWrite(Shift595.pinRCLK, 0); + Shift595 = (struct Shift595*)calloc(1, sizeof(struct Shift595)); - Shift595.pinSER = Pin(GPIO_SHIFT595_SER); - pinMode(Shift595.pinSER, OUTPUT); - digitalWrite(Shift595.pinSER, 0); + Shift595->pinSRCLK = Pin(GPIO_SHIFT595_SRCLK); + Shift595->pinRCLK = Pin(GPIO_SHIFT595_RCLK); + Shift595->pinSER = Pin(GPIO_SHIFT595_SER); + + Shift595ConfigurePin(Shift595->pinSRCLK); + Shift595ConfigurePin(Shift595->pinRCLK); + Shift595ConfigurePin(Shift595->pinSER); if (PinUsed(GPIO_SHIFT595_OE)) { - Shift595.pinOE = Pin(GPIO_SHIFT595_OE); - pinMode(Shift595.pinOE, OUTPUT); - digitalWrite(Shift595.pinOE, 1); + Shift595->pinOE = Pin(GPIO_SHIFT595_OE); + Shift595ConfigurePin(Shift595->pinOE, 1); } - Shift595.outputs = Settings->shift595_device_count * 8; - TasmotaGlobal.devices_present += Shift595.outputs; - Shift595.connected = true; - AddLog(LOG_LEVEL_DEBUG, PSTR("595: Controlling relays POWER%d to POWER%d"), Shift595.first + 1, Shift595.first + Shift595.outputs); + + Shift595->first = TasmotaGlobal.devices_present; + Shift595->outputs = Settings->shift595_device_count * 8; + TasmotaGlobal.devices_present += Shift595->outputs; + Shift595->connected = true; + AddLog(LOG_LEVEL_DEBUG, PSTR("595: Controlling relays POWER%d to POWER%d"), Shift595->first + 1, Shift595->first + Shift595->outputs); } } -void Shift595LatchPin(uint8 pin) { +void Shift595LatchPin(uint8_t pin) { digitalWrite(pin, 1); digitalWrite(pin, 0); } void Shift595SwitchRelay(void) { - if (Shift595.connected == true) { - for (uint32_t i = 0; i < Shift595.outputs; i++) { - uint8_t relay_state = bitRead(XdrvMailbox.index, Shift595.first + Shift595.outputs -1 -i); - digitalWrite(Shift595.pinSER, Settings->flag5.shift595_invert_outputs ? !relay_state : relay_state); - Shift595LatchPin(Shift595.pinSRCLK); + if (Shift595 && Shift595->connected == true) { + for (uint32_t i = 0; i < Shift595->outputs; i++) { + uint8_t relay_state = bitRead(XdrvMailbox.index, Shift595->first + Shift595->outputs -1 -i); + digitalWrite(Shift595->pinSER, Settings->flag5.shift595_invert_outputs ? !relay_state : relay_state); + Shift595LatchPin(Shift595->pinSRCLK); } - Shift595LatchPin(Shift595.pinRCLK); + Shift595LatchPin(Shift595->pinRCLK); if (PinUsed(GPIO_SHIFT595_OE)) { - digitalWrite(Shift595.pinOE, 0); + digitalWrite(Shift595->pinOE, 0); } } } @@ -97,17 +101,19 @@ void CmndShift595Devices(void) { bool Xdrv60(uint8_t function) { bool result = false; - switch (function) { - case FUNC_PRE_INIT: - Shift595Init(); - break; - case FUNC_SET_POWER: - Shift595SwitchRelay(); - break; - case FUNC_COMMAND: - result = DecodeCommand(kShift595Commands, Shift595Command); - break; - } + + if (FUNC_PRE_INIT == function) { + Shift595Init(); + } else if (Shift595) { + switch (function) { + case FUNC_SET_POWER: + Shift595SwitchRelay(); + break; + case FUNC_COMMAND: + result = DecodeCommand(kShift595Commands, Shift595Command); + break; + } + } return result; } From 0cdf6c9653679faae45e754fb47e53df4459de7b Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 5 Dec 2021 14:49:49 +0100 Subject: [PATCH 17/97] Refactor Shift595 --- tasmota/language/af_AF.h | 10 +++---- tasmota/language/bg_BG.h | 10 +++---- tasmota/language/cs_CZ.h | 10 +++---- tasmota/language/de_DE.h | 10 +++---- tasmota/language/el_GR.h | 10 +++---- tasmota/language/en_GB.h | 10 +++---- tasmota/language/es_ES.h | 10 +++---- tasmota/language/fr_FR.h | 10 +++---- tasmota/language/fy_NL.h | 10 +++---- tasmota/language/he_HE.h | 10 +++---- tasmota/language/hu_HU.h | 10 +++---- tasmota/language/it_IT.h | 10 +++---- tasmota/language/ko_KO.h | 10 +++---- tasmota/language/nl_NL.h | 10 +++---- tasmota/language/pl_PL.h | 10 +++---- tasmota/language/pt_BR.h | 10 +++---- tasmota/language/pt_PT.h | 10 +++---- tasmota/language/ro_RO.h | 10 +++---- tasmota/language/ru_RU.h | 10 +++---- tasmota/language/sk_SK.h | 10 +++---- tasmota/language/sv_SE.h | 10 +++---- tasmota/language/tr_TR.h | 10 +++---- tasmota/language/uk_UA.h | 10 +++---- tasmota/language/vi_VN.h | 10 +++---- tasmota/language/zh_CN.h | 10 +++---- tasmota/language/zh_TW.h | 10 +++---- tasmota/my_user_config.h | 2 +- tasmota/settings.h | 4 +-- tasmota/support_features.ino | 4 ++- tasmota/xdrv_60_shift595.ino | 51 ++++++++++++++++++------------------ tools/decode-status.py | 7 ++--- 31 files changed, 139 insertions(+), 189 deletions(-) diff --git a/tasmota/language/af_AF.h b/tasmota/language/af_AF.h index a97df50be..b9e290410 100644 --- a/tasmota/language/af_AF.h +++ b/tasmota/language/af_AF.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "te laag" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pomptyd oorskry" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_AF_AF_H_ diff --git a/tasmota/language/bg_BG.h b/tasmota/language/bg_BG.h index 249100589..fac7105f1 100644 --- a/tasmota/language/bg_BG.h +++ b/tasmota/language/bg_BG.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "твърде ниско" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "превишено време за помпане" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_BG_BG_H_ diff --git a/tasmota/language/cs_CZ.h b/tasmota/language/cs_CZ.h index 0d193693e..a297d5f0f 100644 --- a/tasmota/language/cs_CZ.h +++ b/tasmota/language/cs_CZ.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_CS_CZ_H_ diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h index 9ecbc9a03..e801818df 100644 --- a/tasmota/language/de_DE.h +++ b/tasmota/language/de_DE.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Herzschlag" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "zu niedrig" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "Pumpzeit überschritten" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_DE_DE_H_ diff --git a/tasmota/language/el_GR.h b/tasmota/language/el_GR.h index 630f19471..b777c0965 100644 --- a/tasmota/language/el_GR.h +++ b/tasmota/language/el_GR.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_EL_GR_H_ diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index 9ea7bb50b..128e1c3bf 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_EN_GB_H_ diff --git a/tasmota/language/es_ES.h b/tasmota/language/es_ES.h index 88b371826..f88f62cdb 100644 --- a/tasmota/language/es_ES.h +++ b/tasmota/language/es_ES.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "muy bajo" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "tiempo de bomba excedido" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_ES_ES_H_ diff --git a/tasmota/language/fr_FR.h b/tasmota/language/fr_FR.h index f0c3031ed..01ae71a67 100644 --- a/tasmota/language/fr_FR.h +++ b/tasmota/language/fr_FR.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1082,10 +1086,4 @@ #define D_NEOPOOL_PH_LOW "Trop bas" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "durée pompage expirée" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_FR_FR_H_ diff --git a/tasmota/language/fy_NL.h b/tasmota/language/fy_NL.h index 486a540a1..0adcef573 100644 --- a/tasmota/language/fy_NL.h +++ b/tasmota/language/fy_NL.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_FY_NL_H_ diff --git a/tasmota/language/he_HE.h b/tasmota/language/he_HE.h index 44853211d..d00bac271 100644 --- a/tasmota/language/he_HE.h +++ b/tasmota/language/he_HE.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_HE_HE_H_ diff --git a/tasmota/language/hu_HU.h b/tasmota/language/hu_HU.h index 710d3ba3c..85db8bbce 100644 --- a/tasmota/language/hu_HU.h +++ b/tasmota/language/hu_HU.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_HU_HU_H_ diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h index 881f735e0..9fcb4b292 100644 --- a/tasmota/language/it_IT.h +++ b/tasmota/language/it_IT.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 - TX" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Battito cardiaco" +#define D_GPIO_SHIFT595_SRCLK "74x595 - SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 - RCLK" +#define D_GPIO_SHIFT595_OE "74x595 - OE" +#define D_GPIO_SHIFT595_SER "74x595 - SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "troppo basso" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "tempo pompa superato" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_IT_IT_H_ diff --git a/tasmota/language/ko_KO.h b/tasmota/language/ko_KO.h index 90c0f5138..365480ef5 100644 --- a/tasmota/language/ko_KO.h +++ b/tasmota/language/ko_KO.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_KO_KO_H_ diff --git a/tasmota/language/nl_NL.h b/tasmota/language/nl_NL.h index dcc075d19..991187eb4 100644 --- a/tasmota/language/nl_NL.h +++ b/tasmota/language/nl_NL.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "te laag" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pomptijd bereikt" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_NL_NL_H_ diff --git a/tasmota/language/pl_PL.h b/tasmota/language/pl_PL.h index dfd2c155b..770606fd8 100644 --- a/tasmota/language/pl_PL.h +++ b/tasmota/language/pl_PL.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "czas pompowania przekroczony" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_PL_PL_D_H_ diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h index bcc837cd0..bb039ff4d 100644 --- a/tasmota/language/pt_BR.h +++ b/tasmota/language/pt_BR.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "Muito baixo" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "tempo da bomba excedido" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_PT_BR_H_ diff --git a/tasmota/language/pt_PT.h b/tasmota/language/pt_PT.h index 07804c950..89da9f494 100644 --- a/tasmota/language/pt_PT.h +++ b/tasmota/language/pt_PT.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "Muito baixo" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "tempo da bomba excedido" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_PT_PT_H_ diff --git a/tasmota/language/ro_RO.h b/tasmota/language/ro_RO.h index a87dda8bc..16e8f042b 100644 --- a/tasmota/language/ro_RO.h +++ b/tasmota/language/ro_RO.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_RO_RO_H_ diff --git a/tasmota/language/ru_RU.h b/tasmota/language/ru_RU.h index 7808dba8b..56233f278 100644 --- a/tasmota/language/ru_RU.h +++ b/tasmota/language/ru_RU.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "А" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_RU_RU_H_ diff --git a/tasmota/language/sk_SK.h b/tasmota/language/sk_SK.h index 0afdc669d..b3a1098e5 100644 --- a/tasmota/language/sk_SK.h +++ b/tasmota/language/sk_SK.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_SK_SK_H_ diff --git a/tasmota/language/sv_SE.h b/tasmota/language/sv_SE.h index e86ddd99a..aaf32fbde 100644 --- a/tasmota/language/sv_SE.h +++ b/tasmota/language/sv_SE.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_SV_SE_H_ diff --git a/tasmota/language/tr_TR.h b/tasmota/language/tr_TR.h index 13487d3b3..b9b2b7256 100644 --- a/tasmota/language/tr_TR.h +++ b/tasmota/language/tr_TR.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_TR_TR_H_ diff --git a/tasmota/language/uk_UA.h b/tasmota/language/uk_UA.h index da89a72a7..a9b1f98f6 100644 --- a/tasmota/language/uk_UA.h +++ b/tasmota/language/uk_UA.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "А" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_UK_UA_H_ diff --git a/tasmota/language/vi_VN.h b/tasmota/language/vi_VN.h index d5e4c5543..3bc724566 100644 --- a/tasmota/language/vi_VN.h +++ b/tasmota/language/vi_VN.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_VI_VN_H_ diff --git a/tasmota/language/zh_CN.h b/tasmota/language/zh_CN.h index 1ec0c7eac..d2d9f0d97 100644 --- a/tasmota/language/zh_CN.h +++ b/tasmota/language/zh_CN.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "A" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_ZH_CN_H_ diff --git a/tasmota/language/zh_TW.h b/tasmota/language/zh_TW.h index 5d3c7ced5..39f468e0b 100644 --- a/tasmota/language/zh_TW.h +++ b/tasmota/language/zh_TW.h @@ -843,6 +843,10 @@ #define D_SENSOR_HRG15_TX "HRG15 Tx" #define D_SENSOR_VINDRIKTNING_RX "VINDRIKTNING" #define D_SENSOR_HEARTBEAT "Heartbeat" +#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" +#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" +#define D_GPIO_SHIFT595_OE "74x595 OE" +#define D_GPIO_SHIFT595_SER "74x595 SER" // Units #define D_UNIT_AMPERE "安培" @@ -1083,10 +1087,4 @@ #define D_NEOPOOL_PH_LOW "too low" #define D_NEOPOOL_PUMP_TIME_EXCEEDED "pump time exceeded" -// xdrv_60_shift595.ino -#define D_GPIO_SHIFT595_SRCLK "74x595 SRCLK" -#define D_GPIO_SHIFT595_RCLK "74x595 RCLK" -#define D_GPIO_SHIFT595_OE "74x595 OE" -#define D_GPIO_SHIFT595_SER "74x595 SER" - #endif // _LANGUAGE_ZH_TW_H_ diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index 9eb87e186..b77efe515 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -893,7 +893,7 @@ // -- Other sensors/drivers ----------------------- -// #define USE_SHIFT595 +//#define USE_SHIFT595 // Add support for 74xx595 8-bit shift registers (+0k7 code) #define SHIFT595_INVERT_OUTPUTS false // [SetOption133] Don't invert outputs of 74x595 shift register #define SHIFT595_DEVICE_COUNT 1 // [Shift595DeviceCount] Set the number of connected 74x595 shift registers diff --git a/tasmota/settings.h b/tasmota/settings.h index d8e8e23a2..8b7d1a956 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -161,8 +161,8 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t energy_phase : 1; // bit 15 (v9.5.0.9) - SetOption129 - (Energy) Show phase information uint32_t show_heap_with_timestamp : 1; // bit 16 (v9.5.0.9) - SetOption130 - (Debug) Show heap with logging timestamp uint32_t tuya_allow_dimmer_0 : 1; // bit 17 (v10.0.0.3) - SetOption131 - (Tuya) Allow save dimmer = 0 receved by MCU - uint32_t tls_use_fingerprint : 1; // bit 18 (v10.0.0.4) - SetOption132 - (TLS) use fingerprint validation instead of CA based - uint32_t shift595_invert_outputs : 1; // bit 19 (v10.0.0.4) - SetOption133 - (Shift595) invert outputs of 74x595 shift registers + uint32_t tls_use_fingerprint : 1; // bit 18 (v10.0.0.4) - SetOption132 - (TLS) Use fingerprint validation instead of CA based + uint32_t shift595_invert_outputs : 1; // bit 19 (v10.0.0.4) - SetOption133 - (Shift595) Invert outputs of 74x595 shift registers uint32_t spare20 : 1; // bit 20 uint32_t spare21 : 1; // bit 21 uint32_t spare22 : 1; // bit 22 diff --git a/tasmota/support_features.ino b/tasmota/support_features.ino index 0372c80c8..206735a15 100644 --- a/tasmota/support_features.ino +++ b/tasmota/support_features.ino @@ -784,7 +784,9 @@ void ResponseAppendFeatures(void) #ifdef USE_SONOFF_SPM feature8 |= 0x00040000; #endif -// feature8 |= 0x00080000; +#ifdef USE_SHIFT595 + feature8 |= 0x00080000; // xdrv_60_shift595.ino +#endif // feature8 |= 0x00100000; // feature8 |= 0x00200000; diff --git a/tasmota/xdrv_60_shift595.ino b/tasmota/xdrv_60_shift595.ino index cf9a3868c..4e816fc7e 100644 --- a/tasmota/xdrv_60_shift595.ino +++ b/tasmota/xdrv_60_shift595.ino @@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ + #ifdef USE_SHIFT595 #define XDRV_60 60 @@ -33,34 +34,34 @@ struct Shift595 { bool connected = false; } *Shift595 = nullptr; -void Shift595ConfigurePin(uint8_t pin, uint8_t value = 0){ +void Shift595ConfigurePin(uint8_t pin, uint8_t value = 0) { pinMode(pin, OUTPUT); digitalWrite(pin, value); } -void Shift595Init(void) -{ +void Shift595Init(void) { if (PinUsed(GPIO_SHIFT595_SRCLK) && PinUsed(GPIO_SHIFT595_RCLK) && PinUsed(GPIO_SHIFT595_SER)) { Shift595 = (struct Shift595*)calloc(1, sizeof(struct Shift595)); - - Shift595->pinSRCLK = Pin(GPIO_SHIFT595_SRCLK); - Shift595->pinRCLK = Pin(GPIO_SHIFT595_RCLK); - Shift595->pinSER = Pin(GPIO_SHIFT595_SER); + if (Shift595) { + Shift595->pinSRCLK = Pin(GPIO_SHIFT595_SRCLK); + Shift595->pinRCLK = Pin(GPIO_SHIFT595_RCLK); + Shift595->pinSER = Pin(GPIO_SHIFT595_SER); - Shift595ConfigurePin(Shift595->pinSRCLK); - Shift595ConfigurePin(Shift595->pinRCLK); - Shift595ConfigurePin(Shift595->pinSER); - - if (PinUsed(GPIO_SHIFT595_OE)) { - Shift595->pinOE = Pin(GPIO_SHIFT595_OE); - Shift595ConfigurePin(Shift595->pinOE, 1); + Shift595ConfigurePin(Shift595->pinSRCLK); + Shift595ConfigurePin(Shift595->pinRCLK); + Shift595ConfigurePin(Shift595->pinSER); + + if (PinUsed(GPIO_SHIFT595_OE)) { + Shift595->pinOE = Pin(GPIO_SHIFT595_OE); + Shift595ConfigurePin(Shift595->pinOE, 1); + } + + Shift595->first = TasmotaGlobal.devices_present; + Shift595->outputs = Settings->shift595_device_count * 8; + TasmotaGlobal.devices_present += Shift595->outputs; + Shift595->connected = true; + AddLog(LOG_LEVEL_DEBUG, PSTR("595: Controlling relays POWER%d to POWER%d"), Shift595->first + 1, Shift595->first + Shift595->outputs); } - - Shift595->first = TasmotaGlobal.devices_present; - Shift595->outputs = Settings->shift595_device_count * 8; - TasmotaGlobal.devices_present += Shift595->outputs; - Shift595->connected = true; - AddLog(LOG_LEVEL_DEBUG, PSTR("595: Controlling relays POWER%d to POWER%d"), Shift595->first + 1, Shift595->first + Shift595->outputs); } } @@ -69,8 +70,7 @@ void Shift595LatchPin(uint8_t pin) { digitalWrite(pin, 0); } -void Shift595SwitchRelay(void) -{ +void Shift595SwitchRelay(void) { if (Shift595 && Shift595->connected == true) { for (uint32_t i = 0; i < Shift595->outputs; i++) { uint8_t relay_state = bitRead(XdrvMailbox.index, Shift595->first + Shift595->outputs -1 -i); @@ -81,9 +81,9 @@ void Shift595SwitchRelay(void) Shift595LatchPin(Shift595->pinRCLK); if (PinUsed(GPIO_SHIFT595_OE)) { - digitalWrite(Shift595->pinOE, 0); - } + digitalWrite(Shift595->pinOE, 0); } + } } void CmndShift595Devices(void) { @@ -98,8 +98,7 @@ void CmndShift595Devices(void) { * Interface \*********************************************************************************************/ -bool Xdrv60(uint8_t function) -{ +bool Xdrv60(uint8_t function) { bool result = false; if (FUNC_PRE_INIT == function) { diff --git a/tools/decode-status.py b/tools/decode-status.py index 6e70d8912..c234f8911 100755 --- a/tools/decode-status.py +++ b/tools/decode-status.py @@ -186,7 +186,8 @@ a_setoption = [[ "(Energy) Show phase information", "(Debug) Show heap with logging timestamp", "(Tuya) Allow save dimmer = 0 receved by MCU", - "","", + "(TLS) Use fingerprint validation instead of CA based", + "(Shift595) Invert outputs of 74x595 shift registers", "","","","", "","","","", "","","","" @@ -260,7 +261,7 @@ a_features = [[ "USE_BM8563","USE_ENERGY_DUMMY","USE_AM2320","USE_T67XX", "USE_MCP2515","USE_TASMESH","USE_WIFI_RANGE_EXTENDER","USE_INFLUXDB", "USE_HRG15","USE_VINDRIKTNING","USE_SCD40","USE_HM330X", - "USE_HDC2010","USE_LSC_MCSL","USE_SONOFF_SPM","", + "USE_HDC2010","USE_LSC_MCSL","USE_SONOFF_SPM","USE_SHIFT595", "","","","", "","","","", "","","","" @@ -291,7 +292,7 @@ else: obj = json.load(fp) def StartDecode(): - print ("\n*** decode-status.py v20211201 by Theo Arends and Jacek Ziolkowski ***") + print ("\n*** decode-status.py v20211205 by Theo Arends and Jacek Ziolkowski ***") # print("Decoding\n{}".format(obj)) From 4704829412af53dea5412e2a4e9fccf68ee0d667 Mon Sep 17 00:00:00 2001 From: logon84 Date: Sun, 5 Dec 2021 23:59:04 +0100 Subject: [PATCH 18/97] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 47 +++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 1c9c97a79..e6d8ab667 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -68,11 +68,14 @@ struct miel_hvac_data_settings { uint8_t widevane; #define MIEL_HVAC_SETTTINGS_WIDEVANE_MASK \ 0x0f + uint8_t temp05; }; struct miel_hvac_data_roomtemp { uint8_t _pad1[2]; uint8_t temp; + uint8_t _pad1[2]; + uint8_t temp05; }; struct miel_hvac_data_status { @@ -109,8 +112,10 @@ CTASSERT(offsetof(struct miel_hvac_data, data.settings.temp) == 5); CTASSERT(offsetof(struct miel_hvac_data, data.settings.fan) == 6); CTASSERT(offsetof(struct miel_hvac_data, data.settings.vane) == 7); CTASSERT(offsetof(struct miel_hvac_data, data.settings.widevane) == 10); +CTASSERT(offsetof(struct miel_hvac_data, data.settings.temp05) == 11); CTASSERT(offsetof(struct miel_hvac_data, data.roomtemp.temp) == 3); +CTASSERT(offsetof(struct miel_hvac_data, data.roomtemp.temp05) == 6); /* to hvac */ @@ -140,6 +145,7 @@ struct miel_hvac_msg_update { #define MIEL_HVAC_UPDATE_F_TEMP (1 << 10) #define MIEL_HVAC_UPDATE_F_FAN (1 << 11) #define MIEL_HVAC_UPDATE_F_VANE (1 << 12) +#define MIEL_HVAC_UPDATE_F_TEMP05 (1 << 19) uint8_t power; #define MIEL_HVAC_UPDATE_POWER_OFF 0x00 #define MIEL_HVAC_UPDATE_POWER_ON 0x01 @@ -180,7 +186,8 @@ struct miel_hvac_msg_update { #define MIEL_HVAC_UPDATE_WIDEVANE_LR 0x08 #define MIEL_HVAC_UPDATE_WIDEVANE_SWING 0x0c #define MIEL_HVAC_UPDATE_WIDEVANE_ADJ 0x80 - uint8_t _pad2[2]; + uint8_t temp05; + uint8_t _pad2[1]; } __packed; CTASSERT(sizeof(struct miel_hvac_msg_update) == 16); @@ -192,11 +199,16 @@ CTASSERT(offsetof(struct miel_hvac_msg_update, temp) == MIEL_HVAC_OFFS(10)); CTASSERT(offsetof(struct miel_hvac_msg_update, fan) == MIEL_HVAC_OFFS(11)); CTASSERT(offsetof(struct miel_hvac_msg_update, vane) == MIEL_HVAC_OFFS(12)); CTASSERT(offsetof(struct miel_hvac_msg_update, widevane) == MIEL_HVAC_OFFS(18)); +CTASSERT(offsetof(struct miel_hvac_msg_update, temp05) == MIEL_HVAC_OFFS(19)); static inline uint8_t miel_hvac_deg2temp(uint8_t deg) { - return (31 - deg); +#ifndef MIEL_HVAC_ENHANCED_RES +return (31 - deg); +#else +return 2*deg + 128; +#endif } static inline uint8_t @@ -686,16 +698,20 @@ miel_hvac_cmnd_settemp(void) if (XdrvMailbox.data_len == 0) return; - + degc = strtoul(XdrvMailbox.data, nullptr, 0); if (degc < MIEL_HVAC_UPDATE_TEMP_MIN || degc > MIEL_HVAC_UPDATE_TEMP_MAX) { miel_hvac_respond_unsupported(); return; } - - update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP); - update->temp = miel_hvac_deg2temp(degc); + #ifndef MIEL_HVAC_ENHANCED_RES + update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP); + update->temp = miel_hvac_deg2temp(degc); + #else + update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP05); + update->temp05 = miel_hvac_deg2temp(degc); + #endif ResponseCmndNumber(degc); } @@ -871,9 +887,15 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR(",\"HA" D_JSON_IRHVAC_MODE "\":\"%s\""), set->power ? name : "off"); } - - dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp)), - Settings->flag2.temperature_resolution, temp); + if (set->temp05 == 0) { + dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp)), + Settings->flag2.temperature_resolution, temp); + } + else { + #define MIEL_HVAC_ENHANCED_RES 1 + dtostrfd(ConvertTemp((float)(((set->temp05 - 128))/2)), + Settings->flag2.temperature_resolution, temp); + } ResponseAppend_P(PSTR(",\"" D_JSON_IRHVAC_TEMP "\":%s"), temp); name = miel_hvac_map_byval(set->fan, @@ -1074,7 +1096,12 @@ miel_hvac_sensor(struct miel_hvac_softc *sc) if (sc->sc_temp.type != 0) { const struct miel_hvac_data_roomtemp *rt = &sc->sc_temp.data.roomtemp; - unsigned int temp = miel_hvac_roomtemp2deg(rt->temp); + if(rt->temp05 == 0) { + unsigned int temp = miel_hvac_roomtemp2deg(rt->temp); + } + else { + unsigned float temp = (miel_hvac_roomtemp2deg(rt->temp05) - 128)/2; + } char room_temp[33]; dtostrfd(ConvertTemp(temp), From 1bfcdea9be5bf7aba55d5d5bde9d1248e123b1c4 Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 00:29:05 +0100 Subject: [PATCH 19/97] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index e6d8ab667..381123963 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -74,7 +74,7 @@ struct miel_hvac_data_settings { struct miel_hvac_data_roomtemp { uint8_t _pad1[2]; uint8_t temp; - uint8_t _pad1[2]; + uint8_t _pad2[2]; uint8_t temp05; }; @@ -1096,16 +1096,17 @@ miel_hvac_sensor(struct miel_hvac_softc *sc) if (sc->sc_temp.type != 0) { const struct miel_hvac_data_roomtemp *rt = &sc->sc_temp.data.roomtemp; + char room_temp[33]; if(rt->temp05 == 0) { unsigned int temp = miel_hvac_roomtemp2deg(rt->temp); + dtostrfd(ConvertTemp(temp), + Settings->flag2.temperature_resolution, room_temp); } else { - unsigned float temp = (miel_hvac_roomtemp2deg(rt->temp05) - 128)/2; + float temp = (rt->temp05 - 128)/2; + dtostrfd(ConvertTemp(temp), + Settings->flag2.temperature_resolution, room_temp); } - char room_temp[33]; - - dtostrfd(ConvertTemp(temp), - Settings->flag2.temperature_resolution, room_temp); ResponseAppend_P(PSTR("\"" D_JSON_TEMPERATURE "\":%s"), room_temp); From 3f1e5746a1721830e1d916b8c24e147b3f97e61a Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 03:10:30 +0100 Subject: [PATCH 20/97] Update xdrv_44_miel_hvac.ino --- tasmota/xdrv_44_miel_hvac.ino | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 381123963..819e65529 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -204,23 +204,31 @@ CTASSERT(offsetof(struct miel_hvac_msg_update, temp05) == MIEL_HVAC_OFFS(19)); static inline uint8_t miel_hvac_deg2temp(uint8_t deg) { -#ifndef MIEL_HVAC_ENHANCED_RES -return (31 - deg); -#else -return 2*deg + 128; -#endif + #ifndef MIEL_HVAC_ENHANCED_RES + return (31 - deg); + #else + return 2*deg + 128; + #endif } static inline uint8_t miel_hvac_temp2deg(uint8_t temp) { + #ifndef MIEL_HVAC_ENHANCED_RES return (31 - temp); + #else + return ((float)(((temp - 128))/2)); + #endif } static inline unsigned int miel_hvac_roomtemp2deg(uint8_t roomtemp) { + #ifndef MIEL_HVAC_ENHANCED_RES return ((unsigned int)roomtemp + 10); + #else + return ((float)(roomtemp - 128)/2;) + #endif } struct miel_hvac_msg_remotetemp { @@ -893,7 +901,7 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) } else { #define MIEL_HVAC_ENHANCED_RES 1 - dtostrfd(ConvertTemp((float)(((set->temp05 - 128))/2)), + dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp05)), Settings->flag2.temperature_resolution, temp); } ResponseAppend_P(PSTR(",\"" D_JSON_IRHVAC_TEMP "\":%s"), temp); @@ -1103,7 +1111,8 @@ miel_hvac_sensor(struct miel_hvac_softc *sc) Settings->flag2.temperature_resolution, room_temp); } else { - float temp = (rt->temp05 - 128)/2; + #define MIEL_HVAC_ENHANCED_RES 1 + float temp = miel_hvac_roomtemp2deg(rt->temp05); dtostrfd(ConvertTemp(temp), Settings->flag2.temperature_resolution, room_temp); } From 7a5e3cd78e14202705576253193550482ffc2bf5 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 6 Dec 2021 10:55:03 +0100 Subject: [PATCH 21/97] update changelog --- CHANGELOG.md | 1 + RELEASENOTES.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 804a381a3..a02a1323b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - (Internal) Support for FUNC_BUTTON_MULTI_PRESSED in (light)drivers - Support for GPE Multi color smart light as sold by Action in the Netherlands +- Support for 74xx595 8-bit shift registers (#13921) ### Changed - (Internal) Range conversion edge values diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 8c8578f3e..486b5da33 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -102,7 +102,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo ## Changelog v10.0.0.4 ### Added -- 1 second heartbeat GPIO +- One second heartbeat GPIO - (Internal) Support for FUNC_BUTTON_MULTI_PRESSED in (light)drivers - Command ``TcpConfig`` for TCPBridge protocol configuration [#13565](https://github.com/arendst/Tasmota/issues/13565) - Support for HDC2010 temperature/humidity sensor by Luc Boudreau [#13633](https://github.com/arendst/Tasmota/issues/13633) @@ -110,6 +110,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo - Command ``IfxPeriod `` to overrule ``Teleperiod`` for Influx messages [#13750](https://github.com/arendst/Tasmota/issues/13750) - Support for GPE Multi color smart light as sold by Action in the Netherlands - Shutter support for venetian blinds with tilt control +- Support for 74xx595 8-bit shift registers [#13921](https://github.com/arendst/Tasmota/issues/13921) - ESP32 Proof of Concept Sonoff SPM with limited functionality (switching and energy monitoring) [#13447](https://github.com/arendst/Tasmota/issues/13447) - ESP32 Autoconfiguration - ESP32 Preliminary support for Tasmota Apps (.tapp extesions) From 1a448ae364b5413e45ec588a9d20f6803524d998 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 6 Dec 2021 10:57:25 +0100 Subject: [PATCH 22/97] Fix SPM energy energy values --- tasmota/xdrv_86_esp32_sonoff_spm.ino | 41 ++++++++++++++++------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/tasmota/xdrv_86_esp32_sonoff_spm.ino b/tasmota/xdrv_86_esp32_sonoff_spm.ino index eaeb2d758..3281bfdba 100644 --- a/tasmota/xdrv_86_esp32_sonoff_spm.ino +++ b/tasmota/xdrv_86_esp32_sonoff_spm.ino @@ -50,7 +50,7 @@ * Gui for Overload Protection entry (is handled by ARM processor). * Gui for Scheduling entry (is handled by ARM processor). * Yellow led functionality. - * Interpretation of reset sequence on GPIO's 12-14. + * SPI master to ARM (ARM firmware upload from ESP using EasyFlash). * * Nice to have: * Support for all 32 SPM4Relay units equals 128 relays @@ -61,9 +61,9 @@ * GPIO03 - Serial console RX * GPIO04 - ARM processor TX (115200bps8N1) * GPIO05 - ETH POWER - * GPIO12 - SPI MISO ARM pulsetrain code (input?) - * GPIO13 - SPI CLK - * GPIO14 - SPI CS ARM pulsetrain eoc (input?) + * GPIO12 - SPI MOSI ARM output (pin36 - PB15) - ESP input + * GPIO13 - SPI MISO ESP output - ARM input (pin35 - PB14) + * GPIO14 - SPI CLK ESP input (ARM pin34 - PB13) * GPIO15 - ARM reset (output) - 18ms low active 125ms after restart esp32 * GPIO16 - ARM processor RX * GPIO17 - EMAC_CLK_OUT_180 @@ -116,6 +116,7 @@ #define SSPM_FUNC_GET_ENERGY 24 // 0x18 #define SSPM_FUNC_GET_LOG 26 // 0x1A #define SSPM_FUNC_ENERGY_PERIOD 27 // 0x1B +#define SSPM_FUNC_RESET 28 // 0x1C - Remove device from eWelink and factory reset // Receive #define SSPM_FUNC_ENERGY_RESULT 6 // 0x06 @@ -667,9 +668,9 @@ void SSPMHandleReceivedData(void) { 03 <- L4 07 e5 0b 0d <- End date (Today) 2021 nov 13 07 e5 05 11 <- Start date 2021 may 17 - 00 05 <- 5kWh (13/11 Today) - 00 00 <- 0 (12/11 Yesterday) - 00 04 <- 4kWh (11/11 etc) + 00 05 <- 0.05kWh (13/11 Today) + 00 00 <- 0 (12/11 Yesterday) + 00 04 <- 0.04kWh (11/11 etc) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -679,14 +680,14 @@ void SSPMHandleReceivedData(void) { 42 67 46 */ { - uint32_t energy_today = 0; - uint32_t energy_yesterday = 0; - uint32_t energy_total = 0; + float energy_today = 0; + float energy_yesterday = 0; + float energy_total = 0; uint32_t entries = (Sspm->expected_bytes - 22) / 2; for (uint32_t i = 0; i < entries; i++) { - uint32_t today_energy = (SspmBuffer[41 + (i*2)] << 8) + SspmBuffer[42 + (i*2)]; - if (28702 == today_energy) { today_energy = 0; } // Unknown why sometimes 0x701E (=28702kWh) pops up + float today_energy = SspmBuffer[41 + (i*2)] + (float)SspmBuffer[42 + (i*2)] / 100; // x.xxkWh + if (112.30 == today_energy) { today_energy = 0; } // Unknown why sometimes 0x701E (=112.30kWh) pops up if (0 == i) { energy_today = today_energy; } if (1 == i) { energy_yesterday = today_energy; } energy_total += today_energy; @@ -696,7 +697,7 @@ void SSPMHandleReceivedData(void) { if ((SspmBuffer[20] == Sspm->module[module][0]) && (SspmBuffer[21] == Sspm->module[module][1])) { Sspm->energy_today[module][channel] = energy_today; Sspm->energy_yesterday[module][channel] = energy_yesterday; - Sspm->energy_total[module][channel] = energy_total; // xkWh + Sspm->energy_total[module][channel] = energy_total; // x.xxkWh break; } } @@ -705,7 +706,7 @@ void SSPMHandleReceivedData(void) { break; case SSPM_FUNC_GET_LOG: /* 0x1A - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 AA 55 01 00 00 00 00 00 00 00 00 00 00 00 00 80 1a 01 3a 00 6b 7e 32 37 39 37 34 13 4b 35 36 37 1e Number of log entries (1e = 30) 07 e5 0b 06 0f 25 19 02 01 00 10 byte log entry @@ -730,6 +731,10 @@ void SSPMHandleReceivedData(void) { 07 e5 0b 06 0e 36 37 01 01 00 ... 07 e5 0b 06 0d 30 2d 03 00 01 09 89 fe + + Error: + AA 55 01 00 00 00 00 00 00 00 00 00 00 00 00 80 1A 00 01 03 E5 45 EB + | | */ break; @@ -920,7 +925,7 @@ void SSPMInit(void) { Settings->flag2.voltage_resolution = 1; // SPM has 2 decimals but this keeps the gui clean Settings->flag2.current_resolution = 2; // SPM has 2 decimals Settings->flag2.wattage_resolution = 1; // SPM has 2 decimals but this keeps the gui clean - Settings->flag2.energy_resolution = 0; // SPM has no decimals on total energy + Settings->flag2.energy_resolution = 1; // SPM has 2 decimals but this keeps the gui clean } #if CONFIG_IDF_TARGET_ESP32 @@ -1113,18 +1118,18 @@ void SSPMEnergyShow(bool json) { if (json) { ResponseAppend_P(PSTR(",\"SPM\":{\"" D_JSON_ENERGY "\":[")); for (uint32_t i = 0; i < TasmotaGlobal.devices_present; i++) { - ResponseAppend_P(PSTR("%s%*_f"), (i>0)?",":"", -1, &Sspm->energy_total[i >>2][i &3]); + ResponseAppend_P(PSTR("%s%*_f"), (i>0)?",":"", Settings->flag2.energy_resolution, &Sspm->energy_total[i >>2][i &3]); } #ifdef SSPM_JSON_ENERGY_YESTERDAY ResponseAppend_P(PSTR("],\"" D_JSON_YESTERDAY "\":[")); for (uint32_t i = 0; i < TasmotaGlobal.devices_present; i++) { - ResponseAppend_P(PSTR("%s%*_f"), (i>0)?",":"", -1, &Sspm->energy_yesterday[i >>2][i &3]); + ResponseAppend_P(PSTR("%s%*_f"), (i>0)?",":"", Settings->flag2.energy_resolution, &Sspm->energy_yesterday[i >>2][i &3]); } #endif #ifdef SSPM_JSON_ENERGY_TODAY ResponseAppend_P(PSTR("],\"" D_JSON_TODAY "\":[")); for (uint32_t i = 0; i < TasmotaGlobal.devices_present; i++) { - ResponseAppend_P(PSTR("%s%*_f"), (i>0)?",":"", -1, &Sspm->energy_today[i >>2][i &3]); + ResponseAppend_P(PSTR("%s%*_f"), (i>0)?",":"", Settings->flag2.energy_resolution, &Sspm->energy_today[i >>2][i &3]); } #endif ResponseAppend_P(PSTR("],\"" D_JSON_ACTIVE_POWERUSAGE "\":[")); From 90add2b4c2c757ff61deb6cc76e05f2f1a24ee5e Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 13:50:47 +0100 Subject: [PATCH 23/97] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 53 ++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 819e65529..981cb8643 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -145,7 +145,6 @@ struct miel_hvac_msg_update { #define MIEL_HVAC_UPDATE_F_TEMP (1 << 10) #define MIEL_HVAC_UPDATE_F_FAN (1 << 11) #define MIEL_HVAC_UPDATE_F_VANE (1 << 12) -#define MIEL_HVAC_UPDATE_F_TEMP05 (1 << 19) uint8_t power; #define MIEL_HVAC_UPDATE_POWER_OFF 0x00 #define MIEL_HVAC_UPDATE_POWER_ON 0x01 @@ -204,31 +203,34 @@ CTASSERT(offsetof(struct miel_hvac_msg_update, temp05) == MIEL_HVAC_OFFS(19)); static inline uint8_t miel_hvac_deg2temp(uint8_t deg) { - #ifndef MIEL_HVAC_ENHANCED_RES - return (31 - deg); - #else - return 2*deg + 128; - #endif + if (!Settings->flag5.mqtt_info_retain) { + return (31 - deg); + } + else { + return 2*deg + 128; + } } static inline uint8_t miel_hvac_temp2deg(uint8_t temp) { - #ifndef MIEL_HVAC_ENHANCED_RES - return (31 - temp); - #else - return ((float)(((temp - 128))/2)); - #endif + if (!Settings->flag5.mqtt_info_retain) { + return (31 - temp); + } + else { + return ((float)(((temp - 128))/2)); + } } static inline unsigned int miel_hvac_roomtemp2deg(uint8_t roomtemp) { - #ifndef MIEL_HVAC_ENHANCED_RES - return ((unsigned int)roomtemp + 10); - #else - return ((float)(roomtemp - 128)/2;) - #endif + if (!Settings->flag5.mqtt_info_retain) { + return ((unsigned int)roomtemp + 10); + } + else { + return ((float)((roomtemp - 128)/2)); + } } struct miel_hvac_msg_remotetemp { @@ -713,13 +715,16 @@ miel_hvac_cmnd_settemp(void) miel_hvac_respond_unsupported(); return; } - #ifndef MIEL_HVAC_ENHANCED_RES - update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP); + update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP); + if (!Settings->flag5.mqtt_info_retain) { update->temp = miel_hvac_deg2temp(degc); - #else - update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP05); + update->temp05 = 0; + } + + else { + update->temp = 0; update->temp05 = miel_hvac_deg2temp(degc); - #endif + } ResponseCmndNumber(degc); } @@ -895,12 +900,11 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR(",\"HA" D_JSON_IRHVAC_MODE "\":\"%s\""), set->power ? name : "off"); } - if (set->temp05 == 0) { + if (!Settings->flag5.mqtt_info_retain) { dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp)), Settings->flag2.temperature_resolution, temp); } else { - #define MIEL_HVAC_ENHANCED_RES 1 dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp05)), Settings->flag2.temperature_resolution, temp); } @@ -1105,13 +1109,12 @@ miel_hvac_sensor(struct miel_hvac_softc *sc) const struct miel_hvac_data_roomtemp *rt = &sc->sc_temp.data.roomtemp; char room_temp[33]; - if(rt->temp05 == 0) { + if(!Settings->flag5.mqtt_info_retain) { unsigned int temp = miel_hvac_roomtemp2deg(rt->temp); dtostrfd(ConvertTemp(temp), Settings->flag2.temperature_resolution, room_temp); } else { - #define MIEL_HVAC_ENHANCED_RES 1 float temp = miel_hvac_roomtemp2deg(rt->temp05); dtostrfd(ConvertTemp(temp), Settings->flag2.temperature_resolution, room_temp); From a55cc22cd70ada5dafbbbb8234499b90b5c826bf Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 13:53:42 +0100 Subject: [PATCH 24/97] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 981cb8643..4c28364e6 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -207,7 +207,7 @@ miel_hvac_deg2temp(uint8_t deg) return (31 - deg); } else { - return 2*deg + 128; + return (2*deg + 128); } } From 41e63321f13035b05fe32eadcc30525c31630665 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 6 Dec 2021 15:11:59 +0100 Subject: [PATCH 25/97] Add SPM yellow error led support --- tasmota/xdrv_86_esp32_sonoff_spm.ino | 54 ++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/tasmota/xdrv_86_esp32_sonoff_spm.ino b/tasmota/xdrv_86_esp32_sonoff_spm.ino index 3281bfdba..dc770c7e4 100644 --- a/tasmota/xdrv_86_esp32_sonoff_spm.ino +++ b/tasmota/xdrv_86_esp32_sonoff_spm.ino @@ -28,6 +28,8 @@ * {"NAME":"Sonoff SPM (POC1)","GPIO":[1,1,1,1,3200,1,1,1,1,1,1,1,3232,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,544,1,1,32,1,0,0,1],"FLAG":0,"BASE":1} * Add ethernet support: * {"NAME":"Sonoff SPM (POC2)","GPIO":[1,0,1,0,3200,5536,0,0,1,1,1,0,3232,0,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,544,1,1,32,1,0,0,1],"FLAG":0,"BASE":1} + * Remove all user selectable GPIOs: + * {"NAME":"Sonoff SPM (POC2)","GPIO":[0,0,0,0,3200,5536,0,0,0,0,0,0,3232,0,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,544,0,0,32,0,0,0,0],"FLAG":0,"BASE":1} * * Things to know: * Bulk of the action is handled by ARM processors present in every unit communicating over modbus RS-485. @@ -45,15 +47,21 @@ * Tasmota POC2: * Ethernet support. * Gui optimized for energy display. + * Yellow led lights if no ARM connection can be made. + * Yellow led blinks 2 seconds if an ARM-ESP comms CRC error is detected. + * Supported commands: + * SspmDisplay 0|1 - Select alternative GUI rotating display either all or powered on only + * SspmIAmHere - Blink ERROR in SPM-4Relay where relay resides + * SspmScan - Rescan ARM modbus taking around 20 seconds + * SspmReset 1 - Reset ARM and restart ESP * * Todo: * Gui for Overload Protection entry (is handled by ARM processor). * Gui for Scheduling entry (is handled by ARM processor). - * Yellow led functionality. * SPI master to ARM (ARM firmware upload from ESP using EasyFlash). * * Nice to have: - * Support for all 32 SPM4Relay units equals 128 relays + * Support for all 32 SPM-4Relay units equals 128 relays (restricted due to internal Tasmota register use) * * GPIO's used: * GPIO00 - Bootmode / serial flash @@ -126,6 +134,7 @@ #define SSPM_FUNC_SCAN_DONE 25 // 0x19 #define SSPM_GPIO_ARM_RESET 15 +#define SSPM_GPIO_LED_ERROR 33 #define SSPM_MODULE_NAME_SIZE 12 @@ -176,6 +185,7 @@ typedef struct { uint8_t command_sequence; uint8_t mstate; uint8_t last_button; + uint8_t error_led_blinks; bool discovery_triggered; } TSspm; @@ -428,7 +438,7 @@ void SSPMSendSetTime(void) { SspmBuffer[25] = time.second; SspmBuffer[26] = 0; SspmBuffer[27] = 0; - SspmBuffer[28] = 1 + (Rtc.time_timezone / 60); // Not sure why the "1" is needed but it is in my case + SspmBuffer[28] = Rtc.time_timezone / 60; SspmBuffer[29] = abs(Rtc.time_timezone % 60); Sspm->command_sequence++; SspmBuffer[30] = Sspm->command_sequence; @@ -746,6 +756,12 @@ void SSPMHandleReceivedData(void) { AA 55 01 00 00 00 00 00 00 00 00 00 00 00 00 80 1b 00 11 [00] 8b 34 32 37 39 37 34 13 4b 35 36 37 [03] [00 00 00] f8 94 15 L4, kWh start period (0) */ + break; + case SSPM_FUNC_RESET: + /* 0x1C + AA 55 01 00 00 00 00 00 00 00 00 00 00 00 00 80 1c 00 01 00 0b f9 e3 + */ +// TasmotaGlobal.restart_flag = 2; break; } } else { @@ -884,6 +900,7 @@ void SSPMSerialInput(void) { if (crc_rcvd == crc_calc) { SSPMHandleReceivedData(); } else { + Sspm->error_led_blinks = 20; AddLog(LOG_LEVEL_DEBUG, PSTR("SPM: CRC error")); } Sspm->serial_in_byte_counter = 0; @@ -921,6 +938,9 @@ void SSPMInit(void) { pinMode(SSPM_GPIO_ARM_RESET, OUTPUT); digitalWrite(SSPM_GPIO_ARM_RESET, 1); + pinMode(SSPM_GPIO_LED_ERROR, OUTPUT); + digitalWrite(SSPM_GPIO_LED_ERROR, 0); + if (0 == Settings->flag2.voltage_resolution) { Settings->flag2.voltage_resolution = 1; // SPM has 2 decimals but this keeps the gui clean Settings->flag2.current_resolution = 2; // SPM has 2 decimals @@ -954,11 +974,21 @@ void SSPMEvery100ms(void) { } } + if (Sspm->error_led_blinks) { + uint32_t state = 1; // Stay lit + if (Sspm->error_led_blinks < 255) { + Sspm->error_led_blinks--; + state = Sspm->error_led_blinks >> 1 &1; // Blink every 0.4s + } + digitalWrite(SSPM_GPIO_LED_ERROR, state); + } + // Fix race condition if the ARM doesn't respond if ((Sspm->mstate > SPM_NONE) && (Sspm->mstate < SPM_SEND_FUNC_UNITS)) { Sspm->counter++; if (Sspm->counter > 20) { Sspm->mstate = SPM_NONE; + Sspm->error_led_blinks = 255; } } switch (Sspm->mstate) { @@ -1210,10 +1240,10 @@ void SSPMEnergyShow(bool json) { \*********************************************************************************************/ const char kSSPMCommands[] PROGMEM = "SSPM|" // Prefix - "Log|Energy|History|Scan|IamHere|Display" ; + "Log|Energy|History|Scan|IamHere|Display|Reset" ; void (* const SSPMCommand[])(void) PROGMEM = { - &CmndSSPMLog, &CmndSSPMEnergy, &CmndSSPMEnergyHistory, &CmndSSPMScan, &CmndSSPMIamHere, &CmndSSPMDisplay }; + &CmndSSPMLog, &CmndSSPMEnergy, &CmndSSPMEnergyHistory, &CmndSSPMScan, &CmndSSPMIamHere, &CmndSSPMDisplay, &CmndSSPMReset }; void CmndSSPMLog(void) { // Report 29 log entries @@ -1242,7 +1272,7 @@ void CmndSSPMScan(void) { } void CmndSSPMIamHere(void) { - // Blink module COMM led containing relay + // Blink module ERROR led containing relay if ((XdrvMailbox.payload < 1) || (XdrvMailbox.payload > TasmotaGlobal.devices_present)) { XdrvMailbox.payload = 1; } SSPMSendIAmHere(XdrvMailbox.payload -1); ResponseCmndDone(); @@ -1256,6 +1286,18 @@ void CmndSSPMDisplay(void) { ResponseCmndNumber(Settings->sbflag1.sspm_display); } +void CmndSSPMReset(void) { + // Reset ARM and restart + if (1 == XdrvMailbox.payload) { + Sspm->mstate = SPM_NONE; + SSPMSendCmnd(SSPM_FUNC_RESET); + TasmotaGlobal.restart_flag = 3; + ResponseCmndChar(PSTR(D_JSON_RESET_AND_RESTARTING)); + } else { + ResponseCmndChar(PSTR(D_JSON_ONE_TO_RESET)); + } +} + /*********************************************************************************************\ * Interface \*********************************************************************************************/ From 091a507f348093b74e4b22e9c89f297ce8bd893c Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 6 Dec 2021 15:57:17 +0100 Subject: [PATCH 26/97] Update TEMPLATES.md --- TEMPLATES.md | 205 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 143 insertions(+), 62 deletions(-) diff --git a/TEMPLATES.md b/TEMPLATES.md index cea550f41..803c9683d 100644 --- a/TEMPLATES.md +++ b/TEMPLATES.md @@ -2,11 +2,12 @@ # Templates -Find below the available templates as of October 2021. More template information can be found in the [Tasmota Device Templates Repository](http://blakadder.github.io/templates) +Find below the available templates as of December 2021. More template information can be found in the [Tasmota Device Templates Repository](http://blakadder.github.io/templates) -## Addressable LED Controller +## Addressable LED ``` Athom 2812b {"NAME":"LS2812B-TAS","GPIO":[32,0,1376,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18} +BlitzWolf IC Smart RGB Magic {"NAME":"BW-LT31","GPIO":[0,0,32,1376,0,0,0,0,0,1088,0,0,0,0],"FLAG":0,"BASE":18,"CMND":"SO37 24"} cod.m WLAN Pixel Controller v0.6 {"NAME":"cod.m Pixel Controller","GPIO":[32,0,1376,0,0,0,0,0,544,0,0,0,0,0],"FLAG":0,"BASE":18} ESP01 NeoPixel Ring {"NAME":"ESP-01S-RGB-LED-v1.0","GPIO":[1,1,1376,1,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18} SP501E WS2812B {"NAME":"SP501E","GPIO":[0,32,0,1376,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18} @@ -19,6 +20,7 @@ BlitzWolf 400ml {"NAME":"BW-FUN3","GPIO":[0,2272,0,2304,0,0,0,0,0,0 Brilex 400ml {"NAME":"BrilexDiffuser","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54} Essential Oil 400ml {"NAME":"XD800W","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} GD-30W 300ml {"NAME":"GD-30W","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} +Gernems 400 ml {"NAME":"YX-088","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 11,1|TuyaMCU 61,2|TuyaMCU 62,3|TuyaMCU|12,5|TuyaMCU 63,6|TuyaMCU 21,7|TuyaMCU 24,8|TuyaRGB 3|DimmerRange 1,255|TuyaEnumList 1,2|TuyaEnumList 2,2|TuyaEnumList 3,1"} Kbaybo 300ml {"NAME":"K-H25","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} Kogan 500ml {"NAME":"Kogan Difuser","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54} Maxcio 400ml {"NAME":"MaxcioDiffuser","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54} @@ -40,7 +42,7 @@ Anoopsyche 9W 800lm {"NAME":"Anoop-CW-WW","GPIO":[0,0,0,0,0,416,0,0,0,4 Arlec Smart 1350lm PAR38 {"NAME":"Arlec GLD302HA","GPIO":[0,0,0,0,0,0,0,0,417,0,416,0,0,0],"FLAG":0,"BASE":18} Arlec Smart 9.5W 806lm {"NAME":"Arlec GLD110HA","GPIO":[0,0,0,0,0,416,0,0,0,417,0,0,0,0],"FLAG":0,"BASE":48} Arlec Smart 9.5W 806lm {"NAME":"Arlec CCT","GPIO":[0,0,0,0,0,416,0,0,0,417,0,0,0,0],"FLAG":0,"BASE":48} -Arlec Smart R80 9.5W 806lm {"NAME":"Arlec GLD115HA","GPIO":[0,0,0,0,0,416,0,0,0,449,0,0,0,0],"FLAG":0,"BASE":48} +Arlec Smart R80 9.5W 806lm {"NAME":"Arlec R80","GPIO":[0,0,0,0,0,416,0,0,0,449,0,0,0,0],"FLAG":0,"BASE":48} BlitzWolf A70 9W 900lm {"NAME":"BW-LT29","GPIO":[0,0,0,0,0,0,0,0,0,449,0,416,0,0],"FLAG":0,"BASE":18} BrilliantSmart 20696 9W 900lm {"NAME":"Brilliant20696","GPIO":[0,0,0,0,0,0,0,0,417,0,416,0,0,0],"FLAG":0,"BASE":18} BrilliantSmart 20697 9W 900lm {"NAME":"Brilliant20696","GPIO":[0,0,0,0,0,0,0,0,417,0,416,0,0,0],"FLAG":0,"BASE":18} @@ -128,12 +130,6 @@ Wipro Garnet NS9100 810lm {"NAME":"WiproSmartBulb","GPIO":[0,0,0,0,417,0,0,0, Wyze A19 800lm {"NAME":"Wyze Bulb","GPIO":[5728,0,0,0,0,0,0,0,0,416,417,0,0,0],"FLAG":0,"BASE":48} ``` -## Camera -``` -Ai-Thinker DIY Kit {"NAME":"AITHINKER CAM","GPIO":[4992,1,672,1,416,5088,1,1,1,6720,736,704,1,1,5089,5090,0,5091,5184,5152,0,5120,5024,5056,0,0,0,0,4928,576,5094,5095,5092,0,0,5093],"FLAG":0,"BASE":2} -Wireles Tag DIY Kit {"NAME":"WT-ESP32-CAM","GPIO":[4992,1,1,1,1,5088,0,0,1,1,1,1,1,0,5089,5090,0,5091,5184,5152,0,5120,5024,5056,0,0,0,0,4928,0,5094,5095,5092,0,0,5093],"FLAG":0,"BASE":2} -``` - ## Ceiling Light ``` BAZZ 14" RGBCCT {"NAME":"WF19129W","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} @@ -152,8 +148,11 @@ LOLAsmart Uranus White 70 cm {"NAME":"lola smart","GPIO":[0,0,0,1088,416,419,0, LSC 20W 1400lm White Ambiance {"NAME":"LSC RGBCW LED","GPIO":[0,0,0,0,0,0,0,0,4064,0,4032,0,0,0],"FLAG":0,"BASE":18} Luminea 24W CCT {"NAME":"Luminea NX6205-944","GPIO":[0,0,0,0,0,0,0,0,449,0,416,0,0,0],"FLAG":0,"BASE":48} LVL 300mm Round {"NAME":"LVL 300m Round 24W Ceiling LED","GPIO":[0,0,0,0,0,416,0,0,0,449,0,0,0,0],"FLAG":0,"BASE":48} +Nedis CCT 800lm {"NAME":"NEDIS WIFILAW10WT","GPIO":[0,0,0,0,0,0,0,0,417,0,416,0,0,0],"FLAG":0,"BASE":18} +Nedis RGBCCT 1200lm {"NAME":"Nedis RGB","GPIO":[0,0,0,0,417,416,0,0,420,418,419,0,0,0],"FLAG":0,"BASE":18} Oeegoo 15W RGBCCT {"NAME":"Oeegoo RGBCCT","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} Offdarks Star Fine RGBCCT 60W 40mm {"NAME":"Offdarks","GPIO":[0,0,0,0,417,416,0,0,419,420,418,0,0,0],"FLAG":0,"BASE":18} +Polux UFO RGBCCT 48W {"NAME":"Polux 313924","GPIO":[0,0,0,0,416,417,0,0,418,419,420,0,0,0],"FLAG":0,"BASE":18} SMRTLite LED Panel {"NAME":"SMRTLite","GPIO":[0,0,0,0,417,416,0,0,420,418,419,0,0,0],"FLAG":0,"BASE":18} Spectrum Smart Nymphea 36W CCT {"NAME":"Nymphea_36w","GPIO":[0,0,0,0,0,416,0,0,0,417,0,0,0,0],"FLAG":0,"BASE":18} Taloya 12" 24W CCT Main and RGB Ambient {"NAME":"Taloya GA300-24W-AI-WEMG","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} @@ -184,6 +183,11 @@ MS-108 In-Wall {"NAME":"MS-108","GPIO":[0,0,0,0,161,160,0,0,224,0, QS-WIFI-C01-RF {"NAME":"Shutter-QS-WIFI-C01","GPIO":[0,0,1,0,288,0,0,0,32,33,224,225,0,0],"FLAG":0,"BASE":18} ``` +## Curtain Motor +``` +Steren {"NAME":"Steren_SHOME-155","GPIO":[0,0,0,0,0,0,0,0,0,2304,0,2272,0,0],"FLAG":0,"BASE":54,"CMND":"SO54 1|SO20 1|TuyaMCU 61,1|TuyaMCU 21,2|TuyaMCU 27,3|TuyaMCU 97,5|TuyaMCU 11,6|TuyaMCU 62,7|TuyaMCU 63,8|TuyaMCU 81,9|TuyaMCU 98,10|TuyaMCU 82,11"} +``` + ## Curtain Switch ``` Anccy {"NAME":"Anccy Shutter","GPIO":[544,0,289,34,226,33,0,0,32,224,290,225,288,0],"FLAG":0,"BASE":18} @@ -198,12 +202,15 @@ Konesky {"NAME":"KingArt","GPIO":[544,0,289,162,226,32,0,0, LoraTap SC400W-EU {"NAME":"Loratap SC400W","GPIO":[544,0,0,34,0,32,0,0,33,225,0,224,0,0],"FLAG":0,"BASE":18} LoraTap SC411WSC-EU RF Remote {"NAME":"Loratap","GPIO":[0,0,0,34,226,32,0,0,33,225,0,224,0,0],"FLAG":0,"BASE":18} Maxcio WF-CS01 {"NAME":"Maxcio","GPIO":[544,0,289,162,226,33,0,0,32,224,290,225,288,0],"FLAG":0,"BASE":18} +Moes RF {"NAME":"Moes WS-EUR-CW","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} SCS86-03AJAI {"NAME":"ESE86-03AJAI","GPIO":[544,227,289,34,226,33,0,0,32,224,290,225,288,0],"FLAG":0,"BASE":18} Teekar SYS-CS 01 {"NAME":"Teekar-Tag","GPIO":[320,0,544,33,225,162,0,0,0,224,321,258,32,0],"FLAG":0,"BASE":18} Teepao {"NAME":"Teepao","GPIO":[576,322,226,33,225,34,0,0,320,224,321,0,32,0],"FLAG":0,"BASE":18} WF-CS01 {"NAME":"ShutterSwitch","GPIO":[544,227,289,34,226,33,0,0,32,224,290,225,288,0],"FLAG":0,"BASE":18,"CMND":"Rule1 1"} WF-CS02 {"NAME":"WF-CS02 Tuya","GPIO":[544,0,289,162,226,33,0,0,32,224,290,225,288,0],"FLAG":0,"BASE":18} +WuyunElek {"NAME":"MILOS Jalousie","GPIO":[1,0,224,225,1,320,0,0,32,33,34,226,0,0],"FLAG":0,"BASE":18} Zemismart {"NAME":"Zemismart","GPIO":[544,0,0,162,290,161,0,0,160,224,226,225,0,0],"FLAG":0,"BASE":18} +Zemismart Backlit {"NAME":"WF-CS01","GPIO":[544,227,289,34,226,161,0,0,160,224,290,225,288,0],"FLAG":0,"BASE":18} ``` ## DIN Relay @@ -214,7 +221,9 @@ OpenEnergyMonitor WiFi MQTT Thermostat {"NAME":"MQTT-RELAY","GPIO":[32,0,1,0,0, Sinotimer {"NAME":"TM608","GPIO":[32,0,0,0,2720,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":18} Sinotimer {"NAME":"Sinotimer TM60","GPIO":[0,0,0,0,0,288,0,0,224,160,0,0,0,0],"FLAG":0,"BASE":18} Sohan DIN Circuit Breaker 1P 50A {"NAME":"RDCBC-1P","GPIO":[32,0,0,0,0,0,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":1} +Sonoff Smart Stackable Power Meter {"NAME":"Sonoff SPM (POC2)","GPIO":[1,0,1,0,3200,5536,0,0,1,1,1,0,3232,0,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,544,1,1,32,1,0,0,1],"FLAG":0,"BASE":1} TOMZN 2P 63/80A Circuit Breaker {"NAME":"TOMZN","GPIO":[0,0,0,0,0,0,0,0,64,224,0,0,288,0],"FLAG":0,"BASE":18} +TOMZN 4P 80A Circuit Breaker {"NAME":"TOMZN4","GPIO":[32,0,0,0,0,0,0,0,224,288,0,0,0,0],"FLAG":0,"BASE":18} ``` ## Dehumidifier @@ -225,21 +234,29 @@ Vacplus 50 Pint {"NAME":"VacPlus Dehumidifier","GPIO":[0,0,0,0,0,0, ## Development Board ``` +Adafruit ESP32 Feather {"NAME":"HUZZAH32","GPIO":[0,0,0,0,4709,0,1,1,1,288,1,1,1,1,0,1,0,0,608,640,0,4705,4704,1,0,0,0,0,1,1,4706,4710,4708,0,0,4707],"FLAG":0,"BASE":1} Adafruit HUZZAH {"NAME":"Huzzah","GPIO":[32,0,320,0,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":18} +Ai-Thinker Camera {"NAME":"AITHINKER CAM","GPIO":[4992,1,672,1,416,5088,1,1,1,6720,736,704,1,1,5089,5090,0,5091,5184,5152,0,5120,5024,5056,0,0,0,0,4928,576,5094,5095,5092,0,0,5093],"FLAG":0,"BASE":2} +Ai-Thinker ESP32-C3 "Not available" +Ai-Thinker ESP32-S2F NodeMCU "Not available" AZ-Envy Environmental Sensor {"NAME":"AZ Envy","GPIO":[32,0,320,0,640,608,0,0,0,0,0,0,0,4704],"FLAG":0,"BASE":18} ESP32 Lite V1.0.0 {"NAME":"ESP32 Lite V1.0.0","GPIO":[1,0,1,0,1,1,0,0,1,1,1,1,1,1,1,1,0,0,0,1,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0],"FLAG":0,"BASE":1} LC Technology MicroPython Maker {"NAME":"LC-ESP-Python","GPIO":[1,1,544,1,1,1,1,1,1,1,1,1,1,1],"FLAG":0,"BASE":18} -LilyGO TTGO T-Internet-POE {"NAME":"LilyGO T-Internet-POE","GPIO":[0,1,1,1,1,1,1,1,1,1,1,1,1,1,5600,1,0,1,1,5568,0,1,1,1,0,0,0,0,1,1,1,1,1,0,0,1],"FLAG":0,"BASE":1} +LilyGO T-OI Plus v1.2 ESP32-C3 "Not available" +LilyGO T7 v1.5 {"NAME":"LilyGO T7 V1.5","GPIO":[1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,544,0,0,0,1,0,1,1,1,0,0,0,0,0,1,1,4704,1,0,0,1],"FLAG":0,"BASE":1} +LilyGO TTGO ESP32 Ethernet {"NAME":"T-Internet-POE v1.2","GPIO":[0,1,1,1,1,1,1,1,1,1,1,1,1,1,5600,1,0,1,1,5568,0,1,1,1,0,0,0,0,1,1,1,1,1,0,0,1],"FLAG":0,"BASE":1,"CMND":"EthType 0|EthClockMode 1|EthAddress 0"} M5Stack Atom Lite ESP32 {"NAME":"M5Stack Atom Lite","GPIO":[1,1,1,1,1,1,1,1,1056,1,1,1,1,1,1,1,0,1,1,1,0,1,640,1376,0,0,0,0,608,1,1,1,1,0,0,32],"FLAG":0,"BASE":1} +Mostly Robots Wemos D1 4 Channel MOSFET Shield {"NAME":"MOSFET","GPIO":[1,1,288,1,1,1,1,1,226,225,227,224,1,1],"FLAG":0,"BASE":18} Olimex ESP32-POE Ethernet {"NAME":"Olimex ESP32-PoE","GPIO":[1,1,1,1,1,1,0,0,5536,1,1,1,1,0,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1],"FLAG":0,"BASE":1} QuinLED 2 Channel {"NAME":"QuinLED 2 channel","GPIO":[416,0,417,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18} Silicognition wESP32 {"NAME":"wESP32","GPIO":[0,0,1,0,1,1,0,0,1,1,1,1,5568,5600,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1],"FLAG":0,"BASE":1} TZT ESP8266 Weather Station Kit {"NAME":"TZT Weather Station","GPIO":[32,0,640,0,1,1184,0,0,1,1,608,1,1,1],"FLAG":0,"BASE":18} WifInfo - Teleinfo Server {"NAME":"WifInfo","GPIO":[1376,1,1,5152,640,608,1,1,1,1,1,1,1,1],"FLAG":0,"BASE":18} +Wireles Tag Camera {"NAME":"WT-ESP32-CAM","GPIO":[4992,1,1,1,1,5088,0,0,1,1,1,1,1,0,5089,5090,0,5091,5184,5152,0,5120,5024,5056,0,0,0,0,4928,0,5094,5095,5092,0,0,5093],"FLAG":0,"BASE":2} Wireless Tag ESP32 Ethernet {"NAME":"WT32-ETH01","GPIO":[1,1,1,1,1,1,0,0,1,0,1,1,3840,576,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,1],"FLAG":0,"BASE":1} Witty Cloud {"NAME":"Witty Cloud","GPIO":[1,1,320,1,32,1,0,0,417,418,1,416,1,4704],"FLAG":0,"BASE":32} Yison ESP-01/ESP-202 {"NAME":"Yison Dev Board","GPIO":[259,544,258,1,260,261,1,1,416,418,257,417,256,1],"FLAG":0,"BASE":18} -ZiGate-Ethernet {"NAME":"ZIGATE-ETH","GPIO":[1,1,1,1,1,1,0,0,1,0,1,1,3840,576,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,1],"FLAG":0,"BASE":18,"CMND":"EthClockMode 3 | EthAddress 1"} +ZiGate-Ethernet {"NAME":"ZIGATE-ETH","GPIO":[1,1,1,1,1,1,0,0,1,0,1,1,3840,576,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0],"FLAG":0,"BASE":18,"CMND":"EthClockMode 3 | EthAddress 1"} ``` ## Dimmable @@ -326,6 +343,7 @@ Xiaomi Philips MUE4088RT {"NAME":"Xiaomi Philips","GPIO":[0,0,0,0,0,0,0,0,0, ``` 3A Smart Home HGZB-04D {"NAME":"HGZB-4D","GPIO":[1,1,1,1,1,1,0,0,1,1,290,1,1,0],"FLAG":0,"BASE":54} Acenx SD03 {"NAME":"SD03","GPIO":[34,33,0,323,576,322,0,0,321,416,320,96,256,0],"FLAG":0,"BASE":73} +Athom EU {"NAME":"Athom Dimmer Switch","GPIO":[576,2272,0,2304,0,0,0,0,0,0,0,0,0,1],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 21,2|Ledtable 0|DimmerRange 10,1000"} CE Smart Home {"NAME":"CE-WF500D","GPIO":[0,0,0,0,0,0,0,0,0,2304,0,2272,0,0],"FLAG":0,"BASE":54} CE Smart Home CFW500D-3W 3 Way {"NAME":"CE-WF500D-3W","GPIO":[0,0,0,0,0,0,0,0,0,2304,0,2272,0,0],"FLAG":0,"BASE":54} CNSKOU Touch {"NAME":"CNSKOU Dimmer Switch","GPIO":[0,0,0,0,0,0,0,0,0,0,290,0,0,0],"FLAG":0,"BASE":54} @@ -338,14 +356,16 @@ Martin Jerry SD01 {"NAME":"MJ-SD01 Dimmer","GPIO":[34,33,0,323,576,32 Martin Jerry Single Pole {"NAME":"MJ-KN01 Dimmer","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} Maxcio Rotary {"NAME":"EDM-1WAA-EU","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54} Minoston 3-Way {"NAME":"MS10W","GPIO":[1,2272,1,2304,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54} -Moes DS01-1 {"NAME":"MOES DS01","GPIO":[1,1,1,1,1,1,0,0,1,2304,1,2272,1,0],"FLAG":0,"BASE":54} +Moes {"NAME":"MOES DS01","GPIO":[1,1,1,1,1,1,0,0,1,2304,1,2272,1,0],"FLAG":0,"BASE":54} PS-16-DZ {"NAME":"PS-16-DZ","GPIO":[1,3200,1,3232,1,1,0,0,1,288,1,1,1,0],"FLAG":0,"BASE":58} Teekar UIW001-1 {"NAME":"Teekar UIW001-","GPIO":[0,3232,416,3200,640,608,0,0,160,0,0,0,0,0],"FLAG":0,"BASE":18} Tessan MJ-SD02 {"NAME":"MJ-SD02","GPIO":[34,33,0,323,576,322,0,0,321,416,320,96,256,0],"FLAG":0,"BASE":73} TopGreener TGWF500D {"NAME":"TopGreener-Dimmer","GPIO":[0,0,0,0,0,0,0,0,0,2304,0,2272,0,0],"FLAG":0,"BASE":54} -TreatLife DS01 {"NAME":"DS02S Dimmer","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} -TreatLife DS02S {"NAME":"DS02S Dimmer","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} +TreatLife 400W {"NAME":"DS02S Dimmer","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} +TreatLife 400W Single Pole {"NAME":"DS02S Dimmer","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} +Treatlife Dual Outdoor Dimmer {"NAME":"DP12","GPIO":[1,2272,1,2304,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54,"CMND":"SO97 1 | TuyaMCU 11,1 | TuyaMCU 12,7 | TuyaMCU 21,2 | TuyaMCU 22,8 | SO20 1 | SO54 1"} TreatLife Light and Fan {"NAME":"DS03 Fan/Light","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} +Virage Labs VirageDimmer {"NAME":"VirageDimmer","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18} WF-DS01 {"NAME":"Dimmer WF-DS01","GPIO":[1,1,1,1,1,1,0,0,1,1,290,1,1,0],"FLAG":0,"BASE":54} WiFi Dimmer Switch {"NAME":"PS-16-DZ","GPIO":[0,3200,0,3232,0,0,0,0,0,288,0,0,0,0],"FLAG":0,"BASE":58} Zemismart KS-7011 {"NAME":"KS-7011 Dimmer","GPIO":[1,2272,1,2304,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54} @@ -371,10 +391,11 @@ Sonoff D1 {"NAME":"Sonoff D1","GPIO":[1,3200,0,3232,0,0,0,0,0 ``` Heltec WiFi Kit 32 {"NAME":"WiFi Kit 32","GPIO":[1,1,1,1,640,1,1,1,1,1,1,608,3840,1,1,1,0,1,1,1,0,224,1,1,0,0,0,0,1,1,1,1,1,0,0,1],"FLAG":0,"BASE":1} Heltec WiFi Kit 8 {"NAME":"HTIT-W8266","GPIO":[1,1,1,1,640,608,0,0,1,1,1,1,1024,1],"FLAG":0,"BASE":18} +LilyGO T5 4.7 inch E-paper {"NAME":"LilyGO T5-4.7","GPIO":[0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,7616,0,0,0,0,0,0,0,0,0,0,33,34,4704,0,0,32],"FLAG":0,"BASE":1} LilyGO TTGO ESP8266 0.91 inch OLED SSD1306 {"NAME":"TTGO-0.91","GPIO":[1,1,640,1,1024,0,0,0,1,1,608,1,0,1],"FLAG":0,"BASE":18} LilyGO TTGO T-Camera {"NAME":"T-Camera","GPIO":[1,1,1,1,4992,5120,1,1,1,5089,5090,64,1,1,5024,65,0,640,608,5056,0,5184,1,5152,0,0,0,0,1,1,5088,5091,5095,5094,5093,5092],"FLAG":0,"BASE":1} LilyGO TTGO T-Display 1.14in {"NAME":"ESP32-ttgo-display","GPIO":[0,1,1,1,992,6592,1,1,1,1,1,1,6624,1,896,864,0,1,1,1024,0,1,1,1,0,0,0,0,1,1,1,33,1,0,0,1],"FLAG":0,"BASE":1} -LilyGO TTGO T-Watcher {"NAME":"TTGO T4 v1.3","GPIO":[35,1,672,1,992,1024,1,1,832,768,736,704,1,1,896,0,0,640,608,864,0,0,1,928,0,0,0,0,960,1,1,4704,1,32,33,34],"FLAG":0,"BASE":1} +LilyGO TTGO T-Watcher {"NAME":"TTGO T4 v1.3","GPIO":[35,1,672,1,992,1024,1,1,832,768,736,704,1,1,896,0,0,640,608,864,0,0,1,6368,0,0,0,0,6400,1,1,4704,1,32,33,34],"FLAG":0,"BASE":1} LilyGO TTGO TO ESP8266 OLED SH1106 Weather Station {"NAME":"TTGO T12","GPIO":[1,1,1,1,608,640,0,0,32,34,33,1,1,1],"FLAG":0,"BASE":18} M5Stack Core2 {"NAME":"M5Stack Core 2","GPIO":[6210,1,1,1,6720,768,0,0,0,1,1,800,0,0,736,1,0,641,609,704,0,0,0,1,0,0,0,0,640,608,1,1,1,0,672,0],"FLAG":0,"BASE":1} M5Stack M5StickC {"NAME":"M5StickC","GPIO":[1,0,0,0,0,768,1056,576,0,736,0,704,0,0,1024,0,0,641,609,800,0,0,1,0,0,0,0,0,640,608,1,0,1,32,6210,33],"FLAG":0,"BASE":1} @@ -383,6 +404,12 @@ OLED Display Module 0.66" for Wemos D1 Mini {"NAME":"OLED 64x48","GPIO":[1,1,1, TTGO ESP32 {"NAME":"TTGO T-Journal ESP32 Camera","GPIO":[4928,1,1,1,1,5091,1,1,1,608,640,4960,1,5088,5093,5095,0,5184,5120,5056,0,5024,5152,4992,0,0,0,0,1,1,5090,5089,5094,0,0,5092],"FLAG":0,"BASE":1} ``` +## Display Switch +``` +Lanbon L8 5 in 1 LCD Touch {"NAME":"Lanbon L8","GPIO":[0,0,0,0,0,992,0,0,224,0,225,0,0,0,1024,896,0,6624,6592,864,0,832,416,226,0,0,0,0,417,418,0,352,0,0,0,4736],"FLAG":0,"BASE":1} +Sonoff NSPanel Touch {"NAME":"NSPanel","GPIO":[0,0,0,0,3872,0,0,0,0,0,32,0,0,0,0,225,0,480,224,1,0,0,0,33,0,0,0,0,0,0,0,0,0,0,4736,0],"FLAG":0,"BASE":1,"CMND":"ADCParam 2,64000,10000,3950 | Sleep 0 | BuzzerPWM 1"} +``` + ## Downlight ``` 3A 12W RGBW {"NAME":"RGBWSpot","GPIO":[0,0,0,0,416,419,0,0,417,452,418,0,0,0],"FLAG":0,"BASE":18} @@ -390,6 +417,7 @@ Arlec Smart 9W CCT {"NAME":"Arlec ALD092CHA","GPIO":[0,0,0,0,416,417,0 Arlec Smart 9W RGB+CCT {"NAME":"Arlec ALD092RHA","GPIO":[0,0,0,0,419,420,0,0,416,418,417,0,0,0],"FLAG":0,"BASE":18} Atom 10W RGBCCT {"NAME":"Atom AT9017/WH/WIZ/TR","GPIO":[0,0,420,0,419,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,416,417,418,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1} Atom 11W RGBCCT {"NAME":"Atom AT9012/WH/WIZ","GPIO":[0,0,420,0,419,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,416,417,418,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1} +Bazz 6" RGBCCT Recessed Lighting Conversion Kit {"NAME":"CON6RGBTNWWF","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} BrilliantSmart Prism 10W RGBCCT {"NAME":"Prism","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} BrilliantSmart Trilogy 9W CCT {"NAME":"SmartCCTDwnLgt","GPIO":[0,0,0,0,0,416,0,0,0,449,0,0,0,0],"FLAG":0,"BASE":48} Connect SmartHome RGB {"NAME":"CSH-240RGB10W","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} @@ -400,6 +428,7 @@ Globe 5W 4" Recessed RGBCCT {"NAME":"GlobeRGBWW","GPIO":[0,0,0,0,416,419,0,0,41 Hyperikon 14W 1000lm 6" {"NAME":"HyperikonDL6","GPIO":[0,0,0,0,417,416,0,0,420,418,419,0,0,0],"FLAG":0,"BASE":18} iHomma 6W RGBCCT {"NAME":"iHomma RGBWW","GPIO":[0,0,0,0,420,419,0,0,416,417,418,0,0,0],"FLAG":0,"BASE":18} iHomma RGB BT+IR 12W {"NAME":"iHommaLEDDownl","GPIO":[0,0,0,0,0,419,0,0,416,417,418,0,0,0],"FLAG":0,"BASE":18} +Illume 6-inch RGBCCT {"NAME":"I-SMRGBCCT6","GPIO":[0,0,0,0,407,406,0,0,409,420,408,0,0,0],"FLAG":0,"BASE":18} Kogan 9W RGBCCT {"NAME":"Kogan_SMARTLED","GPIO":[0,0,0,0,417,416,0,0,420,418,419,0,0,0],"FLAG":0,"BASE":18} LEDLite CCT 10W Fire Rated {"NAME":"LEDLite-LTTD10Wifi","GPIO":[0,0,0,0,0,0,0,0,417,0,416,0,0,0],"FLAG":0,"BASE":18} Mirabella Genio 9W CCT {"NAME":"GenioDLightCCT","GPIO":[0,0,0,0,0,0,0,0,449,0,416,0,0,0],"FLAG":0,"BASE":48} @@ -427,6 +456,7 @@ Arlec Smart 45cm Smart DC Wall {"NAME":"Arlec 45cm Fan","GPIO":[0,0,0,0,0,0,0,0 Geek Aire 3D Oscillating Desktop {"NAME":"Geek Aire Fan","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 12,4 | TuyaMCU 13,5"} Goldair SleepSmart GCPF315 {"NAME":"Goldair Fan","GPIO":[0,0,0,0,0,0,0,0,0,2304,0,2272,0,0],"FLAG":0,"BASE":54} Lucci Connect Remote Control {"NAME":"Lucci Fan","GPIO":[0,0,0,0,0,0,0,0,0,2304,0,2272,0,0],"FLAG":0,"BASE":54} +QuietCool Gable Mount Attic {"NAME":"QuietCool-AFG-SMT-PRO-2.0","GPIO":[0,0,0,0,0,224,0,0,0,0,0,0,0,0,640,608,0,0,0,225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1,"CMND":"Interlock 1|WebButton1 Low|WebButton2 High|SO8 1"} Sichler Haushaltsgeraete Column {"NAME":"Sichler Fan","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} Technical Pro {"NAME":"FXA16 Fan","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 12,8"} Zemismart Bladeless {"NAME":"Bladeless Fan","GPIO":[1,2272,1,2304,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54} @@ -446,7 +476,7 @@ Sonoff iFan04-L 110V Light and Ceiling {"NAME":"iFan04-L","GPIO":[32,3200,0,323 Avatto Light and {"NAME":"AVATTO SYS-FL01","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} Deta Light and {"NAME":"Deta Fan Speed and Light Controller","GPIO":[33,0,0,576,226,34,0,0,0,225,224,227,32,0],"FLAG":0,"BASE":18} iSwitch Light and {"NAME":"iSwitchOZ Light Fan","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} -Treatlife Ceiling {"NAME":"DS02F","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 11,1|SO97 1|SO68 0"} +Treatlife 1.5A 4 Speed Ceiling {"NAME":"DS02F","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 11,1|SO97 1|SO68 0"} ``` ## Garage Door Opener @@ -567,7 +597,6 @@ ZJ-WF-ESP-A v1.1 {"NAME":"RGB2","GPIO":[0,0,0,0,0,0,0,0,417,416,418, Arlec Smart 2m LED Colour Changing Strip Light {"NAME":"Arlec_Light_Strip","GPIO":[1,1,1088,1,416,419,1,1,417,420,418,0,1,1],"FLAG":0,"BASE":18} B.K. Licht 2m RGB {"NAME":"RGBW-Strip","GPIO":[0,0,0,0,416,32,0,0,417,0,418,0,0,0],"FLAG":0,"BASE":18} BAZZ 10 ft RGBW {"NAME":"BAZZ U183MRGBWWF RGBW LED Strip","GPIO":[32,0,0,0,416,419,0,0,417,0,418,0,0,0],"FLAG":0,"BASE":18} -BlitzWolf BW-LT11 {"NAME":"BW-LT11 Strip","GPIO":[32,0,0,0,416,419,0,0,417,0,418,0,0,0],"FLAG":0,"BASE":18} BrilliantSmart 20743 RGB+W {"NAME":"BrilliantStrip","GPIO":[32,0,0,0,416,419,0,0,417,0,418,0,0,0],"FLAG":0,"BASE":18} Briloner 2256-150 RGB {"NAME":"Briloner2256-1","GPIO":[1088,0,0,0,416,0,0,0,417,0,418,0,0,0],"FLAG":0,"BASE":18} Calex 5m RGB + White {"NAME":"Calex RGBW IR","GPIO":[1088,0,0,0,416,0,0,0,417,419,418,0,0,0],"FLAG":0,"BASE":18} @@ -589,7 +618,7 @@ LE LampUX 16.4ft RGB {"NAME":"LampUX","GPIO":[0,33,32,0,0,417,0,0,418,10 LE LampUX 2m RGB TV Backlight {"NAME":"LE 904102","GPIO":[0,32,33,0,0,417,0,0,418,34,0,416,0,0],"FLAG":0,"BASE":18} LE LampUX 5m RGB {"NAME":"LampUX","GPIO":[32,0,0,0,0,417,0,0,418,0,0,416,0,0],"FLAG":0,"BASE":18} LE LampUX 5m RGB {"NAME":"LE LampUx","GPIO":[0,0,0,0,0,417,0,0,418,0,0,416,0,0],"FLAG":0,"BASE":34} -LE lampUX 5m RGBW {"NAME":"LampUX","GPIO":[0,0,32,0,0,417,0,0,418,0,419,416,0,0],"FLAG":0,"BASE":18} +LE lampUX 5m RGBW {"NAME":"LampUX","GPIO":[0,0,0,0,416,419,0,0,417,0,418,0,0,0],"FLAG":0,"BASE":18} Lenovo 5m RGBW {"NAME":"Lenovo LED Strip 5m","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} LePower 32.8ft RGB {"NAME":"LePower","GPIO":[0,0,0,0,0,417,0,0,418,0,0,416,0,0],"FLAG":0,"BASE":18} Lohas ZN022 5m RGBW {"NAME":"LOHAS M5-022","GPIO":[0,0,0,0,417,416,0,0,32,418,0,0,0,0],"FLAG":0,"BASE":18} @@ -617,7 +646,7 @@ Torchstar Safe Lighting Kit {"NAME":"Torchstar","GPIO":[0,0,0,0,288,0,0,0,0,0,0 WiZ 2m Starter Kit {"NAME":"WiZ LED Strip","GPIO":[0,0,420,0,419,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,416,417,418,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1} WOOX 5m RGBW {"NAME":"GardenLedstrip1","GPIO":[0,0,0,0,0,417,0,0,418,160,416,0,0,0],"FLAG":0,"BASE":18} WOOX 5m RGBW {"NAME":"Woox R5093","GPIO":[32,0,0,0,416,419,0,0,417,0,418,0,0,0],"FLAG":0,"BASE":18} -Yeelight Lightstrip 1S {"NAME":"Yeelight Lightstrip 1S","GPIO":[0,0,0,0,0,418,0,0,0,416,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1,"CMND":"`SO37 128 | SO92 1"} +Yeelight Lightstrip 1S {"NAME":"Yeelight Lightstrip 1S","GPIO":[0,0,0,0,0,418,0,0,0,416,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1,"CMND":"SO37 128 | SO92 1"} Zemismart 3m Extendable RGBW {"NAME":"Zemismart LED","GPIO":[0,0,0,0,417,416,0,0,0,418,419,0,0,0],"FLAG":0,"BASE":18} ``` @@ -641,6 +670,8 @@ electriQ MOODL Ambiance Lamp {"NAME":"ElectriQ MOODL","GPIO":[0,4640,0,0,0,0,0, Hama Wall Light Square, 10 cm, IP 44 {"NAME":"Hama Wifi Wall Light","GPIO":[0,0,0,0,0,416,0,0,0,417,0,0,0,1],"FLAG":0,"BASE":18} Hugoai Table Lamp {"NAME":"HG02","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 11,20 | TuyaMCU 26,21 | TuyaMCU 21,22 | TuyaMCU 23,23 | TuyaMCU 24,24 | DimmerRange 34,1000"} Iwoole Table Lamp {"NAME":"GLOBELAMP","GPIO":[0,0,0,0,419,0,0,0,417,418,416,0,0,0],"FLAG":0,"BASE":18} +LSC Multicolor Christmas String {"NAME":"LSC MC Lights","GPIO":[0,0,0,0,544,32,0,0,3840,0,3872,0,0,0],"FLAG":0,"BASE":18} +LSC Smart Mood {"NAME":"LSC Mood Light","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} Lumary 18W RGBCCT Recessed Panel {"NAME":"LumaryDLghtRGB","GPIO":[0,0,0,0,417,416,0,0,420,418,419,0,0,0],"FLAG":0,"BASE":18} Mi LED Desk Lamp {"NAME":"Mi Desk Lamp","GPIO":[0,0,32,0,416,417,0,0,3264,3296,0,0,0,0],"FLAG":0,"BASE":66} Mirabella Genio 10 LED Filament Festoon {"NAME":"GenioFestoon","GPIO":[0,0,0,0,0,0,0,0,0,0,416,0,0,0],"FLAG":0,"BASE":18} @@ -648,16 +679,18 @@ Mirabella Genio 4 Black LED Garden Path {"NAME":"GenioGardenStr","GPIO":[0,0,0, Mirabella Genio CCT 6 LED 30mm Stainless Steel Deck {"NAME":"Mirabella Deck CCT","GPIO":[0,0,0,0,0,416,0,0,0,417,0,0,0,0],"FLAG":0,"BASE":18} MiraBella Genio Colour 6 LED 30mm Stainless Steel Deck {"NAME":"Genio RGB Deck Lights","GPIO":[0,0,0,0,416,0,0,0,417,0,418,0,0,0],"FLAG":0,"BASE":18} Mirabella Genio Rechargable LED Portable Lamp {"NAME":"MirabellaPortableLamp","GPIO":[32,0,0,0,416,419,0,0,417,0,418,0,0,0],"FLAG":0,"BASE":18} +Nous CCT Desk Lamp {"NAME":"NOUS Smart Desk Lamp S1","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 11,1 | TuyaMCU 21,3 | TuyaMCU 23,4 | DimmerRange 25,255"} Novostella UT88835 20W Flood {"NAME":"Novo 20W Flood","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} Novostella UT88836 20W Flood {"NAME":"Novo 20W Flood","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} Nue Vision Care Desk Lamp {"NAME":"Nue Vision Desk Lamp VC18","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 11,1 | TuyaMCU 21,3 | TuyaMCU 23,4"} -Sonoff BN-SZ01 {"NAME":"Sonoff BN-SZ","GPIO":[0,0,0,0,0,0,0,0,416,320,0,0,0,0],"FLAG":0,"BASE":22} +Philips Wiz 24W LED White Batten {"NAME":"PHILIPS-wiz-24w","GPIO":[0,0,0,0,417,0,0,0,0,416,0,0,0,0],"FLAG":0,"BASE":18} +Sonoff {"NAME":"Sonoff BN-SZ","GPIO":[0,0,0,0,0,0,0,0,416,320,0,0,0,0],"FLAG":0,"BASE":22} Spotlight 9cm RGB+W 7W {"NAME":"Spotlight RGBW","GPIO":[0,0,0,0,0,0,0,0,0,3008,0,3040,0,0],"FLAG":0,"BASE":27} -TCP WPAN Square 600X600mm 36W CCT Panel {"NAME":"TCPsmart LED Panel","GPIO":[0,0,0,0,0,416,0,0,0,449,0,0,0,0],"FLAG":0,"BASE":18} +TCP WPAN Square 600X600mm 36W CCT Panel {"NAME":"TCPsmart LED Panel","GPIO":[0,0,0,0,0,416,0,0,0,449,0,0,0,0],"FLAG":0,"BASE":18,"CMND":"SO92 1|DimmerRange 30,100"} Teckin FL41 {"NAME":"Teckin FL41","GPIO":[0,0,0,0,0,32,0,0,0,0,416,0,0,0],"FLAG":0,"BASE":18} Wipro Next Smart Batten 20W CCT {"NAME":"WIPROBatten","GPIO":[0,0,0,0,0,416,0,0,0,449,0,0,0,4704],"FLAG":0,"BASE":18} Xiaomi Mi Desk Lamp Pro {"NAME":"Mi Desk Lamp Pro","GPIO":[6212,0,416,0,417,0,0,0,3840,0,0,0,160,640,608,0,0,0,0,0,0,0,3296,3264,0,0,0,0,0,32,0,0,0,0,0,0],"FLAG":0,"BASE":1,"CMND":"DimmerRange 30,100"} -Yeelight Crystal Pendant {"NAME":"Yeelight Meteorite","GPIO":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,420,0,419,0,0,0,0,417,418,0,0,0,0,0,416,0,0,0,0,0,0],"FLAG":0,"BASE":1,"CMND":"`SO37 128 | SO92 1"} +Yeelight Crystal Pendant {"NAME":"Yeelight Meteorite","GPIO":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,420,0,419,0,0,0,0,417,418,0,0,0,0,0,416,0,0,0,0,0,0],"FLAG":0,"BASE":1,"CMND":"SO37 128 | SO92 1"} Zemismart Moonlamp {"NAME":"Zemismart Moonlamp","GPIO":[1,1,1,1,416,419,1,1,417,420,418,1,1,1],"FLAG":0,"BASE":18} ``` @@ -682,12 +715,16 @@ NEO Coolcam Mouse Trap {"NAME":"Neo Mouse Trap","GPIO":[1,2272,1,2304,1,1, PCI-e Desktop PC Remote Control {"NAME":"PC-Switch-01","GPIO":[32,0,0,0,0,0,0,0,224,544,0,0,0,0],"FLAG":0,"BASE":18} Proscenic T21 Air Fryer {"NAME":"Proscenic T21","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} RainPoint Indoor Water Pump {"NAME":"RainPoint","GPIO":[0,0,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 81,107|TuyaMCU 12,109|TuyaMCU 11,1|TuyaMCU 82,104"} +Sinilink PCIe Computer Remote {"NAME":"XY-WPCE","GPIO":[1,1,320,1,32,224,0,0,160,0,0,0,0,0],"FLAG":0,"BASE":18,"CMND":"SO114 1 | SwitchMode1 2"} +Sinilink USB Computer Remote {"NAME":"XY-WPCL","GPIO":[1,1,320,1,32,224,0,0,160,0,0,0,0,0],"FLAG":0,"BASE":18,"CMND":"SO114 1 | SwitchMode1 2"} Xystec USB3.0 4 Port Hub {"NAME":"Xystec USB Hub","GPIO":[0,0,0,0,224,0,0,0,226,227,225,0,0,0],"FLAG":0,"BASE":18} ``` ## Module ``` -Ai Thinker ESP-C3-12F ESP-12 Compatible "Not available" +Ai-Thinker ESP32-C3 "Not available" +Ai-Thinker ESP32-C3F ESP-12 Compatible "Not available" +Ai-Thinker ESP32-S2F "Not available" DT-Light ESP8285 Lighting {"NAME":"DMP-L1","GPIO":[1,1,0,1,1,1,0,0,1,1,1,1,1,1],"FLAG":0,"BASE":18} ESP-01D {"NAME":"ESP-01D","GPIO":[1,1,0,1,1,0,0,0,1,0,1,0,0,0],"FLAG":0,"BASE":18} ESP-01M "Not available" @@ -700,7 +737,10 @@ ESP-M2 {"NAME":"ESP-M2","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,0, ESP-M3 {"NAME":"ESP-M3","GPIO":[1,1,1,1,1,0,0,0,0,1,1,0,1,0],"FLAG":0,"BASE":18} ESP-M4 {"NAME":"ESP-M4","GPIO":[1,1,0,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":18} LC Technology PSF-B04 Ewelink 4 Channel Switch {"NAME":"LC-EWL-B04-MB","GPIO":[1,1,1,1,1,1,0,0,1,288,1,1,0,0],"FLAG":0,"BASE":18} +M5Stack M5Stamp C3 "Not available" +M5Stack M5Stamp Pico {"NAME":"M5Stamp Pico","GPIO":[1,1,0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,1,0,1376,0,0,0,0,1,1,0,0,1,0,0,32],"FLAG":0,"BASE":1} MTools 16 Channel ESP32 Relay Driver 5V DC {"NAME":"16ch Board","GPIO":[1,1,237,1,232,1,1,1,228,231,1,1,233,230,234,235,0,238,239,236,0,224,227,226,0,0,0,0,229,225,1,1,1,0,0,1],"FLAG":0,"BASE":1} +PSF-B Series ESP8285 "Not available" Shelly Universal Input/Output {"NAME":"Shelly Uni","GPIO":[320,0,0,0,225,1216,0,0,192,193,0,224,0,4864],"FLAG":0,"BASE":18} Sinilink MODBUS Interface {"NAME":"XY-WFPOW","GPIO":[0,1,0,1,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18} Wireless Tag ESP32-C3 ESP-12 Compatible "Not available" @@ -769,13 +809,14 @@ Konyks Pluviose 16A IP55 {"NAME":"Konyks Pluviose","GPIO":[32,0,0,0,0,0,0,0, Koolertron {"NAME":"C168 Outdoor","GPIO":[0,32,0,320,2720,2656,0,0,224,2624,225,226,0,0],"FLAG":0,"BASE":18} Luminea 2 Outlet {"NAME":"Luminea","GPIO":[0,0,0,0,225,320,0,0,224,321,32,0,0,1],"FLAG":0,"BASE":18} Luminea NX-4458 {"NAME":"Luminea NX4458","GPIO":[32,0,0,0,2688,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":65} +Master {"NAME":"Master_IOT-EXTPLUG","GPIO":[32,1,0,1,1,0,0,0,224,288,0,0,0,0],"FLAG":0,"BASE":1} Maxcio EOP03-EU {"NAME":"Maxcio EOP03-EU","GPIO":[0,0,0,0,225,321,0,0,224,288,32,0,322,0],"FLAG":0,"BASE":18} Maxcio SOP02-US {"NAME":"Maxcio SOP02US","GPIO":[0,0,0,0,0,544,0,0,224,32,225,0,0,1],"FLAG":0,"BASE":18} Merkury {"NAME":"Merkury Switch","GPIO":[32,0,0,0,0,321,0,0,0,288,224,0,0,0],"FLAG":0,"BASE":18} Merkury {"NAME":"Merkury Switch","GPIO":[0,0,0,0,32,0,0,0,0,224,0,0,0,0],"FLAG":0,"BASE":18} Minoston MP22W {"NAME":"Minoston MP22W","GPIO":[0,0,0,0,320,0,0,0,224,64,0,0,0,0],"FLAG":0,"BASE":18} Nedis PO120 IP44 {"NAME":"WIFIPO120FWT","GPIO":[32,0,0,0,2688,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":49} -Obi Stecker IP44 {"NAME":"OBI Socket 2","GPIO":[0,0,0,0,224,32,0,0,320,289,0,0,0,0],"FLAG":0,"BASE":61} +Obi Stecker IP44 {"NAME":"OBI-Outdoor-Socket2","GPIO":[0,0,0,0,224,32,0,0,576,288,1,1,1,1],"FLAG":0,"BASE":18} Oittm Outdoor {"NAME":"Oittm Outdoor","GPIO":[32,0,0,0,0,0,0,0,0,0,320,224,1,0],"FLAG":0,"BASE":18} Peteme PS-1602 {"NAME":"Peteme Outdoor","GPIO":[32,0,0,0,0,225,33,0,224,320,0,0,0,0],"FLAG":0,"BASE":18} Poweradd {"NAME":"POWERADD","GPIO":[0,0,0,0,320,321,0,0,224,32,225,0,0,0],"FLAG":0,"BASE":18} @@ -802,6 +843,7 @@ Wyze {"NAME":"Wyze Plug Outdoor","GPIO":[0,0,0,0,0,576,0 ## Plug ``` +1AC 2USB {"NAME":"BSD31","GPIO":[0,0,0,0,0,225,0,0,224,32,320,0,0,0],"FLAG":0,"BASE":18} 2nice SP111 {"NAME":"2NICE SP111","GPIO":[320,0,321,0,0,0,0,0,0,32,0,224,0,4736],"FLAG":0,"BASE":18} 2nice UP111 {"NAME":"2NICE UP111","GPIO":[0,576,0,32,2720,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":18} 3Stone Mini {"NAME":"3Stone Smart Plug","GPIO":[0,32,0,0,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":18} @@ -840,6 +882,7 @@ Aoycocr X6 {"NAME":"Aoycocr X6","GPIO":[0,0,320,0,0,0,0,0,0,32 Aquiv S1 {"NAME":"Aquiv S1","GPIO":[0,0,544,0,320,0,0,0,224,32,0,0,0,1],"FLAG":0,"BASE":18} Arlec 10m Smart Extension Lead {"NAME":"Arlec Ext Cord","GPIO":[0,32,0,0,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":18} Arlec Heavy Duty 20m Extension Lead {"NAME":"Arlec Ext Cord","GPIO":[0,32,0,0,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":18} +Arlec Plug In Socket {"NAME":"PC191HA","GPIO":[0,32,0,0,2720,2656,0,0,2624,224,288,0,0,0],"FLAG":0,"BASE":18} Arlec Smart {"NAME":"Arlec-PC190HA","GPIO":[0,0,0,0,320,0,0,0,224,576,32,0,0,0],"FLAG":0,"BASE":18} Arlec Smart {"NAME":"PC399HA","GPIO":[0,0,0,32,2720,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":52} Arlec Smart 2.1A USB Charger {"NAME":"Arlec Single","GPIO":[0,0,0,0,321,0,0,0,224,0,64,0,0,0],"FLAG":0,"BASE":18} @@ -881,6 +924,7 @@ Bakibo TP22Y {"NAME":"Bakibo TP22Y","GPIO":[0,0,0,32,2720,2656,0 Bardi 16A {"NAME":"BARDI","GPIO":[320,0,0,0,0,2720,0,0,224,32,2656,321,2624,0],"FLAG":0,"BASE":18} Bauhn ASPU-1019 {"NAME":"Bauhn Smart Pl","GPIO":[0,0,0,0,224,225,0,0,0,320,32,0,0,0],"FLAG":0,"BASE":18} BAW {"NAME":"BAW TPSWIFI-10","GPIO":[0,0,0,0,320,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} +Bawoo {"NAME":"Bawoo S120","GPIO":[0,0,0,0,288,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} Be HiTech 16A {"NAME":"Be HiTech","GPIO":[0,0,0,288,0,2720,0,0,2624,32,2656,224,0],"FLAG":0,"BASE":18} Bearware 303492 3AC+2USB {"NAME":"Bearware 30349","GPIO":[0,320,0,32,225,226,0,0,227,224,544,0,0,0],"FLAG":0,"BASE":18} Bestek MRJ1011 {"NAME":"BestekMRJ1011","GPIO":[0,0,0,0,320,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":1} @@ -952,6 +996,7 @@ Digoo NX-SP202 {"NAME":"Generic_SP202","GPIO":[288,0,0,2624,65,272 Dilisens NX-SP201 Mini 2 in 1 {"NAME":"NX-SP201","GPIO":[0,0,2624,0,2720,2656,288,224,33,225,32,0,0,0],"FLAG":0,"BASE":18} DILISENS SP201 {"NAME":"Dilisens SP201","GPIO":[0,0,2624,0,2688,2656,288,224,33,225,32,0,0,0],"FLAG":0,"BASE":18} Dunnes Stores {"NAME":"SmartLifePlug","GPIO":[0,0,0,32,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":18} +Duvik 10A {"NAME":"Duvik M008","GPIO":[0,0,0,0,320,320,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} DWFeng AWP02L-N {"NAME":"AWP02L-N","GPIO":[1,1,320,1,1,1,0,0,1,32,1,224,1,0],"FLAG":0,"BASE":18} DWFeng BSD01 {"NAME":"DWFeng BSD01","GPIO":[1,1,1,1,1,1,1,1,224,32,320,1,1,1],"FLAG":0,"BASE":18} ECO Plugs CT-065W {"NAME":"ECO/CT-065W","GPIO":[0,0,576,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} @@ -971,10 +1016,11 @@ Energeeks 2 USB {"NAME":"EG-EW005MC","GPIO":[544,1,288,1,1,225,1,1, Energizer {"NAME":"Energizer EIE3-1001-WHT","GPIO":[32,0,448,0,2688,2656,0,0,2624,450,224,0,449,0],"FLAG":0,"BASE":18} Energizer Smart Plug {"NAME":"Energizer Smart Plug","GPIO":[0,0,0,32,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":18} Epicka {"NAME":"Epicka","GPIO":[1,1,1,1,321,320,0,0,224,32,1,1,1,4704],"FLAG":0,"BASE":18} +Eques Elf Smart Plug {"NAME":"EQP01WTGY","GPIO":[0,0,0,320,0,0,0,0,96,0,0,224,0,0],"FLAG":0,"BASE":18} Esicoo JSM-WF02 {"NAME":"Esicoo Plug","GPIO":[0,32,0,0,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":18} Estink C178 {"NAME":"Estink C178","GPIO":[0,0,0,0,288,321,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} -Etekcity ESW01-USA {"NAME":"ESW01-USA","GPIO":[0,0,0,0,224,544,0,0,2656,2688,32,2592,288,0],"FLAG":0,"BASE":55} -Etekcity ESW15-USA {"NAME":"ESW15-US","GPIO":[0,0,0,0,0,224,0,0,2656,2688,32,2592,288,0],"FLAG":0,"BASE":18} +Etekcity 15A {"NAME":"ESW15-US","GPIO":[0,0,0,0,0,224,0,0,2656,2688,32,2592,288,0],"FLAG":0,"BASE":18} +Etekcity 8A {"NAME":"ESW01-USA","GPIO":[0,0,0,0,224,544,0,0,2656,2688,32,2592,288,0],"FLAG":0,"BASE":55} EU3S {"NAME":"AWOW BSD33","GPIO":[0,0,320,0,0,2720,0,0,2624,32,2656,224,0,0],"FLAG":0,"BASE":18} Eva Logik {"NAME":"EVA LOGIK Plug","GPIO":[1,32,1,1,1,1,0,0,1,288,224,1,1,0],"FLAG":0,"BASE":18} EZPlug V1 OpenSource {"NAME":"EZPlug V1","GPIO":[0,0,0,32,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":1} @@ -985,6 +1031,7 @@ FK-PW901U {"NAME":"FK-PW901U","GPIO":[320,1,1,1,1,226,0,0,224 FLHS-ZN04 {"NAME":"FLHS-ZN04","GPIO":[321,0,320,0,0,2720,0,0,2624,32,2656,224,0,0],"FLAG":0,"BASE":45} Fontastic SH01 {"NAME":"Fontastic","GPIO":[1,0,1,0,320,0,0,0,224,32,0,0,0,4704],"FLAG":0,"BASE":18} Foreet {"NAME":"Foreet_120V","GPIO":[0,0,0,0,224,32,0,0,289,288,0,0,0,0],"FLAG":0,"BASE":18} +Fox&Summit FS-IP12PK {"NAME":"Fox & Summit Plug","GPIO":[0,0,32,0,3840,0,0,0,544,256,480,0,0,0],"FLAG":0,"BASE":18,"CMND":"BuzzerPwm 1"} FrankEver 15A {"NAME":"Israel plug","GPIO":[321,0,320,2624,0,2720,0,0,0,32,2656,224,0,0],"FLAG":0,"BASE":45} FrankEver 16A {"NAME":"FrankEver FK-PW801ER","GPIO":[0,0,0,0,288,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} FrankEver Mini {"NAME":"FK-PW801US","GPIO":[0,0,320,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} @@ -999,12 +1046,14 @@ Geeni Spot Glo {"NAME":"Geeni Glo","GPIO":[0,0,0,0,320,0,0,0,224,3 Geeni SWITCH {"NAME":"Geeni Switch","GPIO":[0,0,0,0,288,321,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} Geeni Switch Duo {"NAME":"Geeni Duo","GPIO":[0,0,0,0,33,225,0,0,32,288,224,0,289,0],"FLAG":0,"BASE":18} Girier 16A {"NAME":"Girier - JR-PM01","GPIO":[0,544,0,2624,2720,2656,0,0,224,32,320,0,0,0],"FLAG":0,"BASE":68} +Globe 15A {"NAME":"Globe 50329","GPIO":[0,0,0,0,320,0,0,0,224,0,32,0,0,0],"FLAG":0,"BASE":18} Globe 2 Outlet {"NAME":"Globe 50020","GPIO":[0,576,0,321,33,32,0,0,224,320,225,0,0,0],"FLAG":0,"BASE":18} Globe Smart {"NAME":"GlobeSmartPlug","GPIO":[0,0,0,0,320,0,0,0,224,0,32,0,0,0],"FLAG":0,"BASE":18} GoldenDot Mini {"NAME":"GoldenDot Mini","GPIO":[0,32,0,0,0,0,0,0,0,321,224,0,0,0],"FLAG":0,"BASE":52} GoldenDot with ADC {"NAME":"W-US003-Power","GPIO":[320,0,0,0,0,0,0,0,0,32,0,224,0,4896],"FLAG":0,"BASE":18} Goliath 16A {"NAME":"GOLIATH AV-SSTE01","GPIO":[0,0,320,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} Gosund {"NAME":"Gosund EP2","GPIO":[320,1,576,1,2656,2720,0,0,2624,32,0,224,0,0],"FLAG":0,"BASE":45} +Gosund {"NAME":"SHP5","GPIO":[321,3072,320,3104,1,225,0,0,1,1,224,1,32,0],"FLAG":0,"BASE":18} Gosund 13A {"NAME":"Gosund UP111","GPIO":[0,320,0,32,2720,2656,0,0,2624,576,224,0,0,0],"FLAG":0,"BASE":18} Gosund 2 in 1 {"NAME":"Gosund WP212","GPIO":[321,288,544,0,224,2720,0,0,2624,32,2656,225,33,0],"FLAG":0,"BASE":18} Gosund Dual {"NAME":"Gosund SP211","GPIO":[33,576,320,2624,2720,2656,0,0,32,321,224,0,225,0],"FLAG":0,"BASE":18} @@ -1012,10 +1061,9 @@ Gosund SP1 {"NAME":"Gosund SP1 v23","GPIO":[0,321,0,32,2720,26 Gosund SP111 {"NAME":"Gosund SP111","GPIO":[320,0,321,0,0,2720,0,0,2624,32,2656,224,0,0],"FLAG":0,"BASE":18} Gosund SP111 v1.1 {"NAME":"Gosund SP111 v1.1","GPIO":[320,0,576,0,2656,2720,0,0,2624,32,0,224,0,0],"FLAG":0,"BASE":45} Gosund SP111 v1.4 {"NAME":"Gosund SP111 v1.4","GPIO":[321,1,320,1,0,2720,0,0,2624,32,2656,224,0,0],"FLAG":0,"BASE":45} -Gosund SP112 {"NAME":"SHP5","GPIO":[321,3072,320,3104,1,225,0,0,1,1,224,1,32,0],"FLAG":0,"BASE":18} Gosund SP112 {"NAME":"Gosund 112v3.4","GPIO":[320,0,321,0,2656,2720,0,0,2624,257,224,0,0,4800],"FLAG":0,"BASE":18} Gosund WP1 {"NAME":"Gosund WP1-1","GPIO":[0,0,320,0,0,2720,0,0,2624,32,2656,224,0,0],"FLAG":0,"BASE":45} -Gosund WP2 {"NAME":"Gosund WP2","GPIO":[32,576,321,0,33,0,0,0,225,320,224,0,0,0],"FLAG":0,"BASE":18} +Gosund WP2 {"NAME":"Gosund WP2 Plug","GPIO":[33,0,320,0,321,32,0,0,224,576,225,0,0,0],"FLAG":0,"BASE":18} Gosund WP211 {"NAME":"Gosund wp211","GPIO":[0,0,0,0,224,0,0,0,0,32,0,225,33,0],"FLAG":0,"BASE":18} Gosund WP212 {"NAME":"Gosund_WP212","GPIO":[32,544,321,0,33,0,0,0,225,320,224,0,0,0],"FLAG":0,"BASE":18} Gosund WP3 {"NAME":"Gosund WP3 v2","GPIO":[320,0,321,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} @@ -1051,10 +1099,10 @@ Hyleton 313 {"NAME":"Hyleton 313","GPIO":[321,0,320,0,0,0,0,0,0 Hyleton 314 {"NAME":"hyleton-314","GPIO":[321,0,320,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} Hyleton 315 {"NAME":"hyleton-315","GPIO":[0,0,0,0,321,320,0,0,224,64,0,0,0,0],"FLAG":0,"BASE":18} Hyleton 317 {"NAME":"hyleton-317","GPIO":[320,0,321,0,322,0,0,0,0,64,0,224,0,0],"FLAG":0,"BASE":18} -Hyleton HLT-311 {"NAME":"HLT-311","GPIO":[320,0,0,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} +Hyleton HLT-311 {"NAME":"HLT-311","GPIO":[544,0,320,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} iClever IC-BS08 {"NAME":"iClever BS08","GPIO":[0,0,0,0,544,320,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} iDIGITAL {"NAME":"Brilliant","GPIO":[0,0,0,0,288,0,0,0,224,64,0,0,0,0],"FLAG":0,"BASE":18} -Ihommate 16A {"NAME":"ZCH-02","GPIO":[0,0,0,32,2688,2656,0,0,2592,320,224,0,0,4704],"FLAG":0,"BASE":18} +Ihommate 16A {"NAME":"ZCH-02","GPIO":[0,0,0,32,2688,2656,0,0,2624,320,224,0,0,4704],"FLAG":0,"BASE":18} Infray 16A {"NAME":"AWP08L","GPIO":[32,0,288,0,0,0,0,0,0,0,0,224,0,4704],"FLAG":0,"BASE":18} Insmart WP5 {"NAME":"INSMART","GPIO":[0,0,448,0,0,0,0,0,0,160,0,224,0,0],"FLAG":0,"BASE":18} iSwitch {"NAME":"Smart Plug XSA","GPIO":[1,32,1,1,1,1,0,0,1,320,224,1,1,0],"FLAG":0,"BASE":18} @@ -1102,6 +1150,7 @@ Koogeek W-UKX {"NAME":"Koogeek W-UKX","GPIO":[0,32,1,1,1,0,0,0,0, KULED K63 {"NAME":"KULED K63","GPIO":[0,0,0,0,224,32,0,0,320,0,0,0,0,0],"FLAG":0,"BASE":18} Laduo YX-DE01 {"NAME":"YX-DE01","GPIO":[1,32,1,1,1,1,0,0,1,320,224,1,1,0],"FLAG":0,"BASE":18} LE LampUX Smart Socket {"NAME":"LE LampUX","GPIO":[0,0,0,0,0,320,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} +Ledvance Smart+ {"NAME":"Ledvance Plug","GPIO":[0,0,0,320,2688,2656,0,0,224,32,2624,0,0,0],"FLAG":0,"BASE":18} Lenovo SE-341A {"NAME":"Lenovo SE-341A","GPIO":[0,0,0,0,32,224,0,0,576,0,320,0,0,0],"FLAG":0,"BASE":18} LESHP KS-501 {"NAME":"LESHP KS-501","GPIO":[32,0,0,0,0,0,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":1} Lighting Arena {"NAME":"Lighting Arena Smart Plug","GPIO":[0,0,320,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} @@ -1113,6 +1162,7 @@ Lohas Nightlight + USB {"NAME":"Lohas LED Mini Plug","GPIO":[0,321,0,288,3 Lonsonho 10A Type E {"NAME":"Lonsonho10ALed","GPIO":[0,0,0,0,320,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} LoraTap SP400W-IT {"NAME":"LoraTap SP400W","GPIO":[0,0,0,0,544,320,0,0,224,32,0,0,0,1],"FLAG":0,"BASE":18} LSC Power {"NAME":"LSC Smart Plug","GPIO":[0,0,0,0,320,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} +LSC Smart Connect {"NAME":"LSC Smart Plug FR","GPIO":[0,0,0,0,320,0,0,0,224,0,32,0,0,0],"FLAG":0,"BASE":18} Lumiman LM650 {"NAME":"Lumiman LM650","GPIO":[0,0,0,0,320,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} Luminea NX-4491 {"NAME":"Luminea NX-449","GPIO":[320,0,576,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} Luminea NX-4541 {"NAME":"NX-4451","GPIO":[0,0,0,32,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":55} @@ -1134,9 +1184,11 @@ Merkury MI-WW101-199 {"NAME":"merkury WW101","GPIO":[0,0,0,0,0,0,0,0,320 Merkury MI-WW102-199L {"NAME":"MIC-WW102","GPIO":[32,0,0,0,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":36} Merkury MI-WW105-199W {"NAME":"Merkury Switch","GPIO":[1,1,1,1,576,320,0,0,224,32,1,1,1,4704],"FLAG":0,"BASE":18} Mini {"NAME":"MiniSmartSocket_S03","GPIO":[0,0,0,0,320,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} +Mini Smart {"NAME":"W-US002S","GPIO":[0,32,0,0,2720,0,0,0,0,288,224,0,0,0],"FLAG":0,"BASE":45} Minleaf W-DEXI {"NAME":"W-DEXI","GPIO":[0,32,0,0,2720,2656,0,0,2624,288,224,0,0,0],"FLAG":0,"BASE":18} Mirabella Genio {"NAME":"GenioGpo","GPIO":[0,0,0,32,2720,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":18} Mirabella Genio 1002341 {"NAME":"Genio 1","GPIO":[0,0,320,0,0,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":1} +Mirabella Genio Double Plug with USB Ports {"NAME":"Genio I002932","GPIO":[0,320,1,32,0,0,0,0,224,0,225,0,0,0],"FLAG":0,"BASE":18} Mirabella Genio USB {"NAME":"Mirabella Genio 1002826","GPIO":[0,0,0,32,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":1} Mirabella Genio USB Port {"NAME":"Genio I002341","GPIO":[0,0,0,0,320,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":1} Mistral {"NAME":"Mistral Smart ","GPIO":[320,0,0,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} @@ -1158,6 +1210,7 @@ NEO Coolcam NAS-WR01W {"NAME":"NAS-WR01W","GPIO":[0,0,0,0,288,0,0,0,224,3 NEO Coolcam NAS-WR01W 16A {"NAME":"Neo Coolcam 16","GPIO":[32,0,0,0,2720,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":49} Nestler-matho {"NAME":"N-m 485-1","GPIO":[0,0,0,32,2688,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":18} NETVIP XS-SSA01 {"NAME":"XS-SSA01","GPIO":[0,0,0,0,0,0,0,0,320,32,0,224,0,0],"FLAG":0,"BASE":18} +Nexxt Surge Protector 220V Chile {"NAME":"Nexxt Smart Plug","GPIO":[0,0,0,0,320,1,0,0,32,544,224,0,0,0],"FLAG":0,"BASE":18} NGS Loop Track 16A {"NAME":"LOOP","GPIO":[0,0,320,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} Nightlight and AC Outlet {"NAME":"SWN03","GPIO":[32,0,0,0,0,0,1,1,416,0,0,224,0,0],"FLAG":0,"BASE":18} Nishica SM-PW701I {"NAME":"SM-PW701I","GPIO":[1,1,1,1,1,1,1,1,224,288,32,1,1,1],"FLAG":0,"BASE":18} @@ -1215,12 +1268,12 @@ SilentNight {"NAME":"SilentNightPlug","GPIO":[0,0,0,0,288,0,0,0 Silvergear Slimme Stekker {"NAME":"Silvergear SmartHomePlug","GPIO":[0,0,0,96,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":18} SimpleHome {"NAME":"SimpleHome","GPIO":[289,0,0,0,0,0,0,0,224,320,32,0,0,0],"FLAG":0,"BASE":1} SimpleHome 2 USB {"NAME":"SimpleHome","GPIO":[289,0,0,0,2656,2624,0,0,224,2688,32,0,0,0],"FLAG":0,"BASE":1} +Slitinto Mini 2 in 1 {"NAME":"slitinto NX-SP201","GPIO":[0,0,0,2624,32,2720,0,0,224,33,2656,225,0,0],"FLAG":0,"BASE":18} Slitinto NX-SM110 {"NAME":"Slitinto SM110","GPIO":[0,0,320,0,0,2720,0,0,2624,32,2656,224,0,0],"FLAG":0,"BASE":45} Slitinto NX-SM112 {"NAME":"NX-SM112","GPIO":[576,0,0,2624,0,2720,0,0,0,32,2656,224,0,0],"FLAG":0,"BASE":45} Slitinto NX-SM112 v2 {"NAME":"Slitinto NX SM","GPIO":[320,1,576,1,0,2720,0,0,2624,32,2656,224,0,0],"FLAG":0,"BASE":45} Slitinto NX-SM200 {"NAME":"NX-SM200","GPIO":[0,0,0,32,2720,2656,0,0,0,288,224,2592,0,0],"FLAG":0,"BASE":45} Slitinto NX-SM2001 {"NAME":"NX-SM2001","GPIO":[0,0,0,32,2720,2656,0,0,2624,288,224,0,0,0],"FLAG":0,"BASE":45} -Slitinto NX-SP201 Mini 2 in 1 {"NAME":"Slitinto Dual ","GPIO":[576,0,0,2624,64,2720,0,0,224,65,2656,225,0,0],"FLAG":0,"BASE":18} Slitinto NX-SP202 {"NAME":"Slitinto SP202","GPIO":[32,0,0,0,2720,2656,0,0,2624,288,225,224,65,0],"FLAG":0,"BASE":64} SM-PW701K {"NAME":"SM-PW701K","GPIO":[0,0,0,0,288,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} Smaho {"NAME":"SMAHO WiFi P.","GPIO":[32,0,0,0,2720,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":18} @@ -1248,7 +1301,7 @@ STITCH {"NAME":"Stitch 27937","GPIO":[32,0,320,0,2688,2656 STITCH {"NAME":"Stitch 35511","GPIO":[320,0,321,0,0,2688,0,0,0,32,2656,224,2624,0],"FLAG":0,"BASE":18} STITCH 15A In-Line {"NAME":"Stitch 39047","GPIO":[0,288,0,32,2688,2656,0,0,2624,0,224,0,0,0],"FLAG":0,"BASE":18} STITCH Mini 10A {"NAME":"STITCH 41730","GPIO":[0,0,320,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} -SuperNight Dual {"NAME":"SuperNight Dua","GPIO":[1,32,1,224,2656,2688,0,0,225,2592,322,1,1,4704],"FLAG":0,"BASE":18} +SuperNight Dual {"NAME":"SUPERNIGHT","GPIO":[0,32,0,224,2656,2688,0,0,225,2624,576,0,0,4833],"FLAG":0,"BASE":18} SWA1 {"NAME":"SWA1","GPIO":[0,0,0,0,288,224,0,0,0,32,0,0,0,0],"FLAG":0,"BASE":18} SWA1 FR {"NAME":"SWA1","GPIO":[0,0,0,0,288,224,0,0,0,32,0,0,0,0],"FLAG":0,"BASE":18} SWA1 UK {"NAME":"SWA1","GPIO":[0,0,0,0,288,224,0,0,0,32,0,0,0,0],"FLAG":0,"BASE":18} @@ -1289,6 +1342,7 @@ TP20 {"NAME":"TP20","GPIO":[0,0,0,32,0,0,0,0,0,320,224,0 TP24 {"NAME":"TP24","GPIO":[0,0,0,32,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":18} Treatlife Dimmable {"NAME":"DP20","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 21,2 | SO20 1 | SO54 1"} U10 Series {"NAME":"WIFI-Socket","GPIO":[1,32,1,1,1,1,1,1,1,320,224,1,1,4704],"FLAG":0,"BASE":18} +UltraBrite {"NAME":"UltraBrite Smart Plug","GPIO":[1,1,1,1,288,289,1,1,224,32,1,1,1,1],"FLAG":0,"BASE":18} Ultralink UL-P01W {"NAME":"UL-P01W","GPIO":[0,288,0,32,2720,2656,0,0,2624,544,224,0,0,0],"FLAG":0,"BASE":18} Upstone {"NAME":"UPSTONE","GPIO":[1,1,544,1,320,1,0,0,224,32,1,1,1,1],"FLAG":0,"BASE":18} US212 {"NAME":"US212","GPIO":[320,0,0,2624,0,2720,0,0,224,32,2656,225,0,0],"FLAG":0,"BASE":18} @@ -1309,8 +1363,9 @@ WAZA JH-G01E 10A {"NAME":"Waza JH-G01E","GPIO":[0,0,0,0,288,0,0,0,22 Waza JH-G01E 16A {"NAME":"Waza JH-G01E 2","GPIO":[0,0,0,0,0,0,0,0,32,288,224,0,0,4704],"FLAG":0,"BASE":18} Wily Electronics {"NAME":"VC Plug","GPIO":[544,0,0,0,0,2720,0,0,2624,32,2656,224,0,0],"FLAG":0,"BASE":45} WiOn {"NAME":"WiOn","GPIO":[1,0,288,0,0,0,0,0,1,32,0,224,0,0],"FLAG":0,"BASE":17} +WiOn Single Outlet {"NAME":"WiOn 50050","GPIO":[0,0,576,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18} Wipro 16A {"NAME":"Wip-DSP1160","GPIO":[0,0,0,32,2720,2656,0,0,2624,576,224,0,0,0],"FLAG":0,"BASE":52} -Wisdom ZY_ACU02 {"NAME":"ZY-ACU02","GPIO":[0,0,0,544,225,224,0,0,320,32,321,0,0,0],"FLAG":0,"BASE":18} +Wisdom Dual {"NAME":"ZY-ACU02","GPIO":[0,0,0,544,225,224,0,0,320,32,321,0,0,0],"FLAG":0,"BASE":18} WL-SC01 {"NAME":"WL-SC01","GPIO":[0,0,0,0,320,0,0,0,224,0,32,0,0,0],"FLAG":0,"BASE":1} WOOX R4026 {"NAME":"WOOX R4026","GPIO":[0,0,0,32,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":18} WOOX R4785 {"NAME":"WOOXR4785","GPIO":[0,0,0,0,288,224,0,0,0,32,0,0,0,0],"FLAG":0,"BASE":18} @@ -1329,14 +1384,14 @@ XS-A14 {"NAME":"NETVIP XS-A14","GPIO":[416,0,417,0,0,32,0, XS-A17 {"NAME":"XS-A18","GPIO":[416,0,417,0,0,418,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":45} XS-A18 {"NAME":"XS-A18","GPIO":[416,0,417,0,0,418,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":45} XS-A23 {"NAME":"XS-A23","GPIO":[320,1,0,2624,32,2720,0,0,0,33,2656,224,225,0],"FLAG":0,"BASE":45} -XS-SSA01 {"NAME":"XS-SSA01","GPIO":[0,32,0,0,0,0,0,0,320,160,0,224,0,0],"FLAG":0,"BASE":18} +XS-SSA01 {"NAME":"XS-SSA01","GPIO":[1,0,0,1,0,0,0,0,320,32,1,224,1,0],"FLAG":0,"BASE":18} XS-SSA01 v2 {"NAME":"XS-SSA01","GPIO":[1,32,1,1,1,1,0,0,320,1,1,224,1,0],"FLAG":0,"BASE":18} XS-SSA05 {"NAME":"XS-SSA05","GPIO":[257,1,1,2624,1,2688,0,0,224,32,2656,258,1,4704],"FLAG":0,"BASE":18} XS-SSA06 {"NAME":"XS-SSA06","GPIO":[416,0,417,0,0,418,0,0,0,64,0,224,0,0],"FLAG":0,"BASE":18} Yagala SWA9 {"NAME":"SWA9","GPIO":[0,0,0,0,288,224,0,0,0,32,0,0,0,0],"FLAG":0,"BASE":18} Yelomin JH-G01E {"NAME":"Yelomin","GPIO":[0,3072,0,3104,0,0,0,0,32,320,224,0,0,0],"FLAG":0,"BASE":18} YERON US101 {"NAME":"YERON_US101","GPIO":[1,1,1,32,2688,2656,0,0,2624,320,224,1,1,0],"FLAG":0,"BASE":18} -YM-WS-1 Mini {"NAME":"YM-WS1","GPIO":[0,0,0,0,0,0,0,0,320,32,0,224,0,0],"FLAG":0,"BASE":18} +YM-WS-1 Mini {"NAME":"YM-WS-1-ALT","GPIO":[32,33,34,35,0,0,0,0,0,288,224,0,0,0],"FLAG":0,"BASE":18} YM-WS-3 16A {"NAME":"YM-WS-3","GPIO":[0,32,0,0,0,0,0,0,0,288,224,0,576,4704],"FLAG":0,"BASE":18} YT-E002 {"NAME":"YT-E002","GPIO":[576,0,0,0,33,0,0,0,225,32,0,224,0,0],"FLAG":0,"BASE":18} YT-E003 {"NAME":"YT-E003-SP202","GPIO":[32,0,0,0,2720,2656,0,0,2624,288,225,224,65,0],"FLAG":0,"BASE":64} @@ -1360,6 +1415,7 @@ AHRise 4+4AC+4USB {"NAME":"AHRise-083","GPIO":[0,0,0,0,320,32,0,0,225 AHRise AHR-085 {"NAME":"AHRise AHR-085","GPIO":[0,0,0,0,32,320,0,0,225,226,224,0,0,0],"FLAG":0,"BASE":18} Aicliv 4AC 3USB {"NAME":"Aicliv WiFi","GPIO":[0,0,0,227,226,576,0,0,224,32,225,0,0,0],"FLAG":0,"BASE":18} Ailink 4AC 4USB {"NAME":"Ailink","GPIO":[288,321,0,289,256,32,0,0,258,257,259,0,228,0],"FLAG":0,"BASE":4} +Anhaorui 6+6AC 4USB {"NAME":"Anhaorui ZN-709","GPIO":[320,0,0,160,224,225,0,0,228,229,227,226,0,0],"FLAG":0,"BASE":18,"CMND":"SwitchMode1 5|SO32 10"} Anncoe 4AC 4USB {"NAME":"P-EU4U4S","GPIO":[288,0,0,0,226,227,0,0,0,0,225,224,0,0],"FLAG":0,"BASE":18} Annhome 3AC + 2USB {"NAME":"1200W WiFi SPS","GPIO":[259,0,0,0,321,288,0,0,224,32,225,226,260,0],"FLAG":0,"BASE":18} AOFO 3AC+4USB {"NAME":"AOFO","GPIO":[0,320,0,32,225,224,0,0,0,226,227,0,0,4704],"FLAG":0,"BASE":18} @@ -1389,8 +1445,9 @@ Geeni Surge + Charge 2 USB {"NAME":"Geeni GN-SW023","GPIO":[288,0,0,0,225,224, Geeni SURGE 6-Outlet Surge Protector {"NAME":"Geeni 6 Strip","GPIO":[320,0,0,0,225,224,0,0,227,228,226,229,32,0],"FLAG":0,"BASE":18} Geeni Surge Mini {"NAME":"Geeni-GN-SW004","GPIO":[320,0,0,32,0,0,0,0,225,224,226,0,0,1],"FLAG":0,"BASE":18} Globe 4 Outlet 2 USB {"NAME":"PowerBar","GPIO":[320,0,0,0,227,32,0,0,225,226,224,0,0,1],"FLAG":0,"BASE":18} +Gosund 3+3AC 3USB {"NAME":"Gosund-PM03-T","GPIO":[0,0,576,0,0,259,0,0,224,225,226,0,32,0],"FLAG":0,"BASE":18} Gosund P1 {"NAME":"Gosund_P1","GPIO":[0,3072,544,3104,0,259,0,0,225,226,224,0,32,4704],"FLAG":0,"BASE":18} -Gosund P2 {"NAME":"Gosund P2","GPIO":[0,0,544,0,0,259,0,0,224,225,226,0,32,0],"FLAG":0,"BASE":18} +Gosund P2 {"NAME":"Gosund-PM03-v2","GPIO":[0,0,576,0,0,0,0,0,224,225,226,259,32,0],"FLAG":0,"BASE":18} Gosund WP9 {"NAME":"Gosund WP9","GPIO":[320,291,290,289,0,224,0,0,226,227,225,0,32,0],"FLAG":0,"BASE":18} Hama 4AC 4USB {"NAME":"HamaStrip","GPIO":[0,544,0,32,225,224,0,0,226,227,228,0,0,0],"FLAG":0,"BASE":18} Heyvalue 3AC+3USB {"NAME":"HeyvalueHLT-330","GPIO":[288,0,289,0,227,256,0,0,257,35,258,0,0,0],"FLAG":0,"BASE":18} @@ -1430,6 +1487,7 @@ POWSAV 5+5AC 4USB {"NAME":"POWSAV 5+5AC+4USB","GPIO":[320,0,0,32,224, Prokord 4AC 4USB {"NAME":"PSH-WT003-EU","GPIO":[0,320,0,32,226,227,0,0,225,224,260,0,0,0],"FLAG":0,"BASE":18} S2199EU {"NAME":"S2199EU","GPIO":[0,32,0,288,226,228,0,0,224,227,225,0,0,4704],"FLAG":0,"BASE":18} SA-P402A {"NAME":"SA-P402A","GPIO":[0,32,0,320,226,228,224,227,225,0,0,0,0,4704],"FLAG":0,"BASE":18} +Smart Tech 4AC 4USB {"NAME":"ST-T-SPS1","GPIO":[0,576,320,0,228,225,0,0,227,32,226,224,0,0],"FLAG":0,"BASE":18} STITCH 4 AC, 2 Always-On USB {"NAME":"MP Stitch 34082","GPIO":[320,0,0,0,227,32,0,0,225,226,224,0,0,0],"FLAG":0,"BASE":18} Surge Protector 3AC 2USB {"NAME":"C158","GPIO":[260,0,0,0,261,230,0,0,224,0,225,226,259,0],"FLAG":0,"BASE":18} SWB1 {"NAME":"SWB1","GPIO":[288,0,0,0,0,227,0,0,224,32,225,226,0,0],"FLAG":0,"BASE":18} @@ -1468,7 +1526,7 @@ ZLD64-EU-W {"NAME":"ZLD64-EU-W","GPIO":[0,320,0,32,225,224,0,0 ## RF Gateway ``` -Sonoff RF Gateway 433 {"NAME":"Sonoff Bridge","GPIO":[32,3200,1,3232,1,1,0,0,1,320,1,0,0,0],"FLAG":0,"BASE":25} +Sonoff RF Bridge 433 {"NAME":"Sonoff Bridge","GPIO":[32,3200,1,3232,1,1,0,0,1,320,1,0,0,0],"FLAG":0,"BASE":25} ``` ## RGB @@ -1495,9 +1553,10 @@ Aoycocr JL81 5W 400lm {"NAME":"AoycocrJLB1","GPIO":[0,0,0,0,418,0,0,0,417 Aoycocr Q10CWM BR30 9W 720lm {"NAME":"AoycocrBR30","GPIO":[0,0,0,0,0,418,0,0,417,0,416,419,0,0],"FLAG":0,"BASE":18} Arlec Smart 9.5W 806lm {"NAME":"Arlec RGBWW","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} Arlec Smart 9.5W 806lm {"NAME":"Arlec RGBWW","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} -Athom 15W 1400lm {"NAME":"Athom LB017W","GPIO":[0,0,0,0,416,419,0,0,417,452,418,0,0,0],"FLAG":0,"BASE":1,"CMND":"SO92 1 | DimmerRange 24,100"} +Athom 12W 1000lm {"NAME":"LB03-12W-E27-TAS","GPIO":[0,0,0,0,416,419,0,0,417,452,418,0,0,0],"FLAG":0,"BASE":18,"CMND":"SO92 1 | DimmerRange 24,100"} +Athom 15W 1400lm {"NAME":"LB01-15W-E27-TAS","GPIO":[0,0,0,0,416,419,0,0,417,452,418,0,0,0],"FLAG":0,"BASE":18,"CMND":"SO92 1 | DimmerRange 24 100"} Athom 4.5W 700lm {"NAME":"Athom LB10-5W-TAS","GPIO":[0,0,0,0,416,419,0,0,417,452,418,0,0,0],"FLAG":0,"BASE":18} -Athom 7W 600lm {"NAME":"Athom LB017W","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":1} +Athom 7W 600lm {"NAME":"LB01-7W-E27-TAS","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} Aunics 7W 600lm {"NAME":"Aunics RGBW","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} Avatar 8W 800lm {"NAME":"Avatar 8W RGBCW","GPIO":[1,1,1,1,416,419,1,1,417,420,418,1,1,1],"FLAG":0,"BASE":18} Avatar ALB201W 720lm {"NAME":"AVATAR ALB201W","GPIO":[0,0,0,0,0,418,0,0,417,0,416,419,0,0],"FLAG":0,"BASE":18} @@ -1509,7 +1568,7 @@ Bardi 9W 900lm {"NAME":"Bardi 9W RGBWW","GPIO":[0,0,0,0,417,416,0, BAZZ BR30 650lm {"NAME":"BAZZrgb","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} Beghelli dom-E 14W 1400lm {"NAME":"Beghelli Smart Bulb","GPIO":[0,0,0,0,416,417,0,0,418,419,420,0,0,0],"FLAG":3,"BASE":18,"CMND":"SO37 13"} BlitzWolf w/ remote 850lm {"NAME":"BW-LT27","GPIO":[0,0,0,0,420,417,0,0,418,1088,419,416,0,0],"FLAG":0,"BASE":18} -BNETA 8.5W 800lm {"NAME":"BNETA IO-WIFI60-E27P","GPIO":[0,0,0,0,416,419,0,0,417,452,418,0,0,0],"FLAG":0,"BASE":18} +BNETA 8.5W 800lm {"NAME":"BNETA IO-WIFI60-E27P","GPIO":[0,0,0,0,416,419,0,0,417,452,418,0,0,0],"FLAG":0,"BASE":48} BNETA 8.5W 800lm {"NAME":"OM60/RGBW","GPIO":[0,0,0,0,2912,416,0,0,417,2976,2944,0,0,0],"FLAG":0,"BASE":18} Bomcosy 600lm {"NAME":"Generic","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,4704],"FLAG":0,"BASE":18} Boxlood 9W 900lm {"NAME":"Boxlood 9w 900lm RGBCCT","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} @@ -1517,6 +1576,7 @@ Calex 429004 A60 806lm {"NAME":"Calex E27 RGB ","GPIO":[0,0,0,0,416,419,0, Calex 429008 B35 5W 470lm {"NAME":"Calex E14 RGBW","GPIO":[0,0,0,0,0,0,0,0,4064,0,4032,0,0,0],"FLAG":0,"BASE":18} Calex 5W 350lm Reflector {"NAME":"Calex RGBW","GPIO":[0,0,0,0,0,0,0,0,4064,0,4032,0,0,0],"FLAG":0,"BASE":18} Candle 5W 450lm {"NAME":"Candela","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} +Cleverio 400lm 5.5W {"NAME":"Cleverio 51573","GPIO":[0,0,0,0,0,0,0,0,4064,0,4032,0,0,0],"FLAG":0,"BASE":18} Cleverio 51395 806lm {"NAME":"CleverioE27RGB","GPIO":[0,0,0,0,2944,2912,0,0,417,2976,416,0,0,0],"FLAG":0,"BASE":18} CMARS 4W Reflector {"NAME":"RGBWW GU10","GPIO":[0,0,0,0,419,420,0,0,417,418,416,0,0,1],"FLAG":0,"BASE":18} Connect SmartHome 5W GU5.3 {"NAME":"CSH-GU53RGB5W","GPIO":[0,0,0,0,419,420,0,0,417,418,416,0,0,0],"FLAG":0,"BASE":18} @@ -1572,6 +1632,7 @@ Legelite 5W Candle {"NAME":"Legelite E12","GPIO":[0,0,0,0,416,419,0,0, Legelite A60 7W {"NAME":"Legelite A60 7","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} Legelite A60 7W 600lm {"NAME":"Legelite E26","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} Lenovo 800lm {"NAME":"Lenovo SE-241EB","GPIO":[0,0,0,0,416,419,0,0,417,452,418,0,0,0],"FLAG":0,"BASE":18} +Lloyd's 5W 400Lm {"NAME":"LLOYDS LC-1271","GPIO":[160,0,0,0,0,0,0,0,4064,0,4032,0,0,0],"FLAG":0,"BASE":18} Lohas ZN004 8W 680lm {"NAME":"Lohas B22 R63","GPIO":[0,0,0,0,417,416,0,0,420,418,419,0,0,0],"FLAG":0,"BASE":18} Lohas ZN011 5W 420lm {"NAME":"LohasZN011","GPIO":[0,0,0,0,417,416,0,0,420,418,419,0,0,0],"FLAG":0,"BASE":18} Lohas ZN014-2 5W 380lm {"NAME":"Lohas ZN014-2","GPIO":[0,0,0,0,417,416,0,0,420,418,419,0,0,0],"FLAG":0,"BASE":18} @@ -1640,7 +1701,7 @@ Teckin SB50 v3 A19 800lm {"NAME":"Teckin SB50v3","GPIO":[0,0,0,0,416,419,0,0 Teckin SB53 1300lm {"NAME":"Teckin SB53","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} Treatlife A19 8W 650lm {"NAME":"Treatlife RGBW","GPIO":[0,0,0,0,417,416,0,0,420,418,419,0,0,0],"FLAG":0,"BASE":18} V-TAC 10W 806lm {"NAME":"V-TAC VT-5119","GPIO":[0,0,0,0,4032,0,0,0,0,0,4064,0,0,0],"FLAG":0,"BASE":18} -V-Tac PAR16 4.5W 400lm 100 {"NAME":"V-TAC VT5164","GPIO":[0,0,0,0,0,0,0,0,4064,0,4032,0,0,0],"FLAG":0,"BASE":18} +V-Tac PAR16 4.5W 400lm 100� {"NAME":"V-TAC VT5164","GPIO":[0,0,0,0,0,0,0,0,4064,0,4032,0,0,0],"FLAG":0,"BASE":18} Vizia 5W GU10 {"NAME":"Vizia RGBWW","GPIO":[0,0,0,0,419,420,0,0,417,418,416,0,0,1],"FLAG":0,"BASE":18} WdtPro 8W 800lm {"NAME":"WdtPro","GPIO":[0,0,0,0,419,420,0,0,417,418,416,0,0,0],"FLAG":0,"BASE":18} Wipro Garnet 9W 810lm {"NAME":"Wipro","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} @@ -1725,7 +1786,7 @@ Kainsy 600lm {"NAME":"KAINSY","GPIO":[32,0,0,0,3008,3040,0,0,0,0 Kkmoon 9W 800lm {"NAME":"KKMOON V21","GPIO":[0,0,0,0,419,0,0,0,417,418,416,0,0,0],"FLAG":0,"BASE":18} Koaanw 650lm {"NAME":"KOAANW Bulb","GPIO":[0,0,0,0,3008,3040,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":27} Kogan 10W Ambient 1050lm {"NAME":"Kogan RGB","GPIO":[0,0,0,0,2912,416,0,0,0,0,2944,0,0,0],"FLAG":0,"BASE":18} -Kogan 4.5W 330lm 110 {"NAME":"Kogan_GU10","GPIO":[0,0,0,0,418,419,0,0,416,0,417,0,0,0],"FLAG":0,"BASE":18} +Kogan 4.5W 330lm 110� {"NAME":"Kogan_GU10","GPIO":[0,0,0,0,418,419,0,0,416,0,417,0,0,0],"FLAG":0,"BASE":18} Kogan Ambient Candle {"NAME":"Kogan_E14","GPIO":[0,0,0,0,416,419,0,0,417,0,418,0,0,0],"FLAG":0,"BASE":18} Kuled 800lm {"NAME":"KULED 60W RGB","GPIO":[0,0,0,0,418,419,0,0,416,0,417,0,0,4704],"FLAG":0,"BASE":18} Laideyi 7W {"NAME":"7W-E14-RGBW-La","GPIO":[0,0,0,0,417,416,0,0,418,0,419,0,0,0],"FLAG":0,"BASE":18} @@ -1829,11 +1890,14 @@ Zilotek A19 800lm {"NAME":"Zilotek RGBW","GPIO":[0,0,0,0,2912,416,0,0 ## Relay Board ``` +2 Channel Tuya {"NAME":"TY-DIY-S02","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 11,1 | TuyaMCU 12,2 | TuyaMCU 13,13 | TuyaMCU 1,101"} Anmbest 2 Channel Inching Self-locking Switch Module {"NAME":"Generic","GPIO":[32,1,1,1,1,225,33,0,224,320,0,0,0,0],"FLAG":0,"BASE":1} +Aptinex IOT RelayNode 4 Channel {"NAME":"APTINEX","GPIO":[0,0,1,0,0,0,0,0,224,225,226,227,0,0],"FLAG":0,"BASE":18} Armtronix Quad {"NAME":"Armtronix Wifi Four Relay Board","GPIO":[1,0,0,0,224,1,0,0,225,226,227,0,1,0],"FLAG":0,"BASE":7} Athom 1Ch Inching/Self-locking {"NAME":"Athom R01","GPIO":[1,1,1,1,1,224,1,1,1,1,1,1,576,0],"FLAG":0,"BASE":18} Athom 8Ch Inching/Self-locking 10A {"NAME":"Athom R08","GPIO":[229,1,1,1,230,231,1,1,226,227,225,228,224,0],"FLAG":0,"BASE":18} Claudy 5V {"NAME":"CLAUDY","GPIO":[0,0,225,0,0,0,0,0,0,0,0,224,0,0],"FLAG":0,"BASE":18} +Devantech 8x16A {"NAME":"ESP32LR88","GPIO":[0,0,231,0,32,35,0,0,229,230,228,0,33,34,36,37,0,38,39,544,0,225,226,227,0,0,0,0,0,224,3232,3200,0,0,0,0],"FLAG":0,"BASE":1} DoHome HomeKit DIY Switch {"NAME":"DoHome DIY","GPIO":[1,1,0,1,1,544,0,0,224,0,0,0,0,0],"FLAG":0,"BASE":1} Eachen ST-DC2 {"NAME":"Garage Control","GPIO":[162,0,0,0,226,225,33,0,224,288,163,227,0,4704],"FLAG":0,"BASE":18} Eachen ST-DC4 {"NAME":"Eachen_ST-DC4","GPIO":[160,1,1,1,226,225,1,1,224,544,1,227,1,0],"FLAG":0,"BASE":54} @@ -1847,11 +1911,12 @@ ESP-12F 5V/7-28V 4 Channel 30A {"NAME":"ESP12F_Relay_30A_X4","GPIO":[1,1,1,1,32 ESP-12F 5V/7-28V 8 Channel {"NAME":"ESP12F_Relay_X8","GPIO":[229,1,1,1,230,231,0,0,226,227,225,228,224,1],"FLAG":0,"BASE":18} ESP-12F 5V/7-30V/220V 4 Channel {"NAME":"ESP12F_Relay_X4","GPIO":[1,1,320,1,1,321,1,1,226,227,225,1,224,1],"FLAG":0,"BASE":18} ESP-12F 5V/8-80V 2 Channel {"NAME":"LC-Relay-ESP12-2R-D8","GPIO":[1,1,1,1,224,225,1,1,1,1,1,1,1,1],"FLAG":0,"BASE":18} -ESP32 4 Channel {"NAME":"RobotDyn ESP32R4","GPIO":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,224,225,1,227,226,32,33,34,35],"FLAG":0,"BASE":1} +ESP32 4 Channel {"NAME":"RobotDyn ESP32R4","GPIO":[0,0,1,0,1,1,0,0,1,1,1,1,1,1,1,1,0,0,0,1,0,224,225,0,0,0,0,0,227,226,32,33,34,0,0,35],"FLAG":0,"BASE":2} eWeLink PSF-B04 5V 7-32V 4 Channel {"NAME":"eWeLink 4CH","GPIO":[160,0,0,0,226,225,161,162,224,288,163,227,0,0],"FLAG":0,"BASE":18} Geekcreit 5V DIY 4 Channel Jog Inching Self-Locking {"NAME":"Geekcreit-4ch","GPIO":[160,0,0,0,226,225,161,162,224,288,163,227,0,0],"FLAG":0,"BASE":18} Geekcreit Module 220V 10A {"NAME":"DIY ESP8266 Re","GPIO":[0,0,544,0,224,32,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18} HW-622 ESP8266 {"NAME":"HW-622","GPIO":[0,0,544,0,224,32,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18} +Kincony 8 Channel {"NAME":"KC868-A8","GPIO":[32,0,1120,0,640,608,0,0,0,1,1,1152,0,0,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,1],"FLAG":0,"BASE":1,"CMND":"EthClockMode 3 | EthAddress 0 | EthType 0 | I2CDriver2 1"} Kincony IR+RF 4 Channel {"NAME":"KC868-A4","GPIO":[32,0,227,0,224,225,0,0,0,1312,1,226,0,0,480,1152,0,1120,1056,1088,0,1,1,1,0,0,0,0,4706,4707,4704,4705,1,0,0,1],"FLAG":0,"BASE":1} LC Technology 12V 4 Channel {"NAME":"LC Technology 4CH Relay","GPIO":[224,0,225,0,226,227,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18} LC Technology 5V 2 Channel {"NAME":"LC-ESP01-2R-5V","GPIO":[0,3200,0,3232,0,0,0,0,224,225,0,0,0,0],"FLAG":0,"BASE":18} @@ -1865,18 +1930,13 @@ Mhcozy 5V {"NAME":"Portail","GPIO":[160,0,0,0,0,0,0,0,224,320 Sinilink DC5V Module {"NAME":"Sinilink XY-WF5V","GPIO":[0,0,0,0,224,1,0,0,32,288,0,0,1,0],"FLAG":0,"BASE":18} Sinilink DC6-36V Module {"NAME":"Sinilink XY-WF5V","GPIO":[0,0,0,0,224,1,0,0,32,288,0,0,1,0],"FLAG":0,"BASE":18} Sinilink MOS {"NAME":"Sinilink MOS","GPIO":[0,0,576,0,224,1,0,0,32,288,0,0,0,0],"FLAG":0,"BASE":18} +Sinilink Thermostat {"NAME":"XY-WFT1","GPIO":[0,0,544,0,480,224,0,0,320,1,32,0,0,4736],"FLAG":0,"BASE":18,"CMND":"BuzzerPwm 1"} Sonoff 1 Channel Inching/Self-Locking {"NAME":"1 Channel","GPIO":[32,0,0,0,0,0,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":12} Sonoff RE5V1C 5V Inching/Selflock {"NAME":"Sonoff RE5V1C","GPIO":[32,1,1,1,1,1,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":18} Sonoff SV {"NAME":"Sonoff SV","GPIO":[32,1,0,1,1,1,0,0,224,320,1,0,0,4704],"FLAG":0,"BASE":3} Yunshan 7-30V 10A {"NAME":"Yunshan 10A","GPIO":[32,1,288,1,224,161,0,0,225,0,0,0,0,0],"FLAG":0,"BASE":18} ``` -## Relay Module -``` -PPA Contatto Wi-Fi {"NAME":"PPA Contatto","GPIO":[0,0,32,0,224,162,0,0,288,225,0,0,0,0],"FLAG":0,"BASE":18} -Shelly Plus 1 {"NAME":"Shelly Plus 1 ","GPIO":[0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1} -``` - ## Siren ``` Connex Smart Indoor {"NAME":"Connex Siren","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} @@ -1900,7 +1960,7 @@ SmartBase E0260 {"NAME":"SmartBaseE0260","GPIO":[0,0,0,0,320,0,0,0, ## Switch ``` -3 Way Smart Light {"NAME":"Nexete KS-602F 3-Way","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54} +3 Way Smart Light {"NAME":"KS-602F","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54} 3A Smart Home {"NAME":"3A Smart Home ","GPIO":[544,0,290,33,225,34,0,0,32,224,289,226,288,0],"FLAG":0,"BASE":18} AGL 2 Gang {"NAME":"AGL WiFi 02","GPIO":[0,0,544,0,0,33,0,0,225,224,0,0,32,0],"FLAG":0,"BASE":18} AGL 3 Gang {"NAME":"AGL WiFi 03","GPIO":[0,0,544,0,34,33,0,0,225,224,226,0,32,0],"FLAG":0,"BASE":18} @@ -1908,12 +1968,16 @@ Aoycocr SW1 {"NAME":"Aoycocr SW1","GPIO":[576,1,321,1,1,1,1,1,3 Athom 1 Gang {"NAME":"Athom SW011EU","GPIO":[576,0,0,32,0,0,0,0,0,224,288,0,0,0],"FLAG":0,"BASE":1} Athom 1 Gang {"NAME":"Athom SW031US","GPIO":[576,0,0,32,0,0,0,0,0,224,288,0,0,0],"FLAG":0,"BASE":1} Athom 1 Gang No Neutral {"NAME":"Athom SW111EU","GPIO":[576,0,0,32,0,0,0,0,0,224,288,0,0,0],"FLAG":0,"BASE":1} +Athom 1 Gang No Neutral Touch {"NAME":"Athom SW33-1US","GPIO":[576,0,0,32,0,0,0,0,0,224,288,0,0,0],"FLAG":0,"BASE":18} Athom 2 Gang {"NAME":"Athom SW012EU","GPIO":[576,289,0,32,225,33,0,0,0,224,288,0,0,0],"FLAG":0,"BASE":1} Athom 2 Gang {"NAME":"Athom SW032US","GPIO":[576,289,0,32,225,33,0,0,0,224,288,0,0,0],"FLAG":0,"BASE":1} Athom 2 Gang No Neutral {"NAME":"Athom SW112EU","GPIO":[576,289,0,32,225,33,0,0,0,224,288,0,0,0],"FLAG":0,"BASE":1} +Athom 2 Gang No Neutral Touch {"NAME":"Athom SW33-2US","GPIO":[576,289,0,32,225,33,0,0,0,224,288,0,0,0],"FLAG":0,"BASE":18} Athom 3 Gang Key {"NAME":"Athom SW01-TAS-3EU","GPIO":[576,290,1,33,225,34,0,0,32,224,289,226,288,0],"FLAG":0,"BASE":18} +Athom 3 Gang No Neutral Touch {"NAME":"Athom SW33-3US","GPIO":[576,290,0,33,225,34,0,0,32,224,289,226,288,0],"FLAG":0,"BASE":18} Athom 3 Gang Touch {"NAME":"Athom SW03-TAS-3US","GPIO":[576,290,0,33,225,34,0,0,32,224,289,226,288,0],"FLAG":0,"BASE":18} Athom 3 Gang Touch {"NAME":"Athom SW11-TAS-3EU","GPIO":[576,290,1,33,225,34,0,0,32,224,289,226,288,0],"FLAG":0,"BASE":18} +Athom 4 Gang No Neutral Touch {"NAME":"Athom SW33-4US","GPIO":[576,0,0,33,225,34,0,0,32,224,227,226,35,0],"FLAG":0,"BASE":18} Athom 4 Gang Touch {"NAME":"Athom SW03-TAS-4US","GPIO":[576,0,0,33,225,34,0,0,32,224,227,226,35,0],"FLAG":0,"BASE":18} Athom 4 Gang Touch {"NAME":"Athom SW11-TAS-4EU","GPIO":[576,0,0,33,225,34,0,0,32,224,227,226,35,0],"FLAG":0,"BASE":18} Athom US Key Switch 1 Gang {"NAME":"Athom SW13","GPIO":[576,0,0,32,0,0,0,0,0,224,288,0,0,0],"FLAG":0,"BASE":1} @@ -1954,9 +2018,10 @@ Eachen CD303 3 Gang {"NAME":"ID Components","GPIO":[544,289,0,162,224,1 Eachen SWT-2Gang {"NAME":"ID Components","GPIO":[544,1,1,1,1,161,1,1,160,224,289,225,288,1],"FLAG":0,"BASE":18} Earda 3-Way {"NAME":"ESW-1WAA-US","GPIO":[160,0,0,0,320,0,0,0,0,224,0,0,0,0],"FLAG":0,"BASE":18} Enjowi WF-SK301 {"NAME":"Tuya 3 Channel","GPIO":[0,0,0,0,226,33,0,0,32,224,34,225,544,0],"FLAG":0,"BASE":18} +Esooli 1 Gang {"NAME":"Esooli 1G","GPIO":[0,288,0,0,0,32,0,0,224,0,0,0,0,0],"FLAG":0,"BASE":1} Esooli 2 Gang 1 Way {"NAME":"Esooli 2 gang","GPIO":[0,288,0,32,33,0,0,0,0,224,225,0,0,0],"FLAG":0,"BASE":1} -Etekcity ESWL01 {"NAME":"EtekCityESWL01","GPIO":[0,1,0,1,288,289,0,0,0,224,96,0,0,4704],"FLAG":0,"BASE":18} -Etekcity ESWL03 3-way {"NAME":"Etekcity 3Way","GPIO":[0,0,0,0,226,256,0,0,192,225,161,0,0,0],"FLAG":0,"BASE":18} +Etekcity {"NAME":"EtekCityESWL01","GPIO":[0,1,0,1,288,289,0,0,0,224,96,0,0,4704],"FLAG":0,"BASE":18} +Etekcity 3-way {"NAME":"Etekcity 3Way","GPIO":[0,0,0,0,226,256,0,0,192,225,161,0,0,0],"FLAG":0,"BASE":18} Eva Logik 3-Way {"NAME":"WF30 Switch","GPIO":[0,0,0,0,33,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} FrankEver 4 Gang {"NAME":"FrankEver Wifi Smart Switch","GPIO":[0,0,0,32,224,33,1,1,34,226,227,225,35,0],"FLAG":0,"BASE":18} Freecube {"NAME":"Freecube","GPIO":[288,0,289,0,0,0,0,0,290,32,0,224,0,0],"FLAG":0,"BASE":18} @@ -1998,7 +2063,6 @@ Kuled K36 {"NAME":"KULED-B","GPIO":[160,1,1,1,1,1,224,288,256 Kuled KS602S {"NAME":"KULED","GPIO":[32,1,1,1,1,1,0,0,224,320,1,1,1,0],"FLAG":0,"BASE":18} Kygne CD-301 {"NAME":"KYGNE Touch","GPIO":[0,0,0,0,288,289,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":10} Laghten SS02S {"NAME":"Laghten SS02S","GPIO":[0,0,0,0,288,321,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} -Lanbon L8 5 in 1 LCD Touch {"NAME":"Lanbon L8","GPIO":[0,0,0,0,0,992,0,0,224,0,225,0,0,0,1024,896,0,6624,6592,864,0,832,416,226,0,0,0,0,417,418,0,352,0,0,0,4736],"FLAG":0,"BASE":1} LCARE Modular 2 Gang {"NAME":"2SW1-In","GPIO":[32,1,1,1,0,225,33,0,224,320,0,0,0,0],"FLAG":0,"BASE":29} LerLink 1 Gang No Neutral {"NAME":"LerLink X801-L","GPIO":[0,0,0,0,32,0,0,0,224,320,0,0,0,1],"FLAG":0,"BASE":18} Lerlink 2 Gang {"NAME":"Lerlink X802A","GPIO":[0,0,0,33,32,0,0,0,224,288,225,0,0,0],"FLAG":0,"BASE":18} @@ -2007,7 +2071,7 @@ Lerlink 3 Gang {"NAME":"X803A","GPIO":[0,0,0,33,32,34,0,0,224,259, Lerlink 3 Gang {"NAME":"X803A","GPIO":[0,0,0,33,32,34,0,0,224,288,225,226,0,0],"FLAG":0,"BASE":18} Lerlink 3 Gang No Neutral {"NAME":"X803K-L 3 Gang","GPIO":[0,0,320,0,32,34,33,0,224,0,225,226,0,0],"FLAG":0,"BASE":18} Lightstory WT02S {"NAME":"WT02S","GPIO":[0,0,0,0,321,320,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":50} -Linkind 2-Way Single Pole {"NAME":"Linkind WS240010008","GPIO":[0,0,0,0,0,224,0,0,0,0,288,0,0,0,0,0,0,0,0,0,0,576,321,0,0,0,0,0,33,32,0,0,0,0,0,0],"FLAG":0,"BASE":1} +Linkind 2-Way {"NAME":"Linkind WS240010008","GPIO":[0,0,0,0,0,224,0,0,0,0,288,0,0,0,0,0,0,0,0,0,0,576,321,0,0,0,0,0,33,32,0,0,0,0,0,0],"FLAG":0,"BASE":1} Lonsonho SK3-01 {"NAME":"Tuya 1 Channel","GPIO":[0,0,0,0,0,32,0,0,0,0,0,224,288,0],"FLAG":0,"BASE":18} Lonsonho SK3-02 {"NAME":"Tuya 2 Channel","GPIO":[0,0,0,0,225,0,0,0,32,224,33,0,288,0],"FLAG":0,"BASE":18} Lonsonho SK3-03 {"NAME":"Tuya 3-ch v2","GPIO":[544,322,0,33,225,34,0,0,32,224,321,226,320,0],"FLAG":0,"BASE":18} @@ -2043,6 +2107,7 @@ Moes BS-US-W Boiler {"NAME":"BS-US-W","GPIO":[290,0,0,32,224,0,0,0,0,0, Moes Light and Fan {"NAME":"Moes WF-FL01","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} Moes RF433 2 Gang Switch {"NAME":"WS-EUB2-WR","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} Moes RF433 3 Gang {"NAME":"WS-EUB3-WR","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54} +Moes RF433 3 Gang Touch {"NAME":"WS-EU-RF","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 11,1 | TuyaMCU 12,2 | TuyaMCU 13,3"} Moes SS01S-1 {"NAME":"Moes Switch","GPIO":[1,1,1,1,320,0,0,0,224,32,1,1,1,0],"FLAG":0,"BASE":18} Moes WS-EU1-LB 1 Gang No Neutral {"NAME":"Moes WS-EU1-LB","GPIO":[0,0,0,0,0,32,0,0,0,0,0,224,544,0],"FLAG":0,"BASE":18} Moes WS-EU2-LW 2 Gang No Neutral {"NAME":"Tuya 2 Channel","GPIO":[0,0,0,0,225,0,0,0,32,224,33,0,544,0],"FLAG":0,"BASE":18} @@ -2080,6 +2145,7 @@ Sesoo WIFI-EU-SK3-02 {"NAME":"Sesoo SK3-02","GPIO":[0,0,321,0,225,0,0,0, Sesoo WIFI-US-SK3-04 {"NAME":"Tuya 4 Channel","GPIO":[288,1,1,34,226,32,0,0,35,227,225,224,33,0],"FLAG":0,"BASE":18} Shawader 1Ch Touch Light {"NAME":"ShawaderTuya1C","GPIO":[0,0,0,0,0,32,0,0,0,0,0,224,288,0],"FLAG":0,"BASE":18} Shawader 2Ch Touch Light {"NAME":"ShawaderTuya2C","GPIO":[0,0,0,0,224,0,0,0,33,225,32,0,288,0],"FLAG":0,"BASE":18} +Shawader 3Ch Touch Light {"NAME":"ShawaderTuya3C","GPIO":[0,3872,0,66,64,65,0,0,225,226,224,0,0,0],"FLAG":0,"BASE":18} SK-A801-01-US 1 Gang {"NAME":"jsankou US Switch 1 Gang","GPIO":[544,0,0,0,0,0,0,0,32,256,0,0,0,0],"FLAG":0,"BASE":18} SK-W803-01-US 3 Gang {"NAME":"jsankou US Switch 3 Gang","GPIO":[544,0,0,33,257,34,0,0,32,256,0,258,0,0],"FLAG":0,"BASE":18} Smartlife Opard CD302 {"NAME":"CD302","GPIO":[0,0,0,0,288,321,0,0,256,32,0,0,0,0],"FLAG":0,"BASE":18} @@ -2106,6 +2172,7 @@ Sonoff TX T1 EU 1 Gang {"NAME":"Sonoff T1 TX 1CH","GPIO":[32,1,1,1,0,0,0,0 Sonoff TX T1 EU 2 Gang {"NAME":"Sonoff T1 TX 2CH","GPIO":[32,1,1,1,0,225,33,0,224,320,0,0,0,0],"FLAG":0,"BASE":29} Sonoff TX T2 EU 1 Gang {"NAME":"Sonoff T2 TX 1CH","GPIO":[32,1,1,1,0,0,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":28} Sonoff TX T2 EU 2 Gang {"NAME":"Sonoff T2 TX 2CH","GPIO":[32,1,1,1,0,225,33,0,224,320,0,0,0,0],"FLAG":0,"BASE":29} +Sonoff TX T2 UK 2 Gang {"NAME":"Sonoff T1 TX 2CH","GPIO":[32,1,1,1,0,225,33,0,224,448,0,0,0,0],"FLAG":0,"BASE":29} Sonoff TX T3 EU 1 Gang {"NAME":"Sonoff T3 TX 1CH","GPIO":[32,1,1,1,0,0,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":28} Sonoff TX T3 EU 2 Gang {"NAME":"Sonoff T3 TX 2CH","GPIO":[32,1,1,1,0,225,33,0,224,320,0,0,0,0],"FLAG":0,"BASE":29} Sonoff TX T3 EU 3 Gang {"NAME":"TX T3EU3C","GPIO":[32,1,0,1,226,225,33,34,224,576,0,0,0,0],"FLAG":0,"BASE":30} @@ -2120,7 +2187,7 @@ SSMS118-01A1 Scene Light Smart {"NAME":"RGB Switch","GPIO":[257,0,259,161,418,4 Steren Apagador {"NAME":"SHOME-115","GPIO":[32,0,0,0,0,0,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":18} Steren Apagador Doble {"NAME":"STEREN SHOME-116","GPIO":[0,0,288,0,0,32,0,0,224,225,0,0,33,0],"FLAG":0,"BASE":18} Steren Apagador Triple {"NAME":"STEREN SHOME-117","GPIO":[0,0,288,0,34,32,0,0,224,225,226,0,33,0],"FLAG":0,"BASE":18} -STITCH {"NAME":"Tuya WF15S ","GPIO":[1,1,0,0,1,1,0,0,1,2304,1,2272,0,0],"FLAG":0,"BASE":54} +STITCH {"NAME":"Tuya WF15S ","GPIO":[0,0,0,0,0,0,0,0,0,2304,0,2272,0,0],"FLAG":0,"BASE":54} TCP Smart 1 Gang {"NAME":"TCP 1 Gang 1 Way","GPIO":[544,0,0,32,224,0,0,0,0,0,320,0,0,0],"FLAG":0,"BASE":18} Teckin 2 Gang {"NAME":"Teckin SR43","GPIO":[0,0,288,0,0,32,0,0,224,225,0,0,33,0],"FLAG":0,"BASE":18} Teckin SR-41 Single Pole {"NAME":"Teckin SR-41","GPIO":[32,0,0,0,0,0,0,0,224,576,0,0,0,0],"FLAG":0,"BASE":18} @@ -2134,10 +2201,10 @@ TopGreener Scene Controller {"NAME":"TGWF15RM","GPIO":[0,2272,0,2304,0,0,0,0,0, TopGreener TGWF15S {"NAME":"TopGreener-Switch","GPIO":[0,0,0,0,0,0,0,0,0,2304,0,2272,0,0],"FLAG":0,"BASE":54} Touch 3 Gang {"NAME":"Switch 3-Gang","GPIO":[0,0,0,0,226,33,0,0,32,224,34,225,544,0],"FLAG":0,"BASE":18} Touch Light Switch 1 Gang {"NAME":"Smart Touch Light Switch ","GPIO":[0,0,0,0,0,32,1,1,0,0,0,224,320,0],"FLAG":0,"BASE":18} +TreatLife {"NAME":"TL SS01S Swtch","GPIO":[0,0,0,0,288,576,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} +Treatlife 3-Way {"NAME":"Treatlife SS01 3-Way","GPIO":[0,0,0,0,224,576,0,0,225,33,160,0,0,0],"FLAG":0,"BASE":18} TreatLife 3-Way {"NAME":"Treatlife 3-Way","GPIO":[0,0,0,0,224,576,0,0,225,33,160,0,0,0],"FLAG":0,"BASE":18} -Treatlife SS01 3-Way {"NAME":"Treatlife SS01 3-Way","GPIO":[0,0,0,0,224,576,0,0,225,33,160,0,0,0],"FLAG":0,"BASE":18} -TreatLife SS01S {"NAME":"TL SS01S Swtch","GPIO":[0,0,0,0,288,576,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} -TreatLife SS02S {"NAME":"Treatlife SS02","GPIO":[0,0,0,0,288,576,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} +TreatLife Single Pole ON/OFF {"NAME":"Treatlife SS02","GPIO":[0,0,0,0,288,576,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} Tuya 3 Gang {"NAME":"KING-Tuya-key","GPIO":[0,0,0,0,226,225,0,0,224,32,34,0,33,0],"FLAG":0,"BASE":18} TY-US-L1-W {"NAME":"TY-US-L1-W","GPIO":[0,0,0,0,0,32,0,0,0,224,0,0,576,0],"FLAG":0,"BASE":18} TY-US-L3-W {"NAME":"TY-US-L3-W","GPIO":[0,0,0,0,224,33,0,0,34,226,32,225,576,1],"FLAG":0,"BASE":18} @@ -2148,6 +2215,7 @@ Vaticas 1 {"NAME":"Vaticas","GPIO":[0,0,0,32,224,0,0,0,0,0,28 VHome RF433 1 Gang {"NAME":"VH-TW-CL-01","GPIO":[0,0,0,0,0,32,0,0,0,0,0,224,544,1],"FLAG":0,"BASE":18} VHome RF433 2 Gang {"NAME":"VX-TW-CL-002","GPIO":[0,0,0,0,224,0,0,0,33,225,32,0,544,1],"FLAG":0,"BASE":18} vhome RF433 3 Gang {"NAME":"VH-TB-US-003","GPIO":[0,0,0,0,224,33,0,0,34,226,32,225,576,1],"FLAG":0,"BASE":18} +Virage Labs VirageSwitch Light {"NAME":"VirageSwitch","GPIO":[32,0,0,0,0,0,0,0,224,288,0,0,0,0],"FLAG":0,"BASE":18} Wall Touch Switch 2 Gang {"NAME":"VOVOWAY 120-WIFI-RF 2GANG","GPIO":[0,0,289,0,225,0,0,0,32,224,33,0,288,0],"FLAG":0,"BASE":18} Welaik 2-Gang 1-Way "Not available" WiFi Smart Switch 2 Gang {"NAME":"Kingart N2","GPIO":[32,1,0,1,0,225,33,0,224,0,0,0,0,1],"FLAG":0,"BASE":18} @@ -2178,7 +2246,7 @@ ZUCZUG 3 Gang {"NAME":"2ph105626a x3","GPIO":[0,288,0,32,34,33,0, ``` AGL Modulo Relay 01 Canal {"NAME":"AGL-Basic","GPIO":[0,1,0,0,224,32,0,0,0,0,320,0,0,0],"FLAG":0,"BASE":18} Albohes 2 Channel {"NAME":"Albohes SH-08","GPIO":[0,3200,33,3232,321,320,0,0,224,544,32,0,225,1],"FLAG":0,"BASE":18} -Athom 10A {"NAME":"Athom CB0110A","GPIO":[0,0,0,0,320,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":1} +Athom 10A {"NAME":"CB01-TAS-1","GPIO":[0,0,0,32,576,0,0,0,0,224,160,0,0,1],"FLAG":0,"BASE":18} Athom 2Ch Inching/Self-locking {"NAME":"Athom R02","GPIO":[1,1,1,1,225,224,1,1,1,1,1,1,576,0],"FLAG":0,"BASE":18} Athom 3-Way Mini Relay {"NAME":"RS01-TAS-1","GPIO":[0,0,0,32,576,0,0,0,0,224,160,0,0,0],"FLAG":0,"BASE":18} Athom 4Ch Inching/Self-locking 10A {"NAME":"Athom R04","GPIO":[1,1,1,1,32,576,1,1,226,227,225,1,224,0],"FLAG":0,"BASE":18} @@ -2202,6 +2270,7 @@ Ener-J Outdoor Switch {"NAME":"Ener-J Smart WiFi Outdoor Relay","GPIO":[3 eWelink No Neutral {"NAME":"SA-018","GPIO":[0,0,0,0,160,0,0,0,224,288,0,0,0,0],"FLAG":0,"BASE":18} EX Store 2 Kanal V5 {"NAME":"EXS Relay V5","GPIO":[1,1,1,1,1,1,0,0,224,225,258,288,259,0],"FLAG":0,"BASE":16} Geekcreit 2 Channel AC 85V-250V {"NAME":"Geekcreit 2ch","GPIO":[32,0,0,0,0,225,33,0,224,288,0,0,0,4704],"FLAG":0,"BASE":18} +Gosund SW3 {"NAME":"Gosund WP3","GPIO":[0,0,0,32,0,0,0,0,320,321,224,0,0,0],"FLAG":0,"BASE":18} HomeMate 4 Node In-wall {"NAME":"HomeMate Wifi 4N ","GPIO":[1,1,1,160,224,163,1,1,161,225,226,227,162,1],"FLAG":0,"BASE":18} L-5A01 {"NAME":"L-5A01","GPIO":[32,1,0,1,0,0,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":1} LoraTap 10A {"NAME":"LoraTap RR400W","GPIO":[0,0,0,0,544,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} @@ -2211,17 +2280,20 @@ Luani HVIO {"NAME":"Luani HVIO","GPIO":[0,1,1,1,224,225,0,0,16 Milfra Smart {"NAME":"Milfra Smart Module TB41","GPIO":[576,0,0,225,2688,2656,0,0,2592,193,480,224,192,0],"FLAG":0,"BASE":18} Moes {"NAME":"Moes MS-104B","GPIO":[0,0,32,0,480,0,0,0,161,160,224,225,0,0],"FLAG":0,"BASE":18} Nova Digital Basic 1 MS101 {"NAME":"NovaDigBasic1","GPIO":[0,1,0,1,320,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} +PPA Contatto Wi-Fi {"NAME":"PPA Contatto","GPIO":[0,0,32,0,224,162,0,0,288,225,0,0,0,0],"FLAG":0,"BASE":18} PS-1604 16A {"NAME":"PS-1604 16A","GPIO":[32,1,1,1,1,0,0,0,224,320,1,0,0,0],"FLAG":0,"BASE":1} QS-WIFI-S03 {"NAME":"QS-WIFI-S03","GPIO":[32,1,1,1,1,0,0,0,192,224,0,0,0,0],"FLAG":0,"BASE":1} QS-WIFI-S05 {"NAME":"QS-WIFI-S05","GPIO":[32,1,1,1,1,0,0,0,192,224,0,0,0,0],"FLAG":0,"BASE":1} Qualitel Breaker {"NAME":"Qualitel Smart Switch","GPIO":[0,0,0,0,224,0,0,0,32,321,288,0,0,0],"FLAG":0,"BASE":18} -Shelly 1 {"NAME":"Shelly 1","GPIO":[0,0,0,0,224,192,0,0,0,0,0,0,0,4736],"FLAG":0,"BASE":46} +Shelly 1 {"NAME":"Shelly 1","GPIO":[1,1,0,1,224,192,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":46} Shelly 1L No Neutral {"NAME":"Shelly 1L","GPIO":[320,0,0,0,192,224,0,0,0,0,193,0,0,4736],"FLAG":0,"BASE":18} Shelly 1PM {"NAME":"Shelly 1PM","GPIO":[320,0,0,0,192,2720,0,0,0,0,0,224,0,4736],"FLAG":0,"BASE":18} Shelly 2 {"NAME":"Shelly 2","GPIO":[0,2752,0,2784,224,225,0,0,160,0,161,2816,0,0],"FLAG":0,"BASE":47} Shelly 2.5 {"NAME":"Shelly 2.5","GPIO":[320,0,32,0,224,193,0,0,640,192,608,225,3456,4736],"FLAG":0,"BASE":18} -Shelly EM {"NAME":"Shelly EM","GPIO":[0,0,0,0,0,0,0,0,640,3456,608,224,0,1],"FLAG":0,"BASE":18} +Shelly EM {"NAME":"Shelly EM","GPIO":[0,0,288,0,32,0,0,0,640,3456,608,224,0,1],"FLAG":0,"BASE":18} Shelly i3 Action and Scenes Activation Device {"NAME":"Shelly i3","GPIO":[0,0,0,0,0,320,0,0,193,194,192,0,0,4736],"FLAG":0,"BASE":18} +Shelly Plus 1 {"NAME":"Shelly Plus 1 ","GPIO":[0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1} +Shelly Plus 1PM {"NAME":"Shelly Plus 1PM","GPIO":[0,0,0,0,192,2720,0,0,0,0,0,0,0,0,2656,0,0,0,0,2624,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1} Sinilink USB {"NAME":"XY-WFUSB","GPIO":[1,1,0,1,32,224,0,0,0,0,320,0,544,0],"FLAG":0,"BASE":18} Smart Home SS-8839-01 {"NAME":"SS-8839-01","GPIO":[0,1,0,1,224,0,0,0,32,321,0,320,0,0],"FLAG":0,"BASE":18} Sonoff 4CH (R2) {"NAME":"Sonoff 4CH","GPIO":[32,1,1,1,226,225,33,34,224,320,35,227,0,0],"FLAG":0,"BASE":7} @@ -2237,7 +2309,7 @@ Sonoff Dual R3 {"NAME":"Sonoff Dual R3","GPIO":[32,0,0,0,0,0,0,0,0 Sonoff Dual R3 Lite {"NAME":"Sonoff Dual R3 Lite","GPIO":[32,0,0,0,0,0,0,0,0,576,225,0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,160,161,0,0,0,0,0,0],"FLAG":0,"BASE":1} Sonoff Dual R3 v2 {"NAME":"Sonoff Dual R3 v2","GPIO":[32,0,0,0,0,0,0,0,0,576,225,0,0,0,0,0,0,0,0,0,0,3200,8128,224,0,0,0,0,160,161,0,0,0,0,0,0],"FLAG":0,"BASE":1} Sonoff Mini {"NAME":"Sonoff Mini","GPIO":[32,0,0,0,160,0,0,0,224,320,0,0,1,0],"FLAG":0,"BASE":1} -Sonoff Mini R2 {"NAME":"Sonoff MINIR2","GPIO":[32,0,0,0,160,0,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":1} +Sonoff Mini R2 {"NAME":"Sonoff MINIR2","GPIO":[32,0,0,0,160,0,0,0,224,544,0,0,0,0],"FLAG":0,"BASE":1} Sonoff Pow {"NAME":"Sonoff Pow","GPIO":[32,0,0,0,0,2592,0,0,224,2656,2688,288,0,0],"FLAG":0,"BASE":6} Sonoff Pow R2 {"NAME":"Sonoff Pow R2","GPIO":[32,3072,0,3104,0,0,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":43} Sonoff POW R3 25A 5500W {"NAME":"Sonoff POWR3","GPIO":[32,3072,0,3104,0,0,0,0,256,320,0,1,1,1],"FLAG":0,"BASE":43} @@ -2252,6 +2324,7 @@ Switch Module 2x5A {"NAME":"QS-WIFI-S04-2C","GPIO":[1,1,32,1,480,0,0,0 Tinxy Single Node 7A {"NAME":"Tnxy07A","GPIO":[32,0,0,0,160,224,0,0,288,0,0,0,0,0],"FLAG":0,"BASE":18} WL-SW01_10 {"NAME":"WL-SW01_10","GPIO":[32,3232,0,3200,0,0,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":1} Woox Integrational Switch {"NAME":"WOOXR4967","GPIO":[0,0,0,1,320,224,0,0,0,32,0,0,0,0],"FLAG":0,"BASE":18} +Yeelight Dual Control {"NAME":"YLAI002","GPIO":[0,0,0,0,0,0,0,0,96,0,224,0,0,320,320,160,0,160,0,0,0,0,0,225,0,0,0,0,162,163,0,0,0,0,0,0],"FLAG":0,"BASE":1,"CMND":"SO127 1"} Yuntong Smart {"NAME":"Yuntong Smart","GPIO":[0,0,0,0,224,0,0,0,96,320,0,576,0,0],"FLAG":0,"BASE":1} Zemismart ERC309 Kinetic {"NAME":"Kinetic Switch","GPIO":[1,1,1,1,1,1,0,0,1,2304,1,2272,1,0],"FLAG":0,"BASE":54} ``` @@ -2267,6 +2340,7 @@ Shelly Add-on {"NAME":"Shelly 1 Temp ","GPIO":[1344,0,0,1312,224, ## Thermostat ``` Floor Heating or Water/Gas Boiler {"NAME":"ME81H Thermostat","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54} +Mysa V1 Electric Baseboard Heater {"NAME":"Mysa Thermostat","GPIO":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,640,608,0,0,0,0,0,0],"FLAG":0,"BASE":1} ``` ## Valve @@ -2277,6 +2351,7 @@ Jinvoo SM-AW713 {"NAME":"Jinvoo Valve","GPIO":[0,0,0,0,0,288,0,0,22 Jinvoo SM-PW713 {"NAME":"Jinvoo Valve","GPIO":[0,0,0,0,224,288,0,0,32,289,0,0,0,4704],"FLAG":0,"BASE":18} Moes Gas-Water {"NAME":"MoesHouse WV-B","GPIO":[0,0,0,0,0,0,0,0,32,224,0,0,0,0],"FLAG":0,"BASE":18} Owfeel EN71 {"NAME":"SmartValve","GPIO":[224,0,0,0,0,0,0,0,32,288,0,0,0,0],"FLAG":0,"BASE":18} +Tuya Gas/Water {"NAME":"Valve FM101","GPIO":[320,0,0,0,224,0,0,0,0,0,32,0,225,0],"FLAG":0,"BASE":18} ``` ## Wall Outlet @@ -2290,10 +2365,13 @@ BSEED Smart Socket {"NAME":"BSEED Socket","GPIO":[0,0,0,0,544,288,0,0, CE Smart Home {"NAME":"CE Smart Wall","GPIO":[1,1,1,1,544,32,0,0,224,1,1,1,1,1],"FLAG":0,"BASE":18} CE Smart Home LQ-2-W3 {"NAME":"LITESUN","GPIO":[0,0,0,0,544,32,0,0,224,0,0,0,0,0],"FLAG":0,"BASE":18} ChilITec Pilota Casa IP44 {"NAME":"Outdoor IP44","GPIO":[0,0,0,0,0,224,0,0,0,288,32,0,0,0],"FLAG":0,"BASE":18} +DETA Double GPO + USB {"NAME":"DETA 6920HA","GPIO":[0,0,0,3104,32,288,0,0,33,224,225,0,0,0],"FLAG":0,"BASE":18} Deta Double Power Point {"NAME":"DETA 2G GPO","GPIO":[0,0,0,0,544,0,0,0,65,224,225,0,64,0],"FLAG":0,"BASE":18} +DETA Outdoor Double Powerpoint {"NAME":"DETA 6294HA","GPIO":[0,0,0,3104,32,288,0,0,33,224,225,0,0,0],"FLAG":0,"BASE":18} Deta Single Power Point {"NAME":"DETA 2G GPO USB","GPIO":[0,0,0,2720,64,576,0,0,65,224,225,0,0,0],"FLAG":0,"BASE":18} Ener-J 13A Twin Wall Sockets with USB {"NAME":"Ener-J 2-Gang ","GPIO":[32,0,0,0,0,224,33,0,225,320,0,0,0,0],"FLAG":0,"BASE":18} Gosund {"NAME":"Gosund WO1","GPIO":[320,0,576,0,2656,2720,0,0,2624,321,225,224,0,4704],"FLAG":0,"BASE":18} +Hevolta Glasense {"NAME":"Hevolta Socket","GPIO":[0,0,0,0,288,289,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} Kapok T16 {"NAME":"tiltech-t16","GPIO":[0,320,0,32,192,0,0,0,224,225,0,0,0,0],"FLAG":0,"BASE":18} Kesen KS-604 {"NAME":"KS-604","GPIO":[1,1,288,1,1,33,0,0,225,224,1,1,32,0],"FLAG":0,"BASE":18} Kesen KS-604S {"NAME":"KS-604S","GPIO":[1,1,258,1,1,33,0,0,225,224,1,1,32,4704],"FLAG":0,"BASE":18} @@ -2302,18 +2380,21 @@ KS-621 {"NAME":"KS-621","GPIO":[32,0,0,0,2688,2656,0,0,259 Makegood MG-AUWF01 {"NAME":"MG-AUWF01","GPIO":[320,161,544,323,2720,2656,0,0,2624,225,321,224,160,0],"FLAG":0,"BASE":18} Makegood MG-UKWSG01 {"NAME":"Aseer 2-Gang","GPIO":[321,160,544,323,2720,2656,0,0,2624,224,320,225,161,0],"FLAG":0,"BASE":18} Makegood MG-UKWSW/B {"NAME":"Aseer 1-Gang","GPIO":[320,0,544,321,2720,2656,0,0,2624,0,0,224,160,0],"FLAG":0,"BASE":18} +Master Contacto WiFi de pared {"NAME":"Master_IOT-WLSOCKET","GPIO":[32,0,0,0,0,225,33,0,224,320,0,0,0,0],"FLAG":0,"BASE":18} Moes WWK Glass Panel {"NAME":"Smart Socket","GPIO":[0,0,0,0,288,289,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18} Oittm 120 {"NAME":"Oittm WS01","GPIO":[32,0,0,0,0,2592,0,0,224,2656,2688,288,0,0],"FLAG":0,"BASE":18} PS-1607 {"NAME":"PS-1607","GPIO":[32,0,0,0,0,225,33,0,224,0,0,0,0,0],"FLAG":0,"BASE":18} Smanergy KA10 {"NAME":"KA10","GPIO":[0,320,0,32,2720,2656,0,0,2624,289,224,0,0,0],"FLAG":0,"BASE":64} Sonoff IW100 {"NAME":"Sonoff IW100","GPIO":[32,3072,0,3104,0,0,0,0,224,544,0,0,0,0],"FLAG":0,"BASE":41} Sonoff S55 {"NAME":"Sonoff S55","GPIO":[32,1,0,1,1,0,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":1} +Steren Dual Plug and USB Charger {"NAME":"Steren_SHOME-118","GPIO":[0,576,0,32,33,288,0,0,224,225,289,0,0,0],"FLAG":0,"BASE":18} T16E Dual USB 10A {"NAME":"T16E 10A","GPIO":[0,0,0,32,2720,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":18} TCP Smart Dual {"NAME":"TCP TAUWIS2GUK","GPIO":[33,0,0,0,0,224,32,0,225,544,0,0,0,0],"FLAG":0,"BASE":18} Teckin SR40 {"NAME":"RF-SR40-US","GPIO":[576,0,0,32,320,33,0,0,225,224,321,226,0,0],"FLAG":0,"BASE":18} TopGreener Dual USB {"NAME":"TGWF215U2A","GPIO":[0,320,0,32,2720,2656,0,0,2624,225,224,321,0,0],"FLAG":0,"BASE":18} TopGreener TGWF15RM {"NAME":"TGWF15RM","GPIO":[0,320,0,32,2720,2656,0,0,2624,321,224,0,0,0],"FLAG":0,"BASE":55} Vigica VGSPK00815 {"NAME":"VIGICA outlet","GPIO":[32,1,1,1,1,225,33,1,224,1,1,1,1,4704],"FLAG":0,"BASE":18} +Virage Labs ViragePlug {"NAME":"ViragePlug","GPIO":[544,0,0,32,320,33,0,0,225,224,320,226,0,0],"FLAG":0,"BASE":18} Woox Dual {"NAME":"Woox R4053","GPIO":[33,0,0,0,0,224,32,0,225,320,0,0,0,0],"FLAG":0,"BASE":18} Xenon 2AC 1USB {"NAME":"Xenon SM-PW801-U1","GPIO":[0,0,0,0,288,32,0,0,224,0,225,0,226,0],"FLAG":0,"BASE":18} ``` From acf2dfb9ab0c253fdf75d412f74b40ae1bca33f7 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 6 Dec 2021 16:46:19 +0100 Subject: [PATCH 27/97] rm faulty chars --- TEMPLATES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TEMPLATES.md b/TEMPLATES.md index 803c9683d..5e9531452 100644 --- a/TEMPLATES.md +++ b/TEMPLATES.md @@ -1701,7 +1701,7 @@ Teckin SB50 v3 A19 800lm {"NAME":"Teckin SB50v3","GPIO":[0,0,0,0,416,419,0,0 Teckin SB53 1300lm {"NAME":"Teckin SB53","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} Treatlife A19 8W 650lm {"NAME":"Treatlife RGBW","GPIO":[0,0,0,0,417,416,0,0,420,418,419,0,0,0],"FLAG":0,"BASE":18} V-TAC 10W 806lm {"NAME":"V-TAC VT-5119","GPIO":[0,0,0,0,4032,0,0,0,0,0,4064,0,0,0],"FLAG":0,"BASE":18} -V-Tac PAR16 4.5W 400lm 100� {"NAME":"V-TAC VT5164","GPIO":[0,0,0,0,0,0,0,0,4064,0,4032,0,0,0],"FLAG":0,"BASE":18} +V-Tac PAR16 4.5W 400lm 100 {"NAME":"V-TAC VT5164","GPIO":[0,0,0,0,0,0,0,0,4064,0,4032,0,0,0],"FLAG":0,"BASE":18} Vizia 5W GU10 {"NAME":"Vizia RGBWW","GPIO":[0,0,0,0,419,420,0,0,417,418,416,0,0,1],"FLAG":0,"BASE":18} WdtPro 8W 800lm {"NAME":"WdtPro","GPIO":[0,0,0,0,419,420,0,0,417,418,416,0,0,0],"FLAG":0,"BASE":18} Wipro Garnet 9W 810lm {"NAME":"Wipro","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18} @@ -1786,7 +1786,7 @@ Kainsy 600lm {"NAME":"KAINSY","GPIO":[32,0,0,0,3008,3040,0,0,0,0 Kkmoon 9W 800lm {"NAME":"KKMOON V21","GPIO":[0,0,0,0,419,0,0,0,417,418,416,0,0,0],"FLAG":0,"BASE":18} Koaanw 650lm {"NAME":"KOAANW Bulb","GPIO":[0,0,0,0,3008,3040,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":27} Kogan 10W Ambient 1050lm {"NAME":"Kogan RGB","GPIO":[0,0,0,0,2912,416,0,0,0,0,2944,0,0,0],"FLAG":0,"BASE":18} -Kogan 4.5W 330lm 110� {"NAME":"Kogan_GU10","GPIO":[0,0,0,0,418,419,0,0,416,0,417,0,0,0],"FLAG":0,"BASE":18} +Kogan 4.5W 330lm 110 {"NAME":"Kogan_GU10","GPIO":[0,0,0,0,418,419,0,0,416,0,417,0,0,0],"FLAG":0,"BASE":18} Kogan Ambient Candle {"NAME":"Kogan_E14","GPIO":[0,0,0,0,416,419,0,0,417,0,418,0,0,0],"FLAG":0,"BASE":18} Kuled 800lm {"NAME":"KULED 60W RGB","GPIO":[0,0,0,0,418,419,0,0,416,0,417,0,0,4704],"FLAG":0,"BASE":18} Laideyi 7W {"NAME":"7W-E14-RGBW-La","GPIO":[0,0,0,0,417,416,0,0,418,0,419,0,0,0],"FLAG":0,"BASE":18} From 9237b4f449f4560545819a379e79c88960feac78 Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 18:59:10 +0100 Subject: [PATCH 28/97] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 4c28364e6..896e2da08 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -42,6 +42,8 @@ #include /* from hvac */ +bool temp_type = false; + struct miel_hvac_header { uint8_t start; #define MIEL_HVAC_H_START 0xfc @@ -200,36 +202,39 @@ CTASSERT(offsetof(struct miel_hvac_msg_update, vane) == MIEL_HVAC_OFFS(12)); CTASSERT(offsetof(struct miel_hvac_msg_update, widevane) == MIEL_HVAC_OFFS(18)); CTASSERT(offsetof(struct miel_hvac_msg_update, temp05) == MIEL_HVAC_OFFS(19)); -static inline uint8_t -miel_hvac_deg2temp(uint8_t deg) +static inline float +miel_hvac_deg2temp(float deg) { - if (!Settings->flag5.mqtt_info_retain) { + if (!temp_type) { return (31 - deg); } else { - return (2*deg + 128); + deg += 128; + return ((float) 2*deg); } } -static inline uint8_t +static inline float miel_hvac_temp2deg(uint8_t temp) { - if (!Settings->flag5.mqtt_info_retain) { + if (!temp_type) { return (31 - temp); } else { - return ((float)(((temp - 128))/2)); + temp -= 128; + return ((float) temp/2); } } -static inline unsigned int +static inline float miel_hvac_roomtemp2deg(uint8_t roomtemp) { - if (!Settings->flag5.mqtt_info_retain) { + if (!temp_type) { return ((unsigned int)roomtemp + 10); } else { - return ((float)((roomtemp - 128)/2)); + roomtemp -= 128; + return ((float) roomtemp/2); } } @@ -704,7 +709,7 @@ miel_hvac_cmnd_settemp(void) { struct miel_hvac_softc *sc = miel_hvac_sc; struct miel_hvac_msg_update *update = &sc->sc_update; - unsigned long degc; + float degc; if (XdrvMailbox.data_len == 0) return; @@ -716,7 +721,7 @@ miel_hvac_cmnd_settemp(void) return; } update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP); - if (!Settings->flag5.mqtt_info_retain) { + if (!temp_type) { update->temp = miel_hvac_deg2temp(degc); update->temp05 = 0; } @@ -900,11 +905,12 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR(",\"HA" D_JSON_IRHVAC_MODE "\":\"%s\""), set->power ? name : "off"); } - if (!Settings->flag5.mqtt_info_retain) { + if (set->temp05 == 0) { dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp)), Settings->flag2.temperature_resolution, temp); } else { + temp_type = true; dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp05)), Settings->flag2.temperature_resolution, temp); } @@ -1109,12 +1115,13 @@ miel_hvac_sensor(struct miel_hvac_softc *sc) const struct miel_hvac_data_roomtemp *rt = &sc->sc_temp.data.roomtemp; char room_temp[33]; - if(!Settings->flag5.mqtt_info_retain) { + if(rt->temp05 == 0) { unsigned int temp = miel_hvac_roomtemp2deg(rt->temp); dtostrfd(ConvertTemp(temp), Settings->flag2.temperature_resolution, room_temp); } else { + temp_type = true; float temp = miel_hvac_roomtemp2deg(rt->temp05); dtostrfd(ConvertTemp(temp), Settings->flag2.temperature_resolution, room_temp); From 8efb7d005c83898d567ff0c32301140b7d563504 Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 19:01:26 +0100 Subject: [PATCH 29/97] Update xdrv_44_miel_hvac.ino --- tasmota/xdrv_44_miel_hvac.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 896e2da08..7856db243 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -944,7 +944,7 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR("}")); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings"), Settings->flag5.mqtt_info_retain); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings")); } static void @@ -985,7 +985,7 @@ miel_hvac_data_response(struct miel_hvac_softc *sc, Response_P(PSTR("{\"Bytes\":\"%s\"}"), ToHex_P((uint8_t *)d, sizeof(*d), hex, sizeof(hex))); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData"),Settings->flag5.mqtt_info_retain); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData")); } static void From 038970c82690601d9dc4866ac32b1a21cacfb4f3 Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 19:35:13 +0100 Subject: [PATCH 30/97] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 7856db243..bd0a70efa 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -202,15 +202,15 @@ CTASSERT(offsetof(struct miel_hvac_msg_update, vane) == MIEL_HVAC_OFFS(12)); CTASSERT(offsetof(struct miel_hvac_msg_update, widevane) == MIEL_HVAC_OFFS(18)); CTASSERT(offsetof(struct miel_hvac_msg_update, temp05) == MIEL_HVAC_OFFS(19)); -static inline float +static inline uint8_t miel_hvac_deg2temp(float deg) { if (!temp_type) { return (31 - deg); } else { - deg += 128; - return ((float) 2*deg); + deg = 2*deg + 128; + return ((uint8_t) deg); } } @@ -714,7 +714,7 @@ miel_hvac_cmnd_settemp(void) if (XdrvMailbox.data_len == 0) return; - degc = strtoul(XdrvMailbox.data, nullptr, 0); + degc = strtof(XdrvMailbox.data, nullptr); if (degc < MIEL_HVAC_UPDATE_TEMP_MIN || degc > MIEL_HVAC_UPDATE_TEMP_MAX) { miel_hvac_respond_unsupported(); @@ -944,7 +944,7 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR("}")); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings")); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings"), Settings->flag5.mqtt_info_retain); } static void @@ -985,7 +985,7 @@ miel_hvac_data_response(struct miel_hvac_softc *sc, Response_P(PSTR("{\"Bytes\":\"%s\"}"), ToHex_P((uint8_t *)d, sizeof(*d), hex, sizeof(hex))); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData")); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData"),Settings->flag5.mqtt_info_retain); } static void From 2e5b7deeadd6b27ff39400e1369da4a6bc279e84 Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 19:36:56 +0100 Subject: [PATCH 31/97] Update xdrv_44_miel_hvac.ino --- tasmota/xdrv_44_miel_hvac.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index bd0a70efa..66e034fec 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -944,7 +944,7 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR("}")); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings"), Settings->flag5.mqtt_info_retain); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings")); } static void @@ -985,7 +985,7 @@ miel_hvac_data_response(struct miel_hvac_softc *sc, Response_P(PSTR("{\"Bytes\":\"%s\"}"), ToHex_P((uint8_t *)d, sizeof(*d), hex, sizeof(hex))); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData"),Settings->flag5.mqtt_info_retain); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData")); } static void From ded6a862da1b41b96236987f69dc62e1c9a79491 Mon Sep 17 00:00:00 2001 From: Barbudor Date: Mon, 6 Dec 2021 20:45:05 +0000 Subject: [PATCH 32/97] fix compile error --- tasmota/xdrv_85_BLE_EQ3_TRV.ino | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tasmota/xdrv_85_BLE_EQ3_TRV.ino b/tasmota/xdrv_85_BLE_EQ3_TRV.ino index cfe3bb33d..d69368268 100644 --- a/tasmota/xdrv_85_BLE_EQ3_TRV.ino +++ b/tasmota/xdrv_85_BLE_EQ3_TRV.ino @@ -128,7 +128,6 @@ print("".join(pin)) // for testing of BLE_ESP32, we remove xsns_62_MI_ESP32.ino completely, and instead add this modified xsns_52_ibeacon_BLE_ESP32.ino #if CONFIG_IDF_TARGET_ESP32 -#if ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(4, 0, 0) #ifdef USE_EQ3_ESP32 #ifdef ESP32 // ESP32 only. Use define USE_HM10 for ESP8266 support #ifdef USE_BLE_ESP32 @@ -226,7 +225,7 @@ uint8_t pairing = 0; #define EQ3_NUM_DEVICESLOTS 16 eq3_device_tag EQ3Devices[EQ3_NUM_DEVICESLOTS]; -void *EQ3mutex = nullptr; +SemaphoreHandle_t EQ3mutex = nullptr; int EQ3Period = 300; uint8_t EQ3OnlyAliased = 0; @@ -1765,5 +1764,4 @@ bool Xdrv85(uint8_t function) #endif // ESP32 #endif -#endif // ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(4, 0, 0) #endif // CONFIG_IDF_TARGET_ESP32 From d509780ad632dbba25de3fa409a182f86d7048ea Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Tue, 7 Dec 2021 17:49:04 +0100 Subject: [PATCH 33/97] Fix BLE EQ3 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a02a1323b..05b3373ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file. ### Fixed - Tuya dimmer range issue (#13849) - BLE Memory leak with update NimBLE v.1.3.1 to v.1.3.3 +- Compile error BLE EQ3 driver with core 2.0.x (#13948) ## [10.0.0.3] 20211130 ### Added From 261338729c5ef09eddb9056f9d3ef4e3f34b852b Mon Sep 17 00:00:00 2001 From: Barbudor Date: Tue, 7 Dec 2021 22:01:57 +0100 Subject: [PATCH 34/97] make mi32option23 compliant with full topic --- tasmota/xsns_62_esp32_mi_ble.ino | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tasmota/xsns_62_esp32_mi_ble.ino b/tasmota/xsns_62_esp32_mi_ble.ino index 92fdf4de0..a1627cebe 100644 --- a/tasmota/xsns_62_esp32_mi_ble.ino +++ b/tasmota/xsns_62_esp32_mi_ble.ino @@ -2741,9 +2741,8 @@ void MI32ShowOneMISensor(){ kMI32DeviceType[p->type-1], p->MAC[3], p->MAC[4], p->MAC[5]); } - char SensorTopic[60]; - sprintf(SensorTopic, "tele/tasmota_ble/%s", - id); + char SensorTopic[TOPSZ]; + GetTopic_P(SensorTopic, TELE, (char*)"tasmota_ble", id); MqttPublish(SensorTopic, Settings->flag.mqtt_sensor_retain); //AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: show some %d %s"),D_CMND_MI32, MI32.mqttCurrentSlot, ResponseData()); @@ -2868,10 +2867,8 @@ void MI32DiscoveryOneMISensor(){ p->MAC[3], p->MAC[4], p->MAC[5]); } - char SensorTopic[60]; - sprintf(SensorTopic, "tele/tasmota_ble/%s", - id); - + char SensorTopic[TOPSZ]; + GetTopic_P(SensorTopic, TELE, (char*)"tasmota_ble", id); //int i = p->nextDiscoveryData*3; for (int i = 0; i < datacount*3; i += 3){ @@ -3063,7 +3060,7 @@ void MI32ShowTriggeredSensors(){ #endif //USE_HOME_ASSISTANT MI32.option.MQTTType == 1 ){ - char SensorTopic[60]; + char SensorTopic[TOPSZ]; char idstr[32]; const char *alias = BLE_ESP32::getAlias(p->MAC); const char *id = idstr; @@ -3074,7 +3071,7 @@ void MI32ShowTriggeredSensors(){ kMI32DeviceType[p->type-1], p->MAC[3], p->MAC[4], p->MAC[5]); } - snprintf_P(SensorTopic, sizeof(SensorTopic), PSTR("tele/tasmota_ble/%s"), id); + GetTopic_P(SensorTopic, TELE, (char*)"tasmota_ble", id); MqttPublish(SensorTopic, Settings->flag.mqtt_sensor_retain); AddLog(LOG_LEVEL_DEBUG, PSTR("M32: triggered %d %s"), sensor, ResponseData()); XdrvRulesProcess(0); From e02c305611e338457cd5756f546505a607a6653f Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 8 Dec 2021 11:03:42 +0100 Subject: [PATCH 35/97] Prep v10.1 --- FIRMWARE.md | 2 +- RELEASENOTES.md | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/FIRMWARE.md b/FIRMWARE.md index e2eb172b7..610cc6fba 100644 --- a/FIRMWARE.md +++ b/FIRMWARE.md @@ -18,7 +18,7 @@ See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/tasmota/C ## Development -[![Dev Version](https://img.shields.io/badge/development%20version-v10.0.x.x-blue.svg)](https://github.com/arendst/Tasmota) +[![Dev Version](https://img.shields.io/badge/development%20version-v10.1.x.x-blue.svg)](https://github.com/arendst/Tasmota) [![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/) [![Tasmota CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22) [![Tasmota ESP32 CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20ESP32%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 486b5da33..3c72eaded 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -102,8 +102,8 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo ## Changelog v10.0.0.4 ### Added -- One second heartbeat GPIO -- (Internal) Support for FUNC_BUTTON_MULTI_PRESSED in (light)drivers +- Support for 1 second heartbeat GPIO +- Support for FUNC_BUTTON_MULTI_PRESSED in (light)drivers - Command ``TcpConfig`` for TCPBridge protocol configuration [#13565](https://github.com/arendst/Tasmota/issues/13565) - Support for HDC2010 temperature/humidity sensor by Luc Boudreau [#13633](https://github.com/arendst/Tasmota/issues/13633) - WS2812 scheme 13 stairs effect [#13595](https://github.com/arendst/Tasmota/issues/13595) @@ -111,7 +111,6 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo - Support for GPE Multi color smart light as sold by Action in the Netherlands - Shutter support for venetian blinds with tilt control - Support for 74xx595 8-bit shift registers [#13921](https://github.com/arendst/Tasmota/issues/13921) -- ESP32 Proof of Concept Sonoff SPM with limited functionality (switching and energy monitoring) [#13447](https://github.com/arendst/Tasmota/issues/13447) - ESP32 Autoconfiguration - ESP32 Preliminary support for Tasmota Apps (.tapp extesions) - ESP32 OTA over HTTPS @@ -119,30 +118,33 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo - ESP32 Berry support for neopixel (WS2812, SK6812) - ESP32 Berry ``import re`` regex module - ESP32 Berry add module ``python_compat`` to be closer to Python syntax [#13428](https://github.com/arendst/Tasmota/issues/13428) +- ESP32 Proof of Concept Sonoff SPM with limited functionality (switching and energy monitoring) [#13447](https://github.com/arendst/Tasmota/issues/13447) ### Breaking Changed - ESP32-S2 TSettings memory usage fixed to 4096 bytes regression from v9.5.0.8 ### Changed -- ESP32 core library from v1.0.7.4 to v2.0.1.1 -- ESP32-C3 core library from v2.0.0-post to ESP32 core library - IRremoteESP8266 library from v2.7.20 to v2.8.0 -- (Internal) Range conversion edge values +- ESP32 core library from v1.0.7.4 to v2.0.1.1 +- ESP32-C3 core library from v2.0.0-post to consolidated ESP32 core library +- ESP32 NimBLE to v.1.3.3 +- ESP32 toolchains changed from 8.4.0-2021r1 to 8.4.0-2021r2 +- Range conversion edge values - ESP8266 Gratuitous ARP enabled and set to 60 seconds [#13623](https://github.com/arendst/Tasmota/issues/13623) - File editor no-wrap [#13427](https://github.com/arendst/Tasmota/issues/13427) -- ESP8266 Gratuitous ARP enabled and set to 60 seconds [#13623](https://github.com/arendst/Tasmota/issues/13623) -- Ethernet hostname ending in ``_eth`` to ``-eth`` according to RFC952 +- MQTT TLS dual mode (CA or fingeprint) in same firmware, ``SetOption132 1`` to force fingerprint +- ESP32 Ethernet hostname ending in ``_eth`` to ``-eth`` according to RFC952 ### Fixed - Initial reset RTC memory based variables like EnergyToday and EnergyTotal -- ESP32 Telegram compile error [#13435](https://github.com/arendst/Tasmota/issues/13435) - SML compile error [#13441](https://github.com/arendst/Tasmota/issues/13441) - GUI checkbox MQTT TLS not saved regression from v9.2.0.3 [#13442](https://github.com/arendst/Tasmota/issues/13442) - Discovery of shutters [#13572](https://github.com/arendst/Tasmota/issues/13572) +- Tuya dimmer range issue [#13849](https://github.com/arendst/Tasmota/issues/13849) +- ESP32 Telegram compile error [#13435](https://github.com/arendst/Tasmota/issues/13435) - ESP32-C3 OneWire as used by DS18x20 [#13583](https://github.com/arendst/Tasmota/issues/13583) - ESP32 analog NTC temperature calculation [#13703](https://github.com/arendst/Tasmota/issues/13703) -- Tuya dimmer range issue [#13849](https://github.com/arendst/Tasmota/issues/13849) +- ESP32 compile error BLE EQ3 driver with core 2.0.x [#13948](https://github.com/arendst/Tasmota/issues/13948) ### Removed - ILI9488 driver in favour of Universal Display driver [#13719](https://github.com/arendst/Tasmota/issues/13719) - From 732c7a4116198c3229f2b44f3c8ee14169e5d375 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Wed, 8 Dec 2021 16:28:29 +0100 Subject: [PATCH 36/97] new functions and housekeeping --- tasmota/xdrv_10_scripter.ino | 696 ++++++++++++++++++++++++----------- 1 file changed, 471 insertions(+), 225 deletions(-) diff --git a/tasmota/xdrv_10_scripter.ino b/tasmota/xdrv_10_scripter.ino index d5a2c5bdb..f744d850b 100755 --- a/tasmota/xdrv_10_scripter.ino +++ b/tasmota/xdrv_10_scripter.ino @@ -116,6 +116,9 @@ uint32_t DecodeLightId(uint32_t hue_id); #define UNISHOXRSIZE 2560 #endif +#ifndef MAX_EXT_ARRAYS +#define MAX_EXT_ARRAYS 5 +#endif #ifndef STASK_PRIO #define STASK_PRIO 1 @@ -1163,6 +1166,22 @@ float *Get_MFAddr(uint8_t index, uint16_t *len, uint16_t *ipos) { char *isvar(char *lp, uint8_t *vtype, struct T_INDEX *tind, float *fp, char *sp, struct GVARS *gv); +char *get_array_by_name(char *lp, float **fp, uint16_t *alen) { + struct T_INDEX ind; + uint8_t vtype; + lp = isvar(lp, &vtype, &ind, 0, 0, 0); + if (vtype==VAR_NV) return 0; + if (vtype&STYPE) return 0; + uint16_t index = glob_script_mem.type[ind.index].index; + + if (glob_script_mem.type[ind.index].bits.is_filter) { + float *fa = Get_MFAddr(index, alen, 0); + *fp = fa; + return lp; + } + *fp = 0; + return lp; +} float *get_array_by_name(char *name, uint16_t *alen) { struct T_INDEX ind; @@ -1281,6 +1300,133 @@ float DoMedian5(uint8_t index, float in) { return median_array(mf->buffer, MEDIAN_SIZE); } + +#ifdef USE_FEXTRACT +// convert tasmota time stamp to ul seconds +uint32_t tstamp2l(char *ts) { +uint16_t year; +uint8_t month; +uint8_t day; +uint8_t hour; +uint8_t mins; +uint8_t secs; + + if (strchr(ts, 'T')) { + // 2020-12-16T15:36:41 + year = strtol(ts, &ts, 10); + if (year < 2020 || year > 2040) { + year = 2020; + } + year -= 2000; + ts++; + month = strtol(ts, &ts, 10); + ts++; + day = strtol(ts, &ts, 10); + ts++; + hour = strtol(ts, &ts, 10); + ts++; + mins = strtol(ts, &ts, 10); + ts++; + secs = strtol(ts, &ts, 10); + } else { + // german excel fromat 16.12.20 15:36 + day = strtol(ts, &ts, 10); + ts++; + month = strtol(ts, &ts, 10); + ts++; + year = strtol(ts, &ts, 10); + ts++; + hour = strtol(ts, &ts, 10); + ts++; + mins = strtol(ts, &ts, 10); + secs = 0; + } + return (year*365*86400)+(month*31*86400)+(day*86400)+(hour*3600)+(mins*60)+secs; +} + +// assume 1. entry is timestamp, others are tab delimited values until LF +// file refernece, from timestamp, to timestampm, column offset, array pointers, array lenght, number of arrays +int32_t extract_from_file(uint8_t fref, char *ts_from, char *ts_to, uint8_t coffs, float **a_ptr, uint16_t *a_len, uint8_t numa, int16_t accum) { + if (!glob_script_mem.file_flags[fref].is_open) return -1; + char rstr[32]; + uint8_t sindex = 0; + uint8_t colpos = 0; + uint8_t range = 0; + uint32_t tsfrom = tstamp2l(ts_from); + uint32_t tsto = tstamp2l(ts_to); + uint16_t lines = 0; + uint16_t rlines = 0; + float summs[numa]; + uint16_t accnt[numa]; + for (uint8_t cnt = 0; cnt < numa; cnt++) { + summs[cnt] = 0; + accnt[cnt] = 0; + } + uint8_t dflg = 1; + if (accum < 0) { + dflg = 0; + accum = -accum; + } + if (accum == 0) accum = 1; + while (glob_script_mem.files[fref].available()) { + // scan through file + uint8_t buff[2], iob; + glob_script_mem.files[fref].read(buff, 1); + iob = buff[0]; + if (iob == '\t' || iob == ',' || iob == '\n') { + rstr[sindex] = 0; + sindex = 0; + if (colpos == 0) { + // timestamp 2020-12-16T15:36:41 + // decompose timestamps + uint32_t cts = tstamp2l(rstr); + if (cts > tsto) break; + if (cts >= tsfrom && cts <= tsto) { + // we want this range + range = 1; + rlines++; + } else { + range = 0; + } + } else { + // data columns + if (range) { + uint8_t curpos = colpos - coffs; + if (colpos >= coffs && curpos < numa) { + if (a_len[curpos]) { + float fval = CharToFloat(rstr); + //AddLog(LOG_LEVEL_INFO, PSTR("cpos %d colp %d numa %d - %s %d"),curpos, colpos, a_len[curpos], rstr, (uint32_t)fval); + summs[curpos] += fval; + accnt[curpos] += 1; + if (accnt[curpos] == accum) { + if (dflg) { + *a_ptr[curpos]++ = summs[curpos] / accum; + } else { + *a_ptr[curpos]++ = summs[curpos]; + } + summs[curpos] = 0; + accnt[curpos] = 0; + a_len[curpos]--; + } + } else { + break; + } + } + } + } + colpos++; + if (iob == '\n') { + colpos = 0; + lines ++; + } + } + rstr[sindex] = iob; + sindex++; + } + return rlines; +} +#endif // USE_FEXTRACT + #ifdef USE_LIGHT uint32_t HSVToRGB(uint16_t hue, uint8_t saturation, uint8_t value) { float r = 0, g = 0, b = 0; @@ -1782,26 +1928,20 @@ chknext: if (!strncmp(vname, "acos(", 5)) { lp=GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); fvar = acosf(fvar); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif if (!strncmp(vname, "abs(", 4)) { lp=GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); fvar = fabs(fvar); - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "asc(", 4)) { char str[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 4, OPER_EQU, str, gv); fvar = str[0]; - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "adc(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); @@ -1831,6 +1971,26 @@ chknext: len = 0; goto exit; } + if (!strncmp(vname, "acp(", 4)) { + lp += 4; + SCRIPT_SKIP_SPACES + uint16_t alend; + fvar = -1; + float *fpd; + lp = get_array_by_name(lp, &fpd, &alend); + SCRIPT_SKIP_SPACES + uint16_t alens; + float *fps; + lp = get_array_by_name(lp, &fps, &alens); + SCRIPT_SKIP_SPACES + if (alend != alens) { + fvar = -1; + } else { + memcpy(fpd, fps, alend * sizeof(float)); + fvar = 0; + } + goto nfuncexit; + } break; case 'b': @@ -1887,9 +2047,7 @@ chknext: float fvar1; lp = GetNumericArgument(lp, OPER_EQU, &fvar1, gv); fvar = Core2SetAxpPin(fvar, fvar1); - lp++; - len=0; - goto exit; + goto nfuncexit; } #endif // USE_M5STACK_CORE2 @@ -1906,10 +2064,8 @@ chknext: if (*lp!=')') { lp = GetNumericArgument(lp, OPER_EQU, &prio, gv); } - lp++; fvar = scripter_create_task(fvar, fvar1, fvar2, prio); - len = 0; - goto exit; + goto nfuncexit; } #endif //USE_SCRIPT_TASK #endif //ESP32 @@ -1917,9 +2073,7 @@ chknext: if (!strncmp(vname, "cos(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); fvar = cosf(fvar); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif break; @@ -1997,9 +2151,7 @@ chknext: fvar = 99999; break; } - len = 0; - lp++; - goto exit; + goto nfuncexit; } #endif //USE_ENERGY_SENSOR break; @@ -2065,9 +2217,7 @@ chknext: break; } } - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "fc(", 3)) { lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); @@ -2081,9 +2231,7 @@ chknext: glob_script_mem.file_flags[ind].is_open = 0; } fvar = 0; - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "ff(", 3)) { lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); @@ -2091,9 +2239,7 @@ chknext: if (ind>=SFS_MAX) ind = SFS_MAX - 1; glob_script_mem.files[ind].flush(); fvar = 0; - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "fw(", 3)) { char str[SCRIPT_MAXSSIZE]; @@ -2107,10 +2253,24 @@ chknext: } else { fvar = 0; } - lp++; - len = 0; - goto exit; + goto nfuncexit; } + if (!strncmp(vname, "fwb(", 4)) { + lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); + uint8_t buf[2]; + buf[0] = fvar; + SCRIPT_SKIP_SPACES + lp = GetNumericArgument(lp, OPER_EQU, &fvar, gv); + uint8_t ind = fvar; + if (ind>=SFS_MAX) ind = SFS_MAX - 1; + if (glob_script_mem.file_flags[ind].is_open) { + fvar = glob_script_mem.files[ind].write(buf, 1); + } else { + fvar = 0; + } + goto nfuncexit; + } + if (!strncmp(vname, "fr(", 3)) { struct T_INDEX ind; uint8_t vtype; @@ -2184,14 +2344,75 @@ chknext: len = 0; goto exit; } + if (!strncmp(vname, "frb(", 4)) { + lp = GetNumericArgument(lp, OPER_EQU, &fvar, gv); + uint8_t ind = fvar; + if (ind>=SFS_MAX) ind = SFS_MAX - 1; + if (glob_script_mem.file_flags[ind].is_open) { + uint8_t buf[2]; + buf[0] = 0; + glob_script_mem.files[ind].read(buf, 1); + fvar = buf[0]; + } else { + fvar = 0; + } + goto nfuncexit; + } + if (!strncmp(vname, "fa(", 3)) { + lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); + uint8_t ind = fvar; + if (ind>=SFS_MAX) ind = SFS_MAX - 1; + if (glob_script_mem.file_flags[ind].is_open) { + fvar = glob_script_mem.files[ind].available(); + } else { + fvar = -1; + } + goto nfuncexit; + } + if (!strncmp(vname, "fs(", 3)) { + lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); + uint8_t ind = fvar; + SCRIPT_SKIP_SPACES + lp = GetNumericArgument(lp, OPER_EQU, &fvar, gv); + SCRIPT_SKIP_SPACES + if (ind>=SFS_MAX) ind = SFS_MAX - 1; + if (glob_script_mem.file_flags[ind].is_open) { + fvar = glob_script_mem.files[ind].seek(fvar, fs::SeekMode::SeekCur); + } else { + fvar = -1; + } + goto nfuncexit; + } + if (!strncmp(vname, "fz(", 3)) { + lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); + SCRIPT_SKIP_SPACES + uint8_t ind = fvar; + if (ind>=SFS_MAX) ind = SFS_MAX - 1; + if (glob_script_mem.file_flags[ind].is_open) { + fvar = glob_script_mem.files[ind].size(); + } else { + fvar = -1; + } + goto nfuncexit; + } if (!strncmp(vname, "fd(", 3)) { char str[glob_script_mem.max_ssize + 1]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); ufsp->remove(str); - lp++; - len = 0; - goto exit; + goto nfuncexit; } +#ifdef USE_UFILESYS + if (!strncmp(vname, "frw(", 4)) { + // read file from web + lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); + SCRIPT_SKIP_SPACES + char url[SCRIPT_MAXSSIZE]; + lp = ForceStringVar(lp, url); + SCRIPT_SKIP_SPACES + fvar = url2file(fvar, url); + goto nfuncexit; + } +#endif #if defined(ESP32) && defined(USE_WEBCAM) if (!strncmp(vname, "fwp(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); @@ -2215,9 +2436,7 @@ chknext: } else { fvar = 0; } - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif //ESP32 && USE_WEBCAM #ifdef USE_SCRIPT_FATFS_EXT @@ -2240,17 +2459,13 @@ chknext: } ef.close(); } - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "fmd(", 4)) { char str[glob_script_mem.max_ssize + 1]; lp = GetStringArgument(lp + 4, OPER_EQU, str, 0); fvar = ufsp->mkdir(str); - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "fmt(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); @@ -2259,64 +2474,99 @@ chknext: } else { //SD.format(); } - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "frd(", 4)) { char str[glob_script_mem.max_ssize + 1]; lp = GetStringArgument(lp + 4, OPER_EQU, str, 0); fvar = ufsp->rmdir(str); - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "fx(", 3)) { char str[glob_script_mem.max_ssize + 1]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); if (ufsp->exists(str)) fvar = 1; else fvar = 0; - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "fsi(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); fvar = UfsInfo(fvar, 0); - lp++; - len = 0; - goto exit; + goto nfuncexit; } - if (!strncmp(vname, "fwa(", 4)) { - struct T_INDEX ind; - uint8_t vtype; - lp = isvar(lp + 4, &vtype, &ind, 0, 0, gv); - if (vtype!=VAR_NV && (vtype&STYPE)==0 && glob_script_mem.type[ind.index].bits.is_filter) { - // found array as result +#ifdef USE_FEXTRACT + if (!strncmp(vname, "fxt(", 4)) { + // extract from file + lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); + SCRIPT_SKIP_SPACES + uint8_t fref = fvar; - } else { - // error + //2020-12-16T14:30:00 + char ts_from[24]; + lp = GetStringArgument(lp, OPER_EQU, ts_from, 0); + SCRIPT_SKIP_SPACES + + char ts_to[24]; + lp = GetStringArgument(lp, OPER_EQU, ts_to, 0); + SCRIPT_SKIP_SPACES + + lp = GetNumericArgument(lp, OPER_EQU, &fvar, gv); + SCRIPT_SKIP_SPACES + uint8_t coffs = fvar; + + lp = GetNumericArgument(lp, OPER_EQU, &fvar, gv); + SCRIPT_SKIP_SPACES + int16_t accum = fvar; + + uint16_t a_len[MAX_EXT_ARRAYS]; + float *a_ptr[MAX_EXT_ARRAYS]; + + uint8_t index = 0; + while (index < MAX_EXT_ARRAYS) { + lp = get_array_by_name(lp, &a_ptr[index], &a_len[index]); + SCRIPT_SKIP_SPACES + index++; + if (*lp == ')' || *lp == '\n') { + break; + } + } + fvar = extract_from_file(fref, ts_from, ts_to, coffs, a_ptr, a_len, index, accum); + goto nfuncexit; + } +#endif // USE_FEXTRACT + if (!strncmp(vname, "fwa(", 4)) { + uint16_t alen; + float *fa; + lp = get_array_by_name(lp + 4, &fa, &alen); + if (!fa) { fvar = 0; goto exit; } - - while (*lp==' ') lp++; + SCRIPT_SKIP_SPACES lp = GetNumericArgument(lp, OPER_EQU, &fvar, gv); + SCRIPT_SKIP_SPACES + uint8_t append = 0; + if (*lp == 'a') { + lp++; + append = 1; + } uint8_t index = fvar; - if (index>=SFS_MAX) index = SFS_MAX - 1; + if (index >= SFS_MAX) index = SFS_MAX - 1; if (glob_script_mem.file_flags[index].is_open) { - uint16_t len = 0; - float *fa = Get_MFAddr(glob_script_mem.type[ind.index].index, &len, 0); char dstr[24]; - for (uint32_t cnt = 0; cnt=SFS_MAX) find = SFS_MAX - 1; + SCRIPT_SKIP_SPACES + + if (find >= SFS_MAX) find = SFS_MAX - 1; char str[glob_script_mem.max_ssize + 1]; if (glob_script_mem.file_flags[find].is_open) { - uint16_t len = 0; - float *fa = Get_MFAddr(glob_script_mem.type[ind.index].index, &len, 0); - char dstr[24]; - for (uint32_t cnt = 0; cnt=glob_script_mem.max_ssize - 1) break; + first = 1; + slen++; + if (slen >= glob_script_mem.max_ssize - 1) break; } } *cp = 0; @@ -2370,9 +2618,7 @@ chknext: } else { fvar = 0; } - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif // USE_SCRIPT_FATFS_EXT @@ -2382,10 +2628,8 @@ chknext: lp = GetStringArgument(lp + 4, OPER_EQU, str, 0); if (lknum<1 || lknum>2) lknum = 1; strlcpy(glob_script_mem.flink[lknum - 1], str, 14); - lp++; fvar = 0; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "fsm", 3)) { fvar=(uint32_t)ufsp; @@ -2501,9 +2745,7 @@ chknext: char path[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp, OPER_EQU, path, 0); fvar = call2https(host, path); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif //SCRIPT_GET_HTTPS_JP break; @@ -2539,9 +2781,36 @@ chknext: char str[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); fvar = strtol(str, NULL, 16); - lp++; - len = 0; - goto exit; + goto nfuncexit; + } + if (!strncmp(vname, "hf(", 3)) { + char str[SCRIPT_MAXSSIZE]; + lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); + SCRIPT_SKIP_SPACES + if (strlen(str) != 8) { + fvar = -1; + } else { + uint8_t *ucp = (uint8_t*)&fvar; + uint8_t rflg = 0; + if (*lp=='r') { + rflg = 1; + ucp += sizeof(float); + lp++; + } + char substr[3]; + char *cp = str; + for (uint32_t cnt = 0; cnt < 4; cnt++) { + substr[0] = *cp++; + substr[1] = *cp++; + substr[2] = 0; + if (!rflg) { + *ucp++ = strtol(substr, NULL, 16); + } else { + *--ucp = strtol(substr, NULL, 16); + } + } + } + goto nfuncexit; } if (!strncmp(vname, "http(", 5)) { char host[SCRIPT_MAXSSIZE]; @@ -2551,9 +2820,7 @@ chknext: lp = GetStringArgument(lp, OPER_EQU, request, 0); SCRIPT_SKIP_SPACES fvar = http_req(host, request); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #ifdef USE_LIGHT if (!strncmp(vname, "hsvrgb(", 7)) { @@ -2571,9 +2838,7 @@ chknext: if (fvar3<0 || fvar3>100) fvar3 = 0; fvar = HSVToRGB(fvar, fvar2, fvar3); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif //USE_LIGHT @@ -2588,9 +2853,7 @@ chknext: glob_script_mem.homekit_running == false; } } - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif break; @@ -2608,16 +2871,12 @@ chknext: } else { fvar = -1; } - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "int(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); fvar = floor(fvar); - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "is(", 3)) { lp = isargs(lp + 3, 0); @@ -2662,9 +2921,7 @@ chknext: } lp = GetNumericArgument(lp + 1, OPER_EQU, &fvar, gv); fvar = script_i2c(0, fvar, bus); - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "iw", 2)) { uint8_t bytes = 1; @@ -2681,9 +2938,7 @@ chknext: float fvar2; lp = GetNumericArgument(lp, OPER_EQU, &fvar2, gv); fvar = script_i2c(9 + bytes, fvar, fvar2); - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "ir", 2)) { uint8_t bytes = 1; @@ -2696,9 +2951,7 @@ chknext: } lp = GetNumericArgument(lp + 1, OPER_EQU, &fvar, gv); fvar = script_i2c(2, fvar, bytes); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif // USE_SCRIPT_I2C break; @@ -2728,9 +2981,7 @@ chknext: lp = GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); SCRIPT_SKIP_SPACES fvar = lvgl_test(&lp, fvar); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif // USE_LVGL break; @@ -2743,17 +2994,13 @@ chknext: float fvar2; lp = GetNumericArgument(lp, OPER_EQU, &fvar2, gv); fvar = DoMedian5(fvar1, fvar2); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #ifdef USE_ANGLE_FUNC if (!strncmp(vname, "mpt(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); fvar = MeasurePulseTime(fvar); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif //USE_ANGLE_FUNC if (!strncmp(vname, "micros", 6)) { @@ -2911,10 +3158,8 @@ chknext: // arg2 float fvar2; lp = GetNumericArgument(lp, OPER_EQU, &fvar2, gv); - lp++; fvar = FastPrecisePowf(fvar1, fvar2); - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "pwr[", 4)) { GetNumericArgument(vname + 4, OPER_EQU, &fvar, gv); @@ -2998,10 +3243,8 @@ chknext: if (!strncmp(vname, "sl(", 3)) { char str[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); - lp++; - len = 0; fvar = strlen(str); - goto exit; + goto nfuncexit; } if (!strncmp(vname, "sb(", 3)) { char str[SCRIPT_MAXSSIZE]; @@ -3081,9 +3324,7 @@ chknext: if (fvar>240) fvar = 240; setCpuFrequencyMhz(fvar); fvar = getCpuFrequencyMhz(); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif //ESP32 #ifdef USE_TTGO_WATCH @@ -3091,9 +3332,7 @@ chknext: lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); SCRIPT_SKIP_SPACES TTGO_Sleep(fvar); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif //USE_TTGO_WATCH #if defined(USE_TIMERS) && defined(USE_SUNRISE) @@ -3124,16 +3363,12 @@ chknext: if (!strncmp(vname, "sin(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); fvar = sinf(fvar); - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "sqrt(", 5)) { lp = GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); fvar = sqrtf(fvar); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif //USE_ANGLE_FUNC @@ -3142,9 +3377,7 @@ chknext: lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); SCRIPT_SKIP_SPACES fvar = SML_GetVal(fvar); - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "sml(", 4)) { float fvar1; @@ -3177,9 +3410,7 @@ chknext: fvar = 0; #endif //ED300L } - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "smlj", 4)) { fvar = sml_json_enable; @@ -3190,16 +3421,12 @@ chknext: lp = GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); if (fvar < 1) fvar = 1; SML_Decode(fvar - 1); - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "smlv[", 5)) { lp = GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); fvar = sml_getv(fvar); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif //USE_SML_M @@ -3261,9 +3488,7 @@ chknext: fvar = -2; } } - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "sw(", 3)) { char str[SCRIPT_MAXSSIZE]; @@ -3273,9 +3498,7 @@ chknext: glob_script_mem.sp->write(str, strlen(str)); fvar = 0; } - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "swb(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, 0); @@ -3284,18 +3507,14 @@ chknext: glob_script_mem.sp->write((uint8_t)fvar); fvar = 0; } - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "sa(", 3)) { fvar = -1; if (glob_script_mem.sp) { fvar = glob_script_mem.sp->available(); } - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "srb(", 3)) { fvar = -1; @@ -3305,9 +3524,7 @@ chknext: fvar = glob_script_mem.sp->read(); } } - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "sp(", 3)) { fvar = -1; @@ -3317,9 +3534,7 @@ chknext: fvar = glob_script_mem.sp->peek(); } } - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "sr(", 3)) { uint16_t size = glob_script_mem.max_ssize; @@ -3396,33 +3611,25 @@ chknext: lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); if (fvar<10) fvar = 10; Script_ticker1.attach_ms(fvar, Script_ticker1_end); - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "ts2(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); if (fvar<10) fvar = 10; Script_ticker2.attach_ms(fvar, Script_ticker2_end); - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "ts3(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); if (fvar<10) fvar = 10; Script_ticker3.attach_ms(fvar, Script_ticker3_end); - lp++; - len = 0; - goto exit; + goto nfuncexit; } if (!strncmp(vname, "ts4(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); if (fvar<10) fvar = 10; Script_ticker4.attach_ms(fvar, Script_ticker4_end); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif // USE_SCRIPT_TIMER @@ -3462,10 +3669,8 @@ chknext: } accu += ESP.getCycleCount()-cycles; } - lp++; - len = 0; fvar = accu / 1000; - goto exit; + goto nfuncexit; } #endif @@ -3478,9 +3683,7 @@ chknext: lp = GetNumericArgument(lp, OPER_EQU, &fvar, gv); SCRIPT_SKIP_SPACES fvar = get_tpars(index - 1, fvar); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif break; @@ -3570,9 +3773,7 @@ chknext: default: fvar = 0; } - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif //ESP32, USE_WEBCAM #if defined(USE_TTGO_WATCH) && defined(USE_BMA423) @@ -3589,9 +3790,7 @@ chknext: if (!strncmp(vname, "wtch(", 5)) { lp = GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); fvar = Touch_Status(fvar); - lp++; - len = 0; - goto exit; + goto nfuncexit; } #endif // USE_FT5206 if (!strncmp(vname, "wm", 2)) { @@ -3638,6 +3837,9 @@ notfound: glob_script_mem.var_not_found = 1; return lp; // return constant numbers +nfuncexit: + lp++; + len = 0; exit: if (fp) *fp = fvar; *vtype = NUM_RES; @@ -6770,6 +6972,7 @@ char buff[512]; if (renderer && renderer->framebuffer) { uint8_t *bp = renderer->framebuffer; uint8_t *lbuf = (uint8_t*)special_malloc(Settings->display_width * 3 + 2); + memset(lbuf, 0, Settings->display_width * 3); if (!lbuf) return; uint8_t dmflg = 0; if (renderer->disp_bpp & 0x40) dmflg = 1; @@ -6808,11 +7011,12 @@ char buff[512]; } else { pixel = *bp & 0xf; } + pixel *= 15; + *--lbp = pixel; + *--lbp = pixel; + *--lbp = pixel; } - pixel *= 15; - *--lbp = pixel; - *--lbp = pixel; - *--lbp = pixel; + } else { for (uint32_t cnt = 0; cnt <= 1; cnt++) { if (!(cnt & 1)) { @@ -7941,18 +8145,20 @@ void script_task2(void *arg) { } } } -uint32_t scripter_create_task(uint32_t num, uint32_t time, uint32_t core, uint32_t prio) { +uint32_t scripter_create_task(uint32_t num, uint32_t time, uint32_t core, int32_t prio) { //return 0; BaseType_t res = 0; if (core > 1) { core = 1; } - if (num == 1) { - if (esp32_tasks[0].task_t) { vTaskDelete(esp32_tasks[0].task_t); } - res = xTaskCreatePinnedToCore(script_task1, "T1", STASK_STACK, NULL, prio, &esp32_tasks[0].task_t, core); - esp32_tasks[0].task_timer = time; - } else { - if (esp32_tasks[1].task_t) { vTaskDelete(esp32_tasks[1].task_t); } - res = xTaskCreatePinnedToCore(script_task2, "T2", STASK_STACK, NULL, prio, &esp32_tasks[1].task_t, core); - esp32_tasks[1].task_timer = time; + if (num < 1) { num = 1; } + if (num > 2) { num = 2; } + num--; + if (esp32_tasks[num].task_t) { + vTaskDelete(esp32_tasks[num].task_t); + esp32_tasks[num].task_t = 0; + } + if (prio >= 0) { + res = xTaskCreatePinnedToCore(script_task1, num==0?"T1":"T2", STASK_STACK, NULL, prio, &esp32_tasks[num].task_t, core); + esp32_tasks[num].task_timer = time; } return res; } @@ -7977,7 +8183,7 @@ void script_task2(void *arg) { } } -uint32_t scripter_create_task(uint32_t num, uint32_t time, uint32_t core, uint32_t prio) { +uint32_t scripter_create_task(uint32_t num, uint32_t time, uint32_t core, int32_t prio) { //return 0; BaseType_t res = 0; if (core > 1) { core = 1; } @@ -7997,6 +8203,42 @@ uint32_t scripter_create_task(uint32_t num, uint32_t time, uint32_t core, uint32 #endif // USE_SCRIPT_TASK #endif // ESP32 + +#ifdef USE_UFILESYS +// read http content to file +int32_t url2file(uint8_t fref, char *url) { + WiFiClient http_client; + HTTPClient http; + int32_t httpCode = 0; + char hbuff[128]; + strcpy(hbuff, "http://"); + strcat(hbuff, url); + http.begin(http_client, UrlEncode(hbuff)); + httpCode = http.GET(); + if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) { + WiFiClient *stream = http.getStreamPtr(); + int32_t len = http.getSize(); + if (len < 0) len = 99999999; + uint8_t buff[512]; + while (http.connected() && (len > 0)) { + size_t size = stream->available(); + if (size) { + if (size > sizeof(buff)) { + size = sizeof(buff); + } + uint32_t read = stream->readBytes(buff, size); + glob_script_mem.files[fref].write(buff, read); + len -= read; + } + delayMicroseconds(1); + } + } + http.end(); + http_client.stop(); + return httpCode; +} +#endif + int32_t http_req(char *host, char *request) { WiFiClient http_client; HTTPClient http; @@ -8613,6 +8855,10 @@ int32_t retval = 0; case 7: retval = Settings->timer[index].arm; break; + case 8: + retval = Settings->flag3.timers_enable; + break; + } return retval; } From 6301b598f5e70dd345e463253dcf6538a706aeea Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Wed, 8 Dec 2021 16:30:11 +0100 Subject: [PATCH 37/97] =d fix, trx list allow split lines --- tasmota/xsns_53_sml.ino | 76 ++++++++++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 12 deletions(-) diff --git a/tasmota/xsns_53_sml.ino b/tasmota/xsns_53_sml.ino index 7674f5cf0..d001af112 100755 --- a/tasmota/xsns_53_sml.ino +++ b/tasmota/xsns_53_sml.ino @@ -1555,16 +1555,22 @@ void SML_Decode(uint8_t index) { double vdiff = meter_vars[ind - 1] - dvalues[dindex]; dvalues[dindex] = meter_vars[ind - 1]; double dres = (double)360000.0 * vdiff / ((double)dtime / 10000.0); -#ifdef USE_SML_MEDIAN_FILTER - if (meter_desc_p[mindex].flag & 16) { - meter_vars[vindex] = sml_median(&sml_mf[vindex], dres); - } else { - meter_vars[vindex] = dres; - } -#else - meter_vars[vindex] = dres; -#endif + dvalid[vindex] += 1; + + if (dvalid[vindex] >= 2) { + // differece is only valid after 2. calculation + dvalid[vindex] = 2; +#ifdef USE_SML_MEDIAN_FILTER + if (meter_desc_p[mindex].flag & 16) { + meter_vars[vindex] = sml_median(&sml_mf[vindex], dres); + } else { + meter_vars[vindex] = dres; + } +#else + meter_vars[vindex] = dres; +#endif + } mp=strchr(mp,'@'); if (mp) { mp++; @@ -1573,7 +1579,7 @@ void SML_Decode(uint8_t index) { SML_Immediate_MQTT((const char*)mp, vindex, mindex); } } - dvalid[vindex] = 1; + //dvalid[vindex] = 1; dindex++; } } else if (*mp == 'h') { @@ -2212,7 +2218,9 @@ uint8_t *script_meter; #ifdef SML_REPLACE_VARS +#ifndef SML_SRCBSIZE #define SML_SRCBSIZE 256 +#endif uint32_t SML_getlinelen(char *lp) { uint32_t cnt; @@ -2404,10 +2412,53 @@ dddef_exit: script_meter_desc[index].tsecs = strtol(lp, &lp, 10); if (*lp == ',') { lp++; - char txbuff[256]; +#if 1 + // look ahead + uint16_t txlen = 0; + uint16_t tx_entries = 1; + char *txp = lp; + while (*txp) { + if (*txp == ',') tx_entries++; + if (*txp == SCRIPT_EOL) { + if (tx_entries > 1) { + if (*(txp - 1) != ',' ) { + break; + } + // line ends with , + } else { + // single entry + break; + } + } + txp++; + txlen++; + } + if (txlen) { + script_meter_desc[index].txmem = (char*)calloc(txlen + 2, 1); + if (script_meter_desc[index].txmem) { + // now copy send blocks + char *txp = lp; + uint16_t tind = 0; + for (uint32_t cnt = 0; cnt < txlen; cnt++) { + if (*txp == SCRIPT_EOL) { + txp++; + } else { + script_meter_desc[index].txmem[tind] = *txp++; + tind++; + } + } + } + //AddLog(LOG_LEVEL_INFO, PSTR(">>> %s - %d"), script_meter_desc[index].txmem, txlen); + script_meter_desc[index].index = 0; + script_meter_desc[index].max_index = tx_entries; + sml_send_blocks++; + lp += txlen; + } +#else + char txbuff[SML_SRCBSIZE]; uint32_t txlen = 0, tx_entries = 1; for (uint32_t cnt = 0; cnt < sizeof(txbuff); cnt++) { - if (*lp == SCRIPT_EOL) { + if (*lp == SCRIPT_EOL && *(lp - 1) != ',' ) { txbuff[cnt] = 0; txlen = cnt; break; @@ -2424,6 +2475,7 @@ dddef_exit: script_meter_desc[index].max_index = tx_entries; sml_send_blocks++; } +#endif } } if (*lp == SCRIPT_EOL) lp--; From 153e5c29988bfe98d65fe12577ab405cbce9ea7c Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Wed, 8 Dec 2021 16:32:02 +0100 Subject: [PATCH 38/97] configurable text sfac --- tasmota/xdrv_13_display.ino | 13 ++++++++++--- tasmota/xdsp_17_universal.ino | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/tasmota/xdrv_13_display.ino b/tasmota/xdrv_13_display.ino index 4b4a988cf..ffded1fde 100755 --- a/tasmota/xdrv_13_display.ino +++ b/tasmota/xdrv_13_display.ino @@ -96,6 +96,11 @@ void Get_display(uint8_t index) { } #endif // USE_MULTI_DISPLAY +#ifndef TXT_MAX_SFAC +#define TXT_MAX_SFAC 4 +#endif // TXT_MAX_SFAC + + const uint8_t DISPLAY_MAX_DRIVERS = 32; // Max number of display drivers/models supported by xdsp_interface.ino const uint8_t DISPLAY_MAX_COLS = 64; // Max number of columns allowed with command DisplayCols const uint8_t DISPLAY_MAX_ROWS = 64; // Max number of lines allowed with command DisplayRows @@ -875,9 +880,11 @@ void DisplayText(void) break; case 's': // size sx - if (renderer) renderer->setTextSize(*cp&7); + var = atoiv(cp, &temp); + if (temp > TXT_MAX_SFAC) temp = TXT_MAX_SFAC; + if (renderer) renderer->setTextSize(temp); //else DisplaySetSize(*cp&3); - cp += 1; + cp+=var; break; case 'f': // font sx @@ -2011,7 +2018,7 @@ void CmndDisplayDimmer(void) { } void CmndDisplaySize(void) { - if ((XdrvMailbox.payload > 0) && (XdrvMailbox.payload <= 4)) { + if ((XdrvMailbox.payload > 0) && (XdrvMailbox.payload <= TXT_MAX_SFAC)) { Settings->display_size = XdrvMailbox.payload; if (renderer) renderer->setTextSize(Settings->display_size); //else DisplaySetSize(Settings->display_size); diff --git a/tasmota/xdsp_17_universal.ino b/tasmota/xdsp_17_universal.ino index b80205029..a37d5af5e 100644 --- a/tasmota/xdsp_17_universal.ino +++ b/tasmota/xdsp_17_universal.ino @@ -55,7 +55,7 @@ void Core2DisplayDim(uint8_t dim); #ifndef DISP_DESC_FILE //#define DISP_DESC_FILE "/dispdesc.txt" #define DISP_DESC_FILE "/display.ini" -#endif +#endif // DISP_DESC_FILE /*********************************************************************************************/ #ifdef DSP_ROM_DESC @@ -95,7 +95,7 @@ int8_t cs; AddLog(LOG_LEVEL_INFO, PSTR("DSP: File descriptor used")); } } -#endif +#endif // USE_UFILESYS #ifdef USE_SCRIPT @@ -212,8 +212,8 @@ int8_t cs; replacepin(&cp, Pin(GPIO_SPI_CLK, 1)); replacepin(&cp, Pin(GPIO_SPI_MOSI, 1)); replacepin(&cp, Pin(GPIO_SPI_DC, 1)); - replacepin(&cp, Pin(GPIO_BACKLIGHT, 1)); - replacepin(&cp, Pin(GPIO_OLED_RESET, 1)); + replacepin(&cp, Pin(GPIO_BACKLIGHT)); + replacepin(&cp, Pin(GPIO_OLED_RESET)); replacepin(&cp, Pin(GPIO_SPI_MISO, 1)); } else { // soft spi pins @@ -280,9 +280,9 @@ int8_t cs; else FT5206_Touch_Init(Wire1); #else if (!wire_n) FT5206_Touch_Init(Wire); -#endif +#endif // ESP32 } -#endif +#endif // USE_FT5206 #ifdef USE_XPT2046 cp = strstr(ddesc, ":TS,"); @@ -291,7 +291,7 @@ int8_t cs; uint8_t touch_cs = replacepin(&cp, Pin(GPIO_XPT2046_CS)); XPT2046_Touch_Init(touch_cs); } -#endif +#endif // USE_XPT2046 uint8_t inirot = Settings->display_rotate; @@ -314,18 +314,18 @@ int8_t cs; #ifdef USE_M5STACK_CORE2 renderer->SetPwrCB(Core2DisplayPower); renderer->SetDimCB(Core2DisplayDim); -#endif +#endif // USE_M5STACK_CORE2 renderer->DisplayInit(DISPLAY_INIT_MODE, Settings->display_size, inirot, Settings->display_font); Settings->display_width = renderer->width(); Settings->display_height = renderer->height(); - + ApplyDisplayDimmer(); #ifdef SHOW_SPLASH renderer->Splash(); -#endif +#endif // SHOW_SPLASH udisp_init_done = true; AddLog(LOG_LEVEL_INFO, PSTR("DSP: %s!"), renderer->devname()); From ba3ca8f905275f4ab733689f4ea49231e1951b7b Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Wed, 8 Dec 2021 16:34:00 +0100 Subject: [PATCH 39/97] dma default off --- lib/lib_display/UDisplay/uDisplay.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/lib_display/UDisplay/uDisplay.cpp b/lib/lib_display/UDisplay/uDisplay.cpp index 6f48d5796..8414795e0 100755 --- a/lib/lib_display/UDisplay/uDisplay.cpp +++ b/lib/lib_display/UDisplay/uDisplay.cpp @@ -76,6 +76,9 @@ uDisplay::uDisplay(char *lp) : Renderer(800, 600) { uint8_t section = 0; dsp_ncmds = 0; lut_num = 0; + lvgl_param.data = 0; + lvgl_param.fluslines = 40; + for (uint32_t cnt = 0; cnt < 5; cnt++) { lut_cnt[cnt] = 0; lut_cmd[cnt] = 0xff; From a06c01cd91d4d6543a74b194e000f58c35edf927 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 8 Dec 2021 16:49:35 +0100 Subject: [PATCH 40/97] Bump version 10.1.0.1 --- CHANGELOG.md | 12 +++++++--- README.md | 2 +- RELEASENOTES.md | 46 ++++----------------------------------- tasmota/tasmota_version.h | 2 +- 4 files changed, 15 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05b3373ea..76a9f1b05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,15 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - Development -## [10.0.0.4] +## [10.1.0.1] + +## [Released] + +## [10.1.0] 20211208 +- Release Noelle + + +## [10.0.0.4] 20211208 ### Added - (Internal) Support for FUNC_BUTTON_MULTI_PRESSED in (light)drivers - Support for GPE Multi color smart light as sold by Action in the Netherlands @@ -78,8 +86,6 @@ All notable changes to this project will be documented in this file. - Discovery of shutters (#13572) - ESP32-C3 OneWire as used by DS18x20 (#13583) -## [Released] - ## [10.0.0] 20211019 - Release Norman diff --git a/README.md b/README.md index 111536ba8..b41539308 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Easy initial installation of Tasmota can be performed using the [Tasmota WebInst ## Development -[![Dev Version](https://img.shields.io/badge/development%20version-v10.0.x.x-blue.svg)](https://github.com/arendst/Tasmota) +[![Dev Version](https://img.shields.io/badge/development%20version-v10.1.x.x-blue.svg)](https://github.com/arendst/Tasmota) [![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/) [![Tasmota CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22) [![Tasmota ESP32 CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20ESP32%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 3c72eaded..e7b2dcdb3 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -66,12 +66,12 @@ Latest released binaries can be downloaded from - http://ota.tasmota.com/tasmota/release Historical binaries can be downloaded from -- http://ota.tasmota.com/tasmota/release-10.0.0 +- http://ota.tasmota.com/tasmota/release-10.1.0 The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz`` ### ESP32 based -The following binary downloads have been compiled with ESP32/Arduino library core version **1.0.7.4**. +The following binary downloads have been compiled with ESP32/Arduino library core version **2.0.1.1**. - **tasmota32.bin** = The Tasmota version with most drivers including additional sensors and KNX for 4M+ flash. **RECOMMENDED RELEASE BINARY** - **tasmota32c3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C3 and 4M+ flash. @@ -90,7 +90,7 @@ Latest released binaries can be downloaded from - http://ota.tasmota.com/tasmota32/release Historical binaries can be downloaded from -- http://ota.tasmota.com/tasmota32/release-10.0.0 +- http://ota.tasmota.com/tasmota32/release-10.1.0 The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota32/release/tasmota32.bin`` @@ -100,51 +100,13 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo [Complete list](BUILDS.md) of available feature and sensors. -## Changelog v10.0.0.4 +## Changelog v10.1.0.1 ### Added -- Support for 1 second heartbeat GPIO -- Support for FUNC_BUTTON_MULTI_PRESSED in (light)drivers -- Command ``TcpConfig`` for TCPBridge protocol configuration [#13565](https://github.com/arendst/Tasmota/issues/13565) -- Support for HDC2010 temperature/humidity sensor by Luc Boudreau [#13633](https://github.com/arendst/Tasmota/issues/13633) -- WS2812 scheme 13 stairs effect [#13595](https://github.com/arendst/Tasmota/issues/13595) -- Command ``IfxPeriod `` to overrule ``Teleperiod`` for Influx messages [#13750](https://github.com/arendst/Tasmota/issues/13750) -- Support for GPE Multi color smart light as sold by Action in the Netherlands -- Shutter support for venetian blinds with tilt control -- Support for 74xx595 8-bit shift registers [#13921](https://github.com/arendst/Tasmota/issues/13921) -- ESP32 Autoconfiguration -- ESP32 Preliminary support for Tasmota Apps (.tapp extesions) -- ESP32 OTA over HTTPS -- ESP32 HTTPS support to ``WebQuery`` -- ESP32 Berry support for neopixel (WS2812, SK6812) -- ESP32 Berry ``import re`` regex module -- ESP32 Berry add module ``python_compat`` to be closer to Python syntax [#13428](https://github.com/arendst/Tasmota/issues/13428) -- ESP32 Proof of Concept Sonoff SPM with limited functionality (switching and energy monitoring) [#13447](https://github.com/arendst/Tasmota/issues/13447) ### Breaking Changed -- ESP32-S2 TSettings memory usage fixed to 4096 bytes regression from v9.5.0.8 ### Changed -- IRremoteESP8266 library from v2.7.20 to v2.8.0 -- ESP32 core library from v1.0.7.4 to v2.0.1.1 -- ESP32-C3 core library from v2.0.0-post to consolidated ESP32 core library -- ESP32 NimBLE to v.1.3.3 -- ESP32 toolchains changed from 8.4.0-2021r1 to 8.4.0-2021r2 -- Range conversion edge values -- ESP8266 Gratuitous ARP enabled and set to 60 seconds [#13623](https://github.com/arendst/Tasmota/issues/13623) -- File editor no-wrap [#13427](https://github.com/arendst/Tasmota/issues/13427) -- MQTT TLS dual mode (CA or fingeprint) in same firmware, ``SetOption132 1`` to force fingerprint -- ESP32 Ethernet hostname ending in ``_eth`` to ``-eth`` according to RFC952 ### Fixed -- Initial reset RTC memory based variables like EnergyToday and EnergyTotal -- SML compile error [#13441](https://github.com/arendst/Tasmota/issues/13441) -- GUI checkbox MQTT TLS not saved regression from v9.2.0.3 [#13442](https://github.com/arendst/Tasmota/issues/13442) -- Discovery of shutters [#13572](https://github.com/arendst/Tasmota/issues/13572) -- Tuya dimmer range issue [#13849](https://github.com/arendst/Tasmota/issues/13849) -- ESP32 Telegram compile error [#13435](https://github.com/arendst/Tasmota/issues/13435) -- ESP32-C3 OneWire as used by DS18x20 [#13583](https://github.com/arendst/Tasmota/issues/13583) -- ESP32 analog NTC temperature calculation [#13703](https://github.com/arendst/Tasmota/issues/13703) -- ESP32 compile error BLE EQ3 driver with core 2.0.x [#13948](https://github.com/arendst/Tasmota/issues/13948) ### Removed -- ILI9488 driver in favour of Universal Display driver [#13719](https://github.com/arendst/Tasmota/issues/13719) diff --git a/tasmota/tasmota_version.h b/tasmota/tasmota_version.h index be18bd75e..d03c4e088 100644 --- a/tasmota/tasmota_version.h +++ b/tasmota/tasmota_version.h @@ -20,6 +20,6 @@ #ifndef _TASMOTA_VERSION_H_ #define _TASMOTA_VERSION_H_ -const uint32_t VERSION = 0x0A000004; +const uint32_t VERSION = 0x0A010001; #endif // _TASMOTA_VERSION_H_ From 79b534d239ad8be233f6c15af1ee4b56b5e8bf24 Mon Sep 17 00:00:00 2001 From: tony-fav <42725386+tony-fav@users.noreply.github.com> Date: Wed, 8 Dec 2021 13:09:54 -0500 Subject: [PATCH 41/97] Enable SetOption92 for platforms beyond ESP8266 --- tasmota/xdrv_04_light.ino | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino index f032b8b67..b05386f4a 100644 --- a/tasmota/xdrv_04_light.ino +++ b/tasmota/xdrv_04_light.ino @@ -1855,10 +1855,12 @@ bool isChannelGammaCorrected(uint32_t channel) { if (channel >= Light.subtype) { return false; } // Out of range #ifdef ESP8266 if ((PHILIPS == TasmotaGlobal.module_type) || (Settings->flag4.pwm_ct_mode)) { +#else + if (Settings->flag4.pwm_ct_mode) { +#endif // ESP8266 if ((LST_COLDWARM == Light.subtype) && (1 == channel)) { return false; } // PMW reserved for CT if ((LST_RGBCW == Light.subtype) && (4 == channel)) { return false; } // PMW reserved for CT } -#endif // ESP8266 return true; } @@ -1866,10 +1868,12 @@ bool isChannelGammaCorrected(uint32_t channel) { bool isChannelCT(uint32_t channel) { #ifdef ESP8266 if ((PHILIPS == TasmotaGlobal.module_type) || (Settings->flag4.pwm_ct_mode)) { +#else + if (Settings->flag4.pwm_ct_mode) { +#endif // ESP8266 if ((LST_COLDWARM == Light.subtype) && (1 == channel)) { return true; } // PMW reserved for CT if ((LST_RGBCW == Light.subtype) && (4 == channel)) { return true; } // PMW reserved for CT } -#endif // ESP8266 return false; } @@ -2159,9 +2163,12 @@ bool calcGammaBulbs(uint16_t cur_col_10[5]) { // Now we know ct_10 and white_bri10 (gamma corrected if needed) -#ifdef ESP8266 if ((LST_COLDWARM == Light.subtype) || (LST_RGBCW == Light.subtype)) { +#ifdef ESP8266 if ((PHILIPS == TasmotaGlobal.module_type) || (Settings->flag4.pwm_ct_mode)) { // channel 1 is the color tone, mapped to cold channel (0..255) +#else + if (Settings->flag4.pwm_ct_mode) { // channel 1 is the color tone, mapped to cold channel (0..255) +#endif // ESP8266 pwm_ct = true; // Xiaomi Philips bulbs follow a different scheme: // channel 0=intensity, channel1=temperature @@ -2170,7 +2177,6 @@ bool calcGammaBulbs(uint16_t cur_col_10[5]) { return false; // avoid any interference } } -#endif // ESP8266 // Now see if we need to mix RGB and White // Valid only for LST_RGBW, LST_RGBCW, SetOption105 1, and white is zero (see doc) From 4cd926e0087b918c95510f95d2a5846134c9f750 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Thu, 9 Dec 2021 19:37:00 +0100 Subject: [PATCH 42/97] Berry pycoc optimization --- lib/libesp32/Berry/Makefile | 5 +- lib/libesp32/Berry/default/be_animate_lib.c | 248 +- lib/libesp32/Berry/default/be_autoconf_lib.c | 548 +-- lib/libesp32/Berry/default/be_display_lib.c | 4 +- lib/libesp32/Berry/default/be_driverlib.c | 62 +- lib/libesp32/Berry/default/be_energylib.c | 216 +- .../Berry/default/be_i2c_axp192_lib.c | 260 +- lib/libesp32/Berry/default/be_i2c_driverlib.c | 154 +- .../Berry/default/be_leds_animator_lib.c | 122 +- lib/libesp32/Berry/default/be_leds_lib.c | 522 +-- lib/libesp32/Berry/default/be_leds_ntv_lib.c | 10 +- .../Berry/default/be_lvgl_clock_icon_lib.c | 122 +- lib/libesp32/Berry/default/be_lvgl_glob_lib.c | 312 +- .../Berry/default/be_lvgl_signal_arcs_lib.c | 136 +- .../Berry/default/be_lvgl_signal_bars_lib.c | 140 +- .../default/be_lvgl_wifi_arcs_icon_lib.c | 42 +- .../Berry/default/be_lvgl_wifi_arcs_lib.c | 52 +- .../default/be_lvgl_wifi_bars_icon_lib.c | 42 +- .../Berry/default/be_lvgl_wifi_bars_lib.c | 52 +- lib/libesp32/Berry/default/be_modtab.c | 4 +- lib/libesp32/Berry/default/be_persist_lib.c | 218 +- lib/libesp32/Berry/default/be_python_compat.c | 38 +- lib/libesp32/Berry/default/be_tapp_lib.c | 48 +- lib/libesp32/Berry/default/be_tasmotalib.c | 3056 +++++++++-------- lib/libesp32/Berry/default/be_timer_class.c | 88 +- lib/libesp32/Berry/default/be_unishox_lib.c | 8 +- lib/libesp32/Berry/default/be_wirelib.c | 26 +- .../Berry/default/embedded/i2c_driver.be | 2 +- lib/libesp32/Berry/generate/be_const_strtab.h | 1073 ++++-- .../Berry/generate/be_const_strtab_def.h | 1570 ++++++--- .../generate/be_fixed_be_class_I2C_Driver.h | 27 - .../generate/be_fixed_be_class_aes_gcm.h | 4 +- .../be_fixed_be_class_audio_file_source.h | 2 +- .../be_fixed_be_class_audio_generator.h | 2 +- .../generate/be_fixed_be_class_audio_output.h | 2 +- .../Berry/generate/be_fixed_be_class_bytes.h | 14 +- .../Berry/generate/be_fixed_be_class_list.h | 10 +- .../Berry/generate/be_fixed_be_class_map.h | 2 +- .../Berry/generate/be_fixed_be_class_md5.h | 2 +- .../generate/be_fixed_be_class_tasmota.h | 58 +- .../be_fixed_be_class_tasmota_onewire.h | 2 +- .../be_fixed_be_class_tasmota_serial.h | 2 +- .../generate/be_fixed_be_class_webclient.h | 4 +- lib/libesp32/Berry/generate/be_fixed_energy.h | 21 - lib/libesp32/Berry/generate/be_fixed_global.h | 2 +- lib/libesp32/Berry/src/be_byteslib.c | 154 +- lib/libesp32/Berry/src/be_constobj.h | 6 + lib/libesp32/Berry/src/be_solidifylib.c | 91 +- lib/libesp32/Berry/src/berry.h | 4 +- .../Berry/tools/pycoc/block_builder.py | 152 + lib/libesp32/Berry/tools/pycoc/coc_parser.py | 146 + lib/libesp32/Berry/tools/pycoc/coc_string.py | 40 + .../Berry/tools/pycoc/coc_string_test.py | 18 + lib/libesp32/Berry/tools/pycoc/hash_map.py | 162 + lib/libesp32/Berry/tools/pycoc/macro_table.py | 50 + lib/libesp32/Berry/tools/pycoc/main.py | 64 + lib/libesp32/Berry/tools/pycoc/str_build.py | 123 + .../Zip-readonly-FS/src/ZipReadFS.cpp | 14 +- tasmota/xdrv_52_3_berry_display.ino | 4 +- tasmota/xdrv_52_3_berry_unishox.ino | 8 +- 60 files changed, 6073 insertions(+), 4297 deletions(-) delete mode 100644 lib/libesp32/Berry/generate/be_fixed_be_class_I2C_Driver.h delete mode 100644 lib/libesp32/Berry/generate/be_fixed_energy.h create mode 100644 lib/libesp32/Berry/tools/pycoc/block_builder.py create mode 100644 lib/libesp32/Berry/tools/pycoc/coc_parser.py create mode 100644 lib/libesp32/Berry/tools/pycoc/coc_string.py create mode 100644 lib/libesp32/Berry/tools/pycoc/coc_string_test.py create mode 100644 lib/libesp32/Berry/tools/pycoc/hash_map.py create mode 100644 lib/libesp32/Berry/tools/pycoc/macro_table.py create mode 100644 lib/libesp32/Berry/tools/pycoc/main.py create mode 100644 lib/libesp32/Berry/tools/pycoc/str_build.py diff --git a/lib/libesp32/Berry/Makefile b/lib/libesp32/Berry/Makefile index 531661bc2..f9d61125d 100644 --- a/lib/libesp32/Berry/Makefile +++ b/lib/libesp32/Berry/Makefile @@ -10,6 +10,8 @@ SRCPATH = src default GENERATE = generate CONFIG = default/berry_conf.h COC = tools/coc/coc +PY = python3 +PYCOC = tools/pycoc/main.py CONST_TAB = $(GENERATE)/be_const_strtab.h MAKE_COC = $(MAKE) -C tools/coc @@ -18,6 +20,7 @@ ifeq ($(OS), Windows_NT) # Windows LFLAGS += -Wl,--out-implib,berry.lib # export symbols lib for dll linked TARGET := $(TARGET).exe COC := $(COC).exe + PY := $(PY).exe else CFLAGS += -DUSE_READLINE_LIB LIBS += -lreadline -ldl @@ -92,7 +95,7 @@ uninstall: prebuild: $(COC) $(GENERATE) $(MSG) [Prebuild] generate resources - $(Q) $(COC) -o $(GENERATE) $(SRCPATH) -c $(CONFIG) + $(Q) $(PY) $(PYCOC) -o $(GENERATE) $(SRCPATH) -c $(CONFIG) $(MSG) done clean: diff --git a/lib/libesp32/Berry/default/be_animate_lib.c b/lib/libesp32/Berry/default/be_animate_lib.c index db6052653..398f87b66 100644 --- a/lib/libesp32/Berry/default/be_animate_lib.c +++ b/lib/libesp32/Berry/default/be_animate_lib.c @@ -20,17 +20,17 @@ be_local_closure(Animate_rotate_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_string("init", 380752755, 4), - /* K1 */ be_nested_string("closure", 1548407746, 7), - /* K2 */ be_nested_string("code", -114201356, 4), - /* K3 */ be_nested_string("push", -2022703139, 4), - /* K4 */ be_nested_string("animate", -409180496, 7), - /* K5 */ be_nested_string("ins_ramp", 1068049360, 8), - /* K6 */ be_nested_string("ins_goto", 1342843963, 8), + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(closure), + /* K2 */ be_nested_str(code), + /* K3 */ be_nested_str(push), + /* K4 */ be_nested_str(animate), + /* K5 */ be_nested_str(ins_ramp), + /* K6 */ be_nested_str(ins_goto), /* K7 */ be_const_int(0), }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[25]) { /* code */ 0x60140003, // 0000 GETGBL R5 G3 0x5C180000, // 0001 MOVE R6 R0 @@ -72,9 +72,9 @@ be_local_class(Animate_rotate, &be_class_Animate_engine, be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("init", 380752755, 4, -1), be_const_closure(Animate_rotate_init_closure) }, + { be_const_key(init, -1), be_const_closure(Animate_rotate_init_closure) }, })), - (be_nested_const_str("Animate_rotate", -787188142, 14)) + be_str_literal("Animate_rotate") ); /******************************************************************** @@ -91,15 +91,15 @@ be_local_closure(Animate_from_to_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_string("init", 380752755, 4), - /* K1 */ be_nested_string("closure", 1548407746, 7), - /* K2 */ be_nested_string("code", -114201356, 4), - /* K3 */ be_nested_string("push", -2022703139, 4), - /* K4 */ be_nested_string("animate", -409180496, 7), - /* K5 */ be_nested_string("ins_ramp", 1068049360, 8), + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(closure), + /* K2 */ be_nested_str(code), + /* K3 */ be_nested_str(push), + /* K4 */ be_nested_str(animate), + /* K5 */ be_nested_str(ins_ramp), }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[16]) { /* code */ 0x60140003, // 0000 GETGBL R5 G3 0x5C180000, // 0001 MOVE R6 R0 @@ -132,9 +132,9 @@ be_local_class(Animate_from_to, &be_class_Animate_engine, be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("init", 380752755, 4, -1), be_const_closure(Animate_from_to_init_closure) }, + { be_const_key(init, -1), be_const_closure(Animate_from_to_init_closure) }, })), - (be_nested_const_str("Animate_from_to", 1699049867, 15)) + be_str_literal("Animate_from_to") ); /******************************************************************** @@ -151,18 +151,18 @@ be_local_closure(Animate_back_forth_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 9]) { /* constants */ - /* K0 */ be_nested_string("init", 380752755, 4), - /* K1 */ be_nested_string("closure", 1548407746, 7), - /* K2 */ be_nested_string("code", -114201356, 4), - /* K3 */ be_nested_string("push", -2022703139, 4), - /* K4 */ be_nested_string("animate", -409180496, 7), - /* K5 */ be_nested_string("ins_ramp", 1068049360, 8), + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(closure), + /* K2 */ be_nested_str(code), + /* K3 */ be_nested_str(push), + /* K4 */ be_nested_str(animate), + /* K5 */ be_nested_str(ins_ramp), /* K6 */ be_const_int(2), - /* K7 */ be_nested_string("ins_goto", 1342843963, 8), + /* K7 */ be_nested_str(ins_goto), /* K8 */ be_const_int(0), }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[34]) { /* code */ 0x60140003, // 0000 GETGBL R5 G3 0x5C180000, // 0001 MOVE R6 R0 @@ -213,9 +213,9 @@ be_local_class(Animate_back_forth, &be_class_Animate_engine, be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("init", 380752755, 4, -1), be_const_closure(Animate_back_forth_init_closure) }, + { be_const_key(init, -1), be_const_closure(Animate_back_forth_init_closure) }, })), - (be_nested_const_str("Animate_back_forth", 5319526, 18)) + be_str_literal("Animate_back_forth") ); /******************************************************************** @@ -232,12 +232,12 @@ be_local_closure(Animate_ins_goto_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("pc_rel", 991921176, 6), - /* K1 */ be_nested_string("pc_abs", 920256495, 6), - /* K2 */ be_nested_string("duration", 799079693, 8), + /* K0 */ be_nested_str(pc_rel), + /* K1 */ be_nested_str(pc_abs), + /* K2 */ be_nested_str(duration), }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x90020001, // 0000 SETMBR R0 K0 R1 0x90020202, // 0001 SETMBR R0 K1 R2 @@ -257,12 +257,12 @@ be_local_class(Animate_ins_goto, NULL, be_nested_map(4, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("pc_rel", 991921176, 6, -1), be_const_var(0) }, - { be_nested_key("duration", 799079693, 8, -1), be_const_var(2) }, - { be_nested_key("pc_abs", 920256495, 6, -1), be_const_var(1) }, - { be_nested_key("init", 380752755, 4, 2), be_const_closure(Animate_ins_goto_init_closure) }, + { be_const_key(pc_rel, -1), be_const_var(0) }, + { be_const_key(duration, -1), be_const_var(2) }, + { be_const_key(pc_abs, -1), be_const_var(1) }, + { be_const_key(init, 2), be_const_closure(Animate_ins_goto_init_closure) }, })), - (be_nested_const_str("Animate_ins_goto", 1667367043, 16)) + be_str_literal("Animate_ins_goto") ); /******************************************************************** @@ -279,12 +279,12 @@ be_local_closure(Animate_ins_ramp_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("a", -468965076, 1), - /* K1 */ be_nested_string("b", -418632219, 1), - /* K2 */ be_nested_string("duration", 799079693, 8), + /* K0 */ be_nested_str(a), + /* K1 */ be_nested_str(b), + /* K2 */ be_nested_str(duration), }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x90020001, // 0000 SETMBR R0 K0 R1 0x90020202, // 0001 SETMBR R0 K1 R2 @@ -304,12 +304,12 @@ be_local_class(Animate_ins_ramp, NULL, be_nested_map(4, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("a", -468965076, 1, -1), be_const_var(0) }, - { be_nested_key("b", -418632219, 1, 2), be_const_var(1) }, - { be_nested_key("duration", 799079693, 8, -1), be_const_var(2) }, - { be_nested_key("init", 380752755, 4, -1), be_const_closure(Animate_ins_ramp_init_closure) }, + { be_const_key(a, -1), be_const_var(0) }, + { be_const_key(b, 2), be_const_var(1) }, + { be_const_key(duration, -1), be_const_var(2) }, + { be_const_key(init, -1), be_const_closure(Animate_ins_ramp_init_closure) }, })), - (be_nested_const_str("Animate_ins_ramp", 785058280, 16)) + be_str_literal("Animate_ins_ramp") ); /******************************************************************** @@ -326,15 +326,15 @@ be_local_closure(Animate_engine_run, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_string("tasmota", 424643812, 7), - /* K1 */ be_nested_string("millis", 1214679063, 6), - /* K2 */ be_nested_string("value", 1113510858, 5), - /* K3 */ be_nested_string("ins_time", -1314721743, 8), - /* K4 */ be_nested_string("running", 343848780, 7), - /* K5 */ be_nested_string("add_driver", 1654458371, 10), + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(millis), + /* K2 */ be_nested_str(value), + /* K3 */ be_nested_str(ins_time), + /* K4 */ be_nested_str(running), + /* K5 */ be_nested_str(add_driver), }), - (be_nested_const_str("run", 718098122, 3)), - ((bstring*) &be_const_str_input), + &be_const_str_run, + &be_const_str_solidified, ( &(const binstruction[19]) { /* code */ 0x4C0C0000, // 0000 LDNIL R3 0x1C0C0203, // 0001 EQ R3 R1 R3 @@ -375,14 +375,14 @@ be_local_closure(Animate_engine_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_string("code", -114201356, 4), - /* K1 */ be_nested_string("pc", 1313756516, 2), + /* K0 */ be_nested_str(code), + /* K1 */ be_nested_str(pc), /* K2 */ be_const_int(0), - /* K3 */ be_nested_string("ins_time", -1314721743, 8), - /* K4 */ be_nested_string("running", 343848780, 7), + /* K3 */ be_nested_str(ins_time), + /* K4 */ be_nested_str(running), }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[ 8]) { /* code */ 0x60040012, // 0000 GETGBL R1 G18 0x7C040000, // 0001 CALL R1 0 @@ -412,12 +412,12 @@ be_local_closure(Animate_engine_autorun, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("run", 718098122, 3), - /* K1 */ be_nested_string("tasmota", 424643812, 7), - /* K2 */ be_nested_string("add_driver", 1654458371, 10), + /* K0 */ be_nested_str(run), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(add_driver), }), - (be_nested_const_str("autorun", 1447527407, 7)), - ((bstring*) &be_const_str_input), + &be_const_str_autorun, + &be_const_str_solidified, ( &(const binstruction[ 9]) { /* code */ 0x8C0C0100, // 0000 GETMET R3 R0 K0 0x5C140200, // 0001 MOVE R5 R1 @@ -448,12 +448,12 @@ be_local_closure(Animate_engine_stop, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("running", 343848780, 7), - /* K1 */ be_nested_string("tasmota", 424643812, 7), - /* K2 */ be_nested_string("remove_driver", 1030243768, 13), + /* K0 */ be_nested_str(running), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(remove_driver), }), - (be_nested_const_str("stop", -883741979, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_stop, + &be_const_str_solidified, ( &(const binstruction[ 7]) { /* code */ 0x50040000, // 0000 LDBOOL R1 0 0 0x90020001, // 0001 SETMBR R0 K0 R1 @@ -482,10 +482,10 @@ be_local_closure(Animate_engine_is_running, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("running", 343848780, 7), + /* K0 */ be_nested_str(running), }), - (be_nested_const_str("is_running", -2068120035, 10)), - ((bstring*) &be_const_str_input), + &be_const_str_is_running, + &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x80040200, // 0001 RET 1 R1 @@ -509,10 +509,10 @@ be_local_closure(Animate_engine_every_50ms, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("animate", -409180496, 7), + /* K0 */ be_nested_str(animate), }), - (be_nested_const_str("every_50ms", -1911083288, 10)), - ((bstring*) &be_const_str_input), + &be_const_str_every_50ms, + &be_const_str_solidified, ( &(const binstruction[ 3]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x7C040200, // 0001 CALL R1 1 @@ -537,31 +537,31 @@ be_local_closure(Animate_engine_animate, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[22]) { /* constants */ - /* K0 */ be_nested_string("running", 343848780, 7), - /* K1 */ be_nested_string("tasmota", 424643812, 7), - /* K2 */ be_nested_string("millis", 1214679063, 6), - /* K3 */ be_nested_string("ins_time", -1314721743, 8), - /* K4 */ be_nested_string("pc", 1313756516, 2), - /* K5 */ be_nested_string("code", -114201356, 4), + /* K0 */ be_nested_str(running), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(millis), + /* K3 */ be_nested_str(ins_time), + /* K4 */ be_nested_str(pc), + /* K5 */ be_nested_str(code), /* K6 */ be_const_int(0), - /* K7 */ be_nested_string("internal_error", -1775809127, 14), - /* K8 */ be_nested_string("Animate pc is out of range", 1854929421, 26), - /* K9 */ be_nested_string("animate", -409180496, 7), - /* K10 */ be_nested_string("ins_ramp", 1068049360, 8), - /* K11 */ be_nested_string("closure", 1548407746, 7), - /* K12 */ be_nested_string("duration", 799079693, 8), - /* K13 */ be_nested_string("value", 1113510858, 5), - /* K14 */ be_nested_string("scale_uint", -1204156202, 10), - /* K15 */ be_nested_string("a", -468965076, 1), - /* K16 */ be_nested_string("b", -418632219, 1), + /* K7 */ be_nested_str(internal_error), + /* K8 */ be_nested_str(Animate_X20pc_X20is_X20out_X20of_X20range), + /* K9 */ be_nested_str(animate), + /* K10 */ be_nested_str(ins_ramp), + /* K11 */ be_nested_str(closure), + /* K12 */ be_nested_str(duration), + /* K13 */ be_nested_str(value), + /* K14 */ be_nested_str(scale_uint), + /* K15 */ be_nested_str(a), + /* K16 */ be_nested_str(b), /* K17 */ be_const_int(1), - /* K18 */ be_nested_string("ins_goto", 1342843963, 8), - /* K19 */ be_nested_string("pc_rel", 991921176, 6), - /* K20 */ be_nested_string("pc_abs", 920256495, 6), - /* K21 */ be_nested_string("unknown instruction", 1093911841, 19), + /* K18 */ be_nested_str(ins_goto), + /* K19 */ be_nested_str(pc_rel), + /* K20 */ be_nested_str(pc_abs), + /* K21 */ be_nested_str(unknown_X20instruction), }), - (be_nested_const_str("animate", -409180496, 7)), - ((bstring*) &be_const_str_input), + &be_const_str_animate, + &be_const_str_solidified, ( &(const binstruction[99]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x740A0000, // 0001 JMPT R2 #0003 @@ -676,21 +676,21 @@ be_local_class(Animate_engine, NULL, be_nested_map(13, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("code", -114201356, 4, -1), be_const_var(0) }, - { be_nested_key("run", 718098122, 3, 4), be_const_closure(Animate_engine_run_closure) }, - { be_nested_key("running", 343848780, 7, 8), be_const_var(4) }, - { be_nested_key("init", 380752755, 4, -1), be_const_closure(Animate_engine_init_closure) }, - { be_nested_key("autorun", 1447527407, 7, -1), be_const_closure(Animate_engine_autorun_closure) }, - { be_nested_key("value", 1113510858, 5, -1), be_const_var(5) }, - { be_nested_key("stop", -883741979, 4, 3), be_const_closure(Animate_engine_stop_closure) }, - { be_nested_key("pc", 1313756516, 2, -1), be_const_var(2) }, - { be_nested_key("is_running", -2068120035, 10, 11), be_const_closure(Animate_engine_is_running_closure) }, - { be_nested_key("every_50ms", -1911083288, 10, 10), be_const_closure(Animate_engine_every_50ms_closure) }, - { be_nested_key("animate", -409180496, 7, -1), be_const_closure(Animate_engine_animate_closure) }, - { be_nested_key("closure", 1548407746, 7, -1), be_const_var(1) }, - { be_nested_key("ins_time", -1314721743, 8, 9), be_const_var(3) }, + { be_const_key(code, -1), be_const_var(0) }, + { be_const_key(run, 4), be_const_closure(Animate_engine_run_closure) }, + { be_const_key(running, 8), be_const_var(4) }, + { be_const_key(init, -1), be_const_closure(Animate_engine_init_closure) }, + { be_const_key(autorun, -1), be_const_closure(Animate_engine_autorun_closure) }, + { be_const_key(value, -1), be_const_var(5) }, + { be_const_key(stop, 3), be_const_closure(Animate_engine_stop_closure) }, + { be_const_key(pc, -1), be_const_var(2) }, + { be_const_key(is_running, 11), be_const_closure(Animate_engine_is_running_closure) }, + { be_const_key(every_50ms, 10), be_const_closure(Animate_engine_every_50ms_closure) }, + { be_const_key(animate, -1), be_const_closure(Animate_engine_animate_closure) }, + { be_const_key(closure, -1), be_const_var(1) }, + { be_const_key(ins_time, 9), be_const_var(3) }, })), - (be_nested_const_str("Animate_engine", 1498417667, 14)) + be_str_literal("Animate_engine") ); /******************************************************************** @@ -700,12 +700,12 @@ be_local_module(animate, "animate", be_nested_map(6, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("rotate", -1510671094, 6, 2), be_const_class(be_class_Animate_rotate) }, - { be_nested_key("from_to", 21625507, 7, 3), be_const_class(be_class_Animate_from_to) }, - { be_nested_key("back_forth", -1629925234, 10, -1), be_const_class(be_class_Animate_back_forth) }, - { be_nested_key("ins_goto", 1342843963, 8, -1), be_const_class(be_class_Animate_ins_goto) }, - { be_nested_key("ins_ramp", 1068049360, 8, -1), be_const_class(be_class_Animate_ins_ramp) }, - { be_nested_key("engine", -301606853, 6, -1), be_const_class(be_class_Animate_engine) }, + { be_const_key(rotate, 2), be_const_class(be_class_Animate_rotate) }, + { be_const_key(from_to, 3), be_const_class(be_class_Animate_from_to) }, + { be_const_key(back_forth, -1), be_const_class(be_class_Animate_back_forth) }, + { be_const_key(ins_goto, -1), be_const_class(be_class_Animate_ins_goto) }, + { be_const_key(ins_ramp, -1), be_const_class(be_class_Animate_ins_ramp) }, + { be_const_key(engine, -1), be_const_class(be_class_Animate_engine) }, })) ); BE_EXPORT_VARIABLE be_define_const_native_module(animate); diff --git a/lib/libesp32/Berry/default/be_autoconf_lib.c b/lib/libesp32/Berry/default/be_autoconf_lib.c index 3d864a988..da41707c7 100644 --- a/lib/libesp32/Berry/default/be_autoconf_lib.c +++ b/lib/libesp32/Berry/default/be_autoconf_lib.c @@ -10,7 +10,7 @@ /******************************************************************** ** Solidified function: page_autoconf_ctl ********************************************************************/ -be_local_closure(page_autoconf_ctl, /* name */ +be_local_closure(Autoconf_page_autoconf_ctl, /* name */ be_nested_proto( 13, /* nstack */ 1, /* argc */ @@ -21,50 +21,50 @@ be_local_closure(page_autoconf_ctl, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[41]) { /* constants */ - /* K0 */ be_nested_string("webserver", 1572454038, 9), - /* K1 */ be_nested_string("string", 398550328, 6), - /* K2 */ be_nested_string("path", -2071507658, 4), - /* K3 */ be_nested_string("check_privileged_access", -602033328, 23), - /* K4 */ be_nested_string("has_arg", 424878688, 7), - /* K5 */ be_nested_string("reapply", -516027964, 7), - /* K6 */ be_nested_string("tasmota", 424643812, 7), - /* K7 */ be_nested_string("log", 1062293841, 3), - /* K8 */ be_nested_string("CFG: removing first time marker", 2125556683, 31), + /* K0 */ be_nested_str(webserver), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(path), + /* K3 */ be_nested_str(check_privileged_access), + /* K4 */ be_nested_str(has_arg), + /* K5 */ be_nested_str(reapply), + /* K6 */ be_nested_str(tasmota), + /* K7 */ be_nested_str(log), + /* K8 */ be_nested_str(CFG_X3A_X20removing_X20first_X20time_X20marker), /* K9 */ be_const_int(2), - /* K10 */ be_nested_string("clear_first_time", 632769909, 16), - /* K11 */ be_nested_string("redirect", 389758641, 8), - /* K12 */ be_nested_string("/?rst=", 580074707, 6), - /* K13 */ be_nested_string("zip", -1417514060, 3), - /* K14 */ be_nested_string("CFG: removing autoconf files", -280262326, 28), - /* K15 */ be_nested_string("delete_all_configs", -1912899718, 18), - /* K16 */ be_nested_string("arg", 1047474471, 3), - /* K17 */ be_nested_string("reset", 1695364032, 5), - /* K18 */ be_nested_string("format", -1180859054, 6), - /* K19 */ be_nested_string("https://raw.githubusercontent.com/tasmota/autoconf/main/%s/%s.autoconf", -1551440987, 70), - /* K20 */ be_nested_string("arch", -1342162999, 4), - /* K21 */ be_nested_string("CFG: downloading '%s'", 589480701, 21), - /* K22 */ be_nested_string("%s.autoconf", -734583772, 11), - /* K23 */ be_nested_string("webclient", -218578150, 9), - /* K24 */ be_nested_string("begin", 1748273790, 5), - /* K25 */ be_nested_string("GET", -1763262857, 3), - /* K26 */ be_nested_string("return code=%i", 2127454401, 14), - /* K27 */ be_nested_string("connection_error", 1358926260, 16), - /* K28 */ be_nested_string("write_file", -1117308417, 10), - /* K29 */ be_nested_string("close", 667630371, 5), - /* K30 */ be_nested_string("value_error", 773297791, 11), - /* K31 */ be_nested_string("Unknown command", 1830905432, 15), - /* K32 */ be_nested_string("CFG: Exception> '%s' - %s", 1228874553, 25), - /* K33 */ be_nested_string("content_start", -1357458227, 13), - /* K34 */ be_nested_string("Parameter error", -454925258, 15), - /* K35 */ be_nested_string("content_send_style", 1087907647, 18), - /* K36 */ be_nested_string("content_send", 1673733649, 12), - /* K37 */ be_nested_string("

Exception:
'%s'
%s

", -42402214, 59), - /* K38 */ be_nested_string("content_button", 1956476087, 14), - /* K39 */ be_nested_string("BUTTON_CONFIGURATION", 70820856, 20), - /* K40 */ be_nested_string("content_stop", 658554751, 12), + /* K10 */ be_nested_str(clear_first_time), + /* K11 */ be_nested_str(redirect), + /* K12 */ be_nested_str(_X2F_X3Frst_X3D), + /* K13 */ be_nested_str(zip), + /* K14 */ be_nested_str(CFG_X3A_X20removing_X20autoconf_X20files), + /* K15 */ be_nested_str(delete_all_configs), + /* K16 */ be_nested_str(arg), + /* K17 */ be_nested_str(reset), + /* K18 */ be_nested_str(format), + /* K19 */ be_nested_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf), + /* K20 */ be_nested_str(arch), + /* K21 */ be_nested_str(CFG_X3A_X20downloading_X20_X27_X25s_X27), + /* K22 */ be_nested_str(_X25s_X2Eautoconf), + /* K23 */ be_nested_str(webclient), + /* K24 */ be_nested_str(begin), + /* K25 */ be_nested_str(GET), + /* K26 */ be_nested_str(return_X20code_X3D_X25i), + /* K27 */ be_nested_str(connection_error), + /* K28 */ be_nested_str(write_file), + /* K29 */ be_nested_str(close), + /* K30 */ be_nested_str(value_error), + /* K31 */ be_nested_str(Unknown_X20command), + /* K32 */ be_nested_str(CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s), + /* K33 */ be_nested_str(content_start), + /* K34 */ be_nested_str(Parameter_X20error), + /* K35 */ be_nested_str(content_send_style), + /* K36 */ be_nested_str(content_send), + /* K37 */ be_nested_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E), + /* K38 */ be_nested_str(content_button), + /* K39 */ be_nested_str(BUTTON_CONFIGURATION), + /* K40 */ be_nested_str(content_stop), }), - (be_nested_const_str("page_autoconf_ctl", -1841585800, 17)), - ((bstring*) &be_const_str_input), + &be_const_str_page_autoconf_ctl, + &be_const_str_solidified, ( &(const binstruction[117]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0xA40A0200, // 0001 IMPORT R2 K1 @@ -192,7 +192,7 @@ be_local_closure(page_autoconf_ctl, /* name */ /******************************************************************** ** Solidified function: autoexec ********************************************************************/ -be_local_closure(autoexec, /* name */ +be_local_closure(Autoconf_autoexec, /* name */ be_nested_proto( 9, /* nstack */ 1, /* argc */ @@ -203,41 +203,41 @@ be_local_closure(autoexec, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[32]) { /* constants */ - /* K0 */ be_nested_string("_archive", -290407892, 8), - /* K1 */ be_nested_string("path", -2071507658, 4), - /* K2 */ be_nested_string("#init.bat", -997372219, 9), - /* K3 */ be_nested_string("is_first_time", 275242384, 13), - /* K4 */ be_nested_string("exists", 1002329533, 6), - /* K5 */ be_nested_string("set_first_time", -1183719746, 14), - /* K6 */ be_nested_string("run_bat", -1758063998, 7), - /* K7 */ be_nested_string("tasmota", 424643812, 7), - /* K8 */ be_nested_string("log", 1062293841, 3), - /* K9 */ be_nested_string("CFG: 'init.bat' done, restarting", 1569670677, 32), + /* K0 */ be_nested_str(_archive), + /* K1 */ be_nested_str(path), + /* K2 */ be_nested_str(_X23init_X2Ebat), + /* K3 */ be_nested_str(is_first_time), + /* K4 */ be_nested_str(exists), + /* K5 */ be_nested_str(set_first_time), + /* K6 */ be_nested_str(run_bat), + /* K7 */ be_nested_str(tasmota), + /* K8 */ be_nested_str(log), + /* K9 */ be_nested_str(CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting), /* K10 */ be_const_int(2), - /* K11 */ be_nested_string("cmd", -158181397, 3), - /* K12 */ be_nested_string("Restart 1", -790511441, 9), - /* K13 */ be_nested_string("#display.ini", 182218220, 12), - /* K14 */ be_nested_string("gpio", -1656812038, 4), - /* K15 */ be_nested_string("pin_used", -261112684, 8), - /* K16 */ be_nested_string("OPTION_A", 1133299440, 8), - /* K17 */ be_nested_string("display.ini", -1648793295, 11), - /* K18 */ be_nested_string("CFG: skipping 'display.ini' because already present in file-system", -329418032, 66), - /* K19 */ be_nested_string("display", 1164572437, 7), - /* K20 */ be_nested_string("r", -150190315, 1), - /* K21 */ be_nested_string("read", -824204347, 4), - /* K22 */ be_nested_string("close", 667630371, 5), - /* K23 */ be_nested_string("start", 1697318111, 5), - /* K24 */ be_nested_string("#autoexec.bat", -912076799, 13), - /* K25 */ be_nested_string("CFG: running ", -1816632762, 13), + /* K11 */ be_nested_str(cmd), + /* K12 */ be_nested_str(Restart_X201), + /* K13 */ be_nested_str(_X23display_X2Eini), + /* K14 */ be_nested_str(gpio), + /* K15 */ be_nested_str(pin_used), + /* K16 */ be_nested_str(OPTION_A), + /* K17 */ be_nested_str(display_X2Eini), + /* K18 */ be_nested_str(CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem), + /* K19 */ be_nested_str(display), + /* K20 */ be_nested_str(r), + /* K21 */ be_nested_str(read), + /* K22 */ be_nested_str(close), + /* K23 */ be_nested_str(start), + /* K24 */ be_nested_str(_X23autoexec_X2Ebat), + /* K25 */ be_nested_str(CFG_X3A_X20running_X20), /* K26 */ be_const_int(3), - /* K27 */ be_nested_string("CFG: ran ", -715396824, 10), - /* K28 */ be_nested_string("#autoexec.be", 1181757091, 12), - /* K29 */ be_nested_string("CFG: loading ", -284605793, 13), - /* K30 */ be_nested_string("load", -435725847, 4), - /* K31 */ be_nested_string("CFG: loaded ", -584693758, 13), + /* K27 */ be_nested_str(CFG_X3A_X20ran_X20_X20), + /* K28 */ be_nested_str(_X23autoexec_X2Ebe), + /* K29 */ be_nested_str(CFG_X3A_X20loading_X20), + /* K30 */ be_nested_str(load), + /* K31 */ be_nested_str(CFG_X3A_X20loaded_X20_X20), }), - (be_nested_const_str("autoexec", -618105405, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_autoexec, + &be_const_str_solidified, ( &(const binstruction[107]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x4C080000, // 0001 LDNIL R2 @@ -355,7 +355,7 @@ be_local_closure(autoexec, /* name */ /******************************************************************** ** Solidified function: run_bat ********************************************************************/ -be_local_closure(run_bat, /* name */ +be_local_closure(Autoconf_run_bat, /* name */ be_nested_proto( 13, /* nstack */ 2, /* argc */ @@ -366,19 +366,19 @@ be_local_closure(run_bat, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[10]) { /* constants */ - /* K0 */ be_nested_string("string", 398550328, 6), - /* K1 */ be_nested_string("r", -150190315, 1), - /* K2 */ be_nested_string("readline", 1212709927, 8), + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(r), + /* K2 */ be_nested_str(readline), /* K3 */ be_const_int(0), - /* K4 */ be_nested_string("\n", 252472541, 1), - /* K5 */ be_nested_string("tasmota", 424643812, 7), - /* K6 */ be_nested_string("cmd", -158181397, 3), - /* K7 */ be_nested_string("close", 667630371, 5), - /* K8 */ be_nested_string("format", -1180859054, 6), - /* K9 */ be_nested_string("CFG: could not run %s (%s - %s)", 1428829580, 31), + /* K4 */ be_nested_str(_X0A), + /* K5 */ be_nested_str(tasmota), + /* K6 */ be_nested_str(cmd), + /* K7 */ be_nested_str(close), + /* K8 */ be_nested_str(format), + /* K9 */ be_nested_str(CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29), }), - (be_nested_const_str("run_bat", -1758063998, 7)), - ((bstring*) &be_const_str_input), + &be_const_str_run_bat, + &be_const_str_solidified, ( &(const binstruction[54]) { /* code */ 0xA40A0000, // 0000 IMPORT R2 K0 0x4C0C0000, // 0001 LDNIL R3 @@ -443,7 +443,7 @@ be_local_closure(run_bat, /* name */ /******************************************************************** ** Solidified function: page_autoconf_mgr ********************************************************************/ -be_local_closure(page_autoconf_mgr, /* name */ +be_local_closure(Autoconf_page_autoconf_mgr, /* name */ be_nested_proto( 19, /* nstack */ 1, /* argc */ @@ -454,48 +454,48 @@ be_local_closure(page_autoconf_mgr, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[39]) { /* constants */ - /* K0 */ be_nested_string("webserver", 1572454038, 9), - /* K1 */ be_nested_string("string", 398550328, 6), - /* K2 */ be_nested_string("check_privileged_access", -602033328, 23), - /* K3 */ be_nested_string("content_start", -1357458227, 13), - /* K4 */ be_nested_string("Auto-configuration", 1665006109, 18), - /* K5 */ be_nested_string("content_send_style", 1087907647, 18), - /* K6 */ be_nested_string("content_send", 1673733649, 12), - /* K7 */ be_nested_string("

 (This feature requires an internet connection)

", -1575700810, 74), - /* K8 */ be_nested_string("get_current_module_path", -1088293888, 23), - /* K9 */ be_nested_string("tr", 1195724803, 2), - /* K10 */ be_nested_string("get_current_module_name", -1915696556, 23), - /* K11 */ be_nested_string("_", -636741266, 1), - /* K12 */ be_nested_string(" ", 621580159, 1), - /* K13 */ be_nested_string("_error", 1132109656, 6), - /* K14 */ be_nested_string("<Error: apply new or remove>", -1439459347, 34), - /* K15 */ be_nested_string("<None>", -1692801798, 12), - /* K16 */ be_nested_string("
", 842307168, 77), - /* K17 */ be_nested_string("format", -1180859054, 6), - /* K18 */ be_nested_string(" Current auto-configuration", -82466516, 82), - /* K19 */ be_nested_string("

Current configuration:

%s

", -179311535, 46), - /* K20 */ be_nested_string("

", 232646018, 57), - /* K22 */ be_nested_string("", -1147033080, 82), - /* K23 */ be_nested_string("

", -748395557, 11), - /* K24 */ be_nested_string("

", 2052843416, 25), - /* K25 */ be_nested_string(" Select new auto-configuration", 1926223891, 80), - /* K26 */ be_nested_string("

", -502554737, 94), - /* K28 */ be_nested_string("
", 1336654704, 49), - /* K29 */ be_nested_string("

", 1863865923, 16), - /* K35 */ be_nested_string("", 1205771629, 72), - /* K36 */ be_nested_string("content_button", 1956476087, 14), - /* K37 */ be_nested_string("BUTTON_CONFIGURATION", 70820856, 20), - /* K38 */ be_nested_string("content_stop", 658554751, 12), + /* K0 */ be_nested_str(webserver), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(check_privileged_access), + /* K3 */ be_nested_str(content_start), + /* K4 */ be_nested_str(Auto_X2Dconfiguration), + /* K5 */ be_nested_str(content_send_style), + /* K6 */ be_nested_str(content_send), + /* K7 */ be_nested_str(_X3Cp_X3E_X3Csmall_X3E_X26nbsp_X3B_X28This_X20feature_X20requires_X20an_X20internet_X20connection_X29_X3C_X2Fsmall_X3E_X3C_X2Fp_X3E), + /* K8 */ be_nested_str(get_current_module_path), + /* K9 */ be_nested_str(tr), + /* K10 */ be_nested_str(get_current_module_name), + /* K11 */ be_nested_str(_), + /* K12 */ be_nested_str(_X20), + /* K13 */ be_nested_str(_error), + /* K14 */ be_nested_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B), + /* K15 */ be_nested_str(_X26lt_X3BNone_X26gt_X3B), + /* K16 */ be_nested_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E), + /* K17 */ be_nested_str(format), + /* K18 */ be_nested_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E), + /* K19 */ be_nested_str(_X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E), + /* K20 */ be_nested_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20), + /* K21 */ be_nested_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E), + /* K22 */ be_nested_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E), + /* K23 */ be_nested_str(_X3C_X2Fform_X3E_X3C_X2Fp_X3E), + /* K24 */ be_nested_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E), + /* K25 */ be_nested_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E), + /* K26 */ be_nested_str(_X3Cp_X3E_X3Cform_X20id_X3Dzip_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20), + /* K27 */ be_nested_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E), + /* K28 */ be_nested_str(_X3Clabel_X3EChoose_X20a_X20device_X20configuration_X3A_X3C_X2Flabel_X3E_X3Cbr_X3E), + /* K29 */ be_nested_str(_X3Cselect_X20name_X3D_X27zip_X27_X3E), + /* K30 */ be_nested_str(load_templates), + /* K31 */ be_nested_str(_X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E), + /* K32 */ be_nested_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E), + /* K33 */ be_nested_str(stop_iteration), + /* K34 */ be_nested_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E), + /* K35 */ be_nested_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E), + /* K36 */ be_nested_str(content_button), + /* K37 */ be_nested_str(BUTTON_CONFIGURATION), + /* K38 */ be_nested_str(content_stop), }), - (be_nested_const_str("page_autoconf_mgr", -651030265, 17)), - ((bstring*) &be_const_str_input), + &be_const_str_page_autoconf_mgr, + &be_const_str_solidified, ( &(const binstruction[124]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0xA40A0200, // 0001 IMPORT R2 K1 @@ -630,7 +630,7 @@ be_local_closure(page_autoconf_mgr, /* name */ /******************************************************************** ** Solidified function: get_current_module_name ********************************************************************/ -be_local_closure(get_current_module_name, /* name */ +be_local_closure(Autoconf_get_current_module_name, /* name */ be_nested_proto( 3, /* nstack */ 1, /* argc */ @@ -641,11 +641,11 @@ be_local_closure(get_current_module_name, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("_archive", -290407892, 8), + /* K0 */ be_nested_str(_archive), /* K1 */ be_const_int(0), }), - (be_nested_const_str("get_current_module_name", -1915696556, 23)), - ((bstring*) &be_const_str_input), + &be_const_str_get_current_module_name, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x5405FFF5, // 0000 LDINT R1 -10 0x40060201, // 0001 CONNECT R1 K1 R1 @@ -661,7 +661,7 @@ be_local_closure(get_current_module_name, /* name */ /******************************************************************** ** Solidified function: delete_all_configs ********************************************************************/ -be_local_closure(delete_all_configs, /* name */ +be_local_closure(Autoconf_delete_all_configs, /* name */ be_nested_proto( 10, /* nstack */ 1, /* argc */ @@ -672,18 +672,18 @@ be_local_closure(delete_all_configs, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 9]) { /* constants */ - /* K0 */ be_nested_string("path", -2071507658, 4), - /* K1 */ be_nested_string("string", 398550328, 6), - /* K2 */ be_nested_string("listdir", 2005220720, 7), - /* K3 */ be_nested_string("/", 705468254, 1), - /* K4 */ be_nested_string("find", -1108310694, 4), - /* K5 */ be_nested_string(".autoconf", -1770288208, 9), + /* K0 */ be_nested_str(path), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(listdir), + /* K3 */ be_nested_str(_X2F), + /* K4 */ be_nested_str(find), + /* K5 */ be_nested_str(_X2Eautoconf), /* K6 */ be_const_int(0), - /* K7 */ be_nested_string("remove", -611183107, 6), - /* K8 */ be_nested_string("stop_iteration", -121173395, 14), + /* K7 */ be_nested_str(remove), + /* K8 */ be_nested_str(stop_iteration), }), - (be_nested_const_str("delete_all_configs", -1912899718, 18)), - ((bstring*) &be_const_str_input), + &be_const_str_delete_all_configs, + &be_const_str_solidified, ( &(const binstruction[25]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0xA40A0200, // 0001 IMPORT R2 K1 @@ -719,7 +719,7 @@ be_local_closure(delete_all_configs, /* name */ /******************************************************************** ** Solidified function: set_first_time ********************************************************************/ -be_local_closure(set_first_time, /* name */ +be_local_closure(Autoconf_set_first_time, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -730,12 +730,12 @@ be_local_closure(set_first_time, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("/.autoconf", -2082892903, 10), - /* K1 */ be_nested_string("w", -234078410, 1), - /* K2 */ be_nested_string("close", 667630371, 5), + /* K0 */ be_nested_str(_X2F_X2Eautoconf), + /* K1 */ be_nested_str(w), + /* K2 */ be_nested_str(close), }), - (be_nested_const_str("set_first_time", -1183719746, 14)), - ((bstring*) &be_const_str_input), + &be_const_str_set_first_time, + &be_const_str_solidified, ( &(const binstruction[ 7]) { /* code */ 0x60040011, // 0000 GETGBL R1 G17 0x58080000, // 0001 LDCONST R2 K0 @@ -753,7 +753,7 @@ be_local_closure(set_first_time, /* name */ /******************************************************************** ** Solidified function: load_templates ********************************************************************/ -be_local_closure(load_templates, /* name */ +be_local_closure(Autoconf_load_templates, /* name */ be_nested_proto( 15, /* nstack */ 1, /* argc */ @@ -764,30 +764,30 @@ be_local_closure(load_templates, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[21]) { /* constants */ - /* K0 */ be_nested_string("string", 398550328, 6), - /* K1 */ be_nested_string("json", 916562499, 4), - /* K2 */ be_nested_string("format", -1180859054, 6), - /* K3 */ be_nested_string("https://raw.githubusercontent.com/tasmota/autoconf/main/%s_manifest.json", -637415251, 72), - /* K4 */ be_nested_string("tasmota", 424643812, 7), - /* K5 */ be_nested_string("arch", -1342162999, 4), - /* K6 */ be_nested_string("log", 1062293841, 3), - /* K7 */ be_nested_string("CFG: loading '%s'", -2009661199, 17), + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(json), + /* K2 */ be_nested_str(format), + /* K3 */ be_nested_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson), + /* K4 */ be_nested_str(tasmota), + /* K5 */ be_nested_str(arch), + /* K6 */ be_nested_str(log), + /* K7 */ be_nested_str(CFG_X3A_X20loading_X20_X27_X25s_X27), /* K8 */ be_const_int(3), - /* K9 */ be_nested_string("webclient", -218578150, 9), - /* K10 */ be_nested_string("begin", 1748273790, 5), - /* K11 */ be_nested_string("GET", -1763262857, 3), - /* K12 */ be_nested_string("CFG: return_code=%i", 2059897320, 19), + /* K9 */ be_nested_str(webclient), + /* K10 */ be_nested_str(begin), + /* K11 */ be_nested_str(GET), + /* K12 */ be_nested_str(CFG_X3A_X20return_code_X3D_X25i), /* K13 */ be_const_int(2), - /* K14 */ be_nested_string("get_string", -99119327, 10), - /* K15 */ be_nested_string("close", 667630371, 5), - /* K16 */ be_nested_string("load", -435725847, 4), - /* K17 */ be_nested_string("CFG: loaded '%s'", 1699028828, 16), - /* K18 */ be_nested_string("find", -1108310694, 4), - /* K19 */ be_nested_string("files", 1055342736, 5), - /* K20 */ be_nested_string("CFG: exception '%s' - '%s'", -199559383, 26), + /* K14 */ be_nested_str(get_string), + /* K15 */ be_nested_str(close), + /* K16 */ be_nested_str(load), + /* K17 */ be_nested_str(CFG_X3A_X20loaded_X20_X27_X25s_X27), + /* K18 */ be_nested_str(find), + /* K19 */ be_nested_str(files), + /* K20 */ be_nested_str(CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27), }), - (be_nested_const_str("load_templates", -781097163, 14)), - ((bstring*) &be_const_str_input), + &be_const_str_load_templates, + &be_const_str_solidified, ( &(const binstruction[86]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0xA40A0200, // 0001 IMPORT R2 K1 @@ -884,7 +884,7 @@ be_local_closure(load_templates, /* name */ /******************************************************************** ** Solidified function: web_add_config_button ********************************************************************/ -be_local_closure(web_add_config_button, /* name */ +be_local_closure(Autoconf_web_add_config_button, /* name */ be_nested_proto( 5, /* nstack */ 1, /* argc */ @@ -895,12 +895,12 @@ be_local_closure(web_add_config_button, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("webserver", 1572454038, 9), - /* K1 */ be_nested_string("content_send", 1673733649, 12), - /* K2 */ be_nested_string("

", 452285201, 120), + /* K0 */ be_nested_str(webserver), + /* K1 */ be_nested_str(content_send), + /* K2 */ be_nested_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E), }), - (be_nested_const_str("web_add_config_button", 639674325, 21)), - ((bstring*) &be_const_str_input), + &be_const_str_web_add_config_button, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0x8C080301, // 0001 GETMET R2 R1 K1 @@ -916,7 +916,7 @@ be_local_closure(web_add_config_button, /* name */ /******************************************************************** ** Solidified function: is_first_time ********************************************************************/ -be_local_closure(is_first_time, /* name */ +be_local_closure(Autoconf_is_first_time, /* name */ be_nested_proto( 5, /* nstack */ 1, /* argc */ @@ -927,12 +927,12 @@ be_local_closure(is_first_time, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("path", -2071507658, 4), - /* K1 */ be_nested_string("exists", 1002329533, 6), - /* K2 */ be_nested_string("/.autoconf", -2082892903, 10), + /* K0 */ be_nested_str(path), + /* K1 */ be_nested_str(exists), + /* K2 */ be_nested_str(_X2F_X2Eautoconf), }), - (be_nested_const_str("is_first_time", 275242384, 13)), - ((bstring*) &be_const_str_input), + &be_const_str_is_first_time, + &be_const_str_solidified, ( &(const binstruction[ 8]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0x8C080301, // 0001 GETMET R2 R1 K1 @@ -951,7 +951,7 @@ be_local_closure(is_first_time, /* name */ /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(init, /* name */ +be_local_closure(Autoconf_init, /* name */ be_nested_proto( 12, /* nstack */ 1, /* argc */ @@ -962,26 +962,26 @@ be_local_closure(init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[17]) { /* constants */ - /* K0 */ be_nested_str_literal("path"), - /* K1 */ be_nested_str_literal("string"), - /* K2 */ be_nested_str_literal("listdir"), - /* K3 */ be_nested_str_literal("/"), - /* K4 */ be_nested_str_literal("tasmota"), - /* K5 */ be_nested_str_literal("add_driver"), + /* K0 */ be_nested_str(path), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(listdir), + /* K3 */ be_nested_str(_X2F), + /* K4 */ be_nested_str(tasmota), + /* K5 */ be_nested_str(add_driver), /* K6 */ be_const_int(0), - /* K7 */ be_nested_str_literal("find"), - /* K8 */ be_nested_str_literal(".autoconf"), - /* K9 */ be_nested_str_literal("format"), - /* K10 */ be_nested_str_literal("CFG: multiple autoconf files found, aborting ('%s' + '%s')"), - /* K11 */ be_nested_str_literal("_error"), + /* K7 */ be_nested_str(find), + /* K8 */ be_nested_str(_X2Eautoconf), + /* K9 */ be_nested_str(format), + /* K10 */ be_nested_str(CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29), + /* K11 */ be_nested_str(_error), /* K12 */ be_const_int(1), - /* K13 */ be_nested_str_literal("log"), - /* K14 */ be_nested_str_literal("CFG: no '*.autoconf' file found"), + /* K13 */ be_nested_str(log), + /* K14 */ be_nested_str(CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found), /* K15 */ be_const_int(2), - /* K16 */ be_nested_str_literal("_archive"), + /* K16 */ be_nested_str(_archive), }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[51]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0xA40A0200, // 0001 IMPORT R2 K1 @@ -1043,7 +1043,7 @@ be_local_closure(init, /* name */ /******************************************************************** ** Solidified function: preinit ********************************************************************/ -be_local_closure(preinit, /* name */ +be_local_closure(Autoconf_preinit, /* name */ be_nested_proto( 7, /* nstack */ 1, /* argc */ @@ -1054,19 +1054,19 @@ be_local_closure(preinit, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[10]) { /* constants */ - /* K0 */ be_nested_string("_archive", -290407892, 8), - /* K1 */ be_nested_string("path", -2071507658, 4), - /* K2 */ be_nested_string("#preinit.be", 687035716, 11), - /* K3 */ be_nested_string("exists", 1002329533, 6), - /* K4 */ be_nested_string("tasmota", 424643812, 7), - /* K5 */ be_nested_string("log", 1062293841, 3), - /* K6 */ be_nested_string("CFG: loading ", -284605793, 13), + /* K0 */ be_nested_str(_archive), + /* K1 */ be_nested_str(path), + /* K2 */ be_nested_str(_X23preinit_X2Ebe), + /* K3 */ be_nested_str(exists), + /* K4 */ be_nested_str(tasmota), + /* K5 */ be_nested_str(log), + /* K6 */ be_nested_str(CFG_X3A_X20loading_X20), /* K7 */ be_const_int(3), - /* K8 */ be_nested_string("load", -435725847, 4), - /* K9 */ be_nested_string("CFG: loaded ", -584693758, 13), + /* K8 */ be_nested_str(load), + /* K9 */ be_nested_str(CFG_X3A_X20loaded_X20_X20), }), - (be_nested_const_str("preinit", -1572960196, 7)), - ((bstring*) &be_const_str_input), + &be_const_str_preinit, + &be_const_str_solidified, ( &(const binstruction[26]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x4C080000, // 0001 LDNIL R2 @@ -1103,7 +1103,7 @@ be_local_closure(preinit, /* name */ /******************************************************************** ** Solidified function: reset ********************************************************************/ -be_local_closure(reset, /* name */ +be_local_closure(Autoconf_reset, /* name */ be_nested_proto( 12, /* nstack */ 1, /* argc */ @@ -1114,22 +1114,22 @@ be_local_closure(reset, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[13]) { /* constants */ - /* K0 */ be_nested_string("path", -2071507658, 4), - /* K1 */ be_nested_string("string", 398550328, 6), - /* K2 */ be_nested_string("listdir", 2005220720, 7), - /* K3 */ be_nested_string("/", 705468254, 1), + /* K0 */ be_nested_str(path), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(listdir), + /* K3 */ be_nested_str(_X2F), /* K4 */ be_const_int(0), - /* K5 */ be_nested_string("find", -1108310694, 4), - /* K6 */ be_nested_string(".autoconf", -1770288208, 9), - /* K7 */ be_nested_string("remove", -611183107, 6), - /* K8 */ be_nested_string("format", -1180859054, 6), - /* K9 */ be_nested_string("CFG: removed file '%s'", 2048602473, 22), + /* K5 */ be_nested_str(find), + /* K6 */ be_nested_str(_X2Eautoconf), + /* K7 */ be_nested_str(remove), + /* K8 */ be_nested_str(format), + /* K9 */ be_nested_str(CFG_X3A_X20removed_X20file_X20_X27_X25s_X27), /* K10 */ be_const_int(1), - /* K11 */ be_nested_string("_archive", -290407892, 8), - /* K12 */ be_nested_string("_error", 1132109656, 6), + /* K11 */ be_nested_str(_archive), + /* K12 */ be_nested_str(_error), }), - (be_nested_const_str("reset", 1695364032, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_reset, + &be_const_str_solidified, ( &(const binstruction[35]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0xA40A0200, // 0001 IMPORT R2 K1 @@ -1175,7 +1175,7 @@ be_local_closure(reset, /* name */ /******************************************************************** ** Solidified function: web_add_handler ********************************************************************/ -be_local_closure(web_add_handler, /* name */ +be_local_closure(Autoconf_web_add_handler, /* name */ be_nested_proto( 7, /* nstack */ 1, /* argc */ @@ -1196,10 +1196,10 @@ be_local_closure(web_add_handler, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("page_autoconf_mgr", -651030265, 17), + /* K0 */ be_nested_str(page_autoconf_mgr), }), - (be_nested_const_str("", 607256038, 8)), - ((bstring*) &be_const_str_input), + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x68000000, // 0000 GETUPV R0 U0 0x8C000100, // 0001 GETMET R0 R0 K0 @@ -1219,10 +1219,10 @@ be_local_closure(web_add_handler, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("page_autoconf_ctl", -1841585800, 17), + /* K0 */ be_nested_str(page_autoconf_ctl), }), - (be_nested_const_str("", 607256038, 8)), - ((bstring*) &be_const_str_input), + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x68000000, // 0000 GETUPV R0 U0 0x8C000100, // 0001 GETMET R0 R0 K0 @@ -1233,14 +1233,14 @@ be_local_closure(web_add_handler, /* name */ }), 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_string("webserver", 1572454038, 9), - /* K1 */ be_nested_string("on", 1630810064, 2), - /* K2 */ be_nested_string("/ac", -390315318, 3), - /* K3 */ be_nested_string("HTTP_GET", 1722467738, 8), - /* K4 */ be_nested_string("HTTP_POST", 1999554144, 9), + /* K0 */ be_nested_str(webserver), + /* K1 */ be_nested_str(on), + /* K2 */ be_nested_str(_X2Fac), + /* K3 */ be_nested_str(HTTP_GET), + /* K4 */ be_nested_str(HTTP_POST), }), - (be_nested_const_str("web_add_handler", -304792334, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_web_add_handler, + &be_const_str_solidified, ( &(const binstruction[13]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0x8C080301, // 0001 GETMET R2 R1 K1 @@ -1264,7 +1264,7 @@ be_local_closure(web_add_handler, /* name */ /******************************************************************** ** Solidified function: clear_first_time ********************************************************************/ -be_local_closure(clear_first_time, /* name */ +be_local_closure(Autoconf_clear_first_time, /* name */ be_nested_proto( 5, /* nstack */ 1, /* argc */ @@ -1275,12 +1275,12 @@ be_local_closure(clear_first_time, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("path", -2071507658, 4), - /* K1 */ be_nested_string("remove", -611183107, 6), - /* K2 */ be_nested_string("/.autoconf", -2082892903, 10), + /* K0 */ be_nested_str(path), + /* K1 */ be_nested_str(remove), + /* K2 */ be_nested_str(_X2F_X2Eautoconf), }), - (be_nested_const_str("clear_first_time", 632769909, 16)), - ((bstring*) &be_const_str_input), + &be_const_str_clear_first_time, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0x8C080301, // 0001 GETMET R2 R1 K1 @@ -1296,7 +1296,7 @@ be_local_closure(clear_first_time, /* name */ /******************************************************************** ** Solidified function: get_current_module_path ********************************************************************/ -be_local_closure(get_current_module_path, /* name */ +be_local_closure(Autoconf_get_current_module_path, /* name */ be_nested_proto( 2, /* nstack */ 1, /* argc */ @@ -1307,10 +1307,10 @@ be_local_closure(get_current_module_path, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("_archive", -290407892, 8), + /* K0 */ be_nested_str(_archive), }), - (be_nested_const_str("get_current_module_path", -1088293888, 23)), - ((bstring*) &be_const_str_input), + &be_const_str_get_current_module_path, + &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x80040200, // 0001 RET 1 R1 @@ -1328,26 +1328,26 @@ be_local_class(Autoconf, NULL, be_nested_map(18, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("page_autoconf_ctl", -1841585800, 17, -1), be_const_closure(page_autoconf_ctl_closure) }, - { be_nested_key("autoexec", -618105405, 8, -1), be_const_closure(autoexec_closure) }, - { be_nested_key("run_bat", -1758063998, 7, 6), be_const_closure(run_bat_closure) }, - { be_nested_key("page_autoconf_mgr", -651030265, 17, -1), be_const_closure(page_autoconf_mgr_closure) }, - { be_nested_key("get_current_module_name", -1915696556, 23, -1), be_const_closure(get_current_module_name_closure) }, - { be_nested_key("delete_all_configs", -1912899718, 18, 13), be_const_closure(delete_all_configs_closure) }, - { be_nested_key("set_first_time", -1183719746, 14, -1), be_const_closure(set_first_time_closure) }, - { be_nested_key("load_templates", -781097163, 14, -1), be_const_closure(load_templates_closure) }, - { be_nested_key("_archive", -290407892, 8, -1), be_const_var(0) }, - { be_nested_key("web_add_config_button", 639674325, 21, -1), be_const_closure(web_add_config_button_closure) }, - { be_nested_key("is_first_time", 275242384, 13, -1), be_const_closure(is_first_time_closure) }, - { be_nested_key("init", 380752755, 4, -1), be_const_closure(init_closure) }, - { be_nested_key("preinit", -1572960196, 7, 5), be_const_closure(preinit_closure) }, - { be_nested_key("reset", 1695364032, 5, 17), be_const_closure(reset_closure) }, - { be_nested_key("web_add_handler", -304792334, 15, 4), be_const_closure(web_add_handler_closure) }, - { be_nested_key("clear_first_time", 632769909, 16, 11), be_const_closure(clear_first_time_closure) }, - { be_nested_key("_error", 1132109656, 6, -1), be_const_var(1) }, - { be_nested_key("get_current_module_path", -1088293888, 23, -1), be_const_closure(get_current_module_path_closure) }, + { be_const_key(page_autoconf_ctl, -1), be_const_closure(Autoconf_page_autoconf_ctl_closure) }, + { be_const_key(autoexec, -1), be_const_closure(Autoconf_autoexec_closure) }, + { be_const_key(run_bat, 17), be_const_closure(Autoconf_run_bat_closure) }, + { be_const_key(page_autoconf_mgr, -1), be_const_closure(Autoconf_page_autoconf_mgr_closure) }, + { be_const_key(get_current_module_path, 13), be_const_closure(Autoconf_get_current_module_path_closure) }, + { be_const_key(preinit, -1), be_const_closure(Autoconf_preinit_closure) }, + { be_const_key(clear_first_time, -1), be_const_closure(Autoconf_clear_first_time_closure) }, + { be_const_key(load_templates, -1), be_const_closure(Autoconf_load_templates_closure) }, + { be_const_key(_archive, -1), be_const_var(0) }, + { be_const_key(web_add_config_button, -1), be_const_closure(Autoconf_web_add_config_button_closure) }, + { be_const_key(is_first_time, -1), be_const_closure(Autoconf_is_first_time_closure) }, + { be_const_key(web_add_handler, -1), be_const_closure(Autoconf_web_add_handler_closure) }, + { be_const_key(delete_all_configs, 4), be_const_closure(Autoconf_delete_all_configs_closure) }, + { be_const_key(reset, 5), be_const_closure(Autoconf_reset_closure) }, + { be_const_key(get_current_module_name, 11), be_const_closure(Autoconf_get_current_module_name_closure) }, + { be_const_key(init, 6), be_const_closure(Autoconf_init_closure) }, + { be_const_key(_error, -1), be_const_var(1) }, + { be_const_key(set_first_time, -1), be_const_closure(Autoconf_set_first_time_closure) }, })), - (be_nested_const_str("Autoconf", 984011268, 8)) + be_str_literal("Autoconf") ); /******************************************************************** @@ -1366,8 +1366,8 @@ be_local_closure(_anonymous_, /* name */ ( &(const bvalue[ 1]) { /* constants */ /* K0 */ be_const_class(be_class_Autoconf), }), - (be_nested_const_str("_anonymous_", 1957281476, 11)), - ((bstring*) &be_const_str_input), + &be_const_str__anonymous_, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x58040000, // 0000 LDCONST R1 K0 0xB4000000, // 0001 CLASS K0 @@ -1387,7 +1387,7 @@ be_local_module(autoconf, "autoconf", be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("init", 380752755, 4, -1), be_const_closure(_anonymous__closure) }, + { be_const_key(init, -1), be_const_closure(_anonymous__closure) }, })) ); BE_EXPORT_VARIABLE be_define_const_native_module(autoconf); diff --git a/lib/libesp32/Berry/default/be_display_lib.c b/lib/libesp32/Berry/default/be_display_lib.c index 2d8bf9ff7..3943396fc 100644 --- a/lib/libesp32/Berry/default/be_display_lib.c +++ b/lib/libesp32/Berry/default/be_display_lib.c @@ -11,7 +11,7 @@ // Tasmota specific -extern int be_disp_start(bvm *vm); +extern int be_ntv_display_start(bvm *vm); /******************************************************************** ** Solidified module: display @@ -20,7 +20,7 @@ be_local_module(display, "display", be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("start", 1697318111, 5, -1), be_const_func(be_disp_start) }, + { be_const_key(start, -1), be_const_func(be_ntv_display_start) }, })) ); BE_EXPORT_VARIABLE be_define_const_native_module(display); diff --git a/lib/libesp32/Berry/default/be_driverlib.c b/lib/libesp32/Berry/default/be_driverlib.c index 13f1d211e..45a611382 100644 --- a/lib/libesp32/Berry/default/be_driverlib.c +++ b/lib/libesp32/Berry/default/be_driverlib.c @@ -9,7 +9,7 @@ /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(init, /* name */ +be_local_closure(Driver_init, /* name */ be_nested_proto( 1, /* nstack */ 1, /* argc */ @@ -20,8 +20,8 @@ be_local_closure(init, /* name */ NULL, /* no sub protos */ 0, /* has constants */ NULL, /* no const */ - ((bstring*) &be_const_str_init), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[ 1]) { /* code */ 0x80000000, // 0000 RET 0 }) @@ -33,7 +33,7 @@ be_local_closure(init, /* name */ /******************************************************************** ** Solidified function: get_tasmota ********************************************************************/ -be_local_closure(get_tasmota, /* name */ +be_local_closure(Driver_get_tasmota, /* name */ be_nested_proto( 2, /* nstack */ 1, /* argc */ @@ -44,10 +44,10 @@ be_local_closure(get_tasmota, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("tasmota", 424643812, 7), + /* K0 */ be_nested_str(tasmota), }), - (be_nested_const_str("get_tasmota", 334356779, 11)), - ((bstring*) &be_const_str_input), + &be_const_str_get_tasmota, + &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0xB8060000, // 0000 GETNGBL R1 K0 0x80040200, // 0001 RET 1 R1 @@ -60,7 +60,7 @@ be_local_closure(get_tasmota, /* name */ /******************************************************************** ** Solidified function: add_cmd ********************************************************************/ -be_local_closure(add_cmd, /* name */ +be_local_closure(Driver_add_cmd, /* name */ be_nested_proto( 7, /* nstack */ 3, /* argc */ @@ -82,8 +82,8 @@ be_local_closure(add_cmd, /* name */ NULL, /* no sub protos */ 0, /* has constants */ NULL, /* no const */ - (be_nested_const_str("", 607256038, 8)), - ((bstring*) &be_const_str_input), + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, ( &(const binstruction[ 8]) { /* code */ 0x68100000, // 0000 GETUPV R4 U0 0x68140001, // 0001 GETUPV R5 U1 @@ -98,11 +98,11 @@ be_local_closure(add_cmd, /* name */ }), 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("tasmota", 424643812, 7), - /* K1 */ be_nested_string("add_cmd", -933336417, 7), + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(add_cmd), }), - (be_nested_const_str("add_cmd", -933336417, 7)), - ((bstring*) &be_const_str_input), + &be_const_str_add_cmd, + &be_const_str_solidified, ( &(const binstruction[ 7]) { /* code */ 0xB80E0000, // 0000 GETNGBL R3 K0 0x8C0C0701, // 0001 GETMET R3 R3 K1 @@ -125,24 +125,24 @@ be_local_class(Driver, NULL, be_nested_map(16, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("web_add_main_button", -334599632, 19, 14), be_const_var(4) }, - { be_nested_key("web_add_console_button", -813531104, 22, -1), be_const_var(7) }, - { be_nested_key("web_add_management_button", -1556090110, 25, 8), be_const_var(5) }, - { be_nested_key("init", 380752755, 4, -1), be_const_closure(init_closure) }, - { be_nested_key("json_append", -1292948012, 11, -1), be_const_var(10) }, - { be_nested_key("web_add_config_button", 639674325, 21, 7), be_const_var(6) }, - { be_nested_key("every_100ms", 1546407804, 11, -1), be_const_var(1) }, - { be_nested_key("display", 1164572437, 7, -1), be_const_var(12) }, - { be_nested_key("web_add_button", -757092238, 14, 13), be_const_var(3) }, - { be_nested_key("every_second", 2075451465, 12, -1), be_const_var(0) }, - { be_nested_key("save_before_restart", 1253239338, 19, -1), be_const_var(8) }, - { be_nested_key("get_tasmota", 334356779, 11, -1), be_const_closure(get_tasmota_closure) }, - { be_nested_key("web_sensor", -1394870324, 10, 6), be_const_var(9) }, - { be_nested_key("web_add_handler", -304792334, 15, -1), be_const_var(2) }, - { be_nested_key("button_pressed", 1694209616, 14, 1), be_const_var(11) }, - { be_nested_key("add_cmd", -933336417, 7, -1), be_const_closure(add_cmd_closure) }, + { be_const_key(web_add_main_button, 14), be_const_var(4) }, + { be_const_key(web_add_console_button, -1), be_const_var(7) }, + { be_const_key(web_add_management_button, 8), be_const_var(5) }, + { be_const_key(init, -1), be_const_closure(Driver_init_closure) }, + { be_const_key(json_append, -1), be_const_var(10) }, + { be_const_key(web_add_config_button, 7), be_const_var(6) }, + { be_const_key(every_100ms, -1), be_const_var(1) }, + { be_const_key(display, -1), be_const_var(12) }, + { be_const_key(web_add_button, 13), be_const_var(3) }, + { be_const_key(every_second, -1), be_const_var(0) }, + { be_const_key(save_before_restart, -1), be_const_var(8) }, + { be_const_key(get_tasmota, -1), be_const_closure(Driver_get_tasmota_closure) }, + { be_const_key(web_sensor, 6), be_const_var(9) }, + { be_const_key(web_add_handler, -1), be_const_var(2) }, + { be_const_key(button_pressed, 1), be_const_var(11) }, + { be_const_key(add_cmd, -1), be_const_closure(Driver_add_cmd_closure) }, })), - (be_nested_const_str("Driver", -718580993, 6)) + be_str_literal("Driver") ); /*******************************************************************/ diff --git a/lib/libesp32/Berry/default/be_energylib.c b/lib/libesp32/Berry/default/be_energylib.c index e115a8507..cbdddbfca 100644 --- a/lib/libesp32/Berry/default/be_energylib.c +++ b/lib/libesp32/Berry/default/be_energylib.c @@ -12,32 +12,127 @@ extern struct ENERGY Energy; /* +_energy = nil # avoid compilation error +energy = module("energy") +energy._ptr = nil + def init(m) import global global._energy = energy_struct(m._ptr) return m end +energy.init = init def read() return _energy.tomap() end +energy.read = read def member(k) return _energy.(k) end +energy.member = member def setmember(k, v) _energy.(k) = v end +energy.setmember = setmember import solidify -solidify.dump(m.init) +solidify.dump(energy) */ + +/******************************************************************** +** Solidified function: member +********************************************************************/ +be_local_closure(energy_member, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(_energy), + }), + &be_const_str_member, + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040200, // 0001 GETMBR R1 R1 R0 + 0x80040200, // 0002 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: setmember +********************************************************************/ +be_local_closure(energy_setmember, /* name */ + be_nested_proto( + 3, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(_energy), + }), + &be_const_str_setmember, + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x90080001, // 0001 SETMBR R2 R0 R1 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read +********************************************************************/ +be_local_closure(energy_read, /* name */ + be_nested_proto( + 2, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(_energy), + /* K1 */ be_nested_str(tomap), + }), + &be_const_str_read, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0xB8020000, // 0000 GETNGBL R0 K0 + 0x8C000101, // 0001 GETMET R0 R0 K1 + 0x7C000200, // 0002 CALL R0 1 + 0x80040000, // 0003 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(init, /* name */ +be_local_closure(energy_init, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -48,13 +143,13 @@ be_local_closure(init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_string("global", 503252654, 6), - /* K1 */ be_nested_string("_energy", 535372070, 7), - /* K2 */ be_nested_string("energy_struct", 1655792843, 13), - /* K3 */ be_nested_string("_ptr", 306235816, 4), + /* K0 */ be_nested_str(global), + /* K1 */ be_nested_str(_energy), + /* K2 */ be_nested_str(energy_struct), + /* K3 */ be_nested_str(_ptr), }), - ((bstring*) &be_const_str_init), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0xB80A0400, // 0001 GETNGBL R2 K2 @@ -69,100 +164,23 @@ be_local_closure(init, /* name */ /******************************************************************** -** Solidified function: read +** Solidified module: energy ********************************************************************/ -be_local_closure(read, /* name */ - be_nested_proto( - 2, /* nstack */ - 0, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("_energy", 535372070, 7), - /* K1 */ be_nested_string("tomap", 612167626, 5), - }), - (be_nested_const_str("", 1160973142, 11)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[ 4]) { /* code */ - 0xB8020000, // 0000 GETNGBL R0 K0 - 0x8C000101, // 0001 GETMET R0 R0 K1 - 0x7C000200, // 0002 CALL R0 1 - 0x80040000, // 0003 RET 1 R0 - }) - ) +be_local_module(energy, + "energy", + be_nested_map(5, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(energy_init_closure) }, + { be_const_key(member, 2), be_const_closure(energy_member_closure) }, + { be_const_key(_ptr, 3), be_const_comptr(&Energy) }, + { be_const_key(setmember, -1), be_const_closure(energy_setmember_closure) }, + { be_const_key(read, -1), be_const_closure(energy_read_closure) }, + })) ); -/*******************************************************************/ - -/******************************************************************** -** Solidified function: member -********************************************************************/ -be_local_closure(member, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("_energy", 535372070, 7), - }), - (be_nested_const_str("member", 719708611, 6)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[ 3]) { /* code */ - 0xB8060000, // 0000 GETNGBL R1 K0 - 0x88040200, // 0001 GETMBR R1 R1 R0 - 0x80040200, // 0002 RET 1 R1 - }) - ) -); -/*******************************************************************/ +BE_EXPORT_VARIABLE be_define_const_native_module(energy); +/********************************************************************/ -/******************************************************************** -** Solidified function: setmember -********************************************************************/ -be_local_closure(setmember, /* name */ - be_nested_proto( - 3, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("_energy", 535372070, 7), - }), - (be_nested_const_str("setmember", 1432909441, 9)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[ 3]) { /* code */ - 0xB80A0000, // 0000 GETNGBL R2 K0 - 0x90080001, // 0001 SETMBR R2 R0 R1 - 0x80000000, // 0002 RET 0 - }) - ) -); -/*******************************************************************/ - - -/* @const_object_info_begin -module energy (scope: global) { - _ptr, comptr(&Energy) - init, closure(init_closure) - - read, closure(read_closure) - member, closure(member_closure) - setmember, closure(setmember_closure) -} -@const_object_info_end */ -#include "../generate/be_fixed_energy.h" +// { be_const_key(_ptr, 3), be_const_comptr(&Energy) }, /* patch */ #endif // USE_ENERGY_SENSOR \ No newline at end of file diff --git a/lib/libesp32/Berry/default/be_i2c_axp192_lib.c b/lib/libesp32/Berry/default/be_i2c_axp192_lib.c index 7449780d6..4f9f02307 100644 --- a/lib/libesp32/Berry/default/be_i2c_axp192_lib.c +++ b/lib/libesp32/Berry/default/be_i2c_axp192_lib.c @@ -6,7 +6,7 @@ /******************************************************************** ** Solidified function: get_warning_level ********************************************************************/ -be_local_closure(get_warning_level, /* name */ +be_local_closure(AXP192_get_warning_level, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -17,11 +17,11 @@ be_local_closure(get_warning_level, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("read12", -3890326, 6), + /* K0 */ be_nested_str(read12), /* K1 */ be_const_int(1), }), - (be_nested_const_str("get_warning_level", 1737834441, 17)), - ((bstring*) &be_const_str_input), + &be_const_str_get_warning_level, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E0046, // 0001 LDINT R3 71 @@ -37,7 +37,7 @@ be_local_closure(get_warning_level, /* name */ /******************************************************************** ** Solidified function: get_vbus_current ********************************************************************/ -be_local_closure(get_vbus_current, /* name */ +be_local_closure(AXP192_get_vbus_current, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -48,11 +48,11 @@ be_local_closure(get_vbus_current, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("read12", -3890326, 6), + /* K0 */ be_nested_str(read12), /* K1 */ be_const_real_hex(0x3EC00000), }), - (be_nested_const_str("get_vbus_current", 1205347942, 16)), - ((bstring*) &be_const_str_input), + &be_const_str_get_vbus_current, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E005B, // 0001 LDINT R3 92 @@ -68,7 +68,7 @@ be_local_closure(get_vbus_current, /* name */ /******************************************************************** ** Solidified function: set_chg_current ********************************************************************/ -be_local_closure(set_chg_current, /* name */ +be_local_closure(AXP192_set_chg_current, /* name */ be_nested_proto( 8, /* nstack */ 2, /* argc */ @@ -79,11 +79,11 @@ be_local_closure(set_chg_current, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("write8", -1160975764, 6), - /* K1 */ be_nested_string("read8", -1492179129, 5), + /* K0 */ be_nested_str(write8), + /* K1 */ be_nested_str(read8), }), - (be_nested_const_str("set_chg_current", 336304386, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_set_chg_current, + &be_const_str_solidified, ( &(const binstruction[12]) { /* code */ 0x8C080100, // 0000 GETMET R2 R0 K0 0x54120032, // 0001 LDINT R4 51 @@ -106,7 +106,7 @@ be_local_closure(set_chg_current, /* name */ /******************************************************************** ** Solidified function: get_bat_current ********************************************************************/ -be_local_closure(get_bat_current, /* name */ +be_local_closure(AXP192_get_bat_current, /* name */ be_nested_proto( 5, /* nstack */ 1, /* argc */ @@ -117,11 +117,11 @@ be_local_closure(get_bat_current, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("read13", 12887293, 6), + /* K0 */ be_nested_str(read13), /* K1 */ be_const_real_hex(0x3F000000), }), - (be_nested_const_str("get_bat_current", 1912106073, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_get_bat_current, + &be_const_str_solidified, ( &(const binstruction[ 9]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E0079, // 0001 LDINT R3 122 @@ -141,7 +141,7 @@ be_local_closure(get_bat_current, /* name */ /******************************************************************** ** Solidified function: get_bat_power ********************************************************************/ -be_local_closure(get_bat_power, /* name */ +be_local_closure(AXP192_get_bat_power, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -152,11 +152,11 @@ be_local_closure(get_bat_power, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("read24", 1808533811, 6), + /* K0 */ be_nested_str(read24), /* K1 */ be_const_real_hex(0x3A102DE1), }), - (be_nested_const_str("get_bat_power", -1227592443, 13)), - ((bstring*) &be_const_str_input), + &be_const_str_get_bat_power, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E006F, // 0001 LDINT R3 112 @@ -172,7 +172,7 @@ be_local_closure(get_bat_power, /* name */ /******************************************************************** ** Solidified function: json_append ********************************************************************/ -be_local_closure(json_append, /* name */ +be_local_closure(AXP192_json_append, /* name */ be_nested_proto( 2, /* nstack */ 1, /* argc */ @@ -183,10 +183,10 @@ be_local_closure(json_append, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("wire", -212213352, 4), + /* K0 */ be_nested_str(wire), }), - (be_nested_const_str("json_append", -1292948012, 11)), - ((bstring*) &be_const_str_input), + &be_const_str_json_append, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x74060001, // 0001 JMPT R1 #0004 @@ -202,7 +202,7 @@ be_local_closure(json_append, /* name */ /******************************************************************** ** Solidified function: get_vbus_voltage ********************************************************************/ -be_local_closure(get_vbus_voltage, /* name */ +be_local_closure(AXP192_get_vbus_voltage, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -213,11 +213,11 @@ be_local_closure(get_vbus_voltage, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("read12", -3890326, 6), + /* K0 */ be_nested_str(read12), /* K1 */ be_const_real_hex(0x3ADED28A), }), - (be_nested_const_str("get_vbus_voltage", -1896756895, 16)), - ((bstring*) &be_const_str_input), + &be_const_str_get_vbus_voltage, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E0059, // 0001 LDINT R3 90 @@ -233,7 +233,7 @@ be_local_closure(get_vbus_voltage, /* name */ /******************************************************************** ** Solidified function: get_temp ********************************************************************/ -be_local_closure(get_temp, /* name */ +be_local_closure(AXP192_get_temp, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -244,12 +244,12 @@ be_local_closure(get_temp, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("read12", -3890326, 6), + /* K0 */ be_nested_str(read12), /* K1 */ be_const_real_hex(0x3DCCCCCD), /* K2 */ be_const_real_hex(0x4310B333), }), - (be_nested_const_str("get_temp", -924047810, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_get_temp, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E005D, // 0001 LDINT R3 94 @@ -266,7 +266,7 @@ be_local_closure(get_temp, /* name */ /******************************************************************** ** Solidified function: battery_present ********************************************************************/ -be_local_closure(battery_present, /* name */ +be_local_closure(AXP192_battery_present, /* name */ be_nested_proto( 6, /* nstack */ 1, /* argc */ @@ -277,13 +277,13 @@ be_local_closure(battery_present, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_string("wire", -212213352, 4), - /* K1 */ be_nested_string("read", -824204347, 4), - /* K2 */ be_nested_string("addr", 1087856498, 4), + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read), + /* K2 */ be_nested_str(addr), /* K3 */ be_const_int(1), }), - (be_nested_const_str("battery_present", -706570238, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_battery_present, + &be_const_str_solidified, ( &(const binstruction[15]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -309,7 +309,7 @@ be_local_closure(battery_present, /* name */ /******************************************************************** ** Solidified function: get_aps_voltage ********************************************************************/ -be_local_closure(get_aps_voltage, /* name */ +be_local_closure(AXP192_get_aps_voltage, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -320,11 +320,11 @@ be_local_closure(get_aps_voltage, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("read12", -3890326, 6), + /* K0 */ be_nested_str(read12), /* K1 */ be_const_real_hex(0x3AB78035), }), - (be_nested_const_str("get_aps_voltage", -2001930861, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_get_aps_voltage, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E007D, // 0001 LDINT R3 126 @@ -340,7 +340,7 @@ be_local_closure(get_aps_voltage, /* name */ /******************************************************************** ** Solidified function: set_dcdc_enable ********************************************************************/ -be_local_closure(set_dcdc_enable, /* name */ +be_local_closure(AXP192_set_dcdc_enable, /* name */ be_nested_proto( 8, /* nstack */ 3, /* argc */ @@ -352,13 +352,13 @@ be_local_closure(set_dcdc_enable, /* name */ 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ /* K0 */ be_const_int(1), - /* K1 */ be_nested_string("write_bit", -1633976860, 9), + /* K1 */ be_nested_str(write_bit), /* K2 */ be_const_int(0), /* K3 */ be_const_int(2), /* K4 */ be_const_int(3), }), - (be_nested_const_str("set_dcdc_enable", 1594690786, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_set_dcdc_enable, + &be_const_str_solidified, ( &(const binstruction[22]) { /* code */ 0x1C0C0300, // 0000 EQ R3 R1 K0 0x780E0004, // 0001 JMPF R3 #0007 @@ -391,7 +391,7 @@ be_local_closure(set_dcdc_enable, /* name */ /******************************************************************** ** Solidified function: set_ldo_voltage ********************************************************************/ -be_local_closure(set_ldo_voltage, /* name */ +be_local_closure(AXP192_set_ldo_voltage, /* name */ be_nested_proto( 9, /* nstack */ 3, /* argc */ @@ -403,12 +403,12 @@ be_local_closure(set_ldo_voltage, /* name */ 1, /* has constants */ ( &(const bvalue[ 4]) { /* constants */ /* K0 */ be_const_int(2), - /* K1 */ be_nested_string("write8", -1160975764, 6), - /* K2 */ be_nested_string("read8", -1492179129, 5), + /* K1 */ be_nested_str(write8), + /* K2 */ be_nested_str(read8), /* K3 */ be_const_int(3), }), - (be_nested_const_str("set_ldo_voltage", -204466136, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_set_ldo_voltage, + &be_const_str_solidified, ( &(const binstruction[39]) { /* code */ 0x540E0CE3, // 0000 LDINT R3 3300 0x240C0403, // 0001 GT R3 R2 R3 @@ -458,7 +458,7 @@ be_local_closure(set_ldo_voltage, /* name */ /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(init, /* name */ +be_local_closure(AXP192_init, /* name */ be_nested_proto( 5, /* nstack */ 1, /* argc */ @@ -469,12 +469,12 @@ be_local_closure(init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("I2C_Driver", 1714501658, 10), - /* K1 */ be_nested_string("init", 380752755, 4), - /* K2 */ be_nested_string("AXP192", 757230128, 6), + /* K0 */ be_nested_str(I2C_Driver), + /* K1 */ be_nested_str(init), + /* K2 */ be_nested_str(AXP192), }), - ((bstring*) &be_const_str_init), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[ 9]) { /* code */ 0x60040003, // 0000 GETGBL R1 G3 0x5C080000, // 0001 MOVE R2 R0 @@ -494,7 +494,7 @@ be_local_closure(init, /* name */ /******************************************************************** ** Solidified function: get_bat_voltage ********************************************************************/ -be_local_closure(get_bat_voltage, /* name */ +be_local_closure(AXP192_get_bat_voltage, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -505,11 +505,11 @@ be_local_closure(get_bat_voltage, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("read12", -3890326, 6), + /* K0 */ be_nested_str(read12), /* K1 */ be_const_real_hex(0x3A902DE0), }), - (be_nested_const_str("get_bat_voltage", 706676538, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_get_bat_voltage, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E0077, // 0001 LDINT R3 120 @@ -525,7 +525,7 @@ be_local_closure(get_bat_voltage, /* name */ /******************************************************************** ** Solidified function: set_ldo_enable ********************************************************************/ -be_local_closure(set_ldo_enable, /* name */ +be_local_closure(AXP192_set_ldo_enable, /* name */ be_nested_proto( 8, /* nstack */ 3, /* argc */ @@ -537,11 +537,11 @@ be_local_closure(set_ldo_enable, /* name */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ /* K0 */ be_const_int(2), - /* K1 */ be_nested_string("write_bit", -1633976860, 9), + /* K1 */ be_nested_str(write_bit), /* K2 */ be_const_int(3), }), - (be_nested_const_str("set_ldo_enable", -1378465255, 14)), - ((bstring*) &be_const_str_input), + &be_const_str_set_ldo_enable, + &be_const_str_solidified, ( &(const binstruction[15]) { /* code */ 0x1C0C0300, // 0000 EQ R3 R1 K0 0x780E0004, // 0001 JMPF R3 #0007 @@ -567,7 +567,7 @@ be_local_closure(set_ldo_enable, /* name */ /******************************************************************** ** Solidified function: set_dc_voltage ********************************************************************/ -be_local_closure(set_dc_voltage, /* name */ +be_local_closure(AXP192_set_dc_voltage, /* name */ be_nested_proto( 11, /* nstack */ 3, /* argc */ @@ -582,11 +582,11 @@ be_local_closure(set_dc_voltage, /* name */ /* K1 */ be_const_int(3), /* K2 */ be_const_int(0), /* K3 */ be_const_int(2), - /* K4 */ be_nested_string("write8", -1160975764, 6), - /* K5 */ be_nested_string("read8", -1492179129, 5), + /* K4 */ be_nested_str(write8), + /* K5 */ be_nested_str(read8), }), - (be_nested_const_str("set_dc_voltage", -2112985360, 14)), - ((bstring*) &be_const_str_input), + &be_const_str_set_dc_voltage, + &be_const_str_solidified, ( &(const binstruction[48]) { /* code */ 0x140C0300, // 0000 LT R3 R1 K0 0x740E0001, // 0001 JMPT R3 #0004 @@ -645,7 +645,7 @@ be_local_closure(set_dc_voltage, /* name */ /******************************************************************** ** Solidified function: write_gpio ********************************************************************/ -be_local_closure(write_gpio, /* name */ +be_local_closure(AXP192_write_gpio, /* name */ be_nested_proto( 8, /* nstack */ 3, /* argc */ @@ -658,11 +658,11 @@ be_local_closure(write_gpio, /* name */ ( &(const bvalue[ 4]) { /* constants */ /* K0 */ be_const_int(0), /* K1 */ be_const_int(2), - /* K2 */ be_nested_string("write_bit", -1633976860, 9), + /* K2 */ be_nested_str(write_bit), /* K3 */ be_const_int(3), }), - (be_nested_const_str("write_gpio", -2027026962, 10)), - ((bstring*) &be_const_str_input), + &be_const_str_write_gpio, + &be_const_str_solidified, ( &(const binstruction[21]) { /* code */ 0x280C0300, // 0000 GE R3 R1 K0 0x780E0007, // 0001 JMPF R3 #000A @@ -694,7 +694,7 @@ be_local_closure(write_gpio, /* name */ /******************************************************************** ** Solidified function: web_sensor ********************************************************************/ -be_local_closure(web_sensor, /* name */ +be_local_closure(AXP192_web_sensor, /* name */ be_nested_proto( 11, /* nstack */ 1, /* argc */ @@ -705,23 +705,23 @@ be_local_closure(web_sensor, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[14]) { /* constants */ - /* K0 */ be_nested_string("wire", -212213352, 4), - /* K1 */ be_nested_string("string", 398550328, 6), - /* K2 */ be_nested_string("format", -1180859054, 6), - /* K3 */ be_nested_string("{s}VBus Voltage{m}%.3f V{e}", 165651270, 27), - /* K4 */ be_nested_string("{s}VBus Current{m}%.1f mA{e}", 1032721155, 28), - /* K5 */ be_nested_string("{s}Batt Voltage{m}%.3f V{e}", -1110659097, 27), - /* K6 */ be_nested_string("{s}Batt Current{m}%.1f mA{e}", 866537156, 28), - /* K7 */ be_nested_string("{s}Temp AXP{m}%.1f °C{e}", -1990510004, 25), - /* K8 */ be_nested_string("get_vbus_voltage", -1896756895, 16), - /* K9 */ be_nested_string("get_bat_voltage", 706676538, 15), - /* K10 */ be_nested_string("get_bat_current", 1912106073, 15), - /* K11 */ be_nested_string("get_temp", -924047810, 8), - /* K12 */ be_nested_string("tasmota", 424643812, 7), - /* K13 */ be_nested_string("web_send_decimal", 1407210204, 16), + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(format), + /* K3 */ be_nested_str(_X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D), + /* K4 */ be_nested_str(_X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D), + /* K5 */ be_nested_str(_X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D), + /* K6 */ be_nested_str(_X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D), + /* K7 */ be_nested_str(_X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D), + /* K8 */ be_nested_str(get_vbus_voltage), + /* K9 */ be_nested_str(get_bat_voltage), + /* K10 */ be_nested_str(get_bat_current), + /* K11 */ be_nested_str(get_temp), + /* K12 */ be_nested_str(tasmota), + /* K13 */ be_nested_str(web_send_decimal), }), - (be_nested_const_str("web_sensor", -1394870324, 10)), - ((bstring*) &be_const_str_input), + &be_const_str_web_sensor, + &be_const_str_solidified, ( &(const binstruction[26]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x74060001, // 0001 JMPT R1 #0004 @@ -758,7 +758,7 @@ be_local_closure(web_sensor, /* name */ /******************************************************************** ** Solidified function: get_bat_charge_current ********************************************************************/ -be_local_closure(get_bat_charge_current, /* name */ +be_local_closure(AXP192_get_bat_charge_current, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -769,11 +769,11 @@ be_local_closure(get_bat_charge_current, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("read13", 12887293, 6), + /* K0 */ be_nested_str(read13), /* K1 */ be_const_real_hex(0x3F000000), }), - (be_nested_const_str("get_bat_charge_current", 1385293050, 22)), - ((bstring*) &be_const_str_input), + &be_const_str_get_bat_charge_current, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E0079, // 0001 LDINT R3 122 @@ -789,7 +789,7 @@ be_local_closure(get_bat_charge_current, /* name */ /******************************************************************** ** Solidified function: get_battery_chargin_status ********************************************************************/ -be_local_closure(get_battery_chargin_status, /* name */ +be_local_closure(AXP192_get_battery_chargin_status, /* name */ be_nested_proto( 6, /* nstack */ 1, /* argc */ @@ -800,13 +800,13 @@ be_local_closure(get_battery_chargin_status, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_string("wire", -212213352, 4), - /* K1 */ be_nested_string("read", -824204347, 4), - /* K2 */ be_nested_string("addr", 1087856498, 4), + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read), + /* K2 */ be_nested_str(addr), /* K3 */ be_const_int(1), }), - (be_nested_const_str("get_battery_chargin_status", -2061725725, 26)), - ((bstring*) &be_const_str_input), + &be_const_str_get_battery_chargin_status, + &be_const_str_solidified, ( &(const binstruction[ 7]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -824,7 +824,7 @@ be_local_closure(get_battery_chargin_status, /* name */ /******************************************************************** ** Solidified function: get_input_power_status ********************************************************************/ -be_local_closure(get_input_power_status, /* name */ +be_local_closure(AXP192_get_input_power_status, /* name */ be_nested_proto( 6, /* nstack */ 1, /* argc */ @@ -835,14 +835,14 @@ be_local_closure(get_input_power_status, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_string("wire", -212213352, 4), - /* K1 */ be_nested_string("read", -824204347, 4), - /* K2 */ be_nested_string("addr", 1087856498, 4), + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read), + /* K2 */ be_nested_str(addr), /* K3 */ be_const_int(0), /* K4 */ be_const_int(1), }), - (be_nested_const_str("get_input_power_status", -192138119, 22)), - ((bstring*) &be_const_str_input), + &be_const_str_get_input_power_status, + &be_const_str_solidified, ( &(const binstruction[ 7]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -866,29 +866,29 @@ be_local_class(AXP192, &be_class_I2C_Driver, be_nested_map(21, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("get_warning_level", 1737834441, 17, -1), be_const_closure(get_warning_level_closure) }, - { be_nested_key("get_vbus_current", 1205347942, 16, -1), be_const_closure(get_vbus_current_closure) }, - { be_nested_key("set_chg_current", 336304386, 15, 14), be_const_closure(set_chg_current_closure) }, - { be_nested_key("get_bat_current", 1912106073, 15, -1), be_const_closure(get_bat_current_closure) }, - { be_nested_key("get_bat_power", -1227592443, 13, 9), be_const_closure(get_bat_power_closure) }, - { be_nested_key("json_append", -1292948012, 11, -1), be_const_closure(json_append_closure) }, - { be_nested_key("get_vbus_voltage", -1896756895, 16, -1), be_const_closure(get_vbus_voltage_closure) }, - { be_nested_key("get_temp", -924047810, 8, -1), be_const_closure(get_temp_closure) }, - { be_nested_key("battery_present", -706570238, 15, -1), be_const_closure(battery_present_closure) }, - { be_nested_key("get_aps_voltage", -2001930861, 15, -1), be_const_closure(get_aps_voltage_closure) }, - { be_nested_key("set_dcdc_enable", 1594690786, 15, -1), be_const_closure(set_dcdc_enable_closure) }, - { be_nested_key("set_ldo_voltage", -204466136, 15, 7), be_const_closure(set_ldo_voltage_closure) }, - { be_nested_key("init", 380752755, 4, 2), be_const_closure(init_closure) }, - { be_nested_key("get_bat_voltage", 706676538, 15, 18), be_const_closure(get_bat_voltage_closure) }, - { be_nested_key("set_ldo_enable", -1378465255, 14, -1), be_const_closure(set_ldo_enable_closure) }, - { be_nested_key("set_dc_voltage", -2112985360, 14, 13), be_const_closure(set_dc_voltage_closure) }, - { be_nested_key("write_gpio", -2027026962, 10, -1), be_const_closure(write_gpio_closure) }, - { be_nested_key("web_sensor", -1394870324, 10, -1), be_const_closure(web_sensor_closure) }, - { be_nested_key("get_bat_charge_current", 1385293050, 22, 19), be_const_closure(get_bat_charge_current_closure) }, - { be_nested_key("get_battery_chargin_status", -2061725725, 26, -1), be_const_closure(get_battery_chargin_status_closure) }, - { be_nested_key("get_input_power_status", -192138119, 22, -1), be_const_closure(get_input_power_status_closure) }, + { be_const_key(get_warning_level, -1), be_const_closure(AXP192_get_warning_level_closure) }, + { be_const_key(get_vbus_current, -1), be_const_closure(AXP192_get_vbus_current_closure) }, + { be_const_key(get_aps_voltage, -1), be_const_closure(AXP192_get_aps_voltage_closure) }, + { be_const_key(get_bat_current, -1), be_const_closure(AXP192_get_bat_current_closure) }, + { be_const_key(get_bat_power, 2), be_const_closure(AXP192_get_bat_power_closure) }, + { be_const_key(json_append, -1), be_const_closure(AXP192_json_append_closure) }, + { be_const_key(get_vbus_voltage, -1), be_const_closure(AXP192_get_vbus_voltage_closure) }, + { be_const_key(get_battery_chargin_status, 9), be_const_closure(AXP192_get_battery_chargin_status_closure) }, + { be_const_key(battery_present, -1), be_const_closure(AXP192_battery_present_closure) }, + { be_const_key(get_bat_charge_current, 14), be_const_closure(AXP192_get_bat_charge_current_closure) }, + { be_const_key(set_dcdc_enable, -1), be_const_closure(AXP192_set_dcdc_enable_closure) }, + { be_const_key(get_temp, 19), be_const_closure(AXP192_get_temp_closure) }, + { be_const_key(set_chg_current, 13), be_const_closure(AXP192_set_chg_current_closure) }, + { be_const_key(set_ldo_enable, 18), be_const_closure(AXP192_set_ldo_enable_closure) }, + { be_const_key(set_dc_voltage, -1), be_const_closure(AXP192_set_dc_voltage_closure) }, + { be_const_key(get_bat_voltage, 7), be_const_closure(AXP192_get_bat_voltage_closure) }, + { be_const_key(write_gpio, -1), be_const_closure(AXP192_write_gpio_closure) }, + { be_const_key(web_sensor, -1), be_const_closure(AXP192_web_sensor_closure) }, + { be_const_key(init, -1), be_const_closure(AXP192_init_closure) }, + { be_const_key(set_ldo_voltage, -1), be_const_closure(AXP192_set_ldo_voltage_closure) }, + { be_const_key(get_input_power_status, -1), be_const_closure(AXP192_get_input_power_status_closure) }, })), - (be_nested_const_str("AXP192", 757230128, 6)) + be_str_literal("AXP192") ); /*******************************************************************/ diff --git a/lib/libesp32/Berry/default/be_i2c_driverlib.c b/lib/libesp32/Berry/default/be_i2c_driverlib.c index f1cedfe8b..45f829e19 100644 --- a/lib/libesp32/Berry/default/be_i2c_driverlib.c +++ b/lib/libesp32/Berry/default/be_i2c_driverlib.c @@ -9,12 +9,10 @@ *******************************************************************/ #include "be_constobj.h" -extern bclass* be_class_Driver; // Parent class - /******************************************************************** ** Solidified function: read32 ********************************************************************/ -be_local_closure(read32, /* name */ +be_local_closure(I2C_Driver_read32, /* name */ be_nested_proto( 7, /* nstack */ 2, /* argc */ @@ -25,16 +23,16 @@ be_local_closure(read32, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_string("wire", -212213352, 4), - /* K1 */ be_nested_string("read_bytes", -718234123, 10), - /* K2 */ be_nested_string("addr", 1087856498, 4), + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read_bytes), + /* K2 */ be_nested_str(addr), /* K3 */ be_const_int(0), /* K4 */ be_const_int(1), /* K5 */ be_const_int(2), /* K6 */ be_const_int(3), }), - (be_nested_const_str("read32", 1741276240, 6)), - ((bstring*) &be_const_str_input), + &be_const_str_read32, + &be_const_str_solidified, ( &(const binstruction[20]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 @@ -65,7 +63,7 @@ be_local_closure(read32, /* name */ /******************************************************************** ** Solidified function: write8 ********************************************************************/ -be_local_closure(write8, /* name */ +be_local_closure(I2C_Driver_write8, /* name */ be_nested_proto( 9, /* nstack */ 3, /* argc */ @@ -76,13 +74,13 @@ be_local_closure(write8, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_string("wire", -212213352, 4), - /* K1 */ be_nested_string("write", -1104765092, 5), - /* K2 */ be_nested_string("addr", 1087856498, 4), + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(write), + /* K2 */ be_nested_str(addr), /* K3 */ be_const_int(1), }), - (be_nested_const_str("write8", -1160975764, 6)), - ((bstring*) &be_const_str_input), + &be_const_str_write8, + &be_const_str_solidified, ( &(const binstruction[ 8]) { /* code */ 0x880C0100, // 0000 GETMBR R3 R0 K0 0x8C0C0701, // 0001 GETMET R3 R3 K1 @@ -101,7 +99,7 @@ be_local_closure(write8, /* name */ /******************************************************************** ** Solidified function: read12 ********************************************************************/ -be_local_closure(read12, /* name */ +be_local_closure(I2C_Driver_read12, /* name */ be_nested_proto( 7, /* nstack */ 2, /* argc */ @@ -112,15 +110,15 @@ be_local_closure(read12, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_string("wire", -212213352, 4), - /* K1 */ be_nested_string("read_bytes", -718234123, 10), - /* K2 */ be_nested_string("addr", 1087856498, 4), + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read_bytes), + /* K2 */ be_nested_str(addr), /* K3 */ be_const_int(2), /* K4 */ be_const_int(0), /* K5 */ be_const_int(1), }), - (be_nested_const_str("read12", -3890326, 6)), - ((bstring*) &be_const_str_input), + &be_const_str_read12, + &be_const_str_solidified, ( &(const binstruction[12]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 @@ -143,7 +141,7 @@ be_local_closure(read12, /* name */ /******************************************************************** ** Solidified function: write_bit ********************************************************************/ -be_local_closure(write_bit, /* name */ +be_local_closure(I2C_Driver_write_bit, /* name */ be_nested_proto( 11, /* nstack */ 4, /* argc */ @@ -156,11 +154,11 @@ be_local_closure(write_bit, /* name */ ( &(const bvalue[ 4]) { /* constants */ /* K0 */ be_const_int(0), /* K1 */ be_const_int(1), - /* K2 */ be_nested_string("write8", -1160975764, 6), - /* K3 */ be_nested_string("read8", -1492179129, 5), + /* K2 */ be_nested_str(write8), + /* K3 */ be_nested_str(read8), }), - (be_nested_const_str("write_bit", -1633976860, 9)), - ((bstring*) &be_const_str_input), + &be_const_str_write_bit, + &be_const_str_solidified, ( &(const binstruction[26]) { /* code */ 0x14100500, // 0000 LT R4 R2 K0 0x74120002, // 0001 JMPT R4 #0005 @@ -197,7 +195,7 @@ be_local_closure(write_bit, /* name */ /******************************************************************** ** Solidified function: read24 ********************************************************************/ -be_local_closure(read24, /* name */ +be_local_closure(I2C_Driver_read24, /* name */ be_nested_proto( 7, /* nstack */ 2, /* argc */ @@ -208,16 +206,16 @@ be_local_closure(read24, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_string("wire", -212213352, 4), - /* K1 */ be_nested_string("read_bytes", -718234123, 10), - /* K2 */ be_nested_string("addr", 1087856498, 4), + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read_bytes), + /* K2 */ be_nested_str(addr), /* K3 */ be_const_int(3), /* K4 */ be_const_int(0), /* K5 */ be_const_int(1), /* K6 */ be_const_int(2), }), - (be_nested_const_str("read24", 1808533811, 6)), - ((bstring*) &be_const_str_input), + &be_const_str_read24, + &be_const_str_solidified, ( &(const binstruction[16]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 @@ -244,7 +242,7 @@ be_local_closure(read24, /* name */ /******************************************************************** ** Solidified function: read8 ********************************************************************/ -be_local_closure(read8, /* name */ +be_local_closure(I2C_Driver_read8, /* name */ be_nested_proto( 7, /* nstack */ 2, /* argc */ @@ -255,13 +253,13 @@ be_local_closure(read8, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_string("wire", -212213352, 4), - /* K1 */ be_nested_string("read", -824204347, 4), - /* K2 */ be_nested_string("addr", 1087856498, 4), + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read), + /* K2 */ be_nested_str(addr), /* K3 */ be_const_int(1), }), - (be_nested_const_str("read8", -1492179129, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_read8, + &be_const_str_solidified, ( &(const binstruction[ 7]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 @@ -279,7 +277,7 @@ be_local_closure(read8, /* name */ /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(init, /* name */ +be_local_closure(I2C_Driver_init, /* name */ be_nested_proto( 10, /* nstack */ 4, /* argc */ @@ -290,19 +288,19 @@ be_local_closure(init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[10]) { /* constants */ - /* K0 */ be_nested_string("get_tasmota", 334356779, 11), - /* K1 */ be_nested_string("i2c_enabled", 218388101, 11), - /* K2 */ be_nested_string("addr", 1087856498, 4), - /* K3 */ be_nested_string("wire", -212213352, 4), - /* K4 */ be_nested_string("wire_scan", -1623691416, 9), - /* K5 */ be_nested_string("function", -1630125495, 8), - /* K6 */ be_nested_string("name", -1925595674, 4), - /* K7 */ be_nested_string("I2C:", 813483371, 4), - /* K8 */ be_nested_string("detected on bus", 1432002650, 15), - /* K9 */ be_nested_string("bus", 1607822841, 3), + /* K0 */ be_nested_str(get_tasmota), + /* K1 */ be_nested_str(i2c_enabled), + /* K2 */ be_nested_str(addr), + /* K3 */ be_nested_str(wire), + /* K4 */ be_nested_str(wire_scan), + /* K5 */ be_nested_str(function), + /* K6 */ be_nested_str(name), + /* K7 */ be_nested_str(I2C_X3A), + /* K8 */ be_nested_str(detected_X20on_X20bus), + /* K9 */ be_nested_str(bus), }), - ((bstring*) &be_const_str_init), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[44]) { /* code */ 0x8C100100, // 0000 GETMET R4 R0 K0 0x7C100200, // 0001 CALL R4 1 @@ -357,7 +355,7 @@ be_local_closure(init, /* name */ /******************************************************************** ** Solidified function: read13 ********************************************************************/ -be_local_closure(read13, /* name */ +be_local_closure(I2C_Driver_read13, /* name */ be_nested_proto( 7, /* nstack */ 2, /* argc */ @@ -368,15 +366,15 @@ be_local_closure(read13, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_string("wire", -212213352, 4), - /* K1 */ be_nested_string("read_bytes", -718234123, 10), - /* K2 */ be_nested_string("addr", 1087856498, 4), + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read_bytes), + /* K2 */ be_nested_str(addr), /* K3 */ be_const_int(2), /* K4 */ be_const_int(0), /* K5 */ be_const_int(1), }), - (be_nested_const_str("read13", 12887293, 6)), - ((bstring*) &be_const_str_input), + &be_const_str_read13, + &be_const_str_solidified, ( &(const binstruction[12]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 @@ -395,27 +393,33 @@ be_local_closure(read13, /* name */ ); /*******************************************************************/ -#include "../generate/be_fixed_be_class_I2C_Driver.h" -void be_load_driver_i2c_lib(bvm *vm) { +/******************************************************************** +** Solidified class: I2C_Driver +********************************************************************/ +be_local_class(I2C_Driver, + 3, + NULL, + be_nested_map(11, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(read32, -1), be_const_closure(I2C_Driver_read32_closure) }, + { be_const_key(write8, 6), be_const_closure(I2C_Driver_write8_closure) }, + { be_const_key(name, -1), be_const_var(2) }, + { be_const_key(addr, 8), be_const_var(1) }, + { be_const_key(read12, -1), be_const_closure(I2C_Driver_read12_closure) }, + { be_const_key(wire, 10), be_const_var(0) }, + { be_const_key(read13, -1), be_const_closure(I2C_Driver_read13_closure) }, + { be_const_key(read24, -1), be_const_closure(I2C_Driver_read24_closure) }, + { be_const_key(read8, -1), be_const_closure(I2C_Driver_read8_closure) }, + { be_const_key(init, -1), be_const_closure(I2C_Driver_init_closure) }, + { be_const_key(write_bit, -1), be_const_closure(I2C_Driver_write_bit_closure) }, + })), + be_str_literal("I2C_Driver") +); +/*******************************************************************/ + +void be_load_I2C_Driver_class(bvm *vm) { be_pushntvclass(vm, &be_class_I2C_Driver); be_setglobal(vm, "I2C_Driver"); be_pop(vm, 1); } -/* @const_object_info_begin - -class be_class_I2C_Driver (scope: global, name: I2C_Driver, super: be_class_Driver) { - wire, var - addr, var - name, var - - init, closure(init_closure) - write8, closure(write8_closure) - write_bit, closure(write_bit_closure) - read8, closure(read8_closure) - read12, closure(read12_closure) - read13, closure(read13_closure) - read24, closure(read24_closure) - read32, closure(read32_closure) -} -@const_object_info_end */ diff --git a/lib/libesp32/Berry/default/be_leds_animator_lib.c b/lib/libesp32/Berry/default/be_leds_animator_lib.c index c5783edb9..bd82193b9 100644 --- a/lib/libesp32/Berry/default/be_leds_animator_lib.c +++ b/lib/libesp32/Berry/default/be_leds_animator_lib.c @@ -20,17 +20,17 @@ be_local_closure(Leds_animator_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_string("strip", -48555823, 5), - /* K1 */ be_nested_string("bri", 2112284244, 3), - /* K2 */ be_nested_string("running", 343848780, 7), - /* K3 */ be_nested_string("pixel_count", -1855836553, 11), - /* K4 */ be_nested_string("animators", 279858213, 9), - /* K5 */ be_nested_string("clear", 1550717474, 5), - /* K6 */ be_nested_string("tasmota", 424643812, 7), - /* K7 */ be_nested_string("add_driver", 1654458371, 10), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(bri), + /* K2 */ be_nested_str(running), + /* K3 */ be_nested_str(pixel_count), + /* K4 */ be_nested_str(animators), + /* K5 */ be_nested_str(clear), + /* K6 */ be_nested_str(tasmota), + /* K7 */ be_nested_str(add_driver), }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[18]) { /* code */ 0x90020001, // 0000 SETMBR R0 K0 R1 0x540A0031, // 0001 LDINT R2 50 @@ -70,10 +70,10 @@ be_local_closure(Leds_animator_set_bri, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("bri", 2112284244, 3), + /* K0 */ be_nested_str(bri), }), - (be_nested_const_str("set_bri", -1505848517, 7)), - ((bstring*) &be_const_str_input), + &be_const_str_set_bri, + &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0x90020001, // 0000 SETMBR R0 K0 R1 0x80000000, // 0001 RET 0 @@ -97,10 +97,10 @@ be_local_closure(Leds_animator_stop, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("running", 343848780, 7), + /* K0 */ be_nested_str(running), }), - (be_nested_const_str("stop", -883741979, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_stop, + &be_const_str_solidified, ( &(const binstruction[ 3]) { /* code */ 0x50040000, // 0000 LDBOOL R1 0 0 0x90020001, // 0001 SETMBR R0 K0 R1 @@ -125,8 +125,8 @@ be_local_closure(Leds_animator_animate, /* name */ NULL, /* no sub protos */ 0, /* has constants */ NULL, /* no const */ - (be_nested_const_str("animate", -409180496, 7)), - ((bstring*) &be_const_str_input), + &be_const_str_animate, + &be_const_str_solidified, ( &(const binstruction[ 1]) { /* code */ 0x80000000, // 0000 RET 0 }) @@ -149,11 +149,11 @@ be_local_closure(Leds_animator_remove, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("tasmota", 424643812, 7), - /* K1 */ be_nested_string("remove_driver", 1030243768, 13), + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(remove_driver), }), - (be_nested_const_str("remove", -611183107, 6)), - ((bstring*) &be_const_str_input), + &be_const_str_remove, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0xB8060000, // 0000 GETNGBL R1 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -180,16 +180,16 @@ be_local_closure(Leds_animator_every_50ms, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_string("running", 343848780, 7), + /* K0 */ be_nested_str(running), /* K1 */ be_const_int(0), - /* K2 */ be_nested_string("animators", 279858213, 9), - /* K3 */ be_nested_string("is_running", -2068120035, 10), - /* K4 */ be_nested_string("animate", -409180496, 7), + /* K2 */ be_nested_str(animators), + /* K3 */ be_nested_str(is_running), + /* K4 */ be_nested_str(animate), /* K5 */ be_const_int(1), - /* K6 */ be_nested_string("remove", -611183107, 6), + /* K6 */ be_nested_str(remove), }), - (be_nested_const_str("every_50ms", -1911083288, 10)), - ((bstring*) &be_const_str_input), + &be_const_str_every_50ms, + &be_const_str_solidified, ( &(const binstruction[25]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x78060015, // 0001 JMPF R1 #0018 @@ -236,10 +236,10 @@ be_local_closure(Leds_animator_get_bri, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("bri", 2112284244, 3), + /* K0 */ be_nested_str(bri), }), - (be_nested_const_str("get_bri", 2041809895, 7)), - ((bstring*) &be_const_str_input), + &be_const_str_get_bri, + &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x80040400, // 0001 RET 1 R2 @@ -263,10 +263,10 @@ be_local_closure(Leds_animator_start, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("running", 343848780, 7), + /* K0 */ be_nested_str(running), }), - (be_nested_const_str("start", 1697318111, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_start, + &be_const_str_solidified, ( &(const binstruction[ 3]) { /* code */ 0x50040200, // 0000 LDBOOL R1 1 0 0x90020001, // 0001 SETMBR R0 K0 R1 @@ -291,12 +291,12 @@ be_local_closure(Leds_animator_add_anim, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("animators", 279858213, 9), - /* K1 */ be_nested_string("push", -2022703139, 4), - /* K2 */ be_nested_string("run", 718098122, 3), + /* K0 */ be_nested_str(animators), + /* K1 */ be_nested_str(push), + /* K2 */ be_nested_str(run), }), - (be_nested_const_str("add_anim", -314304628, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_add_anim, + &be_const_str_solidified, ( &(const binstruction[ 7]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 @@ -325,12 +325,12 @@ be_local_closure(Leds_animator_clear, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("stop", -883741979, 4), - /* K1 */ be_nested_string("strip", -48555823, 5), - /* K2 */ be_nested_string("clear", 1550717474, 5), + /* K0 */ be_nested_str(stop), + /* K1 */ be_nested_str(strip), + /* K2 */ be_nested_str(clear), }), - (be_nested_const_str("clear", 1550717474, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_clear, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x7C040200, // 0001 CALL R1 1 @@ -352,23 +352,23 @@ be_local_class(Leds_animator, NULL, be_nested_map(15, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("init", 380752755, 4, 7), be_const_closure(Leds_animator_init_closure) }, - { be_nested_key("set_bri", -1505848517, 7, -1), be_const_closure(Leds_animator_set_bri_closure) }, - { be_nested_key("stop", -883741979, 4, -1), be_const_closure(Leds_animator_stop_closure) }, - { be_nested_key("strip", -48555823, 5, 4), be_const_var(0) }, - { be_nested_key("animators", 279858213, 9, 12), be_const_var(4) }, - { be_nested_key("animate", -409180496, 7, -1), be_const_closure(Leds_animator_animate_closure) }, - { be_nested_key("remove", -611183107, 6, -1), be_const_closure(Leds_animator_remove_closure) }, - { be_nested_key("running", 343848780, 7, -1), be_const_var(3) }, - { be_nested_key("every_50ms", -1911083288, 10, -1), be_const_closure(Leds_animator_every_50ms_closure) }, - { be_nested_key("bri", 2112284244, 3, 6), be_const_var(2) }, - { be_nested_key("get_bri", 2041809895, 7, -1), be_const_closure(Leds_animator_get_bri_closure) }, - { be_nested_key("start", 1697318111, 5, -1), be_const_closure(Leds_animator_start_closure) }, - { be_nested_key("add_anim", -314304628, 8, 13), be_const_closure(Leds_animator_add_anim_closure) }, - { be_nested_key("pixel_count", -1855836553, 11, -1), be_const_var(1) }, - { be_nested_key("clear", 1550717474, 5, 1), be_const_closure(Leds_animator_clear_closure) }, + { be_const_key(init, 12), be_const_closure(Leds_animator_init_closure) }, + { be_const_key(clear, -1), be_const_closure(Leds_animator_clear_closure) }, + { be_const_key(stop, -1), be_const_closure(Leds_animator_stop_closure) }, + { be_const_key(strip, 4), be_const_var(0) }, + { be_const_key(pixel_count, 6), be_const_var(1) }, + { be_const_key(animate, -1), be_const_closure(Leds_animator_animate_closure) }, + { be_const_key(add_anim, 13), be_const_closure(Leds_animator_add_anim_closure) }, + { be_const_key(bri, -1), be_const_var(2) }, + { be_const_key(every_50ms, -1), be_const_closure(Leds_animator_every_50ms_closure) }, + { be_const_key(remove, 7), be_const_closure(Leds_animator_remove_closure) }, + { be_const_key(get_bri, -1), be_const_closure(Leds_animator_get_bri_closure) }, + { be_const_key(start, -1), be_const_closure(Leds_animator_start_closure) }, + { be_const_key(running, -1), be_const_var(3) }, + { be_const_key(animators, -1), be_const_var(4) }, + { be_const_key(set_bri, 1), be_const_closure(Leds_animator_set_bri_closure) }, })), - (be_nested_const_str("Leds_animator", 142168673, 13)) + be_str_literal("Leds_animator") ); /*******************************************************************/ diff --git a/lib/libesp32/Berry/default/be_leds_lib.c b/lib/libesp32/Berry/default/be_leds_lib.c index 06e322c13..58b0a991e 100644 --- a/lib/libesp32/Berry/default/be_leds_lib.c +++ b/lib/libesp32/Berry/default/be_leds_lib.c @@ -20,11 +20,11 @@ be_local_closure(Leds_matrix_pixel_count, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("w"), - /* K1 */ be_nested_str_literal("h"), + /* K0 */ be_nested_str(w), + /* K1 */ be_nested_str(h), }), - (be_nested_const_str("pixel_count", -1855836553, 11)), - ((bstring*) &be_const_str_input), + &be_const_str_pixel_count, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x88080101, // 0001 GETMBR R2 R0 K1 @@ -50,10 +50,10 @@ be_local_closure(Leds_matrix_set_alternate, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_literal("alternate"), + /* K0 */ be_nested_str(alternate), }), - (be_nested_const_str("set_alternate", 1709680562, 13)), - ((bstring*) &be_const_str_input), + &be_const_str_set_alternate, + &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0x90020001, // 0000 SETMBR R0 K0 R1 0x80000000, // 0001 RET 0 @@ -77,11 +77,11 @@ be_local_closure(Leds_matrix_pixel_size, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("pixel_size"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(pixel_size), }), - (be_nested_const_str("pixel_size", -2085831511, 10)), - ((bstring*) &be_const_str_input), + &be_const_str_pixel_size, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -107,12 +107,12 @@ be_local_closure(Leds_matrix_set_pixel_color, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("set_pixel_color"), - /* K2 */ be_nested_str_literal("offset"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(set_pixel_color), + /* K2 */ be_nested_str(offset), }), - (be_nested_const_str("set_pixel_color", 1275248356, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_set_pixel_color, + &be_const_str_solidified, ( &(const binstruction[ 8]) { /* code */ 0x88100100, // 0000 GETMBR R4 R0 K0 0x8C100901, // 0001 GETMET R4 R4 K1 @@ -142,17 +142,17 @@ be_local_closure(Leds_matrix_set_matrix_pixel_color, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_str_literal("alternate"), + /* K0 */ be_nested_str(alternate), /* K1 */ be_const_int(2), - /* K2 */ be_nested_str_literal("strip"), - /* K3 */ be_nested_str_literal("set_pixel_color"), - /* K4 */ be_nested_str_literal("w"), - /* K5 */ be_nested_str_literal("h"), + /* K2 */ be_nested_str(strip), + /* K3 */ be_nested_str(set_pixel_color), + /* K4 */ be_nested_str(w), + /* K5 */ be_nested_str(h), /* K6 */ be_const_int(1), - /* K7 */ be_nested_str_literal("offset"), + /* K7 */ be_nested_str(offset), }), - (be_nested_const_str("set_matrix_pixel_color", 1197149462, 22)), - ((bstring*) &be_const_str_input), + &be_const_str_set_matrix_pixel_color, + &be_const_str_solidified, ( &(const binstruction[29]) { /* code */ 0x88140100, // 0000 GETMBR R5 R0 K0 0x7816000F, // 0001 JMPF R5 #0012 @@ -203,16 +203,16 @@ be_local_closure(Leds_matrix_show, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_str_literal("offset"), + /* K0 */ be_nested_str(offset), /* K1 */ be_const_int(0), - /* K2 */ be_nested_str_literal("w"), - /* K3 */ be_nested_str_literal("h"), - /* K4 */ be_nested_str_literal("strip"), - /* K5 */ be_nested_str_literal("leds"), - /* K6 */ be_nested_str_literal("show"), + /* K2 */ be_nested_str(w), + /* K3 */ be_nested_str(h), + /* K4 */ be_nested_str(strip), + /* K5 */ be_nested_str(leds), + /* K6 */ be_nested_str(show), }), - (be_nested_const_str("show", -1454906820, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_show, + &be_const_str_solidified, ( &(const binstruction[18]) { /* code */ 0x60080017, // 0000 GETGBL R2 G23 0x5C0C0200, // 0001 MOVE R3 R1 @@ -252,11 +252,11 @@ be_local_closure(Leds_matrix_is_dirty, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("is_dirty"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(is_dirty), }), - (be_nested_const_str("is_dirty", 418034110, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_is_dirty, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -283,15 +283,15 @@ be_local_closure(Leds_matrix_clear_to, /* name */ 1, /* has constants */ ( &(const bvalue[ 7]) { /* constants */ /* K0 */ be_const_int(0), - /* K1 */ be_nested_str_literal("w"), - /* K2 */ be_nested_str_literal("h"), - /* K3 */ be_nested_str_literal("strip"), - /* K4 */ be_nested_str_literal("set_pixel_color"), - /* K5 */ be_nested_str_literal("offset"), + /* K1 */ be_nested_str(w), + /* K2 */ be_nested_str(h), + /* K3 */ be_nested_str(strip), + /* K4 */ be_nested_str(set_pixel_color), + /* K5 */ be_nested_str(offset), /* K6 */ be_const_int(1), }), - (be_nested_const_str("clear_to", -766965166, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_clear_to, + &be_const_str_solidified, ( &(const binstruction[16]) { /* code */ 0x580C0000, // 0000 LDCONST R3 K0 0x88100101, // 0001 GETMBR R4 R0 K1 @@ -329,12 +329,12 @@ be_local_closure(Leds_matrix_clear, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_literal("clear_to"), + /* K0 */ be_nested_str(clear_to), /* K1 */ be_const_int(0), - /* K2 */ be_nested_str_literal("show"), + /* K2 */ be_nested_str(show), }), - (be_nested_const_str("clear", 1550717474, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_clear, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x580C0001, // 0001 LDCONST R3 K1 @@ -362,8 +362,8 @@ be_local_closure(Leds_matrix_pixels_buffer, /* name */ NULL, /* no sub protos */ 0, /* has constants */ NULL, /* no const */ - (be_nested_const_str("pixels_buffer", 1229555807, 13)), - ((bstring*) &be_const_str_input), + &be_const_str_pixels_buffer, + &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0x4C040000, // 0000 LDNIL R1 0x80040200, // 0001 RET 1 R1 @@ -387,14 +387,14 @@ be_local_closure(Leds_matrix_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("offset"), - /* K2 */ be_nested_str_literal("h"), - /* K3 */ be_nested_str_literal("w"), - /* K4 */ be_nested_str_literal("alternate"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(offset), + /* K2 */ be_nested_str(h), + /* K3 */ be_nested_str(w), + /* K4 */ be_nested_str(alternate), }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[ 7]) { /* code */ 0x90020001, // 0000 SETMBR R0 K0 R1 0x90020204, // 0001 SETMBR R0 K1 R4 @@ -423,11 +423,11 @@ be_local_closure(Leds_matrix_dirty, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("dirty"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(dirty), }), - (be_nested_const_str("dirty", -1627386213, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_dirty, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -453,12 +453,12 @@ be_local_closure(Leds_matrix_get_pixel_color, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("get_pixel_color"), - /* K2 */ be_nested_str_literal("offseta"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(get_pixel_color), + /* K2 */ be_nested_str(offseta), }), - (be_nested_const_str("get_pixel_color", 337490048, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_get_pixel_color, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 @@ -486,10 +486,10 @@ be_local_closure(Leds_matrix_get_alternate, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_literal("alternate"), + /* K0 */ be_nested_str(alternate), }), - (be_nested_const_str("get_alternate", 1450148894, 13)), - ((bstring*) &be_const_str_input), + &be_const_str_get_alternate, + &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x80040200, // 0001 RET 1 R1 @@ -513,8 +513,8 @@ be_local_closure(Leds_matrix_begin, /* name */ NULL, /* no sub protos */ 0, /* has constants */ NULL, /* no const */ - (be_nested_const_str("begin", 1748273790, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_begin, + &be_const_str_solidified, ( &(const binstruction[ 1]) { /* code */ 0x80000000, // 0000 RET 0 }) @@ -537,11 +537,11 @@ be_local_closure(Leds_matrix_can_show, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("can_show"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(can_show), }), - (be_nested_const_str("can_show", 960091187, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_can_show, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -561,27 +561,27 @@ be_local_class(Leds_matrix, NULL, be_nested_map(21, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("pixel_count", -1855836553, 11, -1), be_const_closure(Leds_matrix_pixel_count_closure) }, - { be_nested_key("h", -317966505, 1, 6), be_const_var(2) }, - { be_nested_key("set_alternate", 1709680562, 13, 7), be_const_closure(Leds_matrix_set_alternate_closure) }, - { be_nested_key("pixel_size", -2085831511, 10, 16), be_const_closure(Leds_matrix_pixel_size_closure) }, - { be_nested_key("set_pixel_color", 1275248356, 15, 19), be_const_closure(Leds_matrix_set_pixel_color_closure) }, - { be_nested_key("set_matrix_pixel_color", 1197149462, 22, 10), be_const_closure(Leds_matrix_set_matrix_pixel_color_closure) }, - { be_nested_key("show", -1454906820, 4, -1), be_const_closure(Leds_matrix_show_closure) }, - { be_nested_key("alternate", 1140253277, 9, -1), be_const_var(4) }, - { be_nested_key("strip", -48555823, 5, -1), be_const_var(0) }, - { be_nested_key("clear_to", -766965166, 8, -1), be_const_closure(Leds_matrix_clear_to_closure) }, - { be_nested_key("w", -234078410, 1, 15), be_const_var(3) }, - { be_nested_key("pixels_buffer", 1229555807, 13, -1), be_const_closure(Leds_matrix_pixels_buffer_closure) }, - { be_nested_key("init", 380752755, 4, -1), be_const_closure(Leds_matrix_init_closure) }, - { be_nested_key("dirty", -1627386213, 5, -1), be_const_closure(Leds_matrix_dirty_closure) }, - { be_nested_key("get_pixel_color", 337490048, 15, -1), be_const_closure(Leds_matrix_get_pixel_color_closure) }, - { be_nested_key("get_alternate", 1450148894, 13, 17), be_const_closure(Leds_matrix_get_alternate_closure) }, - { be_nested_key("offset", 348705738, 6, 8), be_const_var(1) }, - { be_nested_key("clear", 1550717474, 5, -1), be_const_closure(Leds_matrix_clear_closure) }, - { be_nested_key("begin", 1748273790, 5, -1), be_const_closure(Leds_matrix_begin_closure) }, - { be_nested_key("is_dirty", 418034110, 8, -1), be_const_closure(Leds_matrix_is_dirty_closure) }, - { be_nested_key("can_show", 960091187, 8, -1), be_const_closure(Leds_matrix_can_show_closure) }, + { be_const_key(pixel_count, -1), be_const_closure(Leds_matrix_pixel_count_closure) }, + { be_const_key(h, 6), be_const_var(2) }, + { be_const_key(set_alternate, 7), be_const_closure(Leds_matrix_set_alternate_closure) }, + { be_const_key(pixel_size, 16), be_const_closure(Leds_matrix_pixel_size_closure) }, + { be_const_key(set_pixel_color, 19), be_const_closure(Leds_matrix_set_pixel_color_closure) }, + { be_const_key(set_matrix_pixel_color, 10), be_const_closure(Leds_matrix_set_matrix_pixel_color_closure) }, + { be_const_key(show, -1), be_const_closure(Leds_matrix_show_closure) }, + { be_const_key(alternate, -1), be_const_var(4) }, + { be_const_key(strip, -1), be_const_var(0) }, + { be_const_key(clear_to, -1), be_const_closure(Leds_matrix_clear_to_closure) }, + { be_const_key(w, 15), be_const_var(3) }, + { be_const_key(pixels_buffer, -1), be_const_closure(Leds_matrix_pixels_buffer_closure) }, + { be_const_key(init, -1), be_const_closure(Leds_matrix_init_closure) }, + { be_const_key(dirty, -1), be_const_closure(Leds_matrix_dirty_closure) }, + { be_const_key(get_pixel_color, -1), be_const_closure(Leds_matrix_get_pixel_color_closure) }, + { be_const_key(get_alternate, 17), be_const_closure(Leds_matrix_get_alternate_closure) }, + { be_const_key(offset, 8), be_const_var(1) }, + { be_const_key(clear, -1), be_const_closure(Leds_matrix_clear_closure) }, + { be_const_key(begin, -1), be_const_closure(Leds_matrix_begin_closure) }, + { be_const_key(is_dirty, -1), be_const_closure(Leds_matrix_is_dirty_closure) }, + { be_const_key(can_show, -1), be_const_closure(Leds_matrix_can_show_closure) }, })), be_str_literal("Leds_matrix") ); @@ -601,13 +601,13 @@ be_local_closure(Leds_create_matrix, /* name */ 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ /* K0 */ be_const_int(0), - /* K1 */ be_nested_str_literal("leds"), - /* K2 */ be_nested_str_literal("value_error"), - /* K3 */ be_nested_str_literal("out of range"), + /* K1 */ be_nested_str(leds), + /* K2 */ be_nested_str(value_error), + /* K3 */ be_nested_str(out_X20of_X20range), /* K4 */ be_const_class(be_class_Leds_matrix), }), - (be_nested_const_str("create_matrix", -766781373, 13)), - ((bstring*) &be_const_str_input), + &be_const_str_create_matrix, + &be_const_str_solidified, ( &(const binstruction[37]) { /* code */ 0x60100009, // 0000 GETGBL R4 G9 0x5C140600, // 0001 MOVE R5 R3 @@ -666,11 +666,11 @@ be_local_closure(Leds_begin, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("call_native"), + /* K0 */ be_nested_str(call_native), /* K1 */ be_const_int(1), }), - (be_nested_const_str("begin", 1748273790, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_begin, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x580C0001, // 0001 LDCONST R3 K1 @@ -696,16 +696,16 @@ be_local_closure(Leds_to_gamma, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_str_literal("tasmota"), - /* K1 */ be_nested_str_literal("scale_uint"), + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(scale_uint), /* K2 */ be_const_int(0), /* K3 */ be_const_int(16711680), - /* K4 */ be_nested_str_literal("gamma"), - /* K5 */ be_nested_str_literal("light"), - /* K6 */ be_nested_str_literal("gamma8"), + /* K4 */ be_nested_str(gamma), + /* K5 */ be_nested_str(light), + /* K6 */ be_nested_str(gamma8), }), - (be_nested_const_str("to_gamma", 1597139862, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_to_gamma, + &be_const_str_solidified, ( &(const binstruction[67]) { /* code */ 0x4C0C0000, // 0000 LDNIL R3 0x200C0403, // 0001 NE R3 R2 R3 @@ -794,10 +794,10 @@ be_local_closure(Leds_pixel_count, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_literal("call_native"), + /* K0 */ be_nested_str(call_native), }), - (be_nested_const_str("pixel_count", -1855836553, 11)), - ((bstring*) &be_const_str_input), + &be_const_str_pixel_count, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E0007, // 0001 LDINT R3 8 @@ -823,12 +823,12 @@ be_local_closure(Leds_matrix, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_literal("Leds"), - /* K1 */ be_nested_str_literal("create_matrix"), + /* K0 */ be_nested_str(Leds), + /* K1 */ be_nested_str(create_matrix), /* K2 */ be_const_int(0), }), - (be_nested_const_str("matrix", 365099244, 6)), - ((bstring*) &be_const_str_input), + &be_const_str_matrix, + &be_const_str_solidified, ( &(const binstruction[11]) { /* code */ 0xB8120000, // 0000 GETNGBL R4 K0 0x08140001, // 0001 MUL R5 R0 R1 @@ -861,10 +861,10 @@ be_local_closure(Leds_pixel_size, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_literal("call_native"), + /* K0 */ be_nested_str(call_native), }), - (be_nested_const_str("pixel_size", -2085831511, 10)), - ((bstring*) &be_const_str_input), + &be_const_str_pixel_size, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E0006, // 0001 LDINT R3 7 @@ -890,10 +890,10 @@ be_local_closure(Leds_pixels_buffer, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_literal("call_native"), + /* K0 */ be_nested_str(call_native), }), - (be_nested_const_str("pixels_buffer", 1229555807, 13)), - ((bstring*) &be_const_str_input), + &be_const_str_pixels_buffer, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E0005, // 0001 LDINT R3 6 @@ -919,10 +919,10 @@ be_local_closure(Leds_get_pixel_color, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_literal("call_native"), + /* K0 */ be_nested_str(call_native), }), - (be_nested_const_str("get_pixel_color", 337490048, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_get_pixel_color, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x8C080100, // 0000 GETMET R2 R0 K0 0x5412000A, // 0001 LDINT R4 11 @@ -949,11 +949,11 @@ be_local_closure(Leds_set_pixel_color, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("call_native"), - /* K1 */ be_nested_str_literal("to_gamma"), + /* K0 */ be_nested_str(call_native), + /* K1 */ be_nested_str(to_gamma), }), - (be_nested_const_str("set_pixel_color", 1275248356, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_set_pixel_color, + &be_const_str_solidified, ( &(const binstruction[ 9]) { /* code */ 0x8C100100, // 0000 GETMET R4 R0 K0 0x541A0009, // 0001 LDINT R6 10 @@ -984,10 +984,10 @@ be_local_closure(Leds_is_dirty, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_literal("call_native"), + /* K0 */ be_nested_str(call_native), }), - (be_nested_const_str("is_dirty", 418034110, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_is_dirty, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E0003, // 0001 LDINT R3 4 @@ -1013,21 +1013,21 @@ be_local_closure(Leds_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[12]) { /* constants */ - /* K0 */ be_nested_str_literal("gamma"), - /* K1 */ be_nested_str_literal("leds"), - /* K2 */ be_nested_str_literal("pin"), - /* K3 */ be_nested_str_literal("WS2812"), + /* K0 */ be_nested_str(gamma), + /* K1 */ be_nested_str(leds), + /* K2 */ be_nested_str(pin), + /* K3 */ be_nested_str(WS2812), /* K4 */ be_const_int(0), - /* K5 */ be_nested_str_literal("valuer_error"), - /* K6 */ be_nested_str_literal("no GPIO specified for neopixelbus"), - /* K7 */ be_nested_str_literal("ctor"), - /* K8 */ be_nested_str_literal("_p"), - /* K9 */ be_nested_str_literal("internal_error"), - /* K10 */ be_nested_str_literal("couldn't not initialize noepixelbus"), - /* K11 */ be_nested_str_literal("begin"), + /* K5 */ be_nested_str(valuer_error), + /* K6 */ be_nested_str(no_X20GPIO_X20specified_X20for_X20neopixelbus), + /* K7 */ be_nested_str(ctor), + /* K8 */ be_nested_str(_p), + /* K9 */ be_nested_str(internal_error), + /* K10 */ be_nested_str(couldn_X27t_X20not_X20initialize_X20noepixelbus), + /* K11 */ be_nested_str(begin), }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[36]) { /* code */ 0x50140200, // 0000 LDBOOL R5 1 0 0x90020005, // 0001 SETMBR R0 K0 R5 @@ -1085,11 +1085,11 @@ be_local_closure(Leds_clear_to, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("call_native"), - /* K1 */ be_nested_str_literal("to_gamma"), + /* K0 */ be_nested_str(call_native), + /* K1 */ be_nested_str(to_gamma), }), - (be_nested_const_str("clear_to", -766965166, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_clear_to, + &be_const_str_solidified, ( &(const binstruction[ 8]) { /* code */ 0x8C0C0100, // 0000 GETMET R3 R0 K0 0x54160008, // 0001 LDINT R5 9 @@ -1119,11 +1119,11 @@ be_local_closure(Leds_can_show, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("call_native"), + /* K0 */ be_nested_str(call_native), /* K1 */ be_const_int(3), }), - (be_nested_const_str("can_show", 960091187, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_can_show, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x580C0001, // 0001 LDCONST R3 K1 @@ -1149,12 +1149,12 @@ be_local_closure(Leds_clear, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_literal("clear_to"), + /* K0 */ be_nested_str(clear_to), /* K1 */ be_const_int(0), - /* K2 */ be_nested_str_literal("show"), + /* K2 */ be_nested_str(show), }), - (be_nested_const_str("clear", 1550717474, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_clear, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x580C0001, // 0001 LDCONST R3 K1 @@ -1182,11 +1182,11 @@ be_local_closure(Leds_show, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("call_native"), + /* K0 */ be_nested_str(call_native), /* K1 */ be_const_int(2), }), - (be_nested_const_str("show", -1454906820, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_show, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x580C0001, // 0001 LDCONST R3 K1 @@ -1212,11 +1212,11 @@ be_local_closure(Leds_ctor, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("call_native"), + /* K0 */ be_nested_str(call_native), /* K1 */ be_const_int(0), }), - (be_nested_const_str("ctor", 375399343, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_ctor, + &be_const_str_solidified, ( &(const binstruction[16]) { /* code */ 0x4C100000, // 0000 LDNIL R4 0x1C100604, // 0001 EQ R4 R3 R4 @@ -1254,10 +1254,10 @@ be_local_closure(Leds_dirty, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_literal("call_native"), + /* K0 */ be_nested_str(call_native), }), - (be_nested_const_str("dirty", -1627386213, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_dirty, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x540E0004, // 0001 LDINT R3 5 @@ -1283,12 +1283,12 @@ be_local_closure(Leds_segment_get_pixel_color, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("get_pixel_color"), - /* K2 */ be_nested_str_literal("offseta"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(get_pixel_color), + /* K2 */ be_nested_str(offseta), }), - (be_nested_const_str("get_pixel_color", 337490048, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_get_pixel_color, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 @@ -1317,14 +1317,14 @@ be_local_closure(Leds_segment_clear_to, /* name */ 1, /* has constants */ ( &(const bvalue[ 6]) { /* constants */ /* K0 */ be_const_int(0), - /* K1 */ be_nested_str_literal("leds"), - /* K2 */ be_nested_str_literal("strip"), - /* K3 */ be_nested_str_literal("set_pixel_color"), - /* K4 */ be_nested_str_literal("offset"), + /* K1 */ be_nested_str(leds), + /* K2 */ be_nested_str(strip), + /* K3 */ be_nested_str(set_pixel_color), + /* K4 */ be_nested_str(offset), /* K5 */ be_const_int(1), }), - (be_nested_const_str("clear_to", -766965166, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_clear_to, + &be_const_str_solidified, ( &(const binstruction[14]) { /* code */ 0x580C0000, // 0000 LDCONST R3 K0 0x88100101, // 0001 GETMBR R4 R0 K1 @@ -1360,11 +1360,11 @@ be_local_closure(Leds_segment_can_show, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("can_show"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(can_show), }), - (be_nested_const_str("can_show", 960091187, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_can_show, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -1390,12 +1390,12 @@ be_local_closure(Leds_segment_set_pixel_color, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("set_pixel_color"), - /* K2 */ be_nested_str_literal("offset"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(set_pixel_color), + /* K2 */ be_nested_str(offset), }), - (be_nested_const_str("set_pixel_color", 1275248356, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_set_pixel_color, + &be_const_str_solidified, ( &(const binstruction[ 8]) { /* code */ 0x88100100, // 0000 GETMBR R4 R0 K0 0x8C100901, // 0001 GETMET R4 R4 K1 @@ -1425,12 +1425,12 @@ be_local_closure(Leds_segment_clear, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_literal("clear_to"), + /* K0 */ be_nested_str(clear_to), /* K1 */ be_const_int(0), - /* K2 */ be_nested_str_literal("show"), + /* K2 */ be_nested_str(show), }), - (be_nested_const_str("clear", 1550717474, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_clear, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x8C040100, // 0000 GETMET R1 R0 K0 0x580C0001, // 0001 LDCONST R3 K1 @@ -1458,8 +1458,8 @@ be_local_closure(Leds_segment_begin, /* name */ NULL, /* no sub protos */ 0, /* has constants */ NULL, /* no const */ - (be_nested_const_str("begin", 1748273790, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_begin, + &be_const_str_solidified, ( &(const binstruction[ 1]) { /* code */ 0x80000000, // 0000 RET 0 }) @@ -1482,10 +1482,10 @@ be_local_closure(Leds_segment_pixel_count, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_literal("leds"), + /* K0 */ be_nested_str(leds), }), - (be_nested_const_str("pixel_count", -1855836553, 11)), - ((bstring*) &be_const_str_input), + &be_const_str_pixel_count, + &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x80040200, // 0001 RET 1 R1 @@ -1509,12 +1509,12 @@ be_local_closure(Leds_segment_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("offset"), - /* K2 */ be_nested_str_literal("leds"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(offset), + /* K2 */ be_nested_str(leds), }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[10]) { /* code */ 0x90020001, // 0000 SETMBR R0 K0 R1 0x60100009, // 0001 GETGBL R4 G9 @@ -1546,11 +1546,11 @@ be_local_closure(Leds_segment_pixel_size, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("pixel_size"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(pixel_size), }), - (be_nested_const_str("pixel_size", -2085831511, 10)), - ((bstring*) &be_const_str_input), + &be_const_str_pixel_size, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -1576,11 +1576,11 @@ be_local_closure(Leds_segment_dirty, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("dirty"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(dirty), }), - (be_nested_const_str("dirty", -1627386213, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_dirty, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -1606,14 +1606,14 @@ be_local_closure(Leds_segment_show, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_str_literal("offset"), + /* K0 */ be_nested_str(offset), /* K1 */ be_const_int(0), - /* K2 */ be_nested_str_literal("leds"), - /* K3 */ be_nested_str_literal("strip"), - /* K4 */ be_nested_str_literal("show"), + /* K2 */ be_nested_str(leds), + /* K3 */ be_nested_str(strip), + /* K4 */ be_nested_str(show), }), - (be_nested_const_str("show", -1454906820, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_show, + &be_const_str_solidified, ( &(const binstruction[16]) { /* code */ 0x60080017, // 0000 GETGBL R2 G23 0x5C0C0200, // 0001 MOVE R3 R1 @@ -1651,11 +1651,11 @@ be_local_closure(Leds_segment_is_dirty, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("strip"), - /* K1 */ be_nested_str_literal("is_dirty"), + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(is_dirty), }), - (be_nested_const_str("is_dirty", 418034110, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_is_dirty, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -1681,8 +1681,8 @@ be_local_closure(Leds_segment_pixels_buffer, /* name */ NULL, /* no sub protos */ 0, /* has constants */ NULL, /* no const */ - (be_nested_const_str("pixels_buffer", 1229555807, 13)), - ((bstring*) &be_const_str_input), + &be_const_str_pixels_buffer, + &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0x4C040000, // 0000 LDNIL R1 0x80040200, // 0001 RET 1 R1 @@ -1700,22 +1700,22 @@ be_local_class(Leds_segment, NULL, be_nested_map(16, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("get_pixel_color", 337490048, 15, -1), be_const_closure(Leds_segment_get_pixel_color_closure) }, - { be_nested_key("strip", -48555823, 5, -1), be_const_var(0) }, - { be_nested_key("clear_to", -766965166, 8, 5), be_const_closure(Leds_segment_clear_to_closure) }, - { be_nested_key("can_show", 960091187, 8, 13), be_const_closure(Leds_segment_can_show_closure) }, - { be_nested_key("set_pixel_color", 1275248356, 15, -1), be_const_closure(Leds_segment_set_pixel_color_closure) }, - { be_nested_key("clear", 1550717474, 5, -1), be_const_closure(Leds_segment_clear_closure) }, - { be_nested_key("is_dirty", 418034110, 8, -1), be_const_closure(Leds_segment_is_dirty_closure) }, - { be_nested_key("pixel_count", -1855836553, 11, -1), be_const_closure(Leds_segment_pixel_count_closure) }, - { be_nested_key("leds", 558858555, 4, -1), be_const_var(2) }, - { be_nested_key("pixel_size", -2085831511, 10, -1), be_const_closure(Leds_segment_pixel_size_closure) }, - { be_nested_key("offset", 348705738, 6, -1), be_const_var(1) }, - { be_nested_key("dirty", -1627386213, 5, 8), be_const_closure(Leds_segment_dirty_closure) }, - { be_nested_key("show", -1454906820, 4, -1), be_const_closure(Leds_segment_show_closure) }, - { be_nested_key("init", 380752755, 4, -1), be_const_closure(Leds_segment_init_closure) }, - { be_nested_key("begin", 1748273790, 5, 6), be_const_closure(Leds_segment_begin_closure) }, - { be_nested_key("pixels_buffer", 1229555807, 13, -1), be_const_closure(Leds_segment_pixels_buffer_closure) }, + { be_const_key(get_pixel_color, -1), be_const_closure(Leds_segment_get_pixel_color_closure) }, + { be_const_key(strip, -1), be_const_var(0) }, + { be_const_key(clear_to, 5), be_const_closure(Leds_segment_clear_to_closure) }, + { be_const_key(can_show, 13), be_const_closure(Leds_segment_can_show_closure) }, + { be_const_key(set_pixel_color, -1), be_const_closure(Leds_segment_set_pixel_color_closure) }, + { be_const_key(clear, -1), be_const_closure(Leds_segment_clear_closure) }, + { be_const_key(is_dirty, -1), be_const_closure(Leds_segment_is_dirty_closure) }, + { be_const_key(pixel_count, -1), be_const_closure(Leds_segment_pixel_count_closure) }, + { be_const_key(leds, -1), be_const_var(2) }, + { be_const_key(pixel_size, -1), be_const_closure(Leds_segment_pixel_size_closure) }, + { be_const_key(offset, -1), be_const_var(1) }, + { be_const_key(dirty, 8), be_const_closure(Leds_segment_dirty_closure) }, + { be_const_key(show, -1), be_const_closure(Leds_segment_show_closure) }, + { be_const_key(init, -1), be_const_closure(Leds_segment_init_closure) }, + { be_const_key(begin, 6), be_const_closure(Leds_segment_begin_closure) }, + { be_const_key(pixels_buffer, -1), be_const_closure(Leds_segment_pixels_buffer_closure) }, })), be_str_literal("Leds_segment") ); @@ -1734,14 +1734,14 @@ be_local_closure(Leds_create_segment, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_str_literal("leds"), + /* K0 */ be_nested_str(leds), /* K1 */ be_const_int(0), - /* K2 */ be_nested_str_literal("value_error"), - /* K3 */ be_nested_str_literal("out of range"), + /* K2 */ be_nested_str(value_error), + /* K3 */ be_nested_str(out_X20of_X20range), /* K4 */ be_const_class(be_class_Leds_segment), }), - (be_nested_const_str("create_segment", -431444577, 14)), - ((bstring*) &be_const_str_input), + &be_const_str_create_segment, + &be_const_str_solidified, ( &(const binstruction[23]) { /* code */ 0x600C0009, // 0000 GETGBL R3 G9 0x5C100200, // 0001 MOVE R4 R1 @@ -1781,26 +1781,26 @@ be_local_class(Leds, &be_class_Leds_ntv, be_nested_map(20, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("pixel_count", -1855836553, 11, -1), be_const_closure(Leds_pixel_count_closure) }, - { be_nested_key("dirty", -1627386213, 5, 6), be_const_closure(Leds_dirty_closure) }, - { be_nested_key("to_gamma", 1597139862, 8, -1), be_const_closure(Leds_to_gamma_closure) }, - { be_nested_key("create_matrix", -766781373, 13, 1), be_const_closure(Leds_create_matrix_closure) }, - { be_nested_key("matrix", 365099244, 6, -1), be_const_static_closure(Leds_matrix_closure) }, - { be_nested_key("pixel_size", -2085831511, 10, -1), be_const_closure(Leds_pixel_size_closure) }, - { be_nested_key("ctor", 375399343, 4, 0), be_const_closure(Leds_ctor_closure) }, - { be_nested_key("pixels_buffer", 1229555807, 13, 13), be_const_closure(Leds_pixels_buffer_closure) }, - { be_nested_key("get_pixel_color", 337490048, 15, -1), be_const_closure(Leds_get_pixel_color_closure) }, - { be_nested_key("show", -1454906820, 4, -1), be_const_closure(Leds_show_closure) }, - { be_nested_key("begin", 1748273790, 5, 17), be_const_closure(Leds_begin_closure) }, - { be_nested_key("leds", 558858555, 4, -1), be_const_var(1) }, - { be_nested_key("clear", 1550717474, 5, -1), be_const_closure(Leds_clear_closure) }, - { be_nested_key("can_show", 960091187, 8, -1), be_const_closure(Leds_can_show_closure) }, - { be_nested_key("gamma", -802614262, 5, 12), be_const_var(0) }, - { be_nested_key("init", 380752755, 4, 11), be_const_closure(Leds_init_closure) }, - { be_nested_key("set_pixel_color", 1275248356, 15, 9), be_const_closure(Leds_set_pixel_color_closure) }, - { be_nested_key("clear_to", -766965166, 8, 18), be_const_closure(Leds_clear_to_closure) }, - { be_nested_key("is_dirty", 418034110, 8, -1), be_const_closure(Leds_is_dirty_closure) }, - { be_nested_key("create_segment", -431444577, 14, -1), be_const_closure(Leds_create_segment_closure) }, + { be_const_key(pixel_count, -1), be_const_closure(Leds_pixel_count_closure) }, + { be_const_key(dirty, 6), be_const_closure(Leds_dirty_closure) }, + { be_const_key(to_gamma, -1), be_const_closure(Leds_to_gamma_closure) }, + { be_const_key(create_matrix, 1), be_const_closure(Leds_create_matrix_closure) }, + { be_const_key(matrix, -1), be_const_static_closure(Leds_matrix_closure) }, + { be_const_key(pixel_size, -1), be_const_closure(Leds_pixel_size_closure) }, + { be_const_key(ctor, 0), be_const_closure(Leds_ctor_closure) }, + { be_const_key(pixels_buffer, 13), be_const_closure(Leds_pixels_buffer_closure) }, + { be_const_key(get_pixel_color, -1), be_const_closure(Leds_get_pixel_color_closure) }, + { be_const_key(show, -1), be_const_closure(Leds_show_closure) }, + { be_const_key(begin, 17), be_const_closure(Leds_begin_closure) }, + { be_const_key(leds, -1), be_const_var(1) }, + { be_const_key(clear, -1), be_const_closure(Leds_clear_closure) }, + { be_const_key(can_show, -1), be_const_closure(Leds_can_show_closure) }, + { be_const_key(gamma, 12), be_const_var(0) }, + { be_const_key(init, 11), be_const_closure(Leds_init_closure) }, + { be_const_key(set_pixel_color, 9), be_const_closure(Leds_set_pixel_color_closure) }, + { be_const_key(clear_to, 18), be_const_closure(Leds_clear_to_closure) }, + { be_const_key(is_dirty, -1), be_const_closure(Leds_is_dirty_closure) }, + { be_const_key(create_segment, -1), be_const_closure(Leds_create_segment_closure) }, })), be_str_literal("Leds") ); diff --git a/lib/libesp32/Berry/default/be_leds_ntv_lib.c b/lib/libesp32/Berry/default/be_leds_ntv_lib.c index 357786978..4d5b07bb6 100644 --- a/lib/libesp32/Berry/default/be_leds_ntv_lib.c +++ b/lib/libesp32/Berry/default/be_leds_ntv_lib.c @@ -30,11 +30,11 @@ be_local_class(Leds_ntv, NULL, be_nested_map(5, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("call_native", 1389147405, 11, -1), be_const_func(be_neopixelbus_call_native) }, - { be_nested_key("_t", 1527481326, 2, -1), be_const_var(1) }, - { be_nested_key("_p", 1594591802, 2, 3), be_const_var(0) }, - { be_nested_key("SK6812_GRBW", 81157857, 11, 4), be_const_int(2) }, - { be_nested_key("WS2812_GRB", 1736405692, 10, -1), be_const_int(1) }, + { be_const_key(call_native, -1), be_const_func(be_neopixelbus_call_native) }, + { be_const_key(_t, -1), be_const_var(1) }, + { be_const_key(_p, 3), be_const_var(0) }, + { be_const_key(SK6812_GRBW, 4), be_const_int(2) }, + { be_const_key(WS2812_GRB, -1), be_const_int(1) }, })), be_str_literal("Leds_ntv") ); diff --git a/lib/libesp32/Berry/default/be_lvgl_clock_icon_lib.c b/lib/libesp32/Berry/default/be_lvgl_clock_icon_lib.c index 4cef73ac9..c9cf7f207 100644 --- a/lib/libesp32/Berry/default/be_lvgl_clock_icon_lib.c +++ b/lib/libesp32/Berry/default/be_lvgl_clock_icon_lib.c @@ -10,7 +10,7 @@ /******************************************************************** ** Solidified function: set_time ********************************************************************/ -be_local_closure(set_time, /* name */ +be_local_closure(lv_clock_icon_set_time, /* name */ be_nested_proto( 11, /* nstack */ 4, /* argc */ @@ -21,19 +21,19 @@ be_local_closure(set_time, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[10]) { /* constants */ - /* K0 */ be_nested_string("string", 398550328, 6), - /* K1 */ be_nested_string("hour", -1241306097, 4), - /* K2 */ be_nested_string("minute", 954666857, 6), - /* K3 */ be_nested_string("sec", -1155074638, 3), - /* K4 */ be_nested_string("format", -1180859054, 6), - /* K5 */ be_nested_string("%02d%s%02d", 1587999717, 10), + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(hour), + /* K2 */ be_nested_str(minute), + /* K3 */ be_nested_str(sec), + /* K4 */ be_nested_str(format), + /* K5 */ be_nested_str(_X2502d_X25s_X2502d), /* K6 */ be_const_int(2), - /* K7 */ be_nested_string(":", 1057798253, 1), - /* K8 */ be_nested_string(" ", 621580159, 1), - /* K9 */ be_nested_string("set_text", 1849641155, 8), + /* K7 */ be_nested_str(_X3A), + /* K8 */ be_nested_str(_X20), + /* K9 */ be_nested_str(set_text), }), - (be_nested_const_str("set_time", 900236405, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_set_time, + &be_const_str_solidified, ( &(const binstruction[27]) { /* code */ 0xA4120000, // 0000 IMPORT R4 K0 0x88140101, // 0001 GETMBR R5 R0 K1 @@ -71,7 +71,7 @@ be_local_closure(set_time, /* name */ /******************************************************************** ** Solidified function: every_second ********************************************************************/ -be_local_closure(every_second, /* name */ +be_local_closure(lv_clock_icon_every_second, /* name */ be_nested_proto( 7, /* nstack */ 1, /* argc */ @@ -82,18 +82,18 @@ be_local_closure(every_second, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 9]) { /* constants */ - /* K0 */ be_nested_string("tasmota", 424643812, 7), - /* K1 */ be_nested_string("time_dump", -964556549, 9), - /* K2 */ be_nested_string("rtc", 1070575216, 3), - /* K3 */ be_nested_string("local", -1673304312, 5), - /* K4 */ be_nested_string("year", -1367388900, 4), - /* K5 */ be_nested_string("set_time", 900236405, 8), - /* K6 */ be_nested_string("hour", -1241306097, 4), - /* K7 */ be_nested_string("min", -913357481, 3), - /* K8 */ be_nested_string("sec", -1155074638, 3), + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(time_dump), + /* K2 */ be_nested_str(rtc), + /* K3 */ be_nested_str(local), + /* K4 */ be_nested_str(year), + /* K5 */ be_nested_str(set_time), + /* K6 */ be_nested_str(hour), + /* K7 */ be_nested_str(min), + /* K8 */ be_nested_str(sec), }), - (be_nested_const_str("every_second", 2075451465, 12)), - ((bstring*) &be_const_str_input), + &be_const_str_every_second, + &be_const_str_solidified, ( &(const binstruction[17]) { /* code */ 0xB8060000, // 0000 GETNGBL R1 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -121,7 +121,7 @@ be_local_closure(every_second, /* name */ /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(init, /* name */ +be_local_closure(lv_clock_icon_init, /* name */ be_nested_proto( 11, /* nstack */ 2, /* argc */ @@ -132,31 +132,31 @@ be_local_closure(init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[22]) { /* constants */ - /* K0 */ be_nested_string("init", 380752755, 4), - /* K1 */ be_nested_string("lv", 1529997255, 2), - /* K2 */ be_nested_string("seg7_font", -195276607, 9), - /* K3 */ be_nested_string("set_style_text_font", 1028590019, 19), - /* K4 */ be_nested_string("PART_MAIN", -1821475788, 9), - /* K5 */ be_nested_string("STATE_DEFAULT", 712406428, 13), - /* K6 */ be_nested_string("get_height", -723211773, 10), - /* K7 */ be_nested_string("set_text", 1849641155, 8), - /* K8 */ be_nested_string("--:--", 1370615441, 5), - /* K9 */ be_nested_string("refr_size", 1958144468, 9), - /* K10 */ be_nested_string("get_width", -1001549996, 9), - /* K11 */ be_nested_string("set_y", 1866178391, 5), + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(lv), + /* K2 */ be_nested_str(seg7_font), + /* K3 */ be_nested_str(set_style_text_font), + /* K4 */ be_nested_str(PART_MAIN), + /* K5 */ be_nested_str(STATE_DEFAULT), + /* K6 */ be_nested_str(get_height), + /* K7 */ be_nested_str(set_text), + /* K8 */ be_nested_str(_X2D_X2D_X3A_X2D_X2D), + /* K9 */ be_nested_str(refr_size), + /* K10 */ be_nested_str(get_width), + /* K11 */ be_nested_str(set_y), /* K12 */ be_const_int(2), - /* K13 */ be_nested_string("get_style_pad_right", -1144679830, 19), - /* K14 */ be_nested_string("set_x", 1849400772, 5), + /* K13 */ be_nested_str(get_style_pad_right), + /* K14 */ be_nested_str(set_x), /* K15 */ be_const_int(3), - /* K16 */ be_nested_string("set_style_pad_right", -980898242, 19), - /* K17 */ be_nested_string("set_style_bg_color", 1689513089, 18), - /* K18 */ be_nested_string("color", 1031692888, 5), - /* K19 */ be_nested_string("COLOR_BLACK", 264427940, 11), - /* K20 */ be_nested_string("tasmota", 424643812, 7), - /* K21 */ be_nested_string("add_driver", 1654458371, 10), + /* K16 */ be_nested_str(set_style_pad_right), + /* K17 */ be_nested_str(set_style_bg_color), + /* K18 */ be_nested_str(color), + /* K19 */ be_nested_str(COLOR_BLACK), + /* K20 */ be_nested_str(tasmota), + /* K21 */ be_nested_str(add_driver), }), - ((bstring*) &be_const_str_init), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[82]) { /* code */ 0x60080003, // 0000 GETGBL R2 G3 0x5C0C0000, // 0001 MOVE R3 R0 @@ -249,7 +249,7 @@ be_local_closure(init, /* name */ /******************************************************************** ** Solidified function: del ********************************************************************/ -be_local_closure(del, /* name */ +be_local_closure(lv_clock_icon_del, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -260,12 +260,12 @@ be_local_closure(del, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("del", -816214454, 3), - /* K1 */ be_nested_string("tasmota", 424643812, 7), - /* K2 */ be_nested_string("remove_driver", 1030243768, 13), + /* K0 */ be_nested_str(del), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(remove_driver), }), - (be_nested_const_str("del", -816214454, 3)), - ((bstring*) &be_const_str_input), + &be_const_str_del, + &be_const_str_solidified, ( &(const binstruction[10]) { /* code */ 0x60040003, // 0000 GETGBL R1 G3 0x5C080000, // 0001 MOVE R2 R0 @@ -292,15 +292,15 @@ be_local_class(lv_clock_icon, &be_class_lv_label, be_nested_map(7, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("sec", -1155074638, 3, -1), be_const_var(2) }, - { be_nested_key("hour", -1241306097, 4, -1), be_const_var(0) }, - { be_nested_key("set_time", 900236405, 8, 6), be_const_closure(set_time_closure) }, - { be_nested_key("every_second", 2075451465, 12, -1), be_const_closure(every_second_closure) }, - { be_nested_key("minute", 954666857, 6, -1), be_const_var(1) }, - { be_nested_key("init", 380752755, 4, 2), be_const_closure(init_closure) }, - { be_nested_key("del", -816214454, 3, -1), be_const_closure(del_closure) }, + { be_const_key(sec, -1), be_const_var(2) }, + { be_const_key(hour, -1), be_const_var(0) }, + { be_const_key(set_time, 6), be_const_closure(lv_clock_icon_set_time_closure) }, + { be_const_key(every_second, -1), be_const_closure(lv_clock_icon_every_second_closure) }, + { be_const_key(minute, -1), be_const_var(1) }, + { be_const_key(init, 2), be_const_closure(lv_clock_icon_init_closure) }, + { be_const_key(del, -1), be_const_closure(lv_clock_icon_del_closure) }, })), - (be_nested_const_str("lv_clock_icon", -1037751086, 13)) + be_str_literal("lv_clock_icon") ); /*******************************************************************/ diff --git a/lib/libesp32/Berry/default/be_lvgl_glob_lib.c b/lib/libesp32/Berry/default/be_lvgl_glob_lib.c index 31619f1c4..01bd4ed1d 100644 --- a/lib/libesp32/Berry/default/be_lvgl_glob_lib.c +++ b/lib/libesp32/Berry/default/be_lvgl_glob_lib.c @@ -10,7 +10,7 @@ /******************************************************************** ** Solidified function: get_object_from_ptr ********************************************************************/ -be_local_closure(get_object_from_ptr, /* name */ +be_local_closure(LVGL_glob_get_object_from_ptr, /* name */ be_nested_proto( 5, /* nstack */ 2, /* argc */ @@ -21,11 +21,11 @@ be_local_closure(get_object_from_ptr, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("cb_obj", 1195696482, 6), - /* K1 */ be_nested_string("find", -1108310694, 4), + /* K0 */ be_nested_str(cb_obj), + /* K1 */ be_nested_str(find), }), - (be_nested_const_str("get_object_from_ptr", -1949948095, 19)), - ((bstring*) &be_const_str_input), + &be_const_str_get_object_from_ptr, + &be_const_str_solidified, ( &(const binstruction[10]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x4C0C0000, // 0001 LDNIL R3 @@ -46,7 +46,7 @@ be_local_closure(get_object_from_ptr, /* name */ /******************************************************************** ** Solidified function: widget_event_impl ********************************************************************/ -be_local_closure(widget_event_impl, /* name */ +be_local_closure(LVGL_glob_widget_event_impl, /* name */ be_nested_proto( 12, /* nstack */ 3, /* argc */ @@ -57,18 +57,18 @@ be_local_closure(widget_event_impl, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 9]) { /* constants */ - /* K0 */ be_nested_string("introspect", 164638290, 10), - /* K1 */ be_nested_string("lv", 1529997255, 2), - /* K2 */ be_nested_string("lv_obj_class", -255311002, 12), - /* K3 */ be_nested_string("lv_event", -1860877328, 8), - /* K4 */ be_nested_string("target", 845187144, 6), - /* K5 */ be_nested_string("get_object_from_ptr", -1949948095, 19), - /* K6 */ be_nested_string("instance", 193386898, 8), - /* K7 */ be_nested_string("get", 1410115415, 3), - /* K8 */ be_nested_string("widget_event", 1951408186, 12), + /* K0 */ be_nested_str(introspect), + /* K1 */ be_nested_str(lv), + /* K2 */ be_nested_str(lv_obj_class), + /* K3 */ be_nested_str(lv_event), + /* K4 */ be_nested_str(target), + /* K5 */ be_nested_str(get_object_from_ptr), + /* K6 */ be_nested_str(instance), + /* K7 */ be_nested_str(get), + /* K8 */ be_nested_str(widget_event), }), - (be_nested_const_str("widget_event_impl", -2116536735, 17)), - ((bstring*) &be_const_str_input), + &be_const_str_widget_event_impl, + &be_const_str_solidified, ( &(const binstruction[30]) { /* code */ 0xA40E0000, // 0000 IMPORT R3 K0 0xB8120200, // 0001 GETNGBL R4 K1 @@ -109,7 +109,7 @@ be_local_closure(widget_event_impl, /* name */ /******************************************************************** ** Solidified function: lvgl_event_dispatch ********************************************************************/ -be_local_closure(lvgl_event_dispatch, /* name */ +be_local_closure(LVGL_glob_lvgl_event_dispatch, /* name */ be_nested_proto( 10, /* nstack */ 2, /* argc */ @@ -120,16 +120,16 @@ be_local_closure(lvgl_event_dispatch, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_string("introspect", 164638290, 10), - /* K1 */ be_nested_string("lv", 1529997255, 2), - /* K2 */ be_nested_string("lv_event", -1860877328, 8), - /* K3 */ be_nested_string("toptr", -915119842, 5), - /* K4 */ be_nested_string("target", 845187144, 6), - /* K5 */ be_nested_string("cb_event_closure", -466699971, 16), - /* K6 */ be_nested_string("get_object_from_ptr", -1949948095, 19), + /* K0 */ be_nested_str(introspect), + /* K1 */ be_nested_str(lv), + /* K2 */ be_nested_str(lv_event), + /* K3 */ be_nested_str(toptr), + /* K4 */ be_nested_str(target), + /* K5 */ be_nested_str(cb_event_closure), + /* K6 */ be_nested_str(get_object_from_ptr), }), - (be_nested_const_str("lvgl_event_dispatch", 2104396622, 19)), - ((bstring*) &be_const_str_input), + &be_const_str_lvgl_event_dispatch, + &be_const_str_solidified, ( &(const binstruction[20]) { /* code */ 0xA40A0000, // 0000 IMPORT R2 K0 0xB80E0200, // 0001 GETNGBL R3 K1 @@ -160,7 +160,7 @@ be_local_closure(lvgl_event_dispatch, /* name */ /******************************************************************** ** Solidified function: widget_dtor_impl ********************************************************************/ -be_local_closure(widget_dtor_impl, /* name */ +be_local_closure(LVGL_glob_widget_dtor_impl, /* name */ be_nested_proto( 10, /* nstack */ 3, /* argc */ @@ -171,16 +171,16 @@ be_local_closure(widget_dtor_impl, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_string("introspect", 164638290, 10), - /* K1 */ be_nested_string("lv", 1529997255, 2), - /* K2 */ be_nested_string("lv_obj_class", -255311002, 12), - /* K3 */ be_nested_string("get_object_from_ptr", -1949948095, 19), - /* K4 */ be_nested_string("instance", 193386898, 8), - /* K5 */ be_nested_string("get", 1410115415, 3), - /* K6 */ be_nested_string("widget_destructor", -87578951, 17), + /* K0 */ be_nested_str(introspect), + /* K1 */ be_nested_str(lv), + /* K2 */ be_nested_str(lv_obj_class), + /* K3 */ be_nested_str(get_object_from_ptr), + /* K4 */ be_nested_str(instance), + /* K5 */ be_nested_str(get), + /* K6 */ be_nested_str(widget_destructor), }), - (be_nested_const_str("widget_dtor_impl", 520430610, 16)), - ((bstring*) &be_const_str_input), + &be_const_str_widget_dtor_impl, + &be_const_str_solidified, ( &(const binstruction[22]) { /* code */ 0xA40E0000, // 0000 IMPORT R3 K0 0xB8120200, // 0001 GETNGBL R4 K1 @@ -213,7 +213,7 @@ be_local_closure(widget_dtor_impl, /* name */ /******************************************************************** ** Solidified function: register_obj ********************************************************************/ -be_local_closure(register_obj, /* name */ +be_local_closure(LVGL_glob_register_obj, /* name */ be_nested_proto( 4, /* nstack */ 2, /* argc */ @@ -224,11 +224,11 @@ be_local_closure(register_obj, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("cb_obj", 1195696482, 6), - /* K1 */ be_nested_string("_p", 1594591802, 2), + /* K0 */ be_nested_str(cb_obj), + /* K1 */ be_nested_str(_p), }), - (be_nested_const_str("register_obj", -312352526, 12)), - ((bstring*) &be_const_str_input), + &be_const_str_register_obj, + &be_const_str_solidified, ( &(const binstruction[13]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x4C0C0000, // 0001 LDNIL R3 @@ -252,7 +252,7 @@ be_local_closure(register_obj, /* name */ /******************************************************************** ** Solidified function: gen_cb ********************************************************************/ -be_local_closure(gen_cb, /* name */ +be_local_closure(LVGL_glob_gen_cb, /* name */ be_nested_proto( 8, /* nstack */ 5, /* argc */ @@ -273,10 +273,10 @@ be_local_closure(gen_cb, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("lvgl_event_dispatch", 2104396622, 19), + /* K0 */ be_nested_str(lvgl_event_dispatch), }), - (be_nested_const_str("", 607256038, 8)), - ((bstring*) &be_const_str_input), + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x68040000, // 0000 GETUPV R1 U0 0x8C040300, // 0001 GETMET R1 R1 K0 @@ -288,17 +288,17 @@ be_local_closure(gen_cb, /* name */ }), 1, /* has constants */ ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_string("lv_event_cb", -1814236280, 11), - /* K1 */ be_nested_string("cb_event_closure", -466699971, 16), - /* K2 */ be_nested_string("event_cb", -1166269279, 8), - /* K3 */ be_nested_string("tasmota", 424643812, 7), - /* K4 */ be_nested_string("gen_cb", -1049739745, 6), - /* K5 */ be_nested_string("register_obj", -312352526, 12), - /* K6 */ be_nested_string("null_cb", -1961430836, 7), - /* K7 */ be_nested_string("cb_do_nothing", 1488730702, 13), + /* K0 */ be_nested_str(lv_event_cb), + /* K1 */ be_nested_str(cb_event_closure), + /* K2 */ be_nested_str(event_cb), + /* K3 */ be_nested_str(tasmota), + /* K4 */ be_nested_str(gen_cb), + /* K5 */ be_nested_str(register_obj), + /* K6 */ be_nested_str(null_cb), + /* K7 */ be_nested_str(cb_do_nothing), }), - (be_nested_const_str("gen_cb", -1049739745, 6)), - ((bstring*) &be_const_str_input), + &be_const_str_gen_cb, + &be_const_str_solidified, ( &(const binstruction[41]) { /* code */ 0x1C140300, // 0000 EQ R5 R1 K0 0x78160018, // 0001 JMPF R5 #001B @@ -350,7 +350,7 @@ be_local_closure(gen_cb, /* name */ /******************************************************************** ** Solidified function: deregister_obj ********************************************************************/ -be_local_closure(deregister_obj, /* name */ +be_local_closure(LVGL_glob_deregister_obj, /* name */ be_nested_proto( 5, /* nstack */ 2, /* argc */ @@ -361,12 +361,12 @@ be_local_closure(deregister_obj, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("cb_obj", 1195696482, 6), - /* K1 */ be_nested_string("remove", -611183107, 6), - /* K2 */ be_nested_string("cb_event_closure", -466699971, 16), + /* K0 */ be_nested_str(cb_obj), + /* K1 */ be_nested_str(remove), + /* K2 */ be_nested_str(cb_event_closure), }), - (be_nested_const_str("deregister_obj", -385000303, 14)), - ((bstring*) &be_const_str_input), + &be_const_str_deregister_obj, + &be_const_str_solidified, ( &(const binstruction[17]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x4C0C0000, // 0001 LDNIL R3 @@ -394,7 +394,7 @@ be_local_closure(deregister_obj, /* name */ /******************************************************************** ** Solidified function: widget_cb ********************************************************************/ -be_local_closure(widget_cb, /* name */ +be_local_closure(LVGL_glob_widget_cb, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -415,10 +415,10 @@ be_local_closure(widget_cb, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("widget_ctor_impl", 194252479, 16), + /* K0 */ be_nested_str(widget_ctor_impl), }), - (be_nested_const_str("", 607256038, 8)), - ((bstring*) &be_const_str_input), + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x68080000, // 0000 GETUPV R2 U0 0x8C080500, // 0001 GETMET R2 R2 K0 @@ -440,10 +440,10 @@ be_local_closure(widget_cb, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("widget_dtor_impl", 520430610, 16), + /* K0 */ be_nested_str(widget_dtor_impl), }), - (be_nested_const_str("", 607256038, 8)), - ((bstring*) &be_const_str_input), + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x68080000, // 0000 GETUPV R2 U0 0x8C080500, // 0001 GETMET R2 R2 K0 @@ -465,10 +465,10 @@ be_local_closure(widget_cb, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("widget_event_impl", -2116536735, 17), + /* K0 */ be_nested_str(widget_event_impl), }), - (be_nested_const_str("", 607256038, 8)), - ((bstring*) &be_const_str_input), + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x68080000, // 0000 GETUPV R2 U0 0x8C080500, // 0001 GETMET R2 R2 K0 @@ -481,24 +481,24 @@ be_local_closure(widget_cb, /* name */ }), 1, /* has constants */ ( &(const bvalue[15]) { /* constants */ - /* K0 */ be_nested_string("widget_ctor_cb", 876007560, 14), - /* K1 */ be_nested_string("tasmota", 424643812, 7), - /* K2 */ be_nested_string("gen_cb", -1049739745, 6), - /* K3 */ be_nested_string("widget_dtor_cb", -1143421451, 14), - /* K4 */ be_nested_string("widget_event_cb", 1508466754, 15), - /* K5 */ be_nested_string("widget_struct_default", 781673633, 21), - /* K6 */ be_nested_string("lv", 1529997255, 2), - /* K7 */ be_nested_string("lv_obj_class", -255311002, 12), - /* K8 */ be_nested_string("lv_obj", -37134147, 6), - /* K9 */ be_nested_string("_class", -1562820946, 6), - /* K10 */ be_nested_string("copy", -446502332, 4), - /* K11 */ be_nested_string("base_class", 1107737279, 10), - /* K12 */ be_nested_string("constructor_cb", -1805861999, 14), - /* K13 */ be_nested_string("destructor_cb", 1930283190, 13), - /* K14 */ be_nested_string("event_cb", -1166269279, 8), + /* K0 */ be_nested_str(widget_ctor_cb), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(gen_cb), + /* K3 */ be_nested_str(widget_dtor_cb), + /* K4 */ be_nested_str(widget_event_cb), + /* K5 */ be_nested_str(widget_struct_default), + /* K6 */ be_nested_str(lv), + /* K7 */ be_nested_str(lv_obj_class), + /* K8 */ be_nested_str(lv_obj), + /* K9 */ be_nested_str(_class), + /* K10 */ be_nested_str(copy), + /* K11 */ be_nested_str(base_class), + /* K12 */ be_nested_str(constructor_cb), + /* K13 */ be_nested_str(destructor_cb), + /* K14 */ be_nested_str(event_cb), }), - (be_nested_const_str("widget_cb", -1531384241, 9)), - ((bstring*) &be_const_str_input), + &be_const_str_widget_cb, + &be_const_str_solidified, ( &(const binstruction[56]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x4C080000, // 0001 LDNIL R2 @@ -565,7 +565,7 @@ be_local_closure(widget_cb, /* name */ /******************************************************************** ** Solidified function: _anonymous_ ********************************************************************/ -be_local_closure(_anonymous_, /* name */ +be_local_closure(LVGL_glob__anonymous_, /* name */ be_nested_proto( 2, /* nstack */ 0, /* argc */ @@ -576,10 +576,10 @@ be_local_closure(_anonymous_, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("LVG: call to unsupported callback", 504176819, 33), + /* K0 */ be_nested_str(LVG_X3A_X20call_X20to_X20unsupported_X20callback), }), - (be_nested_const_str("_anonymous_", 1957281476, 11)), - ((bstring*) &be_const_str_input), + &be_const_str__anonymous_, + &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ 0x60000001, // 0000 GETGBL R0 G1 0x58040000, // 0001 LDCONST R1 K0 @@ -594,7 +594,7 @@ be_local_closure(_anonymous_, /* name */ /******************************************************************** ** Solidified function: create_custom_widget ********************************************************************/ -be_local_closure(create_custom_widget, /* name */ +be_local_closure(LVGL_glob_create_custom_widget, /* name */ be_nested_proto( 10, /* nstack */ 3, /* argc */ @@ -605,36 +605,36 @@ be_local_closure(create_custom_widget, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[27]) { /* constants */ - /* K0 */ be_nested_string("introspect", 164638290, 10), - /* K1 */ be_nested_string("lv", 1529997255, 2), - /* K2 */ be_nested_string("lv_obj", -37134147, 6), - /* K3 */ be_nested_string("value_error", 773297791, 11), - /* K4 */ be_nested_string("arg must be a subclass of lv_obj", 1641882079, 32), - /* K5 */ be_nested_string("widget_struct_by_class", -488593454, 22), - /* K6 */ be_nested_string("find", -1108310694, 4), - /* K7 */ be_nested_string("widget_cb", -1531384241, 9), - /* K8 */ be_nested_string("widget_struct_default", 781673633, 21), - /* K9 */ be_nested_string("copy", -446502332, 4), - /* K10 */ be_nested_string("base_class", 1107737279, 10), - /* K11 */ be_nested_string("_class", -1562820946, 6), - /* K12 */ be_nested_string("get", 1410115415, 3), - /* K13 */ be_nested_string("widget_width_def", -308888434, 16), - /* K14 */ be_nested_string("width_def", 1143717879, 9), - /* K15 */ be_nested_string("widget_height_def", -1163299483, 17), - /* K16 */ be_nested_string("height_def", -1946728458, 10), - /* K17 */ be_nested_string("widget_editable", -473174010, 15), - /* K18 */ be_nested_string("editable", 60532369, 8), - /* K19 */ be_nested_string("widget_group_def", 1246968785, 16), - /* K20 */ be_nested_string("group_def", 1524213328, 9), - /* K21 */ be_nested_string("widget_instance_size", 2055354779, 20), - /* K22 */ be_nested_string("instance_size", -14697778, 13), - /* K23 */ be_nested_string("obj_class_create_obj", -990576664, 20), - /* K24 */ be_nested_string("_p", 1594591802, 2), - /* K25 */ be_nested_string("register_obj", -312352526, 12), - /* K26 */ be_nested_string("class_init_obj", 178410604, 14), + /* K0 */ be_nested_str(introspect), + /* K1 */ be_nested_str(lv), + /* K2 */ be_nested_str(lv_obj), + /* K3 */ be_nested_str(value_error), + /* K4 */ be_nested_str(arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj), + /* K5 */ be_nested_str(widget_struct_by_class), + /* K6 */ be_nested_str(find), + /* K7 */ be_nested_str(widget_cb), + /* K8 */ be_nested_str(widget_struct_default), + /* K9 */ be_nested_str(copy), + /* K10 */ be_nested_str(base_class), + /* K11 */ be_nested_str(_class), + /* K12 */ be_nested_str(get), + /* K13 */ be_nested_str(widget_width_def), + /* K14 */ be_nested_str(width_def), + /* K15 */ be_nested_str(widget_height_def), + /* K16 */ be_nested_str(height_def), + /* K17 */ be_nested_str(widget_editable), + /* K18 */ be_nested_str(editable), + /* K19 */ be_nested_str(widget_group_def), + /* K20 */ be_nested_str(group_def), + /* K21 */ be_nested_str(widget_instance_size), + /* K22 */ be_nested_str(instance_size), + /* K23 */ be_nested_str(obj_class_create_obj), + /* K24 */ be_nested_str(_p), + /* K25 */ be_nested_str(register_obj), + /* K26 */ be_nested_str(class_init_obj), }), - (be_nested_const_str("create_custom_widget", 1140594778, 20)), - ((bstring*) &be_const_str_input), + &be_const_str_create_custom_widget, + &be_const_str_solidified, ( &(const binstruction[86]) { /* code */ 0xA40E0000, // 0000 IMPORT R3 K0 0x6010000F, // 0001 GETGBL R4 G15 @@ -731,7 +731,7 @@ be_local_closure(create_custom_widget, /* name */ /******************************************************************** ** Solidified function: widget_ctor_impl ********************************************************************/ -be_local_closure(widget_ctor_impl, /* name */ +be_local_closure(LVGL_glob_widget_ctor_impl, /* name */ be_nested_proto( 10, /* nstack */ 3, /* argc */ @@ -742,18 +742,18 @@ be_local_closure(widget_ctor_impl, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 9]) { /* constants */ - /* K0 */ be_nested_string("introspect", 164638290, 10), - /* K1 */ be_nested_string("lv", 1529997255, 2), - /* K2 */ be_nested_string("lv_obj_class", -255311002, 12), - /* K3 */ be_nested_string("get_object_from_ptr", -1949948095, 19), - /* K4 */ be_nested_string("cb_obj", 1195696482, 6), - /* K5 */ be_nested_string("find", -1108310694, 4), - /* K6 */ be_nested_string("instance", 193386898, 8), - /* K7 */ be_nested_string("get", 1410115415, 3), - /* K8 */ be_nested_string("widget_constructor", -1751181362, 18), + /* K0 */ be_nested_str(introspect), + /* K1 */ be_nested_str(lv), + /* K2 */ be_nested_str(lv_obj_class), + /* K3 */ be_nested_str(get_object_from_ptr), + /* K4 */ be_nested_str(cb_obj), + /* K5 */ be_nested_str(find), + /* K6 */ be_nested_str(instance), + /* K7 */ be_nested_str(get), + /* K8 */ be_nested_str(widget_constructor), }), - (be_nested_const_str("widget_ctor_impl", 194252479, 16)), - ((bstring*) &be_const_str_input), + &be_const_str_widget_ctor_impl, + &be_const_str_solidified, ( &(const binstruction[29]) { /* code */ 0xA40E0000, // 0000 IMPORT R3 K0 0xB8120200, // 0001 GETNGBL R4 K1 @@ -798,28 +798,28 @@ be_local_class(LVGL_glob, NULL, be_nested_map(20, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("widget_ctor_cb", 876007560, 14, 9), be_const_var(4) }, - { be_nested_key("get_object_from_ptr", -1949948095, 19, 4), be_const_closure(get_object_from_ptr_closure) }, - { be_nested_key("cb_obj", 1195696482, 6, 7), be_const_var(0) }, - { be_nested_key("widget_struct_by_class", -488593454, 22, -1), be_const_var(8) }, - { be_nested_key("widget_event_impl", -2116536735, 17, -1), be_const_closure(widget_event_impl_closure) }, - { be_nested_key("widget_dtor_cb", -1143421451, 14, 6), be_const_var(5) }, - { be_nested_key("cb_event_closure", -466699971, 16, -1), be_const_var(1) }, - { be_nested_key("lvgl_event_dispatch", 2104396622, 19, 16), be_const_closure(lvgl_event_dispatch_closure) }, - { be_nested_key("widget_dtor_impl", 520430610, 16, -1), be_const_closure(widget_dtor_impl_closure) }, - { be_nested_key("null_cb", -1961430836, 7, -1), be_const_var(3) }, - { be_nested_key("register_obj", -312352526, 12, 8), be_const_closure(register_obj_closure) }, - { be_nested_key("gen_cb", -1049739745, 6, -1), be_const_closure(gen_cb_closure) }, - { be_nested_key("widget_struct_default", 781673633, 21, -1), be_const_var(7) }, - { be_nested_key("deregister_obj", -385000303, 14, 12), be_const_closure(deregister_obj_closure) }, - { be_nested_key("widget_event_cb", 1508466754, 15, -1), be_const_var(6) }, - { be_nested_key("widget_cb", -1531384241, 9, -1), be_const_closure(widget_cb_closure) }, - { be_nested_key("cb_do_nothing", 1488730702, 13, 3), be_const_closure(_anonymous__closure) }, - { be_nested_key("event_cb", -1166269279, 8, -1), be_const_var(2) }, - { be_nested_key("create_custom_widget", 1140594778, 20, -1), be_const_closure(create_custom_widget_closure) }, - { be_nested_key("widget_ctor_impl", 194252479, 16, -1), be_const_closure(widget_ctor_impl_closure) }, + { be_const_key(widget_ctor_cb, 9), be_const_var(4) }, + { be_const_key(get_object_from_ptr, 4), be_const_closure(LVGL_glob_get_object_from_ptr_closure) }, + { be_const_key(cb_obj, 7), be_const_var(0) }, + { be_const_key(widget_struct_by_class, -1), be_const_var(8) }, + { be_const_key(widget_event_impl, -1), be_const_closure(LVGL_glob_widget_event_impl_closure) }, + { be_const_key(widget_dtor_cb, 6), be_const_var(5) }, + { be_const_key(cb_event_closure, -1), be_const_var(1) }, + { be_const_key(lvgl_event_dispatch, 16), be_const_closure(LVGL_glob_lvgl_event_dispatch_closure) }, + { be_const_key(widget_dtor_impl, -1), be_const_closure(LVGL_glob_widget_dtor_impl_closure) }, + { be_const_key(null_cb, -1), be_const_var(3) }, + { be_const_key(register_obj, 8), be_const_closure(LVGL_glob_register_obj_closure) }, + { be_const_key(gen_cb, -1), be_const_closure(LVGL_glob_gen_cb_closure) }, + { be_const_key(widget_struct_default, -1), be_const_var(7) }, + { be_const_key(deregister_obj, 12), be_const_closure(LVGL_glob_deregister_obj_closure) }, + { be_const_key(widget_event_cb, -1), be_const_var(6) }, + { be_const_key(widget_cb, -1), be_const_closure(LVGL_glob_widget_cb_closure) }, + { be_const_key(cb_do_nothing, 3), be_const_closure(LVGL_glob__anonymous__closure) }, + { be_const_key(event_cb, -1), be_const_var(2) }, + { be_const_key(create_custom_widget, -1), be_const_closure(LVGL_glob_create_custom_widget_closure) }, + { be_const_key(widget_ctor_impl, -1), be_const_closure(LVGL_glob_widget_ctor_impl_closure) }, })), - (be_nested_const_str("LVGL_glob", 315437079, 9)) + be_str_literal("LVGL_glob") ); /*******************************************************************/ diff --git a/lib/libesp32/Berry/default/be_lvgl_signal_arcs_lib.c b/lib/libesp32/Berry/default/be_lvgl_signal_arcs_lib.c index f3452ba57..a127cddd9 100644 --- a/lib/libesp32/Berry/default/be_lvgl_signal_arcs_lib.c +++ b/lib/libesp32/Berry/default/be_lvgl_signal_arcs_lib.c @@ -10,7 +10,7 @@ /******************************************************************** ** Solidified function: set_percentage ********************************************************************/ -be_local_closure(set_percentage, /* name */ +be_local_closure(lv_signal_arcs_set_percentage, /* name */ be_nested_proto( 5, /* nstack */ 2, /* argc */ @@ -21,12 +21,12 @@ be_local_closure(set_percentage, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("percentage", -1756136011, 10), + /* K0 */ be_nested_str(percentage), /* K1 */ be_const_int(0), - /* K2 */ be_nested_string("invalidate", -1645232368, 10), + /* K2 */ be_nested_str(invalidate), }), - (be_nested_const_str("set_percentage", -1342944572, 14)), - ((bstring*) &be_const_str_input), + &be_const_str_set_percentage, + &be_const_str_solidified, ( &(const binstruction[18]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x540E0018, // 0001 LDINT R3 25 @@ -55,7 +55,7 @@ be_local_closure(set_percentage, /* name */ /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(init, /* name */ +be_local_closure(lv_signal_arcs_init, /* name */ be_nested_proto( 6, /* nstack */ 2, /* argc */ @@ -66,19 +66,19 @@ be_local_closure(init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[10]) { /* constants */ - /* K0 */ be_nested_string("_lvgl", -1605747813, 5), - /* K1 */ be_nested_string("create_custom_widget", 1140594778, 20), - /* K2 */ be_nested_string("percentage", -1756136011, 10), - /* K3 */ be_nested_string("p1", -1605446022, 2), - /* K4 */ be_nested_string("lv", 1529997255, 2), - /* K5 */ be_nested_string("point", 414084241, 5), - /* K6 */ be_nested_string("p2", -1622223641, 2), - /* K7 */ be_nested_string("area", -1693507260, 4), - /* K8 */ be_nested_string("line_dsc", -200476318, 8), - /* K9 */ be_nested_string("draw_line_dsc", -74291093, 13), + /* K0 */ be_nested_str(_lvgl), + /* K1 */ be_nested_str(create_custom_widget), + /* K2 */ be_nested_str(percentage), + /* K3 */ be_nested_str(p1), + /* K4 */ be_nested_str(lv), + /* K5 */ be_nested_str(point), + /* K6 */ be_nested_str(p2), + /* K7 */ be_nested_str(area), + /* K8 */ be_nested_str(line_dsc), + /* K9 */ be_nested_str(draw_line_dsc), }), - ((bstring*) &be_const_str_init), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[24]) { /* code */ 0xB80A0000, // 0000 GETNGBL R2 K0 0x8C080501, // 0001 GETMET R2 R2 K1 @@ -113,7 +113,7 @@ be_local_closure(init, /* name */ /******************************************************************** ** Solidified function: widget_event ********************************************************************/ -be_local_closure(widget_event, /* name */ +be_local_closure(lv_signal_arcs_widget_event, /* name */ be_nested_proto( 28, /* nstack */ 3, /* argc */ @@ -134,8 +134,8 @@ be_local_closure(widget_event, /* name */ ( &(const bvalue[ 1]) { /* constants */ /* K0 */ be_const_int(1), }), - (be_nested_const_str("atleast1", 1956331672, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_atleast1, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x28040100, // 0000 GE R1 R0 K0 0x78060001, // 0001 JMPF R1 #0004 @@ -148,44 +148,44 @@ be_local_closure(widget_event, /* name */ }), 1, /* has constants */ ( &(const bvalue[35]) { /* constants */ - /* K0 */ be_nested_string("lv", 1529997255, 2), - /* K1 */ be_nested_string("obj_event_base", 1624064363, 14), - /* K2 */ be_nested_string("RES_OK", 1233817284, 6), - /* K3 */ be_nested_string("code", -114201356, 4), - /* K4 */ be_nested_string("math", -293037681, 4), - /* K5 */ be_nested_string("get_height", -723211773, 10), - /* K6 */ be_nested_string("get_width", -1001549996, 9), + /* K0 */ be_nested_str(lv), + /* K1 */ be_nested_str(obj_event_base), + /* K2 */ be_nested_str(RES_OK), + /* K3 */ be_nested_str(code), + /* K4 */ be_nested_str(math), + /* K5 */ be_nested_str(get_height), + /* K6 */ be_nested_str(get_width), /* K7 */ be_const_int(2), /* K8 */ be_const_int(3), - /* K9 */ be_nested_string("EVENT_DRAW_MAIN", 1955620614, 15), - /* K10 */ be_nested_string("area", -1693507260, 4), - /* K11 */ be_nested_string("param", 1309554226, 5), - /* K12 */ be_nested_string("get_coords", 1044089006, 10), - /* K13 */ be_nested_string("x1", 274927234, 2), - /* K14 */ be_nested_string("y1", -1939865569, 2), - /* K15 */ be_nested_string("draw_line_dsc_init", -428273650, 18), - /* K16 */ be_nested_string("line_dsc", -200476318, 8), - /* K17 */ be_nested_string("init_draw_line_dsc", -1787031256, 18), - /* K18 */ be_nested_string("PART_MAIN", -1821475788, 9), - /* K19 */ be_nested_string("round_start", -1345482912, 11), + /* K9 */ be_nested_str(EVENT_DRAW_MAIN), + /* K10 */ be_nested_str(area), + /* K11 */ be_nested_str(param), + /* K12 */ be_nested_str(get_coords), + /* K13 */ be_nested_str(x1), + /* K14 */ be_nested_str(y1), + /* K15 */ be_nested_str(draw_line_dsc_init), + /* K16 */ be_nested_str(line_dsc), + /* K17 */ be_nested_str(init_draw_line_dsc), + /* K18 */ be_nested_str(PART_MAIN), + /* K19 */ be_nested_str(round_start), /* K20 */ be_const_int(1), - /* K21 */ be_nested_string("round_end", 985288225, 9), - /* K22 */ be_nested_string("width", -1786286561, 5), - /* K23 */ be_nested_string("get_style_line_color", 805371932, 20), - /* K24 */ be_nested_string("STATE_DEFAULT", 712406428, 13), - /* K25 */ be_nested_string("get_style_bg_color", 964794381, 18), - /* K26 */ be_nested_string("deg", -967213025, 3), - /* K27 */ be_nested_string("acos", 1006755615, 4), - /* K28 */ be_nested_string("p1", -1605446022, 2), - /* K29 */ be_nested_string("x", -49524601, 1), - /* K30 */ be_nested_string("y", -66302220, 1), - /* K31 */ be_nested_string("color", 1031692888, 5), - /* K32 */ be_nested_string("percentage", -1756136011, 10), - /* K33 */ be_nested_string("draw_arc", 1828251676, 8), + /* K21 */ be_nested_str(round_end), + /* K22 */ be_nested_str(width), + /* K23 */ be_nested_str(get_style_line_color), + /* K24 */ be_nested_str(STATE_DEFAULT), + /* K25 */ be_nested_str(get_style_bg_color), + /* K26 */ be_nested_str(deg), + /* K27 */ be_nested_str(acos), + /* K28 */ be_nested_str(p1), + /* K29 */ be_nested_str(x), + /* K30 */ be_nested_str(y), + /* K31 */ be_nested_str(color), + /* K32 */ be_nested_str(percentage), + /* K33 */ be_nested_str(draw_arc), /* K34 */ be_const_int(0), }), - (be_nested_const_str("widget_event", 1951408186, 12)), - ((bstring*) &be_const_str_input), + &be_const_str_widget_event, + &be_const_str_solidified, ( &(const binstruction[182]) { /* code */ 0xB80E0000, // 0000 GETNGBL R3 K0 0x8C0C0701, // 0001 GETMET R3 R3 K1 @@ -378,7 +378,7 @@ be_local_closure(widget_event, /* name */ /******************************************************************** ** Solidified function: get_percentage ********************************************************************/ -be_local_closure(get_percentage, /* name */ +be_local_closure(lv_signal_arcs_get_percentage, /* name */ be_nested_proto( 2, /* nstack */ 1, /* argc */ @@ -389,10 +389,10 @@ be_local_closure(get_percentage, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("percentage", -1756136011, 10), + /* K0 */ be_nested_str(percentage), }), - (be_nested_const_str("get_percentage", -1414483304, 14)), - ((bstring*) &be_const_str_input), + &be_const_str_get_percentage, + &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x80040200, // 0001 RET 1 R1 @@ -411,17 +411,17 @@ be_local_class(lv_signal_arcs, &be_class_lv_obj, be_nested_map(9, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("percentage", -1756136011, 10, 4), be_const_var(0) }, - { be_nested_key("p1", -1605446022, 2, 3), be_const_var(1) }, - { be_nested_key("p2", -1622223641, 2, -1), be_const_var(2) }, - { be_nested_key("area", -1693507260, 4, -1), be_const_var(3) }, - { be_nested_key("line_dsc", -200476318, 8, -1), be_const_var(4) }, - { be_nested_key("set_percentage", -1342944572, 14, -1), be_const_closure(set_percentage_closure) }, - { be_nested_key("init", 380752755, 4, -1), be_const_closure(init_closure) }, - { be_nested_key("widget_event", 1951408186, 12, -1), be_const_closure(widget_event_closure) }, - { be_nested_key("get_percentage", -1414483304, 14, 5), be_const_closure(get_percentage_closure) }, + { be_const_key(percentage, 4), be_const_var(0) }, + { be_const_key(p1, 3), be_const_var(1) }, + { be_const_key(p2, -1), be_const_var(2) }, + { be_const_key(area, -1), be_const_var(3) }, + { be_const_key(line_dsc, -1), be_const_var(4) }, + { be_const_key(set_percentage, -1), be_const_closure(lv_signal_arcs_set_percentage_closure) }, + { be_const_key(init, -1), be_const_closure(lv_signal_arcs_init_closure) }, + { be_const_key(widget_event, -1), be_const_closure(lv_signal_arcs_widget_event_closure) }, + { be_const_key(get_percentage, 5), be_const_closure(lv_signal_arcs_get_percentage_closure) }, })), - (be_nested_const_str("lv_signal_arcs", -1455810308, 14)) + be_str_literal("lv_signal_arcs") ); /*******************************************************************/ diff --git a/lib/libesp32/Berry/default/be_lvgl_signal_bars_lib.c b/lib/libesp32/Berry/default/be_lvgl_signal_bars_lib.c index 161afc65d..18452ae34 100644 --- a/lib/libesp32/Berry/default/be_lvgl_signal_bars_lib.c +++ b/lib/libesp32/Berry/default/be_lvgl_signal_bars_lib.c @@ -10,7 +10,7 @@ /******************************************************************** ** Solidified function: set_percentage ********************************************************************/ -be_local_closure(set_percentage, /* name */ +be_local_closure(lv_signal_bars_set_percentage, /* name */ be_nested_proto( 5, /* nstack */ 2, /* argc */ @@ -21,12 +21,12 @@ be_local_closure(set_percentage, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("percentage", -1756136011, 10), + /* K0 */ be_nested_str(percentage), /* K1 */ be_const_int(0), - /* K2 */ be_nested_string("invalidate", -1645232368, 10), + /* K2 */ be_nested_str(invalidate), }), - (be_nested_const_str("set_percentage", -1342944572, 14)), - ((bstring*) &be_const_str_input), + &be_const_str_set_percentage, + &be_const_str_solidified, ( &(const binstruction[18]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x540E0013, // 0001 LDINT R3 20 @@ -55,7 +55,7 @@ be_local_closure(set_percentage, /* name */ /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(init, /* name */ +be_local_closure(lv_signal_bars_init, /* name */ be_nested_proto( 6, /* nstack */ 2, /* argc */ @@ -66,19 +66,19 @@ be_local_closure(init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[10]) { /* constants */ - /* K0 */ be_nested_string("_lvgl", -1605747813, 5), - /* K1 */ be_nested_string("create_custom_widget", 1140594778, 20), - /* K2 */ be_nested_string("percentage", -1756136011, 10), - /* K3 */ be_nested_string("p1", -1605446022, 2), - /* K4 */ be_nested_string("lv", 1529997255, 2), - /* K5 */ be_nested_string("point", 414084241, 5), - /* K6 */ be_nested_string("p2", -1622223641, 2), - /* K7 */ be_nested_string("area", -1693507260, 4), - /* K8 */ be_nested_string("line_dsc", -200476318, 8), - /* K9 */ be_nested_string("draw_line_dsc", -74291093, 13), + /* K0 */ be_nested_str(_lvgl), + /* K1 */ be_nested_str(create_custom_widget), + /* K2 */ be_nested_str(percentage), + /* K3 */ be_nested_str(p1), + /* K4 */ be_nested_str(lv), + /* K5 */ be_nested_str(point), + /* K6 */ be_nested_str(p2), + /* K7 */ be_nested_str(area), + /* K8 */ be_nested_str(line_dsc), + /* K9 */ be_nested_str(draw_line_dsc), }), - ((bstring*) &be_const_str_init), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[24]) { /* code */ 0xB80A0000, // 0000 GETNGBL R2 K0 0x8C080501, // 0001 GETMET R2 R2 K1 @@ -113,7 +113,7 @@ be_local_closure(init, /* name */ /******************************************************************** ** Solidified function: widget_event ********************************************************************/ -be_local_closure(widget_event, /* name */ +be_local_closure(lv_signal_bars_widget_event, /* name */ be_nested_proto( 23, /* nstack */ 3, /* argc */ @@ -134,8 +134,8 @@ be_local_closure(widget_event, /* name */ ( &(const bvalue[ 1]) { /* constants */ /* K0 */ be_const_int(1), }), - (be_nested_const_str("atleast1", 1956331672, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_atleast1, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x28040100, // 0000 GE R1 R0 K0 0x78060001, // 0001 JMPF R1 #0004 @@ -148,46 +148,46 @@ be_local_closure(widget_event, /* name */ }), 1, /* has constants */ ( &(const bvalue[37]) { /* constants */ - /* K0 */ be_nested_string("lv", 1529997255, 2), - /* K1 */ be_nested_string("obj_event_base", 1624064363, 14), - /* K2 */ be_nested_string("RES_OK", 1233817284, 6), - /* K3 */ be_nested_string("code", -114201356, 4), - /* K4 */ be_nested_string("get_height", -723211773, 10), - /* K5 */ be_nested_string("get_width", -1001549996, 9), + /* K0 */ be_nested_str(lv), + /* K1 */ be_nested_str(obj_event_base), + /* K2 */ be_nested_str(RES_OK), + /* K3 */ be_nested_str(code), + /* K4 */ be_nested_str(get_height), + /* K5 */ be_nested_str(get_width), /* K6 */ be_const_int(3), /* K7 */ be_const_int(2), - /* K8 */ be_nested_string("EVENT_DRAW_MAIN", 1955620614, 15), - /* K9 */ be_nested_string("area", -1693507260, 4), - /* K10 */ be_nested_string("param", 1309554226, 5), - /* K11 */ be_nested_string("get_coords", 1044089006, 10), - /* K12 */ be_nested_string("x1", 274927234, 2), - /* K13 */ be_nested_string("y1", -1939865569, 2), - /* K14 */ be_nested_string("draw_line_dsc_init", -428273650, 18), - /* K15 */ be_nested_string("line_dsc", -200476318, 8), - /* K16 */ be_nested_string("init_draw_line_dsc", -1787031256, 18), - /* K17 */ be_nested_string("PART_MAIN", -1821475788, 9), - /* K18 */ be_nested_string("round_start", -1345482912, 11), + /* K8 */ be_nested_str(EVENT_DRAW_MAIN), + /* K9 */ be_nested_str(area), + /* K10 */ be_nested_str(param), + /* K11 */ be_nested_str(get_coords), + /* K12 */ be_nested_str(x1), + /* K13 */ be_nested_str(y1), + /* K14 */ be_nested_str(draw_line_dsc_init), + /* K15 */ be_nested_str(line_dsc), + /* K16 */ be_nested_str(init_draw_line_dsc), + /* K17 */ be_nested_str(PART_MAIN), + /* K18 */ be_nested_str(round_start), /* K19 */ be_const_int(1), - /* K20 */ be_nested_string("round_end", 985288225, 9), - /* K21 */ be_nested_string("width", -1786286561, 5), - /* K22 */ be_nested_string("get_style_line_color", 805371932, 20), - /* K23 */ be_nested_string("STATE_DEFAULT", 712406428, 13), - /* K24 */ be_nested_string("get_style_bg_color", 964794381, 18), - /* K25 */ be_nested_string("event_send", 598925582, 10), - /* K26 */ be_nested_string("EVENT_DRAW_PART_BEGIN", -903102272, 21), + /* K20 */ be_nested_str(round_end), + /* K21 */ be_nested_str(width), + /* K22 */ be_nested_str(get_style_line_color), + /* K23 */ be_nested_str(STATE_DEFAULT), + /* K24 */ be_nested_str(get_style_bg_color), + /* K25 */ be_nested_str(event_send), + /* K26 */ be_nested_str(EVENT_DRAW_PART_BEGIN), /* K27 */ be_const_int(0), - /* K28 */ be_nested_string("color", 1031692888, 5), - /* K29 */ be_nested_string("percentage", -1756136011, 10), - /* K30 */ be_nested_string("p1", -1605446022, 2), - /* K31 */ be_nested_string("y", -66302220, 1), - /* K32 */ be_nested_string("x", -49524601, 1), - /* K33 */ be_nested_string("p2", -1622223641, 2), - /* K34 */ be_nested_string("draw_line", 1634465686, 9), - /* K35 */ be_nested_string("stop_iteration", -121173395, 14), - /* K36 */ be_nested_string("EVENT_DRAW_PART_END", -993342004, 19), + /* K28 */ be_nested_str(color), + /* K29 */ be_nested_str(percentage), + /* K30 */ be_nested_str(p1), + /* K31 */ be_nested_str(y), + /* K32 */ be_nested_str(x), + /* K33 */ be_nested_str(p2), + /* K34 */ be_nested_str(draw_line), + /* K35 */ be_nested_str(stop_iteration), + /* K36 */ be_nested_str(EVENT_DRAW_PART_END), }), - (be_nested_const_str("widget_event", 1951408186, 12)), - ((bstring*) &be_const_str_input), + &be_const_str_widget_event, + &be_const_str_solidified, ( &(const binstruction[138]) { /* code */ 0xB80E0000, // 0000 GETNGBL R3 K0 0x8C0C0701, // 0001 GETMET R3 R3 K1 @@ -336,7 +336,7 @@ be_local_closure(widget_event, /* name */ /******************************************************************** ** Solidified function: get_percentage ********************************************************************/ -be_local_closure(get_percentage, /* name */ +be_local_closure(lv_signal_bars_get_percentage, /* name */ be_nested_proto( 2, /* nstack */ 1, /* argc */ @@ -347,10 +347,10 @@ be_local_closure(get_percentage, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_string("percentage", -1756136011, 10), + /* K0 */ be_nested_str(percentage), }), - (be_nested_const_str("get_percentage", -1414483304, 14)), - ((bstring*) &be_const_str_input), + &be_const_str_get_percentage, + &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x80040200, // 0001 RET 1 R1 @@ -369,17 +369,17 @@ be_local_class(lv_signal_bars, &be_class_lv_obj, be_nested_map(9, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("percentage", -1756136011, 10, 4), be_const_var(0) }, - { be_nested_key("p1", -1605446022, 2, 3), be_const_var(1) }, - { be_nested_key("p2", -1622223641, 2, -1), be_const_var(2) }, - { be_nested_key("area", -1693507260, 4, -1), be_const_var(3) }, - { be_nested_key("line_dsc", -200476318, 8, -1), be_const_var(4) }, - { be_nested_key("set_percentage", -1342944572, 14, -1), be_const_closure(set_percentage_closure) }, - { be_nested_key("init", 380752755, 4, -1), be_const_closure(init_closure) }, - { be_nested_key("widget_event", 1951408186, 12, -1), be_const_closure(widget_event_closure) }, - { be_nested_key("get_percentage", -1414483304, 14, 5), be_const_closure(get_percentage_closure) }, + { be_const_key(percentage, 4), be_const_var(0) }, + { be_const_key(p1, 3), be_const_var(1) }, + { be_const_key(p2, -1), be_const_var(2) }, + { be_const_key(area, -1), be_const_var(3) }, + { be_const_key(line_dsc, -1), be_const_var(4) }, + { be_const_key(set_percentage, -1), be_const_closure(lv_signal_bars_set_percentage_closure) }, + { be_const_key(init, -1), be_const_closure(lv_signal_bars_init_closure) }, + { be_const_key(widget_event, -1), be_const_closure(lv_signal_bars_widget_event_closure) }, + { be_const_key(get_percentage, 5), be_const_closure(lv_signal_bars_get_percentage_closure) }, })), - (be_nested_const_str("lv_signal_bars", -780994737, 14)) + be_str_literal("lv_signal_bars") ); /*******************************************************************/ diff --git a/lib/libesp32/Berry/default/be_lvgl_wifi_arcs_icon_lib.c b/lib/libesp32/Berry/default/be_lvgl_wifi_arcs_icon_lib.c index 9a2c742ff..d8fe9ce08 100644 --- a/lib/libesp32/Berry/default/be_lvgl_wifi_arcs_icon_lib.c +++ b/lib/libesp32/Berry/default/be_lvgl_wifi_arcs_icon_lib.c @@ -10,7 +10,7 @@ /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(init, /* name */ +be_local_closure(lv_wifi_arcs_icon_init, /* name */ be_nested_proto( 10, /* nstack */ 2, /* argc */ @@ -21,27 +21,27 @@ be_local_closure(init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[18]) { /* constants */ - /* K0 */ be_nested_string("init", 380752755, 4), - /* K1 */ be_nested_string("set_style_line_color", -629728320, 20), - /* K2 */ be_nested_string("lv", 1529997255, 2), - /* K3 */ be_nested_string("color", 1031692888, 5), - /* K4 */ be_nested_string("COLOR_WHITE", -1758096026, 11), - /* K5 */ be_nested_string("PART_MAIN", -1821475788, 9), - /* K6 */ be_nested_string("STATE_DEFAULT", 712406428, 13), - /* K7 */ be_nested_string("set_style_bg_color", 1689513089, 18), - /* K8 */ be_nested_string("COLOR_BLACK", 264427940, 11), - /* K9 */ be_nested_string("get_height", -723211773, 10), - /* K10 */ be_nested_string("get_style_pad_right", -1144679830, 19), - /* K11 */ be_nested_string("set_height", 1080207399, 10), + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(set_style_line_color), + /* K2 */ be_nested_str(lv), + /* K3 */ be_nested_str(color), + /* K4 */ be_nested_str(COLOR_WHITE), + /* K5 */ be_nested_str(PART_MAIN), + /* K6 */ be_nested_str(STATE_DEFAULT), + /* K7 */ be_nested_str(set_style_bg_color), + /* K8 */ be_nested_str(COLOR_BLACK), + /* K9 */ be_nested_str(get_height), + /* K10 */ be_nested_str(get_style_pad_right), + /* K11 */ be_nested_str(set_height), /* K12 */ be_const_int(3), - /* K13 */ be_nested_string("set_width", 484671920, 9), - /* K14 */ be_nested_string("set_x", 1849400772, 5), - /* K15 */ be_nested_string("get_width", -1001549996, 9), - /* K16 */ be_nested_string("set_style_pad_right", -980898242, 19), + /* K13 */ be_nested_str(set_width), + /* K14 */ be_nested_str(set_x), + /* K15 */ be_nested_str(get_width), + /* K16 */ be_nested_str(set_style_pad_right), /* K17 */ be_const_int(1), }), - ((bstring*) &be_const_str_init), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[67]) { /* code */ 0x60080003, // 0000 GETGBL R2 G3 0x5C0C0000, // 0001 MOVE R3 R0 @@ -125,9 +125,9 @@ be_local_class(lv_wifi_arcs_icon, &be_class_lv_wifi_arcs, be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("init", 380752755, 4, -1), be_const_closure(init_closure) }, + { be_const_key(init, -1), be_const_closure(lv_wifi_arcs_icon_init_closure) }, })), - (be_nested_const_str("lv_wifi_arcs_icon", 1507982909, 17)) + be_str_literal("lv_wifi_arcs_icon") ); /*******************************************************************/ diff --git a/lib/libesp32/Berry/default/be_lvgl_wifi_arcs_lib.c b/lib/libesp32/Berry/default/be_lvgl_wifi_arcs_lib.c index 59132af9e..57cbf18a9 100644 --- a/lib/libesp32/Berry/default/be_lvgl_wifi_arcs_lib.c +++ b/lib/libesp32/Berry/default/be_lvgl_wifi_arcs_lib.c @@ -10,7 +10,7 @@ /******************************************************************** ** Solidified function: every_second ********************************************************************/ -be_local_closure(every_second, /* name */ +be_local_closure(lv_wifi_arcs_every_second, /* name */ be_nested_proto( 7, /* nstack */ 1, /* argc */ @@ -21,16 +21,16 @@ be_local_closure(every_second, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_string("tasmota", 424643812, 7), - /* K1 */ be_nested_string("wifi", 120087624, 4), - /* K2 */ be_nested_string("find", -1108310694, 4), - /* K3 */ be_nested_string("quality", -1697296346, 7), - /* K4 */ be_nested_string("ip", 1261996636, 2), - /* K5 */ be_nested_string("set_percentage", -1342944572, 14), + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(wifi), + /* K2 */ be_nested_str(find), + /* K3 */ be_nested_str(quality), + /* K4 */ be_nested_str(ip), + /* K5 */ be_nested_str(set_percentage), /* K6 */ be_const_int(0), }), - (be_nested_const_str("every_second", 2075451465, 12)), - ((bstring*) &be_const_str_input), + &be_const_str_every_second, + &be_const_str_solidified, ( &(const binstruction[23]) { /* code */ 0xB8060000, // 0000 GETNGBL R1 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -64,7 +64,7 @@ be_local_closure(every_second, /* name */ /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(init, /* name */ +be_local_closure(lv_wifi_arcs_init, /* name */ be_nested_proto( 5, /* nstack */ 2, /* argc */ @@ -75,14 +75,14 @@ be_local_closure(init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_string("init", 380752755, 4), - /* K1 */ be_nested_string("tasmota", 424643812, 7), - /* K2 */ be_nested_string("add_driver", 1654458371, 10), - /* K3 */ be_nested_string("set_percentage", -1342944572, 14), + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(add_driver), + /* K3 */ be_nested_str(set_percentage), /* K4 */ be_const_int(0), }), - ((bstring*) &be_const_str_init), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[14]) { /* code */ 0x60080003, // 0000 GETGBL R2 G3 0x5C0C0000, // 0001 MOVE R3 R0 @@ -107,7 +107,7 @@ be_local_closure(init, /* name */ /******************************************************************** ** Solidified function: del ********************************************************************/ -be_local_closure(del, /* name */ +be_local_closure(lv_wifi_arcs_del, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -118,12 +118,12 @@ be_local_closure(del, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("del", -816214454, 3), - /* K1 */ be_nested_string("tasmota", 424643812, 7), - /* K2 */ be_nested_string("remove_driver", 1030243768, 13), + /* K0 */ be_nested_str(del), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(remove_driver), }), - (be_nested_const_str("del", -816214454, 3)), - ((bstring*) &be_const_str_input), + &be_const_str_del, + &be_const_str_solidified, ( &(const binstruction[10]) { /* code */ 0x60040003, // 0000 GETGBL R1 G3 0x5C080000, // 0001 MOVE R2 R0 @@ -150,11 +150,11 @@ be_local_class(lv_wifi_arcs, &be_class_lv_signal_arcs, be_nested_map(3, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("every_second", 2075451465, 12, 1), be_const_closure(every_second_closure) }, - { be_nested_key("init", 380752755, 4, -1), be_const_closure(init_closure) }, - { be_nested_key("del", -816214454, 3, -1), be_const_closure(del_closure) }, + { be_const_key(every_second, 1), be_const_closure(lv_wifi_arcs_every_second_closure) }, + { be_const_key(init, -1), be_const_closure(lv_wifi_arcs_init_closure) }, + { be_const_key(del, -1), be_const_closure(lv_wifi_arcs_del_closure) }, })), - (be_nested_const_str("lv_wifi_arcs", 2082091963, 12)) + be_str_literal("lv_wifi_arcs") ); /*******************************************************************/ diff --git a/lib/libesp32/Berry/default/be_lvgl_wifi_bars_icon_lib.c b/lib/libesp32/Berry/default/be_lvgl_wifi_bars_icon_lib.c index 9adcdeba5..a1cf693e5 100644 --- a/lib/libesp32/Berry/default/be_lvgl_wifi_bars_icon_lib.c +++ b/lib/libesp32/Berry/default/be_lvgl_wifi_bars_icon_lib.c @@ -10,7 +10,7 @@ /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(init, /* name */ +be_local_closure(lv_wifi_bars_icon_init, /* name */ be_nested_proto( 9, /* nstack */ 2, /* argc */ @@ -21,26 +21,26 @@ be_local_closure(init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[17]) { /* constants */ - /* K0 */ be_nested_string("init", 380752755, 4), - /* K1 */ be_nested_string("set_style_line_color", -629728320, 20), - /* K2 */ be_nested_string("lv", 1529997255, 2), - /* K3 */ be_nested_string("color", 1031692888, 5), - /* K4 */ be_nested_string("COLOR_WHITE", -1758096026, 11), - /* K5 */ be_nested_string("PART_MAIN", -1821475788, 9), - /* K6 */ be_nested_string("STATE_DEFAULT", 712406428, 13), - /* K7 */ be_nested_string("set_style_bg_color", 1689513089, 18), - /* K8 */ be_nested_string("COLOR_BLACK", 264427940, 11), - /* K9 */ be_nested_string("get_height", -723211773, 10), - /* K10 */ be_nested_string("get_style_pad_right", -1144679830, 19), - /* K11 */ be_nested_string("set_height", 1080207399, 10), - /* K12 */ be_nested_string("set_width", 484671920, 9), - /* K13 */ be_nested_string("set_x", 1849400772, 5), - /* K14 */ be_nested_string("get_width", -1001549996, 9), - /* K15 */ be_nested_string("set_style_pad_right", -980898242, 19), + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(set_style_line_color), + /* K2 */ be_nested_str(lv), + /* K3 */ be_nested_str(color), + /* K4 */ be_nested_str(COLOR_WHITE), + /* K5 */ be_nested_str(PART_MAIN), + /* K6 */ be_nested_str(STATE_DEFAULT), + /* K7 */ be_nested_str(set_style_bg_color), + /* K8 */ be_nested_str(COLOR_BLACK), + /* K9 */ be_nested_str(get_height), + /* K10 */ be_nested_str(get_style_pad_right), + /* K11 */ be_nested_str(set_height), + /* K12 */ be_nested_str(set_width), + /* K13 */ be_nested_str(set_x), + /* K14 */ be_nested_str(get_width), + /* K15 */ be_nested_str(set_style_pad_right), /* K16 */ be_const_int(1), }), - ((bstring*) &be_const_str_init), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[64]) { /* code */ 0x60080003, // 0000 GETGBL R2 G3 0x5C0C0000, // 0001 MOVE R3 R0 @@ -121,9 +121,9 @@ be_local_class(lv_wifi_bars_icon, &be_class_lv_wifi_bars, be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("init", 380752755, 4, -1), be_const_closure(init_closure) }, + { be_const_key(init, -1), be_const_closure(lv_wifi_bars_icon_init_closure) }, })), - (be_nested_const_str("lv_wifi_bars_icon", -1489151756, 17)) + be_str_literal("lv_wifi_bars_icon") ); /*******************************************************************/ diff --git a/lib/libesp32/Berry/default/be_lvgl_wifi_bars_lib.c b/lib/libesp32/Berry/default/be_lvgl_wifi_bars_lib.c index 9bbb51bf0..c61cb2bb3 100644 --- a/lib/libesp32/Berry/default/be_lvgl_wifi_bars_lib.c +++ b/lib/libesp32/Berry/default/be_lvgl_wifi_bars_lib.c @@ -10,7 +10,7 @@ /******************************************************************** ** Solidified function: every_second ********************************************************************/ -be_local_closure(every_second, /* name */ +be_local_closure(lv_wifi_bars_every_second, /* name */ be_nested_proto( 7, /* nstack */ 1, /* argc */ @@ -21,16 +21,16 @@ be_local_closure(every_second, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_string("tasmota", 424643812, 7), - /* K1 */ be_nested_string("wifi", 120087624, 4), - /* K2 */ be_nested_string("find", -1108310694, 4), - /* K3 */ be_nested_string("quality", -1697296346, 7), - /* K4 */ be_nested_string("ip", 1261996636, 2), - /* K5 */ be_nested_string("set_percentage", -1342944572, 14), + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(wifi), + /* K2 */ be_nested_str(find), + /* K3 */ be_nested_str(quality), + /* K4 */ be_nested_str(ip), + /* K5 */ be_nested_str(set_percentage), /* K6 */ be_const_int(0), }), - (be_nested_const_str("every_second", 2075451465, 12)), - ((bstring*) &be_const_str_input), + &be_const_str_every_second, + &be_const_str_solidified, ( &(const binstruction[23]) { /* code */ 0xB8060000, // 0000 GETNGBL R1 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -64,7 +64,7 @@ be_local_closure(every_second, /* name */ /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(init, /* name */ +be_local_closure(lv_wifi_bars_init, /* name */ be_nested_proto( 5, /* nstack */ 2, /* argc */ @@ -75,14 +75,14 @@ be_local_closure(init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_string("init", 380752755, 4), - /* K1 */ be_nested_string("tasmota", 424643812, 7), - /* K2 */ be_nested_string("add_driver", 1654458371, 10), - /* K3 */ be_nested_string("set_percentage", -1342944572, 14), + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(add_driver), + /* K3 */ be_nested_str(set_percentage), /* K4 */ be_const_int(0), }), - ((bstring*) &be_const_str_init), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[14]) { /* code */ 0x60080003, // 0000 GETGBL R2 G3 0x5C0C0000, // 0001 MOVE R3 R0 @@ -107,7 +107,7 @@ be_local_closure(init, /* name */ /******************************************************************** ** Solidified function: del ********************************************************************/ -be_local_closure(del, /* name */ +be_local_closure(lv_wifi_bars_del, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -118,12 +118,12 @@ be_local_closure(del, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("del", -816214454, 3), - /* K1 */ be_nested_string("tasmota", 424643812, 7), - /* K2 */ be_nested_string("remove_driver", 1030243768, 13), + /* K0 */ be_nested_str(del), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(remove_driver), }), - (be_nested_const_str("del", -816214454, 3)), - ((bstring*) &be_const_str_input), + &be_const_str_del, + &be_const_str_solidified, ( &(const binstruction[10]) { /* code */ 0x60040003, // 0000 GETGBL R1 G3 0x5C080000, // 0001 MOVE R2 R0 @@ -150,11 +150,11 @@ be_local_class(lv_wifi_bars, &be_class_lv_signal_bars, be_nested_map(3, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("every_second", 2075451465, 12, 1), be_const_closure(every_second_closure) }, - { be_nested_key("init", 380752755, 4, -1), be_const_closure(init_closure) }, - { be_nested_key("del", -816214454, 3, -1), be_const_closure(del_closure) }, + { be_const_key(every_second, 1), be_const_closure(lv_wifi_bars_every_second_closure) }, + { be_const_key(init, -1), be_const_closure(lv_wifi_bars_init_closure) }, + { be_const_key(del, -1), be_const_closure(lv_wifi_bars_del_closure) }, })), - (be_nested_const_str("lv_wifi_bars", 2109539196, 12)) + be_str_literal("lv_wifi_bars") ); /*******************************************************************/ diff --git a/lib/libesp32/Berry/default/be_modtab.c b/lib/libesp32/Berry/default/be_modtab.c index 0c54ce990..5f4279c27 100644 --- a/lib/libesp32/Berry/default/be_modtab.c +++ b/lib/libesp32/Berry/default/be_modtab.c @@ -131,7 +131,7 @@ extern void be_load_onewirelib(bvm *vm); extern void be_load_serial_lib(bvm *vm); extern void be_load_Driver_class(bvm *vm); extern void be_load_Timer_class(bvm *vm); -extern void be_load_driver_i2c_lib(bvm *vm); +extern void be_load_I2C_Driver_class(bvm *vm); extern void be_load_AXP192_class(bvm *vm); extern void be_load_md5_lib(bvm *vm); extern void be_load_webclient_lib(bvm *vm); @@ -181,7 +181,7 @@ BERRY_API void be_load_custom_libs(bvm *vm) #endif #ifdef USE_I2C be_load_wirelib(vm); - be_load_driver_i2c_lib(vm); + be_load_I2C_Driver_class(vm); be_load_AXP192_class(vm); #endif // USE_I2C #ifdef USE_ENERGY_SENSOR diff --git a/lib/libesp32/Berry/default/be_persist_lib.c b/lib/libesp32/Berry/default/be_persist_lib.c index 4684283d4..0581081c7 100644 --- a/lib/libesp32/Berry/default/be_persist_lib.c +++ b/lib/libesp32/Berry/default/be_persist_lib.c @@ -21,19 +21,19 @@ be_local_closure(Persist_json_fdump_map, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[10]) { /* constants */ - /* K0 */ be_nested_str_literal("json"), - /* K1 */ be_nested_str_literal("write"), - /* K2 */ be_nested_str_literal("{"), - /* K3 */ be_nested_str_literal("keys"), - /* K4 */ be_nested_str_literal("dump"), - /* K5 */ be_nested_str_literal(":"), - /* K6 */ be_nested_str_literal("json_fdump_any"), - /* K7 */ be_nested_str_literal(","), - /* K8 */ be_nested_str_literal("stop_iteration"), - /* K9 */ be_nested_str_literal("}"), + /* K0 */ be_nested_str(json), + /* K1 */ be_nested_str(write), + /* K2 */ be_nested_str(_X7B), + /* K3 */ be_nested_str(keys), + /* K4 */ be_nested_str(dump), + /* K5 */ be_nested_str(_X3A), + /* K6 */ be_nested_str(json_fdump_any), + /* K7 */ be_nested_str(_X2C), + /* K8 */ be_nested_str(stop_iteration), + /* K9 */ be_nested_str(_X7D), }), - (be_nested_const_str("json_fdump_map", -203012643, 14)), - ((bstring*) &be_const_str_input), + &be_const_str_json_fdump_map, + &be_const_str_solidified, ( &(const binstruction[41]) { /* code */ 0xA40E0000, // 0000 IMPORT R3 K0 0x8C100301, // 0001 GETMET R4 R1 K1 @@ -96,11 +96,11 @@ be_local_closure(Persist_setmember, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("_p"), - /* K1 */ be_nested_str_literal("_dirty"), + /* K0 */ be_nested_str(_p), + /* K1 */ be_nested_str(_dirty), }), - (be_nested_const_str("setmember", 1432909441, 9)), - ((bstring*) &be_const_str_input), + &be_const_str_setmember, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x880C0100, // 0000 GETMBR R3 R0 K0 0x980C0202, // 0001 SETIDX R3 R1 R2 @@ -127,11 +127,11 @@ be_local_closure(Persist_zero, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("_p"), - /* K1 */ be_nested_str_literal("_dirty"), + /* K0 */ be_nested_str(_p), + /* K1 */ be_nested_str(_dirty), }), - (be_nested_const_str("zero", -1955600541, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_zero, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x60040013, // 0000 GETGBL R1 G19 0x7C040000, // 0001 CALL R1 0 @@ -159,11 +159,11 @@ be_local_closure(Persist_member, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("_p"), - /* K1 */ be_nested_str_literal("find"), + /* K0 */ be_nested_str(_p), + /* K1 */ be_nested_str(find), }), - (be_nested_const_str("member", 719708611, 6)), - ((bstring*) &be_const_str_input), + &be_const_str_member, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 @@ -190,14 +190,14 @@ be_local_closure(Persist_json_fdump, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_str_literal("json"), - /* K1 */ be_nested_str_literal("_p"), - /* K2 */ be_nested_str_literal("json_fdump_map"), - /* K3 */ be_nested_str_literal("internal_error"), - /* K4 */ be_nested_str_literal("persist._p is not a map"), + /* K0 */ be_nested_str(json), + /* K1 */ be_nested_str(_p), + /* K2 */ be_nested_str(json_fdump_map), + /* K3 */ be_nested_str(internal_error), + /* K4 */ be_nested_str(persist_X2E_p_X20is_X20not_X20a_X20map), }), - (be_nested_const_str("json_fdump", 1694216580, 10)), - ((bstring*) &be_const_str_input), + &be_const_str_json_fdump, + &be_const_str_solidified, ( &(const binstruction[13]) { /* code */ 0xA40A0000, // 0000 IMPORT R2 K0 0x600C000F, // 0001 GETGBL R3 G15 @@ -232,12 +232,12 @@ be_local_closure(Persist_remove, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_literal("_p"), - /* K1 */ be_nested_str_literal("remove"), - /* K2 */ be_nested_str_literal("_dirty"), + /* K0 */ be_nested_str(_p), + /* K1 */ be_nested_str(remove), + /* K2 */ be_nested_str(_dirty), }), - (be_nested_const_str("remove", -611183107, 6)), - ((bstring*) &be_const_str_input), + &be_const_str_remove, + &be_const_str_solidified, ( &(const binstruction[ 7]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 @@ -266,14 +266,14 @@ be_local_closure(Persist_json_fdump_any, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_str_literal("json"), - /* K1 */ be_nested_str_literal("json_fdump_map"), - /* K2 */ be_nested_str_literal("json_fdump_list"), - /* K3 */ be_nested_str_literal("write"), - /* K4 */ be_nested_str_literal("dump"), + /* K0 */ be_nested_str(json), + /* K1 */ be_nested_str(json_fdump_map), + /* K2 */ be_nested_str(json_fdump_list), + /* K3 */ be_nested_str(write), + /* K4 */ be_nested_str(dump), }), - (be_nested_const_str("json_fdump_any", -946337911, 14)), - ((bstring*) &be_const_str_input), + &be_const_str_json_fdump_any, + &be_const_str_solidified, ( &(const binstruction[27]) { /* code */ 0xA40E0000, // 0000 IMPORT R3 K0 0x6010000F, // 0001 GETGBL R4 G15 @@ -322,16 +322,16 @@ be_local_closure(Persist_save, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_str_literal("_filename"), - /* K1 */ be_nested_str_literal("w"), - /* K2 */ be_nested_str_literal("json_fdump"), - /* K3 */ be_nested_str_literal("close"), - /* K4 */ be_nested_str_literal("write"), - /* K5 */ be_nested_str_literal("{}"), - /* K6 */ be_nested_str_literal("_dirty"), + /* K0 */ be_nested_str(_filename), + /* K1 */ be_nested_str(w), + /* K2 */ be_nested_str(json_fdump), + /* K3 */ be_nested_str(close), + /* K4 */ be_nested_str(write), + /* K5 */ be_nested_str(_X7B_X7D), + /* K6 */ be_nested_str(_dirty), }), - (be_nested_const_str("save", -855671224, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_save, + &be_const_str_solidified, ( &(const binstruction[37]) { /* code */ 0x4C040000, // 0000 LDNIL R1 0xA802000B, // 0001 EXBLK 0 #000E @@ -390,21 +390,21 @@ be_local_closure(Persist_load, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[12]) { /* constants */ - /* K0 */ be_nested_str_literal("json"), - /* K1 */ be_nested_str_literal("path"), - /* K2 */ be_nested_str_literal("exists"), - /* K3 */ be_nested_str_literal("_filename"), - /* K4 */ be_nested_str_literal("r"), - /* K5 */ be_nested_str_literal("load"), - /* K6 */ be_nested_str_literal("read"), - /* K7 */ be_nested_str_literal("close"), - /* K8 */ be_nested_str_literal("_p"), - /* K9 */ be_nested_str_literal("BRY: failed to load _persist.json"), - /* K10 */ be_nested_str_literal("_dirty"), - /* K11 */ be_nested_str_literal("save"), + /* K0 */ be_nested_str(json), + /* K1 */ be_nested_str(path), + /* K2 */ be_nested_str(exists), + /* K3 */ be_nested_str(_filename), + /* K4 */ be_nested_str(r), + /* K5 */ be_nested_str(load), + /* K6 */ be_nested_str(read), + /* K7 */ be_nested_str(close), + /* K8 */ be_nested_str(_p), + /* K9 */ be_nested_str(BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson), + /* K10 */ be_nested_str(_dirty), + /* K11 */ be_nested_str(save), }), - (be_nested_const_str("load", -435725847, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_load, + &be_const_str_solidified, ( &(const binstruction[49]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0xA40A0200, // 0001 IMPORT R2 K1 @@ -475,11 +475,11 @@ be_local_closure(Persist_find, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("_p"), - /* K1 */ be_nested_str_literal("find"), + /* K0 */ be_nested_str(_p), + /* K1 */ be_nested_str(find), }), - (be_nested_const_str("find", -1108310694, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_find, + &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x880C0100, // 0000 GETMBR R3 R0 K0 0x8C0C0701, // 0001 GETMET R3 R3 K1 @@ -507,15 +507,15 @@ be_local_closure(Persist_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_str_literal("_filename"), - /* K1 */ be_nested_str_literal("_persist.json"), - /* K2 */ be_nested_str_literal("_p"), - /* K3 */ be_nested_str_literal("copy"), - /* K4 */ be_nested_str_literal("load"), - /* K5 */ be_nested_str_literal("_dirty"), + /* K0 */ be_nested_str(_filename), + /* K1 */ be_nested_str(_persist_X2Ejson), + /* K2 */ be_nested_str(_p), + /* K3 */ be_nested_str(copy), + /* K4 */ be_nested_str(load), + /* K5 */ be_nested_str(_dirty), }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[20]) { /* code */ 0x90020101, // 0000 SETMBR R0 K0 K1 0x6008000F, // 0001 GETGBL R2 G15 @@ -557,17 +557,17 @@ be_local_closure(Persist_json_fdump_list, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_str_literal("json"), - /* K1 */ be_nested_str_literal("write"), - /* K2 */ be_nested_str_literal("["), + /* K0 */ be_nested_str(json), + /* K1 */ be_nested_str(write), + /* K2 */ be_nested_str(_X5B), /* K3 */ be_const_int(0), - /* K4 */ be_nested_str_literal(","), - /* K5 */ be_nested_str_literal("json_fdump_any"), + /* K4 */ be_nested_str(_X2C), + /* K5 */ be_nested_str(json_fdump_any), /* K6 */ be_const_int(1), - /* K7 */ be_nested_str_literal("]"), + /* K7 */ be_nested_str(_X5D), }), - (be_nested_const_str("json_fdump_list", -391087443, 15)), - ((bstring*) &be_const_str_input), + &be_const_str_json_fdump_list, + &be_const_str_solidified, ( &(const binstruction[25]) { /* code */ 0xA40E0000, // 0000 IMPORT R3 K0 0x8C100301, // 0001 GETMET R4 R1 K1 @@ -614,11 +614,11 @@ be_local_closure(Persist_has, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("_p"), - /* K1 */ be_nested_str_literal("has"), + /* K0 */ be_nested_str(_p), + /* K1 */ be_nested_str(has), }), - (be_nested_const_str("has", -306245661, 3)), - ((bstring*) &be_const_str_input), + &be_const_str_has, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 @@ -639,22 +639,22 @@ be_local_class(Persist, NULL, be_nested_map(16, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("has", -306245661, 3, 6), be_const_closure(Persist_has_closure) }, - { be_nested_key("setmember", 1432909441, 9, -1), be_const_closure(Persist_setmember_closure) }, - { be_nested_key("remove", -611183107, 6, -1), be_const_closure(Persist_remove_closure) }, - { be_nested_key("zero", -1955600541, 4, 0), be_const_closure(Persist_zero_closure) }, - { be_nested_key("json_fdump", 1694216580, 10, -1), be_const_closure(Persist_json_fdump_closure) }, - { be_nested_key("json_fdump_list", -391087443, 15, 2), be_const_closure(Persist_json_fdump_list_closure) }, - { be_nested_key("init", 380752755, 4, 15), be_const_closure(Persist_init_closure) }, - { be_nested_key("find", -1108310694, 4, -1), be_const_closure(Persist_find_closure) }, - { be_nested_key("save", -855671224, 4, -1), be_const_closure(Persist_save_closure) }, - { be_nested_key("json_fdump_any", -946337911, 14, 12), be_const_closure(Persist_json_fdump_any_closure) }, - { be_nested_key("_p", 1594591802, 2, 7), be_const_var(1) }, - { be_nested_key("_filename", 1430813195, 9, -1), be_const_var(0) }, - { be_nested_key("load", -435725847, 4, -1), be_const_closure(Persist_load_closure) }, - { be_nested_key("json_fdump_map", -203012643, 14, 5), be_const_closure(Persist_json_fdump_map_closure) }, - { be_nested_key("_dirty", 283846766, 6, -1), be_const_var(2) }, - { be_nested_key("member", 719708611, 6, -1), be_const_closure(Persist_member_closure) }, + { be_const_key(has, 6), be_const_closure(Persist_has_closure) }, + { be_const_key(setmember, -1), be_const_closure(Persist_setmember_closure) }, + { be_const_key(remove, -1), be_const_closure(Persist_remove_closure) }, + { be_const_key(zero, 0), be_const_closure(Persist_zero_closure) }, + { be_const_key(json_fdump, -1), be_const_closure(Persist_json_fdump_closure) }, + { be_const_key(json_fdump_list, 2), be_const_closure(Persist_json_fdump_list_closure) }, + { be_const_key(init, 15), be_const_closure(Persist_init_closure) }, + { be_const_key(find, -1), be_const_closure(Persist_find_closure) }, + { be_const_key(save, -1), be_const_closure(Persist_save_closure) }, + { be_const_key(json_fdump_any, 12), be_const_closure(Persist_json_fdump_any_closure) }, + { be_const_key(_p, 7), be_const_var(1) }, + { be_const_key(_filename, -1), be_const_var(0) }, + { be_const_key(load, -1), be_const_closure(Persist_load_closure) }, + { be_const_key(json_fdump_map, 5), be_const_closure(Persist_json_fdump_map_closure) }, + { be_const_key(_dirty, -1), be_const_var(2) }, + { be_const_key(member, -1), be_const_closure(Persist_member_closure) }, })), be_str_literal("Persist") ); @@ -675,8 +675,8 @@ be_local_closure(persist__anonymous_, /* name */ ( &(const bvalue[ 1]) { /* constants */ /* K0 */ be_const_class(be_class_Persist), }), - (be_nested_const_str("_anonymous_", 1957281476, 11)), - ((bstring*) &be_const_str_input), + &be_const_str__anonymous_, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x58040000, // 0000 LDCONST R1 K0 0xB4000000, // 0001 CLASS K0 @@ -696,7 +696,7 @@ be_local_module(persist, "persist", be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("init", 380752755, 4, -1), be_const_closure(persist__anonymous__closure) }, + { be_const_key(init, -1), be_const_closure(persist__anonymous__closure) }, })) ); BE_EXPORT_VARIABLE be_define_const_native_module(persist); diff --git a/lib/libesp32/Berry/default/be_python_compat.c b/lib/libesp32/Berry/default/be_python_compat.c index 7213c10ad..5b3ec64d0 100644 --- a/lib/libesp32/Berry/default/be_python_compat.c +++ b/lib/libesp32/Berry/default/be_python_compat.c @@ -8,7 +8,7 @@ /******************************************************************** ** Solidified function: _anonymous_ ********************************************************************/ -be_local_closure(_anonymous_, /* name */ +be_local_closure(python_compat__anonymous_, /* name */ be_nested_proto( 3, /* nstack */ 1, /* argc */ @@ -19,25 +19,25 @@ be_local_closure(_anonymous_, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_string("global", 503252654, 6), - /* K1 */ be_nested_string("True", -841064955, 4), - /* K2 */ be_nested_string("False", -1753917960, 5), - /* K3 */ be_nested_string("None", 810547195, 4), - /* K4 */ be_nested_string("b", -418632219, 1), + /* K0 */ be_nested_str(global), + /* K1 */ be_nested_str(True), + /* K2 */ be_nested_str(False), + /* K3 */ be_nested_str(None), + /* K4 */ be_nested_str(b), }), - (be_nested_const_str("_anonymous_", 1957281476, 11)), - (be_nested_const_str("python_compat.be", -225667571, 16)), + &be_const_str__anonymous_, + &be_const_str_solidified, ( &(const binstruction[10]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x50080200, // 0001 LDBOOL R2 1 0 - 0x90060202, // 0002 SETMBR R1 K1 R2 - 0x50080000, // 0003 LDBOOL R2 0 0 - 0x90060402, // 0004 SETMBR R1 K2 R2 - 0x4C080000, // 0005 LDNIL R2 - 0x90060602, // 0006 SETMBR R1 K3 R2 - 0x60080015, // 0007 GETGBL R2 G21 - 0x90060802, // 0008 SETMBR R1 K4 R2 - 0x80040000, // 0009 RET 1 R0 + 0xA4060000, // 0000 IMPORT R1 K0 + 0x50080200, // 0001 LDBOOL R2 1 0 + 0x90060202, // 0002 SETMBR R1 K1 R2 + 0x50080000, // 0003 LDBOOL R2 0 0 + 0x90060402, // 0004 SETMBR R1 K2 R2 + 0x4C080000, // 0005 LDNIL R2 + 0x90060602, // 0006 SETMBR R1 K3 R2 + 0x60080015, // 0007 GETGBL R2 G21 + 0x90060802, // 0008 SETMBR R1 K4 R2 + 0x80040000, // 0009 RET 1 R0 }) ) ); @@ -51,7 +51,7 @@ be_local_module(python_compat, "python_compat", be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("init", 380752755, 4, -1), be_const_closure(_anonymous__closure) }, + { be_const_key(init, -1), be_const_closure(python_compat__anonymous__closure) }, })) ); BE_EXPORT_VARIABLE be_define_const_native_module(python_compat); diff --git a/lib/libesp32/Berry/default/be_tapp_lib.c b/lib/libesp32/Berry/default/be_tapp_lib.c index 47ef170f7..1a312d110 100644 --- a/lib/libesp32/Berry/default/be_tapp_lib.c +++ b/lib/libesp32/Berry/default/be_tapp_lib.c @@ -20,11 +20,11 @@ be_local_closure(Tapp_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_literal("tasmota"), - /* K1 */ be_nested_str_literal("add_driver"), + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(add_driver), }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), + &be_const_str_init, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0xB8060000, // 0000 GETNGBL R1 K0 0x8C040301, // 0001 GETMET R1 R1 K1 @@ -51,24 +51,24 @@ be_local_closure(Tapp_autoexec, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[15]) { /* constants */ - /* K0 */ be_nested_str_literal("path"), - /* K1 */ be_nested_str_literal("string"), - /* K2 */ be_nested_str_literal("listdir"), - /* K3 */ be_nested_str_literal("/"), - /* K4 */ be_nested_str_literal("find"), - /* K5 */ be_nested_str_literal(".tapp"), + /* K0 */ be_nested_str(path), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(listdir), + /* K3 */ be_nested_str(_X2F), + /* K4 */ be_nested_str(find), + /* K5 */ be_nested_str(_X2Etapp), /* K6 */ be_const_int(0), - /* K7 */ be_nested_str_literal("tasmota"), - /* K8 */ be_nested_str_literal("log"), - /* K9 */ be_nested_str_literal("format"), - /* K10 */ be_nested_str_literal("TAP: found Tasmota App '%s'"), + /* K7 */ be_nested_str(tasmota), + /* K8 */ be_nested_str(log), + /* K9 */ be_nested_str(format), + /* K10 */ be_nested_str(TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27), /* K11 */ be_const_int(2), - /* K12 */ be_nested_str_literal("load"), - /* K13 */ be_nested_str_literal("#autoexec.be"), - /* K14 */ be_nested_str_literal("stop_iteration"), + /* K12 */ be_nested_str(load), + /* K13 */ be_nested_str(_X23autoexec_X2Ebe), + /* K14 */ be_nested_str(stop_iteration), }), - (be_nested_const_str("autoexec", -618105405, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_autoexec, + &be_const_str_solidified, ( &(const binstruction[34]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0xA40A0200, // 0001 IMPORT R2 K1 @@ -118,8 +118,8 @@ be_local_class(Tapp, NULL, be_nested_map(2, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("autoexec", -618105405, 8, -1), be_const_closure(Tapp_autoexec_closure) }, - { be_nested_key("init", 380752755, 4, 0), be_const_closure(Tapp_init_closure) }, + { be_const_key(autoexec, -1), be_const_closure(Tapp_autoexec_closure) }, + { be_const_key(init, 0), be_const_closure(Tapp_init_closure) }, })), be_str_literal("Tapp") ); @@ -140,8 +140,8 @@ be_local_closure(tapp__anonymous_, /* name */ ( &(const bvalue[ 1]) { /* constants */ /* K0 */ be_const_class(be_class_Tapp), }), - (be_nested_const_str("_anonymous_", 1957281476, 11)), - ((bstring*) &be_const_str_input), + &be_const_str__anonymous_, + &be_const_str_solidified, ( &(const binstruction[ 5]) { /* code */ 0x58040000, // 0000 LDCONST R1 K0 0xB4000000, // 0001 CLASS K0 @@ -161,7 +161,7 @@ be_local_module(tapp, "tapp", be_nested_map(1, ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("init", 380752755, 4, -1), be_const_closure(tapp__anonymous__closure) }, + { be_const_key(init, -1), be_const_closure(tapp__anonymous__closure) }, })) ); BE_EXPORT_VARIABLE be_define_const_native_module(tapp); diff --git a/lib/libesp32/Berry/default/be_tasmotalib.c b/lib/libesp32/Berry/default/be_tasmotalib.c index a5c0307b8..b073287f4 100644 --- a/lib/libesp32/Berry/default/be_tasmotalib.c +++ b/lib/libesp32/Berry/default/be_tasmotalib.c @@ -53,161 +53,11 @@ extern int l_getswitch(bvm *vm); extern int l_i2cenabled(bvm *vm); -// KV class -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(kv_init, /* name */ - be_nested_proto( - 3, /* nstack */ - 3, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("k", -301188886, 1), - /* K1 */ be_nested_string("v", -217300791, 1), - }), - ((bstring*) &be_const_str_init), - ((bstring*) &be_const_str_input), - ( &(const binstruction[ 3]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x90020202, // 0001 SETMBR R0 K1 R2 - 0x80000000, // 0002 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: KV -********************************************************************/ -be_local_class(KV, - 2, - NULL, - be_nested_map(3, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_nested_key("k", -301188886, 1, 2), be_const_var(0) }, - { be_nested_key("v", -217300791, 1, -1), be_const_var(1) }, - { be_nested_key("init", 380752755, 4, -1), be_const_closure(kv_init_closure) }, - })), - (be_nested_const_str("KV", 955173972, 2)) -); - -/******************************************************************** -** Solidified function: kv -********************************************************************/ -be_local_closure(kv, /* name */ - be_nested_proto( - 7, /* nstack */ - 3, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_const_class(be_class_KV), - }), - (be_nested_const_str("kv", 1497177492, 2)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[ 7]) { /* code */ - 0x580C0000, // 0000 LDCONST R3 K0 - 0xB4000000, // 0001 CLASS K0 - 0x5C100600, // 0002 MOVE R4 R3 - 0x5C140200, // 0003 MOVE R5 R1 - 0x5C180400, // 0004 MOVE R6 R2 - 0x7C100400, // 0005 CALL R4 2 - 0x80040800, // 0006 RET 1 R4 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(init, /* name */ - be_nested_proto( - 7, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[15]) { /* constants */ - /* K0 */ be_nested_str_literal("global"), - /* K1 */ be_nested_str_literal("ctypes_bytes_dyn"), - /* K2 */ be_nested_str_literal("_global_addr"), - /* K3 */ be_nested_str_literal("_global_def"), - /* K4 */ be_nested_str_literal("introspect"), - /* K5 */ be_nested_str_literal("_settings_ptr"), - /* K6 */ be_nested_str_literal("get"), - /* K7 */ be_const_int(0), - /* K8 */ be_nested_str_literal("settings"), - /* K9 */ be_nested_str_literal("toptr"), - /* K10 */ be_nested_str_literal("_settings_def"), - /* K11 */ be_nested_str_literal("wd"), - /* K12 */ be_nested_str_literal(""), - /* K13 */ be_nested_str_literal("_debug_present"), - /* K14 */ be_nested_str_literal("debug"), - }), - (be_nested_const_str("init", 380752755, 4)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[36]) { /* code */ - 0xB8060200, // 0000 GETNGBL R1 K1 - 0x88080102, // 0001 GETMBR R2 R0 K2 - 0x880C0103, // 0002 GETMBR R3 R0 K3 - 0x7C040400, // 0003 CALL R1 2 - 0x90020001, // 0004 SETMBR R0 K0 R1 - 0xA4060800, // 0005 IMPORT R1 K4 - 0x60080015, // 0006 GETGBL R2 G21 - 0x880C0105, // 0007 GETMBR R3 R0 K5 - 0x54120003, // 0008 LDINT R4 4 - 0x7C080400, // 0009 CALL R2 2 - 0x8C080506, // 000A GETMET R2 R2 K6 - 0x58100007, // 000B LDCONST R4 K7 - 0x54160003, // 000C LDINT R5 4 - 0x7C080600, // 000D CALL R2 3 - 0x780A0006, // 000E JMPF R2 #0016 - 0xB80E0200, // 000F GETNGBL R3 K1 - 0x8C100309, // 0010 GETMET R4 R1 K9 - 0x5C180400, // 0011 MOVE R6 R2 - 0x7C100400, // 0012 CALL R4 2 - 0x8814010A, // 0013 GETMBR R5 R0 K10 - 0x7C0C0400, // 0014 CALL R3 2 - 0x90021003, // 0015 SETMBR R0 K8 R3 - 0x9002170C, // 0016 SETMBR R0 K11 K12 - 0x500C0000, // 0017 LDBOOL R3 0 0 - 0x90021A03, // 0018 SETMBR R0 K13 R3 - 0xA8020004, // 0019 EXBLK 0 #001F - 0xA40E1C00, // 001A IMPORT R3 K14 - 0x50100200, // 001B LDBOOL R4 1 0 - 0x90021A04, // 001C SETMBR R0 K13 R4 - 0xA8040001, // 001D EXBLK 1 1 - 0x70020003, // 001E JMP #0023 - 0xAC0C0000, // 001F CATCH R3 0 0 - 0x70020000, // 0020 JMP #0022 - 0x70020000, // 0021 JMP #0023 - 0xB0080000, // 0022 RAISE 2 R0 R0 - 0x80000000, // 0023 RET 0 - }) - ) -); -/*******************************************************************/ /******************************************************************** ** Solidified function: add_driver ********************************************************************/ -be_local_closure(add_driver, /* name */ +be_local_closure(Tasmota_add_driver, /* name */ be_nested_proto( 5, /* nstack */ 2, /* argc */ @@ -218,24 +68,24 @@ be_local_closure(add_driver, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("_drivers", -1034638311, 8), - /* K1 */ be_nested_string("push", -2022703139, 4), + /* K0 */ be_nested_str(_drivers), + /* K1 */ be_nested_str(push), }), - (be_nested_const_str("add_driver", 1654458371, 10)), - ((bstring*) &be_const_str_input), + &be_const_str_add_driver, + &be_const_str_solidified, ( &(const binstruction[12]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x780A0004, // 0001 JMPF R2 #0007 - 0x88080100, // 0002 GETMBR R2 R0 K0 - 0x8C080501, // 0003 GETMET R2 R2 K1 - 0x5C100200, // 0004 MOVE R4 R1 - 0x7C080400, // 0005 CALL R2 2 - 0x70020003, // 0006 JMP #000B - 0x60080012, // 0007 GETGBL R2 G18 - 0x7C080000, // 0008 CALL R2 0 - 0x400C0401, // 0009 CONNECT R3 R2 R1 - 0x90020002, // 000A SETMBR R0 K0 R2 - 0x80000000, // 000B RET 0 + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A0004, // 0001 JMPF R2 #0007 + 0x88080100, // 0002 GETMBR R2 R0 K0 + 0x8C080501, // 0003 GETMET R2 R2 K1 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x70020003, // 0006 JMP #000B + 0x60080012, // 0007 GETGBL R2 G18 + 0x7C080000, // 0008 CALL R2 0 + 0x400C0401, // 0009 CONNECT R3 R2 R1 + 0x90020002, // 000A SETMBR R0 K0 R2 + 0x80000000, // 000B RET 0 }) ) ); @@ -243,77 +93,12 @@ be_local_closure(add_driver, /* name */ /******************************************************************** -** Solidified function: gen_cb +** Solidified function: gc ********************************************************************/ -be_local_closure(gen_cb, /* name */ +be_local_closure(Tasmota_gc, /* name */ be_nested_proto( - 7, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_string("_cb", -251666929, 3), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_string("find", -1108310694, 4), - /* K3 */ be_nested_string("_get_cb", 1448849122, 7), - /* K4 */ be_nested_string("stop_iteration", -121173395, 14), - /* K5 */ be_nested_string("internal_error", -1775809127, 14), - /* K6 */ be_nested_string("No callback available", 633786138, 21), - }), - (be_nested_const_str("gen_cb", -1049739745, 6)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[34]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x4C0C0000, // 0001 LDNIL R3 - 0x1C080403, // 0002 EQ R2 R2 R3 - 0x780A0002, // 0003 JMPF R2 #0007 - 0x60080013, // 0004 GETGBL R2 G19 - 0x7C080000, // 0005 CALL R2 0 - 0x90020002, // 0006 SETMBR R0 K0 R2 - 0x60080010, // 0007 GETGBL R2 G16 - 0x540E0012, // 0008 LDINT R3 19 - 0x400E0203, // 0009 CONNECT R3 K1 R3 - 0x7C080200, // 000A CALL R2 1 - 0xA8020010, // 000B EXBLK 0 #001D - 0x5C0C0400, // 000C MOVE R3 R2 - 0x7C0C0000, // 000D CALL R3 0 - 0x88100100, // 000E GETMBR R4 R0 K0 - 0x8C100902, // 000F GETMET R4 R4 K2 - 0x5C180600, // 0010 MOVE R6 R3 - 0x7C100400, // 0011 CALL R4 2 - 0x4C140000, // 0012 LDNIL R5 - 0x1C100805, // 0013 EQ R4 R4 R5 - 0x78120006, // 0014 JMPF R4 #001C - 0x88100100, // 0015 GETMBR R4 R0 K0 - 0x98100601, // 0016 SETIDX R4 R3 R1 - 0x8C100103, // 0017 GETMET R4 R0 K3 - 0x5C180600, // 0018 MOVE R6 R3 - 0x7C100400, // 0019 CALL R4 2 - 0xA8040001, // 001A EXBLK 1 1 - 0x80040800, // 001B RET 1 R4 - 0x7001FFEE, // 001C JMP #000C - 0x58080004, // 001D LDCONST R2 K4 - 0xAC080200, // 001E CATCH R2 1 0 - 0xB0080000, // 001F RAISE 2 R0 R0 - 0xB0060B06, // 0020 RAISE 1 K5 K6 - 0x80000000, // 0021 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_light -********************************************************************/ -be_local_closure(set_light, /* name */ - be_nested_proto( - 8, /* nstack */ - 3, /* argc */ + 4, /* nstack */ + 1, /* argc */ 0, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -321,776 +106,19 @@ be_local_closure(set_light, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("tasmota.set_light() is deprecated, use light.set()", 2124937871, 50), - /* K1 */ be_nested_string("light", -493019601, 5), - /* K2 */ be_nested_string("set", -970520829, 3), + /* K0 */ be_nested_str(gc), + /* K1 */ be_nested_str(collect), + /* K2 */ be_nested_str(allocated), }), - (be_nested_const_str("set_light", -1118891144, 9)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[18]) { /* code */ - 0x600C0001, // 0000 GETGBL R3 G1 - 0x58100000, // 0001 LDCONST R4 K0 - 0x7C0C0200, // 0002 CALL R3 1 - 0xA40E0200, // 0003 IMPORT R3 K1 - 0x4C100000, // 0004 LDNIL R4 - 0x20100404, // 0005 NE R4 R2 R4 - 0x78120005, // 0006 JMPF R4 #000D - 0x8C100702, // 0007 GETMET R4 R3 K2 - 0x5C180200, // 0008 MOVE R6 R1 - 0x5C1C0400, // 0009 MOVE R7 R2 - 0x7C100600, // 000A CALL R4 3 - 0x80040800, // 000B RET 1 R4 - 0x70020003, // 000C JMP #0011 - 0x8C100702, // 000D GETMET R4 R3 K2 - 0x5C180200, // 000E MOVE R6 R1 - 0x7C100400, // 000F CALL R4 2 - 0x80040800, // 0010 RET 1 R4 - 0x80000000, // 0011 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: remove_rule -********************************************************************/ -be_local_closure(remove_rule, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_string("_rules", -28750191, 6), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_string("k", -301188886, 1), - /* K3 */ be_nested_string("remove", -611183107, 6), - /* K4 */ be_const_int(1), - }), - (be_nested_const_str("remove_rule", -838755968, 11)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[21]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x780A0011, // 0001 JMPF R2 #0014 - 0x58080001, // 0002 LDCONST R2 K1 - 0x600C000C, // 0003 GETGBL R3 G12 - 0x88100100, // 0004 GETMBR R4 R0 K0 - 0x7C0C0200, // 0005 CALL R3 1 - 0x140C0403, // 0006 LT R3 R2 R3 - 0x780E000B, // 0007 JMPF R3 #0014 - 0x880C0100, // 0008 GETMBR R3 R0 K0 - 0x940C0602, // 0009 GETIDX R3 R3 R2 - 0x880C0702, // 000A GETMBR R3 R3 K2 - 0x1C0C0601, // 000B EQ R3 R3 R1 - 0x780E0004, // 000C JMPF R3 #0012 - 0x880C0100, // 000D GETMBR R3 R0 K0 - 0x8C0C0703, // 000E GETMET R3 R3 K3 - 0x5C140400, // 000F MOVE R5 R2 - 0x7C0C0400, // 0010 CALL R3 2 - 0x70020000, // 0011 JMP #0013 - 0x00080504, // 0012 ADD R2 R2 K4 - 0x7001FFEE, // 0013 JMP #0003 - 0x80000000, // 0014 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: add_cmd -********************************************************************/ -be_local_closure(add_cmd, /* name */ - be_nested_proto( - 5, /* nstack */ - 3, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_string("_ccmd", -2131545883, 5), - /* K1 */ be_nested_string("function", -1630125495, 8), - /* K2 */ be_nested_string("value_error", 773297791, 11), - /* K3 */ be_nested_string("the second argument is not a function", -340392827, 37), - }), - (be_nested_const_str("add_cmd", -933336417, 7)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[15]) { /* code */ - 0x880C0100, // 0000 GETMBR R3 R0 K0 - 0x740E0002, // 0001 JMPT R3 #0005 - 0x600C0013, // 0002 GETGBL R3 G19 - 0x7C0C0000, // 0003 CALL R3 0 - 0x90020003, // 0004 SETMBR R0 K0 R3 - 0x600C0004, // 0005 GETGBL R3 G4 - 0x5C100400, // 0006 MOVE R4 R2 - 0x7C0C0200, // 0007 CALL R3 1 - 0x1C0C0701, // 0008 EQ R3 R3 K1 - 0x780E0002, // 0009 JMPF R3 #000D - 0x880C0100, // 000A GETMBR R3 R0 K0 - 0x980C0202, // 000B SETIDX R3 R1 R2 - 0x70020000, // 000C JMP #000E - 0xB0060503, // 000D RAISE 1 K2 K3 - 0x80000000, // 000E RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: wire_scan -********************************************************************/ -be_local_closure(wire_scan, /* name */ - be_nested_proto( - 6, /* nstack */ - 3, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_string("i2c_enabled", 218388101, 11), - /* K1 */ be_nested_string("wire1", -1082245877, 5), - /* K2 */ be_nested_string("enabled", 49525662, 7), - /* K3 */ be_nested_string("detect", 8884370, 6), - /* K4 */ be_nested_string("wire2", -1065468258, 5), - }), - (be_nested_const_str("wire_scan", -1623691416, 9)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[33]) { /* code */ - 0x4C0C0000, // 0000 LDNIL R3 - 0x200C0403, // 0001 NE R3 R2 R3 - 0x780E0005, // 0002 JMPF R3 #0009 - 0x8C0C0100, // 0003 GETMET R3 R0 K0 - 0x5C140400, // 0004 MOVE R5 R2 - 0x7C0C0400, // 0005 CALL R3 2 - 0x740E0001, // 0006 JMPT R3 #0009 - 0x4C0C0000, // 0007 LDNIL R3 - 0x80040600, // 0008 RET 1 R3 - 0x880C0101, // 0009 GETMBR R3 R0 K1 - 0x8C0C0702, // 000A GETMET R3 R3 K2 - 0x7C0C0200, // 000B CALL R3 1 - 0x780E0006, // 000C JMPF R3 #0014 - 0x880C0101, // 000D GETMBR R3 R0 K1 - 0x8C0C0703, // 000E GETMET R3 R3 K3 - 0x5C140200, // 000F MOVE R5 R1 - 0x7C0C0400, // 0010 CALL R3 2 - 0x780E0001, // 0011 JMPF R3 #0014 - 0x880C0101, // 0012 GETMBR R3 R0 K1 - 0x80040600, // 0013 RET 1 R3 - 0x880C0104, // 0014 GETMBR R3 R0 K4 - 0x8C0C0702, // 0015 GETMET R3 R3 K2 - 0x7C0C0200, // 0016 CALL R3 1 - 0x780E0006, // 0017 JMPF R3 #001F - 0x880C0104, // 0018 GETMBR R3 R0 K4 - 0x8C0C0703, // 0019 GETMET R3 R3 K3 - 0x5C140200, // 001A MOVE R5 R1 - 0x7C0C0400, // 001B CALL R3 2 - 0x780E0001, // 001C JMPF R3 #001F - 0x880C0104, // 001D GETMBR R3 R0 K4 - 0x80040600, // 001E RET 1 R3 - 0x4C0C0000, // 001F LDNIL R3 - 0x80040600, // 0020 RET 1 R3 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: find_key_i -********************************************************************/ -be_local_closure(find_key_i, /* name */ - be_nested_proto( - 10, /* nstack */ - 3, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_string("string", 398550328, 6), - /* K1 */ be_nested_string("toupper", -602983720, 7), - /* K2 */ be_nested_string("keys", -112588595, 4), - /* K3 */ be_nested_string("?", 973910158, 1), - /* K4 */ be_nested_string("stop_iteration", -121173395, 14), - }), - (be_nested_const_str("find_key_i", 850136726, 10)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[30]) { /* code */ - 0xA40E0000, // 0000 IMPORT R3 K0 - 0x8C100701, // 0001 GETMET R4 R3 K1 - 0x5C180400, // 0002 MOVE R6 R2 - 0x7C100400, // 0003 CALL R4 2 - 0x6014000F, // 0004 GETGBL R5 G15 - 0x5C180200, // 0005 MOVE R6 R1 - 0x601C0013, // 0006 GETGBL R7 G19 - 0x7C140400, // 0007 CALL R5 2 - 0x78160013, // 0008 JMPF R5 #001D - 0x60140010, // 0009 GETGBL R5 G16 - 0x8C180302, // 000A GETMET R6 R1 K2 - 0x7C180200, // 000B CALL R6 1 - 0x7C140200, // 000C CALL R5 1 - 0xA802000B, // 000D EXBLK 0 #001A - 0x5C180A00, // 000E MOVE R6 R5 - 0x7C180000, // 000F CALL R6 0 - 0x8C1C0701, // 0010 GETMET R7 R3 K1 - 0x5C240C00, // 0011 MOVE R9 R6 - 0x7C1C0400, // 0012 CALL R7 2 - 0x1C1C0E04, // 0013 EQ R7 R7 R4 - 0x741E0001, // 0014 JMPT R7 #0017 - 0x1C1C0503, // 0015 EQ R7 R2 K3 - 0x781E0001, // 0016 JMPF R7 #0019 - 0xA8040001, // 0017 EXBLK 1 1 - 0x80040C00, // 0018 RET 1 R6 - 0x7001FFF3, // 0019 JMP #000E - 0x58140004, // 001A LDCONST R5 K4 - 0xAC140200, // 001B CATCH R5 1 0 - 0xB0080000, // 001C RAISE 2 R0 R0 - 0x80000000, // 001D RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: chars_in_string -********************************************************************/ -be_local_closure(chars_in_string, /* name */ - be_nested_proto( - 10, /* nstack */ - 4, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_const_int(0), - /* K1 */ be_const_int(1), - }), - (be_nested_const_str("chars_in_string", -1146182164, 15)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[31]) { /* code */ - 0x780E0001, // 0000 JMPF R3 #0003 - 0x50100200, // 0001 LDBOOL R4 1 0 - 0x70020000, // 0002 JMP #0004 - 0x50100000, // 0003 LDBOOL R4 0 0 - 0x58140000, // 0004 LDCONST R5 K0 - 0x6018000C, // 0005 GETGBL R6 G12 - 0x5C1C0200, // 0006 MOVE R7 R1 - 0x7C180200, // 0007 CALL R6 1 - 0x14180A06, // 0008 LT R6 R5 R6 - 0x781A0012, // 0009 JMPF R6 #001D - 0x50180000, // 000A LDBOOL R6 0 0 - 0x581C0000, // 000B LDCONST R7 K0 - 0x6020000C, // 000C GETGBL R8 G12 - 0x5C240400, // 000D MOVE R9 R2 - 0x7C200200, // 000E CALL R8 1 - 0x14200E08, // 000F LT R8 R7 R8 - 0x78220006, // 0010 JMPF R8 #0018 - 0x94200205, // 0011 GETIDX R8 R1 R5 - 0x94240407, // 0012 GETIDX R9 R2 R7 - 0x1C201009, // 0013 EQ R8 R8 R9 - 0x78220000, // 0014 JMPF R8 #0016 - 0x50180200, // 0015 LDBOOL R6 1 0 - 0x001C0F01, // 0016 ADD R7 R7 K1 - 0x7001FFF3, // 0017 JMP #000C - 0x20200806, // 0018 NE R8 R4 R6 - 0x78220000, // 0019 JMPF R8 #001B - 0x80040A00, // 001A RET 1 R5 - 0x00140B01, // 001B ADD R5 R5 K1 - 0x7001FFE7, // 001C JMP #0005 - 0x5419FFFE, // 001D LDINT R6 -1 - 0x80040C00, // 001E RET 1 R6 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_timer -********************************************************************/ -be_local_closure(set_timer, /* name */ - be_nested_proto( - 10, /* nstack */ - 4, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_string("_timers", -1694866380, 7), - /* K1 */ be_nested_string("push", -2022703139, 4), - /* K2 */ be_nested_string("Timer", -346839614, 5), - /* K3 */ be_nested_string("millis", 1214679063, 6), - }), - (be_nested_const_str("set_timer", 2135414533, 9)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[16]) { /* code */ - 0x88100100, // 0000 GETMBR R4 R0 K0 - 0x74120002, // 0001 JMPT R4 #0005 - 0x60100012, // 0002 GETGBL R4 G18 - 0x7C100000, // 0003 CALL R4 0 - 0x90020004, // 0004 SETMBR R0 K0 R4 - 0x88100100, // 0005 GETMBR R4 R0 K0 - 0x8C100901, // 0006 GETMET R4 R4 K1 - 0xB81A0400, // 0007 GETNGBL R6 K2 - 0x8C1C0103, // 0008 GETMET R7 R0 K3 - 0x5C240200, // 0009 MOVE R9 R1 - 0x7C1C0400, // 000A CALL R7 2 - 0x5C200400, // 000B MOVE R8 R2 - 0x5C240600, // 000C MOVE R9 R3 - 0x7C180600, // 000D CALL R6 3 - 0x7C100400, // 000E CALL R4 2 - 0x80000000, // 000F RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: add_rule -********************************************************************/ -be_local_closure(add_rule, /* name */ - be_nested_proto( - 9, /* nstack */ - 3, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_string("_rules", -28750191, 6), - /* K1 */ be_nested_string("function", -1630125495, 8), - /* K2 */ be_nested_string("push", -2022703139, 4), - /* K3 */ be_nested_string("kv", 1497177492, 2), - /* K4 */ be_nested_string("value_error", 773297791, 11), - /* K5 */ be_nested_string("the second argument is not a function", -340392827, 37), - }), - (be_nested_const_str("add_rule", 596540743, 8)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[20]) { /* code */ - 0x880C0100, // 0000 GETMBR R3 R0 K0 - 0x740E0002, // 0001 JMPT R3 #0005 - 0x600C0012, // 0002 GETGBL R3 G18 - 0x7C0C0000, // 0003 CALL R3 0 - 0x90020003, // 0004 SETMBR R0 K0 R3 - 0x600C0004, // 0005 GETGBL R3 G4 - 0x5C100400, // 0006 MOVE R4 R2 - 0x7C0C0200, // 0007 CALL R3 1 - 0x1C0C0701, // 0008 EQ R3 R3 K1 - 0x780E0007, // 0009 JMPF R3 #0012 - 0x880C0100, // 000A GETMBR R3 R0 K0 - 0x8C0C0702, // 000B GETMET R3 R3 K2 - 0x8C140103, // 000C GETMET R5 R0 K3 - 0x5C1C0200, // 000D MOVE R7 R1 - 0x5C200400, // 000E MOVE R8 R2 - 0x7C140600, // 000F CALL R5 3 - 0x7C0C0400, // 0010 CALL R3 2 - 0x70020000, // 0011 JMP #0013 - 0xB0060905, // 0012 RAISE 1 K4 K5 - 0x80000000, // 0013 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: run_deferred -********************************************************************/ -be_local_closure(run_deferred, /* name */ - be_nested_proto( - 6, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_string("_timers", -1694866380, 7), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_string("size", 597743964, 4), - /* K3 */ be_nested_string("time_reached", 2075136773, 12), - /* K4 */ be_nested_string("due", -399437003, 3), - /* K5 */ be_nested_string("f", -485742695, 1), - /* K6 */ be_nested_string("remove", -611183107, 6), - /* K7 */ be_const_int(1), - }), - (be_nested_const_str("run_deferred", 371594696, 12)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[27]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x78060017, // 0001 JMPF R1 #001A - 0x58040001, // 0002 LDCONST R1 K1 - 0x88080100, // 0003 GETMBR R2 R0 K0 - 0x8C080502, // 0004 GETMET R2 R2 K2 - 0x7C080200, // 0005 CALL R2 1 - 0x14080202, // 0006 LT R2 R1 R2 - 0x780A0011, // 0007 JMPF R2 #001A - 0x8C080103, // 0008 GETMET R2 R0 K3 - 0x88100100, // 0009 GETMBR R4 R0 K0 - 0x94100801, // 000A GETIDX R4 R4 R1 - 0x88100904, // 000B GETMBR R4 R4 K4 - 0x7C080400, // 000C CALL R2 2 - 0x780A0009, // 000D JMPF R2 #0018 - 0x88080100, // 000E GETMBR R2 R0 K0 - 0x94080401, // 000F GETIDX R2 R2 R1 - 0x88080505, // 0010 GETMBR R2 R2 K5 - 0x880C0100, // 0011 GETMBR R3 R0 K0 - 0x8C0C0706, // 0012 GETMET R3 R3 K6 - 0x5C140200, // 0013 MOVE R5 R1 - 0x7C0C0400, // 0014 CALL R3 2 - 0x5C0C0400, // 0015 MOVE R3 R2 - 0x7C0C0000, // 0016 CALL R3 0 - 0x70020000, // 0017 JMP #0019 - 0x00040307, // 0018 ADD R1 R1 K7 - 0x7001FFE8, // 0019 JMP #0003 - 0x80000000, // 001A RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: cmd -********************************************************************/ -be_local_closure(cmd, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("cmd_res", 921166762, 7), - /* K1 */ be_nested_string("_cmd", -875145154, 4), - }), - (be_nested_const_str("cmd", -158181397, 3)), - (be_nested_const_str("tasmota.be", 1128870755, 10)), - ( &(const binstruction[14]) { /* code */ - 0x50080200, // 0000 LDBOOL R2 1 0 - 0x90020002, // 0001 SETMBR R0 K0 R2 - 0x8C080101, // 0002 GETMET R2 R0 K1 - 0x5C100200, // 0003 MOVE R4 R1 - 0x7C080400, // 0004 CALL R2 2 - 0x4C080000, // 0005 LDNIL R2 - 0x880C0100, // 0006 GETMBR R3 R0 K0 - 0x50100200, // 0007 LDBOOL R4 1 0 - 0x200C0604, // 0008 NE R3 R3 R4 - 0x780E0000, // 0009 JMPF R3 #000B - 0x88080100, // 000A GETMBR R2 R0 K0 - 0x4C0C0000, // 000B LDNIL R3 - 0x90020003, // 000C SETMBR R0 K0 R3 - 0x80040400, // 000D RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: time_str -********************************************************************/ -be_local_closure(time_str, /* name */ - be_nested_proto( - 13, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[10]) { /* constants */ - /* K0 */ be_nested_string("string", 398550328, 6), - /* K1 */ be_nested_string("time_dump", -964556549, 9), - /* K2 */ be_nested_string("format", -1180859054, 6), - /* K3 */ be_nested_string("%04d-%02d-%02dT%02d:%02d:%02d", -869438695, 29), - /* K4 */ be_nested_string("year", -1367388900, 4), - /* K5 */ be_nested_string("month", -696646139, 5), - /* K6 */ be_nested_string("day", -464576003, 3), - /* K7 */ be_nested_string("hour", -1241306097, 4), - /* K8 */ be_nested_string("min", -913357481, 3), - /* K9 */ be_nested_string("sec", -1155074638, 3), - }), - (be_nested_const_str("time_str", -1681139684, 8)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[14]) { /* code */ - 0xA40A0000, // 0000 IMPORT R2 K0 - 0x8C0C0101, // 0001 GETMET R3 R0 K1 - 0x5C140200, // 0002 MOVE R5 R1 - 0x7C0C0400, // 0003 CALL R3 2 - 0x8C100502, // 0004 GETMET R4 R2 K2 - 0x58180003, // 0005 LDCONST R6 K3 - 0x941C0704, // 0006 GETIDX R7 R3 K4 - 0x94200705, // 0007 GETIDX R8 R3 K5 - 0x94240706, // 0008 GETIDX R9 R3 K6 - 0x94280707, // 0009 GETIDX R10 R3 K7 - 0x942C0708, // 000A GETIDX R11 R3 K8 - 0x94300709, // 000B GETIDX R12 R3 K9 - 0x7C101000, // 000C CALL R4 8 - 0x80040800, // 000D RET 1 R4 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: load -********************************************************************/ -be_local_closure(load, /* name */ - be_nested_proto( - 21, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 1, /* has sup protos */ - ( &(const struct bproto*[ 2]) { - be_nested_proto( - 6, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_literal("sys"), - /* K1 */ be_nested_str_literal("path"), - /* K2 */ be_nested_str_literal("find"), - /* K3 */ be_nested_str_literal("push"), - }), - (be_nested_const_str("push_path", 1155254157, 9)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[13]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080301, // 0001 GETMET R2 R1 K1 - 0x7C080200, // 0002 CALL R2 1 - 0x8C0C0502, // 0003 GETMET R3 R2 K2 - 0x5C140000, // 0004 MOVE R5 R0 - 0x7C0C0400, // 0005 CALL R3 2 - 0x4C100000, // 0006 LDNIL R4 - 0x1C0C0604, // 0007 EQ R3 R3 R4 - 0x780E0002, // 0008 JMPF R3 #000C - 0x8C0C0503, // 0009 GETMET R3 R2 K3 - 0x5C140000, // 000A MOVE R5 R0 - 0x7C0C0400, // 000B CALL R3 2 - 0x80000000, // 000C RET 0 - }) - ), - be_nested_proto( - 7, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_literal("sys"), - /* K1 */ be_nested_str_literal("path"), - /* K2 */ be_nested_str_literal("find"), - /* K3 */ be_nested_str_literal("remove"), - }), - (be_nested_const_str("pop_path", -1891723298, 8)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[13]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080301, // 0001 GETMET R2 R1 K1 - 0x7C080200, // 0002 CALL R2 1 - 0x8C0C0502, // 0003 GETMET R3 R2 K2 - 0x5C140000, // 0004 MOVE R5 R0 - 0x7C0C0400, // 0005 CALL R3 2 - 0x4C100000, // 0006 LDNIL R4 - 0x20100604, // 0007 NE R4 R3 R4 - 0x78120002, // 0008 JMPF R4 #000C - 0x8C100503, // 0009 GETMET R4 R2 K3 - 0x5C180600, // 000A MOVE R6 R3 - 0x7C100400, // 000B CALL R4 2 - 0x80000000, // 000C RET 0 - }) - ), - }), - 1, /* has constants */ - ( &(const bvalue[21]) { /* constants */ - /* K0 */ be_nested_str_literal("string"), - /* K1 */ be_nested_str_literal("path"), - /* K2 */ be_const_int(0), - /* K3 */ be_nested_str_literal("/"), - /* K4 */ be_nested_str_literal("split"), - /* K5 */ be_nested_str_literal("#"), - /* K6 */ be_const_int(1), - /* K7 */ be_nested_str_literal("find"), - /* K8 */ be_nested_str_literal("."), - /* K9 */ be_nested_str_literal(".be"), - /* K10 */ be_nested_str_literal(".bec"), - /* K11 */ be_nested_str_literal("io_error"), - /* K12 */ be_nested_str_literal("file extension is not '.be' or '.bec'"), - /* K13 */ be_nested_str_literal("last_modified"), - /* K14 */ be_nested_str_literal("c"), - /* K15 */ be_nested_str_literal("wd"), - /* K16 */ be_nested_str_literal(""), - /* K17 */ be_nested_str_literal("file"), - /* K18 */ be_nested_str_literal("save"), - /* K19 */ be_nested_str_literal("format"), - /* K20 */ be_nested_str_literal("BRY: could not save compiled file %s (%s)"), - }), - (be_nested_const_str("load", -435725847, 4)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[121]) { /* code */ - 0x84080000, // 0000 CLOSURE R2 P0 - 0x840C0001, // 0001 CLOSURE R3 P1 - 0xA4120000, // 0002 IMPORT R4 K0 - 0xA4160200, // 0003 IMPORT R5 K1 - 0x6018000C, // 0004 GETGBL R6 G12 - 0x5C1C0200, // 0005 MOVE R7 R1 - 0x7C180200, // 0006 CALL R6 1 - 0x1C180D02, // 0007 EQ R6 R6 K2 - 0x781A0001, // 0008 JMPF R6 #000B - 0x50180000, // 0009 LDBOOL R6 0 0 - 0x80040C00, // 000A RET 1 R6 - 0x94180302, // 000B GETIDX R6 R1 K2 - 0x20180D03, // 000C NE R6 R6 K3 - 0x781A0000, // 000D JMPF R6 #000F - 0x00060601, // 000E ADD R1 K3 R1 - 0x8C180904, // 000F GETMET R6 R4 K4 - 0x5C200200, // 0010 MOVE R8 R1 - 0x58240005, // 0011 LDCONST R9 K5 - 0x7C180600, // 0012 CALL R6 3 - 0x941C0D02, // 0013 GETIDX R7 R6 K2 - 0x5421FFFE, // 0014 LDINT R8 -1 - 0x94200C08, // 0015 GETIDX R8 R6 R8 - 0x6024000C, // 0016 GETGBL R9 G12 - 0x5C280C00, // 0017 MOVE R10 R6 - 0x7C240200, // 0018 CALL R9 1 - 0x24241306, // 0019 GT R9 R9 K6 - 0x8C280907, // 001A GETMET R10 R4 K7 - 0x5C301000, // 001B MOVE R12 R8 - 0x58340008, // 001C LDCONST R13 K8 - 0x7C280600, // 001D CALL R10 3 - 0x14281502, // 001E LT R10 R10 K2 - 0x782A0001, // 001F JMPF R10 #0022 - 0x00040309, // 0020 ADD R1 R1 K9 - 0x00201109, // 0021 ADD R8 R8 K9 - 0x5429FFFC, // 0022 LDINT R10 -3 - 0x542DFFFE, // 0023 LDINT R11 -1 - 0x4028140B, // 0024 CONNECT R10 R10 R11 - 0x9428100A, // 0025 GETIDX R10 R8 R10 - 0x1C281509, // 0026 EQ R10 R10 K9 - 0x542DFFFB, // 0027 LDINT R11 -4 - 0x5431FFFE, // 0028 LDINT R12 -1 - 0x402C160C, // 0029 CONNECT R11 R11 R12 - 0x942C100B, // 002A GETIDX R11 R8 R11 - 0x1C2C170A, // 002B EQ R11 R11 K10 - 0x5C301400, // 002C MOVE R12 R10 - 0x74320002, // 002D JMPT R12 #0031 - 0x5C301600, // 002E MOVE R12 R11 - 0x74320000, // 002F JMPT R12 #0031 - 0xB006170C, // 0030 RAISE 1 K11 K12 - 0x8C300B0D, // 0031 GETMET R12 R5 K13 - 0x5C380E00, // 0032 MOVE R14 R7 - 0x7C300400, // 0033 CALL R12 2 - 0x782E0005, // 0034 JMPF R11 #003B - 0x4C340000, // 0035 LDNIL R13 - 0x1C34180D, // 0036 EQ R13 R12 R13 - 0x78360001, // 0037 JMPF R13 #003A - 0x50340000, // 0038 LDBOOL R13 0 0 - 0x80041A00, // 0039 RET 1 R13 - 0x70020013, // 003A JMP #004F - 0x8C340B0D, // 003B GETMET R13 R5 K13 - 0x003C030E, // 003C ADD R15 R1 K14 - 0x7C340400, // 003D CALL R13 2 - 0x4C380000, // 003E LDNIL R14 - 0x1C38180E, // 003F EQ R14 R12 R14 - 0x783A0004, // 0040 JMPF R14 #0046 - 0x4C380000, // 0041 LDNIL R14 - 0x1C381A0E, // 0042 EQ R14 R13 R14 - 0x783A0001, // 0043 JMPF R14 #0046 - 0x50380000, // 0044 LDBOOL R14 0 0 - 0x80041C00, // 0045 RET 1 R14 - 0x4C380000, // 0046 LDNIL R14 - 0x20381A0E, // 0047 NE R14 R13 R14 - 0x783A0005, // 0048 JMPF R14 #004F - 0x4C380000, // 0049 LDNIL R14 - 0x1C38180E, // 004A EQ R14 R12 R14 - 0x743A0001, // 004B JMPT R14 #004E - 0x28381A0C, // 004C GE R14 R13 R12 - 0x783A0000, // 004D JMPF R14 #004F - 0x502C0200, // 004E LDBOOL R11 1 0 - 0x78260005, // 004F JMPF R9 #0056 - 0x00340F05, // 0050 ADD R13 R7 K5 - 0x90021E0D, // 0051 SETMBR R0 K15 R13 - 0x5C340400, // 0052 MOVE R13 R2 - 0x8838010F, // 0053 GETMBR R14 R0 K15 - 0x7C340200, // 0054 CALL R13 1 - 0x70020000, // 0055 JMP #0057 - 0x90021F10, // 0056 SETMBR R0 K15 K16 - 0x6034000D, // 0057 GETGBL R13 G13 - 0x5C380200, // 0058 MOVE R14 R1 - 0x583C0011, // 0059 LDCONST R15 K17 - 0x7C340400, // 005A CALL R13 2 - 0x5C381600, // 005B MOVE R14 R11 - 0x743A0013, // 005C JMPT R14 #0071 - 0x5C381200, // 005D MOVE R14 R9 - 0x743A0011, // 005E JMPT R14 #0071 - 0xA8020005, // 005F EXBLK 0 #0066 - 0x8C380112, // 0060 GETMET R14 R0 K18 - 0x0040030E, // 0061 ADD R16 R1 K14 - 0x5C441A00, // 0062 MOVE R17 R13 - 0x7C380600, // 0063 CALL R14 3 - 0xA8040001, // 0064 EXBLK 1 1 - 0x7002000A, // 0065 JMP #0071 - 0xAC380001, // 0066 CATCH R14 0 1 - 0x70020007, // 0067 JMP #0070 - 0x603C0001, // 0068 GETGBL R15 G1 - 0x8C400913, // 0069 GETMET R16 R4 K19 - 0x58480014, // 006A LDCONST R18 K20 - 0x004C030E, // 006B ADD R19 R1 K14 - 0x5C501C00, // 006C MOVE R20 R14 - 0x7C400800, // 006D CALL R16 4 - 0x7C3C0200, // 006E CALL R15 1 - 0x70020000, // 006F JMP #0071 - 0xB0080000, // 0070 RAISE 2 R0 R0 - 0x5C381A00, // 0071 MOVE R14 R13 - 0x7C380000, // 0072 CALL R14 0 - 0x78260002, // 0073 JMPF R9 #0077 - 0x5C380600, // 0074 MOVE R14 R3 - 0x003C0F05, // 0075 ADD R15 R7 K5 - 0x7C380200, // 0076 CALL R14 1 - 0x50380200, // 0077 LDBOOL R14 1 0 - 0x80041C00, // 0078 RET 1 R14 + &be_const_str_gc, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080302, // 0003 GETMET R2 R1 K2 + 0x7C080200, // 0004 CALL R2 1 + 0x80040400, // 0005 RET 1 R2 }) ) ); @@ -1100,7 +128,7 @@ be_local_closure(load, /* name */ /******************************************************************** ** Solidified function: find_op ********************************************************************/ -be_local_closure(find_op, /* name */ +be_local_closure(Tasmota_find_op, /* name */ be_nested_proto( 13, /* nstack */ 2, /* argc */ @@ -1111,357 +139,58 @@ be_local_closure(find_op, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_string("string", 398550328, 6), - /* K1 */ be_nested_string("=<>!", -1630497019, 4), - /* K2 */ be_nested_string("chars_in_string", -1146182164, 15), + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(_X3D_X3C_X3E_X21), + /* K2 */ be_nested_str(chars_in_string), /* K3 */ be_const_int(0), - /* K4 */ be_nested_string("split", -2017972765, 5), + /* K4 */ be_nested_str(split), /* K5 */ be_const_int(1), }), - (be_nested_const_str("find_op", -528253920, 7)), - ((bstring*) &be_const_str_input), + &be_const_str_find_op, + &be_const_str_solidified, ( &(const binstruction[42]) { /* code */ - 0xA40A0000, // 0000 IMPORT R2 K0 - 0x580C0001, // 0001 LDCONST R3 K1 - 0x8C100102, // 0002 GETMET R4 R0 K2 - 0x5C180200, // 0003 MOVE R6 R1 - 0x5C1C0600, // 0004 MOVE R7 R3 - 0x7C100600, // 0005 CALL R4 3 - 0x28140903, // 0006 GE R5 R4 K3 - 0x78160019, // 0007 JMPF R5 #0022 - 0x8C140504, // 0008 GETMET R5 R2 K4 - 0x5C1C0200, // 0009 MOVE R7 R1 - 0x5C200800, // 000A MOVE R8 R4 - 0x7C140600, // 000B CALL R5 3 - 0x94180B03, // 000C GETIDX R6 R5 K3 - 0x941C0B05, // 000D GETIDX R7 R5 K5 - 0x8C200102, // 000E GETMET R8 R0 K2 - 0x5C280E00, // 000F MOVE R10 R7 - 0x5C2C0600, // 0010 MOVE R11 R3 - 0x50300200, // 0011 LDBOOL R12 1 0 - 0x7C200800, // 0012 CALL R8 4 - 0x5C101000, // 0013 MOVE R4 R8 - 0x28200903, // 0014 GE R8 R4 K3 - 0x7822000B, // 0015 JMPF R8 #0022 - 0x8C200504, // 0016 GETMET R8 R2 K4 - 0x5C280E00, // 0017 MOVE R10 R7 - 0x5C2C0800, // 0018 MOVE R11 R4 - 0x7C200600, // 0019 CALL R8 3 - 0x94241103, // 001A GETIDX R9 R8 K3 - 0x94281105, // 001B GETIDX R10 R8 K5 - 0x602C0012, // 001C GETGBL R11 G18 - 0x7C2C0000, // 001D CALL R11 0 - 0x40301606, // 001E CONNECT R12 R11 R6 - 0x40301609, // 001F CONNECT R12 R11 R9 - 0x4030160A, // 0020 CONNECT R12 R11 R10 - 0x80041600, // 0021 RET 1 R11 - 0x60140012, // 0022 GETGBL R5 G18 - 0x7C140000, // 0023 CALL R5 0 - 0x40180A01, // 0024 CONNECT R6 R5 R1 - 0x4C180000, // 0025 LDNIL R6 - 0x40180A06, // 0026 CONNECT R6 R5 R6 - 0x4C180000, // 0027 LDNIL R6 - 0x40180A06, // 0028 CONNECT R6 R5 R6 - 0x80040A00, // 0029 RET 1 R5 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: remove_timer -********************************************************************/ -be_local_closure(remove_timer, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_string("tasmota", 424643812, 7), - /* K1 */ be_nested_string("_timers", -1694866380, 7), - /* K2 */ be_const_int(0), - /* K3 */ be_nested_string("size", 597743964, 4), - /* K4 */ be_nested_string("id", 926444256, 2), - /* K5 */ be_nested_string("remove", -611183107, 6), - /* K6 */ be_const_int(1), - }), - (be_nested_const_str("remove_timer", -153495081, 12)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[23]) { /* code */ - 0xB80A0000, // 0000 GETNGBL R2 K0 - 0x88080501, // 0001 GETMBR R2 R2 K1 - 0x780A0012, // 0002 JMPF R2 #0016 - 0x58080002, // 0003 LDCONST R2 K2 - 0xB80E0000, // 0004 GETNGBL R3 K0 - 0x880C0701, // 0005 GETMBR R3 R3 K1 - 0x8C0C0703, // 0006 GETMET R3 R3 K3 - 0x7C0C0200, // 0007 CALL R3 1 - 0x140C0403, // 0008 LT R3 R2 R3 - 0x780E000B, // 0009 JMPF R3 #0016 - 0x880C0101, // 000A GETMBR R3 R0 K1 - 0x940C0602, // 000B GETIDX R3 R3 R2 - 0x880C0704, // 000C GETMBR R3 R3 K4 - 0x1C0C0601, // 000D EQ R3 R3 R1 - 0x780E0004, // 000E JMPF R3 #0014 - 0x880C0101, // 000F GETMBR R3 R0 K1 - 0x8C0C0705, // 0010 GETMET R3 R3 K5 - 0x5C140400, // 0011 MOVE R5 R2 - 0x7C0C0400, // 0012 CALL R3 2 - 0x70020000, // 0013 JMP #0015 - 0x00080506, // 0014 ADD R2 R2 K6 - 0x7001FFED, // 0015 JMP #0004 - 0x80000000, // 0016 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_light -********************************************************************/ -be_local_closure(get_light, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("tasmota.get_light() is deprecated, use light.get()", -769213649, 50), - /* K1 */ be_nested_string("light", -493019601, 5), - /* K2 */ be_nested_string("get", 1410115415, 3), - }), - (be_nested_const_str("get_light", 381930476, 9)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[16]) { /* code */ - 0x60080001, // 0000 GETGBL R2 G1 - 0x580C0000, // 0001 LDCONST R3 K0 - 0x7C080200, // 0002 CALL R2 1 - 0xA40A0200, // 0003 IMPORT R2 K1 - 0x4C0C0000, // 0004 LDNIL R3 - 0x200C0203, // 0005 NE R3 R1 R3 - 0x780E0004, // 0006 JMPF R3 #000C - 0x8C0C0502, // 0007 GETMET R3 R2 K2 - 0x5C140200, // 0008 MOVE R5 R1 - 0x7C0C0400, // 0009 CALL R3 2 - 0x80040600, // 000A RET 1 R3 - 0x70020002, // 000B JMP #000F - 0x8C0C0502, // 000C GETMET R3 R2 K2 - 0x7C0C0200, // 000D CALL R3 1 - 0x80040600, // 000E RET 1 R3 - 0x80000000, // 000F RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: exec_rules -********************************************************************/ -be_local_closure(exec_rules, /* name */ - be_nested_proto( - 12, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[12]) { /* constants */ - /* K0 */ be_nested_string("_rules", -28750191, 6), - /* K1 */ be_nested_string("cmd_res", 921166762, 7), - /* K2 */ be_nested_string("json", 916562499, 4), - /* K3 */ be_nested_string("load", -435725847, 4), - /* K4 */ be_nested_string("log", 1062293841, 3), - /* K5 */ be_nested_string("BRY: ERROR, bad json: ", -1579831487, 22), - /* K6 */ be_const_int(3), - /* K7 */ be_const_int(0), - /* K8 */ be_nested_string("try_rule", 1986449405, 8), - /* K9 */ be_nested_string("k", -301188886, 1), - /* K10 */ be_nested_string("v", -217300791, 1), - /* K11 */ be_const_int(1), - }), - (be_nested_const_str("exec_rules", 1445221092, 10)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[48]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x740A0003, // 0001 JMPT R2 #0006 - 0x88080101, // 0002 GETMBR R2 R0 K1 - 0x4C0C0000, // 0003 LDNIL R3 - 0x20080403, // 0004 NE R2 R2 R3 - 0x780A0027, // 0005 JMPF R2 #002E - 0xA40A0400, // 0006 IMPORT R2 K2 - 0x8C0C0503, // 0007 GETMET R3 R2 K3 - 0x5C140200, // 0008 MOVE R5 R1 - 0x7C0C0400, // 0009 CALL R3 2 - 0x50100000, // 000A LDBOOL R4 0 0 - 0x4C140000, // 000B LDNIL R5 - 0x1C140605, // 000C EQ R5 R3 R5 - 0x78160004, // 000D JMPF R5 #0013 - 0x8C140104, // 000E GETMET R5 R0 K4 - 0x001E0A01, // 000F ADD R7 K5 R1 - 0x58200006, // 0010 LDCONST R8 K6 - 0x7C140600, // 0011 CALL R5 3 - 0x5C0C0200, // 0012 MOVE R3 R1 - 0x88140101, // 0013 GETMBR R5 R0 K1 - 0x4C180000, // 0014 LDNIL R6 - 0x20140A06, // 0015 NE R5 R5 R6 - 0x78160000, // 0016 JMPF R5 #0018 - 0x90020203, // 0017 SETMBR R0 K1 R3 - 0x88140100, // 0018 GETMBR R5 R0 K0 - 0x78160012, // 0019 JMPF R5 #002D - 0x58140007, // 001A LDCONST R5 K7 - 0x6018000C, // 001B GETGBL R6 G12 - 0x881C0100, // 001C GETMBR R7 R0 K0 - 0x7C180200, // 001D CALL R6 1 - 0x14180A06, // 001E LT R6 R5 R6 - 0x781A000C, // 001F JMPF R6 #002D - 0x88180100, // 0020 GETMBR R6 R0 K0 - 0x94180C05, // 0021 GETIDX R6 R6 R5 - 0x8C1C0108, // 0022 GETMET R7 R0 K8 - 0x5C240600, // 0023 MOVE R9 R3 - 0x88280D09, // 0024 GETMBR R10 R6 K9 - 0x882C0D0A, // 0025 GETMBR R11 R6 K10 - 0x7C1C0800, // 0026 CALL R7 4 - 0x741E0001, // 0027 JMPT R7 #002A - 0x74120000, // 0028 JMPT R4 #002A - 0x50100001, // 0029 LDBOOL R4 0 1 - 0x50100200, // 002A LDBOOL R4 1 0 - 0x00140B0B, // 002B ADD R5 R5 K11 - 0x7001FFED, // 002C JMP #001B - 0x80040800, // 002D RET 1 R4 - 0x50080000, // 002E LDBOOL R2 0 0 - 0x80040400, // 002F RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: exec_tele -********************************************************************/ -be_local_closure(exec_tele, /* name */ - be_nested_proto( - 12, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[12]) { /* constants */ - /* K0 */ be_nested_string("_rules", -28750191, 6), - /* K1 */ be_nested_string("json", 916562499, 4), - /* K2 */ be_nested_string("load", -435725847, 4), - /* K3 */ be_nested_string("log", 1062293841, 3), - /* K4 */ be_nested_string("BRY: ERROR, bad json: ", -1579831487, 22), - /* K5 */ be_const_int(3), - /* K6 */ be_nested_string("Tele", 1329980653, 4), - /* K7 */ be_const_int(0), - /* K8 */ be_nested_string("try_rule", 1986449405, 8), - /* K9 */ be_nested_string("k", -301188886, 1), - /* K10 */ be_nested_string("v", -217300791, 1), - /* K11 */ be_const_int(1), - }), - (be_nested_const_str("exec_tele", 1020751601, 9)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[41]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x780A0024, // 0001 JMPF R2 #0027 - 0xA40A0200, // 0002 IMPORT R2 K1 - 0x8C0C0502, // 0003 GETMET R3 R2 K2 - 0x5C140200, // 0004 MOVE R5 R1 - 0x7C0C0400, // 0005 CALL R3 2 - 0x50100000, // 0006 LDBOOL R4 0 0 - 0x4C140000, // 0007 LDNIL R5 - 0x1C140605, // 0008 EQ R5 R3 R5 - 0x78160004, // 0009 JMPF R5 #000F - 0x8C140103, // 000A GETMET R5 R0 K3 - 0x001E0801, // 000B ADD R7 K4 R1 - 0x58200005, // 000C LDCONST R8 K5 - 0x7C140600, // 000D CALL R5 3 - 0x5C0C0200, // 000E MOVE R3 R1 - 0x60140013, // 000F GETGBL R5 G19 - 0x7C140000, // 0010 CALL R5 0 - 0x98160C03, // 0011 SETIDX R5 K6 R3 - 0x5C0C0A00, // 0012 MOVE R3 R5 - 0x58140007, // 0013 LDCONST R5 K7 - 0x6018000C, // 0014 GETGBL R6 G12 - 0x881C0100, // 0015 GETMBR R7 R0 K0 - 0x7C180200, // 0016 CALL R6 1 - 0x14180A06, // 0017 LT R6 R5 R6 - 0x781A000C, // 0018 JMPF R6 #0026 - 0x88180100, // 0019 GETMBR R6 R0 K0 - 0x94180C05, // 001A GETIDX R6 R6 R5 - 0x8C1C0108, // 001B GETMET R7 R0 K8 - 0x5C240600, // 001C MOVE R9 R3 - 0x88280D09, // 001D GETMBR R10 R6 K9 - 0x882C0D0A, // 001E GETMBR R11 R6 K10 - 0x7C1C0800, // 001F CALL R7 4 - 0x741E0001, // 0020 JMPT R7 #0023 - 0x74120000, // 0021 JMPT R4 #0023 - 0x50100001, // 0022 LDBOOL R4 0 1 - 0x50100200, // 0023 LDBOOL R4 1 0 - 0x00140B0B, // 0024 ADD R5 R5 K11 - 0x7001FFED, // 0025 JMP #0014 - 0x80040800, // 0026 RET 1 R4 - 0x50080000, // 0027 LDBOOL R2 0 0 - 0x80040400, // 0028 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: remove_driver -********************************************************************/ -be_local_closure(remove_driver, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("_drivers", -1034638311, 8), - /* K1 */ be_nested_string("find", -1108310694, 4), - /* K2 */ be_nested_string("pop", 1362321360, 3), - }), - (be_nested_const_str("remove_driver", 1030243768, 13)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[14]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x780A000A, // 0001 JMPF R2 #000D - 0x88080100, // 0002 GETMBR R2 R0 K0 - 0x8C080501, // 0003 GETMET R2 R2 K1 - 0x5C100200, // 0004 MOVE R4 R1 - 0x7C080400, // 0005 CALL R2 2 - 0x4C0C0000, // 0006 LDNIL R3 - 0x200C0403, // 0007 NE R3 R2 R3 - 0x780E0003, // 0008 JMPF R3 #000D - 0x880C0100, // 0009 GETMBR R3 R0 K0 - 0x8C0C0702, // 000A GETMET R3 R3 K2 - 0x5C140400, // 000B MOVE R5 R2 - 0x7C0C0400, // 000C CALL R3 2 - 0x80000000, // 000D RET 0 + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x580C0001, // 0001 LDCONST R3 K1 + 0x8C100102, // 0002 GETMET R4 R0 K2 + 0x5C180200, // 0003 MOVE R6 R1 + 0x5C1C0600, // 0004 MOVE R7 R3 + 0x7C100600, // 0005 CALL R4 3 + 0x28140903, // 0006 GE R5 R4 K3 + 0x78160019, // 0007 JMPF R5 #0022 + 0x8C140504, // 0008 GETMET R5 R2 K4 + 0x5C1C0200, // 0009 MOVE R7 R1 + 0x5C200800, // 000A MOVE R8 R4 + 0x7C140600, // 000B CALL R5 3 + 0x94180B03, // 000C GETIDX R6 R5 K3 + 0x941C0B05, // 000D GETIDX R7 R5 K5 + 0x8C200102, // 000E GETMET R8 R0 K2 + 0x5C280E00, // 000F MOVE R10 R7 + 0x5C2C0600, // 0010 MOVE R11 R3 + 0x50300200, // 0011 LDBOOL R12 1 0 + 0x7C200800, // 0012 CALL R8 4 + 0x5C101000, // 0013 MOVE R4 R8 + 0x28200903, // 0014 GE R8 R4 K3 + 0x7822000B, // 0015 JMPF R8 #0022 + 0x8C200504, // 0016 GETMET R8 R2 K4 + 0x5C280E00, // 0017 MOVE R10 R7 + 0x5C2C0800, // 0018 MOVE R11 R4 + 0x7C200600, // 0019 CALL R8 3 + 0x94241103, // 001A GETIDX R9 R8 K3 + 0x94281105, // 001B GETIDX R10 R8 K5 + 0x602C0012, // 001C GETGBL R11 G18 + 0x7C2C0000, // 001D CALL R11 0 + 0x40301606, // 001E CONNECT R12 R11 R6 + 0x40301609, // 001F CONNECT R12 R11 R9 + 0x4030160A, // 0020 CONNECT R12 R11 R10 + 0x80041600, // 0021 RET 1 R11 + 0x60140012, // 0022 GETGBL R5 G18 + 0x7C140000, // 0023 CALL R5 0 + 0x40180A01, // 0024 CONNECT R6 R5 R1 + 0x4C180000, // 0025 LDNIL R6 + 0x40180A06, // 0026 CONNECT R6 R5 R6 + 0x4C180000, // 0027 LDNIL R6 + 0x40180A06, // 0028 CONNECT R6 R5 R6 + 0x80040A00, // 0029 RET 1 R5 }) ) ); @@ -1471,7 +200,7 @@ be_local_closure(remove_driver, /* name */ /******************************************************************** ** Solidified function: try_rule ********************************************************************/ -be_local_closure(try_rule, /* name */ +be_local_closure(Tasmota_try_rule, /* name */ be_nested_proto( 15, /* nstack */ 4, /* argc */ @@ -1482,25 +211,25 @@ be_local_closure(try_rule, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[16]) { /* constants */ - /* K0 */ be_nested_string("string", 398550328, 6), - /* K1 */ be_nested_string("find_op", -528253920, 7), - /* K2 */ be_nested_string("split", -2017972765, 5), + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(find_op), + /* K2 */ be_nested_str(split), /* K3 */ be_const_int(0), - /* K4 */ be_nested_string("#", 638357778, 1), - /* K5 */ be_nested_string("find_key_i", 850136726, 10), + /* K4 */ be_nested_str(_X23), + /* K5 */ be_nested_str(find_key_i), /* K6 */ be_const_int(1), /* K7 */ be_const_int(2), - /* K8 */ be_nested_string("==", -1863000881, 2), - /* K9 */ be_nested_string("!==", 559817114, 3), - /* K10 */ be_nested_string("=", 940354920, 1), - /* K11 */ be_nested_string("!=", -1866252285, 2), - /* K12 */ be_nested_string(">", 990687777, 1), - /* K13 */ be_nested_string(">=", 284975636, 2), - /* K14 */ be_nested_string("<", 957132539, 1), - /* K15 */ be_nested_string("<=", -1795743310, 2), + /* K8 */ be_nested_str(_X3D_X3D), + /* K9 */ be_nested_str(_X21_X3D_X3D), + /* K10 */ be_nested_str(_X3D), + /* K11 */ be_nested_str(_X21_X3D), + /* K12 */ be_nested_str(_X3E), + /* K13 */ be_nested_str(_X3E_X3D), + /* K14 */ be_nested_str(_X3C), + /* K15 */ be_nested_str(_X3C_X3D), }), - (be_nested_const_str("try_rule", 1986449405, 8)), - ((bstring*) &be_const_str_input), + &be_const_str_try_rule, + &be_const_str_solidified, ( &(const binstruction[141]) { /* code */ 0xA4120000, // 0000 IMPORT R4 K0 0x8C140101, // 0001 GETMET R5 R0 K1 @@ -1650,46 +379,64 @@ be_local_closure(try_rule, /* name */ /******************************************************************** -** Solidified function: cb_dispatch +** Solidified function: gen_cb ********************************************************************/ -be_local_closure(cb_dispatch, /* name */ +be_local_closure(Tasmota_gen_cb, /* name */ be_nested_proto( - 12, /* nstack */ - 6, /* argc */ + 7, /* nstack */ + 2, /* argc */ 0, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("_cb", -251666929, 3), + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str(_cb), /* K1 */ be_const_int(0), - /* K2 */ be_nested_string("find", -1108310694, 4), + /* K2 */ be_nested_str(find), + /* K3 */ be_nested_str(_get_cb), + /* K4 */ be_nested_str(stop_iteration), + /* K5 */ be_nested_str(internal_error), + /* K6 */ be_nested_str(No_X20callback_X20available), }), - (be_nested_const_str("cb_dispatch", 1741510499, 11)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[20]) { /* code */ - 0x88180100, // 0000 GETMBR R6 R0 K0 - 0x4C1C0000, // 0001 LDNIL R7 - 0x1C180C07, // 0002 EQ R6 R6 R7 - 0x781A0000, // 0003 JMPF R6 #0005 - 0x80060200, // 0004 RET 1 K1 - 0x88180100, // 0005 GETMBR R6 R0 K0 - 0x8C180D02, // 0006 GETMET R6 R6 K2 - 0x5C200200, // 0007 MOVE R8 R1 - 0x7C180400, // 0008 CALL R6 2 - 0x4C1C0000, // 0009 LDNIL R7 - 0x201C0C07, // 000A NE R7 R6 R7 - 0x781E0006, // 000B JMPF R7 #0013 - 0x5C1C0C00, // 000C MOVE R7 R6 - 0x5C200400, // 000D MOVE R8 R2 - 0x5C240600, // 000E MOVE R9 R3 - 0x5C280800, // 000F MOVE R10 R4 - 0x5C2C0A00, // 0010 MOVE R11 R5 - 0x7C1C0800, // 0011 CALL R7 4 - 0x80040E00, // 0012 RET 1 R7 - 0x80060200, // 0013 RET 1 K1 + &be_const_str_gen_cb, + &be_const_str_solidified, + ( &(const binstruction[34]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0x1C080403, // 0002 EQ R2 R2 R3 + 0x780A0002, // 0003 JMPF R2 #0007 + 0x60080013, // 0004 GETGBL R2 G19 + 0x7C080000, // 0005 CALL R2 0 + 0x90020002, // 0006 SETMBR R0 K0 R2 + 0x60080010, // 0007 GETGBL R2 G16 + 0x540E0012, // 0008 LDINT R3 19 + 0x400E0203, // 0009 CONNECT R3 K1 R3 + 0x7C080200, // 000A CALL R2 1 + 0xA8020010, // 000B EXBLK 0 #001D + 0x5C0C0400, // 000C MOVE R3 R2 + 0x7C0C0000, // 000D CALL R3 0 + 0x88100100, // 000E GETMBR R4 R0 K0 + 0x8C100902, // 000F GETMET R4 R4 K2 + 0x5C180600, // 0010 MOVE R6 R3 + 0x7C100400, // 0011 CALL R4 2 + 0x4C140000, // 0012 LDNIL R5 + 0x1C100805, // 0013 EQ R4 R4 R5 + 0x78120006, // 0014 JMPF R4 #001C + 0x88100100, // 0015 GETMBR R4 R0 K0 + 0x98100601, // 0016 SETIDX R4 R3 R1 + 0x8C100103, // 0017 GETMET R4 R0 K3 + 0x5C180600, // 0018 MOVE R6 R3 + 0x7C100400, // 0019 CALL R4 2 + 0xA8040001, // 001A EXBLK 1 1 + 0x80040800, // 001B RET 1 R4 + 0x7001FFEE, // 001C JMP #000C + 0x58080004, // 001D LDCONST R2 K4 + 0xAC080200, // 001E CATCH R2 1 0 + 0xB0080000, // 001F RAISE 2 R0 R0 + 0xB0060B06, // 0020 RAISE 1 K5 K6 + 0x80000000, // 0021 RET 0 }) ) ); @@ -1697,12 +444,12 @@ be_local_closure(cb_dispatch, /* name */ /******************************************************************** -** Solidified function: gc +** Solidified function: set_light ********************************************************************/ -be_local_closure(gc, /* name */ +be_local_closure(Tasmota_set_light, /* name */ be_nested_proto( - 4, /* nstack */ - 1, /* argc */ + 8, /* nstack */ + 3, /* argc */ 0, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -1710,19 +457,208 @@ be_local_closure(gc, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_string("gc", 1042313471, 2), - /* K1 */ be_nested_string("collect", -1895928271, 7), - /* K2 */ be_nested_string("allocated", 429986098, 9), + /* K0 */ be_nested_str(tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29), + /* K1 */ be_nested_str(light), + /* K2 */ be_nested_str(set), }), - (be_nested_const_str("gc", 1042313471, 2)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[ 6]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080301, // 0001 GETMET R2 R1 K1 - 0x7C080200, // 0002 CALL R2 1 - 0x8C080302, // 0003 GETMET R2 R1 K2 - 0x7C080200, // 0004 CALL R2 1 - 0x80040400, // 0005 RET 1 R2 + &be_const_str_set_light, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x600C0001, // 0000 GETGBL R3 G1 + 0x58100000, // 0001 LDCONST R4 K0 + 0x7C0C0200, // 0002 CALL R3 1 + 0xA40E0200, // 0003 IMPORT R3 K1 + 0x4C100000, // 0004 LDNIL R4 + 0x20100404, // 0005 NE R4 R2 R4 + 0x78120005, // 0006 JMPF R4 #000D + 0x8C100702, // 0007 GETMET R4 R3 K2 + 0x5C180200, // 0008 MOVE R6 R1 + 0x5C1C0400, // 0009 MOVE R7 R2 + 0x7C100600, // 000A CALL R4 3 + 0x80040800, // 000B RET 1 R4 + 0x70020003, // 000C JMP #0011 + 0x8C100702, // 000D GETMET R4 R3 K2 + 0x5C180200, // 000E MOVE R6 R1 + 0x7C100400, // 000F CALL R4 2 + 0x80040800, // 0010 RET 1 R4 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: exec_tele +********************************************************************/ +be_local_closure(Tasmota_exec_tele, /* name */ + be_nested_proto( + 12, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str(_rules), + /* K1 */ be_nested_str(json), + /* K2 */ be_nested_str(load), + /* K3 */ be_nested_str(log), + /* K4 */ be_nested_str(BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20), + /* K5 */ be_const_int(3), + /* K6 */ be_nested_str(Tele), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str(try_rule), + /* K9 */ be_nested_str(k), + /* K10 */ be_nested_str(v), + /* K11 */ be_const_int(1), + }), + &be_const_str_exec_tele, + &be_const_str_solidified, + ( &(const binstruction[41]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A0024, // 0001 JMPF R2 #0027 + 0xA40A0200, // 0002 IMPORT R2 K1 + 0x8C0C0502, // 0003 GETMET R3 R2 K2 + 0x5C140200, // 0004 MOVE R5 R1 + 0x7C0C0400, // 0005 CALL R3 2 + 0x50100000, // 0006 LDBOOL R4 0 0 + 0x4C140000, // 0007 LDNIL R5 + 0x1C140605, // 0008 EQ R5 R3 R5 + 0x78160004, // 0009 JMPF R5 #000F + 0x8C140103, // 000A GETMET R5 R0 K3 + 0x001E0801, // 000B ADD R7 K4 R1 + 0x58200005, // 000C LDCONST R8 K5 + 0x7C140600, // 000D CALL R5 3 + 0x5C0C0200, // 000E MOVE R3 R1 + 0x60140013, // 000F GETGBL R5 G19 + 0x7C140000, // 0010 CALL R5 0 + 0x98160C03, // 0011 SETIDX R5 K6 R3 + 0x5C0C0A00, // 0012 MOVE R3 R5 + 0x58140007, // 0013 LDCONST R5 K7 + 0x6018000C, // 0014 GETGBL R6 G12 + 0x881C0100, // 0015 GETMBR R7 R0 K0 + 0x7C180200, // 0016 CALL R6 1 + 0x14180A06, // 0017 LT R6 R5 R6 + 0x781A000C, // 0018 JMPF R6 #0026 + 0x88180100, // 0019 GETMBR R6 R0 K0 + 0x94180C05, // 001A GETIDX R6 R6 R5 + 0x8C1C0108, // 001B GETMET R7 R0 K8 + 0x5C240600, // 001C MOVE R9 R3 + 0x88280D09, // 001D GETMBR R10 R6 K9 + 0x882C0D0A, // 001E GETMBR R11 R6 K10 + 0x7C1C0800, // 001F CALL R7 4 + 0x741E0001, // 0020 JMPT R7 #0023 + 0x74120000, // 0021 JMPT R4 #0023 + 0x50100001, // 0022 LDBOOL R4 0 1 + 0x50100200, // 0023 LDBOOL R4 1 0 + 0x00140B0B, // 0024 ADD R5 R5 K11 + 0x7001FFED, // 0025 JMP #0014 + 0x80040800, // 0026 RET 1 R4 + 0x50080000, // 0027 LDBOOL R2 0 0 + 0x80040400, // 0028 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: run_deferred +********************************************************************/ +be_local_closure(Tasmota_run_deferred, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str(_timers), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(size), + /* K3 */ be_nested_str(time_reached), + /* K4 */ be_nested_str(due), + /* K5 */ be_nested_str(f), + /* K6 */ be_nested_str(remove), + /* K7 */ be_const_int(1), + }), + &be_const_str_run_deferred, + &be_const_str_solidified, + ( &(const binstruction[27]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x78060017, // 0001 JMPF R1 #001A + 0x58040001, // 0002 LDCONST R1 K1 + 0x88080100, // 0003 GETMBR R2 R0 K0 + 0x8C080502, // 0004 GETMET R2 R2 K2 + 0x7C080200, // 0005 CALL R2 1 + 0x14080202, // 0006 LT R2 R1 R2 + 0x780A0011, // 0007 JMPF R2 #001A + 0x8C080103, // 0008 GETMET R2 R0 K3 + 0x88100100, // 0009 GETMBR R4 R0 K0 + 0x94100801, // 000A GETIDX R4 R4 R1 + 0x88100904, // 000B GETMBR R4 R4 K4 + 0x7C080400, // 000C CALL R2 2 + 0x780A0009, // 000D JMPF R2 #0018 + 0x88080100, // 000E GETMBR R2 R0 K0 + 0x94080401, // 000F GETIDX R2 R2 R1 + 0x88080505, // 0010 GETMBR R2 R2 K5 + 0x880C0100, // 0011 GETMBR R3 R0 K0 + 0x8C0C0706, // 0012 GETMET R3 R3 K6 + 0x5C140200, // 0013 MOVE R5 R1 + 0x7C0C0400, // 0014 CALL R3 2 + 0x5C0C0400, // 0015 MOVE R3 R2 + 0x7C0C0000, // 0016 CALL R3 0 + 0x70020000, // 0017 JMP #0019 + 0x00040307, // 0018 ADD R1 R1 K7 + 0x7001FFE8, // 0019 JMP #0003 + 0x80000000, // 001A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_driver +********************************************************************/ +be_local_closure(Tasmota_remove_driver, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(_drivers), + /* K1 */ be_nested_str(find), + /* K2 */ be_nested_str(pop), + }), + &be_const_str_remove_driver, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A000A, // 0001 JMPF R2 #000D + 0x88080100, // 0002 GETMBR R2 R0 K0 + 0x8C080501, // 0003 GETMET R2 R2 K1 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x4C0C0000, // 0006 LDNIL R3 + 0x200C0403, // 0007 NE R3 R2 R3 + 0x780E0003, // 0008 JMPF R3 #000D + 0x880C0100, // 0009 GETMBR R3 R0 K0 + 0x8C0C0702, // 000A GETMET R3 R3 K2 + 0x5C140400, // 000B MOVE R5 R2 + 0x7C0C0400, // 000C CALL R3 2 + 0x80000000, // 000D RET 0 }) ) ); @@ -1732,7 +668,7 @@ be_local_closure(gc, /* name */ /******************************************************************** ** Solidified function: event ********************************************************************/ -be_local_closure(event, /* name */ +be_local_closure(Tasmota_event, /* name */ be_nested_proto( 20, /* nstack */ 6, /* argc */ @@ -1743,32 +679,32 @@ be_local_closure(event, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[23]) { /* constants */ - /* K0 */ be_nested_string("introspect", 164638290, 10), - /* K1 */ be_nested_string("string", 398550328, 6), - /* K2 */ be_nested_string("every_50ms", -1911083288, 10), - /* K3 */ be_nested_string("run_deferred", 371594696, 12), - /* K4 */ be_nested_string("cmd", -158181397, 3), - /* K5 */ be_nested_string("exec_cmd", 493567399, 8), - /* K6 */ be_nested_string("tele", -820509235, 4), - /* K7 */ be_nested_string("exec_tele", 1020751601, 9), - /* K8 */ be_nested_string("rule", -64077613, 4), - /* K9 */ be_nested_string("exec_rules", 1445221092, 10), - /* K10 */ be_nested_string("gc", 1042313471, 2), - /* K11 */ be_nested_string("_drivers", -1034638311, 8), + /* K0 */ be_nested_str(introspect), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(every_50ms), + /* K3 */ be_nested_str(run_deferred), + /* K4 */ be_nested_str(cmd), + /* K5 */ be_nested_str(exec_cmd), + /* K6 */ be_nested_str(tele), + /* K7 */ be_nested_str(exec_tele), + /* K8 */ be_nested_str(rule), + /* K9 */ be_nested_str(exec_rules), + /* K10 */ be_nested_str(gc), + /* K11 */ be_nested_str(_drivers), /* K12 */ be_const_int(0), - /* K13 */ be_nested_string("get", 1410115415, 3), - /* K14 */ be_nested_string("function", -1630125495, 8), - /* K15 */ be_nested_string("format", -1180859054, 6), - /* K16 */ be_nested_string("BRY: Exception> '%s' - %s", -2047976332, 25), - /* K17 */ be_nested_string("debug", 1483009432, 5), - /* K18 */ be_nested_string("traceback", -909779187, 9), + /* K13 */ be_nested_str(get), + /* K14 */ be_nested_str(function), + /* K15 */ be_nested_str(format), + /* K16 */ be_nested_str(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s), + /* K17 */ be_nested_str(debug), + /* K18 */ be_nested_str(traceback), /* K19 */ be_const_int(1), - /* K20 */ be_nested_string("save_before_restart", 1253239338, 19), - /* K21 */ be_nested_string("persist", -377883517, 7), - /* K22 */ be_nested_string("save", -855671224, 4), + /* K20 */ be_nested_str(save_before_restart), + /* K21 */ be_nested_str(persist), + /* K22 */ be_nested_str(save), }), - (be_nested_const_str("event", -30355297, 5)), - ((bstring*) &be_const_str_input), + &be_const_str_event, + &be_const_str_solidified, ( &(const binstruction[91]) { /* code */ 0xA41A0000, // 0000 IMPORT R6 K0 0xA41E0200, // 0001 IMPORT R7 K1 @@ -1868,9 +804,593 @@ be_local_closure(event, /* name */ /******************************************************************** -** Solidified function: remove_cmd +** Solidified function: find_key_i ********************************************************************/ -be_local_closure(remove_cmd, /* name */ +be_local_closure(Tasmota_find_key_i, /* name */ + be_nested_proto( + 10, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(toupper), + /* K2 */ be_nested_str(keys), + /* K3 */ be_nested_str(_X3F), + /* K4 */ be_nested_str(stop_iteration), + }), + &be_const_str_find_key_i, + &be_const_str_solidified, + ( &(const binstruction[30]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0x8C100701, // 0001 GETMET R4 R3 K1 + 0x5C180400, // 0002 MOVE R6 R2 + 0x7C100400, // 0003 CALL R4 2 + 0x6014000F, // 0004 GETGBL R5 G15 + 0x5C180200, // 0005 MOVE R6 R1 + 0x601C0013, // 0006 GETGBL R7 G19 + 0x7C140400, // 0007 CALL R5 2 + 0x78160013, // 0008 JMPF R5 #001D + 0x60140010, // 0009 GETGBL R5 G16 + 0x8C180302, // 000A GETMET R6 R1 K2 + 0x7C180200, // 000B CALL R6 1 + 0x7C140200, // 000C CALL R5 1 + 0xA802000B, // 000D EXBLK 0 #001A + 0x5C180A00, // 000E MOVE R6 R5 + 0x7C180000, // 000F CALL R6 0 + 0x8C1C0701, // 0010 GETMET R7 R3 K1 + 0x5C240C00, // 0011 MOVE R9 R6 + 0x7C1C0400, // 0012 CALL R7 2 + 0x1C1C0E04, // 0013 EQ R7 R7 R4 + 0x741E0001, // 0014 JMPT R7 #0017 + 0x1C1C0503, // 0015 EQ R7 R2 K3 + 0x781E0001, // 0016 JMPF R7 #0019 + 0xA8040001, // 0017 EXBLK 1 1 + 0x80040C00, // 0018 RET 1 R6 + 0x7001FFF3, // 0019 JMP #000E + 0x58140004, // 001A LDCONST R5 K4 + 0xAC140200, // 001B CATCH R5 1 0 + 0xB0080000, // 001C RAISE 2 R0 R0 + 0x80000000, // 001D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: wire_scan +********************************************************************/ +be_local_closure(Tasmota_wire_scan, /* name */ + be_nested_proto( + 6, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(i2c_enabled), + /* K1 */ be_nested_str(wire1), + /* K2 */ be_nested_str(enabled), + /* K3 */ be_nested_str(detect), + /* K4 */ be_nested_str(wire2), + }), + &be_const_str_wire_scan, + &be_const_str_solidified, + ( &(const binstruction[33]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x200C0403, // 0001 NE R3 R2 R3 + 0x780E0005, // 0002 JMPF R3 #0009 + 0x8C0C0100, // 0003 GETMET R3 R0 K0 + 0x5C140400, // 0004 MOVE R5 R2 + 0x7C0C0400, // 0005 CALL R3 2 + 0x740E0001, // 0006 JMPT R3 #0009 + 0x4C0C0000, // 0007 LDNIL R3 + 0x80040600, // 0008 RET 1 R3 + 0x880C0101, // 0009 GETMBR R3 R0 K1 + 0x8C0C0702, // 000A GETMET R3 R3 K2 + 0x7C0C0200, // 000B CALL R3 1 + 0x780E0006, // 000C JMPF R3 #0014 + 0x880C0101, // 000D GETMBR R3 R0 K1 + 0x8C0C0703, // 000E GETMET R3 R3 K3 + 0x5C140200, // 000F MOVE R5 R1 + 0x7C0C0400, // 0010 CALL R3 2 + 0x780E0001, // 0011 JMPF R3 #0014 + 0x880C0101, // 0012 GETMBR R3 R0 K1 + 0x80040600, // 0013 RET 1 R3 + 0x880C0104, // 0014 GETMBR R3 R0 K4 + 0x8C0C0702, // 0015 GETMET R3 R3 K2 + 0x7C0C0200, // 0016 CALL R3 1 + 0x780E0006, // 0017 JMPF R3 #001F + 0x880C0104, // 0018 GETMBR R3 R0 K4 + 0x8C0C0703, // 0019 GETMET R3 R3 K3 + 0x5C140200, // 001A MOVE R5 R1 + 0x7C0C0400, // 001B CALL R3 2 + 0x780E0001, // 001C JMPF R3 #001F + 0x880C0104, // 001D GETMBR R3 R0 K4 + 0x80040600, // 001E RET 1 R3 + 0x4C0C0000, // 001F LDNIL R3 + 0x80040600, // 0020 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Tasmota_init, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[15]) { /* constants */ + /* K0 */ be_nested_str(global), + /* K1 */ be_nested_str(ctypes_bytes_dyn), + /* K2 */ be_nested_str(_global_addr), + /* K3 */ be_nested_str(_global_def), + /* K4 */ be_nested_str(introspect), + /* K5 */ be_nested_str(_settings_ptr), + /* K6 */ be_nested_str(get), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str(settings), + /* K9 */ be_nested_str(toptr), + /* K10 */ be_nested_str(_settings_def), + /* K11 */ be_nested_str(wd), + /* K12 */ be_nested_str(), + /* K13 */ be_nested_str(_debug_present), + /* K14 */ be_nested_str(debug), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[36]) { /* code */ + 0xB8060200, // 0000 GETNGBL R1 K1 + 0x88080102, // 0001 GETMBR R2 R0 K2 + 0x880C0103, // 0002 GETMBR R3 R0 K3 + 0x7C040400, // 0003 CALL R1 2 + 0x90020001, // 0004 SETMBR R0 K0 R1 + 0xA4060800, // 0005 IMPORT R1 K4 + 0x60080015, // 0006 GETGBL R2 G21 + 0x880C0105, // 0007 GETMBR R3 R0 K5 + 0x54120003, // 0008 LDINT R4 4 + 0x7C080400, // 0009 CALL R2 2 + 0x8C080506, // 000A GETMET R2 R2 K6 + 0x58100007, // 000B LDCONST R4 K7 + 0x54160003, // 000C LDINT R5 4 + 0x7C080600, // 000D CALL R2 3 + 0x780A0006, // 000E JMPF R2 #0016 + 0xB80E0200, // 000F GETNGBL R3 K1 + 0x8C100309, // 0010 GETMET R4 R1 K9 + 0x5C180400, // 0011 MOVE R6 R2 + 0x7C100400, // 0012 CALL R4 2 + 0x8814010A, // 0013 GETMBR R5 R0 K10 + 0x7C0C0400, // 0014 CALL R3 2 + 0x90021003, // 0015 SETMBR R0 K8 R3 + 0x9002170C, // 0016 SETMBR R0 K11 K12 + 0x500C0000, // 0017 LDBOOL R3 0 0 + 0x90021A03, // 0018 SETMBR R0 K13 R3 + 0xA8020004, // 0019 EXBLK 0 #001F + 0xA40E1C00, // 001A IMPORT R3 K14 + 0x50100200, // 001B LDBOOL R4 1 0 + 0x90021A04, // 001C SETMBR R0 K13 R4 + 0xA8040001, // 001D EXBLK 1 1 + 0x70020003, // 001E JMP #0023 + 0xAC0C0000, // 001F CATCH R3 0 0 + 0x70020000, // 0020 JMP #0022 + 0x70020000, // 0021 JMP #0023 + 0xB0080000, // 0022 RAISE 2 R0 R0 + 0x80000000, // 0023 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: time_str +********************************************************************/ +be_local_closure(Tasmota_time_str, /* name */ + be_nested_proto( + 13, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(time_dump), + /* K2 */ be_nested_str(format), + /* K3 */ be_nested_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d), + /* K4 */ be_nested_str(year), + /* K5 */ be_nested_str(month), + /* K6 */ be_nested_str(day), + /* K7 */ be_nested_str(hour), + /* K8 */ be_nested_str(min), + /* K9 */ be_nested_str(sec), + }), + &be_const_str_time_str, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x8C0C0101, // 0001 GETMET R3 R0 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x8C100502, // 0004 GETMET R4 R2 K2 + 0x58180003, // 0005 LDCONST R6 K3 + 0x941C0704, // 0006 GETIDX R7 R3 K4 + 0x94200705, // 0007 GETIDX R8 R3 K5 + 0x94240706, // 0008 GETIDX R9 R3 K6 + 0x94280707, // 0009 GETIDX R10 R3 K7 + 0x942C0708, // 000A GETIDX R11 R3 K8 + 0x94300709, // 000B GETIDX R12 R3 K9 + 0x7C101000, // 000C CALL R4 8 + 0x80040800, // 000D RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_rule +********************************************************************/ +be_local_closure(Tasmota_remove_rule, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(_rules), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(k), + /* K3 */ be_nested_str(remove), + /* K4 */ be_const_int(1), + }), + &be_const_str_remove_rule, + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A0011, // 0001 JMPF R2 #0014 + 0x58080001, // 0002 LDCONST R2 K1 + 0x600C000C, // 0003 GETGBL R3 G12 + 0x88100100, // 0004 GETMBR R4 R0 K0 + 0x7C0C0200, // 0005 CALL R3 1 + 0x140C0403, // 0006 LT R3 R2 R3 + 0x780E000B, // 0007 JMPF R3 #0014 + 0x880C0100, // 0008 GETMBR R3 R0 K0 + 0x940C0602, // 0009 GETIDX R3 R3 R2 + 0x880C0702, // 000A GETMBR R3 R3 K2 + 0x1C0C0601, // 000B EQ R3 R3 R1 + 0x780E0004, // 000C JMPF R3 #0012 + 0x880C0100, // 000D GETMBR R3 R0 K0 + 0x8C0C0703, // 000E GETMET R3 R3 K3 + 0x5C140400, // 000F MOVE R5 R2 + 0x7C0C0400, // 0010 CALL R3 2 + 0x70020000, // 0011 JMP #0013 + 0x00080504, // 0012 ADD R2 R2 K4 + 0x7001FFEE, // 0013 JMP #0003 + 0x80000000, // 0014 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: load +********************************************************************/ +be_local_closure(Tasmota_load, /* name */ + be_nested_proto( + 21, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 2]) { + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(sys), + /* K1 */ be_nested_str(path), + /* K2 */ be_nested_str(find), + /* K3 */ be_nested_str(push), + }), + &be_const_str_push_path, + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x7C080200, // 0002 CALL R2 1 + 0x8C0C0502, // 0003 GETMET R3 R2 K2 + 0x5C140000, // 0004 MOVE R5 R0 + 0x7C0C0400, // 0005 CALL R3 2 + 0x4C100000, // 0006 LDNIL R4 + 0x1C0C0604, // 0007 EQ R3 R3 R4 + 0x780E0002, // 0008 JMPF R3 #000C + 0x8C0C0503, // 0009 GETMET R3 R2 K3 + 0x5C140000, // 000A MOVE R5 R0 + 0x7C0C0400, // 000B CALL R3 2 + 0x80000000, // 000C RET 0 + }) + ), + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(sys), + /* K1 */ be_nested_str(path), + /* K2 */ be_nested_str(find), + /* K3 */ be_nested_str(remove), + }), + &be_const_str_pop_path, + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x7C080200, // 0002 CALL R2 1 + 0x8C0C0502, // 0003 GETMET R3 R2 K2 + 0x5C140000, // 0004 MOVE R5 R0 + 0x7C0C0400, // 0005 CALL R3 2 + 0x4C100000, // 0006 LDNIL R4 + 0x20100604, // 0007 NE R4 R3 R4 + 0x78120002, // 0008 JMPF R4 #000C + 0x8C100503, // 0009 GETMET R4 R2 K3 + 0x5C180600, // 000A MOVE R6 R3 + 0x7C100400, // 000B CALL R4 2 + 0x80000000, // 000C RET 0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[21]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(path), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str(_X2F), + /* K4 */ be_nested_str(split), + /* K5 */ be_nested_str(_X23), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str(find), + /* K8 */ be_nested_str(_X2E), + /* K9 */ be_nested_str(_X2Ebe), + /* K10 */ be_nested_str(_X2Ebec), + /* K11 */ be_nested_str(io_error), + /* K12 */ be_nested_str(file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27), + /* K13 */ be_nested_str(last_modified), + /* K14 */ be_nested_str(c), + /* K15 */ be_nested_str(wd), + /* K16 */ be_nested_str(), + /* K17 */ be_nested_str(file), + /* K18 */ be_nested_str(save), + /* K19 */ be_nested_str(format), + /* K20 */ be_nested_str(BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29), + }), + &be_const_str_load, + &be_const_str_solidified, + ( &(const binstruction[121]) { /* code */ + 0x84080000, // 0000 CLOSURE R2 P0 + 0x840C0001, // 0001 CLOSURE R3 P1 + 0xA4120000, // 0002 IMPORT R4 K0 + 0xA4160200, // 0003 IMPORT R5 K1 + 0x6018000C, // 0004 GETGBL R6 G12 + 0x5C1C0200, // 0005 MOVE R7 R1 + 0x7C180200, // 0006 CALL R6 1 + 0x1C180D02, // 0007 EQ R6 R6 K2 + 0x781A0001, // 0008 JMPF R6 #000B + 0x50180000, // 0009 LDBOOL R6 0 0 + 0x80040C00, // 000A RET 1 R6 + 0x94180302, // 000B GETIDX R6 R1 K2 + 0x20180D03, // 000C NE R6 R6 K3 + 0x781A0000, // 000D JMPF R6 #000F + 0x00060601, // 000E ADD R1 K3 R1 + 0x8C180904, // 000F GETMET R6 R4 K4 + 0x5C200200, // 0010 MOVE R8 R1 + 0x58240005, // 0011 LDCONST R9 K5 + 0x7C180600, // 0012 CALL R6 3 + 0x941C0D02, // 0013 GETIDX R7 R6 K2 + 0x5421FFFE, // 0014 LDINT R8 -1 + 0x94200C08, // 0015 GETIDX R8 R6 R8 + 0x6024000C, // 0016 GETGBL R9 G12 + 0x5C280C00, // 0017 MOVE R10 R6 + 0x7C240200, // 0018 CALL R9 1 + 0x24241306, // 0019 GT R9 R9 K6 + 0x8C280907, // 001A GETMET R10 R4 K7 + 0x5C301000, // 001B MOVE R12 R8 + 0x58340008, // 001C LDCONST R13 K8 + 0x7C280600, // 001D CALL R10 3 + 0x14281502, // 001E LT R10 R10 K2 + 0x782A0001, // 001F JMPF R10 #0022 + 0x00040309, // 0020 ADD R1 R1 K9 + 0x00201109, // 0021 ADD R8 R8 K9 + 0x5429FFFC, // 0022 LDINT R10 -3 + 0x542DFFFE, // 0023 LDINT R11 -1 + 0x4028140B, // 0024 CONNECT R10 R10 R11 + 0x9428100A, // 0025 GETIDX R10 R8 R10 + 0x1C281509, // 0026 EQ R10 R10 K9 + 0x542DFFFB, // 0027 LDINT R11 -4 + 0x5431FFFE, // 0028 LDINT R12 -1 + 0x402C160C, // 0029 CONNECT R11 R11 R12 + 0x942C100B, // 002A GETIDX R11 R8 R11 + 0x1C2C170A, // 002B EQ R11 R11 K10 + 0x5C301400, // 002C MOVE R12 R10 + 0x74320002, // 002D JMPT R12 #0031 + 0x5C301600, // 002E MOVE R12 R11 + 0x74320000, // 002F JMPT R12 #0031 + 0xB006170C, // 0030 RAISE 1 K11 K12 + 0x8C300B0D, // 0031 GETMET R12 R5 K13 + 0x5C380E00, // 0032 MOVE R14 R7 + 0x7C300400, // 0033 CALL R12 2 + 0x782E0005, // 0034 JMPF R11 #003B + 0x4C340000, // 0035 LDNIL R13 + 0x1C34180D, // 0036 EQ R13 R12 R13 + 0x78360001, // 0037 JMPF R13 #003A + 0x50340000, // 0038 LDBOOL R13 0 0 + 0x80041A00, // 0039 RET 1 R13 + 0x70020013, // 003A JMP #004F + 0x8C340B0D, // 003B GETMET R13 R5 K13 + 0x003C030E, // 003C ADD R15 R1 K14 + 0x7C340400, // 003D CALL R13 2 + 0x4C380000, // 003E LDNIL R14 + 0x1C38180E, // 003F EQ R14 R12 R14 + 0x783A0004, // 0040 JMPF R14 #0046 + 0x4C380000, // 0041 LDNIL R14 + 0x1C381A0E, // 0042 EQ R14 R13 R14 + 0x783A0001, // 0043 JMPF R14 #0046 + 0x50380000, // 0044 LDBOOL R14 0 0 + 0x80041C00, // 0045 RET 1 R14 + 0x4C380000, // 0046 LDNIL R14 + 0x20381A0E, // 0047 NE R14 R13 R14 + 0x783A0005, // 0048 JMPF R14 #004F + 0x4C380000, // 0049 LDNIL R14 + 0x1C38180E, // 004A EQ R14 R12 R14 + 0x743A0001, // 004B JMPT R14 #004E + 0x28381A0C, // 004C GE R14 R13 R12 + 0x783A0000, // 004D JMPF R14 #004F + 0x502C0200, // 004E LDBOOL R11 1 0 + 0x78260005, // 004F JMPF R9 #0056 + 0x00340F05, // 0050 ADD R13 R7 K5 + 0x90021E0D, // 0051 SETMBR R0 K15 R13 + 0x5C340400, // 0052 MOVE R13 R2 + 0x8838010F, // 0053 GETMBR R14 R0 K15 + 0x7C340200, // 0054 CALL R13 1 + 0x70020000, // 0055 JMP #0057 + 0x90021F10, // 0056 SETMBR R0 K15 K16 + 0x6034000D, // 0057 GETGBL R13 G13 + 0x5C380200, // 0058 MOVE R14 R1 + 0x583C0011, // 0059 LDCONST R15 K17 + 0x7C340400, // 005A CALL R13 2 + 0x5C381600, // 005B MOVE R14 R11 + 0x743A0013, // 005C JMPT R14 #0071 + 0x5C381200, // 005D MOVE R14 R9 + 0x743A0011, // 005E JMPT R14 #0071 + 0xA8020005, // 005F EXBLK 0 #0066 + 0x8C380112, // 0060 GETMET R14 R0 K18 + 0x0040030E, // 0061 ADD R16 R1 K14 + 0x5C441A00, // 0062 MOVE R17 R13 + 0x7C380600, // 0063 CALL R14 3 + 0xA8040001, // 0064 EXBLK 1 1 + 0x7002000A, // 0065 JMP #0071 + 0xAC380001, // 0066 CATCH R14 0 1 + 0x70020007, // 0067 JMP #0070 + 0x603C0001, // 0068 GETGBL R15 G1 + 0x8C400913, // 0069 GETMET R16 R4 K19 + 0x58480014, // 006A LDCONST R18 K20 + 0x004C030E, // 006B ADD R19 R1 K14 + 0x5C501C00, // 006C MOVE R20 R14 + 0x7C400800, // 006D CALL R16 4 + 0x7C3C0200, // 006E CALL R15 1 + 0x70020000, // 006F JMP #0071 + 0xB0080000, // 0070 RAISE 2 R0 R0 + 0x5C381A00, // 0071 MOVE R14 R13 + 0x7C380000, // 0072 CALL R14 0 + 0x78260002, // 0073 JMPF R9 #0077 + 0x5C380600, // 0074 MOVE R14 R3 + 0x003C0F05, // 0075 ADD R15 R7 K5 + 0x7C380200, // 0076 CALL R14 1 + 0x50380200, // 0077 LDBOOL R14 1 0 + 0x80041C00, // 0078 RET 1 R14 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: chars_in_string +********************************************************************/ +be_local_closure(Tasmota_chars_in_string, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_const_int(1), + }), + &be_const_str_chars_in_string, + &be_const_str_solidified, + ( &(const binstruction[31]) { /* code */ + 0x780E0001, // 0000 JMPF R3 #0003 + 0x50100200, // 0001 LDBOOL R4 1 0 + 0x70020000, // 0002 JMP #0004 + 0x50100000, // 0003 LDBOOL R4 0 0 + 0x58140000, // 0004 LDCONST R5 K0 + 0x6018000C, // 0005 GETGBL R6 G12 + 0x5C1C0200, // 0006 MOVE R7 R1 + 0x7C180200, // 0007 CALL R6 1 + 0x14180A06, // 0008 LT R6 R5 R6 + 0x781A0012, // 0009 JMPF R6 #001D + 0x50180000, // 000A LDBOOL R6 0 0 + 0x581C0000, // 000B LDCONST R7 K0 + 0x6020000C, // 000C GETGBL R8 G12 + 0x5C240400, // 000D MOVE R9 R2 + 0x7C200200, // 000E CALL R8 1 + 0x14200E08, // 000F LT R8 R7 R8 + 0x78220006, // 0010 JMPF R8 #0018 + 0x94200205, // 0011 GETIDX R8 R1 R5 + 0x94240407, // 0012 GETIDX R9 R2 R7 + 0x1C201009, // 0013 EQ R8 R8 R9 + 0x78220000, // 0014 JMPF R8 #0016 + 0x50180200, // 0015 LDBOOL R6 1 0 + 0x001C0F01, // 0016 ADD R7 R7 K1 + 0x7001FFF3, // 0017 JMP #000C + 0x20200806, // 0018 NE R8 R4 R6 + 0x78220000, // 0019 JMPF R8 #001B + 0x80040A00, // 001A RET 1 R5 + 0x00140B01, // 001B ADD R5 R5 K1 + 0x7001FFE7, // 001C JMP #0005 + 0x5419FFFE, // 001D LDINT R6 -1 + 0x80040C00, // 001E RET 1 R6 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: cmd +********************************************************************/ +be_local_closure(Tasmota_cmd, /* name */ be_nested_proto( 5, /* nstack */ 2, /* argc */ @@ -1881,19 +1401,26 @@ be_local_closure(remove_cmd, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_string("_ccmd", -2131545883, 5), - /* K1 */ be_nested_string("remove", -611183107, 6), + /* K0 */ be_nested_str(cmd_res), + /* K1 */ be_nested_str(_cmd), }), - (be_nested_const_str("remove_cmd", -462651594, 10)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[ 7]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x780A0003, // 0001 JMPF R2 #0006 - 0x88080100, // 0002 GETMBR R2 R0 K0 - 0x8C080501, // 0003 GETMET R2 R2 K1 - 0x5C100200, // 0004 MOVE R4 R1 - 0x7C080400, // 0005 CALL R2 2 - 0x80000000, // 0006 RET 0 + &be_const_str_cmd, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x50080200, // 0000 LDBOOL R2 1 0 + 0x90020002, // 0001 SETMBR R0 K0 R2 + 0x8C080101, // 0002 GETMET R2 R0 K1 + 0x5C100200, // 0003 MOVE R4 R1 + 0x7C080400, // 0004 CALL R2 2 + 0x4C080000, // 0005 LDNIL R2 + 0x880C0100, // 0006 GETMBR R3 R0 K0 + 0x50100200, // 0007 LDBOOL R4 1 0 + 0x200C0604, // 0008 NE R3 R3 R4 + 0x780E0000, // 0009 JMPF R3 #000B + 0x88080100, // 000A GETMBR R2 R0 K0 + 0x4C0C0000, // 000B LDNIL R3 + 0x90020003, // 000C SETMBR R0 K0 R3 + 0x80040400, // 000D RET 1 R2 }) ) ); @@ -1901,64 +1428,233 @@ be_local_closure(remove_cmd, /* name */ /******************************************************************** -** Solidified function: exec_cmd +** Solidified function: add_cmd ********************************************************************/ -be_local_closure(exec_cmd, /* name */ +be_local_closure(Tasmota_add_cmd, /* name */ be_nested_proto( - 12, /* nstack */ - 4, /* argc */ + 5, /* nstack */ + 3, /* argc */ 0, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_string("_ccmd", -2131545883, 5), - /* K1 */ be_nested_string("json", 916562499, 4), - /* K2 */ be_nested_string("load", -435725847, 4), - /* K3 */ be_nested_string("find_key_i", 850136726, 10), - /* K4 */ be_nested_string("resolvecmnd", 993361485, 11), + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(_ccmd), + /* K1 */ be_nested_str(function), + /* K2 */ be_nested_str(value_error), + /* K3 */ be_nested_str(the_X20second_X20argument_X20is_X20not_X20a_X20function), }), - (be_nested_const_str("exec_cmd", 493567399, 8)), - ((bstring*) &be_const_str_input), - ( &(const binstruction[27]) { /* code */ - 0x88100100, // 0000 GETMBR R4 R0 K0 - 0x78120016, // 0001 JMPF R4 #0019 - 0xA4120200, // 0002 IMPORT R4 K1 - 0x8C140902, // 0003 GETMET R5 R4 K2 - 0x5C1C0600, // 0004 MOVE R7 R3 - 0x7C140400, // 0005 CALL R5 2 - 0x8C180103, // 0006 GETMET R6 R0 K3 - 0x88200100, // 0007 GETMBR R8 R0 K0 - 0x5C240200, // 0008 MOVE R9 R1 - 0x7C180600, // 0009 CALL R6 3 - 0x4C1C0000, // 000A LDNIL R7 - 0x201C0C07, // 000B NE R7 R6 R7 - 0x781E000B, // 000C JMPF R7 #0019 - 0x8C1C0104, // 000D GETMET R7 R0 K4 - 0x5C240C00, // 000E MOVE R9 R6 - 0x7C1C0400, // 000F CALL R7 2 - 0x881C0100, // 0010 GETMBR R7 R0 K0 - 0x941C0E06, // 0011 GETIDX R7 R7 R6 - 0x5C200C00, // 0012 MOVE R8 R6 - 0x5C240400, // 0013 MOVE R9 R2 - 0x5C280600, // 0014 MOVE R10 R3 - 0x5C2C0A00, // 0015 MOVE R11 R5 - 0x7C1C0800, // 0016 CALL R7 4 - 0x501C0200, // 0017 LDBOOL R7 1 0 - 0x80040E00, // 0018 RET 1 R7 - 0x50100000, // 0019 LDBOOL R4 0 0 - 0x80040800, // 001A RET 1 R4 + &be_const_str_add_cmd, + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x740E0002, // 0001 JMPT R3 #0005 + 0x600C0013, // 0002 GETGBL R3 G19 + 0x7C0C0000, // 0003 CALL R3 0 + 0x90020003, // 0004 SETMBR R0 K0 R3 + 0x600C0004, // 0005 GETGBL R3 G4 + 0x5C100400, // 0006 MOVE R4 R2 + 0x7C0C0200, // 0007 CALL R3 1 + 0x1C0C0701, // 0008 EQ R3 R3 K1 + 0x780E0002, // 0009 JMPF R3 #000D + 0x880C0100, // 000A GETMBR R3 R0 K0 + 0x980C0202, // 000B SETIDX R3 R1 R2 + 0x70020000, // 000C JMP #000E + 0xB0060503, // 000D RAISE 1 K2 K3 + 0x80000000, // 000E RET 0 }) ) ); /*******************************************************************/ + +/******************************************************************** +** Solidified function: add_rule +********************************************************************/ +be_local_closure(Tasmota_add_rule, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str(_rules), + /* K1 */ be_nested_str(function), + /* K2 */ be_nested_str(push), + /* K3 */ be_nested_str(kv), + /* K4 */ be_nested_str(value_error), + /* K5 */ be_nested_str(the_X20second_X20argument_X20is_X20not_X20a_X20function), + }), + &be_const_str_add_rule, + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x740E0002, // 0001 JMPT R3 #0005 + 0x600C0012, // 0002 GETGBL R3 G18 + 0x7C0C0000, // 0003 CALL R3 0 + 0x90020003, // 0004 SETMBR R0 K0 R3 + 0x600C0004, // 0005 GETGBL R3 G4 + 0x5C100400, // 0006 MOVE R4 R2 + 0x7C0C0200, // 0007 CALL R3 1 + 0x1C0C0701, // 0008 EQ R3 R3 K1 + 0x780E0007, // 0009 JMPF R3 #0012 + 0x880C0100, // 000A GETMBR R3 R0 K0 + 0x8C0C0702, // 000B GETMET R3 R3 K2 + 0x8C140103, // 000C GETMET R5 R0 K3 + 0x5C1C0200, // 000D MOVE R7 R1 + 0x5C200400, // 000E MOVE R8 R2 + 0x7C140600, // 000F CALL R5 3 + 0x7C0C0400, // 0010 CALL R3 2 + 0x70020000, // 0011 JMP #0013 + 0xB0060905, // 0012 RAISE 1 K4 K5 + 0x80000000, // 0013 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: exec_rules +********************************************************************/ +be_local_closure(Tasmota_exec_rules, /* name */ + be_nested_proto( + 12, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str(_rules), + /* K1 */ be_nested_str(cmd_res), + /* K2 */ be_nested_str(json), + /* K3 */ be_nested_str(load), + /* K4 */ be_nested_str(log), + /* K5 */ be_nested_str(BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20), + /* K6 */ be_const_int(3), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str(try_rule), + /* K9 */ be_nested_str(k), + /* K10 */ be_nested_str(v), + /* K11 */ be_const_int(1), + }), + &be_const_str_exec_rules, + &be_const_str_solidified, + ( &(const binstruction[48]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x740A0003, // 0001 JMPT R2 #0006 + 0x88080101, // 0002 GETMBR R2 R0 K1 + 0x4C0C0000, // 0003 LDNIL R3 + 0x20080403, // 0004 NE R2 R2 R3 + 0x780A0027, // 0005 JMPF R2 #002E + 0xA40A0400, // 0006 IMPORT R2 K2 + 0x8C0C0503, // 0007 GETMET R3 R2 K3 + 0x5C140200, // 0008 MOVE R5 R1 + 0x7C0C0400, // 0009 CALL R3 2 + 0x50100000, // 000A LDBOOL R4 0 0 + 0x4C140000, // 000B LDNIL R5 + 0x1C140605, // 000C EQ R5 R3 R5 + 0x78160004, // 000D JMPF R5 #0013 + 0x8C140104, // 000E GETMET R5 R0 K4 + 0x001E0A01, // 000F ADD R7 K5 R1 + 0x58200006, // 0010 LDCONST R8 K6 + 0x7C140600, // 0011 CALL R5 3 + 0x5C0C0200, // 0012 MOVE R3 R1 + 0x88140101, // 0013 GETMBR R5 R0 K1 + 0x4C180000, // 0014 LDNIL R6 + 0x20140A06, // 0015 NE R5 R5 R6 + 0x78160000, // 0016 JMPF R5 #0018 + 0x90020203, // 0017 SETMBR R0 K1 R3 + 0x88140100, // 0018 GETMBR R5 R0 K0 + 0x78160012, // 0019 JMPF R5 #002D + 0x58140007, // 001A LDCONST R5 K7 + 0x6018000C, // 001B GETGBL R6 G12 + 0x881C0100, // 001C GETMBR R7 R0 K0 + 0x7C180200, // 001D CALL R6 1 + 0x14180A06, // 001E LT R6 R5 R6 + 0x781A000C, // 001F JMPF R6 #002D + 0x88180100, // 0020 GETMBR R6 R0 K0 + 0x94180C05, // 0021 GETIDX R6 R6 R5 + 0x8C1C0108, // 0022 GETMET R7 R0 K8 + 0x5C240600, // 0023 MOVE R9 R3 + 0x88280D09, // 0024 GETMBR R10 R6 K9 + 0x882C0D0A, // 0025 GETMBR R11 R6 K10 + 0x7C1C0800, // 0026 CALL R7 4 + 0x741E0001, // 0027 JMPT R7 #002A + 0x74120000, // 0028 JMPT R4 #002A + 0x50100001, // 0029 LDBOOL R4 0 1 + 0x50100200, // 002A LDBOOL R4 1 0 + 0x00140B0B, // 002B ADD R5 R5 K11 + 0x7001FFED, // 002C JMP #001B + 0x80040800, // 002D RET 1 R4 + 0x50080000, // 002E LDBOOL R2 0 0 + 0x80040400, // 002F RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: cb_dispatch +********************************************************************/ +be_local_closure(Tasmota_cb_dispatch, /* name */ + be_nested_proto( + 12, /* nstack */ + 6, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(_cb), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(find), + }), + &be_const_str_cb_dispatch, + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0x88180100, // 0000 GETMBR R6 R0 K0 + 0x4C1C0000, // 0001 LDNIL R7 + 0x1C180C07, // 0002 EQ R6 R6 R7 + 0x781A0000, // 0003 JMPF R6 #0005 + 0x80060200, // 0004 RET 1 K1 + 0x88180100, // 0005 GETMBR R6 R0 K0 + 0x8C180D02, // 0006 GETMET R6 R6 K2 + 0x5C200200, // 0007 MOVE R8 R1 + 0x7C180400, // 0008 CALL R6 2 + 0x4C1C0000, // 0009 LDNIL R7 + 0x201C0C07, // 000A NE R7 R6 R7 + 0x781E0006, // 000B JMPF R7 #0013 + 0x5C1C0C00, // 000C MOVE R7 R6 + 0x5C200400, // 000D MOVE R8 R2 + 0x5C240600, // 000E MOVE R9 R3 + 0x5C280800, // 000F MOVE R10 R4 + 0x5C2C0A00, // 0010 MOVE R11 R5 + 0x7C1C0800, // 0011 CALL R7 4 + 0x80040E00, // 0012 RET 1 R7 + 0x80060200, // 0013 RET 1 K1 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: hs2rgb ********************************************************************/ -be_local_closure(hs2rgb, /* name */ +be_local_closure(Tasmota_hs2rgb, /* name */ be_nested_proto( 17, /* nstack */ 3, /* argc */ @@ -1970,14 +1666,14 @@ be_local_closure(hs2rgb, /* name */ 1, /* has constants */ ( &(const bvalue[ 6]) { /* constants */ /* K0 */ be_const_int(0), - /* K1 */ be_nested_string("tasmota", 424643812, 7), - /* K2 */ be_nested_string("scale_uint", -1204156202, 10), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(scale_uint), /* K3 */ be_const_int(1), /* K4 */ be_const_int(2), /* K5 */ be_const_int(3), }), - (be_nested_const_str("hs2rgb", 1040816349, 6)), - ((bstring*) &be_const_str_input), + &be_const_str_hs2rgb, + &be_const_str_solidified, ( &(const binstruction[68]) { /* code */ 0x4C0C0000, // 0000 LDNIL R3 0x1C0C0403, // 0001 EQ R3 R2 R3 @@ -2052,6 +1748,312 @@ be_local_closure(hs2rgb, /* name */ ); /*******************************************************************/ + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(KV_init, /* name */ + be_nested_proto( + 3, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(k), + /* K1 */ be_nested_str(v), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: KV +********************************************************************/ +be_local_class(KV, + 2, + NULL, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(k, 2), be_const_var(0) }, + { be_const_key(v, -1), be_const_var(1) }, + { be_const_key(init, -1), be_const_closure(KV_init_closure) }, + })), + be_str_literal("KV") +); + +/******************************************************************** +** Solidified function: kv +********************************************************************/ +be_local_closure(Tasmota_kv, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_const_class(be_class_KV), + }), + &be_const_str_kv, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x580C0000, // 0000 LDCONST R3 K0 + 0xB4000000, // 0001 CLASS K0 + 0x5C100600, // 0002 MOVE R4 R3 + 0x5C140200, // 0003 MOVE R5 R1 + 0x5C180400, // 0004 MOVE R6 R2 + 0x7C100400, // 0005 CALL R4 2 + 0x80040800, // 0006 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_cmd +********************************************************************/ +be_local_closure(Tasmota_remove_cmd, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(_ccmd), + /* K1 */ be_nested_str(remove), + }), + &be_const_str_remove_cmd, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A0003, // 0001 JMPF R2 #0006 + 0x88080100, // 0002 GETMBR R2 R0 K0 + 0x8C080501, // 0003 GETMET R2 R2 K1 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_timer +********************************************************************/ +be_local_closure(Tasmota_set_timer, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(_timers), + /* K1 */ be_nested_str(push), + /* K2 */ be_nested_str(Timer), + /* K3 */ be_nested_str(millis), + }), + &be_const_str_set_timer, + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x88100100, // 0000 GETMBR R4 R0 K0 + 0x74120002, // 0001 JMPT R4 #0005 + 0x60100012, // 0002 GETGBL R4 G18 + 0x7C100000, // 0003 CALL R4 0 + 0x90020004, // 0004 SETMBR R0 K0 R4 + 0x88100100, // 0005 GETMBR R4 R0 K0 + 0x8C100901, // 0006 GETMET R4 R4 K1 + 0xB81A0400, // 0007 GETNGBL R6 K2 + 0x8C1C0103, // 0008 GETMET R7 R0 K3 + 0x5C240200, // 0009 MOVE R9 R1 + 0x7C1C0400, // 000A CALL R7 2 + 0x5C200400, // 000B MOVE R8 R2 + 0x5C240600, // 000C MOVE R9 R3 + 0x7C180600, // 000D CALL R6 3 + 0x7C100400, // 000E CALL R4 2 + 0x80000000, // 000F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_timer +********************************************************************/ +be_local_closure(Tasmota_remove_timer, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(_timers), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str(size), + /* K4 */ be_nested_str(id), + /* K5 */ be_nested_str(remove), + /* K6 */ be_const_int(1), + }), + &be_const_str_remove_timer, + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x88080501, // 0001 GETMBR R2 R2 K1 + 0x780A0012, // 0002 JMPF R2 #0016 + 0x58080002, // 0003 LDCONST R2 K2 + 0xB80E0000, // 0004 GETNGBL R3 K0 + 0x880C0701, // 0005 GETMBR R3 R3 K1 + 0x8C0C0703, // 0006 GETMET R3 R3 K3 + 0x7C0C0200, // 0007 CALL R3 1 + 0x140C0403, // 0008 LT R3 R2 R3 + 0x780E000B, // 0009 JMPF R3 #0016 + 0x880C0101, // 000A GETMBR R3 R0 K1 + 0x940C0602, // 000B GETIDX R3 R3 R2 + 0x880C0704, // 000C GETMBR R3 R3 K4 + 0x1C0C0601, // 000D EQ R3 R3 R1 + 0x780E0004, // 000E JMPF R3 #0014 + 0x880C0101, // 000F GETMBR R3 R0 K1 + 0x8C0C0705, // 0010 GETMET R3 R3 K5 + 0x5C140400, // 0011 MOVE R5 R2 + 0x7C0C0400, // 0012 CALL R3 2 + 0x70020000, // 0013 JMP #0015 + 0x00080506, // 0014 ADD R2 R2 K6 + 0x7001FFED, // 0015 JMP #0004 + 0x80000000, // 0016 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: exec_cmd +********************************************************************/ +be_local_closure(Tasmota_exec_cmd, /* name */ + be_nested_proto( + 12, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(_ccmd), + /* K1 */ be_nested_str(json), + /* K2 */ be_nested_str(load), + /* K3 */ be_nested_str(find_key_i), + /* K4 */ be_nested_str(resolvecmnd), + }), + &be_const_str_exec_cmd, + &be_const_str_solidified, + ( &(const binstruction[27]) { /* code */ + 0x88100100, // 0000 GETMBR R4 R0 K0 + 0x78120016, // 0001 JMPF R4 #0019 + 0xA4120200, // 0002 IMPORT R4 K1 + 0x8C140902, // 0003 GETMET R5 R4 K2 + 0x5C1C0600, // 0004 MOVE R7 R3 + 0x7C140400, // 0005 CALL R5 2 + 0x8C180103, // 0006 GETMET R6 R0 K3 + 0x88200100, // 0007 GETMBR R8 R0 K0 + 0x5C240200, // 0008 MOVE R9 R1 + 0x7C180600, // 0009 CALL R6 3 + 0x4C1C0000, // 000A LDNIL R7 + 0x201C0C07, // 000B NE R7 R6 R7 + 0x781E000B, // 000C JMPF R7 #0019 + 0x8C1C0104, // 000D GETMET R7 R0 K4 + 0x5C240C00, // 000E MOVE R9 R6 + 0x7C1C0400, // 000F CALL R7 2 + 0x881C0100, // 0010 GETMBR R7 R0 K0 + 0x941C0E06, // 0011 GETIDX R7 R7 R6 + 0x5C200C00, // 0012 MOVE R8 R6 + 0x5C240400, // 0013 MOVE R9 R2 + 0x5C280600, // 0014 MOVE R10 R3 + 0x5C2C0A00, // 0015 MOVE R11 R5 + 0x7C1C0800, // 0016 CALL R7 4 + 0x501C0200, // 0017 LDBOOL R7 1 0 + 0x80040E00, // 0018 RET 1 R7 + 0x50100000, // 0019 LDBOOL R4 0 0 + 0x80040800, // 001A RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_light +********************************************************************/ +be_local_closure(Tasmota_get_light, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29), + /* K1 */ be_nested_str(light), + /* K2 */ be_nested_str(get), + }), + &be_const_str_get_light, + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x60080001, // 0000 GETGBL R2 G1 + 0x580C0000, // 0001 LDCONST R3 K0 + 0x7C080200, // 0002 CALL R2 1 + 0xA40A0200, // 0003 IMPORT R2 K1 + 0x4C0C0000, // 0004 LDNIL R3 + 0x200C0203, // 0005 NE R3 R1 R3 + 0x780E0004, // 0006 JMPF R3 #000C + 0x8C0C0502, // 0007 GETMET R3 R2 K2 + 0x5C140200, // 0008 MOVE R5 R1 + 0x7C0C0400, // 0009 CALL R3 2 + 0x80040600, // 000A RET 1 R3 + 0x70020002, // 000B JMP #000F + 0x8C0C0502, // 000C GETMET R3 R2 K2 + 0x7C0C0200, // 000D CALL R3 1 + 0x80040600, // 000E RET 1 R3 + 0x80000000, // 000F RET 0 + }) + ) +); +/*******************************************************************/ + #include "../generate/be_fixed_be_class_tasmota.h" @@ -2083,8 +2085,8 @@ class be_class_tasmota (scope: global, name: Tasmota) { _global_addr, comptr(&TasmotaGlobal) _settings_ptr, comptr(&Settings) - init, closure(init_closure) - kv, closure(kv_closure) + init, closure(Tasmota_init_closure) + kv, closure(Tasmota_kv_closure) get_free_heap, func(l_getFreeHeap) arch, func(l_arch) @@ -2126,35 +2128,35 @@ class be_class_tasmota (scope: global, name: Tasmota) { i2c_enabled, func(l_i2cenabled) - cmd, closure(cmd_closure) - chars_in_string, closure(chars_in_string_closure) - find_key_i, closure(find_key_i_closure) - find_op, closure(find_op_closure) - add_rule, closure(add_rule_closure) - remove_rule, closure(remove_rule_closure) - try_rule, closure(try_rule_closure) - exec_rules, closure(exec_rules_closure) - exec_tele, closure(exec_tele_closure) - set_timer, closure(set_timer_closure) - run_deferred, closure(run_deferred_closure) - remove_timer, closure(remove_timer_closure) - add_cmd, closure(add_cmd_closure) - remove_cmd, closure(remove_cmd_closure) - exec_cmd, closure(exec_cmd_closure) - gc, closure(gc_closure) - event, closure(event_closure) - add_driver, closure(add_driver_closure) - remove_driver, closure(remove_driver_closure) - load, closure(load_closure) - wire_scan, closure(wire_scan_closure) - time_str, closure(time_str_closure) + cmd, closure(Tasmota_cmd_closure) + chars_in_string, closure(Tasmota_chars_in_string_closure) + find_key_i, closure(Tasmota_find_key_i_closure) + find_op, closure(Tasmota_find_op_closure) + add_rule, closure(Tasmota_add_rule_closure) + remove_rule, closure(Tasmota_remove_rule_closure) + try_rule, closure(Tasmota_try_rule_closure) + exec_rules, closure(Tasmota_exec_rules_closure) + exec_tele, closure(Tasmota_exec_tele_closure) + set_timer, closure(Tasmota_set_timer_closure) + run_deferred, closure(Tasmota_run_deferred_closure) + remove_timer, closure(Tasmota_remove_timer_closure) + add_cmd, closure(Tasmota_add_cmd_closure) + remove_cmd, closure(Tasmota_remove_cmd_closure) + exec_cmd, closure(Tasmota_exec_cmd_closure) + gc, closure(Tasmota_gc_closure) + event, closure(Tasmota_event_closure) + add_driver, closure(Tasmota_add_driver_closure) + remove_driver, closure(Tasmota_remove_driver_closure) + load, closure(Tasmota_load_closure) + wire_scan, closure(Tasmota_wire_scan_closure) + time_str, closure(Tasmota_time_str_closure) - hs2rgb, closure(hs2rgb_closure) + hs2rgb, closure(Tasmota_hs2rgb_closure) - cb_dispatch, closure(cb_dispatch_closure) - gen_cb, closure(gen_cb_closure) + cb_dispatch, closure(Tasmota_cb_dispatch_closure) + gen_cb, closure(Tasmota_gen_cb_closure) - get_light, closure(get_light_closure) - set_light, closure(set_light_closure) + get_light, closure(Tasmota_get_light_closure) + set_light, closure(Tasmota_set_light_closure) } @const_object_info_end */ diff --git a/lib/libesp32/Berry/default/be_timer_class.c b/lib/libesp32/Berry/default/be_timer_class.c index 2646fd6b2..6664e408e 100644 --- a/lib/libesp32/Berry/default/be_timer_class.c +++ b/lib/libesp32/Berry/default/be_timer_class.c @@ -8,7 +8,7 @@ /******************************************************************** ** Solidified function: tostring ********************************************************************/ -be_local_closure(tostring, /* name */ +be_local_closure(Timer_tostring, /* name */ be_nested_proto( 10, /* nstack */ 1, /* argc */ @@ -19,35 +19,35 @@ be_local_closure(tostring, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_string("string", 398550328, 6), - /* K1 */ be_nested_string("format", -1180859054, 6), - /* K2 */ be_nested_string("

", 3546571739u, 0, 11, &be_const_str_autorun); +be_define_const_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 1863865923u, 0, 16, &be_const_str_id); +be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, NULL); +be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str__get_cb); +be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, &be_const_str_erase); +be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "
", 842307168u, 0, 77, &be_const_str_web_add_config_button); +be_define_const_str(_X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, "Choose a device configuration:
", 1336654704u, 0, 49, &be_const_str_RES_OK); +be_define_const_str(_X3Clambda_X3E, "", 607256038u, 0, 8, NULL); +be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Current auto-configuration", 4212500780u, 0, 82, &be_const_str_GET); +be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Select new auto-configuration", 1926223891u, 0, 80, &be_const_str_add); +be_define_const_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, "", 510303524u, 0, 30, &be_const_str_codedump); +be_define_const_str(_X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, "", 3994619755u, 0, 54, NULL); +be_define_const_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, "

Exception:
'%s'
%s

", 4252565082u, 0, 59, &be_const_str__class); +be_define_const_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 2052843416u, 0, 25, &be_const_str_cb_dispatch); +be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 452285201u, 0, 120, NULL); +be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, "

 (This feature requires an internet connection)

", 2719266486u, 0, 74, &be_const_str__ccmd); +be_define_const_str(_X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, "

Current configuration:

%s

", 4115655761u, 0, 46, &be_const_str_COLOR_BLACK); +be_define_const_str(_X3Cselect_X20name_X3D_X27zip_X27_X3E, "

", 1863865923u, 0, 16, &be_const_str_id); -be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, NULL); -be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str__get_cb); -be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, &be_const_str_erase); -be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "
", 842307168u, 0, 77, &be_const_str_web_add_config_button); -be_define_const_str(_X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, "Choose a device configuration:
", 1336654704u, 0, 49, &be_const_str_RES_OK); -be_define_const_str(_X3Clambda_X3E, "", 607256038u, 0, 8, NULL); -be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Current auto-configuration", 4212500780u, 0, 82, &be_const_str_GET); -be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Select new auto-configuration", 1926223891u, 0, 80, &be_const_str_add); -be_define_const_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, "", 510303524u, 0, 30, &be_const_str_codedump); +be_define_const_str(, "", 2166136261u, 0, 0, NULL); +be_define_const_str(_X0A, "\n", 252472541u, 0, 1, &be_const_str_Unknown_X20command); +be_define_const_str(_X20, " ", 621580159u, 0, 1, &be_const_str_geti); +be_define_const_str(_X21_X3D, "!=", 2428715011u, 0, 2, &be_const_str_asstring); +be_define_const_str(_X21_X3D_X3D, "!==", 559817114u, 0, 3, &be_const_str_type); +be_define_const_str(_X23, "#", 638357778u, 0, 1, &be_const_str_CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found); +be_define_const_str(_X23autoexec_X2Ebat, "#autoexec.bat", 3382890497u, 0, 13, &be_const_str_arg_size); +be_define_const_str(_X23autoexec_X2Ebe, "#autoexec.be", 1181757091u, 0, 12, &be_const_str_file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27); +be_define_const_str(_X23display_X2Eini, "#display.ini", 182218220u, 0, 12, &be_const_str___lower__); +be_define_const_str(_X23init_X2Ebat, "#init.bat", 3297595077u, 0, 9, &be_const_str_SERIAL_7O2); +be_define_const_str(_X23preinit_X2Ebe, "#preinit.be", 687035716u, 0, 11, &be_const_str_SERIAL_8O2); +be_define_const_str(_X2502d_X25s_X2502d, "%02d%s%02d", 1587999717u, 0, 10, &be_const_str_yield); +be_define_const_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, "%04d-%02d-%02dT%02d:%02d:%02d", 3425528601u, 0, 29, &be_const_str__global_def); +be_define_const_str(_X25s_X2Eautoconf, "%s.autoconf", 3560383524u, 0, 11, &be_const_str_every_second); +be_define_const_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, "<Error: apply new or remove>", 2855507949u, 0, 34, &be_const_str_add_driver); +be_define_const_str(_X26lt_X3BNone_X26gt_X3B, "<None>", 2602165498u, 0, 12, &be_const_str_rand); +be_define_const_str(_X28_X29, "()", 685372826u, 0, 2, &be_const_str__X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29); +be_define_const_str(_X2B, "+", 772578730u, 0, 1, &be_const_str_gpio); +be_define_const_str(_X2C, ",", 688690635u, 0, 1, &be_const_str_add_cmd); +be_define_const_str(_X2D_X2D_X3A_X2D_X2D, "--:--", 1370615441u, 0, 5, &be_const_str_AudioOutputI2S); +be_define_const_str(_X2E, ".", 722245873u, 0, 1, NULL); +be_define_const_str(_X2E_X2E, "..", 2748622605u, 0, 2, &be_const_str__X2Ep2); +be_define_const_str(_X2Eautoconf, ".autoconf", 2524679088u, 0, 9, NULL); +be_define_const_str(_X2Ebe, ".be", 1325797348u, 0, 3, &be_const_str_sinh); +be_define_const_str(_X2Ebec, ".bec", 3985273221u, 0, 4, &be_const_str__debug_present); +be_define_const_str(_X2Elen, ".len", 850842136u, 0, 4, NULL); +be_define_const_str(_X2Ep, ".p", 1171526419u, 0, 2, &be_const_str_COLOR_WHITE); +be_define_const_str(_X2Ep1, ".p1", 249175686u, 0, 3, &be_const_str_sin); +be_define_const_str(_X2Ep2, ".p2", 232398067u, 0, 3, &be_const_str_json_fdump_map); +be_define_const_str(_X2Esize, ".size", 1965188224u, 0, 5, &be_const_str__X2Fac); +be_define_const_str(_X2Etapp, ".tapp", 1363391594u, 0, 5, NULL); +be_define_const_str(_X2Ew, ".w", 1255414514u, 0, 2, &be_const_str_member); +be_define_const_str(_X2F, "/", 705468254u, 0, 1, &be_const_str_None); +be_define_const_str(_X2F_X2Eautoconf, "/.autoconf", 2212074393u, 0, 10, &be_const_str_set_dc_voltage); +be_define_const_str(_X2F_X3Frst_X3D, "/?rst=", 580074707u, 0, 6, &be_const_str_AES_GCM); +be_define_const_str(_X2Fac, "/ac", 3904651978u, 0, 3, &be_const_str_get_current_module_path); +be_define_const_str(_X3A, ":", 1057798253u, 0, 1, &be_const_str_json_fdump); +be_define_const_str(_X3C, "<", 957132539u, 0, 1, NULL); +be_define_const_str(_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 3546571739u, 0, 11, &be_const_str_atan); +be_define_const_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 1863865923u, 0, 16, NULL); +be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, &be_const_str_HTTP_POST); +be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str_Wire); +be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, &be_const_str_color); +be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "
", 842307168u, 0, 77, &be_const_str_set_power); +be_define_const_str(_X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, "Choose a device configuration:
", 1336654704u, 0, 49, &be_const_str_bus); +be_define_const_str(_X3Clambda_X3E, "", 607256038u, 0, 8, &be_const_str_No_X20callback_X20available); +be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Current auto-configuration", 4212500780u, 0, 82, &be_const_str_get_warning_level); +be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Select new auto-configuration", 1926223891u, 0, 80, &be_const_str_get_vbus_current); +be_define_const_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, "", 510303524u, 0, 30, &be_const_str_cb_event_closure); be_define_const_str(_X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, "", 3994619755u, 0, 54, NULL); -be_define_const_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, "

Exception:
'%s'
%s

", 4252565082u, 0, 59, &be_const_str__class); -be_define_const_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 2052843416u, 0, 25, &be_const_str_cb_dispatch); +be_define_const_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, "

Exception:
'%s'
%s

", 4252565082u, 0, 59, &be_const_str_arg); +be_define_const_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 2052843416u, 0, 25, &be_const_str_area); be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 452285201u, 0, 120, NULL); -be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, "

 (This feature requires an internet connection)

", 2719266486u, 0, 74, &be_const_str__ccmd); -be_define_const_str(_X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, "

Current configuration:

%s

", 4115655761u, 0, 46, &be_const_str_COLOR_BLACK); -be_define_const_str(_X3Cselect_X20name_X3D_X27zip_X27_X3E, "", 4247924536u, 0, 19, &be_const_str_find_key_i); +be_define_const_str(_X3D, "=", 940354920u, 0, 1, &be_const_str_listdir); +be_define_const_str(_X3D_X3C_X3E_X21, "=<>!", 2664470277u, 0, 4, &be_const_str_shared_key); +be_define_const_str(_X3D_X3D, "==", 2431966415u, 0, 2, &be_const_str_json_append); +be_define_const_str(_X3E, ">", 990687777u, 0, 1, &be_const_str_battery_present); +be_define_const_str(_X3E_X3D, ">=", 284975636u, 0, 2, &be_const_str_get_style_pad_right); +be_define_const_str(_X3F, "?", 973910158u, 0, 1, &be_const_str_redirect); +be_define_const_str(AES_GCM, "AES_GCM", 3832208678u, 0, 7, &be_const_str_clear_to); +be_define_const_str(AXP192, "AXP192", 757230128u, 0, 6, &be_const_str_BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29); +be_define_const_str(Animate_X20pc_X20is_X20out_X20of_X20range, "Animate pc is out of range", 1854929421u, 0, 26, &be_const_str_detected_X20on_X20bus); +be_define_const_str(AudioFileSource, "AudioFileSource", 2959980058u, 0, 15, &be_const_str_a); +be_define_const_str(AudioFileSourceFS, "AudioFileSourceFS", 1839147653u, 0, 17, &be_const_str_ip); be_define_const_str(AudioGenerator, "AudioGenerator", 1839297342u, 0, 14, NULL); -be_define_const_str(AudioGeneratorMP3, "AudioGeneratorMP3", 2199818488u, 0, 17, &be_const_str__end_transmission); -be_define_const_str(AudioGeneratorWAV, "AudioGeneratorWAV", 2746509368u, 0, 17, &be_const_str_get_switch); -be_define_const_str(AudioOutput, "AudioOutput", 3257792048u, 0, 11, &be_const_str_OneWire); -be_define_const_str(AudioOutputI2S, "AudioOutputI2S", 638031784u, 0, 14, &be_const_str__global_addr); -be_define_const_str(Auto_X2Dconfiguration, "Auto-configuration", 1665006109u, 0, 18, NULL); -be_define_const_str(BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, "BRY: ERROR, bad json: ", 2715135809u, 0, 22, NULL); -be_define_const_str(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "BRY: Exception> '%s' - %s", 2246990964u, 0, 25, &be_const_str__cb); -be_define_const_str(BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29, "BRY: could not save compiled file %s (%s)", 736659787u, 0, 41, &be_const_str__settings_ptr); -be_define_const_str(BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, "BRY: failed to load _persist.json", 2991913445u, 0, 33, &be_const_str_CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found); -be_define_const_str(BUTTON_CONFIGURATION, "BUTTON_CONFIGURATION", 70820856u, 0, 20, &be_const_str_preinit); -be_define_const_str(CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting, "CFG: 'init.bat' done, restarting", 1569670677u, 0, 32, &be_const_str_get_battery_chargin_status); -be_define_const_str(CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "CFG: Exception> '%s' - %s", 1228874553u, 0, 25, &be_const_str_CFG_X3A_X20loading_X20_X27_X25s_X27); -be_define_const_str(CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29, "CFG: could not run %s (%s - %s)", 1428829580u, 0, 31, NULL); -be_define_const_str(CFG_X3A_X20downloading_X20_X27_X25s_X27, "CFG: downloading '%s'", 589480701u, 0, 21, &be_const_str_asin); -be_define_const_str(CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27, "CFG: exception '%s' - '%s'", 4095407913u, 0, 26, &be_const_str_floor); -be_define_const_str(CFG_X3A_X20loaded_X20_X20, "CFG: loaded ", 3710273538u, 0, 13, &be_const_str_arg_size); -be_define_const_str(CFG_X3A_X20loaded_X20_X27_X25s_X27, "CFG: loaded '%s'", 1699028828u, 0, 16, &be_const_str_SERIAL_7N2); -be_define_const_str(CFG_X3A_X20loading_X20, "CFG: loading ", 4010361503u, 0, 13, &be_const_str_get_percentage); -be_define_const_str(CFG_X3A_X20loading_X20_X27_X25s_X27, "CFG: loading '%s'", 2285306097u, 0, 17, &be_const_str_SERIAL_8E2); -be_define_const_str(CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29, "CFG: multiple autoconf files found, aborting ('%s' + '%s')", 197663371u, 0, 58, &be_const_str_rad); -be_define_const_str(CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found, "CFG: no '*.autoconf' file found", 127493957u, 0, 31, &be_const_str_web_sensor); -be_define_const_str(CFG_X3A_X20ran_X20_X20, "CFG: ran ", 3579570472u, 0, 10, &be_const_str_SERIAL_5O2); -be_define_const_str(CFG_X3A_X20removed_X20file_X20_X27_X25s_X27, "CFG: removed file '%s'", 2048602473u, 0, 22, &be_const_str_web_send_decimal); -be_define_const_str(CFG_X3A_X20removing_X20autoconf_X20files, "CFG: removing autoconf files", 4014704970u, 0, 28, NULL); -be_define_const_str(CFG_X3A_X20removing_X20first_X20time_X20marker, "CFG: removing first time marker", 2125556683u, 0, 31, &be_const_str_arg_name); -be_define_const_str(CFG_X3A_X20return_code_X3D_X25i, "CFG: return_code=%i", 2059897320u, 0, 19, &be_const_str_set_ldo_enable); -be_define_const_str(CFG_X3A_X20running_X20, "CFG: running ", 2478334534u, 0, 13, NULL); -be_define_const_str(CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, "CFG: skipping 'display.ini' because already present in file-system", 3965549264u, 0, 66, &be_const_str_set_first_time); -be_define_const_str(COLOR_BLACK, "COLOR_BLACK", 264427940u, 0, 11, &be_const_str_refr_size); -be_define_const_str(COLOR_WHITE, "COLOR_WHITE", 2536871270u, 0, 11, &be_const_str_stop); -be_define_const_str(EC_C25519, "EC_C25519", 95492591u, 0, 9, &be_const_str_elif); -be_define_const_str(EVENT_DRAW_MAIN, "EVENT_DRAW_MAIN", 1955620614u, 0, 15, &be_const_str_web_add_management_button); -be_define_const_str(EVENT_DRAW_PART_BEGIN, "EVENT_DRAW_PART_BEGIN", 3391865024u, 0, 21, &be_const_str__X7B); -be_define_const_str(EVENT_DRAW_PART_END, "EVENT_DRAW_PART_END", 3301625292u, 0, 19, &be_const_str_files); -be_define_const_str(False, "False", 2541049336u, 0, 5, &be_const_str_draw_line); -be_define_const_str(GET, "GET", 2531704439u, 0, 3, NULL); -be_define_const_str(HTTP_GET, "HTTP_GET", 1722467738u, 0, 8, &be_const_str_json_append); -be_define_const_str(HTTP_POST, "HTTP_POST", 1999554144u, 0, 9, &be_const_str_log); -be_define_const_str(I2C_X3A, "I2C:", 813483371u, 0, 4, &be_const_str_copy); -be_define_const_str(I2C_Driver, "I2C_Driver", 1714501658u, 0, 10, &be_const_str__energy); -be_define_const_str(LVG_X3A_X20call_X20to_X20unsupported_X20callback, "LVG: call to unsupported callback", 504176819u, 0, 33, &be_const_str_getbits); -be_define_const_str(Leds, "Leds", 2709245275u, 0, 4, NULL); -be_define_const_str(MD5, "MD5", 1935726387u, 0, 3, &be_const_str_write8); -be_define_const_str(No_X20callback_X20available, "No callback available", 633786138u, 0, 21, &be_const_str_atan); -be_define_const_str(None, "None", 810547195u, 0, 4, &be_const_str_widget_editable); -be_define_const_str(OPTION_A, "OPTION_A", 1133299440u, 0, 8, &be_const_str_get_object_from_ptr); -be_define_const_str(OneWire, "OneWire", 2298990722u, 0, 7, &be_const_str_f); -be_define_const_str(PART_MAIN, "PART_MAIN", 2473491508u, 0, 9, NULL); -be_define_const_str(POST, "POST", 1929554311u, 0, 4, &be_const_str_p1); -be_define_const_str(Parameter_X20error, "Parameter error", 3840042038u, 0, 15, &be_const_str_format); -be_define_const_str(RES_OK, "RES_OK", 1233817284u, 0, 6, &be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson); -be_define_const_str(Restart_X201, "Restart 1", 3504455855u, 0, 9, NULL); -be_define_const_str(SERIAL_5E1, "SERIAL_5E1", 1163775235u, 0, 10, NULL); -be_define_const_str(SERIAL_5E2, "SERIAL_5E2", 1180552854u, 0, 10, &be_const_str_acos); +be_define_const_str(AudioGeneratorMP3, "AudioGeneratorMP3", 2199818488u, 0, 17, &be_const_str_remove_cmd); +be_define_const_str(AudioGeneratorWAV, "AudioGeneratorWAV", 2746509368u, 0, 17, &be_const_str_SERIAL_7E1); +be_define_const_str(AudioOutput, "AudioOutput", 3257792048u, 0, 11, &be_const_str_wire); +be_define_const_str(AudioOutputI2S, "AudioOutputI2S", 638031784u, 0, 14, NULL); +be_define_const_str(Auto_X2Dconfiguration, "Auto-configuration", 1665006109u, 0, 18, &be_const_str_Tasmota); +be_define_const_str(BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, "BRY: ERROR, bad json: ", 2715135809u, 0, 22, &be_const_str_I2C_X3A); +be_define_const_str(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "BRY: Exception> '%s' - %s", 2246990964u, 0, 25, NULL); +be_define_const_str(BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29, "BRY: could not save compiled file %s (%s)", 736659787u, 0, 41, &be_const_str_bri); +be_define_const_str(BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, "BRY: failed to load _persist.json", 2991913445u, 0, 33, &be_const_str_target); +be_define_const_str(BUTTON_CONFIGURATION, "BUTTON_CONFIGURATION", 70820856u, 0, 20, &be_const_str_SERIAL_5O1); +be_define_const_str(CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting, "CFG: 'init.bat' done, restarting", 1569670677u, 0, 32, &be_const_str_delay); +be_define_const_str(CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "CFG: Exception> '%s' - %s", 1228874553u, 0, 25, &be_const_str__p); +be_define_const_str(CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29, "CFG: could not run %s (%s - %s)", 1428829580u, 0, 31, &be_const_str_arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj); +be_define_const_str(CFG_X3A_X20downloading_X20_X27_X25s_X27, "CFG: downloading '%s'", 589480701u, 0, 21, &be_const_str_add_header); +be_define_const_str(CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27, "CFG: exception '%s' - '%s'", 4095407913u, 0, 26, &be_const_str_Tele); +be_define_const_str(CFG_X3A_X20loaded_X20_X20, "CFG: loaded ", 3710273538u, 0, 13, NULL); +be_define_const_str(CFG_X3A_X20loaded_X20_X27_X25s_X27, "CFG: loaded '%s'", 1699028828u, 0, 16, &be_const_str_fromb64); +be_define_const_str(CFG_X3A_X20loading_X20, "CFG: loading ", 4010361503u, 0, 13, &be_const_str_floor); +be_define_const_str(CFG_X3A_X20loading_X20_X27_X25s_X27, "CFG: loading '%s'", 2285306097u, 0, 17, &be_const_str_Timer); +be_define_const_str(CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29, "CFG: multiple autoconf files found, aborting ('%s' + '%s')", 197663371u, 0, 58, &be_const_str_content_stop); +be_define_const_str(CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found, "CFG: no '*.autoconf' file found", 127493957u, 0, 31, &be_const_str_byte); +be_define_const_str(CFG_X3A_X20ran_X20_X20, "CFG: ran ", 3579570472u, 0, 10, &be_const_str_draw_line_dsc_init); +be_define_const_str(CFG_X3A_X20removed_X20file_X20_X27_X25s_X27, "CFG: removed file '%s'", 2048602473u, 0, 22, &be_const_str_pixel_size); +be_define_const_str(CFG_X3A_X20removing_X20autoconf_X20files, "CFG: removing autoconf files", 4014704970u, 0, 28, &be_const_str_issubclass); +be_define_const_str(CFG_X3A_X20removing_X20first_X20time_X20marker, "CFG: removing first time marker", 2125556683u, 0, 31, NULL); +be_define_const_str(CFG_X3A_X20return_code_X3D_X25i, "CFG: return_code=%i", 2059897320u, 0, 19, &be_const_str_get_option); +be_define_const_str(CFG_X3A_X20running_X20, "CFG: running ", 2478334534u, 0, 13, &be_const_str_get_vbus_voltage); +be_define_const_str(CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, "CFG: skipping 'display.ini' because already present in file-system", 3965549264u, 0, 66, &be_const_str_create_custom_widget); +be_define_const_str(COLOR_BLACK, "COLOR_BLACK", 264427940u, 0, 11, &be_const_str_SERIAL_6N2); +be_define_const_str(COLOR_WHITE, "COLOR_WHITE", 2536871270u, 0, 11, &be_const_str_wd); +be_define_const_str(EC_C25519, "EC_C25519", 95492591u, 0, 9, &be_const_str__filename); +be_define_const_str(EVENT_DRAW_MAIN, "EVENT_DRAW_MAIN", 1955620614u, 0, 15, &be_const_str_from_to); +be_define_const_str(EVENT_DRAW_PART_BEGIN, "EVENT_DRAW_PART_BEGIN", 3391865024u, 0, 21, NULL); +be_define_const_str(EVENT_DRAW_PART_END, "EVENT_DRAW_PART_END", 3301625292u, 0, 19, &be_const_str_set_pixel_color); +be_define_const_str(False, "False", 2541049336u, 0, 5, &be_const_str_get_style_line_color); +be_define_const_str(GET, "GET", 2531704439u, 0, 3, &be_const_str_SERIAL_5N1); +be_define_const_str(HTTP_GET, "HTTP_GET", 1722467738u, 0, 8, &be_const_str_dac_voltage); +be_define_const_str(HTTP_POST, "HTTP_POST", 1999554144u, 0, 9, &be_const_str_widget_event_impl); +be_define_const_str(I2C_X3A, "I2C:", 813483371u, 0, 4, &be_const_str_WS2812); +be_define_const_str(I2C_Driver, "I2C_Driver", 1714501658u, 0, 10, &be_const_str_SERIAL_5O2); +be_define_const_str(LVG_X3A_X20call_X20to_X20unsupported_X20callback, "LVG: call to unsupported callback", 504176819u, 0, 33, &be_const_str__end_transmission); +be_define_const_str(Leds, "Leds", 2709245275u, 0, 4, &be_const_str_display_X2Eini); +be_define_const_str(MD5, "MD5", 1935726387u, 0, 3, NULL); +be_define_const_str(No_X20callback_X20available, "No callback available", 633786138u, 0, 21, &be_const_str_point); +be_define_const_str(None, "None", 810547195u, 0, 4, &be_const_str_day); +be_define_const_str(OPTION_A, "OPTION_A", 1133299440u, 0, 8, &be_const_str_isnan); +be_define_const_str(OneWire, "OneWire", 2298990722u, 0, 7, &be_const_str_is_first_time); +be_define_const_str(PART_MAIN, "PART_MAIN", 2473491508u, 0, 9, &be_const_str__ccmd); +be_define_const_str(POST, "POST", 1929554311u, 0, 4, &be_const_str_getbits); +be_define_const_str(Parameter_X20error, "Parameter error", 3840042038u, 0, 15, NULL); +be_define_const_str(RES_OK, "RES_OK", 1233817284u, 0, 6, &be_const_str_k); +be_define_const_str(Restart_X201, "Restart 1", 3504455855u, 0, 9, &be_const_str_year); +be_define_const_str(SERIAL_5E1, "SERIAL_5E1", 1163775235u, 0, 10, &be_const_str_SERIAL_8N1); +be_define_const_str(SERIAL_5E2, "SERIAL_5E2", 1180552854u, 0, 10, &be_const_str_SERIAL_8N2); be_define_const_str(SERIAL_5N1, "SERIAL_5N1", 3313031680u, 0, 10, NULL); -be_define_const_str(SERIAL_5N2, "SERIAL_5N2", 3363364537u, 0, 10, &be_const_str__settings_def); -be_define_const_str(SERIAL_5O1, "SERIAL_5O1", 3782657917u, 0, 10, NULL); -be_define_const_str(SERIAL_5O2, "SERIAL_5O2", 3732325060u, 0, 10, &be_const_str_color); -be_define_const_str(SERIAL_6E1, "SERIAL_6E1", 334249486u, 0, 10, &be_const_str_is_first_time); -be_define_const_str(SERIAL_6E2, "SERIAL_6E2", 317471867u, 0, 10, NULL); -be_define_const_str(SERIAL_6N1, "SERIAL_6N1", 198895701u, 0, 10, &be_const_str_back_forth); -be_define_const_str(SERIAL_6N2, "SERIAL_6N2", 148562844u, 0, 10, &be_const_str__global_def); -be_define_const_str(SERIAL_6O1, "SERIAL_6O1", 266153272u, 0, 10, &be_const_str_iter); -be_define_const_str(SERIAL_6O2, "SERIAL_6O2", 316486129u, 0, 10, &be_const_str_get_vbus_current); -be_define_const_str(SERIAL_7E1, "SERIAL_7E1", 147718061u, 0, 10, &be_const_str_addr); -be_define_const_str(SERIAL_7E2, "SERIAL_7E2", 97385204u, 0, 10, &be_const_str__X7D); -be_define_const_str(SERIAL_7N1, "SERIAL_7N1", 1891060246u, 0, 10, &be_const_str_sin); -be_define_const_str(SERIAL_7N2, "SERIAL_7N2", 1874282627u, 0, 10, &be_const_str_nan); -be_define_const_str(SERIAL_7O1, "SERIAL_7O1", 1823802675u, 0, 10, &be_const_str_geti); -be_define_const_str(SERIAL_7O2, "SERIAL_7O2", 1840580294u, 0, 10, &be_const_str__filename); -be_define_const_str(SERIAL_8E1, "SERIAL_8E1", 2371121616u, 0, 10, &be_const_str_json_fdump_any); -be_define_const_str(SERIAL_8E2, "SERIAL_8E2", 2421454473u, 0, 10, &be_const_str_draw_line_dsc_init); -be_define_const_str(SERIAL_8N1, "SERIAL_8N1", 2369297235u, 0, 10, &be_const_str_SK6812_GRBW); -be_define_const_str(SERIAL_8N2, "SERIAL_8N2", 2386074854u, 0, 10, &be_const_str_digital_write); -be_define_const_str(SERIAL_8O1, "SERIAL_8O1", 289122742u, 0, 10, NULL); -be_define_const_str(SERIAL_8O2, "SERIAL_8O2", 272345123u, 0, 10, &be_const_str_attrdump); -be_define_const_str(SK6812_GRBW, "SK6812_GRBW", 81157857u, 0, 11, NULL); -be_define_const_str(STATE_DEFAULT, "STATE_DEFAULT", 712406428u, 0, 13, &be_const_str_y); -be_define_const_str(TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, "TAP: found Tasmota App '%s'", 2643152398u, 0, 27, NULL); -be_define_const_str(Tasmota, "Tasmota", 4047617668u, 0, 7, &be_const_str_flush); -be_define_const_str(Tele, "Tele", 1329980653u, 0, 4, &be_const_str_setbits); -be_define_const_str(Timer, "Timer", 3948127682u, 0, 5, &be_const_str__buffer); -be_define_const_str(True, "True", 3453902341u, 0, 4, &be_const_str__X5D); -be_define_const_str(Unknown_X20command, "Unknown command", 1830905432u, 0, 15, &be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf); -be_define_const_str(WS2812, "WS2812", 3539741218u, 0, 6, &be_const_str__error); -be_define_const_str(WS2812_GRB, "WS2812_GRB", 1736405692u, 0, 10, &be_const_str_create_segment); -be_define_const_str(Wire, "Wire", 1938276536u, 0, 4, &be_const_str_read24); -be_define_const_str(_X5B, "[", 3725336506u, 0, 1, &be_const_str_set_useragent); -be_define_const_str(_X5D, "]", 3624670792u, 0, 1, &be_const_str_add_rule); -be_define_const_str(_, "_", 3658226030u, 0, 1, NULL); -be_define_const_str(__iterator__, "__iterator__", 3884039703u, 0, 12, &be_const_str_resp_cmnd); -be_define_const_str(__lower__, "__lower__", 123855590u, 0, 9, &be_const_str_clear); -be_define_const_str(__upper__, "__upper__", 3612202883u, 0, 9, NULL); -be_define_const_str(_anonymous_, "_anonymous_", 1957281476u, 0, 11, &be_const_str_out_X20of_X20range); -be_define_const_str(_archive, "_archive", 4004559404u, 0, 8, NULL); -be_define_const_str(_available, "_available", 1306196581u, 0, 10, NULL); -be_define_const_str(_begin_transmission, "_begin_transmission", 2779461176u, 0, 19, &be_const_str_deg); -be_define_const_str(_buffer, "_buffer", 2044888568u, 0, 7, &be_const_str_exec_tele); -be_define_const_str(_cb, "_cb", 4043300367u, 0, 3, &be_const_str_save_before_restart); -be_define_const_str(_ccmd, "_ccmd", 2163421413u, 0, 5, &be_const_str_count); -be_define_const_str(_class, "_class", 2732146350u, 0, 6, &be_const_str_strip); -be_define_const_str(_cmd, "_cmd", 3419822142u, 0, 4, &be_const_str_clear_first_time); -be_define_const_str(_debug_present, "_debug_present", 4063411725u, 0, 14, &be_const_str_input); -be_define_const_str(_def, "_def", 1985022181u, 0, 4, &be_const_str__write); -be_define_const_str(_dirty, "_dirty", 283846766u, 0, 6, &be_const_str_setitem); -be_define_const_str(_drivers, "_drivers", 3260328985u, 0, 8, &be_const_str_imax); -be_define_const_str(_end_transmission, "_end_transmission", 3237480400u, 0, 17, &be_const_str_content_send); -be_define_const_str(_energy, "_energy", 535372070u, 0, 7, &be_const_str_public_key); -be_define_const_str(_error, "_error", 1132109656u, 0, 6, &be_const_str_member); -be_define_const_str(_filename, "_filename", 1430813195u, 0, 9, &be_const_str_zip); -be_define_const_str(_get_cb, "_get_cb", 1448849122u, 0, 7, &be_const_str_area); -be_define_const_str(_global_addr, "_global_addr", 533766721u, 0, 12, &be_const_str_math); -be_define_const_str(_global_def, "_global_def", 646007001u, 0, 11, &be_const_str_chars_in_string); -be_define_const_str(_lvgl, "_lvgl", 2689219483u, 0, 5, &be_const_str_ins_goto); -be_define_const_str(_p, "_p", 1594591802u, 0, 2, &be_const_str_get_input_power_status); -be_define_const_str(_persist_X2Ejson, "_persist.json", 2008425138u, 0, 13, &be_const_str_number); +be_define_const_str(SERIAL_5N2, "SERIAL_5N2", 3363364537u, 0, 10, &be_const_str_read_sensors); +be_define_const_str(SERIAL_5O1, "SERIAL_5O1", 3782657917u, 0, 10, &be_const_str_return); +be_define_const_str(SERIAL_5O2, "SERIAL_5O2", 3732325060u, 0, 10, &be_const_str__t); +be_define_const_str(SERIAL_6E1, "SERIAL_6E1", 334249486u, 0, 10, NULL); +be_define_const_str(SERIAL_6E2, "SERIAL_6E2", 317471867u, 0, 10, &be_const_str_digital_write); +be_define_const_str(SERIAL_6N1, "SERIAL_6N1", 198895701u, 0, 10, &be_const_str__X5D); +be_define_const_str(SERIAL_6N2, "SERIAL_6N2", 148562844u, 0, 10, &be_const_str__settings_def); +be_define_const_str(SERIAL_6O1, "SERIAL_6O1", 266153272u, 0, 10, &be_const_str_couldn_X27t_X20not_X20initialize_X20noepixelbus); +be_define_const_str(SERIAL_6O2, "SERIAL_6O2", 316486129u, 0, 10, &be_const_str_deregister_obj); +be_define_const_str(SERIAL_7E1, "SERIAL_7E1", 147718061u, 0, 10, &be_const_str_call); +be_define_const_str(SERIAL_7E2, "SERIAL_7E2", 97385204u, 0, 10, &be_const_str_global); +be_define_const_str(SERIAL_7N1, "SERIAL_7N1", 1891060246u, 0, 10, &be_const_str_encrypt); +be_define_const_str(SERIAL_7N2, "SERIAL_7N2", 1874282627u, 0, 10, &be_const_str_alternate); +be_define_const_str(SERIAL_7O1, "SERIAL_7O1", 1823802675u, 0, 10, NULL); +be_define_const_str(SERIAL_7O2, "SERIAL_7O2", 1840580294u, 0, 10, &be_const_str_arch); +be_define_const_str(SERIAL_8E1, "SERIAL_8E1", 2371121616u, 0, 10, &be_const_str__available); +be_define_const_str(SERIAL_8E2, "SERIAL_8E2", 2421454473u, 0, 10, NULL); +be_define_const_str(SERIAL_8N1, "SERIAL_8N1", 2369297235u, 0, 10, &be_const_str_imin); +be_define_const_str(SERIAL_8N2, "SERIAL_8N2", 2386074854u, 0, 10, &be_const_str_gen_cb); +be_define_const_str(SERIAL_8O1, "SERIAL_8O1", 289122742u, 0, 10, &be_const_str_return_X20code_X3D_X25i); +be_define_const_str(SERIAL_8O2, "SERIAL_8O2", 272345123u, 0, 10, &be_const_str_tag); +be_define_const_str(SK6812_GRBW, "SK6812_GRBW", 81157857u, 0, 11, &be_const_str_item); +be_define_const_str(STATE_DEFAULT, "STATE_DEFAULT", 712406428u, 0, 13, &be_const_str_pop); +be_define_const_str(TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, "TAP: found Tasmota App '%s'", 2643152398u, 0, 27, &be_const_str_closure); +be_define_const_str(Tasmota, "Tasmota", 4047617668u, 0, 7, &be_const_str_dump); +be_define_const_str(Tele, "Tele", 1329980653u, 0, 4, &be_const_str_f); +be_define_const_str(Timer, "Timer", 3948127682u, 0, 5, &be_const_str_check_privileged_access); +be_define_const_str(True, "True", 3453902341u, 0, 4, &be_const_str_hs2rgb); +be_define_const_str(Unknown_X20command, "Unknown command", 1830905432u, 0, 15, &be_const_str_map); +be_define_const_str(WS2812, "WS2812", 3539741218u, 0, 6, NULL); +be_define_const_str(WS2812_GRB, "WS2812_GRB", 1736405692u, 0, 10, NULL); +be_define_const_str(Wire, "Wire", 1938276536u, 0, 4, NULL); +be_define_const_str(_X5B, "[", 3725336506u, 0, 1, &be_const_str_get_object_from_ptr); +be_define_const_str(_X5D, "]", 3624670792u, 0, 1, &be_const_str_x1); +be_define_const_str(_, "_", 3658226030u, 0, 1, &be_const_str_widget_struct_by_class); +be_define_const_str(__iterator__, "__iterator__", 3884039703u, 0, 12, &be_const_str_asin); +be_define_const_str(__lower__, "__lower__", 123855590u, 0, 9, &be_const_str_public_key); +be_define_const_str(__upper__, "__upper__", 3612202883u, 0, 9, &be_const_str_class_init_obj); +be_define_const_str(_anonymous_, "_anonymous_", 1957281476u, 0, 11, &be_const_str_matrix); +be_define_const_str(_archive, "_archive", 4004559404u, 0, 8, &be_const_str_isrunning); +be_define_const_str(_available, "_available", 1306196581u, 0, 10, &be_const_str_setitem); +be_define_const_str(_begin_transmission, "_begin_transmission", 2779461176u, 0, 19, NULL); +be_define_const_str(_buffer, "_buffer", 2044888568u, 0, 7, &be_const_str_seti); +be_define_const_str(_cb, "_cb", 4043300367u, 0, 3, &be_const_str_copy); +be_define_const_str(_ccmd, "_ccmd", 2163421413u, 0, 5, &be_const_str_enabled); +be_define_const_str(_class, "_class", 2732146350u, 0, 6, &be_const_str__dirty); +be_define_const_str(_cmd, "_cmd", 3419822142u, 0, 4, &be_const_str_nan); +be_define_const_str(_debug_present, "_debug_present", 4063411725u, 0, 14, NULL); +be_define_const_str(_def, "_def", 1985022181u, 0, 4, NULL); +be_define_const_str(_dirty, "_dirty", 283846766u, 0, 6, &be_const_str_content_start); +be_define_const_str(_drivers, "_drivers", 3260328985u, 0, 8, &be_const_str_del); +be_define_const_str(_end_transmission, "_end_transmission", 3237480400u, 0, 17, &be_const_str_math); +be_define_const_str(_energy, "_energy", 535372070u, 0, 7, &be_const_str_reduce); +be_define_const_str(_error, "_error", 1132109656u, 0, 6, NULL); +be_define_const_str(_filename, "_filename", 1430813195u, 0, 9, NULL); +be_define_const_str(_get_cb, "_get_cb", 1448849122u, 0, 7, &be_const_str_begin); +be_define_const_str(_global_addr, "_global_addr", 533766721u, 0, 12, &be_const_str_add_rule); +be_define_const_str(_global_def, "_global_def", 646007001u, 0, 11, &be_const_str_destructor_cb); +be_define_const_str(_lvgl, "_lvgl", 2689219483u, 0, 5, NULL); +be_define_const_str(_p, "_p", 1594591802u, 0, 2, &be_const_str_scan); +be_define_const_str(_persist_X2Ejson, "_persist.json", 2008425138u, 0, 13, NULL); be_define_const_str(_ptr, "_ptr", 306235816u, 0, 4, NULL); -be_define_const_str(_read, "_read", 346717030u, 0, 5, NULL); -be_define_const_str(_request_from, "_request_from", 3965148604u, 0, 13, &be_const_str_point); -be_define_const_str(_rules, "_rules", 4266217105u, 0, 6, &be_const_str_find); -be_define_const_str(_settings_def, "_settings_def", 3775560307u, 0, 13, &be_const_str_content_stop); -be_define_const_str(_settings_ptr, "_settings_ptr", 1825772182u, 0, 13, &be_const_str_local); -be_define_const_str(_t, "_t", 1527481326u, 0, 2, NULL); -be_define_const_str(_timers, "_timers", 2600100916u, 0, 7, &be_const_str_set_style_line_color); -be_define_const_str(_write, "_write", 2215462825u, 0, 6, NULL); -be_define_const_str(a, "a", 3826002220u, 0, 1, &be_const_str_cmd_res); +be_define_const_str(_read, "_read", 346717030u, 0, 5, &be_const_str_calldepth); +be_define_const_str(_request_from, "_request_from", 3965148604u, 0, 13, &be_const_str_set_x); +be_define_const_str(_rules, "_rules", 4266217105u, 0, 6, NULL); +be_define_const_str(_settings_def, "_settings_def", 3775560307u, 0, 13, &be_const_str_offseta); +be_define_const_str(_settings_ptr, "_settings_ptr", 1825772182u, 0, 13, &be_const_str_event_send); +be_define_const_str(_t, "_t", 1527481326u, 0, 2, &be_const_str_resolvecmnd); +be_define_const_str(_timers, "_timers", 2600100916u, 0, 7, &be_const_str_add); +be_define_const_str(_write, "_write", 2215462825u, 0, 6, &be_const_str_read12); +be_define_const_str(a, "a", 3826002220u, 0, 1, &be_const_str_get_string); be_define_const_str(abs, "abs", 709362235u, 0, 3, NULL); -be_define_const_str(acos, "acos", 1006755615u, 0, 4, &be_const_str_content_flush); -be_define_const_str(add, "add", 993596020u, 0, 3, &be_const_str_rtc); -be_define_const_str(add_anim, "add_anim", 3980662668u, 0, 8, &be_const_str_lv); -be_define_const_str(add_cmd, "add_cmd", 3361630879u, 0, 7, &be_const_str_instance); -be_define_const_str(add_driver, "add_driver", 1654458371u, 0, 10, &be_const_str_content_button); -be_define_const_str(add_header, "add_header", 927130612u, 0, 10, NULL); -be_define_const_str(add_rule, "add_rule", 596540743u, 0, 8, &be_const_str_finish); -be_define_const_str(addr, "addr", 1087856498u, 0, 4, NULL); -be_define_const_str(allocated, "allocated", 429986098u, 0, 9, &be_const_str_check_privileged_access); +be_define_const_str(acos, "acos", 1006755615u, 0, 4, &be_const_str_def); +be_define_const_str(add, "add", 993596020u, 0, 3, &be_const_str_zero); +be_define_const_str(add_anim, "add_anim", 3980662668u, 0, 8, &be_const_str_content_flush); +be_define_const_str(add_cmd, "add_cmd", 3361630879u, 0, 7, NULL); +be_define_const_str(add_driver, "add_driver", 1654458371u, 0, 10, &be_const_str_atan2); +be_define_const_str(add_header, "add_header", 927130612u, 0, 10, &be_const_str_set_percentage); +be_define_const_str(add_rule, "add_rule", 596540743u, 0, 8, &be_const_str_call_native); +be_define_const_str(addr, "addr", 1087856498u, 0, 4, &be_const_str_create_matrix); +be_define_const_str(allocated, "allocated", 429986098u, 0, 9, &be_const_str_toptr); be_define_const_str(alternate, "alternate", 1140253277u, 0, 9, NULL); -be_define_const_str(animate, "animate", 3885786800u, 0, 7, &be_const_str_hex); -be_define_const_str(animators, "animators", 279858213u, 0, 9, &be_const_str_bool); -be_define_const_str(arch, "arch", 2952804297u, 0, 4, &be_const_str_deregister_obj); -be_define_const_str(area, "area", 2601460036u, 0, 4, &be_const_str_ins_ramp); -be_define_const_str(arg, "arg", 1047474471u, 0, 3, &be_const_str_webserver); -be_define_const_str(arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj, "arg must be a subclass of lv_obj", 1641882079u, 0, 32, &be_const_str_tasmota); -be_define_const_str(arg_name, "arg_name", 1345046155u, 0, 8, NULL); -be_define_const_str(arg_size, "arg_size", 3310243257u, 0, 8, &be_const_str_compile); +be_define_const_str(animate, "animate", 3885786800u, 0, 7, &be_const_str_function); +be_define_const_str(animators, "animators", 279858213u, 0, 9, &be_const_str_traceback); +be_define_const_str(arch, "arch", 2952804297u, 0, 4, NULL); +be_define_const_str(area, "area", 2601460036u, 0, 4, &be_const_str_find); +be_define_const_str(arg, "arg", 1047474471u, 0, 3, NULL); +be_define_const_str(arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj, "arg must be a subclass of lv_obj", 1641882079u, 0, 32, &be_const_str_as); +be_define_const_str(arg_name, "arg_name", 1345046155u, 0, 8, &be_const_str_widget_height_def); +be_define_const_str(arg_size, "arg_size", 3310243257u, 0, 8, NULL); be_define_const_str(as, "as", 1579491469u, 67, 2, NULL); -be_define_const_str(asin, "asin", 4272848550u, 0, 4, &be_const_str_dac_voltage); -be_define_const_str(assert, "assert", 2774883451u, 0, 6, &be_const_str_ctor); -be_define_const_str(asstring, "asstring", 1298225088u, 0, 8, &be_const_str_size); -be_define_const_str(atan, "atan", 108579519u, 0, 4, NULL); -be_define_const_str(atan2, "atan2", 3173440503u, 0, 5, &be_const_str_close); -be_define_const_str(atleast1, "atleast1", 1956331672u, 0, 8, &be_const_str_from_to); -be_define_const_str(attrdump, "attrdump", 1521571304u, 0, 8, &be_const_str_calldepth); -be_define_const_str(autoexec, "autoexec", 3676861891u, 0, 8, &be_const_str_v); -be_define_const_str(autorun, "autorun", 1447527407u, 0, 7, NULL); -be_define_const_str(available, "available", 1727918744u, 0, 9, &be_const_str_publish); +be_define_const_str(asin, "asin", 4272848550u, 0, 4, &be_const_str_get_current_module_name); +be_define_const_str(assert, "assert", 2774883451u, 0, 6, &be_const_str_display); +be_define_const_str(asstring, "asstring", 1298225088u, 0, 8, &be_const_str_get_temp); +be_define_const_str(atan, "atan", 108579519u, 0, 4, &be_const_str_publish); +be_define_const_str(atan2, "atan2", 3173440503u, 0, 5, &be_const_str_json_fdump_list); +be_define_const_str(atleast1, "atleast1", 1956331672u, 0, 8, &be_const_str_exp); +be_define_const_str(attrdump, "attrdump", 1521571304u, 0, 8, &be_const_str_cb_do_nothing); +be_define_const_str(autoexec, "autoexec", 3676861891u, 0, 8, &be_const_str_cmd_res); +be_define_const_str(autorun, "autorun", 1447527407u, 0, 7, &be_const_str_log); +be_define_const_str(available, "available", 1727918744u, 0, 9, NULL); be_define_const_str(b, "b", 3876335077u, 0, 1, &be_const_str_get_bri); -be_define_const_str(back_forth, "back_forth", 2665042062u, 0, 10, &be_const_str_toptr); -be_define_const_str(base_class, "base_class", 1107737279u, 0, 10, &be_const_str_get_string); -be_define_const_str(battery_present, "battery_present", 3588397058u, 0, 15, &be_const_str_day); -be_define_const_str(begin, "begin", 1748273790u, 0, 5, NULL); -be_define_const_str(bool, "bool", 3365180733u, 0, 4, NULL); +be_define_const_str(back_forth, "back_forth", 2665042062u, 0, 10, &be_const_str_debug); +be_define_const_str(base_class, "base_class", 1107737279u, 0, 10, &be_const_str_is_running); +be_define_const_str(battery_present, "battery_present", 3588397058u, 0, 15, NULL); +be_define_const_str(begin, "begin", 1748273790u, 0, 5, &be_const_str_char); +be_define_const_str(bool, "bool", 3365180733u, 0, 4, &be_const_str_log10); be_define_const_str(break, "break", 3378807160u, 58, 5, NULL); -be_define_const_str(bri, "bri", 2112284244u, 0, 3, &be_const_str_get_warning_level); -be_define_const_str(bus, "bus", 1607822841u, 0, 3, &be_const_str_false); -be_define_const_str(button_pressed, "button_pressed", 1694209616u, 0, 14, NULL); -be_define_const_str(byte, "byte", 1683620383u, 0, 4, &be_const_str_load_templates); -be_define_const_str(bytes, "bytes", 1706151940u, 0, 5, NULL); -be_define_const_str(c, "c", 3859557458u, 0, 1, NULL); -be_define_const_str(call, "call", 3018949801u, 0, 4, &be_const_str_round_start); -be_define_const_str(call_native, "call_native", 1389147405u, 0, 11, &be_const_str_delete_all_configs); -be_define_const_str(calldepth, "calldepth", 3122364302u, 0, 9, NULL); -be_define_const_str(can_show, "can_show", 960091187u, 0, 8, &be_const_str_pin_mode); -be_define_const_str(cb_dispatch, "cb_dispatch", 1741510499u, 0, 11, &be_const_str_register_obj); -be_define_const_str(cb_do_nothing, "cb_do_nothing", 1488730702u, 0, 13, NULL); -be_define_const_str(cb_event_closure, "cb_event_closure", 3828267325u, 0, 16, &be_const_str_remove_driver); +be_define_const_str(bri, "bri", 2112284244u, 0, 3, &be_const_str_set_style_pad_right); +be_define_const_str(bus, "bus", 1607822841u, 0, 3, &be_const_str_minute); +be_define_const_str(button_pressed, "button_pressed", 1694209616u, 0, 14, &be_const_str_editable); +be_define_const_str(byte, "byte", 1683620383u, 0, 4, &be_const_str_set_timeouts); +be_define_const_str(bytes, "bytes", 1706151940u, 0, 5, &be_const_str_read); +be_define_const_str(c, "c", 3859557458u, 0, 1, &be_const_str_state); +be_define_const_str(call, "call", 3018949801u, 0, 4, &be_const_str_get_coords); +be_define_const_str(call_native, "call_native", 1389147405u, 0, 11, &be_const_str_read8); +be_define_const_str(calldepth, "calldepth", 3122364302u, 0, 9, &be_const_str__X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); +be_define_const_str(can_show, "can_show", 960091187u, 0, 8, &be_const_str_month); +be_define_const_str(cb_dispatch, "cb_dispatch", 1741510499u, 0, 11, &be_const_str_offset); +be_define_const_str(cb_do_nothing, "cb_do_nothing", 1488730702u, 0, 13, &be_const_str_contains); +be_define_const_str(cb_event_closure, "cb_event_closure", 3828267325u, 0, 16, &be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E); be_define_const_str(cb_obj, "cb_obj", 1195696482u, 0, 6, NULL); be_define_const_str(ceil, "ceil", 1659167240u, 0, 4, NULL); -be_define_const_str(char, "char", 2823553821u, 0, 4, &be_const_str_enabled); -be_define_const_str(chars_in_string, "chars_in_string", 3148785132u, 0, 15, &be_const_str_file); -be_define_const_str(check_privileged_access, "check_privileged_access", 3692933968u, 0, 23, &be_const_str_json_fdump_map); +be_define_const_str(char, "char", 2823553821u, 0, 4, &be_const_str_every_50ms); +be_define_const_str(chars_in_string, "chars_in_string", 3148785132u, 0, 15, &be_const_str_draw_line_dsc); +be_define_const_str(check_privileged_access, "check_privileged_access", 3692933968u, 0, 23, &be_const_str_solidified); be_define_const_str(class, "class", 2872970239u, 57, 5, NULL); -be_define_const_str(class_init_obj, "class_init_obj", 178410604u, 0, 14, &be_const_str_widget_ctor_impl); +be_define_const_str(class_init_obj, "class_init_obj", 178410604u, 0, 14, NULL); be_define_const_str(classname, "classname", 1998589948u, 0, 9, NULL); -be_define_const_str(classof, "classof", 1796577762u, 0, 7, &be_const_str_json_fdump); -be_define_const_str(clear, "clear", 1550717474u, 0, 5, &be_const_str_counters); -be_define_const_str(clear_first_time, "clear_first_time", 632769909u, 0, 16, NULL); -be_define_const_str(clear_to, "clear_to", 3528002130u, 0, 8, NULL); -be_define_const_str(close, "close", 667630371u, 0, 5, &be_const_str_issubclass); -be_define_const_str(closure, "closure", 1548407746u, 0, 7, NULL); -be_define_const_str(cmd, "cmd", 4136785899u, 0, 3, NULL); -be_define_const_str(cmd_res, "cmd_res", 921166762u, 0, 7, &be_const_str_zero); -be_define_const_str(code, "code", 4180765940u, 0, 4, NULL); -be_define_const_str(codedump, "codedump", 1786337906u, 0, 8, &be_const_str_decrypt); -be_define_const_str(collect, "collect", 2399039025u, 0, 7, &be_const_str_fromb64); -be_define_const_str(color, "color", 1031692888u, 0, 5, &be_const_str_debug); -be_define_const_str(compile, "compile", 1000265118u, 0, 7, &be_const_str_page_autoconf_ctl); -be_define_const_str(compress, "compress", 2818084237u, 0, 8, &be_const_str_has_arg); -be_define_const_str(concat, "concat", 4124019837u, 0, 6, &be_const_str_raise); -be_define_const_str(connection_error, "connection_error", 1358926260u, 0, 16, &be_const_str_strftime); -be_define_const_str(constructor_cb, "constructor_cb", 2489105297u, 0, 14, NULL); -be_define_const_str(contains, "contains", 1825239352u, 0, 8, NULL); -be_define_const_str(content_button, "content_button", 1956476087u, 0, 14, NULL); -be_define_const_str(content_flush, "content_flush", 214922475u, 0, 13, &be_const_str_except); -be_define_const_str(content_send, "content_send", 1673733649u, 0, 12, &be_const_str_lower); -be_define_const_str(content_send_style, "content_send_style", 1087907647u, 0, 18, &be_const_str_create_custom_widget); -be_define_const_str(content_start, "content_start", 2937509069u, 0, 13, &be_const_str_del); -be_define_const_str(content_stop, "content_stop", 658554751u, 0, 12, &be_const_str_update); +be_define_const_str(classof, "classof", 1796577762u, 0, 7, &be_const_str_gamma); +be_define_const_str(clear, "clear", 1550717474u, 0, 5, NULL); +be_define_const_str(clear_first_time, "clear_first_time", 632769909u, 0, 16, &be_const_str_get_power); +be_define_const_str(clear_to, "clear_to", 3528002130u, 0, 8, &be_const_str_tanh); +be_define_const_str(close, "close", 667630371u, 0, 5, &be_const_str_write_bit); +be_define_const_str(closure, "closure", 1548407746u, 0, 7, &be_const_str_cmd); +be_define_const_str(cmd, "cmd", 4136785899u, 0, 3, &be_const_str_get_switch); +be_define_const_str(cmd_res, "cmd_res", 921166762u, 0, 7, NULL); +be_define_const_str(code, "code", 4180765940u, 0, 4, &be_const_str_group_def); +be_define_const_str(codedump, "codedump", 1786337906u, 0, 8, &be_const_str_members); +be_define_const_str(collect, "collect", 2399039025u, 0, 7, &be_const_str_file); +be_define_const_str(color, "color", 1031692888u, 0, 5, &be_const_str_get_width); +be_define_const_str(compile, "compile", 1000265118u, 0, 7, &be_const_str_ctypes_bytes); +be_define_const_str(compress, "compress", 2818084237u, 0, 8, &be_const_str_find_op); +be_define_const_str(concat, "concat", 4124019837u, 0, 6, &be_const_str_widget_dtor_impl); +be_define_const_str(connect, "connect", 2866859257u, 0, 7, &be_const_str_stop); +be_define_const_str(connected, "connected", 1424938192u, 0, 9, &be_const_str_obj_event_base); +be_define_const_str(connection_error, "connection_error", 1358926260u, 0, 16, &be_const_str_wifi); +be_define_const_str(constructor_cb, "constructor_cb", 2489105297u, 0, 14, &be_const_str_round_start); +be_define_const_str(contains, "contains", 1825239352u, 0, 8, &be_const_str_deinit); +be_define_const_str(content_button, "content_button", 1956476087u, 0, 14, &be_const_str_write); +be_define_const_str(content_flush, "content_flush", 214922475u, 0, 13, NULL); +be_define_const_str(content_send, "content_send", 1673733649u, 0, 12, NULL); +be_define_const_str(content_send_style, "content_send_style", 1087907647u, 0, 18, &be_const_str_is_dirty); +be_define_const_str(content_start, "content_start", 2937509069u, 0, 13, NULL); +be_define_const_str(content_stop, "content_stop", 658554751u, 0, 12, &be_const_str_line_dsc); be_define_const_str(continue, "continue", 2977070660u, 59, 8, NULL); -be_define_const_str(copy, "copy", 3848464964u, 0, 4, &be_const_str_detected_X20on_X20bus); -be_define_const_str(cos, "cos", 4220379804u, 0, 3, &be_const_str_obj_class_create_obj); -be_define_const_str(cosh, "cosh", 4099687964u, 0, 4, &be_const_str_get_style_line_color); -be_define_const_str(couldn_X27t_X20not_X20initialize_X20noepixelbus, "couldn't not initialize noepixelbus", 2536490812u, 0, 35, &be_const_str__X7B_X7D); -be_define_const_str(count, "count", 967958004u, 0, 5, &be_const_str_hs2rgb); -be_define_const_str(counters, "counters", 4095866864u, 0, 8, &be_const_str_set_width); -be_define_const_str(create_custom_widget, "create_custom_widget", 1140594778u, 0, 20, &be_const_str_super); -be_define_const_str(create_matrix, "create_matrix", 3528185923u, 0, 13, &be_const_str_exec_cmd); -be_define_const_str(create_segment, "create_segment", 3863522719u, 0, 14, &be_const_str_reverse); -be_define_const_str(ctor, "ctor", 375399343u, 0, 4, NULL); -be_define_const_str(ctypes_bytes, "ctypes_bytes", 3879019703u, 0, 12, &be_const_str_lvgl_event_dispatch); -be_define_const_str(ctypes_bytes_dyn, "ctypes_bytes_dyn", 915205307u, 0, 16, &be_const_str_global); -be_define_const_str(dac_voltage, "dac_voltage", 1552257222u, 0, 11, &be_const_str_read12); -be_define_const_str(day, "day", 3830391293u, 0, 3, &be_const_str_fromstring); -be_define_const_str(debug, "debug", 1483009432u, 0, 5, &be_const_str_write_gpio); -be_define_const_str(decompress, "decompress", 2887031650u, 0, 10, &be_const_str_widget_event_impl); -be_define_const_str(decrypt, "decrypt", 2886974618u, 0, 7, &be_const_str_tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29); +be_define_const_str(copy, "copy", 3848464964u, 0, 4, &be_const_str_rad); +be_define_const_str(cos, "cos", 4220379804u, 0, 3, &be_const_str_start); +be_define_const_str(cosh, "cosh", 4099687964u, 0, 4, &be_const_str_h); +be_define_const_str(couldn_X27t_X20not_X20initialize_X20noepixelbus, "couldn't not initialize noepixelbus", 2536490812u, 0, 35, NULL); +be_define_const_str(count, "count", 967958004u, 0, 5, &be_const_str_web_add_console_button); +be_define_const_str(counters, "counters", 4095866864u, 0, 8, &be_const_str_save); +be_define_const_str(create_custom_widget, "create_custom_widget", 1140594778u, 0, 20, &be_const_str_quality); +be_define_const_str(create_matrix, "create_matrix", 3528185923u, 0, 13, &be_const_str_y1); +be_define_const_str(create_segment, "create_segment", 3863522719u, 0, 14, &be_const_str_open); +be_define_const_str(ctor, "ctor", 375399343u, 0, 4, &be_const_str_push); +be_define_const_str(ctypes_bytes, "ctypes_bytes", 3879019703u, 0, 12, NULL); +be_define_const_str(ctypes_bytes_dyn, "ctypes_bytes_dyn", 915205307u, 0, 16, &be_const_str_reapply); +be_define_const_str(dac_voltage, "dac_voltage", 1552257222u, 0, 11, &be_const_str_time_reached); +be_define_const_str(day, "day", 3830391293u, 0, 3, &be_const_str_every_100ms); +be_define_const_str(debug, "debug", 1483009432u, 0, 5, &be_const_str_exec_rules); +be_define_const_str(decompress, "decompress", 2887031650u, 0, 10, NULL); +be_define_const_str(decrypt, "decrypt", 2886974618u, 0, 7, NULL); be_define_const_str(def, "def", 3310976652u, 55, 3, NULL); -be_define_const_str(deg, "deg", 3327754271u, 0, 3, &be_const_str_get_size); -be_define_const_str(deinit, "deinit", 2345559592u, 0, 6, &be_const_str_setmember); -be_define_const_str(del, "del", 3478752842u, 0, 3, &be_const_str_get_alternate); -be_define_const_str(delay, "delay", 1322381784u, 0, 5, &be_const_str_type); -be_define_const_str(delete_all_configs, "delete_all_configs", 2382067578u, 0, 18, NULL); -be_define_const_str(depower, "depower", 3563819571u, 0, 7, &be_const_str_event); -be_define_const_str(deregister_obj, "deregister_obj", 3909966993u, 0, 14, &be_const_str_gamma); -be_define_const_str(destructor_cb, "destructor_cb", 1930283190u, 0, 13, NULL); -be_define_const_str(detect, "detect", 8884370u, 0, 6, &be_const_str_energy_struct); -be_define_const_str(detected_X20on_X20bus, "detected on bus", 1432002650u, 0, 15, &be_const_str_p2); -be_define_const_str(digital_read, "digital_read", 3585496928u, 0, 12, &be_const_str_listdir); -be_define_const_str(digital_write, "digital_write", 3435877979u, 0, 13, &be_const_str_get_coords); -be_define_const_str(dirty, "dirty", 2667581083u, 0, 5, NULL); -be_define_const_str(display, "display", 1164572437u, 0, 7, NULL); +be_define_const_str(deg, "deg", 3327754271u, 0, 3, NULL); +be_define_const_str(deinit, "deinit", 2345559592u, 0, 6, NULL); +be_define_const_str(del, "del", 3478752842u, 0, 3, NULL); +be_define_const_str(delay, "delay", 1322381784u, 0, 5, &be_const_str_run_deferred); +be_define_const_str(delete_all_configs, "delete_all_configs", 2382067578u, 0, 18, &be_const_str_wire1); +be_define_const_str(depower, "depower", 3563819571u, 0, 7, &be_const_str_get_bat_charge_current); +be_define_const_str(deregister_obj, "deregister_obj", 3909966993u, 0, 14, &be_const_str_get_alternate); +be_define_const_str(destructor_cb, "destructor_cb", 1930283190u, 0, 13, &be_const_str_p2); +be_define_const_str(detect, "detect", 8884370u, 0, 6, NULL); +be_define_const_str(detected_X20on_X20bus, "detected on bus", 1432002650u, 0, 15, &be_const_str_run); +be_define_const_str(digital_read, "digital_read", 3585496928u, 0, 12, NULL); +be_define_const_str(digital_write, "digital_write", 3435877979u, 0, 13, &be_const_str_gamma8); +be_define_const_str(dirty, "dirty", 2667581083u, 0, 5, &be_const_str_pop_path); +be_define_const_str(display, "display", 1164572437u, 0, 7, &be_const_str_finish); be_define_const_str(display_X2Eini, "display.ini", 2646174001u, 0, 11, NULL); be_define_const_str(do, "do", 1646057492u, 65, 2, NULL); -be_define_const_str(draw_arc, "draw_arc", 1828251676u, 0, 8, NULL); -be_define_const_str(draw_line, "draw_line", 1634465686u, 0, 9, &be_const_str_tomap); -be_define_const_str(draw_line_dsc, "draw_line_dsc", 4220676203u, 0, 13, &be_const_str_on); -be_define_const_str(draw_line_dsc_init, "draw_line_dsc_init", 3866693646u, 0, 18, &be_const_str_get_style_pad_right); -be_define_const_str(due, "due", 3895530293u, 0, 3, &be_const_str_exp); -be_define_const_str(dump, "dump", 3663001223u, 0, 4, &be_const_str_write); -be_define_const_str(duration, "duration", 799079693u, 0, 8, &be_const_str_start); -be_define_const_str(editable, "editable", 60532369u, 0, 8, NULL); +be_define_const_str(draw_arc, "draw_arc", 1828251676u, 0, 8, &be_const_str_hour); +be_define_const_str(draw_line, "draw_line", 1634465686u, 0, 9, NULL); +be_define_const_str(draw_line_dsc, "draw_line_dsc", 4220676203u, 0, 13, &be_const_str_widget_instance_size); +be_define_const_str(draw_line_dsc_init, "draw_line_dsc_init", 3866693646u, 0, 18, NULL); +be_define_const_str(due, "due", 3895530293u, 0, 3, NULL); +be_define_const_str(dump, "dump", 3663001223u, 0, 4, NULL); +be_define_const_str(duration, "duration", 799079693u, 0, 8, &be_const_str_rotate); +be_define_const_str(editable, "editable", 60532369u, 0, 8, &be_const_str_kv); be_define_const_str(elif, "elif", 3232090307u, 51, 4, NULL); -be_define_const_str(else, "else", 3183434736u, 52, 4, &be_const_str_nil); -be_define_const_str(enabled, "enabled", 49525662u, 0, 7, &be_const_str_x); -be_define_const_str(encrypt, "encrypt", 2194327650u, 0, 7, NULL); -be_define_const_str(end, "end", 1787721130u, 56, 3, &be_const_str_if); -be_define_const_str(energy_struct, "energy_struct", 1655792843u, 0, 13, &be_const_str_last_modified); -be_define_const_str(engine, "engine", 3993360443u, 0, 6, &be_const_str_push); -be_define_const_str(erase, "erase", 1010949589u, 0, 5, NULL); -be_define_const_str(escape, "escape", 2652972038u, 0, 6, &be_const_str_range); -be_define_const_str(eth, "eth", 2191266556u, 0, 3, &be_const_str_wire); -be_define_const_str(event, "event", 4264611999u, 0, 5, NULL); -be_define_const_str(event_cb, "event_cb", 3128698017u, 0, 8, &be_const_str_target); -be_define_const_str(event_send, "event_send", 598925582u, 0, 10, &be_const_str_null_cb); -be_define_const_str(every_100ms, "every_100ms", 1546407804u, 0, 11, &be_const_str_tele); -be_define_const_str(every_50ms, "every_50ms", 2383884008u, 0, 10, &be_const_str_pc); -be_define_const_str(every_second, "every_second", 2075451465u, 0, 12, &be_const_str_width_def); +be_define_const_str(else, "else", 3183434736u, 52, 4, NULL); +be_define_const_str(enabled, "enabled", 49525662u, 0, 7, &be_const_str_write_file); +be_define_const_str(encrypt, "encrypt", 2194327650u, 0, 7, &be_const_str_static); +be_define_const_str(end, "end", 1787721130u, 56, 3, &be_const_str_try); +be_define_const_str(energy_struct, "energy_struct", 1655792843u, 0, 13, NULL); +be_define_const_str(engine, "engine", 3993360443u, 0, 6, &be_const_str_widget_destructor); +be_define_const_str(erase, "erase", 1010949589u, 0, 5, &be_const_str_tolower); +be_define_const_str(escape, "escape", 2652972038u, 0, 6, &be_const_str_hex); +be_define_const_str(eth, "eth", 2191266556u, 0, 3, NULL); +be_define_const_str(event, "event", 4264611999u, 0, 5, &be_const_str_set_width); +be_define_const_str(event_cb, "event_cb", 3128698017u, 0, 8, &be_const_str_height_def); +be_define_const_str(event_send, "event_send", 598925582u, 0, 10, &be_const_str_gamma10); +be_define_const_str(every_100ms, "every_100ms", 1546407804u, 0, 11, NULL); +be_define_const_str(every_50ms, "every_50ms", 2383884008u, 0, 10, &be_const_str_page_autoconf_mgr); +be_define_const_str(every_second, "every_second", 2075451465u, 0, 12, &be_const_str_list); be_define_const_str(except, "except", 950914032u, 69, 6, NULL); -be_define_const_str(exec_cmd, "exec_cmd", 493567399u, 0, 8, &be_const_str_has); -be_define_const_str(exec_rules, "exec_rules", 1445221092u, 0, 10, &be_const_str_pin); -be_define_const_str(exec_tele, "exec_tele", 1020751601u, 0, 9, &be_const_str_lv_event); -be_define_const_str(exists, "exists", 1002329533u, 0, 6, NULL); -be_define_const_str(exp, "exp", 1923516200u, 0, 3, &be_const_str_fromptr); -be_define_const_str(f, "f", 3809224601u, 0, 1, &be_const_str_get_current_module_name); +be_define_const_str(exec_cmd, "exec_cmd", 493567399u, 0, 8, &be_const_str_light); +be_define_const_str(exec_rules, "exec_rules", 1445221092u, 0, 10, &be_const_str_reverse); +be_define_const_str(exec_tele, "exec_tele", 1020751601u, 0, 9, &be_const_str_has); +be_define_const_str(exists, "exists", 1002329533u, 0, 6, &be_const_str_setbits); +be_define_const_str(exp, "exp", 1923516200u, 0, 3, &be_const_str_tasmota); +be_define_const_str(f, "f", 3809224601u, 0, 1, &be_const_str_input); be_define_const_str(false, "false", 184981848u, 62, 5, NULL); -be_define_const_str(file, "file", 2867484483u, 0, 4, &be_const_str_get_bat_current); -be_define_const_str(file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27, "file extension is not '.be' or '.bec'", 3095719639u, 0, 37, &be_const_str_ip); -be_define_const_str(files, "files", 1055342736u, 0, 5, NULL); -be_define_const_str(find, "find", 3186656602u, 0, 4, &be_const_str_set_dcdc_enable); -be_define_const_str(find_key_i, "find_key_i", 850136726u, 0, 10, &be_const_str_length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032); -be_define_const_str(find_op, "find_op", 3766713376u, 0, 7, &be_const_str_function); -be_define_const_str(finish, "finish", 1494643858u, 0, 6, &be_const_str_resp_cmnd_error); -be_define_const_str(floor, "floor", 3102149661u, 0, 5, &be_const_str_lv_obj_class); +be_define_const_str(file, "file", 2867484483u, 0, 4, NULL); +be_define_const_str(file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27, "file extension is not '.be' or '.bec'", 3095719639u, 0, 37, NULL); +be_define_const_str(files, "files", 1055342736u, 0, 5, &be_const_str_param); +be_define_const_str(find, "find", 3186656602u, 0, 4, NULL); +be_define_const_str(find_key_i, "find_key_i", 850136726u, 0, 10, &be_const_str_pin); +be_define_const_str(find_op, "find_op", 3766713376u, 0, 7, NULL); +be_define_const_str(finish, "finish", 1494643858u, 0, 6, NULL); +be_define_const_str(floor, "floor", 3102149661u, 0, 5, &be_const_str_local); be_define_const_str(flush, "flush", 3002334877u, 0, 5, NULL); be_define_const_str(for, "for", 2901640080u, 54, 3, NULL); -be_define_const_str(format, "format", 3114108242u, 0, 6, &be_const_str_get_pixel_color); -be_define_const_str(from_to, "from_to", 21625507u, 0, 7, NULL); -be_define_const_str(fromb64, "fromb64", 2717019639u, 0, 7, &be_const_str_get_style_bg_color); +be_define_const_str(format, "format", 3114108242u, 0, 6, &be_const_str_memory); +be_define_const_str(from_to, "from_to", 21625507u, 0, 7, &be_const_str_load); +be_define_const_str(fromb64, "fromb64", 2717019639u, 0, 7, NULL); be_define_const_str(fromptr, "fromptr", 666189689u, 0, 7, NULL); -be_define_const_str(fromstring, "fromstring", 610302344u, 0, 10, &be_const_str_i2c_enabled); -be_define_const_str(function, "function", 2664841801u, 0, 8, &be_const_str_read13); -be_define_const_str(gamma, "gamma", 3492353034u, 0, 5, NULL); -be_define_const_str(gamma10, "gamma10", 3472052483u, 0, 7, NULL); -be_define_const_str(gamma8, "gamma8", 3802843830u, 0, 6, NULL); +be_define_const_str(fromstring, "fromstring", 610302344u, 0, 10, &be_const_str_get_input_power_status); +be_define_const_str(function, "function", 2664841801u, 0, 8, &be_const_str_tostring); +be_define_const_str(gamma, "gamma", 3492353034u, 0, 5, &be_const_str_widget_struct_default); +be_define_const_str(gamma10, "gamma10", 3472052483u, 0, 7, &be_const_str_get_free_heap); +be_define_const_str(gamma8, "gamma8", 3802843830u, 0, 6, &be_const_str_resp_cmnd); be_define_const_str(gc, "gc", 1042313471u, 0, 2, NULL); be_define_const_str(gen_cb, "gen_cb", 3245227551u, 0, 6, NULL); -be_define_const_str(get, "get", 1410115415u, 0, 3, &be_const_str_reset_search); +be_define_const_str(get, "get", 1410115415u, 0, 3, &be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D); be_define_const_str(get_alternate, "get_alternate", 1450148894u, 0, 13, NULL); -be_define_const_str(get_aps_voltage, "get_aps_voltage", 2293036435u, 0, 15, &be_const_str_read8); -be_define_const_str(get_bat_charge_current, "get_bat_charge_current", 1385293050u, 0, 22, &be_const_str_invalidate); -be_define_const_str(get_bat_current, "get_bat_current", 1912106073u, 0, 15, &be_const_str_pixel_size); -be_define_const_str(get_bat_power, "get_bat_power", 3067374853u, 0, 13, NULL); +be_define_const_str(get_aps_voltage, "get_aps_voltage", 2293036435u, 0, 15, NULL); +be_define_const_str(get_bat_charge_current, "get_bat_charge_current", 1385293050u, 0, 22, &be_const_str_pi); +be_define_const_str(get_bat_current, "get_bat_current", 1912106073u, 0, 15, NULL); +be_define_const_str(get_bat_power, "get_bat_power", 3067374853u, 0, 13, &be_const_str_ins_time); be_define_const_str(get_bat_voltage, "get_bat_voltage", 706676538u, 0, 15, NULL); -be_define_const_str(get_battery_chargin_status, "get_battery_chargin_status", 2233241571u, 0, 26, &be_const_str_list); -be_define_const_str(get_bri, "get_bri", 2041809895u, 0, 7, &be_const_str_rand); -be_define_const_str(get_coords, "get_coords", 1044089006u, 0, 10, &be_const_str_tag); -be_define_const_str(get_current_module_name, "get_current_module_name", 2379270740u, 0, 23, &be_const_str_tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29); +be_define_const_str(get_battery_chargin_status, "get_battery_chargin_status", 2233241571u, 0, 26, NULL); +be_define_const_str(get_bri, "get_bri", 2041809895u, 0, 7, &be_const_str_page_autoconf_ctl); +be_define_const_str(get_coords, "get_coords", 1044089006u, 0, 10, &be_const_str_upper); +be_define_const_str(get_current_module_name, "get_current_module_name", 2379270740u, 0, 23, NULL); be_define_const_str(get_current_module_path, "get_current_module_path", 3206673408u, 0, 23, NULL); -be_define_const_str(get_free_heap, "get_free_heap", 625069757u, 0, 13, &be_const_str_web_add_handler); -be_define_const_str(get_height, "get_height", 3571755523u, 0, 10, &be_const_str_light); -be_define_const_str(get_input_power_status, "get_input_power_status", 4102829177u, 0, 22, &be_const_str_run_bat); -be_define_const_str(get_light, "get_light", 381930476u, 0, 9, NULL); -be_define_const_str(get_object_from_ptr, "get_object_from_ptr", 2345019201u, 0, 19, &be_const_str_reapply); +be_define_const_str(get_free_heap, "get_free_heap", 625069757u, 0, 13, &be_const_str_no_X20GPIO_X20specified_X20for_X20neopixelbus); +be_define_const_str(get_height, "get_height", 3571755523u, 0, 10, &be_const_str_obj_class_create_obj); +be_define_const_str(get_input_power_status, "get_input_power_status", 4102829177u, 0, 22, &be_const_str_get_style_bg_color); +be_define_const_str(get_light, "get_light", 381930476u, 0, 9, &be_const_str_unknown_X20instruction); +be_define_const_str(get_object_from_ptr, "get_object_from_ptr", 2345019201u, 0, 19, NULL); be_define_const_str(get_option, "get_option", 2123730033u, 0, 10, NULL); -be_define_const_str(get_percentage, "get_percentage", 2880483992u, 0, 14, &be_const_str_get_tasmota); +be_define_const_str(get_percentage, "get_percentage", 2880483992u, 0, 14, NULL); be_define_const_str(get_pixel_color, "get_pixel_color", 337490048u, 0, 15, NULL); be_define_const_str(get_power, "get_power", 3009799377u, 0, 9, NULL); -be_define_const_str(get_size, "get_size", 2803644713u, 0, 8, &be_const_str_set_style_text_font); -be_define_const_str(get_string, "get_string", 4195847969u, 0, 10, &be_const_str_get_width); -be_define_const_str(get_style_bg_color, "get_style_bg_color", 964794381u, 0, 18, NULL); -be_define_const_str(get_style_line_color, "get_style_line_color", 805371932u, 0, 20, NULL); -be_define_const_str(get_style_pad_right, "get_style_pad_right", 3150287466u, 0, 19, &be_const_str_gpio); -be_define_const_str(get_switch, "get_switch", 164821028u, 0, 10, NULL); -be_define_const_str(get_tasmota, "get_tasmota", 334356779u, 0, 11, NULL); -be_define_const_str(get_temp, "get_temp", 3370919486u, 0, 8, &be_const_str_keys); -be_define_const_str(get_vbus_current, "get_vbus_current", 1205347942u, 0, 16, NULL); -be_define_const_str(get_vbus_voltage, "get_vbus_voltage", 2398210401u, 0, 16, NULL); +be_define_const_str(get_size, "get_size", 2803644713u, 0, 8, &be_const_str_tomap); +be_define_const_str(get_string, "get_string", 4195847969u, 0, 10, &be_const_str_remove_driver); +be_define_const_str(get_style_bg_color, "get_style_bg_color", 964794381u, 0, 18, &be_const_str_number); +be_define_const_str(get_style_line_color, "get_style_line_color", 805371932u, 0, 20, &be_const_str_ins_ramp); +be_define_const_str(get_style_pad_right, "get_style_pad_right", 3150287466u, 0, 19, NULL); +be_define_const_str(get_switch, "get_switch", 164821028u, 0, 10, &be_const_str_set_y); +be_define_const_str(get_tasmota, "get_tasmota", 334356779u, 0, 11, &be_const_str_imax); +be_define_const_str(get_temp, "get_temp", 3370919486u, 0, 8, NULL); +be_define_const_str(get_vbus_current, "get_vbus_current", 1205347942u, 0, 16, &be_const_str_tele); +be_define_const_str(get_vbus_voltage, "get_vbus_voltage", 2398210401u, 0, 16, &be_const_str_toupper); be_define_const_str(get_warning_level, "get_warning_level", 1737834441u, 0, 17, NULL); -be_define_const_str(get_width, "get_width", 3293417300u, 0, 9, NULL); -be_define_const_str(getbits, "getbits", 3094168979u, 0, 7, &be_const_str_widget_struct_default); -be_define_const_str(geti, "geti", 2381006490u, 0, 4, &be_const_str_resp_cmnd_failed); -be_define_const_str(global, "global", 503252654u, 0, 6, &be_const_str_name); -be_define_const_str(gpio, "gpio", 2638155258u, 0, 4, &be_const_str_pin_used); -be_define_const_str(group_def, "group_def", 1524213328u, 0, 9, &be_const_str_param); -be_define_const_str(h, "h", 3977000791u, 0, 1, NULL); -be_define_const_str(has, "has", 3988721635u, 0, 3, NULL); -be_define_const_str(has_arg, "has_arg", 424878688u, 0, 7, &be_const_str_try); -be_define_const_str(height_def, "height_def", 2348238838u, 0, 10, &be_const_str_hour); -be_define_const_str(hex, "hex", 4273249610u, 0, 3, NULL); -be_define_const_str(hour, "hour", 3053661199u, 0, 4, &be_const_str_unknown_X20instruction); -be_define_const_str(hs2rgb, "hs2rgb", 1040816349u, 0, 6, &be_const_str_json); -be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s/%s.autoconf", 2743526309u, 0, 70, &be_const_str_set_bri); -be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s_manifest.json", 3657552045u, 0, 72, &be_const_str_widget_dtor_impl); -be_define_const_str(i2c_enabled, "i2c_enabled", 218388101u, 0, 11, &be_const_str_lv_event_cb); -be_define_const_str(id, "id", 926444256u, 0, 2, NULL); +be_define_const_str(get_width, "get_width", 3293417300u, 0, 9, &be_const_str_readbytes); +be_define_const_str(getbits, "getbits", 3094168979u, 0, 7, &be_const_str_has_arg); +be_define_const_str(geti, "geti", 2381006490u, 0, 4, NULL); +be_define_const_str(global, "global", 503252654u, 0, 6, NULL); +be_define_const_str(gpio, "gpio", 2638155258u, 0, 4, &be_const_str_wire_scan); +be_define_const_str(group_def, "group_def", 1524213328u, 0, 9, NULL); +be_define_const_str(h, "h", 3977000791u, 0, 1, &be_const_str_init); +be_define_const_str(has, "has", 3988721635u, 0, 3, &be_const_str_pow); +be_define_const_str(has_arg, "has_arg", 424878688u, 0, 7, &be_const_str__X7D); +be_define_const_str(height_def, "height_def", 2348238838u, 0, 10, &be_const_str_set_height); +be_define_const_str(hex, "hex", 4273249610u, 0, 3, &be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson); +be_define_const_str(hour, "hour", 3053661199u, 0, 4, &be_const_str_pixel_count); +be_define_const_str(hs2rgb, "hs2rgb", 1040816349u, 0, 6, &be_const_str_path); +be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s/%s.autoconf", 2743526309u, 0, 70, &be_const_str_pc_abs); +be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s_manifest.json", 3657552045u, 0, 72, &be_const_str_int); +be_define_const_str(i2c_enabled, "i2c_enabled", 218388101u, 0, 11, NULL); +be_define_const_str(id, "id", 926444256u, 0, 2, &be_const_str_x); be_define_const_str(if, "if", 959999494u, 50, 2, NULL); -be_define_const_str(imax, "imax", 3084515410u, 0, 4, NULL); +be_define_const_str(imax, "imax", 3084515410u, 0, 4, &be_const_str_resize); be_define_const_str(imin, "imin", 2714127864u, 0, 4, NULL); be_define_const_str(import, "import", 288002260u, 66, 6, NULL); -be_define_const_str(init, "init", 380752755u, 0, 4, NULL); +be_define_const_str(init, "init", 380752755u, 0, 4, &be_const_str_pc_rel); be_define_const_str(init_draw_line_dsc, "init_draw_line_dsc", 2507936040u, 0, 18, NULL); -be_define_const_str(input, "input", 4191711099u, 0, 5, &be_const_str_serial); -be_define_const_str(ins_goto, "ins_goto", 1342843963u, 0, 8, &be_const_str_json_fdump_list); -be_define_const_str(ins_ramp, "ins_ramp", 1068049360u, 0, 8, &be_const_str_resize); +be_define_const_str(input, "input", 4191711099u, 0, 5, &be_const_str_reset); +be_define_const_str(ins_goto, "ins_goto", 1342843963u, 0, 8, NULL); +be_define_const_str(ins_ramp, "ins_ramp", 1068049360u, 0, 8, &be_const_str_stop_iteration); be_define_const_str(ins_time, "ins_time", 2980245553u, 0, 8, NULL); -be_define_const_str(insert, "insert", 3332609576u, 0, 6, &be_const_str_int); -be_define_const_str(instance, "instance", 193386898u, 0, 8, &be_const_str_round_end); -be_define_const_str(instance_size, "instance_size", 4280269518u, 0, 13, &be_const_str_memory); -be_define_const_str(int, "int", 2515107422u, 0, 3, NULL); -be_define_const_str(internal_error, "internal_error", 2519158169u, 0, 14, &be_const_str_yield); -be_define_const_str(introspect, "introspect", 164638290u, 0, 10, &be_const_str_open); -be_define_const_str(invalidate, "invalidate", 2649734928u, 0, 10, &be_const_str_pc_rel); -be_define_const_str(io_error, "io_error", 1970281036u, 0, 8, &be_const_str_lv_obj); -be_define_const_str(ip, "ip", 1261996636u, 0, 2, &be_const_str_top); -be_define_const_str(is_dirty, "is_dirty", 418034110u, 0, 8, NULL); -be_define_const_str(is_first_time, "is_first_time", 275242384u, 0, 13, &be_const_str_widget_event_cb); -be_define_const_str(is_running, "is_running", 2226847261u, 0, 10, NULL); -be_define_const_str(isinstance, "isinstance", 3669352738u, 0, 10, &be_const_str_set_timeouts); -be_define_const_str(isnan, "isnan", 2981347434u, 0, 5, &be_const_str_true); +be_define_const_str(insert, "insert", 3332609576u, 0, 6, &be_const_str_lvgl_event_dispatch); +be_define_const_str(instance, "instance", 193386898u, 0, 8, &be_const_str_set_matrix_pixel_color); +be_define_const_str(instance_size, "instance_size", 4280269518u, 0, 13, NULL); +be_define_const_str(int, "int", 2515107422u, 0, 3, &be_const_str_set_style_text_font); +be_define_const_str(internal_error, "internal_error", 2519158169u, 0, 14, &be_const_str_width_def); +be_define_const_str(introspect, "introspect", 164638290u, 0, 10, &be_const_str_preinit); +be_define_const_str(invalidate, "invalidate", 2649734928u, 0, 10, NULL); +be_define_const_str(io_error, "io_error", 1970281036u, 0, 8, NULL); +be_define_const_str(ip, "ip", 1261996636u, 0, 2, NULL); +be_define_const_str(is_dirty, "is_dirty", 418034110u, 0, 8, &be_const_str_on); +be_define_const_str(is_first_time, "is_first_time", 275242384u, 0, 13, &be_const_str_persist); +be_define_const_str(is_running, "is_running", 2226847261u, 0, 10, &be_const_str__X7B_X7D); +be_define_const_str(isinstance, "isinstance", 3669352738u, 0, 10, &be_const_str_last_modified); +be_define_const_str(isnan, "isnan", 2981347434u, 0, 5, &be_const_str_iter); be_define_const_str(isrunning, "isrunning", 1688182268u, 0, 9, NULL); -be_define_const_str(issubclass, "issubclass", 4078395519u, 0, 10, NULL); -be_define_const_str(item, "item", 2671260646u, 0, 4, NULL); -be_define_const_str(iter, "iter", 3124256359u, 0, 4, &be_const_str_widget_event); -be_define_const_str(json, "json", 916562499u, 0, 4, &be_const_str_matrix); -be_define_const_str(json_append, "json_append", 3002019284u, 0, 11, &be_const_str_set_time); +be_define_const_str(issubclass, "issubclass", 4078395519u, 0, 10, &be_const_str_setmember); +be_define_const_str(item, "item", 2671260646u, 0, 4, &be_const_str_json_fdump_any); +be_define_const_str(iter, "iter", 3124256359u, 0, 4, &be_const_str_name); +be_define_const_str(json, "json", 916562499u, 0, 4, NULL); +be_define_const_str(json_append, "json_append", 3002019284u, 0, 11, &be_const_str_import); be_define_const_str(json_fdump, "json_fdump", 1694216580u, 0, 10, NULL); be_define_const_str(json_fdump_any, "json_fdump_any", 3348629385u, 0, 14, NULL); -be_define_const_str(json_fdump_list, "json_fdump_list", 3903879853u, 0, 15, &be_const_str_solidified); -be_define_const_str(json_fdump_map, "json_fdump_map", 4091954653u, 0, 14, &be_const_str_as); -be_define_const_str(k, "k", 3993778410u, 0, 1, &be_const_str_resp_cmnd_str); -be_define_const_str(keys, "keys", 4182378701u, 0, 4, &be_const_str_run_deferred); +be_define_const_str(json_fdump_list, "json_fdump_list", 3903879853u, 0, 15, &be_const_str_millis); +be_define_const_str(json_fdump_map, "json_fdump_map", 4091954653u, 0, 14, &be_const_str_save_before_restart); +be_define_const_str(k, "k", 3993778410u, 0, 1, &be_const_str_keys); +be_define_const_str(keys, "keys", 4182378701u, 0, 4, &be_const_str_min); be_define_const_str(kv, "kv", 1497177492u, 0, 2, NULL); -be_define_const_str(last_modified, "last_modified", 772177145u, 0, 13, &be_const_str_tob64); -be_define_const_str(leds, "leds", 558858555u, 0, 4, &be_const_str_to_gamma); -be_define_const_str(length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032, "length in bits must be between 0 and 32", 2584509128u, 0, 39, &be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E); +be_define_const_str(last_modified, "last_modified", 772177145u, 0, 13, NULL); +be_define_const_str(leds, "leds", 558858555u, 0, 4, &be_const_str_elif); +be_define_const_str(length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032, "length in bits must be between 0 and 32", 2584509128u, 0, 39, &be_const_str_false); be_define_const_str(light, "light", 3801947695u, 0, 5, NULL); -be_define_const_str(line_dsc, "line_dsc", 4094490978u, 0, 8, &be_const_str_def); -be_define_const_str(list, "list", 217798785u, 0, 4, &be_const_str_upper); -be_define_const_str(listdir, "listdir", 2005220720u, 0, 7, &be_const_str_srand); +be_define_const_str(line_dsc, "line_dsc", 4094490978u, 0, 8, &be_const_str_print); +be_define_const_str(list, "list", 217798785u, 0, 4, NULL); +be_define_const_str(listdir, "listdir", 2005220720u, 0, 7, NULL); be_define_const_str(load, "load", 3859241449u, 0, 4, NULL); -be_define_const_str(load_templates, "load_templates", 3513870133u, 0, 14, &be_const_str_read32); -be_define_const_str(local, "local", 2621662984u, 0, 5, &be_const_str_wire2); -be_define_const_str(log, "log", 1062293841u, 0, 3, &be_const_str_pixel_count); -be_define_const_str(log10, "log10", 2346846000u, 0, 5, &be_const_str_set_x); -be_define_const_str(loop, "loop", 3723446379u, 0, 4, NULL); -be_define_const_str(lower, "lower", 3038577850u, 0, 5, NULL); +be_define_const_str(load_templates, "load_templates", 3513870133u, 0, 14, &be_const_str_set_bri); +be_define_const_str(local, "local", 2621662984u, 0, 5, NULL); +be_define_const_str(log, "log", 1062293841u, 0, 3, &be_const_str_the_X20second_X20argument_X20is_X20not_X20a_X20function); +be_define_const_str(log10, "log10", 2346846000u, 0, 5, &be_const_str_web_add_handler); +be_define_const_str(loop, "loop", 3723446379u, 0, 4, &be_const_str_continue); +be_define_const_str(lower, "lower", 3038577850u, 0, 5, &be_const_str_push_path); be_define_const_str(lv, "lv", 1529997255u, 0, 2, NULL); -be_define_const_str(lv_event, "lv_event", 2434089968u, 0, 8, &be_const_str_set_alternate); -be_define_const_str(lv_event_cb, "lv_event_cb", 2480731016u, 0, 11, NULL); +be_define_const_str(lv_event, "lv_event", 2434089968u, 0, 8, &be_const_str_set_timer); +be_define_const_str(lv_event_cb, "lv_event_cb", 2480731016u, 0, 11, &be_const_str_try_rule); be_define_const_str(lv_obj, "lv_obj", 4257833149u, 0, 6, NULL); -be_define_const_str(lv_obj_class, "lv_obj_class", 4039656294u, 0, 12, &be_const_str_running); -be_define_const_str(lvgl_event_dispatch, "lvgl_event_dispatch", 2104396622u, 0, 19, &be_const_str_the_X20second_X20argument_X20is_X20not_X20a_X20function); -be_define_const_str(map, "map", 3751997361u, 0, 3, &be_const_str_page_autoconf_mgr); -be_define_const_str(math, "math", 4001929615u, 0, 4, &be_const_str_remove_cmd); -be_define_const_str(matrix, "matrix", 365099244u, 0, 6, NULL); -be_define_const_str(member, "member", 719708611u, 0, 6, &be_const_str_remove_timer); -be_define_const_str(members, "members", 937576464u, 0, 7, &be_const_str_module); -be_define_const_str(memory, "memory", 2229924270u, 0, 6, &be_const_str_persist); -be_define_const_str(millis, "millis", 1214679063u, 0, 6, &be_const_str_publish_result); +be_define_const_str(lv_obj_class, "lv_obj_class", 4039656294u, 0, 12, NULL); +be_define_const_str(lvgl_event_dispatch, "lvgl_event_dispatch", 2104396622u, 0, 19, &be_const_str_rule); +be_define_const_str(map, "map", 3751997361u, 0, 3, NULL); +be_define_const_str(math, "math", 4001929615u, 0, 4, &be_const_str_widget_event_cb); +be_define_const_str(matrix, "matrix", 365099244u, 0, 6, &be_const_str_pixels_buffer); +be_define_const_str(member, "member", 719708611u, 0, 6, &be_const_str_web_add_management_button); +be_define_const_str(members, "members", 937576464u, 0, 7, &be_const_str_remove_rule); +be_define_const_str(memory, "memory", 2229924270u, 0, 6, NULL); +be_define_const_str(millis, "millis", 1214679063u, 0, 6, &be_const_str_module); be_define_const_str(min, "min", 3381609815u, 0, 3, NULL); -be_define_const_str(minute, "minute", 954666857u, 0, 6, &be_const_str_set_light); -be_define_const_str(module, "module", 3617558685u, 0, 6, &be_const_str_rule); -be_define_const_str(month, "month", 3598321157u, 0, 5, &be_const_str_time_str); -be_define_const_str(name, "name", 2369371622u, 0, 4, &be_const_str_widget_instance_size); -be_define_const_str(nan, "nan", 797905850u, 0, 3, NULL); +be_define_const_str(minute, "minute", 954666857u, 0, 6, NULL); +be_define_const_str(module, "module", 3617558685u, 0, 6, &be_const_str_setrange); +be_define_const_str(month, "month", 3598321157u, 0, 5, &be_const_str_web_send); +be_define_const_str(name, "name", 2369371622u, 0, 4, NULL); +be_define_const_str(nan, "nan", 797905850u, 0, 3, &be_const_str_size); be_define_const_str(nil, "nil", 228849900u, 63, 3, NULL); -be_define_const_str(no_X20GPIO_X20specified_X20for_X20neopixelbus, "no GPIO specified for neopixelbus", 42078528u, 0, 33, &be_const_str_return_X20code_X3D_X25i); +be_define_const_str(no_X20GPIO_X20specified_X20for_X20neopixelbus, "no GPIO specified for neopixelbus", 42078528u, 0, 33, NULL); be_define_const_str(null_cb, "null_cb", 2333536460u, 0, 7, NULL); -be_define_const_str(number, "number", 467038368u, 0, 6, &be_const_str_write_bit); -be_define_const_str(obj_class_create_obj, "obj_class_create_obj", 3304390632u, 0, 20, &be_const_str_resolvecmnd); -be_define_const_str(obj_event_base, "obj_event_base", 1624064363u, 0, 14, &be_const_str_w); -be_define_const_str(offset, "offset", 348705738u, 0, 6, NULL); +be_define_const_str(number, "number", 467038368u, 0, 6, &be_const_str_range); +be_define_const_str(obj_class_create_obj, "obj_class_create_obj", 3304390632u, 0, 20, NULL); +be_define_const_str(obj_event_base, "obj_event_base", 1624064363u, 0, 14, NULL); +be_define_const_str(offset, "offset", 348705738u, 0, 6, &be_const_str_web_add_button); be_define_const_str(offseta, "offseta", 1663383089u, 0, 7, NULL); -be_define_const_str(on, "on", 1630810064u, 0, 2, NULL); -be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will cause a restart.\");'>", 232646018u, 0, 57, NULL); -be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will change the current configuration and cause a restart.\");'>", 3792412559u, 0, 94, NULL); -be_define_const_str(open, "open", 3546203337u, 0, 4, NULL); +be_define_const_str(on, "on", 1630810064u, 0, 2, &be_const_str_webclient); +be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will cause a restart.\");'>", 232646018u, 0, 57, &be_const_str_wire2); +be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will change the current configuration and cause a restart.\");'>", 3792412559u, 0, 94, &be_const_str_srand); +be_define_const_str(open, "open", 3546203337u, 0, 4, &be_const_str_search); be_define_const_str(out_X20of_X20range, "out of range", 2236631477u, 0, 12, NULL); be_define_const_str(p1, "p1", 2689521274u, 0, 2, NULL); -be_define_const_str(p2, "p2", 2672743655u, 0, 2, &be_const_str_pop_path); +be_define_const_str(p2, "p2", 2672743655u, 0, 2, &be_const_str_set_alternate); be_define_const_str(page_autoconf_ctl, "page_autoconf_ctl", 2453381496u, 0, 17, NULL); -be_define_const_str(page_autoconf_mgr, "page_autoconf_mgr", 3643937031u, 0, 17, &be_const_str_sec); -be_define_const_str(param, "param", 1309554226u, 0, 5, &be_const_str_real); -be_define_const_str(path, "path", 2223459638u, 0, 4, NULL); -be_define_const_str(pc, "pc", 1313756516u, 0, 2, NULL); -be_define_const_str(pc_abs, "pc_abs", 920256495u, 0, 6, NULL); -be_define_const_str(pc_rel, "pc_rel", 991921176u, 0, 6, &be_const_str_persist_X2E_p_X20is_X20not_X20a_X20map); -be_define_const_str(percentage, "percentage", 2538831285u, 0, 10, &be_const_str_tolower); -be_define_const_str(persist, "persist", 3917083779u, 0, 7, &be_const_str_reverse_gamma10); -be_define_const_str(persist_X2E_p_X20is_X20not_X20a_X20map, "persist._p is not a map", 1176528732u, 0, 23, &be_const_str_scan); -be_define_const_str(pi, "pi", 1213090802u, 0, 2, &be_const_str_set_y); +be_define_const_str(page_autoconf_mgr, "page_autoconf_mgr", 3643937031u, 0, 17, &be_const_str_write8); +be_define_const_str(param, "param", 1309554226u, 0, 5, &be_const_str_resp_cmnd_error); +be_define_const_str(path, "path", 2223459638u, 0, 4, &be_const_str_real); +be_define_const_str(pc, "pc", 1313756516u, 0, 2, &be_const_str_nil); +be_define_const_str(pc_abs, "pc_abs", 920256495u, 0, 6, &be_const_str_set); +be_define_const_str(pc_rel, "pc_rel", 991921176u, 0, 6, &be_const_str_web_add_config_button); +be_define_const_str(percentage, "percentage", 2538831285u, 0, 10, &be_const_str_tcpclient); +be_define_const_str(persist, "persist", 3917083779u, 0, 7, NULL); +be_define_const_str(persist_X2E_p_X20is_X20not_X20a_X20map, "persist._p is not a map", 1176528732u, 0, 23, NULL); +be_define_const_str(pi, "pi", 1213090802u, 0, 2, NULL); be_define_const_str(pin, "pin", 1866532500u, 0, 3, NULL); -be_define_const_str(pin_mode, "pin_mode", 3258314030u, 0, 8, NULL); -be_define_const_str(pin_used, "pin_used", 4033854612u, 0, 8, NULL); +be_define_const_str(pin_mode, "pin_mode", 3258314030u, 0, 8, &be_const_str_set_ldo_voltage); +be_define_const_str(pin_used, "pin_used", 4033854612u, 0, 8, &be_const_str_set_auth); be_define_const_str(pixel_count, "pixel_count", 2439130743u, 0, 11, NULL); -be_define_const_str(pixel_size, "pixel_size", 2209135785u, 0, 10, &be_const_str_seg7_font); -be_define_const_str(pixels_buffer, "pixels_buffer", 1229555807u, 0, 13, &be_const_str_sinh); +be_define_const_str(pixel_size, "pixel_size", 2209135785u, 0, 10, NULL); +be_define_const_str(pixels_buffer, "pixels_buffer", 1229555807u, 0, 13, NULL); be_define_const_str(point, "point", 414084241u, 0, 5, NULL); -be_define_const_str(pop, "pop", 1362321360u, 0, 3, &be_const_str_remove); -be_define_const_str(pop_path, "pop_path", 2403243998u, 0, 8, &be_const_str_sqrt); -be_define_const_str(pow, "pow", 1479764693u, 0, 3, NULL); -be_define_const_str(preinit, "preinit", 2722007100u, 0, 7, &be_const_str_widget_height_def); +be_define_const_str(pop, "pop", 1362321360u, 0, 3, &be_const_str_resp_cmnd_failed); +be_define_const_str(pop_path, "pop_path", 2403243998u, 0, 8, NULL); +be_define_const_str(pow, "pow", 1479764693u, 0, 3, &be_const_str_seg7_font); +be_define_const_str(preinit, "preinit", 2722007100u, 0, 7, &be_const_str_widget_ctor_cb); be_define_const_str(print, "print", 372738696u, 0, 5, NULL); -be_define_const_str(public_key, "public_key", 4169142980u, 0, 10, NULL); -be_define_const_str(publish, "publish", 264247304u, 0, 7, &be_const_str_widget_destructor); -be_define_const_str(publish_result, "publish_result", 2013351252u, 0, 14, &be_const_str_for); -be_define_const_str(push, "push", 2272264157u, 0, 4, &be_const_str_set_style_pad_right); -be_define_const_str(push_path, "push_path", 1155254157u, 0, 9, &be_const_str_reduce); -be_define_const_str(quality, "quality", 2597670950u, 0, 7, &be_const_str_set_percentage); -be_define_const_str(r, "r", 4144776981u, 0, 1, &be_const_str_save); -be_define_const_str(rad, "rad", 1358899048u, 0, 3, &be_const_str_tostring); +be_define_const_str(public_key, "public_key", 4169142980u, 0, 10, &be_const_str_read32); +be_define_const_str(publish, "publish", 264247304u, 0, 7, NULL); +be_define_const_str(publish_result, "publish_result", 2013351252u, 0, 14, &be_const_str_skip); +be_define_const_str(push, "push", 2272264157u, 0, 4, &be_const_str_width); +be_define_const_str(push_path, "push_path", 1155254157u, 0, 9, NULL); +be_define_const_str(quality, "quality", 2597670950u, 0, 7, &be_const_str_else); +be_define_const_str(r, "r", 4144776981u, 0, 1, &be_const_str_set_light); +be_define_const_str(rad, "rad", 1358899048u, 0, 3, &be_const_str_set_ldo_enable); be_define_const_str(raise, "raise", 1593437475u, 70, 5, NULL); be_define_const_str(rand, "rand", 2711325910u, 0, 4, NULL); -be_define_const_str(range, "range", 4208725202u, 0, 5, &be_const_str_remove_rule); -be_define_const_str(read, "read", 3470762949u, 0, 4, &be_const_str_shared_key); +be_define_const_str(range, "range", 4208725202u, 0, 5, &be_const_str_reverse_gamma10); +be_define_const_str(read, "read", 3470762949u, 0, 4, NULL); be_define_const_str(read12, "read12", 4291076970u, 0, 6, NULL); -be_define_const_str(read13, "read13", 12887293u, 0, 6, &be_const_str_wd); +be_define_const_str(read13, "read13", 12887293u, 0, 6, NULL); be_define_const_str(read24, "read24", 1808533811u, 0, 6, NULL); be_define_const_str(read32, "read32", 1741276240u, 0, 6, NULL); -be_define_const_str(read8, "read8", 2802788167u, 0, 5, &be_const_str_set_pixel_color); -be_define_const_str(read_bytes, "read_bytes", 3576733173u, 0, 10, &be_const_str_response_append); -be_define_const_str(read_sensors, "read_sensors", 892689201u, 0, 12, NULL); +be_define_const_str(read8, "read8", 2802788167u, 0, 5, NULL); +be_define_const_str(read_bytes, "read_bytes", 3576733173u, 0, 10, NULL); +be_define_const_str(read_sensors, "read_sensors", 892689201u, 0, 12, &be_const_str_round_end); +be_define_const_str(readbytes, "readbytes", 2716426756u, 0, 9, NULL); be_define_const_str(readline, "readline", 1212709927u, 0, 8, NULL); be_define_const_str(real, "real", 3604983901u, 0, 4, NULL); be_define_const_str(reapply, "reapply", 3778939332u, 0, 7, NULL); -be_define_const_str(redirect, "redirect", 389758641u, 0, 8, &be_const_str_wifi); -be_define_const_str(reduce, "reduce", 2002030311u, 0, 6, &be_const_str_url_encode); -be_define_const_str(refr_size, "refr_size", 1958144468u, 0, 9, &be_const_str_widget_dtor_cb); -be_define_const_str(register_obj, "register_obj", 3982614770u, 0, 12, NULL); -be_define_const_str(remove, "remove", 3683784189u, 0, 6, &be_const_str_set_dc_voltage); +be_define_const_str(redirect, "redirect", 389758641u, 0, 8, &be_const_str_rtc); +be_define_const_str(reduce, "reduce", 2002030311u, 0, 6, &be_const_str_sec); +be_define_const_str(refr_size, "refr_size", 1958144468u, 0, 9, &be_const_str_target_search); +be_define_const_str(register_obj, "register_obj", 3982614770u, 0, 12, &be_const_str_sys); +be_define_const_str(remove, "remove", 3683784189u, 0, 6, NULL); be_define_const_str(remove_cmd, "remove_cmd", 3832315702u, 0, 10, NULL); -be_define_const_str(remove_driver, "remove_driver", 1030243768u, 0, 13, &be_const_str_str); -be_define_const_str(remove_rule, "remove_rule", 3456211328u, 0, 11, NULL); +be_define_const_str(remove_driver, "remove_driver", 1030243768u, 0, 13, &be_const_str_tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29); +be_define_const_str(remove_rule, "remove_rule", 3456211328u, 0, 11, &be_const_str_except); be_define_const_str(remove_timer, "remove_timer", 4141472215u, 0, 12, NULL); be_define_const_str(reset, "reset", 1695364032u, 0, 5, NULL); be_define_const_str(reset_search, "reset_search", 1350414305u, 0, 12, NULL); be_define_const_str(resize, "resize", 3514612129u, 0, 6, NULL); -be_define_const_str(resolvecmnd, "resolvecmnd", 993361485u, 0, 11, &be_const_str_web_add_button); -be_define_const_str(resp_cmnd, "resp_cmnd", 2869459626u, 0, 9, &be_const_str_set_height); +be_define_const_str(resolvecmnd, "resolvecmnd", 993361485u, 0, 11, NULL); +be_define_const_str(resp_cmnd, "resp_cmnd", 2869459626u, 0, 9, &be_const_str_widget_editable); be_define_const_str(resp_cmnd_done, "resp_cmnd_done", 2601874875u, 0, 14, NULL); -be_define_const_str(resp_cmnd_error, "resp_cmnd_error", 2404088863u, 0, 15, &be_const_str_show); -be_define_const_str(resp_cmnd_failed, "resp_cmnd_failed", 2136281562u, 0, 16, NULL); -be_define_const_str(resp_cmnd_str, "resp_cmnd_str", 737845590u, 0, 13, &be_const_str_skip); -be_define_const_str(response_append, "response_append", 450346371u, 0, 15, NULL); +be_define_const_str(resp_cmnd_error, "resp_cmnd_error", 2404088863u, 0, 15, NULL); +be_define_const_str(resp_cmnd_failed, "resp_cmnd_failed", 2136281562u, 0, 16, &be_const_str_set_chg_current); +be_define_const_str(resp_cmnd_str, "resp_cmnd_str", 737845590u, 0, 13, NULL); +be_define_const_str(response_append, "response_append", 450346371u, 0, 15, &be_const_str_set_first_time); be_define_const_str(return, "return", 2246981567u, 60, 6, NULL); -be_define_const_str(return_X20code_X3D_X25i, "return code=%i", 2127454401u, 0, 14, &be_const_str_rotate); -be_define_const_str(reverse, "reverse", 558918661u, 0, 7, &be_const_str_wire_scan); +be_define_const_str(return_X20code_X3D_X25i, "return code=%i", 2127454401u, 0, 14, NULL); +be_define_const_str(reverse, "reverse", 558918661u, 0, 7, NULL); be_define_const_str(reverse_gamma10, "reverse_gamma10", 739112262u, 0, 15, NULL); be_define_const_str(rotate, "rotate", 2784296202u, 0, 6, NULL); -be_define_const_str(round_end, "round_end", 985288225u, 0, 9, &be_const_str_while); -be_define_const_str(round_start, "round_start", 2949484384u, 0, 11, &be_const_str_import); -be_define_const_str(rtc, "rtc", 1070575216u, 0, 3, &be_const_str_web_send); -be_define_const_str(rule, "rule", 4230889683u, 0, 4, &be_const_str_y1); -be_define_const_str(run, "run", 718098122u, 0, 3, NULL); -be_define_const_str(run_bat, "run_bat", 2536903298u, 0, 7, NULL); -be_define_const_str(run_deferred, "run_deferred", 371594696u, 0, 12, &be_const_str_continue); -be_define_const_str(running, "running", 343848780u, 0, 7, NULL); +be_define_const_str(round_end, "round_end", 985288225u, 0, 9, &be_const_str_strftime); +be_define_const_str(round_start, "round_start", 2949484384u, 0, 11, &be_const_str_sqrt); +be_define_const_str(rtc, "rtc", 1070575216u, 0, 3, NULL); +be_define_const_str(rule, "rule", 4230889683u, 0, 4, &be_const_str_settings); +be_define_const_str(run, "run", 718098122u, 0, 3, &be_const_str_set_style_line_color); +be_define_const_str(run_bat, "run_bat", 2536903298u, 0, 7, &be_const_str_valuer_error); +be_define_const_str(run_deferred, "run_deferred", 371594696u, 0, 12, NULL); +be_define_const_str(running, "running", 343848780u, 0, 7, &be_const_str_string); be_define_const_str(save, "save", 3439296072u, 0, 4, NULL); be_define_const_str(save_before_restart, "save_before_restart", 1253239338u, 0, 19, NULL); -be_define_const_str(scale_uint, "scale_uint", 3090811094u, 0, 10, &be_const_str_sys); -be_define_const_str(scan, "scan", 3974641896u, 0, 4, &be_const_str_toupper); +be_define_const_str(scale_uint, "scale_uint", 3090811094u, 0, 10, &be_const_str_widget_group_def); +be_define_const_str(scan, "scan", 3974641896u, 0, 4, NULL); be_define_const_str(search, "search", 2150836393u, 0, 6, NULL); -be_define_const_str(sec, "sec", 3139892658u, 0, 3, &be_const_str_tanh); -be_define_const_str(seg7_font, "seg7_font", 4099690689u, 0, 9, NULL); +be_define_const_str(sec, "sec", 3139892658u, 0, 3, NULL); +be_define_const_str(seg7_font, "seg7_font", 4099690689u, 0, 9, &be_const_str_set_useragent); be_define_const_str(select, "select", 297952813u, 0, 6, NULL); be_define_const_str(serial, "serial", 3687697785u, 0, 6, NULL); be_define_const_str(set, "set", 3324446467u, 0, 3, NULL); -be_define_const_str(set_alternate, "set_alternate", 1709680562u, 0, 13, NULL); -be_define_const_str(set_auth, "set_auth", 1057170930u, 0, 8, NULL); -be_define_const_str(set_bri, "set_bri", 2789118779u, 0, 7, &be_const_str_time_dump); +be_define_const_str(set_alternate, "set_alternate", 1709680562u, 0, 13, &be_const_str_widget_event); +be_define_const_str(set_auth, "set_auth", 1057170930u, 0, 8, &be_const_str_update); +be_define_const_str(set_bri, "set_bri", 2789118779u, 0, 7, &be_const_str_str); be_define_const_str(set_chg_current, "set_chg_current", 336304386u, 0, 15, NULL); be_define_const_str(set_dc_voltage, "set_dc_voltage", 2181981936u, 0, 14, NULL); -be_define_const_str(set_dcdc_enable, "set_dcdc_enable", 1594690786u, 0, 15, NULL); -be_define_const_str(set_first_time, "set_first_time", 3111247550u, 0, 14, NULL); -be_define_const_str(set_height, "set_height", 1080207399u, 0, 10, &be_const_str_value); +be_define_const_str(set_dcdc_enable, "set_dcdc_enable", 1594690786u, 0, 15, &be_const_str_class); +be_define_const_str(set_first_time, "set_first_time", 3111247550u, 0, 14, &be_const_str_tan); +be_define_const_str(set_height, "set_height", 1080207399u, 0, 10, NULL); be_define_const_str(set_ldo_enable, "set_ldo_enable", 2916502041u, 0, 14, NULL); -be_define_const_str(set_ldo_voltage, "set_ldo_voltage", 4090501160u, 0, 15, &be_const_str_stop_iteration); +be_define_const_str(set_ldo_voltage, "set_ldo_voltage", 4090501160u, 0, 15, NULL); be_define_const_str(set_light, "set_light", 3176076152u, 0, 9, NULL); be_define_const_str(set_matrix_pixel_color, "set_matrix_pixel_color", 1197149462u, 0, 22, NULL); -be_define_const_str(set_percentage, "set_percentage", 2952022724u, 0, 14, NULL); +be_define_const_str(set_percentage, "set_percentage", 2952022724u, 0, 14, &be_const_str__X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); be_define_const_str(set_pixel_color, "set_pixel_color", 1275248356u, 0, 15, NULL); -be_define_const_str(set_power, "set_power", 549820893u, 0, 9, NULL); -be_define_const_str(set_style_bg_color, "set_style_bg_color", 1689513089u, 0, 18, &be_const_str_set_text); +be_define_const_str(set_power, "set_power", 549820893u, 0, 9, &be_const_str_v); +be_define_const_str(set_style_bg_color, "set_style_bg_color", 1689513089u, 0, 18, NULL); be_define_const_str(set_style_line_color, "set_style_line_color", 3665238976u, 0, 20, NULL); be_define_const_str(set_style_pad_right, "set_style_pad_right", 3314069054u, 0, 19, NULL); -be_define_const_str(set_style_text_font, "set_style_text_font", 1028590019u, 0, 19, NULL); -be_define_const_str(set_text, "set_text", 1849641155u, 0, 8, &be_const_str_wire1); -be_define_const_str(set_time, "set_time", 900236405u, 0, 8, &be_const_str_widget_struct_by_class); -be_define_const_str(set_timeouts, "set_timeouts", 3732850900u, 0, 12, &be_const_str_tan); -be_define_const_str(set_timer, "set_timer", 2135414533u, 0, 9, NULL); -be_define_const_str(set_useragent, "set_useragent", 612237244u, 0, 13, &be_const_str_write_file); +be_define_const_str(set_style_text_font, "set_style_text_font", 1028590019u, 0, 19, &be_const_str_widget_ctor_impl); +be_define_const_str(set_text, "set_text", 1849641155u, 0, 8, NULL); +be_define_const_str(set_time, "set_time", 900236405u, 0, 8, &be_const_str_if); +be_define_const_str(set_timeouts, "set_timeouts", 3732850900u, 0, 12, NULL); +be_define_const_str(set_timer, "set_timer", 2135414533u, 0, 9, &be_const_str_for); +be_define_const_str(set_useragent, "set_useragent", 612237244u, 0, 13, NULL); be_define_const_str(set_width, "set_width", 484671920u, 0, 9, NULL); -be_define_const_str(set_x, "set_x", 1849400772u, 0, 5, NULL); -be_define_const_str(set_y, "set_y", 1866178391u, 0, 5, NULL); -be_define_const_str(setbits, "setbits", 2762408167u, 0, 7, NULL); +be_define_const_str(set_x, "set_x", 1849400772u, 0, 5, &be_const_str_var); +be_define_const_str(set_y, "set_y", 1866178391u, 0, 5, &be_const_str_raise); +be_define_const_str(setbits, "setbits", 2762408167u, 0, 7, &be_const_str_super); be_define_const_str(seti, "seti", 1500556254u, 0, 4, NULL); be_define_const_str(setitem, "setitem", 1554834596u, 0, 7, NULL); be_define_const_str(setmember, "setmember", 1432909441u, 0, 9, NULL); be_define_const_str(setrange, "setrange", 3794019032u, 0, 8, NULL); be_define_const_str(settings, "settings", 1745255176u, 0, 8, NULL); be_define_const_str(shared_key, "shared_key", 2200833624u, 0, 10, NULL); -be_define_const_str(show, "show", 2840060476u, 0, 4, &be_const_str_string); -be_define_const_str(sin, "sin", 3761252941u, 0, 3, NULL); +be_define_const_str(show, "show", 2840060476u, 0, 4, NULL); +be_define_const_str(sin, "sin", 3761252941u, 0, 3, &be_const_str_widget_constructor); be_define_const_str(sinh, "sinh", 282220607u, 0, 4, NULL); -be_define_const_str(size, "size", 597743964u, 0, 4, NULL); -be_define_const_str(skip, "skip", 1097563074u, 0, 4, NULL); -be_define_const_str(solidified, "solidified", 3257553487u, 0, 10, &be_const_str_class); -be_define_const_str(split, "split", 2276994531u, 0, 5, NULL); -be_define_const_str(sqrt, "sqrt", 2112764879u, 0, 4, &be_const_str_width); -be_define_const_str(srand, "srand", 465518633u, 0, 5, &be_const_str_widget_group_def); +be_define_const_str(size, "size", 597743964u, 0, 4, &be_const_str_top); +be_define_const_str(skip, "skip", 1097563074u, 0, 4, &be_const_str_tr); +be_define_const_str(solidified, "solidified", 3257553487u, 0, 10, NULL); +be_define_const_str(split, "split", 2276994531u, 0, 5, &be_const_str__X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); +be_define_const_str(sqrt, "sqrt", 2112764879u, 0, 4, &be_const_str_widget_cb); +be_define_const_str(srand, "srand", 465518633u, 0, 5, NULL); be_define_const_str(start, "start", 1697318111u, 0, 5, NULL); -be_define_const_str(state, "state", 2016490230u, 0, 5, &be_const_str_write_bytes); +be_define_const_str(state, "state", 2016490230u, 0, 5, NULL); be_define_const_str(static, "static", 3532702267u, 71, 6, NULL); be_define_const_str(stop, "stop", 3411225317u, 0, 4, NULL); -be_define_const_str(stop_iteration, "stop_iteration", 4173793901u, 0, 14, &be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D); +be_define_const_str(stop_iteration, "stop_iteration", 4173793901u, 0, 14, NULL); be_define_const_str(str, "str", 3259748752u, 0, 3, NULL); -be_define_const_str(strftime, "strftime", 187738851u, 0, 8, &be_const_str_else); +be_define_const_str(strftime, "strftime", 187738851u, 0, 8, NULL); be_define_const_str(string, "string", 398550328u, 0, 6, NULL); -be_define_const_str(strip, "strip", 4246411473u, 0, 5, &be_const_str_widget_width_def); +be_define_const_str(strip, "strip", 4246411473u, 0, 5, NULL); be_define_const_str(super, "super", 4152230356u, 0, 5, NULL); be_define_const_str(sys, "sys", 3277365014u, 0, 3, NULL); be_define_const_str(tag, "tag", 2516003219u, 0, 3, NULL); be_define_const_str(tan, "tan", 2633446552u, 0, 3, NULL); -be_define_const_str(tanh, "tanh", 153638352u, 0, 4, NULL); -be_define_const_str(target, "target", 845187144u, 0, 6, &be_const_str_webclient); -be_define_const_str(target_search, "target_search", 1947846553u, 0, 13, &be_const_str__X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); -be_define_const_str(tasmota, "tasmota", 424643812u, 0, 7, NULL); -be_define_const_str(tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29, "tasmota.get_light() is deprecated, use light.get()", 3525753647u, 0, 50, NULL); +be_define_const_str(tanh, "tanh", 153638352u, 0, 4, &be_const_str__X7B); +be_define_const_str(target, "target", 845187144u, 0, 6, &be_const_str_widget_width_def); +be_define_const_str(target_search, "target_search", 1947846553u, 0, 13, &be_const_str_url_encode); +be_define_const_str(tasmota, "tasmota", 424643812u, 0, 7, &be_const_str_value_error); +be_define_const_str(tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29, "tasmota.get_light() is deprecated, use light.get()", 3525753647u, 0, 50, &be_const_str_while); be_define_const_str(tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29, "tasmota.set_light() is deprecated, use light.set()", 2124937871u, 0, 50, NULL); -be_define_const_str(tele, "tele", 3474458061u, 0, 4, NULL); +be_define_const_str(tcpclient, "tcpclient", 3828797983u, 0, 9, NULL); +be_define_const_str(tele, "tele", 3474458061u, 0, 4, &be_const_str_time_dump); be_define_const_str(the_X20second_X20argument_X20is_X20not_X20a_X20function, "the second argument is not a function", 3954574469u, 0, 37, NULL); be_define_const_str(time_dump, "time_dump", 3330410747u, 0, 9, NULL); -be_define_const_str(time_reached, "time_reached", 2075136773u, 0, 12, &be_const_str_try_rule); +be_define_const_str(time_reached, "time_reached", 2075136773u, 0, 12, &be_const_str__X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); be_define_const_str(time_str, "time_str", 2613827612u, 0, 8, NULL); -be_define_const_str(to_gamma, "to_gamma", 1597139862u, 0, 8, NULL); +be_define_const_str(to_gamma, "to_gamma", 1597139862u, 0, 8, &be_const_str_value); be_define_const_str(tob64, "tob64", 373777640u, 0, 5, NULL); be_define_const_str(tolower, "tolower", 1042520049u, 0, 7, NULL); -be_define_const_str(tomap, "tomap", 612167626u, 0, 5, &be_const_str_value_error); +be_define_const_str(tomap, "tomap", 612167626u, 0, 5, NULL); be_define_const_str(top, "top", 2802900028u, 0, 3, NULL); be_define_const_str(toptr, "toptr", 3379847454u, 0, 5, NULL); be_define_const_str(tostring, "tostring", 2299708645u, 0, 8, NULL); -be_define_const_str(toupper, "toupper", 3691983576u, 0, 7, &be_const_str_widget_ctor_cb); +be_define_const_str(toupper, "toupper", 3691983576u, 0, 7, &be_const_str_webserver); be_define_const_str(tr, "tr", 1195724803u, 0, 2, NULL); be_define_const_str(traceback, "traceback", 3385188109u, 0, 9, NULL); be_define_const_str(true, "true", 1303515621u, 61, 4, NULL); be_define_const_str(try, "try", 2887626766u, 68, 3, NULL); be_define_const_str(try_rule, "try_rule", 1986449405u, 0, 8, NULL); be_define_const_str(type, "type", 1361572173u, 0, 4, NULL); -be_define_const_str(unknown_X20instruction, "unknown instruction", 1093911841u, 0, 19, &be_const_str_break); +be_define_const_str(unknown_X20instruction, "unknown instruction", 1093911841u, 0, 19, NULL); be_define_const_str(update, "update", 672109684u, 0, 6, NULL); be_define_const_str(upper, "upper", 176974407u, 0, 5, NULL); be_define_const_str(url_encode, "url_encode", 528392145u, 0, 10, NULL); @@ -683,12 +687,12 @@ be_define_const_str(web_add_config_button, "web_add_config_button", 639674325u, be_define_const_str(web_add_console_button, "web_add_console_button", 3481436192u, 0, 22, NULL); be_define_const_str(web_add_handler, "web_add_handler", 3990174962u, 0, 15, NULL); be_define_const_str(web_add_main_button, "web_add_main_button", 3960367664u, 0, 19, NULL); -be_define_const_str(web_add_management_button, "web_add_management_button", 2738877186u, 0, 25, NULL); +be_define_const_str(web_add_management_button, "web_add_management_button", 2738877186u, 0, 25, &be_const_str_do); be_define_const_str(web_send, "web_send", 2989941448u, 0, 8, NULL); be_define_const_str(web_send_decimal, "web_send_decimal", 1407210204u, 0, 16, NULL); -be_define_const_str(web_sensor, "web_sensor", 2900096972u, 0, 10, NULL); +be_define_const_str(web_sensor, "web_sensor", 2900096972u, 0, 10, &be_const_str_write_gpio); be_define_const_str(webclient, "webclient", 4076389146u, 0, 9, NULL); -be_define_const_str(webserver, "webserver", 1572454038u, 0, 9, &be_const_str__X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); +be_define_const_str(webserver, "webserver", 1572454038u, 0, 9, NULL); be_define_const_str(while, "while", 231090382u, 53, 5, NULL); be_define_const_str(widget_cb, "widget_cb", 2763583055u, 0, 9, NULL); be_define_const_str(widget_constructor, "widget_constructor", 2543785934u, 0, 18, NULL); @@ -703,15 +707,15 @@ be_define_const_str(widget_event_cb, "widget_event_cb", 1508466754u, 0, 15, NULL be_define_const_str(widget_event_impl, "widget_event_impl", 2178430561u, 0, 17, NULL); be_define_const_str(widget_group_def, "widget_group_def", 1246968785u, 0, 16, NULL); be_define_const_str(widget_height_def, "widget_height_def", 3131667813u, 0, 17, NULL); -be_define_const_str(widget_instance_size, "widget_instance_size", 2055354779u, 0, 20, &be_const_str_do); +be_define_const_str(widget_instance_size, "widget_instance_size", 2055354779u, 0, 20, NULL); be_define_const_str(widget_struct_by_class, "widget_struct_by_class", 3806373842u, 0, 22, NULL); be_define_const_str(widget_struct_default, "widget_struct_default", 781673633u, 0, 21, NULL); be_define_const_str(widget_width_def, "widget_width_def", 3986078862u, 0, 16, NULL); be_define_const_str(width, "width", 2508680735u, 0, 5, NULL); be_define_const_str(width_def, "width_def", 1143717879u, 0, 9, NULL); be_define_const_str(wifi, "wifi", 120087624u, 0, 4, NULL); -be_define_const_str(wire, "wire", 4082753944u, 0, 4, &be_const_str_static); -be_define_const_str(wire1, "wire1", 3212721419u, 0, 5, NULL); +be_define_const_str(wire, "wire", 4082753944u, 0, 4, NULL); +be_define_const_str(wire1, "wire1", 3212721419u, 0, 5, &be_const_str_true); be_define_const_str(wire2, "wire2", 3229499038u, 0, 5, NULL); be_define_const_str(wire_scan, "wire_scan", 2671275880u, 0, 9, NULL); be_define_const_str(write, "write", 3190202204u, 0, 5, NULL); @@ -720,9 +724,9 @@ be_define_const_str(write_bit, "write_bit", 2660990436u, 0, 9, NULL); be_define_const_str(write_bytes, "write_bytes", 1227543792u, 0, 11, NULL); be_define_const_str(write_file, "write_file", 3177658879u, 0, 10, NULL); be_define_const_str(write_gpio, "write_gpio", 2267940334u, 0, 10, NULL); -be_define_const_str(x, "x", 4245442695u, 0, 1, &be_const_str__X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); +be_define_const_str(x, "x", 4245442695u, 0, 1, NULL); be_define_const_str(x1, "x1", 274927234u, 0, 2, NULL); -be_define_const_str(y, "y", 4228665076u, 0, 1, &be_const_str_end); +be_define_const_str(y, "y", 4228665076u, 0, 1, NULL); be_define_const_str(y1, "y1", 2355101727u, 0, 2, NULL); be_define_const_str(year, "year", 2927578396u, 0, 4, NULL); be_define_const_str(yield, "yield", 1821831854u, 0, 5, NULL); @@ -738,367 +742,369 @@ be_define_const_str(_X7B_X7D, "{}", 1415952421u, 0, 2, NULL); be_define_const_str(_X7D, "}", 4161554600u, 0, 1, NULL); static const bstring* const m_string_table[] = { - (const bstring *)&be_const_str__X23init_X2Ebat, - (const bstring *)&be_const_str_Tele, - (const bstring *)&be_const_str_widget_cb, - (const bstring *)&be_const_str__X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_cb_do_nothing, - (const bstring *)&be_const_str_return, - (const bstring *)&be_const_str_state, - (const bstring *)&be_const_str_call, - NULL, - (const bstring *)&be_const_str__X23, - (const bstring *)&be_const_str_autoexec, - NULL, - (const bstring *)&be_const_str___iterator__, - (const bstring *)&be_const_str_POST, - (const bstring *)&be_const_str_Wire, - (const bstring *)&be_const_str_push_path, - (const bstring *)&be_const_str_CFG_X3A_X20ran_X20_X20, - (const bstring *)&be_const_str_time_reached, - (const bstring *)&be_const_str_encrypt, - (const bstring *)&be_const_str_a, - (const bstring *)&be_const_str_can_show, - (const bstring *)&be_const_str_imin, - (const bstring *)&be_const_str__X2Ebe, - (const bstring *)&be_const_str_SERIAL_8N2, - (const bstring *)&be_const_str_read, - (const bstring *)&be_const_str_SERIAL_6E1, - (const bstring *)&be_const_str__X2Etapp, - (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X20, - (const bstring *)&be_const_str__X2B, (const bstring *)&be_const_str__X3E_X3D, - (const bstring *)&be_const_str_atan2, - (const bstring *)&be_const_str_bytes, - (const bstring *)&be_const_str_AES_GCM, - (const bstring *)&be_const_str__X25s_X2Eautoconf, - NULL, - (const bstring *)&be_const_str_AudioFileSourceFS, - (const bstring *)&be_const_str_get_bat_voltage, - (const bstring *)&be_const_str_display_X2Eini, - (const bstring *)&be_const_str_web_add_console_button, - (const bstring *)&be_const_str__X2Ep1, + (const bstring *)&be_const_str_run_bat, NULL, NULL, - (const bstring *)&be_const_str_EVENT_DRAW_PART_END, - (const bstring *)&be_const_str_group_def, - (const bstring *)&be_const_str__X2F_X3Frst_X3D, - (const bstring *)&be_const_str_leds, - (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, - (const bstring *)&be_const_str_CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, - (const bstring *)&be_const_str_connection_error, - (const bstring *)&be_const_str_load, - (const bstring *)&be_const_str_pow, - NULL, - (const bstring *)&be_const_str_valuer_error, - NULL, - NULL, - (const bstring *)&be_const_str_draw_arc, - (const bstring *)&be_const_str_scale_uint, - (const bstring *)&be_const_str_arg, - (const bstring *)&be_const_str__read, - (const bstring *)&be_const_str__X21_X3D_X3D, - (const bstring *)&be_const_str_cos, - (const bstring *)&be_const_str_classname, - (const bstring *)&be_const_str_add_driver, - (const bstring *)&be_const_str__X3D_X3C_X3E_X21, - (const bstring *)&be_const_str_SERIAL_5N2, - (const bstring *)&be_const_str__X23display_X2Eini, - (const bstring *)&be_const_str_CFG_X3A_X20removing_X20autoconf_X20files, - (const bstring *)&be_const_str__drivers, - (const bstring *)&be_const_str_detect, - (const bstring *)&be_const_str_get_vbus_voltage, - (const bstring *)&be_const_str_tr, - (const bstring *)&be_const_str_button_pressed, - (const bstring *)&be_const_str_call_native, - NULL, - (const bstring *)&be_const_str_gamma10, - (const bstring *)&be_const_str__X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, - (const bstring *)&be_const_str_STATE_DEFAULT, - (const bstring *)&be_const_str_quality, - (const bstring *)&be_const_str__X2Eautoconf, - (const bstring *)&be_const_str__def, - (const bstring *)&be_const_str_escape, - (const bstring *)&be_const_str_percentage, - (const bstring *)&be_const_str_TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, - (const bstring *)&be_const_str__archive, - (const bstring *)&be_const_str_OPTION_A, - (const bstring *)&be_const_str_h, - (const bstring *)&be_const_str_every_50ms, - (const bstring *)&be_const_str_SERIAL_8E1, - (const bstring *)&be_const_str_get_aps_voltage, - (const bstring *)&be_const_str_EC_C25519, - (const bstring *)&be_const_str_gen_cb, - (const bstring *)&be_const_str_False, - (const bstring *)&be_const_str_path, - (const bstring *)&be_const_str_isnan, - (const bstring *)&be_const_str__X5B, - (const bstring *)&be_const_str__X2Ew, - (const bstring *)&be_const_str_collect, - (const bstring *)&be_const_str_contains, - (const bstring *)&be_const_str_Parameter_X20error, - (const bstring *)&be_const_str_CFG_X3A_X20removed_X20file_X20_X27_X25s_X27, - (const bstring *)&be_const_str__X21_X3D, - (const bstring *)&be_const_str_ceil, - (const bstring *)&be_const_str_pc_abs, - (const bstring *)&be_const_str_CFG_X3A_X20removing_X20first_X20time_X20marker, - (const bstring *)&be_const_str_setrange, - (const bstring *)&be_const_str_concat, - (const bstring *)&be_const_str_x1, - (const bstring *)&be_const_str_ctypes_bytes_dyn, - NULL, - (const bstring *)&be_const_str__X2Elen, - NULL, - (const bstring *)&be_const_str__X2Ebec, - (const bstring *)&be_const_str_set_timer, - (const bstring *)&be_const_str__X3A, - (const bstring *)&be_const_str_log10, - (const bstring *)&be_const_str_None, - (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_init, - NULL, - (const bstring *)&be_const_str_run, - (const bstring *)&be_const_str_BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, - (const bstring *)&be_const_str_Leds, - NULL, - (const bstring *)&be_const_str_char, - NULL, - NULL, - (const bstring *)&be_const_str_exec_rules, - (const bstring *)&be_const_str_content_send_style, - (const bstring *)&be_const_str___upper__, - (const bstring *)&be_const_str_millis, - NULL, - (const bstring *)&be_const_str_find_key_i, - (const bstring *)&be_const_str_k, - (const bstring *)&be_const_str_SERIAL_6O1, - (const bstring *)&be_const_str_battery_present, - NULL, - (const bstring *)&be_const_str_compress, - (const bstring *)&be_const_str_offseta, - NULL, - (const bstring *)&be_const_str_decompress, - (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X27_X25s_X27, - (const bstring *)&be_const_str__X3D, - (const bstring *)&be_const_str_is_running, - (const bstring *)&be_const_str_min, - (const bstring *)&be_const_str_line_dsc, - (const bstring *)&be_const_str__ptr, - (const bstring *)&be_const_str_ctypes_bytes, - (const bstring *)&be_const_str__X3C_X3D, - NULL, - (const bstring *)&be_const_str_draw_line_dsc, - (const bstring *)&be_const_str__X2C, - (const bstring *)&be_const_str_get_bat_power, - (const bstring *)&be_const_str___lower__, - (const bstring *)&be_const_str_read_bytes, - (const bstring *)&be_const_str_get_height, - (const bstring *)&be_const_str_BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, - (const bstring *)&be_const_str_bus, - (const bstring *)&be_const_str_SERIAL_5O1, - (const bstring *)&be_const_str_set_ldo_voltage, - (const bstring *)&be_const_str_CFG_X3A_X20downloading_X20_X27_X25s_X27, - (const bstring *)&be_const_str_b, - (const bstring *)&be_const_str_pi, - (const bstring *)&be_const_str_get_current_module_path, - (const bstring *)&be_const_str_editable, - (const bstring *)&be_const_str_internal_error, - (const bstring *)&be_const_str_begin, - (const bstring *)&be_const_str_arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj, - (const bstring *)&be_const_str_duration, - (const bstring *)&be_const_str_instance_size, - (const bstring *)&be_const_str_True, - (const bstring *)&be_const_str_EVENT_DRAW_PART_BEGIN, - (const bstring *)&be_const_str__X2502d_X25s_X2502d, - (const bstring *)&be_const_str_byte, - NULL, - (const bstring *)&be_const_str_kv, - (const bstring *)&be_const_str_WS2812_GRB, - (const bstring *)&be_const_str_SERIAL_8O2, - (const bstring *)&be_const_str_arch, - (const bstring *)&be_const_str__X2Fac, - (const bstring *)&be_const_str_get_temp, - (const bstring *)&be_const_str_CFG_X3A_X20return_code_X3D_X25i, - (const bstring *)&be_const_str_WS2812, - (const bstring *)&be_const_str__X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, - NULL, - (const bstring *)&be_const_str_add_header, - (const bstring *)&be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, - (const bstring *)&be_const_str_every_100ms, - (const bstring *)&be_const_str_SERIAL_7N1, - (const bstring *)&be_const_str__X3C, - (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dzip_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, - NULL, - (const bstring *)&be_const_str__begin_transmission, - (const bstring *)&be_const_str_every_second, - (const bstring *)&be_const_str_CFG_X3A_X20running_X20, - (const bstring *)&be_const_str_base_class, - (const bstring *)&be_const_str_set_power, - (const bstring *)&be_const_str_AudioGeneratorMP3, - (const bstring *)&be_const_str__X2F, - (const bstring *)&be_const_str_r, - (const bstring *)&be_const_str_eth, - (const bstring *)&be_const_str_due, - (const bstring *)&be_const_str_animators, - (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, - NULL, - (const bstring *)&be_const_str_cmd, - (const bstring *)&be_const_str_, - (const bstring *)&be_const_str_gc, - (const bstring *)&be_const_str_get_power, - (const bstring *)&be_const_str_file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27, - NULL, - (const bstring *)&be_const_str_bri, - (const bstring *)&be_const_str_class_init_obj, - (const bstring *)&be_const_str_engine, - (const bstring *)&be_const_str_add_anim, - (const bstring *)&be_const_str_closure, - (const bstring *)&be_const_str_HTTP_GET, - (const bstring *)&be_const_str_members, - (const bstring *)&be_const_str__X2Ep, - (const bstring *)&be_const_str_CFG_X3A_X20loading_X20, - (const bstring *)&be_const_str_gamma8, - (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, - (const bstring *)&be_const_str__X3C_X2Fform_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_get_option, - (const bstring *)&be_const_str_SERIAL_8O1, - (const bstring *)&be_const_str_dump, - (const bstring *)&be_const_str_CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting, - (const bstring *)&be_const_str_traceback, - (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, - (const bstring *)&be_const_str_CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, - (const bstring *)&be_const_str_PART_MAIN, - (const bstring *)&be_const_str_Unknown_X20command, - NULL, - (const bstring *)&be_const_str_atleast1, - (const bstring *)&be_const_str_I2C_Driver, - (const bstring *)&be_const_str_delay, - (const bstring *)&be_const_str__X3F, - (const bstring *)&be_const_str_set_style_bg_color, - NULL, - (const bstring *)&be_const_str_AudioFileSource, - (const bstring *)&be_const_str__X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str__debug_present, - NULL, - (const bstring *)&be_const_str_get_free_heap, - (const bstring *)&be_const_str_introspect, - (const bstring *)&be_const_str__X2E, - (const bstring *)&be_const_str_SERIAL_7E2, - (const bstring *)&be_const_str_get_bat_charge_current, - NULL, - (const bstring *)&be_const_str__X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, - NULL, - NULL, - (const bstring *)&be_const_str__p, - (const bstring *)&be_const_str__X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, - (const bstring *)&be_const_str_year, - NULL, - (const bstring *)&be_const_str_destructor_cb, - (const bstring *)&be_const_str_select, - (const bstring *)&be_const_str_content_start, - (const bstring *)&be_const_str__persist_X2Ejson, - NULL, - NULL, - (const bstring *)&be_const_str_Animate_X20pc_X20is_X20out_X20of_X20range, - (const bstring *)&be_const_str_create_matrix, - (const bstring *)&be_const_str__, - (const bstring *)&be_const_str_SERIAL_5E2, - NULL, - (const bstring *)&be_const_str__X23autoexec_X2Ebat, - (const bstring *)&be_const_str_BUTTON_CONFIGURATION, - (const bstring *)&be_const_str_exists, - (const bstring *)&be_const_str_CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29, - NULL, - (const bstring *)&be_const_str_ins_time, - (const bstring *)&be_const_str_digital_read, - (const bstring *)&be_const_str_MD5, - (const bstring *)&be_const_str_SERIAL_6O2, - (const bstring *)&be_const_str_alternate, - (const bstring *)&be_const_str_offset, - (const bstring *)&be_const_str_assert, - NULL, - NULL, - (const bstring *)&be_const_str_SERIAL_5N1, - (const bstring *)&be_const_str_cosh, - (const bstring *)&be_const_str__X3E, - (const bstring *)&be_const_str__X23preinit_X2Ebe, - (const bstring *)&be_const_str_AXP192, - NULL, - (const bstring *)&be_const_str_search, - NULL, - (const bstring *)&be_const_str_seti, - (const bstring *)&be_const_str_target_search, - (const bstring *)&be_const_str_var, - (const bstring *)&be_const_str__X2F_X2Eautoconf, - (const bstring *)&be_const_str_item, - NULL, - (const bstring *)&be_const_str__X3Clabel_X3EChoose_X20a_X20device_X20configuration_X3A_X3C_X2Flabel_X3E_X3Cbr_X3E, - (const bstring *)&be_const_str_height_def, - (const bstring *)&be_const_str_insert, - (const bstring *)&be_const_str__X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, - (const bstring *)&be_const_str__request_from, - (const bstring *)&be_const_str__X28_X29, - (const bstring *)&be_const_str_asstring, - (const bstring *)&be_const_str__timers, - (const bstring *)&be_const_str_web_add_main_button, - (const bstring *)&be_const_str_CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27, - (const bstring *)&be_const_str_allocated, - (const bstring *)&be_const_str__X3D_X3D, - (const bstring *)&be_const_str_reset, - (const bstring *)&be_const_str_find_op, - (const bstring *)&be_const_str_animate, - (const bstring *)&be_const_str_cb_obj, - NULL, - (const bstring *)&be_const_str_isrunning, + (const bstring *)&be_const_str_io_error, (const bstring *)&be_const_str_depower, - (const bstring *)&be_const_str_AudioOutputI2S, + (const bstring *)&be_const_str_SERIAL_6O1, + (const bstring *)&be_const_str_STATE_DEFAULT, + (const bstring *)&be_const_str_SERIAL_6N1, + (const bstring *)&be_const_str_Auto_X2Dconfiguration, + (const bstring *)&be_const_str_decrypt, + (const bstring *)&be_const_str_insert, NULL, + (const bstring *)&be_const_str__X3D, + (const bstring *)&be_const_str_write_bytes, NULL, - (const bstring *)&be_const_str_cb_event_closure, - NULL, - (const bstring *)&be_const_str_EVENT_DRAW_MAIN, + (const bstring *)&be_const_str_running, + (const bstring *)&be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, + (const bstring *)&be_const_str_read_bytes, + (const bstring *)&be_const_str_draw_arc, (const bstring *)&be_const_str__X20, - (const bstring *)&be_const_str_obj_event_base, - (const bstring *)&be_const_str_redirect, - (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, - (const bstring *)&be_const_str_I2C_X3A, - (const bstring *)&be_const_str_clear_to, - (const bstring *)&be_const_str_CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29, - (const bstring *)&be_const_str_pixels_buffer, - (const bstring *)&be_const_str_resp_cmnd_done, - (const bstring *)&be_const_str__X2Esize, - (const bstring *)&be_const_str_AudioOutput, + (const bstring *)&be_const_str_event, + (const bstring *)&be_const_str_SERIAL_5E2, + (const bstring *)&be_const_str_SERIAL_6E1, + (const bstring *)&be_const_str_leds, + (const bstring *)&be_const_str__lvgl, + (const bstring *)&be_const_str_zip, + (const bstring *)&be_const_str_EC_C25519, + (const bstring *)&be_const_str_COLOR_BLACK, + (const bstring *)&be_const_str_readline, + (const bstring *)&be_const_str__X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, + NULL, + (const bstring *)&be_const_str_load_templates, + (const bstring *)&be_const_str_get, + (const bstring *)&be_const_str_POST, + (const bstring *)&be_const_str___iterator__, + (const bstring *)&be_const_str_AudioGeneratorMP3, + (const bstring *)&be_const_str__energy, + (const bstring *)&be_const_str__rules, + (const bstring *)&be_const_str_break, + (const bstring *)&be_const_str__X2F_X2Eautoconf, + (const bstring *)&be_const_str_content_button, + (const bstring *)&be_const_str__cb, + (const bstring *)&be_const_str_get_aps_voltage, + (const bstring *)&be_const_str_AXP192, + (const bstring *)&be_const_str_select, + (const bstring *)&be_const_str_autoexec, + (const bstring *)&be_const_str__X0A, + (const bstring *)&be_const_str_available, + NULL, + (const bstring *)&be_const_str__X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, + (const bstring *)&be_const_str_gc, + (const bstring *)&be_const_str_CFG_X3A_X20loading_X20_X27_X25s_X27, + (const bstring *)&be_const_str__X21_X3D_X3D, + (const bstring *)&be_const_str_split, + (const bstring *)&be_const_str_lower, + (const bstring *)&be_const_str__X3Clabel_X3EChoose_X20a_X20device_X20configuration_X3A_X3C_X2Flabel_X3E_X3Cbr_X3E, + (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, + (const bstring *)&be_const_str_base_class, + (const bstring *)&be_const_str_connected, + (const bstring *)&be_const_str_instance, + NULL, + (const bstring *)&be_const_str__X2Etapp, + (const bstring *)&be_const_str__X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_attrdump, + (const bstring *)&be_const_str_EVENT_DRAW_MAIN, + (const bstring *)&be_const_str__request_from, + (const bstring *)&be_const_str__X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_acos, + (const bstring *)&be_const_str_get_light, + (const bstring *)&be_const_str_resp_cmnd_str, + NULL, + (const bstring *)&be_const_str_CFG_X3A_X20removing_X20autoconf_X20files, + NULL, + (const bstring *)&be_const_str_w, + (const bstring *)&be_const_str_draw_line, + NULL, + (const bstring *)&be_const_str_strip, + (const bstring *)&be_const_str_format, + (const bstring *)&be_const_str_Leds, + (const bstring *)&be_const_str_exec_tele, + (const bstring *)&be_const_str_chars_in_string, + (const bstring *)&be_const_str_CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, + NULL, + (const bstring *)&be_const_str_widget_dtor_cb, + (const bstring *)&be_const_str_invalidate, + (const bstring *)&be_const_str__X3A, + NULL, + (const bstring *)&be_const_str_out_X20of_X20range, + NULL, + (const bstring *)&be_const_str_lv_event_cb, + (const bstring *)&be_const_str_LVG_X3A_X20call_X20to_X20unsupported_X20callback, + (const bstring *)&be_const_str_escape, + (const bstring *)&be_const_str_event_cb, (const bstring *)&be_const_str_init_draw_line_dsc, NULL, - (const bstring *)&be_const_str_BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, - (const bstring *)&be_const_str_SERIAL_8N1, - (const bstring *)&be_const_str_deinit, - (const bstring *)&be_const_str__X2D_X2D_X3A_X2D_X2D, - (const bstring *)&be_const_str_split, - NULL, - (const bstring *)&be_const_str__X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D, - (const bstring *)&be_const_str__X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str__X23autoexec_X2Ebe, - (const bstring *)&be_const_str_Restart_X201, - (const bstring *)&be_const_str__X3Cp_X3E_X3Csmall_X3E_X26nbsp_X3B_X28This_X20feature_X20requires_X20an_X20internet_X20connection_X29_X3C_X2Fsmall_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_settings, - (const bstring *)&be_const_str_code, + (const bstring *)&be_const_str_isinstance, + (const bstring *)&be_const_str_exists, + (const bstring *)&be_const_str_HTTP_GET, + (const bstring *)&be_const_str_clear_first_time, + (const bstring *)&be_const_str__X2Eautoconf, + (const bstring *)&be_const_str_clear, + (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, + (const bstring *)&be_const_str_SERIAL_7N1, + (const bstring *)&be_const_str_get_percentage, (const bstring *)&be_const_str_SERIAL_7O1, - (const bstring *)&be_const_str__rules, - (const bstring *)&be_const_str_month, - (const bstring *)&be_const_str_read_sensors, - (const bstring *)&be_const_str__X2Ep2, - (const bstring *)&be_const_str__dirty, + (const bstring *)&be_const_str_remove, + (const bstring *)&be_const_str_set_time, + (const bstring *)&be_const_str_get_size, + (const bstring *)&be_const_str_remove_timer, + (const bstring *)&be_const_str__X23autoexec_X2Ebat, + (const bstring *)&be_const_str__X2D_X2D_X3A_X2D_X2D, + (const bstring *)&be_const_str_due, + (const bstring *)&be_const_str__X2C, + (const bstring *)&be_const_str_instance_size, + (const bstring *)&be_const_str_Animate_X20pc_X20is_X20out_X20of_X20range, + (const bstring *)&be_const_str_get_bat_voltage, + (const bstring *)&be_const_str_resp_cmnd_done, + NULL, + (const bstring *)&be_const_str_energy_struct, + NULL, + (const bstring *)&be_const_str__drivers, + (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dzip_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, + (const bstring *)&be_const_str_tob64, + (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, + (const bstring *)&be_const_str_CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29, + (const bstring *)&be_const_str__X3C, + (const bstring *)&be_const_str_y, + (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_files, + (const bstring *)&be_const_str__X2Ew, + (const bstring *)&be_const_str_assert, + (const bstring *)&be_const_str_bytes, + (const bstring *)&be_const_str__X23, + (const bstring *)&be_const_str_abs, (const bstring *)&be_const_str__X2E_X2E, + (const bstring *)&be_const_str__global_addr, + (const bstring *)&be_const_str_connect, + (const bstring *)&be_const_str__settings_ptr, + NULL, + (const bstring *)&be_const_str_CFG_X3A_X20ran_X20_X20, + (const bstring *)&be_const_str_BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, + NULL, + (const bstring *)&be_const_str__X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, + (const bstring *)&be_const_str_i2c_enabled, + (const bstring *)&be_const_str_ctypes_bytes_dyn, + (const bstring *)&be_const_str_CFG_X3A_X20loading_X20, + NULL, + NULL, + (const bstring *)&be_const_str_refr_size, + (const bstring *)&be_const_str_content_send_style, + NULL, + NULL, + (const bstring *)&be_const_str__get_cb, + (const bstring *)&be_const_str_c, + (const bstring *)&be_const_str_ins_goto, + (const bstring *)&be_const_str__buffer, + (const bstring *)&be_const_str_concat, + (const bstring *)&be_const_str_percentage, + NULL, + (const bstring *)&be_const_str_SERIAL_5N2, + NULL, + NULL, + (const bstring *)&be_const_str_SK6812_GRBW, + (const bstring *)&be_const_str__X3Cp_X3E_X3Csmall_X3E_X26nbsp_X3B_X28This_X20feature_X20requires_X20an_X20internet_X20connection_X29_X3C_X2Fsmall_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, + NULL, + NULL, + (const bstring *)&be_const_str_lv_obj, + (const bstring *)&be_const_str___upper__, + (const bstring *)&be_const_str_Restart_X201, + NULL, + (const bstring *)&be_const_str_introspect, + (const bstring *)&be_const_str__X23autoexec_X2Ebe, + (const bstring *)&be_const_str_CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27, + (const bstring *)&be_const_str_bool, + (const bstring *)&be_const_str_PART_MAIN, + (const bstring *)&be_const_str_back_forth, + (const bstring *)&be_const_str_lv_obj_class, + (const bstring *)&be_const_str_TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, + (const bstring *)&be_const_str_GET, + (const bstring *)&be_const_str_deg, + (const bstring *)&be_const_str__X28_X29, + NULL, + (const bstring *)&be_const_str__X23preinit_X2Ebe, + (const bstring *)&be_const_str__class, + NULL, + (const bstring *)&be_const_str__X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, + (const bstring *)&be_const_str_CFG_X3A_X20downloading_X20_X27_X25s_X27, + (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, + (const bstring *)&be_const_str_fromstring, + (const bstring *)&be_const_str_SERIAL_8E2, + NULL, + (const bstring *)&be_const_str__anonymous_, + (const bstring *)&be_const_str__X2502d_X25s_X2502d, + (const bstring *)&be_const_str_CFG_X3A_X20return_code_X3D_X25i, + (const bstring *)&be_const_str_web_sensor, + (const bstring *)&be_const_str_detect, + (const bstring *)&be_const_str_exec_cmd, + (const bstring *)&be_const_str_to_gamma, + (const bstring *)&be_const_str__ptr, + (const bstring *)&be_const_str_null_cb, + (const bstring *)&be_const_str_eth, + (const bstring *)&be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf, + (const bstring *)&be_const_str_erase, + (const bstring *)&be_const_str__archive, + (const bstring *)&be_const_str_CFG_X3A_X20removed_X20file_X20_X27_X25s_X27, + (const bstring *)&be_const_str_code, + (const bstring *)&be_const_str_BUTTON_CONFIGURATION, + (const bstring *)&be_const_str_web_send_decimal, + (const bstring *)&be_const_str_fromptr, + (const bstring *)&be_const_str_SERIAL_8E1, + NULL, + (const bstring *)&be_const_str_set_style_bg_color, + (const bstring *)&be_const_str_end, + (const bstring *)&be_const_str__read, + (const bstring *)&be_const_str_cos, + (const bstring *)&be_const_str_codedump, + (const bstring *)&be_const_str__X23init_X2Ebat, + (const bstring *)&be_const_str_get_battery_chargin_status, + (const bstring *)&be_const_str__X2Ebec, + (const bstring *)&be_const_str_set_dcdc_enable, + NULL, + (const bstring *)&be_const_str_ctor, + (const bstring *)&be_const_str_digital_read, + (const bstring *)&be_const_str_close, + (const bstring *)&be_const_str__X2F, + (const bstring *)&be_const_str_cosh, + (const bstring *)&be_const_str_I2C_Driver, + (const bstring *)&be_const_str_read24, + (const bstring *)&be_const_str__write, + (const bstring *)&be_const_str__X23display_X2Eini, + (const bstring *)&be_const_str_get_bat_power, + (const bstring *)&be_const_str_pin_mode, + (const bstring *)&be_const_str__, + (const bstring *)&be_const_str_scale_uint, + (const bstring *)&be_const_str_WS2812_GRB, + (const bstring *)&be_const_str_AudioOutput, + (const bstring *)&be_const_str_animate, + (const bstring *)&be_const_str__X3F, + (const bstring *)&be_const_str_id, + (const bstring *)&be_const_str_arg_name, + (const bstring *)&be_const_str_internal_error, + (const bstring *)&be_const_str_serial, + NULL, + NULL, + (const bstring *)&be_const_str_CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29, + (const bstring *)&be_const_str__begin_transmission, + (const bstring *)&be_const_str__X2Ep1, + (const bstring *)&be_const_str_engine, + (const bstring *)&be_const_str__def, + (const bstring *)&be_const_str_get_pixel_color, + (const bstring *)&be_const_str__X3C_X3D, + (const bstring *)&be_const_str_CFG_X3A_X20removing_X20first_X20time_X20marker, + (const bstring *)&be_const_str__X3D_X3D, + (const bstring *)&be_const_str_can_show, + (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, + (const bstring *)&be_const_str_response_append, + (const bstring *)&be_const_str_CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting, + (const bstring *)&be_const_str_content_send, + (const bstring *)&be_const_str_create_segment, + (const bstring *)&be_const_str_duration, + (const bstring *)&be_const_str_get_height, + (const bstring *)&be_const_str_delete_all_configs, + (const bstring *)&be_const_str_reset_search, + (const bstring *)&be_const_str_BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, + (const bstring *)&be_const_str_, + (const bstring *)&be_const_str_b, + (const bstring *)&be_const_str_SERIAL_5E1, + (const bstring *)&be_const_str_SERIAL_6E2, + (const bstring *)&be_const_str_read13, + (const bstring *)&be_const_str_BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, + (const bstring *)&be_const_str_publish_result, + (const bstring *)&be_const_str_get_bat_current, + NULL, + (const bstring *)&be_const_str_ceil, + (const bstring *)&be_const_str_autorun, + (const bstring *)&be_const_str_length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032, + (const bstring *)&be_const_str_set_text, + (const bstring *)&be_const_str__X3D_X3C_X3E_X21, + (const bstring *)&be_const_str_r, + (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X20, + (const bstring *)&be_const_str__X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str__X2Ep, + (const bstring *)&be_const_str__error, + (const bstring *)&be_const_str_lv, + (const bstring *)&be_const_str_flush, + (const bstring *)&be_const_str_AudioFileSource, + (const bstring *)&be_const_str_web_add_main_button, + (const bstring *)&be_const_str__X2Elen, + (const bstring *)&be_const_str_persist_X2E_p_X20is_X20not_X20a_X20map, + (const bstring *)&be_const_str_compile, + (const bstring *)&be_const_str_CFG_X3A_X20running_X20, + (const bstring *)&be_const_str_compress, + NULL, + (const bstring *)&be_const_str_pin_used, + (const bstring *)&be_const_str__X2Ebe, + (const bstring *)&be_const_str_SERIAL_8O1, + (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X27_X25s_X27, + (const bstring *)&be_const_str_EVENT_DRAW_PART_END, + NULL, + NULL, + (const bstring *)&be_const_str_button_pressed, + (const bstring *)&be_const_str_atleast1, + (const bstring *)&be_const_str_add_anim, + (const bstring *)&be_const_str_count, + (const bstring *)&be_const_str__X25s_X2Eautoconf, + (const bstring *)&be_const_str_False, + (const bstring *)&be_const_str_time_str, (const bstring *)&be_const_str__X26lt_X3BNone_X26gt_X3B, - (const bstring *)&be_const_str_COLOR_WHITE, - (const bstring *)&be_const_str_event_cb, - (const bstring *)&be_const_str_add_cmd, - (const bstring *)&be_const_str__X0A + (const bstring *)&be_const_str_allocated, + NULL, + (const bstring *)&be_const_str_cb_obj, + (const bstring *)&be_const_str__X21_X3D, + (const bstring *)&be_const_str__X3Cselect_X20name_X3D_X27zip_X27_X3E, + (const bstring *)&be_const_str_OneWire, + (const bstring *)&be_const_str_classof, + (const bstring *)&be_const_str_json, + (const bstring *)&be_const_str_True, + (const bstring *)&be_const_str__X2B, + (const bstring *)&be_const_str_decompress, + (const bstring *)&be_const_str_CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, + (const bstring *)&be_const_str_lv_event, + (const bstring *)&be_const_str_counters, + (const bstring *)&be_const_str_pc, + (const bstring *)&be_const_str__X2Esize, + NULL, + (const bstring *)&be_const_str__X5B, + (const bstring *)&be_const_str__X3C_X2Fform_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_connection_error, + (const bstring *)&be_const_str_classname, + (const bstring *)&be_const_str_AudioGeneratorWAV, + (const bstring *)&be_const_str_AudioGenerator, + (const bstring *)&be_const_str_Parameter_X20error, + (const bstring *)&be_const_str_get_tasmota, + (const bstring *)&be_const_str_loop, + (const bstring *)&be_const_str__timers, + (const bstring *)&be_const_str_constructor_cb, + (const bstring *)&be_const_str_addr, + (const bstring *)&be_const_str__X2E, + (const bstring *)&be_const_str_RES_OK, + NULL, + (const bstring *)&be_const_str_OPTION_A, + NULL, + (const bstring *)&be_const_str_collect, + (const bstring *)&be_const_str_SERIAL_6O2, + (const bstring *)&be_const_str_AudioFileSourceFS, + (const bstring *)&be_const_str_show, + (const bstring *)&be_const_str__cmd, + (const bstring *)&be_const_str_SERIAL_7N2, + (const bstring *)&be_const_str_dirty, + (const bstring *)&be_const_str_SERIAL_7E2, + (const bstring *)&be_const_str__X3E, + (const bstring *)&be_const_str__X2F_X3Frst_X3D, + (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, + (const bstring *)&be_const_str_EVENT_DRAW_PART_BEGIN, + (const bstring *)&be_const_str__persist_X2Ejson, + (const bstring *)&be_const_str_tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29, + (const bstring *)&be_const_str__X3Clambda_X3E }; static const struct bconststrtab m_const_string_table = { - .size = 357, - .count = 738, + .size = 359, + .count = 742, .table = m_string_table }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tcpclient.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tcpclient.h new file mode 100644 index 000000000..68c4d0095 --- /dev/null +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_tcpclient.h @@ -0,0 +1,27 @@ +#include "be_constobj.h" + +static be_define_const_map_slots(be_class_tcpclient_map) { + { be_const_key(init, -1), be_const_func(wc_tcp_init) }, + { be_const_key(close, -1), be_const_func(wc_tcp_close) }, + { be_const_key(_X2Ew, 4), be_const_var(0) }, + { be_const_key(flush, -1), be_const_func(wc_tcp_flush) }, + { be_const_key(deinit, 6), be_const_func(wc_tcp_deinit) }, + { be_const_key(read, -1), be_const_func(wc_tcp_read) }, + { be_const_key(write, 8), be_const_func(wc_tcp_write) }, + { be_const_key(connected, -1), be_const_func(wc_tcp_connected) }, + { be_const_key(available, -1), be_const_func(wc_tcp_available) }, + { be_const_key(connect, 0), be_const_func(wc_tcp_connect) }, + { be_const_key(readbytes, -1), be_const_func(wc_tcp_readbytes) }, +}; + +static be_define_const_map( + be_class_tcpclient_map, + 11 +); + +BE_EXPORT_VARIABLE be_define_const_class( + be_class_tcpclient, + 1, + NULL, + tcpclient +); diff --git a/tasmota/xdrv_52_3_berry_webclient.ino b/tasmota/xdrv_52_3_berry_webclient.ino index b7b56a39e..83f9419ea 100644 --- a/tasmota/xdrv_52_3_berry_webclient.ino +++ b/tasmota/xdrv_52_3_berry_webclient.ino @@ -17,6 +17,7 @@ along with this program. If not, see . */ +// also includes tcp_client #ifdef USE_BERRY @@ -84,7 +85,6 @@ extern "C" { // int32_t wc_init(struct bvm *vm); int32_t wc_init(struct bvm *vm) { - // int32_t argc = be_top(vm); // Get the number of arguments WiFiClient * wcl = new WiFiClient(); be_pushcomptr(vm, (void*) wcl); be_setmember(vm, 1, ".w"); @@ -96,6 +96,14 @@ extern "C" { be_return_nil(vm); } + int32_t wc_tcp_init(struct bvm *vm); + int32_t wc_tcp_init(struct bvm *vm) { + WiFiClient * wcl = new WiFiClient(); + be_pushcomptr(vm, (void*) wcl); + be_setmember(vm, 1, ".w"); + be_return_nil(vm); + } + HTTPClientLight * wc_getclient(struct bvm *vm) { be_getmember(vm, 1, ".p"); void *p = be_tocomptr(vm, -1); @@ -123,6 +131,14 @@ extern "C" { be_return_nil(vm); } + int32_t wc_tcp_deinit(struct bvm *vm); + int32_t wc_tcp_deinit(struct bvm *vm) { + WiFiClient * wcl = wc_getwificlient(vm); + if (wcl != nullptr) { delete wcl; } + be_setmember(vm, 1, ".w"); + be_return_nil(vm); + } + // wc.url_encode(string) -> string int32_t wc_urlencode(struct bvm *vm); int32_t wc_urlencode(struct bvm *vm) { @@ -151,6 +167,24 @@ extern "C" { be_return(vm); /* return self */ } + // tcp.connect(url:string) -> self + int32_t wc_tcp_connect(struct bvm *vm); + int32_t wc_tcp_connect(struct bvm *vm) { + int32_t argc = be_top(vm); + if (argc >= 3 && be_isstring(vm, 2) && be_isint(vm, 3)) { + WiFiClient * tcp = wc_getwificlient(vm); + const char * address = be_tostring(vm, 2); + int32_t port = be_toint(vm, 3); + // open connection + if (!tcp->connect(address, port)) { + be_raise(vm, "value_error", "unsupported protocol"); + } + be_pushvalue(vm, 1); + be_return(vm); /* return self */ + } + be_raise(vm, "attribute_error", NULL); + } + // wc.close(void) -> nil int32_t wc_close(struct bvm *vm); int32_t wc_close(struct bvm *vm) { @@ -159,6 +193,31 @@ extern "C" { be_return_nil(vm); } + // tcp.close(void) -> nil + int32_t wc_tcp_close(struct bvm *vm); + int32_t wc_tcp_close(struct bvm *vm) { + WiFiClient * tcp = wc_getwificlient(vm); + tcp->stop(); + be_return_nil(vm); + } + + // tcp.close(void) -> nil + int32_t wc_tcp_flush(struct bvm *vm); + int32_t wc_tcp_flush(struct bvm *vm) { + WiFiClient * tcp = wc_getwificlient(vm); + tcp->flush(); + be_return_nil(vm); + } + + // tcp.available(void) -> int + int32_t wc_tcp_available(struct bvm *vm); + int32_t wc_tcp_available(struct bvm *vm) { + WiFiClient * tcp = wc_getwificlient(vm); + int32_t available = tcp->available(); + be_pushint(vm, available); + be_return(vm); + } + // wc.wc_set_timeouts([http_timeout_ms:int, tcp_timeout_ms:int]) -> self int32_t wc_set_timeouts(struct bvm *vm); int32_t wc_set_timeouts(struct bvm *vm) { @@ -239,6 +298,65 @@ extern "C" { be_return(vm); /* return code */ } + // tcp.connected(void) -> bool + int32_t wc_tcp_connected(struct bvm *vm); + int32_t wc_tcp_connected(struct bvm *vm) { + WiFiClient * tcp = wc_getwificlient(vm); + be_pushbool(vm, tcp->connected()); + be_return(vm); /* return code */ + } + + // tcp.write(bytes | string) -> int + int32_t wc_tcp_write(struct bvm *vm); + int32_t wc_tcp_write(struct bvm *vm) { + int32_t argc = be_top(vm); + if (argc >= 2 && (be_isstring(vm, 2) || be_isbytes(vm, 2))) { + WiFiClient * tcp = wc_getwificlient(vm); + const char * buf = nullptr; + size_t buf_len = 0; + if (be_isstring(vm, 2)) { // string + buf = be_tostring(vm, 2); + buf_len = strlen(buf); + } else { // bytes + buf = (const char*) be_tobytes(vm, 2, &buf_len); + } + size_t bw = tcp->write(buf, buf_len); + be_pushint(vm, bw); + be_return(vm); /* return code */ + } + be_raise(vm, kTypeError, nullptr); + } + + // tcp.read() -> string + int32_t wc_tcp_read(struct bvm *vm); + int32_t wc_tcp_read(struct bvm *vm) { + WiFiClient * tcp = wc_getwificlient(vm); + int32_t btr = tcp->available(); + if (btr <= 0) { + be_pushstring(vm, ""); + } else { + char * buf = (char*) be_pushbuffer(vm, btr); + int32_t btr2 = tcp->read((uint8_t*) buf, btr); + be_pushnstring(vm, buf, btr2); + } + be_return(vm); /* return code */ + } + + // tcp.readbytes() -> bytes + int32_t wc_tcp_readbytes(struct bvm *vm); + int32_t wc_tcp_readbytes(struct bvm *vm) { + WiFiClient * tcp = wc_getwificlient(vm); + int32_t btr = tcp->available(); + if (btr <= 0) { + be_pushbytes(vm, nullptr, 0); + } else { + uint8_t * buf = (uint8_t*) be_pushbuffer(vm, btr); + int32_t btr2 = tcp->read(buf, btr); + be_pushbytes(vm, buf, btr2); + } + be_return(vm); /* return code */ + } + void wc_errorCodeMessage(int32_t httpCode, uint32_t http_connect_time) { if (httpCode < 0) { if (httpCode <= -1000) { From 41684215909ffa79ce5b5ad4bf922c585286a1a3 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Thu, 9 Dec 2021 22:15:15 +0100 Subject: [PATCH 44/97] Remove flush --- lib/libesp32/Berry/default/be_tcpclient_lib.c | 2 -- .../generate/be_fixed_be_class_tcpclient.h | 19 +++++++++---------- tasmota/xdrv_52_3_berry_webclient.ino | 8 -------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/lib/libesp32/Berry/default/be_tcpclient_lib.c b/lib/libesp32/Berry/default/be_tcpclient_lib.c index 9f24be20d..d8bfef023 100644 --- a/lib/libesp32/Berry/default/be_tcpclient_lib.c +++ b/lib/libesp32/Berry/default/be_tcpclient_lib.c @@ -15,7 +15,6 @@ extern int wc_tcp_connect(bvm *vm); extern int wc_tcp_connected(bvm *vm); extern int wc_tcp_close(bvm *vm); extern int wc_tcp_available(bvm *vm); -extern int wc_tcp_flush(bvm *vm); extern int wc_tcp_write(bvm *vm); extern int wc_tcp_read(bvm *vm); @@ -39,7 +38,6 @@ class be_class_tcpclient (scope: global, name: tcpclient) { connected, func(wc_tcp_connected) close, func(wc_tcp_close) available, func(wc_tcp_available) - flush, func(wc_tcp_flush) write, func(wc_tcp_write) read, func(wc_tcp_read) diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tcpclient.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tcpclient.h index 68c4d0095..72bdbffb4 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_tcpclient.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_tcpclient.h @@ -1,22 +1,21 @@ #include "be_constobj.h" static be_define_const_map_slots(be_class_tcpclient_map) { - { be_const_key(init, -1), be_const_func(wc_tcp_init) }, - { be_const_key(close, -1), be_const_func(wc_tcp_close) }, - { be_const_key(_X2Ew, 4), be_const_var(0) }, - { be_const_key(flush, -1), be_const_func(wc_tcp_flush) }, - { be_const_key(deinit, 6), be_const_func(wc_tcp_deinit) }, - { be_const_key(read, -1), be_const_func(wc_tcp_read) }, { be_const_key(write, 8), be_const_func(wc_tcp_write) }, - { be_const_key(connected, -1), be_const_func(wc_tcp_connected) }, - { be_const_key(available, -1), be_const_func(wc_tcp_available) }, - { be_const_key(connect, 0), be_const_func(wc_tcp_connect) }, + { be_const_key(close, -1), be_const_func(wc_tcp_close) }, + { be_const_key(connected, 3), be_const_func(wc_tcp_connected) }, + { be_const_key(deinit, -1), be_const_func(wc_tcp_deinit) }, + { be_const_key(_X2Ew, 0), be_const_var(0) }, + { be_const_key(init, -1), be_const_func(wc_tcp_init) }, { be_const_key(readbytes, -1), be_const_func(wc_tcp_readbytes) }, + { be_const_key(connect, -1), be_const_func(wc_tcp_connect) }, + { be_const_key(available, -1), be_const_func(wc_tcp_available) }, + { be_const_key(read, -1), be_const_func(wc_tcp_read) }, }; static be_define_const_map( be_class_tcpclient_map, - 11 + 10 ); BE_EXPORT_VARIABLE be_define_const_class( diff --git a/tasmota/xdrv_52_3_berry_webclient.ino b/tasmota/xdrv_52_3_berry_webclient.ino index 83f9419ea..bb53278ae 100644 --- a/tasmota/xdrv_52_3_berry_webclient.ino +++ b/tasmota/xdrv_52_3_berry_webclient.ino @@ -201,14 +201,6 @@ extern "C" { be_return_nil(vm); } - // tcp.close(void) -> nil - int32_t wc_tcp_flush(struct bvm *vm); - int32_t wc_tcp_flush(struct bvm *vm) { - WiFiClient * tcp = wc_getwificlient(vm); - tcp->flush(); - be_return_nil(vm); - } - // tcp.available(void) -> int int32_t wc_tcp_available(struct bvm *vm); int32_t wc_tcp_available(struct bvm *vm) { From 5e8bf1eb05d9e2d0bcfcba0b1c46c13dbe01ee73 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Thu, 9 Dec 2021 22:39:24 +0100 Subject: [PATCH 45/97] Add timeout --- tasmota/xdrv_52_3_berry_webclient.ino | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tasmota/xdrv_52_3_berry_webclient.ino b/tasmota/xdrv_52_3_berry_webclient.ino index bb53278ae..5c1700ebf 100644 --- a/tasmota/xdrv_52_3_berry_webclient.ino +++ b/tasmota/xdrv_52_3_berry_webclient.ino @@ -167,7 +167,7 @@ extern "C" { be_return(vm); /* return self */ } - // tcp.connect(url:string) -> self + // tcp.connect(address:string, port:int [, timeout_ms:int]) -> bool int32_t wc_tcp_connect(struct bvm *vm); int32_t wc_tcp_connect(struct bvm *vm) { int32_t argc = be_top(vm); @@ -175,11 +175,13 @@ extern "C" { WiFiClient * tcp = wc_getwificlient(vm); const char * address = be_tostring(vm, 2); int32_t port = be_toint(vm, 3); - // open connection - if (!tcp->connect(address, port)) { - be_raise(vm, "value_error", "unsupported protocol"); + int32_t timeout = USE_BERRY_WEBCLIENT_TIMEOUT; // default timeout of 2 seconds + if (argc >= 4) { + timeout = be_toint(vm, 4); } - be_pushvalue(vm, 1); + // open connection + bool success = tcp->connect(address, port, timeout); + be_pushbool(vm, success); be_return(vm); /* return self */ } be_raise(vm, "attribute_error", NULL); From c4d7a5eab2245119ffa411546ebfd84c14372f3e Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Thu, 9 Dec 2021 23:33:05 +0100 Subject: [PATCH 46/97] Berry `string.tr` accepts removing chars --- lib/libesp32/Berry/src/be_strlib.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/libesp32/Berry/src/be_strlib.c b/lib/libesp32/Berry/src/be_strlib.c index 53f35607b..e0636c100 100644 --- a/lib/libesp32/Berry/src/be_strlib.c +++ b/lib/libesp32/Berry/src/be_strlib.c @@ -793,9 +793,6 @@ static int str_tr(bvm *vm) const char *p, *s = be_tostring(vm, 1); const char *t1 = be_tostring(vm, 2); const char *t2 = be_tostring(vm, 3); - if (strlen(t2) < strlen(t1)) { - be_raise(vm, "value_error", "invalid translation pattern"); - } size_t len = (size_t)be_strlen(vm, 1); char *buf, *q; buf = be_pushbuffer(vm, len); @@ -803,11 +800,17 @@ static int str_tr(bvm *vm) for (p = s, q = buf; *p != '\0'; ++p, ++q) { const char *p1, *p2; *q = *p; /* default to no change */ - for (p1=t1, p2=t2; *p1 != '\0'; ++p1, ++p2) { + for (p1=t1, p2=t2; *p1 != '\0'; ++p1) { if (*p == *p1) { - *q = *p2; + if (*p2) { + *q = *p2; + } else { + q--; /* remove this char */ + len--; + } break; } + if (*p2) { p2++; } } } be_pushnstring(vm, buf, len); /* make escape string from buffer */ From b0b1b79fbdc01fcea220c0ff1c5760624af4842f Mon Sep 17 00:00:00 2001 From: Luc Boudreau Date: Thu, 9 Dec 2021 17:35:29 -0500 Subject: [PATCH 47/97] Turns off the relay once when the thermostat is switched off to prevent it from being kept on forever, as a safety precaution. --- tasmota/xdrv_39_thermostat.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasmota/xdrv_39_thermostat.ino b/tasmota/xdrv_39_thermostat.ino index ae8d2d92f..414cb358b 100644 --- a/tasmota/xdrv_39_thermostat.ino +++ b/tasmota/xdrv_39_thermostat.ino @@ -1400,6 +1400,12 @@ void CmndThermostatModeSet(void) Thermostat[ctr_output].status.thermostat_mode = value; Thermostat[ctr_output].timestamp_input_on = 0; // Reset last manual switch timer if command set externally } + if ((value == THERMOSTAT_OFF) && (Thermostat[ctr_output].status.enable_output == IFACE_ON)) { + // Make sure the relay is switched to off once if the thermostat is being disabled, + // or it will get stuck on (danger!) + Thermostat[ctr_output].status.command_output = IFACE_OFF; + ThermostatOutputRelay(ctr_output, Thermostat[ctr_output].status.command_output); + } } ResponseCmndIdxNumber((int)Thermostat[ctr_output].status.thermostat_mode); } From 922d867717f22e29bf6d2cfa039f86f196f1c465 Mon Sep 17 00:00:00 2001 From: Paul C Diem Date: Fri, 10 Dec 2021 11:36:24 -0600 Subject: [PATCH 48/97] Add 2-button support --- tasmota/xdrv_35_pwm_dimmer.ino | 86 ++++++++++++++++++++++++++-------- 1 file changed, 67 insertions(+), 19 deletions(-) diff --git a/tasmota/xdrv_35_pwm_dimmer.ino b/tasmota/xdrv_35_pwm_dimmer.ino index 85d76c0af..aad092643 100644 --- a/tasmota/xdrv_35_pwm_dimmer.ino +++ b/tasmota/xdrv_35_pwm_dimmer.ino @@ -67,6 +67,7 @@ uint8_t power_button_index = 0; uint8_t down_button_index = 1; uint8_t buttons_pressed = 0; uint8_t local_fixed_color_index = 128; +bool is_two_button; bool button_tapped = false; bool down_button_tapped = false; bool ignore_power_button = false; @@ -110,16 +111,19 @@ void PWMModulePreInit(void) // The relay initializes to on. If the power is supposed to be off, turn the relay off. // if (!TasmotaGlobal.power && PinUsed(GPIO_REL1)) digitalWrite(Pin(GPIO_REL1), bitRead(TasmotaGlobal.rel_inverted, 0) ? 1 : 0); + // Find out how many buttons we have. + uint8_t button_count = 0; + for (uint32_t button_index = 0; button_index < MAX_PWM_DIMMER_KEYS; button_index++) { + if (PinUsed(GPIO_KEY1, button_index)) button_count++; + } + if ((is_two_button = (button_count == 2))) down_button_index = 99; + #ifdef USE_PWM_DIMMER_REMOTE // If remote device mode is enabled, set the device group count to the number of buttons // present. if (Settings->flag4.multiple_device_groups) { Settings->flag4.device_groups_enabled = true; - - device_group_count = 0; - for (uint32_t button_index = 0; button_index < MAX_PWM_DIMMER_KEYS; button_index++) { - if (PinUsed(GPIO_KEY1, button_index)) device_group_count++; - } + device_group_count = button_count; // If no relay or PWM is defined, all buttons control remote devices. if (!PinUsed(GPIO_REL1) && !PinUsed(GPIO_PWM1)) { @@ -266,6 +270,22 @@ void PWMDimmerHandleDevGroupItem(void) } #endif // USE_DEVICE_GROUPS +/* +* ---------------- Single ----------------- ------------------------- Hold ------------------------- +* Off On Off On +* +* 3 Button: +* 1 Power on Power off Power on at low preset Alternately inc/dec brightness +* 2 Power on at low preset Dec brightness NOP Dec brightness +* 3 Power on at high preset Inc brightness NOP Inc brightness +* +* 2 Button: +* 1 NOP Power off Power on at low preset Dec brightness +* 2 Power on Inc brightness Power on at high preset Inc brightness +* +* 1 Button: +* 1 Power on Power off Power on at low preset Alternately inc/dec brightness +*/ void PWMDimmerHandleButton(uint32_t button_index, bool pressed) { bool handle_tap = false; @@ -286,7 +306,7 @@ void PWMDimmerHandleButton(uint32_t button_index, bool pressed) #else // USE_PWM_DIMMER_REMOTE bool power_is_on = TasmotaGlobal.power; bool is_power_button = !button_index; - bool is_down_button = (button_index == (power_button_index ? 0 : 1)); + bool is_down_button = (is_two_button ? false : button_index == (power_button_index ? 0 : 1)); #endif // USE_PWM_DIMMER_REMOTE // If the button is being held, ... @@ -313,12 +333,17 @@ void PWMDimmerHandleButton(uint32_t button_index, bool pressed) // direction for the device and then invert the direction when the power button is released. // The new brightness will be calculated below. if (power_is_on) { + if (is_two_button && !Settings->flag4.multiple_device_groups) { + bri_hold = -1; + } + else { #ifdef USE_PWM_DIMMER_REMOTE - bri_hold = (active_remote_pwm_dimmer ? (active_remote_pwm_dimmer->power_button_increases_bri ? 1 : -1) : (power_button_increases_bri ? 1 : -1)); + bri_hold = (active_remote_pwm_dimmer ? (active_remote_pwm_dimmer->power_button_increases_bri ? 1 : -1) : (power_button_increases_bri ? 1 : -1)); #else // USE_PWM_DIMMER_REMOTE - bri_hold = (power_button_increases_bri ? 1 : -1); + bri_hold = (power_button_increases_bri ? 1 : -1); #endif // USE_PWM_DIMMER_REMOTE - invert_power_button_bri_direction = true; + invert_power_button_bri_direction = true; + } } // If the power is not on, turn it on using an initial brightness of bri_preset_low and set @@ -364,8 +389,21 @@ void PWMDimmerHandleButton(uint32_t button_index, bool pressed) // Otherwise, if the power is on, adjust the brightness. Set the direction based on which // button is pressed. The new brightness will be calculated below. - else if (power_is_on && !button_tapped) { - bri_hold = (is_down_button ? -1 : 1); + if (!button_tapped) { + if (power_is_on) { + bri_hold = (is_down_button ? -1 : 1); + } + + // If the power is off and this ia a two button switch, turn the power + // on using a temporary brightness of bri_preset_high. + else { +#ifdef USE_PWM_DIMMER_REMOTE + if (active_remote_pwm_dimmer) + power_on_bri = active_remote_pwm_dimmer->bri = active_remote_pwm_dimmer->bri_preset_high; + else +#endif // USE_PWM_DIMMER_REMOTE + power_on_bri = Settings->bri_preset_high; + } } } } @@ -432,7 +470,8 @@ void PWMDimmerHandleButton(uint32_t button_index, bool pressed) power_on_bri = active_remote_pwm_dimmer->bri_power_on; else #endif // USE_PWM_DIMMER_REMOTE - power_on_bri = Settings->bri_power_on; + if (!is_two_button || Settings->flag4.multiple_device_groups || power_is_on) + power_on_bri = Settings->bri_power_on; } } @@ -478,8 +517,20 @@ void PWMDimmerHandleButton(uint32_t button_index, bool pressed) } } - // If the power is off, turn it on using a temporary brightness of bri_preset_low if the - // down button is pressed or bri_preset_low if the up button is pressed. + // If the power is off and this is a two button switch, turn the power + // on. + else if (is_two_button) { +#ifdef USE_PWM_DIMMER_REMOTE + if (active_remote_pwm_dimmer) + power_on_bri = active_remote_pwm_dimmer->bri_power_on; + else +#endif // USE_PWM_DIMMER_REMOTE + power_on_bri = Settings->bri_power_on; + } + + // If the power is off and this is not a two button switch, turn the + // power on using a temporary brightness of bri_preset_low if the down + // button is pressed or bri_preset_high if the up button is pressed. else { #ifdef USE_PWM_DIMMER_REMOTE if (active_remote_pwm_dimmer) @@ -563,12 +614,9 @@ void PWMDimmerHandleButton(uint32_t button_index, bool pressed) new_power = active_remote_pwm_dimmer->power_on; PWMDimmerSetBrightnessLeds(new_power ? -power_on_bri : 0); } - else { + else #endif // USE_PWM_DIMMER_REMOTE new_power = TasmotaGlobal.power ^ 1; -#ifdef USE_PWM_DIMMER_REMOTE - } -#endif // USE_PWM_DIMMER_REMOTE if (new_power) SendDeviceGroupMessage(negated_device_group_index, DGR_MSGTYP_UPDATE, DGR_ITEM_LIGHT_BRI, power_on_bri, DGR_ITEM_POWER, new_power); else @@ -777,7 +825,7 @@ bool Xdrv35(uint8_t function) // Bottom 15 3 15 1 if (!buttons_pressed && Settings->flag4.multiple_device_groups) { power_button_index = button_index; - down_button_index = (Pin(GPIO_KEY1, power_button_index) == 15 ? TasmotaGlobal.gpio_pin[1] : TasmotaGlobal.gpio_pin[15]) - 32; + down_button_index = (is_two_button ? 99 : Pin(GPIO_KEY1, power_button_index) == 15 ? TasmotaGlobal.gpio_pin[1] : TasmotaGlobal.gpio_pin[15]) - 32; active_remote_pwm_dimmer = nullptr; if (power_button_index || !first_device_group_is_local) active_remote_pwm_dimmer = &remote_pwm_dimmers[power_button_index]; From c2880d2dee83884b9e7185743f919fa4126f45c7 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 10 Dec 2021 21:48:06 +0100 Subject: [PATCH 49/97] Berry minor cleaning --- tasmota/xdrv_52_0_berry_struct.ino | 12 +++++- ..._native.ino => xdrv_52_1_berry_native.ino} | 37 ++++++++++++++----- tasmota/xdrv_52_3_berry_lvgl.ino | 8 ++-- tasmota/xdrv_52_3_berry_tasmota.ino | 15 +------- tasmota/xdrv_52_9_berry.ino | 7 +++- 5 files changed, 49 insertions(+), 30 deletions(-) rename tasmota/{xdrv_52_2_berry_native.ino => xdrv_52_1_berry_native.ino} (93%) diff --git a/tasmota/xdrv_52_0_berry_struct.ino b/tasmota/xdrv_52_0_berry_struct.ino index 70e443cb3..fe09b3c84 100644 --- a/tasmota/xdrv_52_0_berry_struct.ino +++ b/tasmota/xdrv_52_0_berry_struct.ino @@ -25,6 +25,11 @@ #include "re1.5.h" +/*********************************************************************************************\ + * Logging for Tasmota Berry console + * + * We need to declare the the log class first since it is used in structure +\*********************************************************************************************/ #define BERRY_CONSOLE_CMD_DELIMITER "\x01" class Log_line { @@ -71,6 +76,12 @@ public: LList log; }; +/*********************************************************************************************\ + * Berry global structure + * +\*********************************************************************************************/ +class BerryLog; + class BerrySupport { public: bvm *vm = nullptr; // berry vm @@ -84,5 +95,4 @@ public: }; BerrySupport berry; - #endif // USE_BERRY diff --git a/tasmota/xdrv_52_2_berry_native.ino b/tasmota/xdrv_52_1_berry_native.ino similarity index 93% rename from tasmota/xdrv_52_2_berry_native.ino rename to tasmota/xdrv_52_1_berry_native.ino index e8acc8039..970d26c48 100644 --- a/tasmota/xdrv_52_2_berry_native.ino +++ b/tasmota/xdrv_52_1_berry_native.ino @@ -1,5 +1,5 @@ /* - xdrv_52_3_berry_native.ino - Berry scripting language, native fucnctions + xdrv_52_1_berry_native.ino - Berry scripting language, native fucnctions Copyright (C) 2021 Stephan Hadinger, Berry language by Guan Wenliang https://github.com/Skiars/berry @@ -45,6 +45,11 @@ extern "C" { * Responds to virtual constants \*********************************************************************************************/ extern "C" { + // Clear all elements on the stack + void be_pop_all(bvm *vm) { + be_pop(vm, be_top(vm)); // clear Berry stack + } + #include "be_exec.h" #include "be_debug.h" void be_dumpstack(bvm *vm) { @@ -259,12 +264,27 @@ extern "C" { /*********************************************************************************************\ * Generalized callbacks * + * Warning, the following expect all parameters to be 32 bits wide \*********************************************************************************************/ + extern "C" { + /*********************************************************************************************\ + * Callback structures + * + * We allow 4 parameters, or 3 if method (first arg is `self`) + * This could be extended if needed + \*********************************************************************************************/ typedef int32_t (*berry_callback_t)(int32_t v0, int32_t v1, int32_t v2, int32_t v3); + extern void BerryDumpErrorAndClear(bvm *vm, bool berry_console); + /*********************************************************************************************\ + * Callback structures + * + * We allow 4 parameters, or 3 if method (first arg is `self`) + * This could be extended if needed + \*********************************************************************************************/ int32_t call_berry_cb(int32_t num, int32_t v0, int32_t v1, int32_t v2, int32_t v3) { // call berry cb dispatcher int32_t ret = 0; @@ -285,6 +305,7 @@ extern "C" { ret = be_pcall(berry.vm, 6); // 5 arguments if (ret != 0) { BerryDumpErrorAndClear(berry.vm, false); // log in Tasmota console only + be_pop_all(berry.vm); // clear Berry stack return 0; } be_pop(berry.vm, 6); @@ -353,10 +374,6 @@ extern "C" { }; } - -#define LV_OBJ_CLASS "lv_obj" -#define LV_MODULE "lvgl" // name of the lvgl module - /*********************************************************************************************\ * Automatically parse Berry stack and call the C function accordingly * @@ -424,7 +441,7 @@ int32_t be_convert_single_elt(bvm *vm, int32_t idx, const char * arg_type = null const void * func = be_tocomptr(vm, -6); be_pop(vm, 6); - // berry_log_P("func=%p", func); + // berry_log_C("func=%p", func); return (int32_t) func; } else { be_raise(vm, kTypeError, "Closure expected for callback type"); @@ -445,7 +462,7 @@ int32_t be_convert_single_elt(bvm *vm, int32_t idx, const char * arg_type = null 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); + berry_log_C("Unexpected argument type '%c', expected '%s'", provided_type, arg_type); } return ret; } @@ -475,14 +492,14 @@ int32_t be_convert_single_elt(bvm *vm, int32_t idx, const char * arg_type = null // Stack: class_of_idx, class_of_target (or nil) if (class_found) { if (!be_isderived(vm, -2)) { - berry_log_P("Unexpected class type '%s', expected '%s'", be_classname(vm, idx), arg_type); + berry_log_C("Unexpected class type '%s', expected '%s'", be_classname(vm, idx), arg_type); } } else { - berry_log_P("Unable to find class '%s' (%d)", arg_type, arg_type_len); + berry_log_C("Unable to find class '%s' (%d)", arg_type, arg_type_len); } be_pop(vm, 2); } else if (arg_type[0] != '.') { - berry_log_P("Unexpected instance type '%s', expected '%s'", be_classname(vm, idx), arg_type); + berry_log_C("Unexpected instance type '%s', expected '%s'", be_classname(vm, idx), arg_type); } return ret; diff --git a/tasmota/xdrv_52_3_berry_lvgl.ino b/tasmota/xdrv_52_3_berry_lvgl.ino index a8bd61dda..39e7737ed 100644 --- a/tasmota/xdrv_52_3_berry_lvgl.ino +++ b/tasmota/xdrv_52_3_berry_lvgl.ino @@ -167,7 +167,7 @@ void be_check_arg_type(bvm *vm, int32_t arg_start, int32_t argc, const char * ar // check if we are missing arguments if (arg_type != nullptr && arg_type[arg_idx] != 0) { - berry_log_P("Missing arguments, remaining type '%s'", &arg_type[arg_idx]); + berry_log_C("Missing arguments, remaining type '%s'", &arg_type[arg_idx]); } } @@ -777,7 +777,7 @@ extern "C" { int lv0_register_button_encoder(bvm *vm) { int32_t argc = be_top(vm); // Get the number of arguments bool inverted = false; - // berry_log_P("lv0_register_button_encoder argc=%d inverted=%d", argc, be_tobool(vm, 1)); + // berry_log_C("lv0_register_button_encoder argc=%d inverted=%d", argc, be_tobool(vm, 1)); if (argc >= 1) { inverted = be_tobool(vm, 1); // get the inverted flag } @@ -794,7 +794,7 @@ extern "C" { lvbe.btn[1].set_inverted(inverted); lvbe.btn[2].set_gpio(btn2); lvbe.btn[2].set_inverted(inverted); - berry_log_P(D_LOG_LVGL "Button Rotary encoder using GPIOs %d,%d,%d%s", btn0, btn1, btn2, inverted ? " (inverted)" : ""); + berry_log_C(D_LOG_LVGL "Button Rotary encoder using GPIOs %d,%d,%d%s", btn0, btn1, btn2, inverted ? " (inverted)" : ""); lv_indev_drv_init(&lvbe.indev_drv); lvbe.indev_drv.type = LV_INDEV_TYPE_ENCODER; @@ -837,7 +837,7 @@ extern "C" { } bool state = lvbe.btn[i].clear_state_changed(); data->state = state ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; - // berry_log_P("Button event key %d state %d,%d", data->key, state, data->state); + // berry_log_C("Button event key %d state %d,%d", data->key, state, data->state); break; } } diff --git a/tasmota/xdrv_52_3_berry_tasmota.ino b/tasmota/xdrv_52_3_berry_tasmota.ino index ee65d27a1..6b8e83ea3 100644 --- a/tasmota/xdrv_52_3_berry_tasmota.ino +++ b/tasmota/xdrv_52_3_berry_tasmota.ino @@ -1,5 +1,5 @@ /* - xdrv_52_3_berry_native.ino - Berry scripting language, native fucnctions + xdrv_52_3_berry_tasmota.ino - Berry scripting language, native fucnctions Copyright (C) 2021 Stephan Hadinger, Berry language by Guan Wenliang https://github.com/Skiars/berry @@ -614,17 +614,4 @@ extern "C" { } } - -void berry_log_P(const char * berry_buf, ...) { - // To save stack space support logging for max text length of 128 characters - char log_data[LOGSZ]; - - va_list arg; - va_start(arg, berry_buf); - uint32_t len = ext_vsnprintf_P(log_data, LOGSZ-3, berry_buf, arg); - va_end(arg); - if (len+3 > LOGSZ) { strcat(log_data, "..."); } // Actual data is more - berry_log(log_data); -} - #endif // USE_BERRY diff --git a/tasmota/xdrv_52_9_berry.ino b/tasmota/xdrv_52_9_berry.ino index 6596782c1..84a4f698c 100644 --- a/tasmota/xdrv_52_9_berry.ino +++ b/tasmota/xdrv_52_9_berry.ino @@ -126,7 +126,6 @@ void BerryDumpErrorAndClear(bvm *vm, bool berry_console) { } else { be_dumpstack(vm); } - be_pop(vm, top); } // void callBerryMqttData(void) { @@ -226,6 +225,7 @@ int32_t callBerryEventDispatcher(const char *type, const char *cmd, int32_t idx, BrTimeoutReset(); if (ret != 0) { BerryDumpErrorAndClear(vm, false); // log in Tasmota console only + be_pop_all(berry.vm); // clear Berry stack return ret; } be_pop(vm, 5); @@ -332,17 +332,20 @@ void BerryInit(void) { ret_code1 = be_loadstring(berry.vm, berry_prog); if (ret_code1 != 0) { BerryDumpErrorAndClear(berry.vm, false); + be_pop_all(berry.vm); // clear Berry stack break; } // AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_BERRY "Berry code loaded, RAM used=%u"), be_gc_memcount(berry.vm)); ret_code2 = be_pcall(berry.vm, 0); if (ret_code1 != 0) { BerryDumpErrorAndClear(berry.vm, false); + be_pop_all(berry.vm); // clear Berry stack break; } // AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_BERRY "Berry code ran, RAM used=%u"), be_gc_memcount(berry.vm)); if (be_top(berry.vm) > 1) { BerryDumpErrorAndClear(berry.vm, false); + be_pop_all(berry.vm); // clear Berry stack } else { be_pop(berry.vm, 1); } @@ -387,6 +390,7 @@ void BrLoad(const char * script_name) { BrTimeoutStart(); if (be_pcall(berry.vm, 1) != 0) { BerryDumpErrorAndClear(berry.vm, false); + be_pop_all(berry.vm); // clear Berry stack return; } BrTimeoutReset(); @@ -492,6 +496,7 @@ void BrREPLRun(char * cmd) { } if (BE_EXCEPTION == ret_code) { BerryDumpErrorAndClear(berry.vm, true); + be_pop_all(berry.vm); // clear Berry stack // be_dumpstack(berry.vm); // char exception_s[120]; // ext_snprintf_P(exception_s, sizeof(exception_s), PSTR("%s: %s"), be_tostring(berry.vm, -2), be_tostring(berry.vm, -1)); From 1615c5558370a69fe5ebad7fa351d3e7933a2e9e Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 10 Dec 2021 21:53:43 +0100 Subject: [PATCH 50/97] Apply MQTT_TLS_FINGERPRINT --- tasmota/settings.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasmota/settings.ino b/tasmota/settings.ino index b2a58e2ae..31dd8a87c 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -1197,7 +1197,8 @@ void SettingsDefaultSet2(void) { flag4.mqtt_no_retain |= MQTT_NO_RETAIN; flag5.shift595_invert_outputs |= SHIFT595_INVERT_OUTPUTS; - Settings->shift595_device_count = SHIFT595_DEVICE_COUNT; + Settings->shift595_device_count = SHIFT595_DEVICE_COUNT; + flag5.tls_use_fingerprint |= MQTT_TLS_FINGERPRINT; Settings->flag = flag; Settings->flag2 = flag2; From 524216552039025ee2262aaa74486cc458f18215 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 10 Dec 2021 22:23:59 +0100 Subject: [PATCH 51/97] Berry allow instance functions --- lib/libesp32/Berry/src/be_vm.c | 6 +++--- lib/libesp32/Berry/tests/class_const.be | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/libesp32/Berry/src/be_vm.c b/lib/libesp32/Berry/src/be_vm.c index 67519ee39..26c15a1a3 100644 --- a/lib/libesp32/Berry/src/be_vm.c +++ b/lib/libesp32/Berry/src/be_vm.c @@ -853,9 +853,9 @@ newframe: /* a new call frame */ reg = vm->reg; bvalue *a = RA(); *a = a_temp; - if (basetype(type) == BE_FUNCTION) { - if (func_isstatic(a)) { - /* static method, don't bother with the instance */ + if (var_basetype(a) == BE_FUNCTION) { + if (func_isstatic(a) || (type == BE_INDEX)) { /* if instance variable then we consider it's non-method */ + /* static method, don't bother with the instance */ a[1] = a_temp; var_settype(a, NOT_METHOD); } else { diff --git a/lib/libesp32/Berry/tests/class_const.be b/lib/libesp32/Berry/tests/class_const.be index 7c986bff0..e8f4c1920 100644 --- a/lib/libesp32/Berry/tests/class_const.be +++ b/lib/libesp32/Berry/tests/class_const.be @@ -64,7 +64,7 @@ A.h = def (x, y) return type(x) end assert(type(a.g) == 'function') assert(type(a.h) == 'function') -assert_attribute_error("a.g(1,2)") +assert(a.g(1) == 'int') assert(a.h(1) == 'int') assert(A.h(1) == 'int') @@ -85,6 +85,9 @@ assert(a.g(1,2) == [1,2]) assert(a.h(1,2) == [1,2]) assert(A.g(1,2) == [1,2]) assert(A.h(1,2) == [1,2]) +a.a = def (x,y) return [x,y] end +assert(a.a(1,2) == [1,2]) + #- test static initializers -# class A From dbd321291e575e8ca318179282a160ac3e5c8412 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 10 Dec 2021 23:18:49 +0100 Subject: [PATCH 52/97] Berry strptime --- lib/libesp32/Berry/default/be_tasmotalib.c | 2 + lib/libesp32/Berry/generate/be_const_strtab.h | 1 + .../Berry/generate/be_const_strtab_def.h | 1822 +++++++++-------- .../generate/be_fixed_be_class_tasmota.h | 149 +- tasmota/xdrv_52_3_berry_tasmota.ino | 19 + 5 files changed, 1009 insertions(+), 984 deletions(-) diff --git a/lib/libesp32/Berry/default/be_tasmotalib.c b/lib/libesp32/Berry/default/be_tasmotalib.c index b073287f4..e117bae70 100644 --- a/lib/libesp32/Berry/default/be_tasmotalib.c +++ b/lib/libesp32/Berry/default/be_tasmotalib.c @@ -23,6 +23,7 @@ extern int l_timereached(bvm *vm); extern int l_rtc(bvm *vm); extern int l_time_dump(bvm *vm); extern int l_strftime(bvm *vm); +extern int l_strptime(bvm *vm); extern int l_memory(bvm *vm); extern int l_wifi(bvm *vm); extern int l_eth(bvm *vm); @@ -2100,6 +2101,7 @@ class be_class_tasmota (scope: global, name: Tasmota) { rtc, func(l_rtc) time_dump, func(l_time_dump) strftime, func(l_strftime) + strptime, func(l_strptime) memory, func(l_memory) wifi, func(l_wifi) eth, func(l_eth) diff --git a/lib/libesp32/Berry/generate/be_const_strtab.h b/lib/libesp32/Berry/generate/be_const_strtab.h index ea109e214..9692c8508 100644 --- a/lib/libesp32/Berry/generate/be_const_strtab.h +++ b/lib/libesp32/Berry/generate/be_const_strtab.h @@ -649,6 +649,7 @@ extern const bcstring be_const_str_str; extern const bcstring be_const_str_strftime; extern const bcstring be_const_str_string; extern const bcstring be_const_str_strip; +extern const bcstring be_const_str_strptime; extern const bcstring be_const_str_super; extern const bcstring be_const_str_sys; extern const bcstring be_const_str_tag; diff --git a/lib/libesp32/Berry/generate/be_const_strtab_def.h b/lib/libesp32/Berry/generate/be_const_strtab_def.h index 063ce52df..44676a35e 100644 --- a/lib/libesp32/Berry/generate/be_const_strtab_def.h +++ b/lib/libesp32/Berry/generate/be_const_strtab_def.h @@ -1,636 +1,636 @@ -be_define_const_str(, "", 2166136261u, 0, 0, NULL); -be_define_const_str(_X0A, "\n", 252472541u, 0, 1, &be_const_str_Unknown_X20command); -be_define_const_str(_X20, " ", 621580159u, 0, 1, &be_const_str_geti); -be_define_const_str(_X21_X3D, "!=", 2428715011u, 0, 2, &be_const_str_asstring); -be_define_const_str(_X21_X3D_X3D, "!==", 559817114u, 0, 3, &be_const_str_type); -be_define_const_str(_X23, "#", 638357778u, 0, 1, &be_const_str_CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found); -be_define_const_str(_X23autoexec_X2Ebat, "#autoexec.bat", 3382890497u, 0, 13, &be_const_str_arg_size); -be_define_const_str(_X23autoexec_X2Ebe, "#autoexec.be", 1181757091u, 0, 12, &be_const_str_file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27); -be_define_const_str(_X23display_X2Eini, "#display.ini", 182218220u, 0, 12, &be_const_str___lower__); -be_define_const_str(_X23init_X2Ebat, "#init.bat", 3297595077u, 0, 9, &be_const_str_SERIAL_7O2); -be_define_const_str(_X23preinit_X2Ebe, "#preinit.be", 687035716u, 0, 11, &be_const_str_SERIAL_8O2); -be_define_const_str(_X2502d_X25s_X2502d, "%02d%s%02d", 1587999717u, 0, 10, &be_const_str_yield); -be_define_const_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, "%04d-%02d-%02dT%02d:%02d:%02d", 3425528601u, 0, 29, &be_const_str__global_def); -be_define_const_str(_X25s_X2Eautoconf, "%s.autoconf", 3560383524u, 0, 11, &be_const_str_every_second); -be_define_const_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, "<Error: apply new or remove>", 2855507949u, 0, 34, &be_const_str_add_driver); -be_define_const_str(_X26lt_X3BNone_X26gt_X3B, "<None>", 2602165498u, 0, 12, &be_const_str_rand); -be_define_const_str(_X28_X29, "()", 685372826u, 0, 2, &be_const_str__X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29); -be_define_const_str(_X2B, "+", 772578730u, 0, 1, &be_const_str_gpio); -be_define_const_str(_X2C, ",", 688690635u, 0, 1, &be_const_str_add_cmd); -be_define_const_str(_X2D_X2D_X3A_X2D_X2D, "--:--", 1370615441u, 0, 5, &be_const_str_AudioOutputI2S); -be_define_const_str(_X2E, ".", 722245873u, 0, 1, NULL); -be_define_const_str(_X2E_X2E, "..", 2748622605u, 0, 2, &be_const_str__X2Ep2); -be_define_const_str(_X2Eautoconf, ".autoconf", 2524679088u, 0, 9, NULL); -be_define_const_str(_X2Ebe, ".be", 1325797348u, 0, 3, &be_const_str_sinh); -be_define_const_str(_X2Ebec, ".bec", 3985273221u, 0, 4, &be_const_str__debug_present); -be_define_const_str(_X2Elen, ".len", 850842136u, 0, 4, NULL); -be_define_const_str(_X2Ep, ".p", 1171526419u, 0, 2, &be_const_str_COLOR_WHITE); -be_define_const_str(_X2Ep1, ".p1", 249175686u, 0, 3, &be_const_str_sin); -be_define_const_str(_X2Ep2, ".p2", 232398067u, 0, 3, &be_const_str_json_fdump_map); -be_define_const_str(_X2Esize, ".size", 1965188224u, 0, 5, &be_const_str__X2Fac); -be_define_const_str(_X2Etapp, ".tapp", 1363391594u, 0, 5, NULL); -be_define_const_str(_X2Ew, ".w", 1255414514u, 0, 2, &be_const_str_member); -be_define_const_str(_X2F, "/", 705468254u, 0, 1, &be_const_str_None); -be_define_const_str(_X2F_X2Eautoconf, "/.autoconf", 2212074393u, 0, 10, &be_const_str_set_dc_voltage); -be_define_const_str(_X2F_X3Frst_X3D, "/?rst=", 580074707u, 0, 6, &be_const_str_AES_GCM); -be_define_const_str(_X2Fac, "/ac", 3904651978u, 0, 3, &be_const_str_get_current_module_path); -be_define_const_str(_X3A, ":", 1057798253u, 0, 1, &be_const_str_json_fdump); -be_define_const_str(_X3C, "<", 957132539u, 0, 1, NULL); -be_define_const_str(_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 3546571739u, 0, 11, &be_const_str_atan); -be_define_const_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 1863865923u, 0, 16, NULL); -be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, &be_const_str_HTTP_POST); -be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str_Wire); -be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, &be_const_str_color); -be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "
", 842307168u, 0, 77, &be_const_str_set_power); -be_define_const_str(_X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, "Choose a device configuration:
", 1336654704u, 0, 49, &be_const_str_bus); -be_define_const_str(_X3Clambda_X3E, "", 607256038u, 0, 8, &be_const_str_No_X20callback_X20available); -be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Current auto-configuration", 4212500780u, 0, 82, &be_const_str_get_warning_level); -be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Select new auto-configuration", 1926223891u, 0, 80, &be_const_str_get_vbus_current); -be_define_const_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, "", 510303524u, 0, 30, &be_const_str_cb_event_closure); -be_define_const_str(_X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, "", 3994619755u, 0, 54, NULL); -be_define_const_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, "

Exception:
'%s'
%s

", 4252565082u, 0, 59, &be_const_str_arg); -be_define_const_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 2052843416u, 0, 25, &be_const_str_area); +be_define_const_str(, "", 2166136261u, 0, 0, &be_const_str_True); +be_define_const_str(_X0A, "\n", 252472541u, 0, 1, &be_const_str_i2c_enabled); +be_define_const_str(_X20, " ", 621580159u, 0, 1, &be_const_str_add_cmd); +be_define_const_str(_X21_X3D, "!=", 2428715011u, 0, 2, &be_const_str__X23autoexec_X2Ebe); +be_define_const_str(_X21_X3D_X3D, "!==", 559817114u, 0, 3, &be_const_str__X2Ew); +be_define_const_str(_X23, "#", 638357778u, 0, 1, &be_const_str_No_X20callback_X20available); +be_define_const_str(_X23autoexec_X2Ebat, "#autoexec.bat", 3382890497u, 0, 13, NULL); +be_define_const_str(_X23autoexec_X2Ebe, "#autoexec.be", 1181757091u, 0, 12, &be_const_str_assert); +be_define_const_str(_X23display_X2Eini, "#display.ini", 182218220u, 0, 12, &be_const_str_code); +be_define_const_str(_X23init_X2Ebat, "#init.bat", 3297595077u, 0, 9, &be_const_str__X2502d_X25s_X2502d); +be_define_const_str(_X23preinit_X2Ebe, "#preinit.be", 687035716u, 0, 11, &be_const_str__timers); +be_define_const_str(_X2502d_X25s_X2502d, "%02d%s%02d", 1587999717u, 0, 10, &be_const_str__X3D_X3C_X3E_X21); +be_define_const_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, "%04d-%02d-%02dT%02d:%02d:%02d", 3425528601u, 0, 29, &be_const_str_get_object_from_ptr); +be_define_const_str(_X25s_X2Eautoconf, "%s.autoconf", 3560383524u, 0, 11, &be_const_str_RES_OK); +be_define_const_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, "<Error: apply new or remove>", 2855507949u, 0, 34, &be_const_str_hs2rgb); +be_define_const_str(_X26lt_X3BNone_X26gt_X3B, "<None>", 2602165498u, 0, 12, &be_const_str__X2Fac); +be_define_const_str(_X28_X29, "()", 685372826u, 0, 2, NULL); +be_define_const_str(_X2B, "+", 772578730u, 0, 1, &be_const_str_lower); +be_define_const_str(_X2C, ",", 688690635u, 0, 1, &be_const_str_SERIAL_7O1); +be_define_const_str(_X2D_X2D_X3A_X2D_X2D, "--:--", 1370615441u, 0, 5, &be_const_str__X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E); +be_define_const_str(_X2E, ".", 722245873u, 0, 1, &be_const_str_search); +be_define_const_str(_X2E_X2E, "..", 2748622605u, 0, 2, &be_const_str__debug_present); +be_define_const_str(_X2Eautoconf, ".autoconf", 2524679088u, 0, 9, &be_const_str_false); +be_define_const_str(_X2Ebe, ".be", 1325797348u, 0, 3, &be_const_str_Tasmota); +be_define_const_str(_X2Ebec, ".bec", 3985273221u, 0, 4, &be_const_str_CFG_X3A_X20downloading_X20_X27_X25s_X27); +be_define_const_str(_X2Elen, ".len", 850842136u, 0, 4, &be_const_str__X3Cselect_X20name_X3D_X27zip_X27_X3E); +be_define_const_str(_X2Ep, ".p", 1171526419u, 0, 2, NULL); +be_define_const_str(_X2Ep1, ".p1", 249175686u, 0, 3, &be_const_str__t); +be_define_const_str(_X2Ep2, ".p2", 232398067u, 0, 3, &be_const_str_BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29); +be_define_const_str(_X2Esize, ".size", 1965188224u, 0, 5, &be_const_str_is_first_time); +be_define_const_str(_X2Etapp, ".tapp", 1363391594u, 0, 5, &be_const_str__X7B); +be_define_const_str(_X2Ew, ".w", 1255414514u, 0, 2, &be_const_str_clear); +be_define_const_str(_X2F, "/", 705468254u, 0, 1, &be_const_str_SERIAL_7O2); +be_define_const_str(_X2F_X2Eautoconf, "/.autoconf", 2212074393u, 0, 10, &be_const_str_CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27); +be_define_const_str(_X2F_X3Frst_X3D, "/?rst=", 580074707u, 0, 6, &be_const_str_SERIAL_7N2); +be_define_const_str(_X2Fac, "/ac", 3904651978u, 0, 3, &be_const_str_WS2812); +be_define_const_str(_X3A, ":", 1057798253u, 0, 1, &be_const_str_AudioFileSourceFS); +be_define_const_str(_X3C, "<", 957132539u, 0, 1, &be_const_str_digital_write); +be_define_const_str(_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 3546571739u, 0, 11, &be_const_str_LVG_X3A_X20call_X20to_X20unsupported_X20callback); +be_define_const_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 1863865923u, 0, 16, &be_const_str_rule); +be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, &be_const_str_set_chg_current); +be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str_find_op); +be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, NULL); +be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "
", 842307168u, 0, 77, &be_const_str_get_current_module_path); +be_define_const_str(_X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, "Choose a device configuration:
", 1336654704u, 0, 49, &be_const_str_delay); +be_define_const_str(_X3Clambda_X3E, "", 607256038u, 0, 8, &be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20); +be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Current auto-configuration", 4212500780u, 0, 82, &be_const_str_CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29); +be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Select new auto-configuration", 1926223891u, 0, 80, &be_const_str_CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29); +be_define_const_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, "", 510303524u, 0, 30, &be_const_str_write); +be_define_const_str(_X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, "", 3994619755u, 0, 54, &be_const_str_None); +be_define_const_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, "

Exception:
'%s'
%s

", 4252565082u, 0, 59, &be_const_str_classof); +be_define_const_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 2052843416u, 0, 25, &be_const_str_button_pressed); be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 452285201u, 0, 120, NULL); -be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, "

 (This feature requires an internet connection)

", 2719266486u, 0, 74, &be_const_str_register_obj); -be_define_const_str(_X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, "

Current configuration:

%s

", 4115655761u, 0, 46, &be_const_str_cb_dispatch); -be_define_const_str(_X3Cselect_X20name_X3D_X27zip_X27_X3E, "", 4247924536u, 0, 19, &be_const_str_False); +be_define_const_str(_X3D, "=", 940354920u, 0, 1, &be_const_str_CFG_X3A_X20return_code_X3D_X25i); +be_define_const_str(_X3D_X3C_X3E_X21, "=<>!", 2664470277u, 0, 4, &be_const_str_CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting); +be_define_const_str(_X3D_X3D, "==", 2431966415u, 0, 2, &be_const_str_get); +be_define_const_str(_X3E, ">", 990687777u, 0, 1, &be_const_str_CFG_X3A_X20loading_X20_X27_X25s_X27); +be_define_const_str(_X3E_X3D, ">=", 284975636u, 0, 2, &be_const_str__anonymous_); +be_define_const_str(_X3F, "?", 973910158u, 0, 1, &be_const_str_TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27); +be_define_const_str(AES_GCM, "AES_GCM", 3832208678u, 0, 7, NULL); +be_define_const_str(AXP192, "AXP192", 757230128u, 0, 6, &be_const_str__buffer); +be_define_const_str(Animate_X20pc_X20is_X20out_X20of_X20range, "Animate pc is out of range", 1854929421u, 0, 26, &be_const_str_true); +be_define_const_str(AudioFileSource, "AudioFileSource", 2959980058u, 0, 15, &be_const_str_allocated); +be_define_const_str(AudioFileSourceFS, "AudioFileSourceFS", 1839147653u, 0, 17, &be_const_str_due); +be_define_const_str(AudioGenerator, "AudioGenerator", 1839297342u, 0, 14, &be_const_str_enabled); +be_define_const_str(AudioGeneratorMP3, "AudioGeneratorMP3", 2199818488u, 0, 17, &be_const_str_check_privileged_access); +be_define_const_str(AudioGeneratorWAV, "AudioGeneratorWAV", 2746509368u, 0, 17, &be_const_str_digital_read); +be_define_const_str(AudioOutput, "AudioOutput", 3257792048u, 0, 11, &be_const_str_get_pixel_color); be_define_const_str(AudioOutputI2S, "AudioOutputI2S", 638031784u, 0, 14, NULL); -be_define_const_str(Auto_X2Dconfiguration, "Auto-configuration", 1665006109u, 0, 18, &be_const_str_Tasmota); -be_define_const_str(BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, "BRY: ERROR, bad json: ", 2715135809u, 0, 22, &be_const_str_I2C_X3A); -be_define_const_str(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "BRY: Exception> '%s' - %s", 2246990964u, 0, 25, NULL); -be_define_const_str(BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29, "BRY: could not save compiled file %s (%s)", 736659787u, 0, 41, &be_const_str_bri); -be_define_const_str(BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, "BRY: failed to load _persist.json", 2991913445u, 0, 33, &be_const_str_target); -be_define_const_str(BUTTON_CONFIGURATION, "BUTTON_CONFIGURATION", 70820856u, 0, 20, &be_const_str_SERIAL_5O1); -be_define_const_str(CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting, "CFG: 'init.bat' done, restarting", 1569670677u, 0, 32, &be_const_str_delay); -be_define_const_str(CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "CFG: Exception> '%s' - %s", 1228874553u, 0, 25, &be_const_str__p); -be_define_const_str(CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29, "CFG: could not run %s (%s - %s)", 1428829580u, 0, 31, &be_const_str_arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj); -be_define_const_str(CFG_X3A_X20downloading_X20_X27_X25s_X27, "CFG: downloading '%s'", 589480701u, 0, 21, &be_const_str_add_header); -be_define_const_str(CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27, "CFG: exception '%s' - '%s'", 4095407913u, 0, 26, &be_const_str_Tele); -be_define_const_str(CFG_X3A_X20loaded_X20_X20, "CFG: loaded ", 3710273538u, 0, 13, NULL); -be_define_const_str(CFG_X3A_X20loaded_X20_X27_X25s_X27, "CFG: loaded '%s'", 1699028828u, 0, 16, &be_const_str_fromb64); -be_define_const_str(CFG_X3A_X20loading_X20, "CFG: loading ", 4010361503u, 0, 13, &be_const_str_floor); -be_define_const_str(CFG_X3A_X20loading_X20_X27_X25s_X27, "CFG: loading '%s'", 2285306097u, 0, 17, &be_const_str_Timer); -be_define_const_str(CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29, "CFG: multiple autoconf files found, aborting ('%s' + '%s')", 197663371u, 0, 58, &be_const_str_content_stop); -be_define_const_str(CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found, "CFG: no '*.autoconf' file found", 127493957u, 0, 31, &be_const_str_byte); -be_define_const_str(CFG_X3A_X20ran_X20_X20, "CFG: ran ", 3579570472u, 0, 10, &be_const_str_draw_line_dsc_init); -be_define_const_str(CFG_X3A_X20removed_X20file_X20_X27_X25s_X27, "CFG: removed file '%s'", 2048602473u, 0, 22, &be_const_str_pixel_size); -be_define_const_str(CFG_X3A_X20removing_X20autoconf_X20files, "CFG: removing autoconf files", 4014704970u, 0, 28, &be_const_str_issubclass); -be_define_const_str(CFG_X3A_X20removing_X20first_X20time_X20marker, "CFG: removing first time marker", 2125556683u, 0, 31, NULL); -be_define_const_str(CFG_X3A_X20return_code_X3D_X25i, "CFG: return_code=%i", 2059897320u, 0, 19, &be_const_str_get_option); -be_define_const_str(CFG_X3A_X20running_X20, "CFG: running ", 2478334534u, 0, 13, &be_const_str_get_vbus_voltage); -be_define_const_str(CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, "CFG: skipping 'display.ini' because already present in file-system", 3965549264u, 0, 66, &be_const_str_create_custom_widget); -be_define_const_str(COLOR_BLACK, "COLOR_BLACK", 264427940u, 0, 11, &be_const_str_SERIAL_6N2); -be_define_const_str(COLOR_WHITE, "COLOR_WHITE", 2536871270u, 0, 11, &be_const_str_wd); -be_define_const_str(EC_C25519, "EC_C25519", 95492591u, 0, 9, &be_const_str__filename); -be_define_const_str(EVENT_DRAW_MAIN, "EVENT_DRAW_MAIN", 1955620614u, 0, 15, &be_const_str_from_to); -be_define_const_str(EVENT_DRAW_PART_BEGIN, "EVENT_DRAW_PART_BEGIN", 3391865024u, 0, 21, NULL); -be_define_const_str(EVENT_DRAW_PART_END, "EVENT_DRAW_PART_END", 3301625292u, 0, 19, &be_const_str_set_pixel_color); -be_define_const_str(False, "False", 2541049336u, 0, 5, &be_const_str_get_style_line_color); -be_define_const_str(GET, "GET", 2531704439u, 0, 3, &be_const_str_SERIAL_5N1); -be_define_const_str(HTTP_GET, "HTTP_GET", 1722467738u, 0, 8, &be_const_str_dac_voltage); -be_define_const_str(HTTP_POST, "HTTP_POST", 1999554144u, 0, 9, &be_const_str_widget_event_impl); -be_define_const_str(I2C_X3A, "I2C:", 813483371u, 0, 4, &be_const_str_WS2812); -be_define_const_str(I2C_Driver, "I2C_Driver", 1714501658u, 0, 10, &be_const_str_SERIAL_5O2); -be_define_const_str(LVG_X3A_X20call_X20to_X20unsupported_X20callback, "LVG: call to unsupported callback", 504176819u, 0, 33, &be_const_str__end_transmission); -be_define_const_str(Leds, "Leds", 2709245275u, 0, 4, &be_const_str_display_X2Eini); +be_define_const_str(Auto_X2Dconfiguration, "Auto-configuration", 1665006109u, 0, 18, NULL); +be_define_const_str(BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, "BRY: ERROR, bad json: ", 2715135809u, 0, 22, &be_const_str_fromptr); +be_define_const_str(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "BRY: Exception> '%s' - %s", 2246990964u, 0, 25, &be_const_str_SERIAL_6N2); +be_define_const_str(BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29, "BRY: could not save compiled file %s (%s)", 736659787u, 0, 41, NULL); +be_define_const_str(BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, "BRY: failed to load _persist.json", 2991913445u, 0, 33, &be_const_str_set_time); +be_define_const_str(BUTTON_CONFIGURATION, "BUTTON_CONFIGURATION", 70820856u, 0, 20, &be_const_str_files); +be_define_const_str(CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting, "CFG: 'init.bat' done, restarting", 1569670677u, 0, 32, &be_const_str_push_path); +be_define_const_str(CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "CFG: Exception> '%s' - %s", 1228874553u, 0, 25, &be_const_str_CFG_X3A_X20removed_X20file_X20_X27_X25s_X27); +be_define_const_str(CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29, "CFG: could not run %s (%s - %s)", 1428829580u, 0, 31, &be_const_str_COLOR_BLACK); +be_define_const_str(CFG_X3A_X20downloading_X20_X27_X25s_X27, "CFG: downloading '%s'", 589480701u, 0, 21, &be_const_str_floor); +be_define_const_str(CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27, "CFG: exception '%s' - '%s'", 4095407913u, 0, 26, &be_const_str_get_option); +be_define_const_str(CFG_X3A_X20loaded_X20_X20, "CFG: loaded ", 3710273538u, 0, 13, &be_const_str_delete_all_configs); +be_define_const_str(CFG_X3A_X20loaded_X20_X27_X25s_X27, "CFG: loaded '%s'", 1699028828u, 0, 16, NULL); +be_define_const_str(CFG_X3A_X20loading_X20, "CFG: loading ", 4010361503u, 0, 13, NULL); +be_define_const_str(CFG_X3A_X20loading_X20_X27_X25s_X27, "CFG: loading '%s'", 2285306097u, 0, 17, &be_const_str_SK6812_GRBW); +be_define_const_str(CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29, "CFG: multiple autoconf files found, aborting ('%s' + '%s')", 197663371u, 0, 58, NULL); +be_define_const_str(CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found, "CFG: no '*.autoconf' file found", 127493957u, 0, 31, &be_const_str_get_free_heap); +be_define_const_str(CFG_X3A_X20ran_X20_X20, "CFG: ran ", 3579570472u, 0, 10, &be_const_str_contains); +be_define_const_str(CFG_X3A_X20removed_X20file_X20_X27_X25s_X27, "CFG: removed file '%s'", 2048602473u, 0, 22, &be_const_str_SERIAL_8E2); +be_define_const_str(CFG_X3A_X20removing_X20autoconf_X20files, "CFG: removing autoconf files", 4014704970u, 0, 28, &be_const_str_get_bat_charge_current); +be_define_const_str(CFG_X3A_X20removing_X20first_X20time_X20marker, "CFG: removing first time marker", 2125556683u, 0, 31, &be_const_str__lvgl); +be_define_const_str(CFG_X3A_X20return_code_X3D_X25i, "CFG: return_code=%i", 2059897320u, 0, 19, &be_const_str_OPTION_A); +be_define_const_str(CFG_X3A_X20running_X20, "CFG: running ", 2478334534u, 0, 13, NULL); +be_define_const_str(CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, "CFG: skipping 'display.ini' because already present in file-system", 3965549264u, 0, 66, NULL); +be_define_const_str(COLOR_BLACK, "COLOR_BLACK", 264427940u, 0, 11, NULL); +be_define_const_str(COLOR_WHITE, "COLOR_WHITE", 2536871270u, 0, 11, &be_const_str__energy); +be_define_const_str(EC_C25519, "EC_C25519", 95492591u, 0, 9, &be_const_str_gc); +be_define_const_str(EVENT_DRAW_MAIN, "EVENT_DRAW_MAIN", 1955620614u, 0, 15, &be_const_str_SERIAL_5E2); +be_define_const_str(EVENT_DRAW_PART_BEGIN, "EVENT_DRAW_PART_BEGIN", 3391865024u, 0, 21, &be_const_str_available); +be_define_const_str(EVENT_DRAW_PART_END, "EVENT_DRAW_PART_END", 3301625292u, 0, 19, &be_const_str_chars_in_string); +be_define_const_str(False, "False", 2541049336u, 0, 5, &be_const_str_set_style_line_color); +be_define_const_str(GET, "GET", 2531704439u, 0, 3, &be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E); +be_define_const_str(HTTP_GET, "HTTP_GET", 1722467738u, 0, 8, &be_const_str_I2C_Driver); +be_define_const_str(HTTP_POST, "HTTP_POST", 1999554144u, 0, 9, &be_const_str_imin); +be_define_const_str(I2C_X3A, "I2C:", 813483371u, 0, 4, &be_const_str_read24); +be_define_const_str(I2C_Driver, "I2C_Driver", 1714501658u, 0, 10, &be_const_str_addr); +be_define_const_str(LVG_X3A_X20call_X20to_X20unsupported_X20callback, "LVG: call to unsupported callback", 504176819u, 0, 33, &be_const_str_cb_dispatch); +be_define_const_str(Leds, "Leds", 2709245275u, 0, 4, &be_const_str_arg_name); be_define_const_str(MD5, "MD5", 1935726387u, 0, 3, NULL); -be_define_const_str(No_X20callback_X20available, "No callback available", 633786138u, 0, 21, &be_const_str_point); -be_define_const_str(None, "None", 810547195u, 0, 4, &be_const_str_day); -be_define_const_str(OPTION_A, "OPTION_A", 1133299440u, 0, 8, &be_const_str_isnan); -be_define_const_str(OneWire, "OneWire", 2298990722u, 0, 7, &be_const_str_is_first_time); -be_define_const_str(PART_MAIN, "PART_MAIN", 2473491508u, 0, 9, &be_const_str__ccmd); -be_define_const_str(POST, "POST", 1929554311u, 0, 4, &be_const_str_getbits); +be_define_const_str(No_X20callback_X20available, "No callback available", 633786138u, 0, 21, &be_const_str_gpio); +be_define_const_str(None, "None", 810547195u, 0, 4, &be_const_str_SERIAL_5E1); +be_define_const_str(OPTION_A, "OPTION_A", 1133299440u, 0, 8, &be_const_str_init_draw_line_dsc); +be_define_const_str(OneWire, "OneWire", 2298990722u, 0, 7, &be_const_str_Timer); +be_define_const_str(PART_MAIN, "PART_MAIN", 2473491508u, 0, 9, &be_const_str_STATE_DEFAULT); +be_define_const_str(POST, "POST", 1929554311u, 0, 4, NULL); be_define_const_str(Parameter_X20error, "Parameter error", 3840042038u, 0, 15, NULL); -be_define_const_str(RES_OK, "RES_OK", 1233817284u, 0, 6, &be_const_str_k); -be_define_const_str(Restart_X201, "Restart 1", 3504455855u, 0, 9, &be_const_str_year); -be_define_const_str(SERIAL_5E1, "SERIAL_5E1", 1163775235u, 0, 10, &be_const_str_SERIAL_8N1); -be_define_const_str(SERIAL_5E2, "SERIAL_5E2", 1180552854u, 0, 10, &be_const_str_SERIAL_8N2); -be_define_const_str(SERIAL_5N1, "SERIAL_5N1", 3313031680u, 0, 10, NULL); -be_define_const_str(SERIAL_5N2, "SERIAL_5N2", 3363364537u, 0, 10, &be_const_str_read_sensors); -be_define_const_str(SERIAL_5O1, "SERIAL_5O1", 3782657917u, 0, 10, &be_const_str_return); -be_define_const_str(SERIAL_5O2, "SERIAL_5O2", 3732325060u, 0, 10, &be_const_str__t); +be_define_const_str(RES_OK, "RES_OK", 1233817284u, 0, 6, &be_const_str_bri); +be_define_const_str(Restart_X201, "Restart 1", 3504455855u, 0, 9, &be_const_str_min); +be_define_const_str(SERIAL_5E1, "SERIAL_5E1", 1163775235u, 0, 10, &be_const_str_zero); +be_define_const_str(SERIAL_5E2, "SERIAL_5E2", 1180552854u, 0, 10, &be_const_str_lv_obj_class); +be_define_const_str(SERIAL_5N1, "SERIAL_5N1", 3313031680u, 0, 10, &be_const_str_ins_ramp); +be_define_const_str(SERIAL_5N2, "SERIAL_5N2", 3363364537u, 0, 10, NULL); +be_define_const_str(SERIAL_5O1, "SERIAL_5O1", 3782657917u, 0, 10, &be_const_str_flush); +be_define_const_str(SERIAL_5O2, "SERIAL_5O2", 3732325060u, 0, 10, NULL); be_define_const_str(SERIAL_6E1, "SERIAL_6E1", 334249486u, 0, 10, NULL); -be_define_const_str(SERIAL_6E2, "SERIAL_6E2", 317471867u, 0, 10, &be_const_str_digital_write); -be_define_const_str(SERIAL_6N1, "SERIAL_6N1", 198895701u, 0, 10, &be_const_str__X5D); -be_define_const_str(SERIAL_6N2, "SERIAL_6N2", 148562844u, 0, 10, &be_const_str__settings_def); -be_define_const_str(SERIAL_6O1, "SERIAL_6O1", 266153272u, 0, 10, &be_const_str_couldn_X27t_X20not_X20initialize_X20noepixelbus); -be_define_const_str(SERIAL_6O2, "SERIAL_6O2", 316486129u, 0, 10, &be_const_str_deregister_obj); -be_define_const_str(SERIAL_7E1, "SERIAL_7E1", 147718061u, 0, 10, &be_const_str_call); -be_define_const_str(SERIAL_7E2, "SERIAL_7E2", 97385204u, 0, 10, &be_const_str_global); -be_define_const_str(SERIAL_7N1, "SERIAL_7N1", 1891060246u, 0, 10, &be_const_str_encrypt); -be_define_const_str(SERIAL_7N2, "SERIAL_7N2", 1874282627u, 0, 10, &be_const_str_alternate); -be_define_const_str(SERIAL_7O1, "SERIAL_7O1", 1823802675u, 0, 10, NULL); -be_define_const_str(SERIAL_7O2, "SERIAL_7O2", 1840580294u, 0, 10, &be_const_str_arch); -be_define_const_str(SERIAL_8E1, "SERIAL_8E1", 2371121616u, 0, 10, &be_const_str__available); -be_define_const_str(SERIAL_8E2, "SERIAL_8E2", 2421454473u, 0, 10, NULL); -be_define_const_str(SERIAL_8N1, "SERIAL_8N1", 2369297235u, 0, 10, &be_const_str_imin); -be_define_const_str(SERIAL_8N2, "SERIAL_8N2", 2386074854u, 0, 10, &be_const_str_gen_cb); -be_define_const_str(SERIAL_8O1, "SERIAL_8O1", 289122742u, 0, 10, &be_const_str_return_X20code_X3D_X25i); -be_define_const_str(SERIAL_8O2, "SERIAL_8O2", 272345123u, 0, 10, &be_const_str_tag); -be_define_const_str(SK6812_GRBW, "SK6812_GRBW", 81157857u, 0, 11, &be_const_str_item); -be_define_const_str(STATE_DEFAULT, "STATE_DEFAULT", 712406428u, 0, 13, &be_const_str_pop); -be_define_const_str(TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, "TAP: found Tasmota App '%s'", 2643152398u, 0, 27, &be_const_str_closure); -be_define_const_str(Tasmota, "Tasmota", 4047617668u, 0, 7, &be_const_str_dump); -be_define_const_str(Tele, "Tele", 1329980653u, 0, 4, &be_const_str_f); -be_define_const_str(Timer, "Timer", 3948127682u, 0, 5, &be_const_str_check_privileged_access); -be_define_const_str(True, "True", 3453902341u, 0, 4, &be_const_str_hs2rgb); -be_define_const_str(Unknown_X20command, "Unknown command", 1830905432u, 0, 15, &be_const_str_map); -be_define_const_str(WS2812, "WS2812", 3539741218u, 0, 6, NULL); -be_define_const_str(WS2812_GRB, "WS2812_GRB", 1736405692u, 0, 10, NULL); -be_define_const_str(Wire, "Wire", 1938276536u, 0, 4, NULL); -be_define_const_str(_X5B, "[", 3725336506u, 0, 1, &be_const_str_get_object_from_ptr); -be_define_const_str(_X5D, "]", 3624670792u, 0, 1, &be_const_str_x1); -be_define_const_str(_, "_", 3658226030u, 0, 1, &be_const_str_widget_struct_by_class); -be_define_const_str(__iterator__, "__iterator__", 3884039703u, 0, 12, &be_const_str_asin); -be_define_const_str(__lower__, "__lower__", 123855590u, 0, 9, &be_const_str_public_key); -be_define_const_str(__upper__, "__upper__", 3612202883u, 0, 9, &be_const_str_class_init_obj); -be_define_const_str(_anonymous_, "_anonymous_", 1957281476u, 0, 11, &be_const_str_matrix); -be_define_const_str(_archive, "_archive", 4004559404u, 0, 8, &be_const_str_isrunning); -be_define_const_str(_available, "_available", 1306196581u, 0, 10, &be_const_str_setitem); -be_define_const_str(_begin_transmission, "_begin_transmission", 2779461176u, 0, 19, NULL); -be_define_const_str(_buffer, "_buffer", 2044888568u, 0, 7, &be_const_str_seti); -be_define_const_str(_cb, "_cb", 4043300367u, 0, 3, &be_const_str_copy); -be_define_const_str(_ccmd, "_ccmd", 2163421413u, 0, 5, &be_const_str_enabled); -be_define_const_str(_class, "_class", 2732146350u, 0, 6, &be_const_str__dirty); -be_define_const_str(_cmd, "_cmd", 3419822142u, 0, 4, &be_const_str_nan); -be_define_const_str(_debug_present, "_debug_present", 4063411725u, 0, 14, NULL); +be_define_const_str(SERIAL_6E2, "SERIAL_6E2", 317471867u, 0, 10, NULL); +be_define_const_str(SERIAL_6N1, "SERIAL_6N1", 198895701u, 0, 10, &be_const_str_char); +be_define_const_str(SERIAL_6N2, "SERIAL_6N2", 148562844u, 0, 10, &be_const_str_matrix); +be_define_const_str(SERIAL_6O1, "SERIAL_6O1", 266153272u, 0, 10, &be_const_str_atleast1); +be_define_const_str(SERIAL_6O2, "SERIAL_6O2", 316486129u, 0, 10, &be_const_str_content_send); +be_define_const_str(SERIAL_7E1, "SERIAL_7E1", 147718061u, 0, 10, &be_const_str_stop_iteration); +be_define_const_str(SERIAL_7E2, "SERIAL_7E2", 97385204u, 0, 10, &be_const_str_copy); +be_define_const_str(SERIAL_7N1, "SERIAL_7N1", 1891060246u, 0, 10, NULL); +be_define_const_str(SERIAL_7N2, "SERIAL_7N2", 1874282627u, 0, 10, &be_const_str_elif); +be_define_const_str(SERIAL_7O1, "SERIAL_7O1", 1823802675u, 0, 10, &be_const_str_init); +be_define_const_str(SERIAL_7O2, "SERIAL_7O2", 1840580294u, 0, 10, &be_const_str_global); +be_define_const_str(SERIAL_8E1, "SERIAL_8E1", 2371121616u, 0, 10, &be_const_str_scan); +be_define_const_str(SERIAL_8E2, "SERIAL_8E2", 2421454473u, 0, 10, &be_const_str_deregister_obj); +be_define_const_str(SERIAL_8N1, "SERIAL_8N1", 2369297235u, 0, 10, &be_const_str_resp_cmnd_done); +be_define_const_str(SERIAL_8N2, "SERIAL_8N2", 2386074854u, 0, 10, &be_const_str_sys); +be_define_const_str(SERIAL_8O1, "SERIAL_8O1", 289122742u, 0, 10, &be_const_str_get_vbus_current); +be_define_const_str(SERIAL_8O2, "SERIAL_8O2", 272345123u, 0, 10, &be_const_str_gamma10); +be_define_const_str(SK6812_GRBW, "SK6812_GRBW", 81157857u, 0, 11, NULL); +be_define_const_str(STATE_DEFAULT, "STATE_DEFAULT", 712406428u, 0, 13, &be_const_str_classname); +be_define_const_str(TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, "TAP: found Tasmota App '%s'", 2643152398u, 0, 27, NULL); +be_define_const_str(Tasmota, "Tasmota", 4047617668u, 0, 7, &be_const_str_top); +be_define_const_str(Tele, "Tele", 1329980653u, 0, 4, &be_const_str_exists); +be_define_const_str(Timer, "Timer", 3948127682u, 0, 5, &be_const_str_del); +be_define_const_str(True, "True", 3453902341u, 0, 4, &be_const_str_real); +be_define_const_str(Unknown_X20command, "Unknown command", 1830905432u, 0, 15, &be_const_str_get_percentage); +be_define_const_str(WS2812, "WS2812", 3539741218u, 0, 6, &be_const_str_finish); +be_define_const_str(WS2812_GRB, "WS2812_GRB", 1736405692u, 0, 10, &be_const_str_tasmota); +be_define_const_str(Wire, "Wire", 1938276536u, 0, 4, &be_const_str__begin_transmission); +be_define_const_str(_X5B, "[", 3725336506u, 0, 1, NULL); +be_define_const_str(_X5D, "]", 3624670792u, 0, 1, NULL); +be_define_const_str(_, "_", 3658226030u, 0, 1, NULL); +be_define_const_str(__iterator__, "__iterator__", 3884039703u, 0, 12, &be_const_str_pixel_count); +be_define_const_str(__lower__, "__lower__", 123855590u, 0, 9, &be_const_str_pin_mode); +be_define_const_str(__upper__, "__upper__", 3612202883u, 0, 9, &be_const_str_engine); +be_define_const_str(_anonymous_, "_anonymous_", 1957281476u, 0, 11, &be_const_str_get_light); +be_define_const_str(_archive, "_archive", 4004559404u, 0, 8, &be_const_str_cosh); +be_define_const_str(_available, "_available", 1306196581u, 0, 10, &be_const_str_is_running); +be_define_const_str(_begin_transmission, "_begin_transmission", 2779461176u, 0, 19, &be_const_str_lv_event_cb); +be_define_const_str(_buffer, "_buffer", 2044888568u, 0, 7, &be_const_str_every_50ms); +be_define_const_str(_cb, "_cb", 4043300367u, 0, 3, NULL); +be_define_const_str(_ccmd, "_ccmd", 2163421413u, 0, 5, &be_const_str_animators); +be_define_const_str(_class, "_class", 2732146350u, 0, 6, &be_const_str__X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); +be_define_const_str(_cmd, "_cmd", 3419822142u, 0, 4, NULL); +be_define_const_str(_debug_present, "_debug_present", 4063411725u, 0, 14, &be_const_str_call_native); be_define_const_str(_def, "_def", 1985022181u, 0, 4, NULL); -be_define_const_str(_dirty, "_dirty", 283846766u, 0, 6, &be_const_str_content_start); -be_define_const_str(_drivers, "_drivers", 3260328985u, 0, 8, &be_const_str_del); -be_define_const_str(_end_transmission, "_end_transmission", 3237480400u, 0, 17, &be_const_str_math); -be_define_const_str(_energy, "_energy", 535372070u, 0, 7, &be_const_str_reduce); -be_define_const_str(_error, "_error", 1132109656u, 0, 6, NULL); -be_define_const_str(_filename, "_filename", 1430813195u, 0, 9, NULL); -be_define_const_str(_get_cb, "_get_cb", 1448849122u, 0, 7, &be_const_str_begin); -be_define_const_str(_global_addr, "_global_addr", 533766721u, 0, 12, &be_const_str_add_rule); -be_define_const_str(_global_def, "_global_def", 646007001u, 0, 11, &be_const_str_destructor_cb); -be_define_const_str(_lvgl, "_lvgl", 2689219483u, 0, 5, NULL); -be_define_const_str(_p, "_p", 1594591802u, 0, 2, &be_const_str_scan); -be_define_const_str(_persist_X2Ejson, "_persist.json", 2008425138u, 0, 13, NULL); -be_define_const_str(_ptr, "_ptr", 306235816u, 0, 4, NULL); -be_define_const_str(_read, "_read", 346717030u, 0, 5, &be_const_str_calldepth); -be_define_const_str(_request_from, "_request_from", 3965148604u, 0, 13, &be_const_str_set_x); +be_define_const_str(_dirty, "_dirty", 283846766u, 0, 6, &be_const_str_get_coords); +be_define_const_str(_drivers, "_drivers", 3260328985u, 0, 8, &be_const_str__write); +be_define_const_str(_end_transmission, "_end_transmission", 3237480400u, 0, 17, NULL); +be_define_const_str(_energy, "_energy", 535372070u, 0, 7, &be_const_str_quality); +be_define_const_str(_error, "_error", 1132109656u, 0, 6, &be_const_str__ptr); +be_define_const_str(_filename, "_filename", 1430813195u, 0, 9, &be_const_str_set_text); +be_define_const_str(_get_cb, "_get_cb", 1448849122u, 0, 7, &be_const_str_find); +be_define_const_str(_global_addr, "_global_addr", 533766721u, 0, 12, &be_const_str_display_X2Eini); +be_define_const_str(_global_def, "_global_def", 646007001u, 0, 11, &be_const_str_get_warning_level); +be_define_const_str(_lvgl, "_lvgl", 2689219483u, 0, 5, &be_const_str_get_height); +be_define_const_str(_p, "_p", 1594591802u, 0, 2, &be_const_str_format); +be_define_const_str(_persist_X2Ejson, "_persist.json", 2008425138u, 0, 13, &be_const_str_value); +be_define_const_str(_ptr, "_ptr", 306235816u, 0, 4, &be_const_str_rtc); +be_define_const_str(_read, "_read", 346717030u, 0, 5, &be_const_str_is_dirty); +be_define_const_str(_request_from, "_request_from", 3965148604u, 0, 13, NULL); be_define_const_str(_rules, "_rules", 4266217105u, 0, 6, NULL); -be_define_const_str(_settings_def, "_settings_def", 3775560307u, 0, 13, &be_const_str_offseta); -be_define_const_str(_settings_ptr, "_settings_ptr", 1825772182u, 0, 13, &be_const_str_event_send); -be_define_const_str(_t, "_t", 1527481326u, 0, 2, &be_const_str_resolvecmnd); -be_define_const_str(_timers, "_timers", 2600100916u, 0, 7, &be_const_str_add); -be_define_const_str(_write, "_write", 2215462825u, 0, 6, &be_const_str_read12); -be_define_const_str(a, "a", 3826002220u, 0, 1, &be_const_str_get_string); -be_define_const_str(abs, "abs", 709362235u, 0, 3, NULL); -be_define_const_str(acos, "acos", 1006755615u, 0, 4, &be_const_str_def); -be_define_const_str(add, "add", 993596020u, 0, 3, &be_const_str_zero); -be_define_const_str(add_anim, "add_anim", 3980662668u, 0, 8, &be_const_str_content_flush); -be_define_const_str(add_cmd, "add_cmd", 3361630879u, 0, 7, NULL); -be_define_const_str(add_driver, "add_driver", 1654458371u, 0, 10, &be_const_str_atan2); -be_define_const_str(add_header, "add_header", 927130612u, 0, 10, &be_const_str_set_percentage); -be_define_const_str(add_rule, "add_rule", 596540743u, 0, 8, &be_const_str_call_native); -be_define_const_str(addr, "addr", 1087856498u, 0, 4, &be_const_str_create_matrix); -be_define_const_str(allocated, "allocated", 429986098u, 0, 9, &be_const_str_toptr); -be_define_const_str(alternate, "alternate", 1140253277u, 0, 9, NULL); -be_define_const_str(animate, "animate", 3885786800u, 0, 7, &be_const_str_function); -be_define_const_str(animators, "animators", 279858213u, 0, 9, &be_const_str_traceback); -be_define_const_str(arch, "arch", 2952804297u, 0, 4, NULL); -be_define_const_str(area, "area", 2601460036u, 0, 4, &be_const_str_find); -be_define_const_str(arg, "arg", 1047474471u, 0, 3, NULL); -be_define_const_str(arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj, "arg must be a subclass of lv_obj", 1641882079u, 0, 32, &be_const_str_as); -be_define_const_str(arg_name, "arg_name", 1345046155u, 0, 8, &be_const_str_widget_height_def); +be_define_const_str(_settings_def, "_settings_def", 3775560307u, 0, 13, &be_const_str_set); +be_define_const_str(_settings_ptr, "_settings_ptr", 1825772182u, 0, 13, &be_const_str_remove_cmd); +be_define_const_str(_t, "_t", 1527481326u, 0, 2, &be_const_str_draw_line_dsc_init); +be_define_const_str(_timers, "_timers", 2600100916u, 0, 7, &be_const_str_eth); +be_define_const_str(_write, "_write", 2215462825u, 0, 6, &be_const_str_v); +be_define_const_str(a, "a", 3826002220u, 0, 1, &be_const_str_add); +be_define_const_str(abs, "abs", 709362235u, 0, 3, &be_const_str_get_aps_voltage); +be_define_const_str(acos, "acos", 1006755615u, 0, 4, &be_const_str_lv); +be_define_const_str(add, "add", 993596020u, 0, 3, &be_const_str_bytes); +be_define_const_str(add_anim, "add_anim", 3980662668u, 0, 8, NULL); +be_define_const_str(add_cmd, "add_cmd", 3361630879u, 0, 7, &be_const_str_arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj); +be_define_const_str(add_driver, "add_driver", 1654458371u, 0, 10, NULL); +be_define_const_str(add_header, "add_header", 927130612u, 0, 10, &be_const_str_couldn_X27t_X20not_X20initialize_X20noepixelbus); +be_define_const_str(add_rule, "add_rule", 596540743u, 0, 8, &be_const_str_resp_cmnd_error); +be_define_const_str(addr, "addr", 1087856498u, 0, 4, &be_const_str_battery_present); +be_define_const_str(allocated, "allocated", 429986098u, 0, 9, &be_const_str_create_custom_widget); +be_define_const_str(alternate, "alternate", 1140253277u, 0, 9, &be_const_str_out_X20of_X20range); +be_define_const_str(animate, "animate", 3885786800u, 0, 7, &be_const_str_set_ldo_voltage); +be_define_const_str(animators, "animators", 279858213u, 0, 9, &be_const_str_read_bytes); +be_define_const_str(arch, "arch", 2952804297u, 0, 4, &be_const_str_arg_size); +be_define_const_str(area, "area", 2601460036u, 0, 4, &be_const_str_draw_arc); +be_define_const_str(arg, "arg", 1047474471u, 0, 3, &be_const_str_page_autoconf_mgr); +be_define_const_str(arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj, "arg must be a subclass of lv_obj", 1641882079u, 0, 32, &be_const_str_create_segment); +be_define_const_str(arg_name, "arg_name", 1345046155u, 0, 8, &be_const_str_has); be_define_const_str(arg_size, "arg_size", 3310243257u, 0, 8, NULL); be_define_const_str(as, "as", 1579491469u, 67, 2, NULL); -be_define_const_str(asin, "asin", 4272848550u, 0, 4, &be_const_str_get_current_module_name); -be_define_const_str(assert, "assert", 2774883451u, 0, 6, &be_const_str_display); -be_define_const_str(asstring, "asstring", 1298225088u, 0, 8, &be_const_str_get_temp); -be_define_const_str(atan, "atan", 108579519u, 0, 4, &be_const_str_publish); -be_define_const_str(atan2, "atan2", 3173440503u, 0, 5, &be_const_str_json_fdump_list); -be_define_const_str(atleast1, "atleast1", 1956331672u, 0, 8, &be_const_str_exp); -be_define_const_str(attrdump, "attrdump", 1521571304u, 0, 8, &be_const_str_cb_do_nothing); -be_define_const_str(autoexec, "autoexec", 3676861891u, 0, 8, &be_const_str_cmd_res); -be_define_const_str(autorun, "autorun", 1447527407u, 0, 7, &be_const_str_log); -be_define_const_str(available, "available", 1727918744u, 0, 9, NULL); -be_define_const_str(b, "b", 3876335077u, 0, 1, &be_const_str_get_bri); -be_define_const_str(back_forth, "back_forth", 2665042062u, 0, 10, &be_const_str_debug); -be_define_const_str(base_class, "base_class", 1107737279u, 0, 10, &be_const_str_is_running); -be_define_const_str(battery_present, "battery_present", 3588397058u, 0, 15, NULL); -be_define_const_str(begin, "begin", 1748273790u, 0, 5, &be_const_str_char); -be_define_const_str(bool, "bool", 3365180733u, 0, 4, &be_const_str_log10); +be_define_const_str(asin, "asin", 4272848550u, 0, 4, &be_const_str_destructor_cb); +be_define_const_str(assert, "assert", 2774883451u, 0, 6, &be_const_str_member); +be_define_const_str(asstring, "asstring", 1298225088u, 0, 8, &be_const_str_invalidate); +be_define_const_str(atan, "atan", 108579519u, 0, 4, &be_const_str_fromb64); +be_define_const_str(atan2, "atan2", 3173440503u, 0, 5, &be_const_str_millis); +be_define_const_str(atleast1, "atleast1", 1956331672u, 0, 8, &be_const_str_connected); +be_define_const_str(attrdump, "attrdump", 1521571304u, 0, 8, &be_const_str_counters); +be_define_const_str(autoexec, "autoexec", 3676861891u, 0, 8, NULL); +be_define_const_str(autorun, "autorun", 1447527407u, 0, 7, &be_const_str_return); +be_define_const_str(available, "available", 1727918744u, 0, 9, &be_const_str_fromstring); +be_define_const_str(b, "b", 3876335077u, 0, 1, &be_const_str_display); +be_define_const_str(back_forth, "back_forth", 2665042062u, 0, 10, &be_const_str_dac_voltage); +be_define_const_str(base_class, "base_class", 1107737279u, 0, 10, NULL); +be_define_const_str(battery_present, "battery_present", 3588397058u, 0, 15, &be_const_str_run_bat); +be_define_const_str(begin, "begin", 1748273790u, 0, 5, &be_const_str_gamma8); +be_define_const_str(bool, "bool", 3365180733u, 0, 4, &be_const_str_set_power); be_define_const_str(break, "break", 3378807160u, 58, 5, NULL); -be_define_const_str(bri, "bri", 2112284244u, 0, 3, &be_const_str_set_style_pad_right); -be_define_const_str(bus, "bus", 1607822841u, 0, 3, &be_const_str_minute); -be_define_const_str(button_pressed, "button_pressed", 1694209616u, 0, 14, &be_const_str_editable); -be_define_const_str(byte, "byte", 1683620383u, 0, 4, &be_const_str_set_timeouts); -be_define_const_str(bytes, "bytes", 1706151940u, 0, 5, &be_const_str_read); -be_define_const_str(c, "c", 3859557458u, 0, 1, &be_const_str_state); -be_define_const_str(call, "call", 3018949801u, 0, 4, &be_const_str_get_coords); -be_define_const_str(call_native, "call_native", 1389147405u, 0, 11, &be_const_str_read8); -be_define_const_str(calldepth, "calldepth", 3122364302u, 0, 9, &be_const_str__X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); -be_define_const_str(can_show, "can_show", 960091187u, 0, 8, &be_const_str_month); -be_define_const_str(cb_dispatch, "cb_dispatch", 1741510499u, 0, 11, &be_const_str_offset); -be_define_const_str(cb_do_nothing, "cb_do_nothing", 1488730702u, 0, 13, &be_const_str_contains); -be_define_const_str(cb_event_closure, "cb_event_closure", 3828267325u, 0, 16, &be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E); -be_define_const_str(cb_obj, "cb_obj", 1195696482u, 0, 6, NULL); -be_define_const_str(ceil, "ceil", 1659167240u, 0, 4, NULL); -be_define_const_str(char, "char", 2823553821u, 0, 4, &be_const_str_every_50ms); -be_define_const_str(chars_in_string, "chars_in_string", 3148785132u, 0, 15, &be_const_str_draw_line_dsc); -be_define_const_str(check_privileged_access, "check_privileged_access", 3692933968u, 0, 23, &be_const_str_solidified); +be_define_const_str(bri, "bri", 2112284244u, 0, 3, &be_const_str_cos); +be_define_const_str(bus, "bus", 1607822841u, 0, 3, &be_const_str_get_vbus_voltage); +be_define_const_str(button_pressed, "button_pressed", 1694209616u, 0, 14, &be_const_str_insert); +be_define_const_str(byte, "byte", 1683620383u, 0, 4, NULL); +be_define_const_str(bytes, "bytes", 1706151940u, 0, 5, NULL); +be_define_const_str(c, "c", 3859557458u, 0, 1, &be_const_str_decrypt); +be_define_const_str(call, "call", 3018949801u, 0, 4, NULL); +be_define_const_str(call_native, "call_native", 1389147405u, 0, 11, &be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson); +be_define_const_str(calldepth, "calldepth", 3122364302u, 0, 9, &be_const_str_event_send); +be_define_const_str(can_show, "can_show", 960091187u, 0, 8, &be_const_str_ctypes_bytes_dyn); +be_define_const_str(cb_dispatch, "cb_dispatch", 1741510499u, 0, 11, &be_const_str_set_bri); +be_define_const_str(cb_do_nothing, "cb_do_nothing", 1488730702u, 0, 13, NULL); +be_define_const_str(cb_event_closure, "cb_event_closure", 3828267325u, 0, 16, NULL); +be_define_const_str(cb_obj, "cb_obj", 1195696482u, 0, 6, &be_const_str_rotate); +be_define_const_str(ceil, "ceil", 1659167240u, 0, 4, &be_const_str_set_width); +be_define_const_str(char, "char", 2823553821u, 0, 4, NULL); +be_define_const_str(chars_in_string, "chars_in_string", 3148785132u, 0, 15, &be_const_str_kv); +be_define_const_str(check_privileged_access, "check_privileged_access", 3692933968u, 0, 23, &be_const_str_group_def); be_define_const_str(class, "class", 2872970239u, 57, 5, NULL); -be_define_const_str(class_init_obj, "class_init_obj", 178410604u, 0, 14, NULL); +be_define_const_str(class_init_obj, "class_init_obj", 178410604u, 0, 14, &be_const_str_set_useragent); be_define_const_str(classname, "classname", 1998589948u, 0, 9, NULL); -be_define_const_str(classof, "classof", 1796577762u, 0, 7, &be_const_str_gamma); +be_define_const_str(classof, "classof", 1796577762u, 0, 7, NULL); be_define_const_str(clear, "clear", 1550717474u, 0, 5, NULL); -be_define_const_str(clear_first_time, "clear_first_time", 632769909u, 0, 16, &be_const_str_get_power); -be_define_const_str(clear_to, "clear_to", 3528002130u, 0, 8, &be_const_str_tanh); -be_define_const_str(close, "close", 667630371u, 0, 5, &be_const_str_write_bit); -be_define_const_str(closure, "closure", 1548407746u, 0, 7, &be_const_str_cmd); -be_define_const_str(cmd, "cmd", 4136785899u, 0, 3, &be_const_str_get_switch); +be_define_const_str(clear_first_time, "clear_first_time", 632769909u, 0, 16, &be_const_str_read); +be_define_const_str(clear_to, "clear_to", 3528002130u, 0, 8, &be_const_str_geti); +be_define_const_str(close, "close", 667630371u, 0, 5, &be_const_str_depower); +be_define_const_str(closure, "closure", 1548407746u, 0, 7, &be_const_str_param); +be_define_const_str(cmd, "cmd", 4136785899u, 0, 3, &be_const_str_input); be_define_const_str(cmd_res, "cmd_res", 921166762u, 0, 7, NULL); -be_define_const_str(code, "code", 4180765940u, 0, 4, &be_const_str_group_def); -be_define_const_str(codedump, "codedump", 1786337906u, 0, 8, &be_const_str_members); -be_define_const_str(collect, "collect", 2399039025u, 0, 7, &be_const_str_file); -be_define_const_str(color, "color", 1031692888u, 0, 5, &be_const_str_get_width); -be_define_const_str(compile, "compile", 1000265118u, 0, 7, &be_const_str_ctypes_bytes); -be_define_const_str(compress, "compress", 2818084237u, 0, 8, &be_const_str_find_op); -be_define_const_str(concat, "concat", 4124019837u, 0, 6, &be_const_str_widget_dtor_impl); -be_define_const_str(connect, "connect", 2866859257u, 0, 7, &be_const_str_stop); -be_define_const_str(connected, "connected", 1424938192u, 0, 9, &be_const_str_obj_event_base); -be_define_const_str(connection_error, "connection_error", 1358926260u, 0, 16, &be_const_str_wifi); -be_define_const_str(constructor_cb, "constructor_cb", 2489105297u, 0, 14, &be_const_str_round_start); +be_define_const_str(code, "code", 4180765940u, 0, 4, &be_const_str_null_cb); +be_define_const_str(codedump, "codedump", 1786337906u, 0, 8, NULL); +be_define_const_str(collect, "collect", 2399039025u, 0, 7, &be_const_str_json_fdump_any); +be_define_const_str(color, "color", 1031692888u, 0, 5, &be_const_str_has_arg); +be_define_const_str(compile, "compile", 1000265118u, 0, 7, NULL); +be_define_const_str(compress, "compress", 2818084237u, 0, 8, NULL); +be_define_const_str(concat, "concat", 4124019837u, 0, 6, NULL); +be_define_const_str(connect, "connect", 2866859257u, 0, 7, NULL); +be_define_const_str(connected, "connected", 1424938192u, 0, 9, &be_const_str_debug); +be_define_const_str(connection_error, "connection_error", 1358926260u, 0, 16, &be_const_str_json_fdump); +be_define_const_str(constructor_cb, "constructor_cb", 2489105297u, 0, 14, &be_const_str_minute); be_define_const_str(contains, "contains", 1825239352u, 0, 8, &be_const_str_deinit); -be_define_const_str(content_button, "content_button", 1956476087u, 0, 14, &be_const_str_write); -be_define_const_str(content_flush, "content_flush", 214922475u, 0, 13, NULL); -be_define_const_str(content_send, "content_send", 1673733649u, 0, 12, NULL); -be_define_const_str(content_send_style, "content_send_style", 1087907647u, 0, 18, &be_const_str_is_dirty); -be_define_const_str(content_start, "content_start", 2937509069u, 0, 13, NULL); -be_define_const_str(content_stop, "content_stop", 658554751u, 0, 12, &be_const_str_line_dsc); +be_define_const_str(content_button, "content_button", 1956476087u, 0, 14, &be_const_str_pixels_buffer); +be_define_const_str(content_flush, "content_flush", 214922475u, 0, 13, &be_const_str_leds); +be_define_const_str(content_send, "content_send", 1673733649u, 0, 12, &be_const_str_load); +be_define_const_str(content_send_style, "content_send_style", 1087907647u, 0, 18, &be_const_str_read8); +be_define_const_str(content_start, "content_start", 2937509069u, 0, 13, &be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf); +be_define_const_str(content_stop, "content_stop", 658554751u, 0, 12, NULL); be_define_const_str(continue, "continue", 2977070660u, 59, 8, NULL); -be_define_const_str(copy, "copy", 3848464964u, 0, 4, &be_const_str_rad); -be_define_const_str(cos, "cos", 4220379804u, 0, 3, &be_const_str_start); -be_define_const_str(cosh, "cosh", 4099687964u, 0, 4, &be_const_str_h); +be_define_const_str(copy, "copy", 3848464964u, 0, 4, &be_const_str_json_append); +be_define_const_str(cos, "cos", 4220379804u, 0, 3, &be_const_str_count); +be_define_const_str(cosh, "cosh", 4099687964u, 0, 4, &be_const_str_set_percentage); be_define_const_str(couldn_X27t_X20not_X20initialize_X20noepixelbus, "couldn't not initialize noepixelbus", 2536490812u, 0, 35, NULL); -be_define_const_str(count, "count", 967958004u, 0, 5, &be_const_str_web_add_console_button); -be_define_const_str(counters, "counters", 4095866864u, 0, 8, &be_const_str_save); -be_define_const_str(create_custom_widget, "create_custom_widget", 1140594778u, 0, 20, &be_const_str_quality); -be_define_const_str(create_matrix, "create_matrix", 3528185923u, 0, 13, &be_const_str_y1); -be_define_const_str(create_segment, "create_segment", 3863522719u, 0, 14, &be_const_str_open); -be_define_const_str(ctor, "ctor", 375399343u, 0, 4, &be_const_str_push); +be_define_const_str(count, "count", 967958004u, 0, 5, &be_const_str_every_100ms); +be_define_const_str(counters, "counters", 4095866864u, 0, 8, &be_const_str_on); +be_define_const_str(create_custom_widget, "create_custom_widget", 1140594778u, 0, 20, &be_const_str_instance); +be_define_const_str(create_matrix, "create_matrix", 3528185923u, 0, 13, &be_const_str_dirty); +be_define_const_str(create_segment, "create_segment", 3863522719u, 0, 14, &be_const_str_exec_cmd); +be_define_const_str(ctor, "ctor", 375399343u, 0, 4, &be_const_str_tcpclient); be_define_const_str(ctypes_bytes, "ctypes_bytes", 3879019703u, 0, 12, NULL); -be_define_const_str(ctypes_bytes_dyn, "ctypes_bytes_dyn", 915205307u, 0, 16, &be_const_str_reapply); -be_define_const_str(dac_voltage, "dac_voltage", 1552257222u, 0, 11, &be_const_str_time_reached); -be_define_const_str(day, "day", 3830391293u, 0, 3, &be_const_str_every_100ms); -be_define_const_str(debug, "debug", 1483009432u, 0, 5, &be_const_str_exec_rules); -be_define_const_str(decompress, "decompress", 2887031650u, 0, 10, NULL); -be_define_const_str(decrypt, "decrypt", 2886974618u, 0, 7, NULL); +be_define_const_str(ctypes_bytes_dyn, "ctypes_bytes_dyn", 915205307u, 0, 16, &be_const_str_time_dump); +be_define_const_str(dac_voltage, "dac_voltage", 1552257222u, 0, 11, &be_const_str_reverse_gamma10); +be_define_const_str(day, "day", 3830391293u, 0, 3, &be_const_str_duration); +be_define_const_str(debug, "debug", 1483009432u, 0, 5, &be_const_str_str); +be_define_const_str(decompress, "decompress", 2887031650u, 0, 10, &be_const_str_imax); +be_define_const_str(decrypt, "decrypt", 2886974618u, 0, 7, &be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E); be_define_const_str(def, "def", 3310976652u, 55, 3, NULL); -be_define_const_str(deg, "deg", 3327754271u, 0, 3, NULL); -be_define_const_str(deinit, "deinit", 2345559592u, 0, 6, NULL); -be_define_const_str(del, "del", 3478752842u, 0, 3, NULL); -be_define_const_str(delay, "delay", 1322381784u, 0, 5, &be_const_str_run_deferred); -be_define_const_str(delete_all_configs, "delete_all_configs", 2382067578u, 0, 18, &be_const_str_wire1); -be_define_const_str(depower, "depower", 3563819571u, 0, 7, &be_const_str_get_bat_charge_current); -be_define_const_str(deregister_obj, "deregister_obj", 3909966993u, 0, 14, &be_const_str_get_alternate); -be_define_const_str(destructor_cb, "destructor_cb", 1930283190u, 0, 13, &be_const_str_p2); -be_define_const_str(detect, "detect", 8884370u, 0, 6, NULL); -be_define_const_str(detected_X20on_X20bus, "detected on bus", 1432002650u, 0, 15, &be_const_str_run); +be_define_const_str(deg, "deg", 3327754271u, 0, 3, &be_const_str_set_y); +be_define_const_str(deinit, "deinit", 2345559592u, 0, 6, &be_const_str_tan); +be_define_const_str(del, "del", 3478752842u, 0, 3, &be_const_str_range); +be_define_const_str(delay, "delay", 1322381784u, 0, 5, &be_const_str_shared_key); +be_define_const_str(delete_all_configs, "delete_all_configs", 2382067578u, 0, 18, &be_const_str_get_bat_voltage); +be_define_const_str(depower, "depower", 3563819571u, 0, 7, &be_const_str_get_battery_chargin_status); +be_define_const_str(deregister_obj, "deregister_obj", 3909966993u, 0, 14, &be_const_str_strip); +be_define_const_str(destructor_cb, "destructor_cb", 1930283190u, 0, 13, &be_const_str_state); +be_define_const_str(detect, "detect", 8884370u, 0, 6, &be_const_str_hex); +be_define_const_str(detected_X20on_X20bus, "detected on bus", 1432002650u, 0, 15, &be_const_str_nan); be_define_const_str(digital_read, "digital_read", 3585496928u, 0, 12, NULL); -be_define_const_str(digital_write, "digital_write", 3435877979u, 0, 13, &be_const_str_gamma8); -be_define_const_str(dirty, "dirty", 2667581083u, 0, 5, &be_const_str_pop_path); -be_define_const_str(display, "display", 1164572437u, 0, 7, &be_const_str_finish); -be_define_const_str(display_X2Eini, "display.ini", 2646174001u, 0, 11, NULL); +be_define_const_str(digital_write, "digital_write", 3435877979u, 0, 13, &be_const_str_set_style_text_font); +be_define_const_str(dirty, "dirty", 2667581083u, 0, 5, NULL); +be_define_const_str(display, "display", 1164572437u, 0, 7, NULL); +be_define_const_str(display_X2Eini, "display.ini", 2646174001u, 0, 11, &be_const_str_function); be_define_const_str(do, "do", 1646057492u, 65, 2, NULL); -be_define_const_str(draw_arc, "draw_arc", 1828251676u, 0, 8, &be_const_str_hour); -be_define_const_str(draw_line, "draw_line", 1634465686u, 0, 9, NULL); -be_define_const_str(draw_line_dsc, "draw_line_dsc", 4220676203u, 0, 13, &be_const_str_widget_instance_size); +be_define_const_str(draw_arc, "draw_arc", 1828251676u, 0, 8, &be_const_str_io_error); +be_define_const_str(draw_line, "draw_line", 1634465686u, 0, 9, &be_const_str_item); +be_define_const_str(draw_line_dsc, "draw_line_dsc", 4220676203u, 0, 13, &be_const_str_energy_struct); be_define_const_str(draw_line_dsc_init, "draw_line_dsc_init", 3866693646u, 0, 18, NULL); -be_define_const_str(due, "due", 3895530293u, 0, 3, NULL); +be_define_const_str(due, "due", 3895530293u, 0, 3, &be_const_str_pow); be_define_const_str(dump, "dump", 3663001223u, 0, 4, NULL); -be_define_const_str(duration, "duration", 799079693u, 0, 8, &be_const_str_rotate); -be_define_const_str(editable, "editable", 60532369u, 0, 8, &be_const_str_kv); +be_define_const_str(duration, "duration", 799079693u, 0, 8, &be_const_str_time_reached); +be_define_const_str(editable, "editable", 60532369u, 0, 8, &be_const_str_resize); be_define_const_str(elif, "elif", 3232090307u, 51, 4, NULL); be_define_const_str(else, "else", 3183434736u, 52, 4, NULL); -be_define_const_str(enabled, "enabled", 49525662u, 0, 7, &be_const_str_write_file); -be_define_const_str(encrypt, "encrypt", 2194327650u, 0, 7, &be_const_str_static); -be_define_const_str(end, "end", 1787721130u, 56, 3, &be_const_str_try); +be_define_const_str(enabled, "enabled", 49525662u, 0, 7, &be_const_str_widget_width_def); +be_define_const_str(encrypt, "encrypt", 2194327650u, 0, 7, &be_const_str_introspect); +be_define_const_str(end, "end", 1787721130u, 56, 3, NULL); be_define_const_str(energy_struct, "energy_struct", 1655792843u, 0, 13, NULL); -be_define_const_str(engine, "engine", 3993360443u, 0, 6, &be_const_str_widget_destructor); -be_define_const_str(erase, "erase", 1010949589u, 0, 5, &be_const_str_tolower); -be_define_const_str(escape, "escape", 2652972038u, 0, 6, &be_const_str_hex); -be_define_const_str(eth, "eth", 2191266556u, 0, 3, NULL); -be_define_const_str(event, "event", 4264611999u, 0, 5, &be_const_str_set_width); -be_define_const_str(event_cb, "event_cb", 3128698017u, 0, 8, &be_const_str_height_def); -be_define_const_str(event_send, "event_send", 598925582u, 0, 10, &be_const_str_gamma10); -be_define_const_str(every_100ms, "every_100ms", 1546407804u, 0, 11, NULL); -be_define_const_str(every_50ms, "every_50ms", 2383884008u, 0, 10, &be_const_str_page_autoconf_mgr); -be_define_const_str(every_second, "every_second", 2075451465u, 0, 12, &be_const_str_list); +be_define_const_str(engine, "engine", 3993360443u, 0, 6, &be_const_str_obj_event_base); +be_define_const_str(erase, "erase", 1010949589u, 0, 5, &be_const_str_lv_obj); +be_define_const_str(escape, "escape", 2652972038u, 0, 6, &be_const_str_path); +be_define_const_str(eth, "eth", 2191266556u, 0, 3, &be_const_str_set_pixel_color); +be_define_const_str(event, "event", 4264611999u, 0, 5, &be_const_str_issubclass); +be_define_const_str(event_cb, "event_cb", 3128698017u, 0, 8, &be_const_str_get_power); +be_define_const_str(event_send, "event_send", 598925582u, 0, 10, &be_const_str_lvgl_event_dispatch); +be_define_const_str(every_100ms, "every_100ms", 1546407804u, 0, 11, &be_const_str_web_send_decimal); +be_define_const_str(every_50ms, "every_50ms", 2383884008u, 0, 10, &be_const_str_length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032); +be_define_const_str(every_second, "every_second", 2075451465u, 0, 12, &be_const_str_serial); be_define_const_str(except, "except", 950914032u, 69, 6, NULL); -be_define_const_str(exec_cmd, "exec_cmd", 493567399u, 0, 8, &be_const_str_light); -be_define_const_str(exec_rules, "exec_rules", 1445221092u, 0, 10, &be_const_str_reverse); -be_define_const_str(exec_tele, "exec_tele", 1020751601u, 0, 9, &be_const_str_has); -be_define_const_str(exists, "exists", 1002329533u, 0, 6, &be_const_str_setbits); -be_define_const_str(exp, "exp", 1923516200u, 0, 3, &be_const_str_tasmota); -be_define_const_str(f, "f", 3809224601u, 0, 1, &be_const_str_input); +be_define_const_str(exec_cmd, "exec_cmd", 493567399u, 0, 8, &be_const_str__X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); +be_define_const_str(exec_rules, "exec_rules", 1445221092u, 0, 10, &be_const_str_write8); +be_define_const_str(exec_tele, "exec_tele", 1020751601u, 0, 9, NULL); +be_define_const_str(exists, "exists", 1002329533u, 0, 6, &be_const_str_get_bat_power); +be_define_const_str(exp, "exp", 1923516200u, 0, 3, &be_const_str_listdir); +be_define_const_str(f, "f", 3809224601u, 0, 1, NULL); be_define_const_str(false, "false", 184981848u, 62, 5, NULL); be_define_const_str(file, "file", 2867484483u, 0, 4, NULL); -be_define_const_str(file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27, "file extension is not '.be' or '.bec'", 3095719639u, 0, 37, NULL); -be_define_const_str(files, "files", 1055342736u, 0, 5, &be_const_str_param); +be_define_const_str(file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27, "file extension is not '.be' or '.bec'", 3095719639u, 0, 37, &be_const_str_hour); +be_define_const_str(files, "files", 1055342736u, 0, 5, &be_const_str_page_autoconf_ctl); be_define_const_str(find, "find", 3186656602u, 0, 4, NULL); -be_define_const_str(find_key_i, "find_key_i", 850136726u, 0, 10, &be_const_str_pin); +be_define_const_str(find_key_i, "find_key_i", 850136726u, 0, 10, &be_const_str_w); be_define_const_str(find_op, "find_op", 3766713376u, 0, 7, NULL); -be_define_const_str(finish, "finish", 1494643858u, 0, 6, NULL); -be_define_const_str(floor, "floor", 3102149661u, 0, 5, &be_const_str_local); +be_define_const_str(finish, "finish", 1494643858u, 0, 6, &be_const_str_isinstance); +be_define_const_str(floor, "floor", 3102149661u, 0, 5, &be_const_str_get_style_bg_color); be_define_const_str(flush, "flush", 3002334877u, 0, 5, NULL); be_define_const_str(for, "for", 2901640080u, 54, 3, NULL); -be_define_const_str(format, "format", 3114108242u, 0, 6, &be_const_str_memory); -be_define_const_str(from_to, "from_to", 21625507u, 0, 7, &be_const_str_load); +be_define_const_str(format, "format", 3114108242u, 0, 6, &be_const_str_pi); +be_define_const_str(from_to, "from_to", 21625507u, 0, 7, &be_const_str_static); be_define_const_str(fromb64, "fromb64", 2717019639u, 0, 7, NULL); -be_define_const_str(fromptr, "fromptr", 666189689u, 0, 7, NULL); -be_define_const_str(fromstring, "fromstring", 610302344u, 0, 10, &be_const_str_get_input_power_status); -be_define_const_str(function, "function", 2664841801u, 0, 8, &be_const_str_tostring); -be_define_const_str(gamma, "gamma", 3492353034u, 0, 5, &be_const_str_widget_struct_default); -be_define_const_str(gamma10, "gamma10", 3472052483u, 0, 7, &be_const_str_get_free_heap); -be_define_const_str(gamma8, "gamma8", 3802843830u, 0, 6, &be_const_str_resp_cmnd); -be_define_const_str(gc, "gc", 1042313471u, 0, 2, NULL); +be_define_const_str(fromptr, "fromptr", 666189689u, 0, 7, &be_const_str_set_style_bg_color); +be_define_const_str(fromstring, "fromstring", 610302344u, 0, 10, &be_const_str_publish); +be_define_const_str(function, "function", 2664841801u, 0, 8, NULL); +be_define_const_str(gamma, "gamma", 3492353034u, 0, 5, &be_const_str_isnan); +be_define_const_str(gamma10, "gamma10", 3472052483u, 0, 7, NULL); +be_define_const_str(gamma8, "gamma8", 3802843830u, 0, 6, &be_const_str_memory); +be_define_const_str(gc, "gc", 1042313471u, 0, 2, &be_const_str_tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29); be_define_const_str(gen_cb, "gen_cb", 3245227551u, 0, 6, NULL); -be_define_const_str(get, "get", 1410115415u, 0, 3, &be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D); -be_define_const_str(get_alternate, "get_alternate", 1450148894u, 0, 13, NULL); +be_define_const_str(get, "get", 1410115415u, 0, 3, NULL); +be_define_const_str(get_alternate, "get_alternate", 1450148894u, 0, 13, &be_const_str_scale_uint); be_define_const_str(get_aps_voltage, "get_aps_voltage", 2293036435u, 0, 15, NULL); -be_define_const_str(get_bat_charge_current, "get_bat_charge_current", 1385293050u, 0, 22, &be_const_str_pi); +be_define_const_str(get_bat_charge_current, "get_bat_charge_current", 1385293050u, 0, 22, &be_const_str_read12); be_define_const_str(get_bat_current, "get_bat_current", 1912106073u, 0, 15, NULL); -be_define_const_str(get_bat_power, "get_bat_power", 3067374853u, 0, 13, &be_const_str_ins_time); -be_define_const_str(get_bat_voltage, "get_bat_voltage", 706676538u, 0, 15, NULL); -be_define_const_str(get_battery_chargin_status, "get_battery_chargin_status", 2233241571u, 0, 26, NULL); -be_define_const_str(get_bri, "get_bri", 2041809895u, 0, 7, &be_const_str_page_autoconf_ctl); -be_define_const_str(get_coords, "get_coords", 1044089006u, 0, 10, &be_const_str_upper); -be_define_const_str(get_current_module_name, "get_current_module_name", 2379270740u, 0, 23, NULL); +be_define_const_str(get_bat_power, "get_bat_power", 3067374853u, 0, 13, &be_const_str_json_fdump_list); +be_define_const_str(get_bat_voltage, "get_bat_voltage", 706676538u, 0, 15, &be_const_str_save_before_restart); +be_define_const_str(get_battery_chargin_status, "get_battery_chargin_status", 2233241571u, 0, 26, &be_const_str_split); +be_define_const_str(get_bri, "get_bri", 2041809895u, 0, 7, &be_const_str_math); +be_define_const_str(get_coords, "get_coords", 1044089006u, 0, 10, &be_const_str_get_temp); +be_define_const_str(get_current_module_name, "get_current_module_name", 2379270740u, 0, 23, &be_const_str_get_width); be_define_const_str(get_current_module_path, "get_current_module_path", 3206673408u, 0, 23, NULL); -be_define_const_str(get_free_heap, "get_free_heap", 625069757u, 0, 13, &be_const_str_no_X20GPIO_X20specified_X20for_X20neopixelbus); -be_define_const_str(get_height, "get_height", 3571755523u, 0, 10, &be_const_str_obj_class_create_obj); -be_define_const_str(get_input_power_status, "get_input_power_status", 4102829177u, 0, 22, &be_const_str_get_style_bg_color); -be_define_const_str(get_light, "get_light", 381930476u, 0, 9, &be_const_str_unknown_X20instruction); -be_define_const_str(get_object_from_ptr, "get_object_from_ptr", 2345019201u, 0, 19, NULL); +be_define_const_str(get_free_heap, "get_free_heap", 625069757u, 0, 13, &be_const_str_push); +be_define_const_str(get_height, "get_height", 3571755523u, 0, 10, &be_const_str_ins_goto); +be_define_const_str(get_input_power_status, "get_input_power_status", 4102829177u, 0, 22, NULL); +be_define_const_str(get_light, "get_light", 381930476u, 0, 9, &be_const_str_setitem); +be_define_const_str(get_object_from_ptr, "get_object_from_ptr", 2345019201u, 0, 19, &be_const_str_log); be_define_const_str(get_option, "get_option", 2123730033u, 0, 10, NULL); be_define_const_str(get_percentage, "get_percentage", 2880483992u, 0, 14, NULL); be_define_const_str(get_pixel_color, "get_pixel_color", 337490048u, 0, 15, NULL); -be_define_const_str(get_power, "get_power", 3009799377u, 0, 9, NULL); -be_define_const_str(get_size, "get_size", 2803644713u, 0, 8, &be_const_str_tomap); -be_define_const_str(get_string, "get_string", 4195847969u, 0, 10, &be_const_str_remove_driver); -be_define_const_str(get_style_bg_color, "get_style_bg_color", 964794381u, 0, 18, &be_const_str_number); -be_define_const_str(get_style_line_color, "get_style_line_color", 805371932u, 0, 20, &be_const_str_ins_ramp); +be_define_const_str(get_power, "get_power", 3009799377u, 0, 9, &be_const_str_open); +be_define_const_str(get_size, "get_size", 2803644713u, 0, 8, NULL); +be_define_const_str(get_string, "get_string", 4195847969u, 0, 10, NULL); +be_define_const_str(get_style_bg_color, "get_style_bg_color", 964794381u, 0, 18, &be_const_str_r); +be_define_const_str(get_style_line_color, "get_style_line_color", 805371932u, 0, 20, &be_const_str_time_str); be_define_const_str(get_style_pad_right, "get_style_pad_right", 3150287466u, 0, 19, NULL); -be_define_const_str(get_switch, "get_switch", 164821028u, 0, 10, &be_const_str_set_y); -be_define_const_str(get_tasmota, "get_tasmota", 334356779u, 0, 11, &be_const_str_imax); +be_define_const_str(get_switch, "get_switch", 164821028u, 0, 10, &be_const_str_isrunning); +be_define_const_str(get_tasmota, "get_tasmota", 334356779u, 0, 11, &be_const_str_getbits); be_define_const_str(get_temp, "get_temp", 3370919486u, 0, 8, NULL); -be_define_const_str(get_vbus_current, "get_vbus_current", 1205347942u, 0, 16, &be_const_str_tele); -be_define_const_str(get_vbus_voltage, "get_vbus_voltage", 2398210401u, 0, 16, &be_const_str_toupper); -be_define_const_str(get_warning_level, "get_warning_level", 1737834441u, 0, 17, NULL); -be_define_const_str(get_width, "get_width", 3293417300u, 0, 9, &be_const_str_readbytes); -be_define_const_str(getbits, "getbits", 3094168979u, 0, 7, &be_const_str_has_arg); -be_define_const_str(geti, "geti", 2381006490u, 0, 4, NULL); -be_define_const_str(global, "global", 503252654u, 0, 6, NULL); -be_define_const_str(gpio, "gpio", 2638155258u, 0, 4, &be_const_str_wire_scan); -be_define_const_str(group_def, "group_def", 1524213328u, 0, 9, NULL); -be_define_const_str(h, "h", 3977000791u, 0, 1, &be_const_str_init); -be_define_const_str(has, "has", 3988721635u, 0, 3, &be_const_str_pow); -be_define_const_str(has_arg, "has_arg", 424878688u, 0, 7, &be_const_str__X7D); -be_define_const_str(height_def, "height_def", 2348238838u, 0, 10, &be_const_str_set_height); -be_define_const_str(hex, "hex", 4273249610u, 0, 3, &be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson); -be_define_const_str(hour, "hour", 3053661199u, 0, 4, &be_const_str_pixel_count); -be_define_const_str(hs2rgb, "hs2rgb", 1040816349u, 0, 6, &be_const_str_path); -be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s/%s.autoconf", 2743526309u, 0, 70, &be_const_str_pc_abs); -be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s_manifest.json", 3657552045u, 0, 72, &be_const_str_int); -be_define_const_str(i2c_enabled, "i2c_enabled", 218388101u, 0, 11, NULL); -be_define_const_str(id, "id", 926444256u, 0, 2, &be_const_str_x); +be_define_const_str(get_vbus_current, "get_vbus_current", 1205347942u, 0, 16, &be_const_str_while); +be_define_const_str(get_vbus_voltage, "get_vbus_voltage", 2398210401u, 0, 16, &be_const_str_return_X20code_X3D_X25i); +be_define_const_str(get_warning_level, "get_warning_level", 1737834441u, 0, 17, &be_const_str_map); +be_define_const_str(get_width, "get_width", 3293417300u, 0, 9, NULL); +be_define_const_str(getbits, "getbits", 3094168979u, 0, 7, &be_const_str_tag); +be_define_const_str(geti, "geti", 2381006490u, 0, 4, &be_const_str_k); +be_define_const_str(global, "global", 503252654u, 0, 6, &be_const_str_widget_constructor); +be_define_const_str(gpio, "gpio", 2638155258u, 0, 4, &be_const_str_line_dsc); +be_define_const_str(group_def, "group_def", 1524213328u, 0, 9, &be_const_str_web_send); +be_define_const_str(h, "h", 3977000791u, 0, 1, &be_const_str_value_error); +be_define_const_str(has, "has", 3988721635u, 0, 3, NULL); +be_define_const_str(has_arg, "has_arg", 424878688u, 0, 7, &be_const_str_rad); +be_define_const_str(height_def, "height_def", 2348238838u, 0, 10, &be_const_str_wire2); +be_define_const_str(hex, "hex", 4273249610u, 0, 3, &be_const_str_register_obj); +be_define_const_str(hour, "hour", 3053661199u, 0, 4, &be_const_str_widget_ctor_impl); +be_define_const_str(hs2rgb, "hs2rgb", 1040816349u, 0, 6, NULL); +be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s/%s.autoconf", 2743526309u, 0, 70, NULL); +be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s_manifest.json", 3657552045u, 0, 72, NULL); +be_define_const_str(i2c_enabled, "i2c_enabled", 218388101u, 0, 11, &be_const_str_keys); +be_define_const_str(id, "id", 926444256u, 0, 2, &be_const_str_print); be_define_const_str(if, "if", 959999494u, 50, 2, NULL); -be_define_const_str(imax, "imax", 3084515410u, 0, 4, &be_const_str_resize); -be_define_const_str(imin, "imin", 2714127864u, 0, 4, NULL); +be_define_const_str(imax, "imax", 3084515410u, 0, 4, NULL); +be_define_const_str(imin, "imin", 2714127864u, 0, 4, &be_const_str_members); be_define_const_str(import, "import", 288002260u, 66, 6, NULL); -be_define_const_str(init, "init", 380752755u, 0, 4, &be_const_str_pc_rel); -be_define_const_str(init_draw_line_dsc, "init_draw_line_dsc", 2507936040u, 0, 18, NULL); -be_define_const_str(input, "input", 4191711099u, 0, 5, &be_const_str_reset); +be_define_const_str(init, "init", 380752755u, 0, 4, NULL); +be_define_const_str(init_draw_line_dsc, "init_draw_line_dsc", 2507936040u, 0, 18, &be_const_str_pop); +be_define_const_str(input, "input", 4191711099u, 0, 5, &be_const_str_json); be_define_const_str(ins_goto, "ins_goto", 1342843963u, 0, 8, NULL); -be_define_const_str(ins_ramp, "ins_ramp", 1068049360u, 0, 8, &be_const_str_stop_iteration); -be_define_const_str(ins_time, "ins_time", 2980245553u, 0, 8, NULL); -be_define_const_str(insert, "insert", 3332609576u, 0, 6, &be_const_str_lvgl_event_dispatch); -be_define_const_str(instance, "instance", 193386898u, 0, 8, &be_const_str_set_matrix_pixel_color); +be_define_const_str(ins_ramp, "ins_ramp", 1068049360u, 0, 8, &be_const_str_wire_scan); +be_define_const_str(ins_time, "ins_time", 2980245553u, 0, 8, &be_const_str_target_search); +be_define_const_str(insert, "insert", 3332609576u, 0, 6, NULL); +be_define_const_str(instance, "instance", 193386898u, 0, 8, NULL); be_define_const_str(instance_size, "instance_size", 4280269518u, 0, 13, NULL); -be_define_const_str(int, "int", 2515107422u, 0, 3, &be_const_str_set_style_text_font); -be_define_const_str(internal_error, "internal_error", 2519158169u, 0, 14, &be_const_str_width_def); -be_define_const_str(introspect, "introspect", 164638290u, 0, 10, &be_const_str_preinit); -be_define_const_str(invalidate, "invalidate", 2649734928u, 0, 10, NULL); -be_define_const_str(io_error, "io_error", 1970281036u, 0, 8, NULL); -be_define_const_str(ip, "ip", 1261996636u, 0, 2, NULL); -be_define_const_str(is_dirty, "is_dirty", 418034110u, 0, 8, &be_const_str_on); -be_define_const_str(is_first_time, "is_first_time", 275242384u, 0, 13, &be_const_str_persist); -be_define_const_str(is_running, "is_running", 2226847261u, 0, 10, &be_const_str__X7B_X7D); -be_define_const_str(isinstance, "isinstance", 3669352738u, 0, 10, &be_const_str_last_modified); -be_define_const_str(isnan, "isnan", 2981347434u, 0, 5, &be_const_str_iter); -be_define_const_str(isrunning, "isrunning", 1688182268u, 0, 9, NULL); -be_define_const_str(issubclass, "issubclass", 4078395519u, 0, 10, &be_const_str_setmember); -be_define_const_str(item, "item", 2671260646u, 0, 4, &be_const_str_json_fdump_any); -be_define_const_str(iter, "iter", 3124256359u, 0, 4, &be_const_str_name); +be_define_const_str(int, "int", 2515107422u, 0, 3, NULL); +be_define_const_str(internal_error, "internal_error", 2519158169u, 0, 14, &be_const_str_offseta); +be_define_const_str(introspect, "introspect", 164638290u, 0, 10, &be_const_str_widget_dtor_impl); +be_define_const_str(invalidate, "invalidate", 2649734928u, 0, 10, &be_const_str_no_X20GPIO_X20specified_X20for_X20neopixelbus); +be_define_const_str(io_error, "io_error", 1970281036u, 0, 8, &be_const_str_readbytes); +be_define_const_str(ip, "ip", 1261996636u, 0, 2, &be_const_str_super); +be_define_const_str(is_dirty, "is_dirty", 418034110u, 0, 8, &be_const_str_rand); +be_define_const_str(is_first_time, "is_first_time", 275242384u, 0, 13, &be_const_str_local); +be_define_const_str(is_running, "is_running", 2226847261u, 0, 10, &be_const_str_reverse); +be_define_const_str(isinstance, "isinstance", 3669352738u, 0, 10, NULL); +be_define_const_str(isnan, "isnan", 2981347434u, 0, 5, NULL); +be_define_const_str(isrunning, "isrunning", 1688182268u, 0, 9, &be_const_str_refr_size); +be_define_const_str(issubclass, "issubclass", 4078395519u, 0, 10, NULL); +be_define_const_str(item, "item", 2671260646u, 0, 4, &be_const_str_widget_editable); +be_define_const_str(iter, "iter", 3124256359u, 0, 4, &be_const_str_class); be_define_const_str(json, "json", 916562499u, 0, 4, NULL); -be_define_const_str(json_append, "json_append", 3002019284u, 0, 11, &be_const_str_import); -be_define_const_str(json_fdump, "json_fdump", 1694216580u, 0, 10, NULL); -be_define_const_str(json_fdump_any, "json_fdump_any", 3348629385u, 0, 14, NULL); -be_define_const_str(json_fdump_list, "json_fdump_list", 3903879853u, 0, 15, &be_const_str_millis); -be_define_const_str(json_fdump_map, "json_fdump_map", 4091954653u, 0, 14, &be_const_str_save_before_restart); -be_define_const_str(k, "k", 3993778410u, 0, 1, &be_const_str_keys); -be_define_const_str(keys, "keys", 4182378701u, 0, 4, &be_const_str_min); -be_define_const_str(kv, "kv", 1497177492u, 0, 2, NULL); +be_define_const_str(json_append, "json_append", 3002019284u, 0, 11, NULL); +be_define_const_str(json_fdump, "json_fdump", 1694216580u, 0, 10, &be_const_str_nil); +be_define_const_str(json_fdump_any, "json_fdump_any", 3348629385u, 0, 14, &be_const_str_pixel_size); +be_define_const_str(json_fdump_list, "json_fdump_list", 3903879853u, 0, 15, &be_const_str_json_fdump_map); +be_define_const_str(json_fdump_map, "json_fdump_map", 4091954653u, 0, 14, &be_const_str_select); +be_define_const_str(k, "k", 3993778410u, 0, 1, &be_const_str_set_auth); +be_define_const_str(keys, "keys", 4182378701u, 0, 4, NULL); +be_define_const_str(kv, "kv", 1497177492u, 0, 2, &be_const_str_persist_X2E_p_X20is_X20not_X20a_X20map); be_define_const_str(last_modified, "last_modified", 772177145u, 0, 13, NULL); -be_define_const_str(leds, "leds", 558858555u, 0, 4, &be_const_str_elif); -be_define_const_str(length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032, "length in bits must be between 0 and 32", 2584509128u, 0, 39, &be_const_str_false); +be_define_const_str(leds, "leds", 558858555u, 0, 4, &be_const_str__X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); +be_define_const_str(length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032, "length in bits must be between 0 and 32", 2584509128u, 0, 39, &be_const_str_lv_event); be_define_const_str(light, "light", 3801947695u, 0, 5, NULL); -be_define_const_str(line_dsc, "line_dsc", 4094490978u, 0, 8, &be_const_str_print); +be_define_const_str(line_dsc, "line_dsc", 4094490978u, 0, 8, &be_const_str_offset); be_define_const_str(list, "list", 217798785u, 0, 4, NULL); be_define_const_str(listdir, "listdir", 2005220720u, 0, 7, NULL); be_define_const_str(load, "load", 3859241449u, 0, 4, NULL); -be_define_const_str(load_templates, "load_templates", 3513870133u, 0, 14, &be_const_str_set_bri); -be_define_const_str(local, "local", 2621662984u, 0, 5, NULL); -be_define_const_str(log, "log", 1062293841u, 0, 3, &be_const_str_the_X20second_X20argument_X20is_X20not_X20a_X20function); -be_define_const_str(log10, "log10", 2346846000u, 0, 5, &be_const_str_web_add_handler); -be_define_const_str(loop, "loop", 3723446379u, 0, 4, &be_const_str_continue); -be_define_const_str(lower, "lower", 3038577850u, 0, 5, &be_const_str_push_path); -be_define_const_str(lv, "lv", 1529997255u, 0, 2, NULL); -be_define_const_str(lv_event, "lv_event", 2434089968u, 0, 8, &be_const_str_set_timer); -be_define_const_str(lv_event_cb, "lv_event_cb", 2480731016u, 0, 11, &be_const_str_try_rule); -be_define_const_str(lv_obj, "lv_obj", 4257833149u, 0, 6, NULL); +be_define_const_str(load_templates, "load_templates", 3513870133u, 0, 14, NULL); +be_define_const_str(local, "local", 2621662984u, 0, 5, &be_const_str_round_start); +be_define_const_str(log, "log", 1062293841u, 0, 3, &be_const_str_read_sensors); +be_define_const_str(log10, "log10", 2346846000u, 0, 5, NULL); +be_define_const_str(loop, "loop", 3723446379u, 0, 4, NULL); +be_define_const_str(lower, "lower", 3038577850u, 0, 5, &be_const_str_end); +be_define_const_str(lv, "lv", 1529997255u, 0, 2, &be_const_str_x); +be_define_const_str(lv_event, "lv_event", 2434089968u, 0, 8, &be_const_str_remove_rule); +be_define_const_str(lv_event_cb, "lv_event_cb", 2480731016u, 0, 11, &be_const_str_run_deferred); +be_define_const_str(lv_obj, "lv_obj", 4257833149u, 0, 6, &be_const_str_traceback); be_define_const_str(lv_obj_class, "lv_obj_class", 4039656294u, 0, 12, NULL); -be_define_const_str(lvgl_event_dispatch, "lvgl_event_dispatch", 2104396622u, 0, 19, &be_const_str_rule); -be_define_const_str(map, "map", 3751997361u, 0, 3, NULL); -be_define_const_str(math, "math", 4001929615u, 0, 4, &be_const_str_widget_event_cb); -be_define_const_str(matrix, "matrix", 365099244u, 0, 6, &be_const_str_pixels_buffer); -be_define_const_str(member, "member", 719708611u, 0, 6, &be_const_str_web_add_management_button); -be_define_const_str(members, "members", 937576464u, 0, 7, &be_const_str_remove_rule); -be_define_const_str(memory, "memory", 2229924270u, 0, 6, NULL); -be_define_const_str(millis, "millis", 1214679063u, 0, 6, &be_const_str_module); -be_define_const_str(min, "min", 3381609815u, 0, 3, NULL); +be_define_const_str(lvgl_event_dispatch, "lvgl_event_dispatch", 2104396622u, 0, 19, &be_const_str_set_matrix_pixel_color); +be_define_const_str(map, "map", 3751997361u, 0, 3, &be_const_str_redirect); +be_define_const_str(math, "math", 4001929615u, 0, 4, NULL); +be_define_const_str(matrix, "matrix", 365099244u, 0, 6, NULL); +be_define_const_str(member, "member", 719708611u, 0, 6, NULL); +be_define_const_str(members, "members", 937576464u, 0, 7, &be_const_str_target); +be_define_const_str(memory, "memory", 2229924270u, 0, 6, &be_const_str_resp_cmnd_str); +be_define_const_str(millis, "millis", 1214679063u, 0, 6, NULL); +be_define_const_str(min, "min", 3381609815u, 0, 3, &be_const_str_widget_cb); be_define_const_str(minute, "minute", 954666857u, 0, 6, NULL); -be_define_const_str(module, "module", 3617558685u, 0, 6, &be_const_str_setrange); -be_define_const_str(month, "month", 3598321157u, 0, 5, &be_const_str_web_send); +be_define_const_str(module, "module", 3617558685u, 0, 6, &be_const_str_percentage); +be_define_const_str(month, "month", 3598321157u, 0, 5, NULL); be_define_const_str(name, "name", 2369371622u, 0, 4, NULL); -be_define_const_str(nan, "nan", 797905850u, 0, 3, &be_const_str_size); +be_define_const_str(nan, "nan", 797905850u, 0, 3, NULL); be_define_const_str(nil, "nil", 228849900u, 63, 3, NULL); -be_define_const_str(no_X20GPIO_X20specified_X20for_X20neopixelbus, "no GPIO specified for neopixelbus", 42078528u, 0, 33, NULL); -be_define_const_str(null_cb, "null_cb", 2333536460u, 0, 7, NULL); -be_define_const_str(number, "number", 467038368u, 0, 6, &be_const_str_range); -be_define_const_str(obj_class_create_obj, "obj_class_create_obj", 3304390632u, 0, 20, NULL); +be_define_const_str(no_X20GPIO_X20specified_X20for_X20neopixelbus, "no GPIO specified for neopixelbus", 42078528u, 0, 33, &be_const_str_number); +be_define_const_str(null_cb, "null_cb", 2333536460u, 0, 7, &be_const_str_public_key); +be_define_const_str(number, "number", 467038368u, 0, 6, NULL); +be_define_const_str(obj_class_create_obj, "obj_class_create_obj", 3304390632u, 0, 20, &be_const_str_write_bytes); be_define_const_str(obj_event_base, "obj_event_base", 1624064363u, 0, 14, NULL); -be_define_const_str(offset, "offset", 348705738u, 0, 6, &be_const_str_web_add_button); +be_define_const_str(offset, "offset", 348705738u, 0, 6, &be_const_str_sec); be_define_const_str(offseta, "offseta", 1663383089u, 0, 7, NULL); -be_define_const_str(on, "on", 1630810064u, 0, 2, &be_const_str_webclient); -be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will cause a restart.\");'>", 232646018u, 0, 57, &be_const_str_wire2); -be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will change the current configuration and cause a restart.\");'>", 3792412559u, 0, 94, &be_const_str_srand); -be_define_const_str(open, "open", 3546203337u, 0, 4, &be_const_str_search); +be_define_const_str(on, "on", 1630810064u, 0, 2, NULL); +be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will cause a restart.\");'>", 232646018u, 0, 57, NULL); +be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will change the current configuration and cause a restart.\");'>", 3792412559u, 0, 94, &be_const_str_sqrt); +be_define_const_str(open, "open", 3546203337u, 0, 4, NULL); be_define_const_str(out_X20of_X20range, "out of range", 2236631477u, 0, 12, NULL); -be_define_const_str(p1, "p1", 2689521274u, 0, 2, NULL); -be_define_const_str(p2, "p2", 2672743655u, 0, 2, &be_const_str_set_alternate); -be_define_const_str(page_autoconf_ctl, "page_autoconf_ctl", 2453381496u, 0, 17, NULL); -be_define_const_str(page_autoconf_mgr, "page_autoconf_mgr", 3643937031u, 0, 17, &be_const_str_write8); -be_define_const_str(param, "param", 1309554226u, 0, 5, &be_const_str_resp_cmnd_error); -be_define_const_str(path, "path", 2223459638u, 0, 4, &be_const_str_real); -be_define_const_str(pc, "pc", 1313756516u, 0, 2, &be_const_str_nil); -be_define_const_str(pc_abs, "pc_abs", 920256495u, 0, 6, &be_const_str_set); -be_define_const_str(pc_rel, "pc_rel", 991921176u, 0, 6, &be_const_str_web_add_config_button); -be_define_const_str(percentage, "percentage", 2538831285u, 0, 10, &be_const_str_tcpclient); +be_define_const_str(p1, "p1", 2689521274u, 0, 2, &be_const_str_widget_event_cb); +be_define_const_str(p2, "p2", 2672743655u, 0, 2, NULL); +be_define_const_str(page_autoconf_ctl, "page_autoconf_ctl", 2453381496u, 0, 17, &be_const_str_pc_rel); +be_define_const_str(page_autoconf_mgr, "page_autoconf_mgr", 3643937031u, 0, 17, &be_const_str_reduce); +be_define_const_str(param, "param", 1309554226u, 0, 5, &be_const_str_set_dcdc_enable); +be_define_const_str(path, "path", 2223459638u, 0, 4, &be_const_str_pop_path); +be_define_const_str(pc, "pc", 1313756516u, 0, 2, &be_const_str_zip); +be_define_const_str(pc_abs, "pc_abs", 920256495u, 0, 6, NULL); +be_define_const_str(pc_rel, "pc_rel", 991921176u, 0, 6, NULL); +be_define_const_str(percentage, "percentage", 2538831285u, 0, 10, &be_const_str_web_add_config_button); be_define_const_str(persist, "persist", 3917083779u, 0, 7, NULL); -be_define_const_str(persist_X2E_p_X20is_X20not_X20a_X20map, "persist._p is not a map", 1176528732u, 0, 23, NULL); -be_define_const_str(pi, "pi", 1213090802u, 0, 2, NULL); -be_define_const_str(pin, "pin", 1866532500u, 0, 3, NULL); -be_define_const_str(pin_mode, "pin_mode", 3258314030u, 0, 8, &be_const_str_set_ldo_voltage); -be_define_const_str(pin_used, "pin_used", 4033854612u, 0, 8, &be_const_str_set_auth); +be_define_const_str(persist_X2E_p_X20is_X20not_X20a_X20map, "persist._p is not a map", 1176528732u, 0, 23, &be_const_str_publish_result); +be_define_const_str(pi, "pi", 1213090802u, 0, 2, &be_const_str_set_alternate); +be_define_const_str(pin, "pin", 1866532500u, 0, 3, &be_const_str_running); +be_define_const_str(pin_mode, "pin_mode", 3258314030u, 0, 8, &be_const_str_set_first_time); +be_define_const_str(pin_used, "pin_used", 4033854612u, 0, 8, &be_const_str_reapply); be_define_const_str(pixel_count, "pixel_count", 2439130743u, 0, 11, NULL); be_define_const_str(pixel_size, "pixel_size", 2209135785u, 0, 10, NULL); be_define_const_str(pixels_buffer, "pixels_buffer", 1229555807u, 0, 13, NULL); -be_define_const_str(point, "point", 414084241u, 0, 5, NULL); -be_define_const_str(pop, "pop", 1362321360u, 0, 3, &be_const_str_resp_cmnd_failed); +be_define_const_str(point, "point", 414084241u, 0, 5, &be_const_str_setmember); +be_define_const_str(pop, "pop", 1362321360u, 0, 3, NULL); be_define_const_str(pop_path, "pop_path", 2403243998u, 0, 8, NULL); -be_define_const_str(pow, "pow", 1479764693u, 0, 3, &be_const_str_seg7_font); -be_define_const_str(preinit, "preinit", 2722007100u, 0, 7, &be_const_str_widget_ctor_cb); -be_define_const_str(print, "print", 372738696u, 0, 5, NULL); -be_define_const_str(public_key, "public_key", 4169142980u, 0, 10, &be_const_str_read32); -be_define_const_str(publish, "publish", 264247304u, 0, 7, NULL); -be_define_const_str(publish_result, "publish_result", 2013351252u, 0, 14, &be_const_str_skip); -be_define_const_str(push, "push", 2272264157u, 0, 4, &be_const_str_width); +be_define_const_str(pow, "pow", 1479764693u, 0, 3, NULL); +be_define_const_str(preinit, "preinit", 2722007100u, 0, 7, NULL); +be_define_const_str(print, "print", 372738696u, 0, 5, &be_const_str_else); +be_define_const_str(public_key, "public_key", 4169142980u, 0, 10, &be_const_str_continue); +be_define_const_str(publish, "publish", 264247304u, 0, 7, &be_const_str_web_add_main_button); +be_define_const_str(publish_result, "publish_result", 2013351252u, 0, 14, &be_const_str_set_x); +be_define_const_str(push, "push", 2272264157u, 0, 4, &be_const_str_stop); be_define_const_str(push_path, "push_path", 1155254157u, 0, 9, NULL); -be_define_const_str(quality, "quality", 2597670950u, 0, 7, &be_const_str_else); -be_define_const_str(r, "r", 4144776981u, 0, 1, &be_const_str_set_light); -be_define_const_str(rad, "rad", 1358899048u, 0, 3, &be_const_str_set_ldo_enable); +be_define_const_str(quality, "quality", 2597670950u, 0, 7, NULL); +be_define_const_str(r, "r", 4144776981u, 0, 1, &be_const_str_tele); +be_define_const_str(rad, "rad", 1358899048u, 0, 3, NULL); be_define_const_str(raise, "raise", 1593437475u, 70, 5, NULL); be_define_const_str(rand, "rand", 2711325910u, 0, 4, NULL); -be_define_const_str(range, "range", 4208725202u, 0, 5, &be_const_str_reverse_gamma10); +be_define_const_str(range, "range", 4208725202u, 0, 5, &be_const_str_web_add_handler); be_define_const_str(read, "read", 3470762949u, 0, 4, NULL); be_define_const_str(read12, "read12", 4291076970u, 0, 6, NULL); -be_define_const_str(read13, "read13", 12887293u, 0, 6, NULL); +be_define_const_str(read13, "read13", 12887293u, 0, 6, &be_const_str_set_timer); be_define_const_str(read24, "read24", 1808533811u, 0, 6, NULL); -be_define_const_str(read32, "read32", 1741276240u, 0, 6, NULL); -be_define_const_str(read8, "read8", 2802788167u, 0, 5, NULL); -be_define_const_str(read_bytes, "read_bytes", 3576733173u, 0, 10, NULL); -be_define_const_str(read_sensors, "read_sensors", 892689201u, 0, 12, &be_const_str_round_end); -be_define_const_str(readbytes, "readbytes", 2716426756u, 0, 9, NULL); -be_define_const_str(readline, "readline", 1212709927u, 0, 8, NULL); -be_define_const_str(real, "real", 3604983901u, 0, 4, NULL); +be_define_const_str(read32, "read32", 1741276240u, 0, 6, &be_const_str_break); +be_define_const_str(read8, "read8", 2802788167u, 0, 5, &be_const_str_readline); +be_define_const_str(read_bytes, "read_bytes", 3576733173u, 0, 10, &be_const_str_type); +be_define_const_str(read_sensors, "read_sensors", 892689201u, 0, 12, NULL); +be_define_const_str(readbytes, "readbytes", 2716426756u, 0, 9, &be_const_str_show); +be_define_const_str(readline, "readline", 1212709927u, 0, 8, &be_const_str_solidified); +be_define_const_str(real, "real", 3604983901u, 0, 4, &be_const_str__X7B_X7D); be_define_const_str(reapply, "reapply", 3778939332u, 0, 7, NULL); -be_define_const_str(redirect, "redirect", 389758641u, 0, 8, &be_const_str_rtc); -be_define_const_str(reduce, "reduce", 2002030311u, 0, 6, &be_const_str_sec); -be_define_const_str(refr_size, "refr_size", 1958144468u, 0, 9, &be_const_str_target_search); -be_define_const_str(register_obj, "register_obj", 3982614770u, 0, 12, &be_const_str_sys); +be_define_const_str(redirect, "redirect", 389758641u, 0, 8, NULL); +be_define_const_str(reduce, "reduce", 2002030311u, 0, 6, NULL); +be_define_const_str(refr_size, "refr_size", 1958144468u, 0, 9, NULL); +be_define_const_str(register_obj, "register_obj", 3982614770u, 0, 12, NULL); be_define_const_str(remove, "remove", 3683784189u, 0, 6, NULL); be_define_const_str(remove_cmd, "remove_cmd", 3832315702u, 0, 10, NULL); -be_define_const_str(remove_driver, "remove_driver", 1030243768u, 0, 13, &be_const_str_tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29); -be_define_const_str(remove_rule, "remove_rule", 3456211328u, 0, 11, &be_const_str_except); +be_define_const_str(remove_driver, "remove_driver", 1030243768u, 0, 13, &be_const_str_string); +be_define_const_str(remove_rule, "remove_rule", 3456211328u, 0, 11, NULL); be_define_const_str(remove_timer, "remove_timer", 4141472215u, 0, 12, NULL); be_define_const_str(reset, "reset", 1695364032u, 0, 5, NULL); -be_define_const_str(reset_search, "reset_search", 1350414305u, 0, 12, NULL); +be_define_const_str(reset_search, "reset_search", 1350414305u, 0, 12, &be_const_str_widget_destructor); be_define_const_str(resize, "resize", 3514612129u, 0, 6, NULL); be_define_const_str(resolvecmnd, "resolvecmnd", 993361485u, 0, 11, NULL); -be_define_const_str(resp_cmnd, "resp_cmnd", 2869459626u, 0, 9, &be_const_str_widget_editable); -be_define_const_str(resp_cmnd_done, "resp_cmnd_done", 2601874875u, 0, 14, NULL); +be_define_const_str(resp_cmnd, "resp_cmnd", 2869459626u, 0, 9, &be_const_str_web_add_management_button); +be_define_const_str(resp_cmnd_done, "resp_cmnd_done", 2601874875u, 0, 14, &be_const_str_raise); be_define_const_str(resp_cmnd_error, "resp_cmnd_error", 2404088863u, 0, 15, NULL); -be_define_const_str(resp_cmnd_failed, "resp_cmnd_failed", 2136281562u, 0, 16, &be_const_str_set_chg_current); +be_define_const_str(resp_cmnd_failed, "resp_cmnd_failed", 2136281562u, 0, 16, NULL); be_define_const_str(resp_cmnd_str, "resp_cmnd_str", 737845590u, 0, 13, NULL); -be_define_const_str(response_append, "response_append", 450346371u, 0, 15, &be_const_str_set_first_time); +be_define_const_str(response_append, "response_append", 450346371u, 0, 15, NULL); be_define_const_str(return, "return", 2246981567u, 60, 6, NULL); -be_define_const_str(return_X20code_X3D_X25i, "return code=%i", 2127454401u, 0, 14, NULL); -be_define_const_str(reverse, "reverse", 558918661u, 0, 7, NULL); -be_define_const_str(reverse_gamma10, "reverse_gamma10", 739112262u, 0, 15, NULL); +be_define_const_str(return_X20code_X3D_X25i, "return code=%i", 2127454401u, 0, 14, &be_const_str_set_ldo_enable); +be_define_const_str(reverse, "reverse", 558918661u, 0, 7, &be_const_str_sin); +be_define_const_str(reverse_gamma10, "reverse_gamma10", 739112262u, 0, 15, &be_const_str_to_gamma); be_define_const_str(rotate, "rotate", 2784296202u, 0, 6, NULL); -be_define_const_str(round_end, "round_end", 985288225u, 0, 9, &be_const_str_strftime); -be_define_const_str(round_start, "round_start", 2949484384u, 0, 11, &be_const_str_sqrt); -be_define_const_str(rtc, "rtc", 1070575216u, 0, 3, NULL); -be_define_const_str(rule, "rule", 4230889683u, 0, 4, &be_const_str_settings); -be_define_const_str(run, "run", 718098122u, 0, 3, &be_const_str_set_style_line_color); -be_define_const_str(run_bat, "run_bat", 2536903298u, 0, 7, &be_const_str_valuer_error); +be_define_const_str(round_end, "round_end", 985288225u, 0, 9, NULL); +be_define_const_str(round_start, "round_start", 2949484384u, 0, 11, &be_const_str_wire); +be_define_const_str(rtc, "rtc", 1070575216u, 0, 3, &be_const_str_settings); +be_define_const_str(rule, "rule", 4230889683u, 0, 4, NULL); +be_define_const_str(run, "run", 718098122u, 0, 3, NULL); +be_define_const_str(run_bat, "run_bat", 2536903298u, 0, 7, NULL); be_define_const_str(run_deferred, "run_deferred", 371594696u, 0, 12, NULL); -be_define_const_str(running, "running", 343848780u, 0, 7, &be_const_str_string); -be_define_const_str(save, "save", 3439296072u, 0, 4, NULL); +be_define_const_str(running, "running", 343848780u, 0, 7, NULL); +be_define_const_str(save, "save", 3439296072u, 0, 4, &be_const_str_tanh); be_define_const_str(save_before_restart, "save_before_restart", 1253239338u, 0, 19, NULL); -be_define_const_str(scale_uint, "scale_uint", 3090811094u, 0, 10, &be_const_str_widget_group_def); -be_define_const_str(scan, "scan", 3974641896u, 0, 4, NULL); +be_define_const_str(scale_uint, "scale_uint", 3090811094u, 0, 10, &be_const_str_set_style_pad_right); +be_define_const_str(scan, "scan", 3974641896u, 0, 4, &be_const_str_set_dc_voltage); be_define_const_str(search, "search", 2150836393u, 0, 6, NULL); be_define_const_str(sec, "sec", 3139892658u, 0, 3, NULL); -be_define_const_str(seg7_font, "seg7_font", 4099690689u, 0, 9, &be_const_str_set_useragent); +be_define_const_str(seg7_font, "seg7_font", 4099690689u, 0, 9, NULL); be_define_const_str(select, "select", 297952813u, 0, 6, NULL); -be_define_const_str(serial, "serial", 3687697785u, 0, 6, NULL); +be_define_const_str(serial, "serial", 3687697785u, 0, 6, &be_const_str_url_encode); be_define_const_str(set, "set", 3324446467u, 0, 3, NULL); -be_define_const_str(set_alternate, "set_alternate", 1709680562u, 0, 13, &be_const_str_widget_event); -be_define_const_str(set_auth, "set_auth", 1057170930u, 0, 8, &be_const_str_update); -be_define_const_str(set_bri, "set_bri", 2789118779u, 0, 7, &be_const_str_str); +be_define_const_str(set_alternate, "set_alternate", 1709680562u, 0, 13, &be_const_str_widget_struct_by_class); +be_define_const_str(set_auth, "set_auth", 1057170930u, 0, 8, NULL); +be_define_const_str(set_bri, "set_bri", 2789118779u, 0, 7, &be_const_str_wire1); be_define_const_str(set_chg_current, "set_chg_current", 336304386u, 0, 15, NULL); -be_define_const_str(set_dc_voltage, "set_dc_voltage", 2181981936u, 0, 14, NULL); -be_define_const_str(set_dcdc_enable, "set_dcdc_enable", 1594690786u, 0, 15, &be_const_str_class); -be_define_const_str(set_first_time, "set_first_time", 3111247550u, 0, 14, &be_const_str_tan); -be_define_const_str(set_height, "set_height", 1080207399u, 0, 10, NULL); +be_define_const_str(set_dc_voltage, "set_dc_voltage", 2181981936u, 0, 14, &be_const_str_toupper); +be_define_const_str(set_dcdc_enable, "set_dcdc_enable", 1594690786u, 0, 15, &be_const_str_tomap); +be_define_const_str(set_first_time, "set_first_time", 3111247550u, 0, 14, NULL); +be_define_const_str(set_height, "set_height", 1080207399u, 0, 10, &be_const_str_width_def); be_define_const_str(set_ldo_enable, "set_ldo_enable", 2916502041u, 0, 14, NULL); -be_define_const_str(set_ldo_voltage, "set_ldo_voltage", 4090501160u, 0, 15, NULL); -be_define_const_str(set_light, "set_light", 3176076152u, 0, 9, NULL); +be_define_const_str(set_ldo_voltage, "set_ldo_voltage", 4090501160u, 0, 15, &be_const_str_tob64); +be_define_const_str(set_light, "set_light", 3176076152u, 0, 9, &be_const_str_setrange); be_define_const_str(set_matrix_pixel_color, "set_matrix_pixel_color", 1197149462u, 0, 22, NULL); -be_define_const_str(set_percentage, "set_percentage", 2952022724u, 0, 14, &be_const_str__X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); +be_define_const_str(set_percentage, "set_percentage", 2952022724u, 0, 14, NULL); be_define_const_str(set_pixel_color, "set_pixel_color", 1275248356u, 0, 15, NULL); -be_define_const_str(set_power, "set_power", 549820893u, 0, 9, &be_const_str_v); +be_define_const_str(set_power, "set_power", 549820893u, 0, 9, &be_const_str_widget_height_def); be_define_const_str(set_style_bg_color, "set_style_bg_color", 1689513089u, 0, 18, NULL); be_define_const_str(set_style_line_color, "set_style_line_color", 3665238976u, 0, 20, NULL); be_define_const_str(set_style_pad_right, "set_style_pad_right", 3314069054u, 0, 19, NULL); -be_define_const_str(set_style_text_font, "set_style_text_font", 1028590019u, 0, 19, &be_const_str_widget_ctor_impl); +be_define_const_str(set_style_text_font, "set_style_text_font", 1028590019u, 0, 19, NULL); be_define_const_str(set_text, "set_text", 1849641155u, 0, 8, NULL); -be_define_const_str(set_time, "set_time", 900236405u, 0, 8, &be_const_str_if); -be_define_const_str(set_timeouts, "set_timeouts", 3732850900u, 0, 12, NULL); -be_define_const_str(set_timer, "set_timer", 2135414533u, 0, 9, &be_const_str_for); +be_define_const_str(set_time, "set_time", 900236405u, 0, 8, NULL); +be_define_const_str(set_timeouts, "set_timeouts", 3732850900u, 0, 12, &be_const_str_import); +be_define_const_str(set_timer, "set_timer", 2135414533u, 0, 9, NULL); be_define_const_str(set_useragent, "set_useragent", 612237244u, 0, 13, NULL); -be_define_const_str(set_width, "set_width", 484671920u, 0, 9, NULL); -be_define_const_str(set_x, "set_x", 1849400772u, 0, 5, &be_const_str_var); -be_define_const_str(set_y, "set_y", 1866178391u, 0, 5, &be_const_str_raise); -be_define_const_str(setbits, "setbits", 2762408167u, 0, 7, &be_const_str_super); +be_define_const_str(set_width, "set_width", 484671920u, 0, 9, &be_const_str__X7D); +be_define_const_str(set_x, "set_x", 1849400772u, 0, 5, &be_const_str_def); +be_define_const_str(set_y, "set_y", 1866178391u, 0, 5, NULL); +be_define_const_str(setbits, "setbits", 2762408167u, 0, 7, NULL); be_define_const_str(seti, "seti", 1500556254u, 0, 4, NULL); be_define_const_str(setitem, "setitem", 1554834596u, 0, 7, NULL); -be_define_const_str(setmember, "setmember", 1432909441u, 0, 9, NULL); +be_define_const_str(setmember, "setmember", 1432909441u, 0, 9, &be_const_str_strptime); be_define_const_str(setrange, "setrange", 3794019032u, 0, 8, NULL); be_define_const_str(settings, "settings", 1745255176u, 0, 8, NULL); -be_define_const_str(shared_key, "shared_key", 2200833624u, 0, 10, NULL); -be_define_const_str(show, "show", 2840060476u, 0, 4, NULL); -be_define_const_str(sin, "sin", 3761252941u, 0, 3, &be_const_str_widget_constructor); -be_define_const_str(sinh, "sinh", 282220607u, 0, 4, NULL); -be_define_const_str(size, "size", 597743964u, 0, 4, &be_const_str_top); -be_define_const_str(skip, "skip", 1097563074u, 0, 4, &be_const_str_tr); +be_define_const_str(shared_key, "shared_key", 2200833624u, 0, 10, &be_const_str_wifi); +be_define_const_str(show, "show", 2840060476u, 0, 4, &be_const_str_y); +be_define_const_str(sin, "sin", 3761252941u, 0, 3, NULL); +be_define_const_str(sinh, "sinh", 282220607u, 0, 4, &be_const_str_tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29); +be_define_const_str(size, "size", 597743964u, 0, 4, NULL); +be_define_const_str(skip, "skip", 1097563074u, 0, 4, NULL); be_define_const_str(solidified, "solidified", 3257553487u, 0, 10, NULL); -be_define_const_str(split, "split", 2276994531u, 0, 5, &be_const_str__X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); -be_define_const_str(sqrt, "sqrt", 2112764879u, 0, 4, &be_const_str_widget_cb); +be_define_const_str(split, "split", 2276994531u, 0, 5, &be_const_str_strftime); +be_define_const_str(sqrt, "sqrt", 2112764879u, 0, 4, NULL); be_define_const_str(srand, "srand", 465518633u, 0, 5, NULL); be_define_const_str(start, "start", 1697318111u, 0, 5, NULL); be_define_const_str(state, "state", 2016490230u, 0, 5, NULL); @@ -641,42 +641,43 @@ be_define_const_str(str, "str", 3259748752u, 0, 3, NULL); be_define_const_str(strftime, "strftime", 187738851u, 0, 8, NULL); be_define_const_str(string, "string", 398550328u, 0, 6, NULL); be_define_const_str(strip, "strip", 4246411473u, 0, 5, NULL); -be_define_const_str(super, "super", 4152230356u, 0, 5, NULL); +be_define_const_str(strptime, "strptime", 1277910361u, 0, 8, &be_const_str_unknown_X20instruction); +be_define_const_str(super, "super", 4152230356u, 0, 5, &be_const_str_year); be_define_const_str(sys, "sys", 3277365014u, 0, 3, NULL); -be_define_const_str(tag, "tag", 2516003219u, 0, 3, NULL); +be_define_const_str(tag, "tag", 2516003219u, 0, 3, &be_const_str_widget_instance_size); be_define_const_str(tan, "tan", 2633446552u, 0, 3, NULL); -be_define_const_str(tanh, "tanh", 153638352u, 0, 4, &be_const_str__X7B); -be_define_const_str(target, "target", 845187144u, 0, 6, &be_const_str_widget_width_def); -be_define_const_str(target_search, "target_search", 1947846553u, 0, 13, &be_const_str_url_encode); -be_define_const_str(tasmota, "tasmota", 424643812u, 0, 7, &be_const_str_value_error); -be_define_const_str(tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29, "tasmota.get_light() is deprecated, use light.get()", 3525753647u, 0, 50, &be_const_str_while); +be_define_const_str(tanh, "tanh", 153638352u, 0, 4, NULL); +be_define_const_str(target, "target", 845187144u, 0, 6, NULL); +be_define_const_str(target_search, "target_search", 1947846553u, 0, 13, NULL); +be_define_const_str(tasmota, "tasmota", 424643812u, 0, 7, NULL); +be_define_const_str(tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29, "tasmota.get_light() is deprecated, use light.get()", 3525753647u, 0, 50, NULL); be_define_const_str(tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29, "tasmota.set_light() is deprecated, use light.set()", 2124937871u, 0, 50, NULL); be_define_const_str(tcpclient, "tcpclient", 3828797983u, 0, 9, NULL); -be_define_const_str(tele, "tele", 3474458061u, 0, 4, &be_const_str_time_dump); +be_define_const_str(tele, "tele", 3474458061u, 0, 4, NULL); be_define_const_str(the_X20second_X20argument_X20is_X20not_X20a_X20function, "the second argument is not a function", 3954574469u, 0, 37, NULL); be_define_const_str(time_dump, "time_dump", 3330410747u, 0, 9, NULL); -be_define_const_str(time_reached, "time_reached", 2075136773u, 0, 12, &be_const_str__X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); -be_define_const_str(time_str, "time_str", 2613827612u, 0, 8, NULL); -be_define_const_str(to_gamma, "to_gamma", 1597139862u, 0, 8, &be_const_str_value); +be_define_const_str(time_reached, "time_reached", 2075136773u, 0, 12, NULL); +be_define_const_str(time_str, "time_str", 2613827612u, 0, 8, &be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D); +be_define_const_str(to_gamma, "to_gamma", 1597139862u, 0, 8, NULL); be_define_const_str(tob64, "tob64", 373777640u, 0, 5, NULL); be_define_const_str(tolower, "tolower", 1042520049u, 0, 7, NULL); be_define_const_str(tomap, "tomap", 612167626u, 0, 5, NULL); be_define_const_str(top, "top", 2802900028u, 0, 3, NULL); be_define_const_str(toptr, "toptr", 3379847454u, 0, 5, NULL); be_define_const_str(tostring, "tostring", 2299708645u, 0, 8, NULL); -be_define_const_str(toupper, "toupper", 3691983576u, 0, 7, &be_const_str_webserver); +be_define_const_str(toupper, "toupper", 3691983576u, 0, 7, NULL); be_define_const_str(tr, "tr", 1195724803u, 0, 2, NULL); -be_define_const_str(traceback, "traceback", 3385188109u, 0, 9, NULL); +be_define_const_str(traceback, "traceback", 3385188109u, 0, 9, &be_const_str_as); be_define_const_str(true, "true", 1303515621u, 61, 4, NULL); be_define_const_str(try, "try", 2887626766u, 68, 3, NULL); -be_define_const_str(try_rule, "try_rule", 1986449405u, 0, 8, NULL); +be_define_const_str(try_rule, "try_rule", 1986449405u, 0, 8, &be_const_str_widget_dtor_cb); be_define_const_str(type, "type", 1361572173u, 0, 4, NULL); -be_define_const_str(unknown_X20instruction, "unknown instruction", 1093911841u, 0, 19, NULL); +be_define_const_str(unknown_X20instruction, "unknown instruction", 1093911841u, 0, 19, &be_const_str_widget_event_impl); be_define_const_str(update, "update", 672109684u, 0, 6, NULL); be_define_const_str(upper, "upper", 176974407u, 0, 5, NULL); be_define_const_str(url_encode, "url_encode", 528392145u, 0, 10, NULL); -be_define_const_str(v, "v", 4077666505u, 0, 1, NULL); -be_define_const_str(value, "value", 1113510858u, 0, 5, NULL); +be_define_const_str(v, "v", 4077666505u, 0, 1, &be_const_str_valuer_error); +be_define_const_str(value, "value", 1113510858u, 0, 5, &be_const_str_web_add_button); be_define_const_str(value_error, "value_error", 773297791u, 0, 11, NULL); be_define_const_str(valuer_error, "valuer_error", 2567947105u, 0, 12, NULL); be_define_const_str(var, "var", 2317739966u, 64, 3, NULL); @@ -687,21 +688,21 @@ be_define_const_str(web_add_config_button, "web_add_config_button", 639674325u, be_define_const_str(web_add_console_button, "web_add_console_button", 3481436192u, 0, 22, NULL); be_define_const_str(web_add_handler, "web_add_handler", 3990174962u, 0, 15, NULL); be_define_const_str(web_add_main_button, "web_add_main_button", 3960367664u, 0, 19, NULL); -be_define_const_str(web_add_management_button, "web_add_management_button", 2738877186u, 0, 25, &be_const_str_do); +be_define_const_str(web_add_management_button, "web_add_management_button", 2738877186u, 0, 25, &be_const_str_webclient); be_define_const_str(web_send, "web_send", 2989941448u, 0, 8, NULL); be_define_const_str(web_send_decimal, "web_send_decimal", 1407210204u, 0, 16, NULL); -be_define_const_str(web_sensor, "web_sensor", 2900096972u, 0, 10, &be_const_str_write_gpio); +be_define_const_str(web_sensor, "web_sensor", 2900096972u, 0, 10, &be_const_str_do); be_define_const_str(webclient, "webclient", 4076389146u, 0, 9, NULL); be_define_const_str(webserver, "webserver", 1572454038u, 0, 9, NULL); be_define_const_str(while, "while", 231090382u, 53, 5, NULL); -be_define_const_str(widget_cb, "widget_cb", 2763583055u, 0, 9, NULL); -be_define_const_str(widget_constructor, "widget_constructor", 2543785934u, 0, 18, NULL); -be_define_const_str(widget_ctor_cb, "widget_ctor_cb", 876007560u, 0, 14, NULL); -be_define_const_str(widget_ctor_impl, "widget_ctor_impl", 194252479u, 0, 16, NULL); +be_define_const_str(widget_cb, "widget_cb", 2763583055u, 0, 9, &be_const_str_width); +be_define_const_str(widget_constructor, "widget_constructor", 2543785934u, 0, 18, &be_const_str_yield); +be_define_const_str(widget_ctor_cb, "widget_ctor_cb", 876007560u, 0, 14, &be_const_str_for); +be_define_const_str(widget_ctor_impl, "widget_ctor_impl", 194252479u, 0, 16, &be_const_str_write_file); be_define_const_str(widget_destructor, "widget_destructor", 4207388345u, 0, 17, NULL); be_define_const_str(widget_dtor_cb, "widget_dtor_cb", 3151545845u, 0, 14, NULL); be_define_const_str(widget_dtor_impl, "widget_dtor_impl", 520430610u, 0, 16, NULL); -be_define_const_str(widget_editable, "widget_editable", 3821793286u, 0, 15, NULL); +be_define_const_str(widget_editable, "widget_editable", 3821793286u, 0, 15, &be_const_str_try); be_define_const_str(widget_event, "widget_event", 1951408186u, 0, 12, NULL); be_define_const_str(widget_event_cb, "widget_event_cb", 1508466754u, 0, 15, NULL); be_define_const_str(widget_event_impl, "widget_event_impl", 2178430561u, 0, 17, NULL); @@ -715,15 +716,15 @@ be_define_const_str(width, "width", 2508680735u, 0, 5, NULL); be_define_const_str(width_def, "width_def", 1143717879u, 0, 9, NULL); be_define_const_str(wifi, "wifi", 120087624u, 0, 4, NULL); be_define_const_str(wire, "wire", 4082753944u, 0, 4, NULL); -be_define_const_str(wire1, "wire1", 3212721419u, 0, 5, &be_const_str_true); +be_define_const_str(wire1, "wire1", 3212721419u, 0, 5, NULL); be_define_const_str(wire2, "wire2", 3229499038u, 0, 5, NULL); be_define_const_str(wire_scan, "wire_scan", 2671275880u, 0, 9, NULL); be_define_const_str(write, "write", 3190202204u, 0, 5, NULL); be_define_const_str(write8, "write8", 3133991532u, 0, 6, NULL); be_define_const_str(write_bit, "write_bit", 2660990436u, 0, 9, NULL); -be_define_const_str(write_bytes, "write_bytes", 1227543792u, 0, 11, NULL); +be_define_const_str(write_bytes, "write_bytes", 1227543792u, 0, 11, &be_const_str_except); be_define_const_str(write_file, "write_file", 3177658879u, 0, 10, NULL); -be_define_const_str(write_gpio, "write_gpio", 2267940334u, 0, 10, NULL); +be_define_const_str(write_gpio, "write_gpio", 2267940334u, 0, 10, &be_const_str_if); be_define_const_str(x, "x", 4245442695u, 0, 1, NULL); be_define_const_str(x1, "x1", 274927234u, 0, 2, NULL); be_define_const_str(y, "y", 4228665076u, 0, 1, NULL); @@ -731,7 +732,7 @@ be_define_const_str(y1, "y1", 2355101727u, 0, 2, NULL); be_define_const_str(year, "year", 2927578396u, 0, 4, NULL); be_define_const_str(yield, "yield", 1821831854u, 0, 5, NULL); be_define_const_str(zero, "zero", 2339366755u, 0, 4, NULL); -be_define_const_str(zip, "zip", 2877453236u, 0, 3, NULL); +be_define_const_str(zip, "zip", 2877453236u, 0, 3, &be_const_str__X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); be_define_const_str(_X7B, "{", 4262220314u, 0, 1, NULL); be_define_const_str(_X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D, "{s}Batt Current{m}%.1f mA{e}", 866537156u, 0, 28, NULL); be_define_const_str(_X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D, "{s}Batt Voltage{m}%.3f V{e}", 3184308199u, 0, 27, NULL); @@ -742,369 +743,370 @@ be_define_const_str(_X7B_X7D, "{}", 1415952421u, 0, 2, NULL); be_define_const_str(_X7D, "}", 4161554600u, 0, 1, NULL); static const bstring* const m_string_table[] = { - (const bstring *)&be_const_str__X3E_X3D, - (const bstring *)&be_const_str_run_bat, - NULL, - NULL, - (const bstring *)&be_const_str_io_error, - (const bstring *)&be_const_str_depower, - (const bstring *)&be_const_str_SERIAL_6O1, - (const bstring *)&be_const_str_STATE_DEFAULT, - (const bstring *)&be_const_str_SERIAL_6N1, - (const bstring *)&be_const_str_Auto_X2Dconfiguration, - (const bstring *)&be_const_str_decrypt, - (const bstring *)&be_const_str_insert, - NULL, (const bstring *)&be_const_str__X3D, - (const bstring *)&be_const_str_write_bytes, + (const bstring *)&be_const_str_point, + (const bstring *)&be_const_str_run, NULL, - (const bstring *)&be_const_str_running, - (const bstring *)&be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, - (const bstring *)&be_const_str_read_bytes, - (const bstring *)&be_const_str_draw_arc, - (const bstring *)&be_const_str__X20, - (const bstring *)&be_const_str_event, - (const bstring *)&be_const_str_SERIAL_5E2, - (const bstring *)&be_const_str_SERIAL_6E1, - (const bstring *)&be_const_str_leds, - (const bstring *)&be_const_str__lvgl, - (const bstring *)&be_const_str_zip, - (const bstring *)&be_const_str_EC_C25519, - (const bstring *)&be_const_str_COLOR_BLACK, - (const bstring *)&be_const_str_readline, - (const bstring *)&be_const_str__X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, - NULL, - (const bstring *)&be_const_str_load_templates, - (const bstring *)&be_const_str_get, - (const bstring *)&be_const_str_POST, - (const bstring *)&be_const_str___iterator__, - (const bstring *)&be_const_str_AudioGeneratorMP3, - (const bstring *)&be_const_str__energy, - (const bstring *)&be_const_str__rules, - (const bstring *)&be_const_str_break, - (const bstring *)&be_const_str__X2F_X2Eautoconf, - (const bstring *)&be_const_str_content_button, - (const bstring *)&be_const_str__cb, - (const bstring *)&be_const_str_get_aps_voltage, - (const bstring *)&be_const_str_AXP192, - (const bstring *)&be_const_str_select, - (const bstring *)&be_const_str_autoexec, - (const bstring *)&be_const_str__X0A, - (const bstring *)&be_const_str_available, - NULL, - (const bstring *)&be_const_str__X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, - (const bstring *)&be_const_str_gc, - (const bstring *)&be_const_str_CFG_X3A_X20loading_X20_X27_X25s_X27, - (const bstring *)&be_const_str__X21_X3D_X3D, - (const bstring *)&be_const_str_split, - (const bstring *)&be_const_str_lower, - (const bstring *)&be_const_str__X3Clabel_X3EChoose_X20a_X20device_X20configuration_X3A_X3C_X2Flabel_X3E_X3Cbr_X3E, - (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, - (const bstring *)&be_const_str_base_class, - (const bstring *)&be_const_str_connected, - (const bstring *)&be_const_str_instance, - NULL, - (const bstring *)&be_const_str__X2Etapp, - (const bstring *)&be_const_str__X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_attrdump, - (const bstring *)&be_const_str_EVENT_DRAW_MAIN, - (const bstring *)&be_const_str__request_from, - (const bstring *)&be_const_str__X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_acos, - (const bstring *)&be_const_str_get_light, - (const bstring *)&be_const_str_resp_cmnd_str, - NULL, - (const bstring *)&be_const_str_CFG_X3A_X20removing_X20autoconf_X20files, - NULL, - (const bstring *)&be_const_str_w, - (const bstring *)&be_const_str_draw_line, - NULL, - (const bstring *)&be_const_str_strip, - (const bstring *)&be_const_str_format, - (const bstring *)&be_const_str_Leds, - (const bstring *)&be_const_str_exec_tele, - (const bstring *)&be_const_str_chars_in_string, - (const bstring *)&be_const_str_CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, - NULL, - (const bstring *)&be_const_str_widget_dtor_cb, - (const bstring *)&be_const_str_invalidate, - (const bstring *)&be_const_str__X3A, - NULL, - (const bstring *)&be_const_str_out_X20of_X20range, - NULL, - (const bstring *)&be_const_str_lv_event_cb, - (const bstring *)&be_const_str_LVG_X3A_X20call_X20to_X20unsupported_X20callback, - (const bstring *)&be_const_str_escape, - (const bstring *)&be_const_str_event_cb, - (const bstring *)&be_const_str_init_draw_line_dsc, - NULL, - (const bstring *)&be_const_str_isinstance, - (const bstring *)&be_const_str_exists, - (const bstring *)&be_const_str_HTTP_GET, - (const bstring *)&be_const_str_clear_first_time, - (const bstring *)&be_const_str__X2Eautoconf, - (const bstring *)&be_const_str_clear, - (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, - (const bstring *)&be_const_str_SERIAL_7N1, - (const bstring *)&be_const_str_get_percentage, - (const bstring *)&be_const_str_SERIAL_7O1, - (const bstring *)&be_const_str_remove, - (const bstring *)&be_const_str_set_time, - (const bstring *)&be_const_str_get_size, - (const bstring *)&be_const_str_remove_timer, - (const bstring *)&be_const_str__X23autoexec_X2Ebat, - (const bstring *)&be_const_str__X2D_X2D_X3A_X2D_X2D, - (const bstring *)&be_const_str_due, - (const bstring *)&be_const_str__X2C, - (const bstring *)&be_const_str_instance_size, - (const bstring *)&be_const_str_Animate_X20pc_X20is_X20out_X20of_X20range, - (const bstring *)&be_const_str_get_bat_voltage, - (const bstring *)&be_const_str_resp_cmnd_done, - NULL, - (const bstring *)&be_const_str_energy_struct, - NULL, - (const bstring *)&be_const_str__drivers, + (const bstring *)&be_const_str_class_init_obj, + (const bstring *)&be_const_str_try_rule, (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dzip_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, - (const bstring *)&be_const_str_tob64, - (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, - (const bstring *)&be_const_str_CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29, - (const bstring *)&be_const_str__X3C, - (const bstring *)&be_const_str_y, - (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_files, - (const bstring *)&be_const_str__X2Ew, - (const bstring *)&be_const_str_assert, - (const bstring *)&be_const_str_bytes, - (const bstring *)&be_const_str__X23, - (const bstring *)&be_const_str_abs, - (const bstring *)&be_const_str__X2E_X2E, - (const bstring *)&be_const_str__global_addr, - (const bstring *)&be_const_str_connect, - (const bstring *)&be_const_str__settings_ptr, - NULL, - (const bstring *)&be_const_str_CFG_X3A_X20ran_X20_X20, - (const bstring *)&be_const_str_BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, - NULL, - (const bstring *)&be_const_str__X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, - (const bstring *)&be_const_str_i2c_enabled, - (const bstring *)&be_const_str_ctypes_bytes_dyn, - (const bstring *)&be_const_str_CFG_X3A_X20loading_X20, - NULL, - NULL, - (const bstring *)&be_const_str_refr_size, - (const bstring *)&be_const_str_content_send_style, - NULL, - NULL, - (const bstring *)&be_const_str__get_cb, - (const bstring *)&be_const_str_c, - (const bstring *)&be_const_str_ins_goto, - (const bstring *)&be_const_str__buffer, - (const bstring *)&be_const_str_concat, - (const bstring *)&be_const_str_percentage, - NULL, - (const bstring *)&be_const_str_SERIAL_5N2, - NULL, - NULL, - (const bstring *)&be_const_str_SK6812_GRBW, - (const bstring *)&be_const_str__X3Cp_X3E_X3Csmall_X3E_X26nbsp_X3B_X28This_X20feature_X20requires_X20an_X20internet_X20connection_X29_X3C_X2Fsmall_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, - NULL, - NULL, - (const bstring *)&be_const_str_lv_obj, - (const bstring *)&be_const_str___upper__, - (const bstring *)&be_const_str_Restart_X201, - NULL, - (const bstring *)&be_const_str_introspect, - (const bstring *)&be_const_str__X23autoexec_X2Ebe, - (const bstring *)&be_const_str_CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27, - (const bstring *)&be_const_str_bool, - (const bstring *)&be_const_str_PART_MAIN, - (const bstring *)&be_const_str_back_forth, - (const bstring *)&be_const_str_lv_obj_class, - (const bstring *)&be_const_str_TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, - (const bstring *)&be_const_str_GET, - (const bstring *)&be_const_str_deg, - (const bstring *)&be_const_str__X28_X29, - NULL, - (const bstring *)&be_const_str__X23preinit_X2Ebe, - (const bstring *)&be_const_str__class, - NULL, - (const bstring *)&be_const_str__X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, - (const bstring *)&be_const_str_CFG_X3A_X20downloading_X20_X27_X25s_X27, - (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, - (const bstring *)&be_const_str_fromstring, - (const bstring *)&be_const_str_SERIAL_8E2, - NULL, - (const bstring *)&be_const_str__anonymous_, - (const bstring *)&be_const_str__X2502d_X25s_X2502d, - (const bstring *)&be_const_str_CFG_X3A_X20return_code_X3D_X25i, - (const bstring *)&be_const_str_web_sensor, - (const bstring *)&be_const_str_detect, - (const bstring *)&be_const_str_exec_cmd, - (const bstring *)&be_const_str_to_gamma, - (const bstring *)&be_const_str__ptr, - (const bstring *)&be_const_str_null_cb, - (const bstring *)&be_const_str_eth, - (const bstring *)&be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf, - (const bstring *)&be_const_str_erase, - (const bstring *)&be_const_str__archive, - (const bstring *)&be_const_str_CFG_X3A_X20removed_X20file_X20_X27_X25s_X27, - (const bstring *)&be_const_str_code, - (const bstring *)&be_const_str_BUTTON_CONFIGURATION, - (const bstring *)&be_const_str_web_send_decimal, - (const bstring *)&be_const_str_fromptr, - (const bstring *)&be_const_str_SERIAL_8E1, - NULL, - (const bstring *)&be_const_str_set_style_bg_color, - (const bstring *)&be_const_str_end, - (const bstring *)&be_const_str__read, - (const bstring *)&be_const_str_cos, - (const bstring *)&be_const_str_codedump, - (const bstring *)&be_const_str__X23init_X2Ebat, - (const bstring *)&be_const_str_get_battery_chargin_status, - (const bstring *)&be_const_str__X2Ebec, - (const bstring *)&be_const_str_set_dcdc_enable, - NULL, - (const bstring *)&be_const_str_ctor, - (const bstring *)&be_const_str_digital_read, - (const bstring *)&be_const_str_close, - (const bstring *)&be_const_str__X2F, - (const bstring *)&be_const_str_cosh, - (const bstring *)&be_const_str_I2C_Driver, - (const bstring *)&be_const_str_read24, - (const bstring *)&be_const_str__write, - (const bstring *)&be_const_str__X23display_X2Eini, - (const bstring *)&be_const_str_get_bat_power, - (const bstring *)&be_const_str_pin_mode, - (const bstring *)&be_const_str__, - (const bstring *)&be_const_str_scale_uint, - (const bstring *)&be_const_str_WS2812_GRB, - (const bstring *)&be_const_str_AudioOutput, - (const bstring *)&be_const_str_animate, - (const bstring *)&be_const_str__X3F, - (const bstring *)&be_const_str_id, - (const bstring *)&be_const_str_arg_name, - (const bstring *)&be_const_str_internal_error, - (const bstring *)&be_const_str_serial, - NULL, - NULL, - (const bstring *)&be_const_str_CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29, - (const bstring *)&be_const_str__begin_transmission, - (const bstring *)&be_const_str__X2Ep1, - (const bstring *)&be_const_str_engine, - (const bstring *)&be_const_str__def, - (const bstring *)&be_const_str_get_pixel_color, - (const bstring *)&be_const_str__X3C_X3D, - (const bstring *)&be_const_str_CFG_X3A_X20removing_X20first_X20time_X20marker, - (const bstring *)&be_const_str__X3D_X3D, - (const bstring *)&be_const_str_can_show, - (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, - (const bstring *)&be_const_str_response_append, - (const bstring *)&be_const_str_CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting, - (const bstring *)&be_const_str_content_send, - (const bstring *)&be_const_str_create_segment, - (const bstring *)&be_const_str_duration, - (const bstring *)&be_const_str_get_height, - (const bstring *)&be_const_str_delete_all_configs, - (const bstring *)&be_const_str_reset_search, - (const bstring *)&be_const_str_BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, - (const bstring *)&be_const_str_, - (const bstring *)&be_const_str_b, - (const bstring *)&be_const_str_SERIAL_5E1, - (const bstring *)&be_const_str_SERIAL_6E2, - (const bstring *)&be_const_str_read13, - (const bstring *)&be_const_str_BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, - (const bstring *)&be_const_str_publish_result, - (const bstring *)&be_const_str_get_bat_current, - NULL, - (const bstring *)&be_const_str_ceil, - (const bstring *)&be_const_str_autorun, - (const bstring *)&be_const_str_length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032, - (const bstring *)&be_const_str_set_text, - (const bstring *)&be_const_str__X3D_X3C_X3E_X21, - (const bstring *)&be_const_str_r, - (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X20, - (const bstring *)&be_const_str__X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str__X2Ep, - (const bstring *)&be_const_str__error, - (const bstring *)&be_const_str_lv, - (const bstring *)&be_const_str_flush, - (const bstring *)&be_const_str_AudioFileSource, - (const bstring *)&be_const_str_web_add_main_button, - (const bstring *)&be_const_str__X2Elen, - (const bstring *)&be_const_str_persist_X2E_p_X20is_X20not_X20a_X20map, - (const bstring *)&be_const_str_compile, - (const bstring *)&be_const_str_CFG_X3A_X20running_X20, - (const bstring *)&be_const_str_compress, - NULL, - (const bstring *)&be_const_str_pin_used, - (const bstring *)&be_const_str__X2Ebe, - (const bstring *)&be_const_str_SERIAL_8O1, - (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X27_X25s_X27, - (const bstring *)&be_const_str_EVENT_DRAW_PART_END, - NULL, - NULL, - (const bstring *)&be_const_str_button_pressed, - (const bstring *)&be_const_str_atleast1, - (const bstring *)&be_const_str_add_anim, - (const bstring *)&be_const_str_count, - (const bstring *)&be_const_str__X25s_X2Eautoconf, - (const bstring *)&be_const_str_False, - (const bstring *)&be_const_str_time_str, - (const bstring *)&be_const_str__X26lt_X3BNone_X26gt_X3B, - (const bstring *)&be_const_str_allocated, - NULL, - (const bstring *)&be_const_str_cb_obj, - (const bstring *)&be_const_str__X21_X3D, - (const bstring *)&be_const_str__X3Cselect_X20name_X3D_X27zip_X27_X3E, - (const bstring *)&be_const_str_OneWire, - (const bstring *)&be_const_str_classof, - (const bstring *)&be_const_str_json, - (const bstring *)&be_const_str_True, + (const bstring *)&be_const_str_setbits, + (const bstring *)&be_const_str_AXP192, + (const bstring *)&be_const_str_tolower, (const bstring *)&be_const_str__X2B, - (const bstring *)&be_const_str_decompress, - (const bstring *)&be_const_str_CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, - (const bstring *)&be_const_str_lv_event, - (const bstring *)&be_const_str_counters, - (const bstring *)&be_const_str_pc, - (const bstring *)&be_const_str__X2Esize, + (const bstring *)&be_const_str_I2C_X3A, + (const bstring *)&be_const_str_exec_rules, + (const bstring *)&be_const_str_read13, + (const bstring *)&be_const_str__X2F, + (const bstring *)&be_const_str_pc_abs, + (const bstring *)&be_const_str__error, + (const bstring *)&be_const_str__X23autoexec_X2Ebat, + (const bstring *)&be_const_str__X23, + (const bstring *)&be_const_str__X2Ep, + (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, + (const bstring *)&be_const_str_SERIAL_6N1, + (const bstring *)&be_const_str_cb_do_nothing, + (const bstring *)&be_const_str_CFG_X3A_X20loading_X20, + (const bstring *)&be_const_str_HTTP_POST, + (const bstring *)&be_const_str__rules, + NULL, + NULL, + NULL, + (const bstring *)&be_const_str_the_X20second_X20argument_X20is_X20not_X20a_X20function, + (const bstring *)&be_const_str_begin, + (const bstring *)&be_const_str_POST, + (const bstring *)&be_const_str_web_add_console_button, + (const bstring *)&be_const_str__X2F_X2Eautoconf, + NULL, + (const bstring *)&be_const_str__filename, + (const bstring *)&be_const_str_write_bit, + (const bstring *)&be_const_str_SERIAL_5O1, + (const bstring *)&be_const_str_AES_GCM, + (const bstring *)&be_const_str_set_height, + (const bstring *)&be_const_str__end_transmission, + (const bstring *)&be_const_str__X2D_X2D_X3A_X2D_X2D, + (const bstring *)&be_const_str_cb_obj, + (const bstring *)&be_const_str_CFG_X3A_X20removing_X20first_X20time_X20marker, + (const bstring *)&be_const_str__archive, + (const bstring *)&be_const_str_module, + (const bstring *)&be_const_str_SERIAL_7N1, + (const bstring *)&be_const_str_sinh, + (const bstring *)&be_const_str__X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, + (const bstring *)&be_const_str_SERIAL_6O2, + (const bstring *)&be_const_str_detected_X20on_X20bus, + (const bstring *)&be_const_str_response_append, + (const bstring *)&be_const_str_WS2812_GRB, + (const bstring *)&be_const_str__X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, + (const bstring *)&be_const_str_toptr, + (const bstring *)&be_const_str_get_bri, + NULL, + (const bstring *)&be_const_str_arch, NULL, - (const bstring *)&be_const_str__X5B, (const bstring *)&be_const_str__X3C_X2Fform_X3E_X3C_X2Fp_X3E, (const bstring *)&be_const_str_connection_error, - (const bstring *)&be_const_str_classname, - (const bstring *)&be_const_str_AudioGeneratorWAV, + (const bstring *)&be_const_str_, + (const bstring *)&be_const_str_calldepth, + (const bstring *)&be_const_str___iterator__, + (const bstring *)&be_const_str__X2Esize, + (const bstring *)&be_const_str_widget_group_def, + (const bstring *)&be_const_str_resp_cmnd, + (const bstring *)&be_const_str__X2Ep2, + (const bstring *)&be_const_str_get_switch, + (const bstring *)&be_const_str_clear_first_time, + NULL, + (const bstring *)&be_const_str_EC_C25519, + (const bstring *)&be_const_str_save, + NULL, + NULL, + (const bstring *)&be_const_str_SERIAL_8N1, + (const bstring *)&be_const_str_ip, + (const bstring *)&be_const_str_alternate, + (const bstring *)&be_const_str_compile, + (const bstring *)&be_const_str_file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27, + (const bstring *)&be_const_str_animate, + (const bstring *)&be_const_str__X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, + NULL, + (const bstring *)&be_const_str_SERIAL_8O2, + (const bstring *)&be_const_str__X25s_X2Eautoconf, + NULL, + (const bstring *)&be_const_str__dirty, + (const bstring *)&be_const_str_y1, + (const bstring *)&be_const_str_remove_driver, + (const bstring *)&be_const_str_get_string, + (const bstring *)&be_const_str_CFG_X3A_X20removing_X20autoconf_X20files, + (const bstring *)&be_const_str_autoexec, + (const bstring *)&be_const_str_get_style_line_color, + (const bstring *)&be_const_str_bool, + (const bstring *)&be_const_str_write_gpio, + (const bstring *)&be_const_str__X3D_X3D, + (const bstring *)&be_const_str_id, + (const bstring *)&be_const_str_SERIAL_5N2, + NULL, + (const bstring *)&be_const_str_persist, + (const bstring *)&be_const_str_set_timeouts, + NULL, (const bstring *)&be_const_str_AudioGenerator, - (const bstring *)&be_const_str_Parameter_X20error, - (const bstring *)&be_const_str_get_tasmota, - (const bstring *)&be_const_str_loop, - (const bstring *)&be_const_str__timers, - (const bstring *)&be_const_str_constructor_cb, - (const bstring *)&be_const_str_addr, - (const bstring *)&be_const_str__X2E, - (const bstring *)&be_const_str_RES_OK, - NULL, - (const bstring *)&be_const_str_OPTION_A, - NULL, - (const bstring *)&be_const_str_collect, - (const bstring *)&be_const_str_SERIAL_6O2, - (const bstring *)&be_const_str_AudioFileSourceFS, - (const bstring *)&be_const_str_show, - (const bstring *)&be_const_str__cmd, - (const bstring *)&be_const_str_SERIAL_7N2, - (const bstring *)&be_const_str_dirty, - (const bstring *)&be_const_str_SERIAL_7E2, - (const bstring *)&be_const_str__X3E, - (const bstring *)&be_const_str__X2F_X3Frst_X3D, - (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, + (const bstring *)&be_const_str_byte, (const bstring *)&be_const_str_EVENT_DRAW_PART_BEGIN, + (const bstring *)&be_const_str_collect, + (const bstring *)&be_const_str_widget_event, + (const bstring *)&be_const_str_SERIAL_6E2, + (const bstring *)&be_const_str_add_anim, + (const bstring *)&be_const_str_erase, + (const bstring *)&be_const_str___lower__, + (const bstring *)&be_const_str_arg, + (const bstring *)&be_const_str_CFG_X3A_X20ran_X20_X20, + (const bstring *)&be_const_str_srand, + (const bstring *)&be_const_str_skip, + (const bstring *)&be_const_str_Leds, + NULL, + (const bstring *)&be_const_str__X23init_X2Ebat, + (const bstring *)&be_const_str__X3Clambda_X3E, + (const bstring *)&be_const_str_GET, + (const bstring *)&be_const_str_widget_ctor_cb, + (const bstring *)&be_const_str__global_addr, + (const bstring *)&be_const_str_OneWire, + (const bstring *)&be_const_str__X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_update, + NULL, + NULL, + NULL, + (const bstring *)&be_const_str_AudioOutput, + NULL, + (const bstring *)&be_const_str_decompress, + NULL, + (const bstring *)&be_const_str_EVENT_DRAW_PART_END, + (const bstring *)&be_const_str_load_templates, + (const bstring *)&be_const_str_get_alternate, + (const bstring *)&be_const_str_acos, + (const bstring *)&be_const_str__X2Elen, + (const bstring *)&be_const_str_constructor_cb, + (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X20, + NULL, + (const bstring *)&be_const_str_get_current_module_name, + (const bstring *)&be_const_str__X2Ebec, + (const bstring *)&be_const_str__settings_ptr, + (const bstring *)&be_const_str_dump, + NULL, + (const bstring *)&be_const_str__drivers, + (const bstring *)&be_const_str__X28_X29, + NULL, + (const bstring *)&be_const_str__X2Ebe, + (const bstring *)&be_const_str_content_start, + (const bstring *)&be_const_str__class, + (const bstring *)&be_const_str_h, + (const bstring *)&be_const_str_Unknown_X20command, + (const bstring *)&be_const_str_CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, + (const bstring *)&be_const_str_p1, + NULL, + NULL, + (const bstring *)&be_const_str_b, + (const bstring *)&be_const_str_Parameter_X20error, + (const bstring *)&be_const_str_event, + (const bstring *)&be_const_str_read32, + (const bstring *)&be_const_str_f, + (const bstring *)&be_const_str_resp_cmnd_failed, + (const bstring *)&be_const_str_create_matrix, + (const bstring *)&be_const_str_SERIAL_7E2, + (const bstring *)&be_const_str_resolvecmnd, + (const bstring *)&be_const_str_draw_line, + (const bstring *)&be_const_str_autorun, + (const bstring *)&be_const_str__X2Eautoconf, + (const bstring *)&be_const_str_editable, + NULL, + NULL, + NULL, + (const bstring *)&be_const_str__X3A, + (const bstring *)&be_const_str_EVENT_DRAW_MAIN, + (const bstring *)&be_const_str_remove_timer, + (const bstring *)&be_const_str_Wire, + (const bstring *)&be_const_str__X3E, + (const bstring *)&be_const_str__X26lt_X3BNone_X26gt_X3B, + (const bstring *)&be_const_str__X3C, + (const bstring *)&be_const_str_pin, + (const bstring *)&be_const_str__def, + (const bstring *)&be_const_str_int, + (const bstring *)&be_const_str_atan2, + (const bstring *)&be_const_str_AudioOutputI2S, + (const bstring *)&be_const_str_last_modified, + (const bstring *)&be_const_str_get_style_pad_right, + (const bstring *)&be_const_str__settings_def, + (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X27_X25s_X27, + (const bstring *)&be_const_str__X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, + NULL, + (const bstring *)&be_const_str_start, + (const bstring *)&be_const_str_reset, + (const bstring *)&be_const_str__X2E, + (const bstring *)&be_const_str__X21_X3D_X3D, + (const bstring *)&be_const_str__X2C, + (const bstring *)&be_const_str__X23preinit_X2Ebe, + (const bstring *)&be_const_str_month, + (const bstring *)&be_const_str_instance_size, + (const bstring *)&be_const_str__X20, + (const bstring *)&be_const_str_exp, + (const bstring *)&be_const_str_bus, + (const bstring *)&be_const_str_cmd_res, + (const bstring *)&be_const_str_draw_line_dsc, + (const bstring *)&be_const_str_BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, + (const bstring *)&be_const_str_tostring, + (const bstring *)&be_const_str_var, + (const bstring *)&be_const_str_upper, + (const bstring *)&be_const_str_color, + (const bstring *)&be_const_str_internal_error, + (const bstring *)&be_const_str_encrypt, + (const bstring *)&be_const_str__X21_X3D, + NULL, + NULL, + (const bstring *)&be_const_str_CFG_X3A_X20running_X20, + (const bstring *)&be_const_str_Restart_X201, + (const bstring *)&be_const_str_BUTTON_CONFIGURATION, + NULL, + (const bstring *)&be_const_str_HTTP_GET, + (const bstring *)&be_const_str_loop, + (const bstring *)&be_const_str_SERIAL_5O2, + (const bstring *)&be_const_str__X0A, + (const bstring *)&be_const_str_back_forth, + (const bstring *)&be_const_str_add_rule, + (const bstring *)&be_const_str_CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, + (const bstring *)&be_const_str_list, + (const bstring *)&be_const_str_closure, + (const bstring *)&be_const_str__X2F_X3Frst_X3D, + NULL, + (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, + (const bstring *)&be_const_str_COLOR_WHITE, + NULL, + (const bstring *)&be_const_str_SERIAL_6O1, + (const bstring *)&be_const_str_widget_struct_default, + (const bstring *)&be_const_str_gamma, + (const bstring *)&be_const_str_abs, + (const bstring *)&be_const_str_pc, + (const bstring *)&be_const_str_concat, + (const bstring *)&be_const_str_height_def, + NULL, + (const bstring *)&be_const_str_log10, + (const bstring *)&be_const_str_call, + (const bstring *)&be_const_str__p, + (const bstring *)&be_const_str_file, + (const bstring *)&be_const_str__request_from, + (const bstring *)&be_const_str_BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, + (const bstring *)&be_const_str__X2Ep1, + (const bstring *)&be_const_str_content_send_style, + (const bstring *)&be_const_str_AudioGeneratorWAV, + (const bstring *)&be_const_str_seg7_font, + NULL, + (const bstring *)&be_const_str_add_driver, + (const bstring *)&be_const_str_pin_used, + (const bstring *)&be_const_str_Tele, + (const bstring *)&be_const_str_SERIAL_8N2, + NULL, + (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, + (const bstring *)&be_const_str_get_input_power_status, (const bstring *)&be_const_str__persist_X2Ejson, - (const bstring *)&be_const_str_tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29, - (const bstring *)&be_const_str__X3Clambda_X3E + NULL, + (const bstring *)&be_const_str__X23display_X2Eini, + (const bstring *)&be_const_str_Animate_X20pc_X20is_X20out_X20of_X20range, + (const bstring *)&be_const_str_SERIAL_8O1, + (const bstring *)&be_const_str_ctypes_bytes, + (const bstring *)&be_const_str__X3Clabel_X3EChoose_X20a_X20device_X20configuration_X3A_X3C_X2Flabel_X3E_X3Cbr_X3E, + (const bstring *)&be_const_str_round_end, + (const bstring *)&be_const_str_codedump, + (const bstring *)&be_const_str_MD5, + (const bstring *)&be_const_str_PART_MAIN, + NULL, + (const bstring *)&be_const_str_asin, + (const bstring *)&be_const_str_content_stop, + (const bstring *)&be_const_str_set_light, + (const bstring *)&be_const_str_get_bat_current, + (const bstring *)&be_const_str_x1, + NULL, + NULL, + (const bstring *)&be_const_str_compress, + (const bstring *)&be_const_str_escape, + (const bstring *)&be_const_str_atan, + (const bstring *)&be_const_str_SERIAL_5N1, + (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str__X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_tr, + (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, + (const bstring *)&be_const_str__X2E_X2E, + (const bstring *)&be_const_str_SERIAL_6E1, + (const bstring *)&be_const_str_content_button, + (const bstring *)&be_const_str_asstring, + NULL, + (const bstring *)&be_const_str_detect, + (const bstring *)&be_const_str_close, + (const bstring *)&be_const_str_add_header, + (const bstring *)&be_const_str_day, + (const bstring *)&be_const_str_seti, + (const bstring *)&be_const_str_light, + (const bstring *)&be_const_str__X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_event_cb, + (const bstring *)&be_const_str_AudioFileSource, + (const bstring *)&be_const_str_get_tasmota, + (const bstring *)&be_const_str_preinit, + (const bstring *)&be_const_str__available, + (const bstring *)&be_const_str_name, + NULL, + NULL, + (const bstring *)&be_const_str_reset_search, + (const bstring *)&be_const_str__X3C_X3D, + (const bstring *)&be_const_str_from_to, + NULL, + (const bstring *)&be_const_str_remove, + (const bstring *)&be_const_str__read, + (const bstring *)&be_const_str_deg, + (const bstring *)&be_const_str_obj_class_create_obj, + (const bstring *)&be_const_str_ins_time, + (const bstring *)&be_const_str__X2Etapp, + (const bstring *)&be_const_str_content_flush, + (const bstring *)&be_const_str_area, + (const bstring *)&be_const_str_CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found, + (const bstring *)&be_const_str_webserver, + (const bstring *)&be_const_str_iter, + (const bstring *)&be_const_str_ceil, + (const bstring *)&be_const_str__global_def, + (const bstring *)&be_const_str__get_cb, + (const bstring *)&be_const_str___upper__, + (const bstring *)&be_const_str_size, + (const bstring *)&be_const_str_cb_event_closure, + (const bstring *)&be_const_str_find_key_i, + (const bstring *)&be_const_str__cb, + (const bstring *)&be_const_str_AudioGeneratorMP3, + (const bstring *)&be_const_str_BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, + (const bstring *)&be_const_str_clear_to, + (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, + (const bstring *)&be_const_str_web_sensor, + (const bstring *)&be_const_str__ccmd, + NULL, + (const bstring *)&be_const_str_p2, + (const bstring *)&be_const_str_SERIAL_8E1, + (const bstring *)&be_const_str_connect, + (const bstring *)&be_const_str_c, + (const bstring *)&be_const_str_cmd, + (const bstring *)&be_const_str_a, + (const bstring *)&be_const_str_SERIAL_7E1, + (const bstring *)&be_const_str__cmd, + (const bstring *)&be_const_str_ctor, + (const bstring *)&be_const_str_attrdump, + (const bstring *)&be_const_str_every_second, + (const bstring *)&be_const_str__X5B, + (const bstring *)&be_const_str_can_show, + NULL, + (const bstring *)&be_const_str_Auto_X2Dconfiguration, + (const bstring *)&be_const_str__, + (const bstring *)&be_const_str_gen_cb, + (const bstring *)&be_const_str__X5D, + (const bstring *)&be_const_str_get_size, + NULL, + (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, + (const bstring *)&be_const_str__X3E_X3D, + NULL, + (const bstring *)&be_const_str__X3F, + (const bstring *)&be_const_str_base_class }; static const struct bconststrtab m_const_string_table = { - .size = 359, - .count = 742, + .size = 360, + .count = 743, .table = m_string_table }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h index f691e6602..dc2abcca8 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h @@ -1,90 +1,91 @@ #include "be_constobj.h" static be_define_const_map_slots(be_class_tasmota_map) { - { be_const_key(resp_cmnd_done, -1), be_const_func(l_respCmndDone) }, - { be_const_key(resolvecmnd, 42), be_const_func(l_resolveCmnd) }, - { be_const_key(add_driver, -1), be_const_closure(Tasmota_add_driver_closure) }, { be_const_key(gc, -1), be_const_closure(Tasmota_gc_closure) }, - { be_const_key(find_op, -1), be_const_closure(Tasmota_find_op_closure) }, - { be_const_key(scale_uint, 15), be_const_func(l_scaleuint) }, - { be_const_key(try_rule, -1), be_const_closure(Tasmota_try_rule_closure) }, - { be_const_key(time_reached, -1), be_const_func(l_timereached) }, - { be_const_key(web_send, -1), be_const_func(l_webSend) }, - { be_const_key(eth, 21), be_const_func(l_eth) }, - { be_const_key(get_switch, 34), be_const_func(l_getswitch) }, - { be_const_key(set_power, -1), be_const_func(l_setpower) }, - { be_const_key(_drivers, 50), be_const_var(0) }, - { be_const_key(_rules, -1), be_const_var(1) }, - { be_const_key(_ccmd, 6), be_const_var(2) }, - { be_const_key(time_dump, -1), be_const_func(l_time_dump) }, - { be_const_key(gen_cb, 17), be_const_closure(Tasmota_gen_cb_closure) }, - { be_const_key(cmd_res, 20), be_const_var(3) }, - { be_const_key(set_light, 63), be_const_closure(Tasmota_set_light_closure) }, - { be_const_key(millis, -1), be_const_func(l_millis) }, - { be_const_key(global, -1), be_const_var(4) }, - { be_const_key(exec_tele, 67), be_const_closure(Tasmota_exec_tele_closure) }, - { be_const_key(_settings_ptr, -1), be_const_comptr(&Settings) }, - { be_const_key(get_power, -1), be_const_func(l_getpower) }, - { be_const_key(_cb, 57), be_const_var(5) }, - { be_const_key(save, -1), be_const_func(l_save) }, - { be_const_key(run_deferred, -1), be_const_closure(Tasmota_run_deferred_closure) }, - { be_const_key(i2c_enabled, 9), be_const_func(l_i2cenabled) }, - { be_const_key(remove_driver, -1), be_const_closure(Tasmota_remove_driver_closure) }, - { be_const_key(event, -1), be_const_closure(Tasmota_event_closure) }, + { be_const_key(read_sensors, 7), be_const_func(l_read_sensors) }, + { be_const_key(_get_cb, -1), be_const_func(l_get_cb) }, + { be_const_key(response_append, 50), be_const_func(l_respAppend) }, + { be_const_key(try_rule, 74), be_const_closure(Tasmota_try_rule_closure) }, + { be_const_key(eth, -1), be_const_func(l_eth) }, { be_const_key(find_key_i, -1), be_const_closure(Tasmota_find_key_i_closure) }, - { be_const_key(web_send_decimal, -1), be_const_func(l_webSendDecimal) }, - { be_const_key(get_free_heap, 3), be_const_func(l_getFreeHeap) }, - { be_const_key(wire_scan, -1), be_const_closure(Tasmota_wire_scan_closure) }, - { be_const_key(init, -1), be_const_closure(Tasmota_init_closure) }, - { be_const_key(wd, -1), be_const_var(6) }, - { be_const_key(_debug_present, -1), be_const_var(7) }, - { be_const_key(time_str, 45), be_const_closure(Tasmota_time_str_closure) }, - { be_const_key(remove_rule, 71), be_const_closure(Tasmota_remove_rule_closure) }, - { be_const_key(memory, 62), be_const_func(l_memory) }, - { be_const_key(wifi, -1), be_const_func(l_wifi) }, - { be_const_key(get_option, 44), be_const_func(l_getoption) }, - { be_const_key(rtc, -1), be_const_func(l_rtc) }, - { be_const_key(load, 72), be_const_closure(Tasmota_load_closure) }, - { be_const_key(chars_in_string, -1), be_const_closure(Tasmota_chars_in_string_closure) }, - { be_const_key(cmd, -1), be_const_closure(Tasmota_cmd_closure) }, - { be_const_key(publish, 43), be_const_func(l_publish) }, - { be_const_key(resp_cmnd_error, 18), be_const_func(l_respCmndError) }, - { be_const_key(add_cmd, -1), be_const_closure(Tasmota_add_cmd_closure) }, - { be_const_key(_settings_def, -1), be_const_comptr(&be_tasmota_settings_struct) }, - { be_const_key(strftime, 4), be_const_func(l_strftime) }, - { be_const_key(add_rule, 41), be_const_closure(Tasmota_add_rule_closure) }, - { be_const_key(wire2, -1), be_const_var(8) }, - { be_const_key(settings, -1), be_const_var(9) }, - { be_const_key(exec_rules, -1), be_const_closure(Tasmota_exec_rules_closure) }, + { be_const_key(exec_tele, 73), be_const_closure(Tasmota_exec_tele_closure) }, + { be_const_key(remove_driver, 28), be_const_closure(Tasmota_remove_driver_closure) }, + { be_const_key(load, -1), be_const_closure(Tasmota_load_closure) }, + { be_const_key(_settings_ptr, -1), be_const_comptr(&Settings) }, + { be_const_key(cmd_res, -1), be_const_var(0) }, + { be_const_key(time_str, 43), be_const_closure(Tasmota_time_str_closure) }, + { be_const_key(set_power, -1), be_const_func(l_setpower) }, + { be_const_key(yield, 20), be_const_func(l_yield) }, + { be_const_key(set_light, -1), be_const_closure(Tasmota_set_light_closure) }, + { be_const_key(find_op, 32), be_const_closure(Tasmota_find_op_closure) }, + { be_const_key(get_power, -1), be_const_func(l_getpower) }, + { be_const_key(add_rule, -1), be_const_closure(Tasmota_add_rule_closure) }, { be_const_key(cb_dispatch, -1), be_const_closure(Tasmota_cb_dispatch_closure) }, - { be_const_key(yield, 68), be_const_func(l_yield) }, - { be_const_key(_get_cb, 75), be_const_func(l_get_cb) }, - { be_const_key(wire1, 33), be_const_var(10) }, + { be_const_key(global, -1), be_const_var(1) }, + { be_const_key(i2c_enabled, -1), be_const_func(l_i2cenabled) }, + { be_const_key(remove_cmd, 10), be_const_closure(Tasmota_remove_cmd_closure) }, + { be_const_key(millis, 18), be_const_func(l_millis) }, + { be_const_key(publish, 69), be_const_func(l_publish) }, + { be_const_key(_drivers, -1), be_const_var(2) }, { be_const_key(resp_cmnd, -1), be_const_func(l_respCmnd) }, - { be_const_key(resp_cmnd_failed, 16), be_const_func(l_respCmndFailed) }, - { be_const_key(_global_addr, -1), be_const_comptr(&TasmotaGlobal) }, + { be_const_key(time_dump, -1), be_const_func(l_time_dump) }, + { be_const_key(web_send, -1), be_const_func(l_webSend) }, { be_const_key(hs2rgb, -1), be_const_closure(Tasmota_hs2rgb_closure) }, - { be_const_key(resp_cmnd_str, 76), be_const_func(l_respCmndStr) }, - { be_const_key(_global_def, -1), be_const_comptr(&be_tasmota_global_struct) }, - { be_const_key(kv, 74), be_const_closure(Tasmota_kv_closure) }, - { be_const_key(delay, -1), be_const_func(l_delay) }, - { be_const_key(remove_cmd, 19), be_const_closure(Tasmota_remove_cmd_closure) }, - { be_const_key(set_timer, -1), be_const_closure(Tasmota_set_timer_closure) }, - { be_const_key(_cmd, 54), be_const_func(l_cmd) }, - { be_const_key(publish_result, -1), be_const_func(l_publish_result) }, - { be_const_key(log, -1), be_const_func(l_logInfo) }, - { be_const_key(arch, -1), be_const_func(l_arch) }, - { be_const_key(remove_timer, 66), be_const_closure(Tasmota_remove_timer_closure) }, - { be_const_key(_timers, -1), be_const_var(11) }, - { be_const_key(read_sensors, -1), be_const_func(l_read_sensors) }, + { be_const_key(memory, -1), be_const_func(l_memory) }, + { be_const_key(gen_cb, 0), be_const_closure(Tasmota_gen_cb_closure) }, + { be_const_key(rtc, -1), be_const_func(l_rtc) }, + { be_const_key(get_option, -1), be_const_func(l_getoption) }, + { be_const_key(add_cmd, -1), be_const_closure(Tasmota_add_cmd_closure) }, + { be_const_key(init, -1), be_const_closure(Tasmota_init_closure) }, + { be_const_key(_timers, -1), be_const_var(3) }, + { be_const_key(_global_addr, -1), be_const_comptr(&TasmotaGlobal) }, + { be_const_key(wd, -1), be_const_var(4) }, { be_const_key(exec_cmd, -1), be_const_closure(Tasmota_exec_cmd_closure) }, - { be_const_key(response_append, -1), be_const_func(l_respAppend) }, - { be_const_key(get_light, -1), be_const_closure(Tasmota_get_light_closure) }, + { be_const_key(wire_scan, -1), be_const_closure(Tasmota_wire_scan_closure) }, + { be_const_key(_global_def, 61), be_const_comptr(&be_tasmota_global_struct) }, + { be_const_key(resp_cmnd_failed, 11), be_const_func(l_respCmndFailed) }, + { be_const_key(chars_in_string, -1), be_const_closure(Tasmota_chars_in_string_closure) }, + { be_const_key(web_send_decimal, -1), be_const_func(l_webSendDecimal) }, + { be_const_key(_debug_present, 4), be_const_var(5) }, + { be_const_key(cmd, -1), be_const_closure(Tasmota_cmd_closure) }, + { be_const_key(_cb, -1), be_const_var(6) }, + { be_const_key(remove_rule, -1), be_const_closure(Tasmota_remove_rule_closure) }, + { be_const_key(run_deferred, -1), be_const_closure(Tasmota_run_deferred_closure) }, + { be_const_key(strftime, -1), be_const_func(l_strftime) }, + { be_const_key(add_driver, 3), be_const_closure(Tasmota_add_driver_closure) }, + { be_const_key(kv, 60), be_const_closure(Tasmota_kv_closure) }, + { be_const_key(set_timer, 58), be_const_closure(Tasmota_set_timer_closure) }, + { be_const_key(scale_uint, -1), be_const_func(l_scaleuint) }, + { be_const_key(remove_timer, -1), be_const_closure(Tasmota_remove_timer_closure) }, + { be_const_key(settings, 49), be_const_var(7) }, + { be_const_key(arch, -1), be_const_func(l_arch) }, + { be_const_key(_ccmd, 64), be_const_var(8) }, + { be_const_key(wire1, 46), be_const_var(9) }, + { be_const_key(exec_rules, 66), be_const_closure(Tasmota_exec_rules_closure) }, + { be_const_key(strptime, -1), be_const_func(l_strptime) }, + { be_const_key(_cmd, -1), be_const_func(l_cmd) }, + { be_const_key(resp_cmnd_error, -1), be_const_func(l_respCmndError) }, + { be_const_key(time_reached, -1), be_const_func(l_timereached) }, + { be_const_key(_rules, -1), be_const_var(10) }, + { be_const_key(publish_result, -1), be_const_func(l_publish_result) }, + { be_const_key(_settings_def, -1), be_const_comptr(&be_tasmota_settings_struct) }, + { be_const_key(get_switch, -1), be_const_func(l_getswitch) }, + { be_const_key(delay, 71), be_const_func(l_delay) }, + { be_const_key(resp_cmnd_str, -1), be_const_func(l_respCmndStr) }, + { be_const_key(wifi, -1), be_const_func(l_wifi) }, + { be_const_key(save, 15), be_const_func(l_save) }, + { be_const_key(log, 37), be_const_func(l_logInfo) }, + { be_const_key(resolvecmnd, -1), be_const_func(l_resolveCmnd) }, + { be_const_key(resp_cmnd_done, -1), be_const_func(l_respCmndDone) }, + { be_const_key(get_light, 5), be_const_closure(Tasmota_get_light_closure) }, + { be_const_key(get_free_heap, -1), be_const_func(l_getFreeHeap) }, + { be_const_key(wire2, -1), be_const_var(11) }, + { be_const_key(event, 34), be_const_closure(Tasmota_event_closure) }, }; static be_define_const_map( be_class_tasmota_map, - 79 + 80 ); BE_EXPORT_VARIABLE be_define_const_class( diff --git a/tasmota/xdrv_52_3_berry_tasmota.ino b/tasmota/xdrv_52_3_berry_tasmota.ino index 6b8e83ea3..d165c209c 100644 --- a/tasmota/xdrv_52_3_berry_tasmota.ino +++ b/tasmota/xdrv_52_3_berry_tasmota.ino @@ -293,6 +293,24 @@ extern "C" { be_raise(vm, kTypeError, nullptr); } + int32_t l_strptime(bvm *vm) { + int32_t argc = be_top(vm); // Get the number of arguments + if (argc == 3 && be_isstring(vm, 2) && be_isstring(vm, 3)) { + const char * input = be_tostring(vm, 2); + const char * format = be_tostring(vm, 3); + struct tm time; + char * ret = strptime(input, format, &time); + if (ret) { + time_t ts = mktime(&time); + be_pushint(vm, ts); + be_return(vm); + } else { + be_return_nil(vm); + } + } + be_raise(vm, kTypeError, nullptr); + } + // Berry: tasmota.delay(timer:int) -> nil // int32_t l_delay(struct bvm *vm); @@ -311,6 +329,7 @@ extern "C" { int32_t l_yield(bvm *vm); int32_t l_yield(bvm *vm) { BrTimeoutYield(); // reset timeout + strptime(nullptr, nullptr, nullptr); be_return_nil(vm); } From 6905cfbe40a37641af2326e9475eaa504034a1eb Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 10 Dec 2021 23:22:46 +0100 Subject: [PATCH 53/97] Remove leftover --- tasmota/xdrv_52_3_berry_tasmota.ino | 1 - 1 file changed, 1 deletion(-) diff --git a/tasmota/xdrv_52_3_berry_tasmota.ino b/tasmota/xdrv_52_3_berry_tasmota.ino index d165c209c..d471b3ab7 100644 --- a/tasmota/xdrv_52_3_berry_tasmota.ino +++ b/tasmota/xdrv_52_3_berry_tasmota.ino @@ -329,7 +329,6 @@ extern "C" { int32_t l_yield(bvm *vm); int32_t l_yield(bvm *vm) { BrTimeoutYield(); // reset timeout - strptime(nullptr, nullptr, nullptr); be_return_nil(vm); } From 6ded581a371d37b2fedf1eea957a857205bd1411 Mon Sep 17 00:00:00 2001 From: Barbudor Date: Sat, 11 Dec 2021 09:18:14 +0000 Subject: [PATCH 54/97] fix O2 sensor message format --- tasmota/xsns_78_ezoo2.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xsns_78_ezoo2.ino b/tasmota/xsns_78_ezoo2.ino index ffeea4a86..81a40867e 100644 --- a/tasmota/xsns_78_ezoo2.ino +++ b/tasmota/xsns_78_ezoo2.ino @@ -39,7 +39,7 @@ struct EZOO2 : public EZOStruct { dtostrfd(O2, 2, str); if (json) { - ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_O2 "\":%d}" ), name, str); + ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_O2 "\":%s}" ), name, str); #ifdef USE_WEBSERVER }else { WSContentSend_PD(HTTP_SNS_O2, name, str); From c261a4f86335429ecead3d5da4ba9b99faa4b469 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 11 Dec 2021 10:21:57 +0100 Subject: [PATCH 55/97] Fixed strptime --- tasmota/xdrv_52_3_berry_tasmota.ino | 30 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/tasmota/xdrv_52_3_berry_tasmota.ino b/tasmota/xdrv_52_3_berry_tasmota.ino index d471b3ab7..cfc847e7a 100644 --- a/tasmota/xdrv_52_3_berry_tasmota.ino +++ b/tasmota/xdrv_52_3_berry_tasmota.ino @@ -260,20 +260,25 @@ extern "C" { be_raise(vm, kTypeError, nullptr); } + static void l_push_time(bvm *vm, struct tm *t, const char *unparsed) { + be_newobject(vm, "map"); + map_insert_int(vm, "year", t->tm_year + 1900); + map_insert_int(vm, "month", t->tm_mon + 1); + map_insert_int(vm, "day", t->tm_mday); + map_insert_int(vm, "hour", t->tm_hour); + map_insert_int(vm, "min", t->tm_min); + map_insert_int(vm, "sec", t->tm_sec); + map_insert_int(vm, "weekday", t->tm_wday); + if (unparsed) map_insert_str(vm, "unparsed", unparsed); + be_pop(vm, 1); + } + int32_t l_time_dump(bvm *vm) { int32_t top = be_top(vm); // Get the number of arguments if (top == 2 && be_isint(vm, 2)) { time_t ts = be_toint(vm, 2); struct tm *t = gmtime(&ts); - be_newobject(vm, "map"); - map_insert_int(vm, "year", t->tm_year + 1900); - map_insert_int(vm, "month", t->tm_mon + 1); - map_insert_int(vm, "day", t->tm_mday); - map_insert_int(vm, "hour", t->tm_hour); - map_insert_int(vm, "min", t->tm_min); - map_insert_int(vm, "sec", t->tm_sec); - map_insert_int(vm, "weekday", t->tm_wday); - be_pop(vm, 1); + l_push_time(vm, t, NULL); be_return(vm); } be_raise(vm, kTypeError, nullptr); @@ -298,11 +303,10 @@ extern "C" { if (argc == 3 && be_isstring(vm, 2) && be_isstring(vm, 3)) { const char * input = be_tostring(vm, 2); const char * format = be_tostring(vm, 3); - struct tm time; - char * ret = strptime(input, format, &time); + struct tm t = {0}; + char * ret = strptime(input, format, &t); if (ret) { - time_t ts = mktime(&time); - be_pushint(vm, ts); + l_push_time(vm, &t, ret); be_return(vm); } else { be_return_nil(vm); From d0806d33c684a41493b064125985187f3f5a1d4e Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 11 Dec 2021 16:36:29 +0100 Subject: [PATCH 56/97] Berry fix webclient --- lib/libesp32/Berry/default/be_modtab.c | 2 ++ lib/libesp32/Berry/default/be_tcpclient_lib.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libesp32/Berry/default/be_modtab.c b/lib/libesp32/Berry/default/be_modtab.c index 5f4279c27..47db8b24e 100644 --- a/lib/libesp32/Berry/default/be_modtab.c +++ b/lib/libesp32/Berry/default/be_modtab.c @@ -135,6 +135,7 @@ extern void be_load_I2C_Driver_class(bvm *vm); extern void be_load_AXP192_class(bvm *vm); extern void be_load_md5_lib(bvm *vm); extern void be_load_webclient_lib(bvm *vm); +extern void be_load_tcpclient_lib(bvm *vm); extern void be_load_crypto_lib(bvm *vm); extern void be_load_Leds_ntv_class(bvm *vm); extern void be_load_Leds_class(bvm *vm); @@ -189,6 +190,7 @@ BERRY_API void be_load_custom_libs(bvm *vm) #endif // USE_ENERGY_SENSOR #ifdef USE_WEBCLIENT be_load_webclient_lib(vm); + be_load_tcpclient_lib(vm); #endif // USE_WEBCLIENT #if defined(USE_ONEWIRE) || defined(USE_DS18x20) be_load_onewirelib(vm); diff --git a/lib/libesp32/Berry/default/be_tcpclient_lib.c b/lib/libesp32/Berry/default/be_tcpclient_lib.c index d8bfef023..b39db458e 100644 --- a/lib/libesp32/Berry/default/be_tcpclient_lib.c +++ b/lib/libesp32/Berry/default/be_tcpclient_lib.c @@ -22,7 +22,7 @@ extern int wc_tcp_readbytes(bvm *vm); #include "../generate/be_fixed_be_class_tcpclient.h" -void be_load_webclient_lib(bvm *vm) { +void be_load_tcpclient_lib(bvm *vm) { be_pushntvclass(vm, &be_class_tcpclient); be_setglobal(vm, "tcpclient"); be_pop(vm, 1); From 3bb71f154d91f51487897c3dfaa120768253d080 Mon Sep 17 00:00:00 2001 From: Jeroen Vermeulen - MageHost Date: Sat, 11 Dec 2021 19:34:17 +0100 Subject: [PATCH 57/97] Fix for #14006. Without USE_UFILESYS you can't draw picture buttons. --- .../Adafruit-GFX-Library-1.5.6-gemu-1.0/Adafruit_GFX.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/lib_display/Adafruit-GFX-Library-1.5.6-gemu-1.0/Adafruit_GFX.cpp b/lib/lib_display/Adafruit-GFX-Library-1.5.6-gemu-1.0/Adafruit_GFX.cpp index 5e88150cc..398dba0df 100644 --- a/lib/lib_display/Adafruit-GFX-Library-1.5.6-gemu-1.0/Adafruit_GFX.cpp +++ b/lib/lib_display/Adafruit-GFX-Library-1.5.6-gemu-1.0/Adafruit_GFX.cpp @@ -1610,10 +1610,12 @@ void Adafruit_GFX_Button::drawButton(boolean inverted) { text = _fillcolor; } + #if defined USE_UFILESYS if (_label[0]=='/') { draw_picture(_label, _x1, _y1, _w, _h, outline, inverted); _gfx->drawRect(_x1, _y1, _w, _h, text); } else { + #endif uint8_t r = min(_w, _h) / 4; // Corner radius _gfx->fillRoundRect(_x1, _y1, _w, _h, r, fill); _gfx->drawRoundRect(_x1, _y1, _w, _h, r, outline); @@ -1622,7 +1624,9 @@ void Adafruit_GFX_Button::drawButton(boolean inverted) { _gfx->setTextColor(text); _gfx->setTextSize(_textsize_x, _textsize_y); _gfx->print(_label); + #if defined USE_UFILESYS } + #endif } /**************************************************************************/ From 801c0cf90f892fd2fa5403ad2c55260b36431767 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 12 Dec 2021 17:09:20 +0100 Subject: [PATCH 58/97] Use matrix for compile --- .github/workflows/Tasmota_build_devel.yml | 1370 +-------------------- 1 file changed, 60 insertions(+), 1310 deletions(-) diff --git a/.github/workflows/Tasmota_build_devel.yml b/.github/workflows/Tasmota_build_devel.yml index fe3f995d1..bf22b6313 100644 --- a/.github/workflows/Tasmota_build_devel.yml +++ b/.github/workflows/Tasmota_build_devel.yml @@ -9,1318 +9,68 @@ on: - '**.md' # Do no build if *.md files changes jobs: - - tasmota: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-minimal: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-minimal - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-lite: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-lite - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-knx: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-knx - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-sensors: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-sensors - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-display: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-display - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-ir: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-ir - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-zbbridge: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-zbbridge - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-zigbee: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-zigbee - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-AF: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-AF - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-BG: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-BG - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-BR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-BR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-CN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-CN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-CZ: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-CZ - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-DE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-DE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-ES: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-ES - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-FR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-FR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-FY: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-FY - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-GR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-GR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-HE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-HE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-HU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-HU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-IT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-IT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-KO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-KO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-NL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-NL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-PL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-PL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-PT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-PT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-RO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-RO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-RU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-RU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-SE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-SE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-SK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-SK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-TR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-TR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-TW: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-TW - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-UK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-UK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-VN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-VN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32solo1: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32solo1 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-webcam: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-webcam - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-odroidgo: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-odroidgo - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-core2: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-core2 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-bluetooth: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-bluetooth - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-display: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-display - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-lvgl: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-lvgl - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-ir: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-ir - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - tasmota32c3: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32c3 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - tasmota32-AF: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-AF - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-BG: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-BG - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-BR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-BR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-CN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-CN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-CZ: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-CZ - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-DE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-DE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-ES: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-ES - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-FR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-FR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-FY: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-FY - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-GR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-GR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-HE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-HE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-HU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-HU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-IT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-IT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-KO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-KO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-NL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-NL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-PL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-PL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-PT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-PT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-RO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-RO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-RU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-RU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-SE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-SE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-SK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-SK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-TR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-TR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-TW: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-TW - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-UK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-UK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-VN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-VN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - + base-images: + runs-on: ubuntu-latest + continue-on-error: true + strategy: + matrix: + variant: + - tasmota + - tasmota-minimal + - tasmota-display + - tasmota-ir + - tasmota-knx + - tasmota-lite + - tasmota-sensors + - tasmota-zbbridge + - tasmota-zigbee + - tasmota32 + - tasmota32-webcam + - tasmota32-bluetooth + - tasmota32-core2 + - tasmota32-display + - tasmota32-ir + - tasmota32-lvgl + - tasmota32-odroidgo + - tasmota32c3 + - tasmota32solo1 + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + - name: Install dependencies + run: | + pip install -U platformio + - name: Run PlatformIO + run: platformio run -e ${{ matrix.variant }} + - uses: actions/upload-artifact@v2 + with: + name: firmware + path: ./build_output + + language-images: + runs-on: ubuntu-latest + continue-on-error: true + strategy: + matrix: + variant: [ tasmota, tasmota32 ] + language: [ AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ] + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + - name: Install dependencies + run: | + pip install -U platformio + - name: Run PlatformIO + run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }} + - uses: actions/upload-artifact@v2 + with: + name: firmware + path: ./build_output Upload: - needs: [tasmota-VN, tasmota32-VN, tasmota32-TW, tasmota32-TR] + needs: [base-images, language-images] runs-on: ubuntu-latest continue-on-error: true steps: From 9ff3755798be1372d19803ad48614d0cdae75085 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 12 Dec 2021 17:15:43 +0100 Subject: [PATCH 59/97] Use matrix to build --- .github/workflows/Tasmota_build_master.yml | 1371 +------------------- 1 file changed, 61 insertions(+), 1310 deletions(-) diff --git a/.github/workflows/Tasmota_build_master.yml b/.github/workflows/Tasmota_build_master.yml index 4639fde5e..41661c136 100644 --- a/.github/workflows/Tasmota_build_master.yml +++ b/.github/workflows/Tasmota_build_master.yml @@ -5,1320 +5,71 @@ on: branches: master paths-ignore: - '.github/**' # Ignore changes towards the .github directory + - '**.md' # Do no build if *.md files changes jobs: - - tasmota: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-minimal: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-minimal - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-lite: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-lite - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-knx: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-knx - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-sensors: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-sensors - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-display: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-display - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-ir: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-ir - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-zbbridge: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-zbbridge - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-zigbee: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-zigbee - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-AF: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-AF - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-BG: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-BG - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-BR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-BR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-CN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-CN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-CZ: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-CZ - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-DE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-DE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-ES: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-ES - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-FR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-FR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-FY: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-FY - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-GR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-GR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-HE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-HE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-HU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-HU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-IT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-IT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-KO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-KO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-NL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-NL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-PL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-PL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-PT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-PT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-RO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-RO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-RU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-RU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-SE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-SE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-SK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-SK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-TR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-TR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-TW: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-TW - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-UK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-UK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-VN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-VN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32solo1: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32solo1 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-webcam: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-webcam - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-odroidgo: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-odroidgo - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-core2: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-core2 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-bluetooth: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-bluetooth - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-display: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-display - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-lvgl: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-lvgl - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-ir: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-ir - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - tasmota32c3: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32c3 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - tasmota32-AF: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-AF - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-BG: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-BG - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-BR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-BR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-CN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-CN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-CZ: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-CZ - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-DE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-DE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-ES: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-ES - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-FR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-FR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-FY: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-FY - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-GR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-GR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-HE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-HE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-HU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-HU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-IT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-IT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-KO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-KO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-NL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-NL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-PL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-PL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-PT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-PT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-RO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-RO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-RU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-RU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-SE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-SE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-SK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-SK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-TR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-TR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-TW: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-TW - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-UK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-UK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-VN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-VN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - + base-images: + runs-on: ubuntu-latest + continue-on-error: true + strategy: + matrix: + variant: + - tasmota + - tasmota-minimal + - tasmota-display + - tasmota-ir + - tasmota-knx + - tasmota-lite + - tasmota-sensors + - tasmota-zbbridge + - tasmota-zigbee + - tasmota32 + - tasmota32-webcam + - tasmota32-bluetooth + - tasmota32-core2 + - tasmota32-display + - tasmota32-ir + - tasmota32-lvgl + - tasmota32-odroidgo + - tasmota32c3 + - tasmota32solo1 + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + - name: Install dependencies + run: | + pip install -U platformio + - name: Run PlatformIO + run: platformio run -e ${{ matrix.variant }} + - uses: actions/upload-artifact@v2 + with: + name: firmware + path: ./build_output + + language-images: + runs-on: ubuntu-latest + continue-on-error: true + strategy: + matrix: + variant: [ tasmota, tasmota32 ] + language: [ AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ] + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + - name: Install dependencies + run: | + pip install -U platformio + - name: Run PlatformIO + run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }} + - uses: actions/upload-artifact@v2 + with: + name: firmware + path: ./build_output Upload: - needs: [tasmota-VN, tasmota32-VN, tasmota32-TW, tasmota32-TR] + needs: [base-images, language-images] runs-on: ubuntu-latest continue-on-error: true steps: From 806d87b3a9288cfa964905e117abdd50d7f18c20 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 12 Dec 2021 17:20:16 +0100 Subject: [PATCH 60/97] run github build only in repo arendst --- .github/workflows/Tasmota_build_devel.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Tasmota_build_devel.yml b/.github/workflows/Tasmota_build_devel.yml index bf22b6313..ac908be23 100644 --- a/.github/workflows/Tasmota_build_devel.yml +++ b/.github/workflows/Tasmota_build_devel.yml @@ -11,6 +11,7 @@ on: jobs: base-images: runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' continue-on-error: true strategy: matrix: @@ -50,6 +51,7 @@ jobs: language-images: runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' continue-on-error: true strategy: matrix: From 58499b18dbd1ef30532c9d63fdb58d48416abd78 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 12 Dec 2021 17:21:31 +0100 Subject: [PATCH 61/97] build firmware only in repo arendst --- .github/workflows/Tasmota_build_master.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Tasmota_build_master.yml b/.github/workflows/Tasmota_build_master.yml index 41661c136..9ae940bef 100644 --- a/.github/workflows/Tasmota_build_master.yml +++ b/.github/workflows/Tasmota_build_master.yml @@ -10,6 +10,7 @@ on: jobs: base-images: runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' continue-on-error: true strategy: matrix: @@ -49,6 +50,7 @@ jobs: language-images: runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' continue-on-error: true strategy: matrix: From 21cda658d66f255887787eba526eb39ad5216cf3 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 12 Dec 2021 17:22:37 +0100 Subject: [PATCH 62/97] CI only in arendst repo --- .github/workflows/build_all_the_things.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_all_the_things.yml b/.github/workflows/build_all_the_things.yml index 2ffca53b7..cb41ae85e 100644 --- a/.github/workflows/build_all_the_things.yml +++ b/.github/workflows/build_all_the_things.yml @@ -18,6 +18,7 @@ on: jobs: base-images: runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' strategy: matrix: variant: @@ -59,6 +60,7 @@ jobs: language-images: runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' strategy: matrix: variant: [ tasmota ] From fa7b0302a7c42fdf1e76bdfb39605f0071e02b78 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 12 Dec 2021 18:04:46 +0100 Subject: [PATCH 63/97] Trying to solve ESP32-webcam timeouts Trying to solve ESP32-webcam timeouts on Settings save by adding delays in between file write chunks and diabling NVS writes when stream is active. (#13882) --- tasmota/settings.ino | 2 +- tasmota/support_esp.ino | 51 +++++++++++++++++++------------- tasmota/xdrv_50_filesystem.ino | 18 ++++++++++- tasmota/xdrv_81_esp32_webcam.ino | 4 +++ 4 files changed, 53 insertions(+), 22 deletions(-) diff --git a/tasmota/settings.ino b/tasmota/settings.ino index 31dd8a87c..5dfc21424 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -694,7 +694,7 @@ void SettingsLoad(void) { if (source) { settings_location = 1; if (Settings->cfg_holder == (uint16_t)CFG_HOLDER) { - AddLog(LOG_LEVEL_NONE, PSTR(D_LOG_CONFIG "Loaded from %s, " D_COUNT " %lu"), (source)?"File":"Nvm", Settings->save_flag); + AddLog(LOG_LEVEL_NONE, PSTR(D_LOG_CONFIG "Loaded from %s, " D_COUNT " %lu"), (2 == source)?"File":"NVS", Settings->save_flag); } } #endif // ESP32 diff --git a/tasmota/support_esp.ino b/tasmota/support_esp.ino index 93abe9daa..81b6ee6f6 100644 --- a/tasmota/support_esp.ino +++ b/tasmota/support_esp.ino @@ -137,34 +137,43 @@ String GetDeviceHardware(void) { #include -void NvmLoad(const char *sNvsName, const char *sName, void *pSettings, unsigned nSettingsLen) { - nvs_handle handle; - noInterrupts(); - nvs_open(sNvsName, NVS_READONLY, &handle); +bool NvmLoad(const char *sNvsName, const char *sName, void *pSettings, unsigned nSettingsLen) { + nvs_handle_t handle; +// noInterrupts(); + esp_err_t result = nvs_open(sNvsName, NVS_READONLY, &handle); + if (result != ESP_OK) { + AddLog(LOG_LEVEL_DEBUG, PSTR("NVS: Error %d"), result); + return false; + } size_t size = nSettingsLen; nvs_get_blob(handle, sName, pSettings, &size); nvs_close(handle); - interrupts(); +// interrupts(); + return true; } void NvmSave(const char *sNvsName, const char *sName, const void *pSettings, unsigned nSettingsLen) { - nvs_handle handle; - noInterrupts(); - nvs_open(sNvsName, NVS_READWRITE, &handle); + nvs_handle_t handle; +// noInterrupts(); + esp_err_t result = nvs_open(sNvsName, NVS_READWRITE, &handle); + if (result != ESP_OK) { + AddLog(LOG_LEVEL_DEBUG, PSTR("NVS: Error %d"), result); + return; + } nvs_set_blob(handle, sName, pSettings, nSettingsLen); nvs_commit(handle); nvs_close(handle); - interrupts(); +// interrupts(); } int32_t NvmErase(const char *sNvsName) { - nvs_handle handle; - noInterrupts(); + nvs_handle_t handle; +// noInterrupts(); int32_t result = nvs_open(sNvsName, NVS_READWRITE, &handle); if (ESP_OK == result) { result = nvs_erase_all(handle); } if (ESP_OK == result) { result = nvs_commit(handle); } nvs_close(handle); - interrupts(); +// interrupts(); return result; } @@ -208,23 +217,25 @@ void SettingsErase(uint8_t type) { } uint32_t SettingsRead(void *data, size_t size) { - uint32_t source = 1; -#ifdef USE_UFILESYS - if (!TfsLoadFile(TASM_FILE_SETTINGS, (uint8_t*)data, size)) { -#endif - source = 0; - NvmLoad("main", "Settings", data, size); #ifdef USE_UFILESYS + if (TfsLoadFile(TASM_FILE_SETTINGS, (uint8_t*)data, size)) { + return 2; } #endif - return source; + if (NvmLoad("main", "Settings", data, size)) { + return 1; + }; + return 0; } void SettingsWrite(const void *pSettings, unsigned nSettingsLen) { #ifdef USE_UFILESYS TfsSaveFile(TASM_FILE_SETTINGS, (const uint8_t*)pSettings, nSettingsLen); #endif - NvmSave("main", "Settings", pSettings, nSettingsLen); +#ifdef USE_WEBCAM + if (!WcStreamActive()) +#endif + NvmSave("main", "Settings", pSettings, nSettingsLen); } void QPCRead(void *pSettings, unsigned nSettingsLen) { diff --git a/tasmota/xdrv_50_filesystem.ino b/tasmota/xdrv_50_filesystem.ino index 8a0ed1d16..7150fbd85 100644 --- a/tasmota/xdrv_50_filesystem.ino +++ b/tasmota/xdrv_50_filesystem.ino @@ -294,7 +294,23 @@ bool TfsSaveFile(const char *fname, const uint8_t *buf, uint32_t len) { return false; } - file.write(buf, len); +// This will timeout on ESP32-webcam +// file.write(buf, len); + + uint32_t count = len / 512; + uint32_t chunk = len / count; + for (uint32_t i = 0; i < count; i++) { + file.write(buf + (i * chunk), chunk); + // do actually wait a little to allow ESP32 tasks to tick + // fixes task timeout in ESP32Solo1 style unicore code and webcam. + delay(10); + OsWatchLoop(); + } + uint32_t left = len % count; + if (left) { + file.write(buf + (count * chunk), left); + } + file.close(); return true; } diff --git a/tasmota/xdrv_81_esp32_webcam.ino b/tasmota/xdrv_81_esp32_webcam.ino index dca8ec936..273885049 100644 --- a/tasmota/xdrv_81_esp32_webcam.ino +++ b/tasmota/xdrv_81_esp32_webcam.ino @@ -876,6 +876,10 @@ void WcStreamControl() { WcSetup(Settings->webcam_config.resolution); } +bool WcStreamActive(void) { + return (Wc.stream_active); +} + /*********************************************************************************************/ From eb5d23131459aa3523dcc920a2e81be310323155 Mon Sep 17 00:00:00 2001 From: Barbudor Date: Sun, 12 Dec 2021 18:46:52 +0100 Subject: [PATCH 64/97] remove topic must differ from mqttclient --- tasmota/xdrv_02_9_mqtt.ino | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tasmota/xdrv_02_9_mqtt.ino b/tasmota/xdrv_02_9_mqtt.ino index a1a763b47..38f6bcd88 100644 --- a/tasmota/xdrv_02_9_mqtt.ino +++ b/tasmota/xdrv_02_9_mqtt.ino @@ -1405,7 +1405,6 @@ void CmndMqttClient(void) { void CmndFullTopic(void) { if (XdrvMailbox.data_len > 0) { MakeValidMqtt(1, XdrvMailbox.data); - if (!strcmp(XdrvMailbox.data, TasmotaGlobal.mqtt_client)) { SetShortcutDefault(); } char stemp1[TOPSZ]; strlcpy(stemp1, (SC_DEFAULT == Shortcut()) ? MQTT_FULLTOPIC : XdrvMailbox.data, sizeof(stemp1)); if (strcmp(stemp1, SettingsText(SET_MQTT_FULLTOPIC))) { @@ -1460,7 +1459,10 @@ void CmndGroupTopic(void) { if (XdrvMailbox.data_len > 0) { uint32_t settings_text_index = (1 == XdrvMailbox.index) ? SET_MQTT_GRP_TOPIC : SET_MQTT_GRP_TOPIC2 + XdrvMailbox.index - 2; MakeValidMqtt(0, XdrvMailbox.data); - if (!strcmp(XdrvMailbox.data, TasmotaGlobal.mqtt_client)) { SetShortcutDefault(); } + if (!strcmp(XdrvMailbox.data, TasmotaGlobal.mqtt_topic)) { + AddLog(LOG_LEVEL_INFO, PSTR("MQT: Error: GroupTopic must differ from Topic")); + SetShortcutDefault(); + } SettingsUpdateText(settings_text_index, (SC_CLEAR == Shortcut()) ? "" : (SC_DEFAULT == Shortcut()) ? PSTR(MQTT_GRPTOPIC) : XdrvMailbox.data); // Eliminate duplicates, have at least one and fill from index 1 @@ -1507,7 +1509,6 @@ void CmndGroupTopic(void) { void CmndTopic(void) { if (!XdrvMailbox.grpflg && (XdrvMailbox.data_len > 0)) { MakeValidMqtt(0, XdrvMailbox.data); - if (!strcmp(XdrvMailbox.data, TasmotaGlobal.mqtt_client)) { SetShortcutDefault(); } char stemp1[TOPSZ]; strlcpy(stemp1, (SC_DEFAULT == Shortcut()) ? MQTT_TOPIC : XdrvMailbox.data, sizeof(stemp1)); if (strcmp(stemp1, SettingsText(SET_MQTT_TOPIC))) { @@ -1523,7 +1524,6 @@ void CmndTopic(void) { void CmndButtonTopic(void) { if (!XdrvMailbox.grpflg && (XdrvMailbox.data_len > 0)) { MakeValidMqtt(0, XdrvMailbox.data); - if (!strcmp(XdrvMailbox.data, TasmotaGlobal.mqtt_client)) { SetShortcutDefault(); } switch (Shortcut()) { case SC_CLEAR: SettingsUpdateText(SET_MQTT_BUTTON_TOPIC, ""); break; case SC_DEFAULT: SettingsUpdateText(SET_MQTT_BUTTON_TOPIC, TasmotaGlobal.mqtt_topic); break; @@ -1537,7 +1537,6 @@ void CmndButtonTopic(void) { void CmndSwitchTopic(void) { if (!XdrvMailbox.grpflg && (XdrvMailbox.data_len > 0)) { MakeValidMqtt(0, XdrvMailbox.data); - if (!strcmp(XdrvMailbox.data, TasmotaGlobal.mqtt_client)) { SetShortcutDefault(); } switch (Shortcut()) { case SC_CLEAR: SettingsUpdateText(SET_MQTT_SWITCH_TOPIC, ""); break; case SC_DEFAULT: SettingsUpdateText(SET_MQTT_SWITCH_TOPIC, TasmotaGlobal.mqtt_topic); break; From b4e9468bbbfd905e8539c0aca178d92002227c3f Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 12 Dec 2021 18:56:11 +0100 Subject: [PATCH 65/97] Berry mapping step 1 --- lib/libesp32/Berry/default/be_modtab.c | 8 + lib/libesp32/Berry/default/be_tasmotalib.c | 105 +- lib/libesp32/Berry/default/berry_conf.h | 10 +- .../Berry/default/embedded/Tasmota.be | 24 +- lib/libesp32/Berry/gen.sh | 2 + lib/libesp32/Berry/generate/be_const_strtab.h | 6 +- .../Berry/generate/be_const_strtab_def.h | 1805 ++++++++--------- .../generate/be_fixed_be_class_tasmota.h | 155 +- lib/libesp32/Berry/generate/be_fixed_cb.h | 18 + lib/libesp32/Berry/src/be_exec.c | 5 +- lib/libesp32/Berry/src/be_gc.c | 10 +- lib/libesp32/Berry/src/be_vm.c | 6 +- lib/libesp32/Berry/src/be_vm.h | 2 - lib/libesp32/Berry/src/berry.h | 1 + lib/libesp32/berry_mapping/library.json | 17 + lib/libesp32/berry_mapping/src/be_cb_module.c | 171 ++ lib/libesp32/berry_mapping/src/be_mapping.h | 10 + tasmota/xdrv_52_0_berry_struct.ino | 1 + tasmota/xdrv_52_1_berry_native.ino | 114 +- tasmota/xdrv_52_3_berry_tasmota.ino | 38 +- tasmota/xdrv_52_9_berry.ino | 94 +- 21 files changed, 1267 insertions(+), 1335 deletions(-) create mode 100755 lib/libesp32/Berry/gen.sh create mode 100644 lib/libesp32/Berry/generate/be_fixed_cb.h create mode 100644 lib/libesp32/berry_mapping/library.json create mode 100644 lib/libesp32/berry_mapping/src/be_cb_module.c create mode 100644 lib/libesp32/berry_mapping/src/be_mapping.h diff --git a/lib/libesp32/Berry/default/be_modtab.c b/lib/libesp32/Berry/default/be_modtab.c index 47db8b24e..934400bbb 100644 --- a/lib/libesp32/Berry/default/be_modtab.c +++ b/lib/libesp32/Berry/default/be_modtab.c @@ -23,6 +23,10 @@ be_extern_native_module(solidify); be_extern_native_module(introspect); be_extern_native_module(strict); +/* Berry extensions */ +#include "be_mapping.h" +be_extern_native_module(cb); + /* Tasmota specific */ be_extern_native_module(python_compat); be_extern_native_module(re); @@ -85,6 +89,10 @@ BERRY_LOCAL const bntvmodule* const be_module_table[] = { #if BE_USE_STRICT_MODULE &be_native_module(strict), #endif + + /* Berry extensions */ + &be_native_module(cb), + /* user-defined modules register start */ &be_native_module(python_compat), diff --git a/lib/libesp32/Berry/default/be_tasmotalib.c b/lib/libesp32/Berry/default/be_tasmotalib.c index e117bae70..6539b0de3 100644 --- a/lib/libesp32/Berry/default/be_tasmotalib.c +++ b/lib/libesp32/Berry/default/be_tasmotalib.c @@ -16,7 +16,6 @@ extern int l_arch(bvm *vm); extern int l_publish(bvm *vm); extern int l_publish_result(bvm *vm); extern int l_cmd(bvm *vm); -extern int l_get_cb(bvm *vm); extern int l_getoption(bvm *vm); extern int l_millis(bvm *vm); extern int l_timereached(bvm *vm); @@ -384,7 +383,7 @@ be_local_closure(Tasmota_try_rule, /* name */ ********************************************************************/ be_local_closure(Tasmota_gen_cb, /* name */ be_nested_proto( - 7, /* nstack */ + 6, /* nstack */ 2, /* argc */ 0, /* varg */ 0, /* has upvals */ @@ -392,52 +391,18 @@ be_local_closure(Tasmota_gen_cb, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_str(_cb), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_str(find), - /* K3 */ be_nested_str(_get_cb), - /* K4 */ be_nested_str(stop_iteration), - /* K5 */ be_nested_str(internal_error), - /* K6 */ be_nested_str(No_X20callback_X20available), + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(cb), + /* K1 */ be_nested_str(gen_cb), }), &be_const_str_gen_cb, &be_const_str_solidified, - ( &(const binstruction[34]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x4C0C0000, // 0001 LDNIL R3 - 0x1C080403, // 0002 EQ R2 R2 R3 - 0x780A0002, // 0003 JMPF R2 #0007 - 0x60080013, // 0004 GETGBL R2 G19 - 0x7C080000, // 0005 CALL R2 0 - 0x90020002, // 0006 SETMBR R0 K0 R2 - 0x60080010, // 0007 GETGBL R2 G16 - 0x540E0012, // 0008 LDINT R3 19 - 0x400E0203, // 0009 CONNECT R3 K1 R3 - 0x7C080200, // 000A CALL R2 1 - 0xA8020010, // 000B EXBLK 0 #001D - 0x5C0C0400, // 000C MOVE R3 R2 - 0x7C0C0000, // 000D CALL R3 0 - 0x88100100, // 000E GETMBR R4 R0 K0 - 0x8C100902, // 000F GETMET R4 R4 K2 - 0x5C180600, // 0010 MOVE R6 R3 - 0x7C100400, // 0011 CALL R4 2 - 0x4C140000, // 0012 LDNIL R5 - 0x1C100805, // 0013 EQ R4 R4 R5 - 0x78120006, // 0014 JMPF R4 #001C - 0x88100100, // 0015 GETMBR R4 R0 K0 - 0x98100601, // 0016 SETIDX R4 R3 R1 - 0x8C100103, // 0017 GETMET R4 R0 K3 - 0x5C180600, // 0018 MOVE R6 R3 - 0x7C100400, // 0019 CALL R4 2 - 0xA8040001, // 001A EXBLK 1 1 - 0x80040800, // 001B RET 1 R4 - 0x7001FFEE, // 001C JMP #000C - 0x58080004, // 001D LDCONST R2 K4 - 0xAC080200, // 001E CATCH R2 1 0 - 0xB0080000, // 001F RAISE 2 R0 R0 - 0xB0060B06, // 0020 RAISE 1 K5 K6 - 0x80000000, // 0021 RET 0 + ( &(const binstruction[ 5]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x8C0C0501, // 0001 GETMET R3 R2 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x80040600, // 0004 RET 1 R3 }) ) ); @@ -1605,53 +1570,6 @@ be_local_closure(Tasmota_exec_rules, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: cb_dispatch -********************************************************************/ -be_local_closure(Tasmota_cb_dispatch, /* name */ - be_nested_proto( - 12, /* nstack */ - 6, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str(_cb), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_str(find), - }), - &be_const_str_cb_dispatch, - &be_const_str_solidified, - ( &(const binstruction[20]) { /* code */ - 0x88180100, // 0000 GETMBR R6 R0 K0 - 0x4C1C0000, // 0001 LDNIL R7 - 0x1C180C07, // 0002 EQ R6 R6 R7 - 0x781A0000, // 0003 JMPF R6 #0005 - 0x80060200, // 0004 RET 1 K1 - 0x88180100, // 0005 GETMBR R6 R0 K0 - 0x8C180D02, // 0006 GETMET R6 R6 K2 - 0x5C200200, // 0007 MOVE R8 R1 - 0x7C180400, // 0008 CALL R6 2 - 0x4C1C0000, // 0009 LDNIL R7 - 0x201C0C07, // 000A NE R7 R6 R7 - 0x781E0006, // 000B JMPF R7 #0013 - 0x5C1C0C00, // 000C MOVE R7 R6 - 0x5C200400, // 000D MOVE R8 R2 - 0x5C240600, // 000E MOVE R9 R3 - 0x5C280800, // 000F MOVE R10 R4 - 0x5C2C0A00, // 0010 MOVE R11 R5 - 0x7C1C0800, // 0011 CALL R7 4 - 0x80040E00, // 0012 RET 1 R7 - 0x80060200, // 0013 RET 1 K1 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: hs2rgb ********************************************************************/ @@ -2072,7 +1990,6 @@ class be_class_tasmota (scope: global, name: Tasmota) { _timers, var _ccmd, var _drivers, var - _cb, var wire1, var wire2, var global, var @@ -2094,7 +2011,6 @@ class be_class_tasmota (scope: global, name: Tasmota) { publish, func(l_publish) publish_result, func(l_publish_result) _cmd, func(l_cmd) - _get_cb, func(l_get_cb) get_option, func(l_getoption) millis, func(l_millis) time_reached, func(l_timereached) @@ -2155,7 +2071,6 @@ class be_class_tasmota (scope: global, name: Tasmota) { hs2rgb, closure(Tasmota_hs2rgb_closure) - cb_dispatch, closure(Tasmota_cb_dispatch_closure) gen_cb, closure(Tasmota_gen_cb_closure) get_light, closure(Tasmota_get_light_closure) diff --git a/lib/libesp32/Berry/default/berry_conf.h b/lib/libesp32/Berry/default/berry_conf.h index d2284ac31..607a9c612 100644 --- a/lib/libesp32/Berry/default/berry_conf.h +++ b/lib/libesp32/Berry/default/berry_conf.h @@ -65,20 +65,14 @@ **/ #define BE_DEBUG_VAR_INFO 0 -/* Macro: BE_USE_OBSERVABILITY_HOOK - * Use the obshook function to report low-level actions. - * Default: 0 - **/ -#define BE_USE_OBSERVABILITY_HOOK 1 - -/* Macro: BE_USE_OBSERVABILITY_HOOK +/* Macro: BE_USE_PERF_COUNTERS * Use the obshook function to report low-level actions. * Default: 0 **/ #define BE_USE_PERF_COUNTERS 1 /* Macro: BE_VM_OBSERVABILITY_SAMPLING - * If BE_USE_OBSERVABILITY_HOOK == 1 and BE_USE_PERF_COUNTERS == 1 + * If BE_USE_PERF_COUNTERS == 1 * then the observability hook is called regularly in the VM loop * allowing to stop infinite loops or too-long running code. * The value is a power of 2. diff --git a/lib/libesp32/Berry/default/embedded/Tasmota.be b/lib/libesp32/Berry/default/embedded/Tasmota.be index 3305d57ff..22752a47d 100644 --- a/lib/libesp32/Berry/default/embedded/Tasmota.be +++ b/lib/libesp32/Berry/default/embedded/Tasmota.be @@ -21,7 +21,6 @@ class Tasmota var _timers var _ccmd var _drivers - var _cb var wire1 var wire2 var cmd_res # store the command result, nil if disables, true if capture enabled, contains return value @@ -520,28 +519,11 @@ class Tasmota end end - - #- dispatch callback number n, with parameters v0,v1,v2,v3 -# - def cb_dispatch(n,v0,v1,v2,v3) - if self._cb == nil return 0 end - var f = self._cb.find(n) - if f != nil - return f(v0,v1,v2,v3) - end - return 0 - end - #- generate a new C callback and record the associated Berry closure -# def gen_cb(f) - if self._cb == nil self._cb = {} end # create map if not already initialized - for i:0..19 - if self._cb.find(i) == nil - #- free slot -# - self._cb[i] = f - return self._get_cb(i) - end - end - raise "internal_error", "No callback available" + # DEPRECATED + import cb + return cb.gen_cb(f) end #- convert hue/sat to rgb -# diff --git a/lib/libesp32/Berry/gen.sh b/lib/libesp32/Berry/gen.sh new file mode 100755 index 000000000..303a62c95 --- /dev/null +++ b/lib/libesp32/Berry/gen.sh @@ -0,0 +1,2 @@ +#!/bin/bash +python3 tools/pycoc/main.py -o generate src default ../berry_mapping/src -c default/berry_conf.h diff --git a/lib/libesp32/Berry/generate/be_const_strtab.h b/lib/libesp32/Berry/generate/be_const_strtab.h index 9692c8508..50198eb8f 100644 --- a/lib/libesp32/Berry/generate/be_const_strtab.h +++ b/lib/libesp32/Berry/generate/be_const_strtab.h @@ -48,7 +48,6 @@ extern const bcstring be_const_str_I2C_X3A; extern const bcstring be_const_str_LVG_X3A_X20call_X20to_X20unsupported_X20callback; extern const bcstring be_const_str_Leds; extern const bcstring be_const_str_MD5; -extern const bcstring be_const_str_No_X20callback_X20available; extern const bcstring be_const_str_None; extern const bcstring be_const_str_OPTION_A; extern const bcstring be_const_str_OneWire; @@ -175,7 +174,6 @@ extern const bcstring be_const_str__archive; extern const bcstring be_const_str__available; extern const bcstring be_const_str__begin_transmission; extern const bcstring be_const_str__buffer; -extern const bcstring be_const_str__cb; extern const bcstring be_const_str__ccmd; extern const bcstring be_const_str__class; extern const bcstring be_const_str__cmd; @@ -187,7 +185,6 @@ extern const bcstring be_const_str__end_transmission; extern const bcstring be_const_str__energy; extern const bcstring be_const_str__error; extern const bcstring be_const_str__filename; -extern const bcstring be_const_str__get_cb; extern const bcstring be_const_str__global_addr; extern const bcstring be_const_str__global_def; extern const bcstring be_const_str__lvgl; @@ -250,7 +247,7 @@ extern const bcstring be_const_str_call; extern const bcstring be_const_str_call_native; extern const bcstring be_const_str_calldepth; extern const bcstring be_const_str_can_show; -extern const bcstring be_const_str_cb_dispatch; +extern const bcstring be_const_str_cb; extern const bcstring be_const_str_cb_do_nothing; extern const bcstring be_const_str_cb_event_closure; extern const bcstring be_const_str_cb_obj; @@ -384,6 +381,7 @@ extern const bcstring be_const_str_get_bat_power; extern const bcstring be_const_str_get_bat_voltage; extern const bcstring be_const_str_get_battery_chargin_status; extern const bcstring be_const_str_get_bri; +extern const bcstring be_const_str_get_cb_list; extern const bcstring be_const_str_get_coords; extern const bcstring be_const_str_get_current_module_name; extern const bcstring be_const_str_get_current_module_path; diff --git a/lib/libesp32/Berry/generate/be_const_strtab_def.h b/lib/libesp32/Berry/generate/be_const_strtab_def.h index 44676a35e..4c195c96b 100644 --- a/lib/libesp32/Berry/generate/be_const_strtab_def.h +++ b/lib/libesp32/Berry/generate/be_const_strtab_def.h @@ -1,636 +1,634 @@ -be_define_const_str(, "", 2166136261u, 0, 0, &be_const_str_True); -be_define_const_str(_X0A, "\n", 252472541u, 0, 1, &be_const_str_i2c_enabled); -be_define_const_str(_X20, " ", 621580159u, 0, 1, &be_const_str_add_cmd); -be_define_const_str(_X21_X3D, "!=", 2428715011u, 0, 2, &be_const_str__X23autoexec_X2Ebe); -be_define_const_str(_X21_X3D_X3D, "!==", 559817114u, 0, 3, &be_const_str__X2Ew); -be_define_const_str(_X23, "#", 638357778u, 0, 1, &be_const_str_No_X20callback_X20available); -be_define_const_str(_X23autoexec_X2Ebat, "#autoexec.bat", 3382890497u, 0, 13, NULL); -be_define_const_str(_X23autoexec_X2Ebe, "#autoexec.be", 1181757091u, 0, 12, &be_const_str_assert); -be_define_const_str(_X23display_X2Eini, "#display.ini", 182218220u, 0, 12, &be_const_str_code); -be_define_const_str(_X23init_X2Ebat, "#init.bat", 3297595077u, 0, 9, &be_const_str__X2502d_X25s_X2502d); -be_define_const_str(_X23preinit_X2Ebe, "#preinit.be", 687035716u, 0, 11, &be_const_str__timers); -be_define_const_str(_X2502d_X25s_X2502d, "%02d%s%02d", 1587999717u, 0, 10, &be_const_str__X3D_X3C_X3E_X21); -be_define_const_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, "%04d-%02d-%02dT%02d:%02d:%02d", 3425528601u, 0, 29, &be_const_str_get_object_from_ptr); -be_define_const_str(_X25s_X2Eautoconf, "%s.autoconf", 3560383524u, 0, 11, &be_const_str_RES_OK); -be_define_const_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, "<Error: apply new or remove>", 2855507949u, 0, 34, &be_const_str_hs2rgb); -be_define_const_str(_X26lt_X3BNone_X26gt_X3B, "<None>", 2602165498u, 0, 12, &be_const_str__X2Fac); -be_define_const_str(_X28_X29, "()", 685372826u, 0, 2, NULL); -be_define_const_str(_X2B, "+", 772578730u, 0, 1, &be_const_str_lower); -be_define_const_str(_X2C, ",", 688690635u, 0, 1, &be_const_str_SERIAL_7O1); -be_define_const_str(_X2D_X2D_X3A_X2D_X2D, "--:--", 1370615441u, 0, 5, &be_const_str__X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E); -be_define_const_str(_X2E, ".", 722245873u, 0, 1, &be_const_str_search); -be_define_const_str(_X2E_X2E, "..", 2748622605u, 0, 2, &be_const_str__debug_present); -be_define_const_str(_X2Eautoconf, ".autoconf", 2524679088u, 0, 9, &be_const_str_false); -be_define_const_str(_X2Ebe, ".be", 1325797348u, 0, 3, &be_const_str_Tasmota); -be_define_const_str(_X2Ebec, ".bec", 3985273221u, 0, 4, &be_const_str_CFG_X3A_X20downloading_X20_X27_X25s_X27); -be_define_const_str(_X2Elen, ".len", 850842136u, 0, 4, &be_const_str__X3Cselect_X20name_X3D_X27zip_X27_X3E); -be_define_const_str(_X2Ep, ".p", 1171526419u, 0, 2, NULL); -be_define_const_str(_X2Ep1, ".p1", 249175686u, 0, 3, &be_const_str__t); -be_define_const_str(_X2Ep2, ".p2", 232398067u, 0, 3, &be_const_str_BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29); -be_define_const_str(_X2Esize, ".size", 1965188224u, 0, 5, &be_const_str_is_first_time); -be_define_const_str(_X2Etapp, ".tapp", 1363391594u, 0, 5, &be_const_str__X7B); -be_define_const_str(_X2Ew, ".w", 1255414514u, 0, 2, &be_const_str_clear); -be_define_const_str(_X2F, "/", 705468254u, 0, 1, &be_const_str_SERIAL_7O2); -be_define_const_str(_X2F_X2Eautoconf, "/.autoconf", 2212074393u, 0, 10, &be_const_str_CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27); -be_define_const_str(_X2F_X3Frst_X3D, "/?rst=", 580074707u, 0, 6, &be_const_str_SERIAL_7N2); -be_define_const_str(_X2Fac, "/ac", 3904651978u, 0, 3, &be_const_str_WS2812); -be_define_const_str(_X3A, ":", 1057798253u, 0, 1, &be_const_str_AudioFileSourceFS); -be_define_const_str(_X3C, "<", 957132539u, 0, 1, &be_const_str_digital_write); -be_define_const_str(_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 3546571739u, 0, 11, &be_const_str_LVG_X3A_X20call_X20to_X20unsupported_X20callback); -be_define_const_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 1863865923u, 0, 16, &be_const_str_rule); -be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, &be_const_str_set_chg_current); -be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str_find_op); -be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, NULL); -be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "
", 842307168u, 0, 77, &be_const_str_get_current_module_path); -be_define_const_str(_X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, "Choose a device configuration:
", 1336654704u, 0, 49, &be_const_str_delay); -be_define_const_str(_X3Clambda_X3E, "", 607256038u, 0, 8, &be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20); -be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Current auto-configuration", 4212500780u, 0, 82, &be_const_str_CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29); -be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Select new auto-configuration", 1926223891u, 0, 80, &be_const_str_CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29); -be_define_const_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, "", 510303524u, 0, 30, &be_const_str_write); -be_define_const_str(_X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, "", 3994619755u, 0, 54, &be_const_str_None); -be_define_const_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, "

Exception:
'%s'
%s

", 4252565082u, 0, 59, &be_const_str_classof); -be_define_const_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 2052843416u, 0, 25, &be_const_str_button_pressed); +be_define_const_str(, "", 2166136261u, 0, 0, NULL); +be_define_const_str(_X0A, "\n", 252472541u, 0, 1, &be_const_str_Unknown_X20command); +be_define_const_str(_X20, " ", 621580159u, 0, 1, &be_const_str_geti); +be_define_const_str(_X21_X3D, "!=", 2428715011u, 0, 2, &be_const_str_asstring); +be_define_const_str(_X21_X3D_X3D, "!==", 559817114u, 0, 3, &be_const_str_type); +be_define_const_str(_X23, "#", 638357778u, 0, 1, &be_const_str_CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found); +be_define_const_str(_X23autoexec_X2Ebat, "#autoexec.bat", 3382890497u, 0, 13, &be_const_str_arg_size); +be_define_const_str(_X23autoexec_X2Ebe, "#autoexec.be", 1181757091u, 0, 12, &be_const_str_file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27); +be_define_const_str(_X23display_X2Eini, "#display.ini", 182218220u, 0, 12, &be_const_str___lower__); +be_define_const_str(_X23init_X2Ebat, "#init.bat", 3297595077u, 0, 9, &be_const_str_SERIAL_7O2); +be_define_const_str(_X23preinit_X2Ebe, "#preinit.be", 687035716u, 0, 11, &be_const_str_SERIAL_8O2); +be_define_const_str(_X2502d_X25s_X2502d, "%02d%s%02d", 1587999717u, 0, 10, &be_const_str_yield); +be_define_const_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, "%04d-%02d-%02dT%02d:%02d:%02d", 3425528601u, 0, 29, &be_const_str__global_def); +be_define_const_str(_X25s_X2Eautoconf, "%s.autoconf", 3560383524u, 0, 11, &be_const_str_every_second); +be_define_const_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, "<Error: apply new or remove>", 2855507949u, 0, 34, &be_const_str_add_driver); +be_define_const_str(_X26lt_X3BNone_X26gt_X3B, "<None>", 2602165498u, 0, 12, &be_const_str_rand); +be_define_const_str(_X28_X29, "()", 685372826u, 0, 2, &be_const_str__X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29); +be_define_const_str(_X2B, "+", 772578730u, 0, 1, &be_const_str_gpio); +be_define_const_str(_X2C, ",", 688690635u, 0, 1, &be_const_str_add_cmd); +be_define_const_str(_X2D_X2D_X3A_X2D_X2D, "--:--", 1370615441u, 0, 5, &be_const_str_AudioOutputI2S); +be_define_const_str(_X2E, ".", 722245873u, 0, 1, NULL); +be_define_const_str(_X2E_X2E, "..", 2748622605u, 0, 2, &be_const_str__X2Ep2); +be_define_const_str(_X2Eautoconf, ".autoconf", 2524679088u, 0, 9, NULL); +be_define_const_str(_X2Ebe, ".be", 1325797348u, 0, 3, &be_const_str_sinh); +be_define_const_str(_X2Ebec, ".bec", 3985273221u, 0, 4, &be_const_str__debug_present); +be_define_const_str(_X2Elen, ".len", 850842136u, 0, 4, NULL); +be_define_const_str(_X2Ep, ".p", 1171526419u, 0, 2, &be_const_str_COLOR_WHITE); +be_define_const_str(_X2Ep1, ".p1", 249175686u, 0, 3, &be_const_str_sin); +be_define_const_str(_X2Ep2, ".p2", 232398067u, 0, 3, &be_const_str_json_fdump_map); +be_define_const_str(_X2Esize, ".size", 1965188224u, 0, 5, &be_const_str__X2Fac); +be_define_const_str(_X2Etapp, ".tapp", 1363391594u, 0, 5, NULL); +be_define_const_str(_X2Ew, ".w", 1255414514u, 0, 2, &be_const_str_member); +be_define_const_str(_X2F, "/", 705468254u, 0, 1, &be_const_str_None); +be_define_const_str(_X2F_X2Eautoconf, "/.autoconf", 2212074393u, 0, 10, &be_const_str_set_dc_voltage); +be_define_const_str(_X2F_X3Frst_X3D, "/?rst=", 580074707u, 0, 6, &be_const_str_AES_GCM); +be_define_const_str(_X2Fac, "/ac", 3904651978u, 0, 3, &be_const_str_get_current_module_path); +be_define_const_str(_X3A, ":", 1057798253u, 0, 1, &be_const_str_json_fdump); +be_define_const_str(_X3C, "<", 957132539u, 0, 1, NULL); +be_define_const_str(_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 3546571739u, 0, 11, &be_const_str_atan); +be_define_const_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 1863865923u, 0, 16, NULL); +be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, &be_const_str_HTTP_POST); +be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str_Wire); +be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, &be_const_str_color); +be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "
", 842307168u, 0, 77, &be_const_str_set_power); +be_define_const_str(_X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, "Choose a device configuration:
", 1336654704u, 0, 49, &be_const_str_bus); +be_define_const_str(_X3Clambda_X3E, "", 607256038u, 0, 8, &be_const_str_point); +be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Current auto-configuration", 4212500780u, 0, 82, &be_const_str_get_warning_level); +be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Select new auto-configuration", 1926223891u, 0, 80, &be_const_str_get_vbus_current); +be_define_const_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, "", 510303524u, 0, 30, &be_const_str_cb_event_closure); +be_define_const_str(_X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, "", 3994619755u, 0, 54, NULL); +be_define_const_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, "

Exception:
'%s'
%s

", 4252565082u, 0, 59, &be_const_str_arg); +be_define_const_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 2052843416u, 0, 25, &be_const_str_area); be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 452285201u, 0, 120, NULL); -be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, "

 (This feature requires an internet connection)

", 2719266486u, 0, 74, NULL); -be_define_const_str(_X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, "

Current configuration:

%s

", 4115655761u, 0, 46, &be_const_str_exec_tele); -be_define_const_str(_X3Cselect_X20name_X3D_X27zip_X27_X3E, "", 4247924536u, 0, 19, &be_const_str_find_key_i); +be_define_const_str(_X3D, "=", 940354920u, 0, 1, &be_const_str_listdir); +be_define_const_str(_X3D_X3C_X3E_X21, "=<>!", 2664470277u, 0, 4, &be_const_str_shared_key); +be_define_const_str(_X3D_X3D, "==", 2431966415u, 0, 2, &be_const_str_json_append); +be_define_const_str(_X3E, ">", 990687777u, 0, 1, &be_const_str_battery_present); +be_define_const_str(_X3E_X3D, ">=", 284975636u, 0, 2, &be_const_str_get_style_pad_right); +be_define_const_str(_X3F, "?", 973910158u, 0, 1, &be_const_str_redirect); +be_define_const_str(AES_GCM, "AES_GCM", 3832208678u, 0, 7, &be_const_str_clear_to); +be_define_const_str(AXP192, "AXP192", 757230128u, 0, 6, &be_const_str_BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29); +be_define_const_str(Animate_X20pc_X20is_X20out_X20of_X20range, "Animate pc is out of range", 1854929421u, 0, 26, &be_const_str_detected_X20on_X20bus); +be_define_const_str(AudioFileSource, "AudioFileSource", 2959980058u, 0, 15, &be_const_str_a); +be_define_const_str(AudioFileSourceFS, "AudioFileSourceFS", 1839147653u, 0, 17, &be_const_str_ip); +be_define_const_str(AudioGenerator, "AudioGenerator", 1839297342u, 0, 14, NULL); +be_define_const_str(AudioGeneratorMP3, "AudioGeneratorMP3", 2199818488u, 0, 17, &be_const_str_remove_cmd); +be_define_const_str(AudioGeneratorWAV, "AudioGeneratorWAV", 2746509368u, 0, 17, &be_const_str_SERIAL_7E1); +be_define_const_str(AudioOutput, "AudioOutput", 3257792048u, 0, 11, &be_const_str_wire); be_define_const_str(AudioOutputI2S, "AudioOutputI2S", 638031784u, 0, 14, NULL); -be_define_const_str(Auto_X2Dconfiguration, "Auto-configuration", 1665006109u, 0, 18, NULL); -be_define_const_str(BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, "BRY: ERROR, bad json: ", 2715135809u, 0, 22, &be_const_str_fromptr); -be_define_const_str(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "BRY: Exception> '%s' - %s", 2246990964u, 0, 25, &be_const_str_SERIAL_6N2); -be_define_const_str(BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29, "BRY: could not save compiled file %s (%s)", 736659787u, 0, 41, NULL); -be_define_const_str(BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, "BRY: failed to load _persist.json", 2991913445u, 0, 33, &be_const_str_set_time); -be_define_const_str(BUTTON_CONFIGURATION, "BUTTON_CONFIGURATION", 70820856u, 0, 20, &be_const_str_files); -be_define_const_str(CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting, "CFG: 'init.bat' done, restarting", 1569670677u, 0, 32, &be_const_str_push_path); -be_define_const_str(CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "CFG: Exception> '%s' - %s", 1228874553u, 0, 25, &be_const_str_CFG_X3A_X20removed_X20file_X20_X27_X25s_X27); -be_define_const_str(CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29, "CFG: could not run %s (%s - %s)", 1428829580u, 0, 31, &be_const_str_COLOR_BLACK); -be_define_const_str(CFG_X3A_X20downloading_X20_X27_X25s_X27, "CFG: downloading '%s'", 589480701u, 0, 21, &be_const_str_floor); -be_define_const_str(CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27, "CFG: exception '%s' - '%s'", 4095407913u, 0, 26, &be_const_str_get_option); -be_define_const_str(CFG_X3A_X20loaded_X20_X20, "CFG: loaded ", 3710273538u, 0, 13, &be_const_str_delete_all_configs); -be_define_const_str(CFG_X3A_X20loaded_X20_X27_X25s_X27, "CFG: loaded '%s'", 1699028828u, 0, 16, NULL); -be_define_const_str(CFG_X3A_X20loading_X20, "CFG: loading ", 4010361503u, 0, 13, NULL); -be_define_const_str(CFG_X3A_X20loading_X20_X27_X25s_X27, "CFG: loading '%s'", 2285306097u, 0, 17, &be_const_str_SK6812_GRBW); -be_define_const_str(CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29, "CFG: multiple autoconf files found, aborting ('%s' + '%s')", 197663371u, 0, 58, NULL); -be_define_const_str(CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found, "CFG: no '*.autoconf' file found", 127493957u, 0, 31, &be_const_str_get_free_heap); -be_define_const_str(CFG_X3A_X20ran_X20_X20, "CFG: ran ", 3579570472u, 0, 10, &be_const_str_contains); -be_define_const_str(CFG_X3A_X20removed_X20file_X20_X27_X25s_X27, "CFG: removed file '%s'", 2048602473u, 0, 22, &be_const_str_SERIAL_8E2); -be_define_const_str(CFG_X3A_X20removing_X20autoconf_X20files, "CFG: removing autoconf files", 4014704970u, 0, 28, &be_const_str_get_bat_charge_current); -be_define_const_str(CFG_X3A_X20removing_X20first_X20time_X20marker, "CFG: removing first time marker", 2125556683u, 0, 31, &be_const_str__lvgl); -be_define_const_str(CFG_X3A_X20return_code_X3D_X25i, "CFG: return_code=%i", 2059897320u, 0, 19, &be_const_str_OPTION_A); -be_define_const_str(CFG_X3A_X20running_X20, "CFG: running ", 2478334534u, 0, 13, NULL); -be_define_const_str(CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, "CFG: skipping 'display.ini' because already present in file-system", 3965549264u, 0, 66, NULL); -be_define_const_str(COLOR_BLACK, "COLOR_BLACK", 264427940u, 0, 11, NULL); -be_define_const_str(COLOR_WHITE, "COLOR_WHITE", 2536871270u, 0, 11, &be_const_str__energy); -be_define_const_str(EC_C25519, "EC_C25519", 95492591u, 0, 9, &be_const_str_gc); -be_define_const_str(EVENT_DRAW_MAIN, "EVENT_DRAW_MAIN", 1955620614u, 0, 15, &be_const_str_SERIAL_5E2); -be_define_const_str(EVENT_DRAW_PART_BEGIN, "EVENT_DRAW_PART_BEGIN", 3391865024u, 0, 21, &be_const_str_available); -be_define_const_str(EVENT_DRAW_PART_END, "EVENT_DRAW_PART_END", 3301625292u, 0, 19, &be_const_str_chars_in_string); -be_define_const_str(False, "False", 2541049336u, 0, 5, &be_const_str_set_style_line_color); -be_define_const_str(GET, "GET", 2531704439u, 0, 3, &be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E); -be_define_const_str(HTTP_GET, "HTTP_GET", 1722467738u, 0, 8, &be_const_str_I2C_Driver); -be_define_const_str(HTTP_POST, "HTTP_POST", 1999554144u, 0, 9, &be_const_str_imin); -be_define_const_str(I2C_X3A, "I2C:", 813483371u, 0, 4, &be_const_str_read24); -be_define_const_str(I2C_Driver, "I2C_Driver", 1714501658u, 0, 10, &be_const_str_addr); -be_define_const_str(LVG_X3A_X20call_X20to_X20unsupported_X20callback, "LVG: call to unsupported callback", 504176819u, 0, 33, &be_const_str_cb_dispatch); -be_define_const_str(Leds, "Leds", 2709245275u, 0, 4, &be_const_str_arg_name); +be_define_const_str(Auto_X2Dconfiguration, "Auto-configuration", 1665006109u, 0, 18, &be_const_str_Tasmota); +be_define_const_str(BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, "BRY: ERROR, bad json: ", 2715135809u, 0, 22, &be_const_str_I2C_X3A); +be_define_const_str(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "BRY: Exception> '%s' - %s", 2246990964u, 0, 25, NULL); +be_define_const_str(BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29, "BRY: could not save compiled file %s (%s)", 736659787u, 0, 41, &be_const_str_bri); +be_define_const_str(BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, "BRY: failed to load _persist.json", 2991913445u, 0, 33, &be_const_str_target); +be_define_const_str(BUTTON_CONFIGURATION, "BUTTON_CONFIGURATION", 70820856u, 0, 20, &be_const_str_SERIAL_5O1); +be_define_const_str(CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting, "CFG: 'init.bat' done, restarting", 1569670677u, 0, 32, &be_const_str_delay); +be_define_const_str(CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "CFG: Exception> '%s' - %s", 1228874553u, 0, 25, &be_const_str__p); +be_define_const_str(CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29, "CFG: could not run %s (%s - %s)", 1428829580u, 0, 31, &be_const_str_arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj); +be_define_const_str(CFG_X3A_X20downloading_X20_X27_X25s_X27, "CFG: downloading '%s'", 589480701u, 0, 21, &be_const_str_add_header); +be_define_const_str(CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27, "CFG: exception '%s' - '%s'", 4095407913u, 0, 26, &be_const_str_Tele); +be_define_const_str(CFG_X3A_X20loaded_X20_X20, "CFG: loaded ", 3710273538u, 0, 13, NULL); +be_define_const_str(CFG_X3A_X20loaded_X20_X27_X25s_X27, "CFG: loaded '%s'", 1699028828u, 0, 16, &be_const_str_fromb64); +be_define_const_str(CFG_X3A_X20loading_X20, "CFG: loading ", 4010361503u, 0, 13, &be_const_str_floor); +be_define_const_str(CFG_X3A_X20loading_X20_X27_X25s_X27, "CFG: loading '%s'", 2285306097u, 0, 17, &be_const_str_Timer); +be_define_const_str(CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29, "CFG: multiple autoconf files found, aborting ('%s' + '%s')", 197663371u, 0, 58, &be_const_str_content_stop); +be_define_const_str(CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found, "CFG: no '*.autoconf' file found", 127493957u, 0, 31, &be_const_str_byte); +be_define_const_str(CFG_X3A_X20ran_X20_X20, "CFG: ran ", 3579570472u, 0, 10, &be_const_str_draw_line_dsc_init); +be_define_const_str(CFG_X3A_X20removed_X20file_X20_X27_X25s_X27, "CFG: removed file '%s'", 2048602473u, 0, 22, &be_const_str_pixel_size); +be_define_const_str(CFG_X3A_X20removing_X20autoconf_X20files, "CFG: removing autoconf files", 4014704970u, 0, 28, &be_const_str_issubclass); +be_define_const_str(CFG_X3A_X20removing_X20first_X20time_X20marker, "CFG: removing first time marker", 2125556683u, 0, 31, NULL); +be_define_const_str(CFG_X3A_X20return_code_X3D_X25i, "CFG: return_code=%i", 2059897320u, 0, 19, &be_const_str_get_option); +be_define_const_str(CFG_X3A_X20running_X20, "CFG: running ", 2478334534u, 0, 13, &be_const_str_get_vbus_voltage); +be_define_const_str(CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, "CFG: skipping 'display.ini' because already present in file-system", 3965549264u, 0, 66, &be_const_str_create_custom_widget); +be_define_const_str(COLOR_BLACK, "COLOR_BLACK", 264427940u, 0, 11, &be_const_str_SERIAL_6N2); +be_define_const_str(COLOR_WHITE, "COLOR_WHITE", 2536871270u, 0, 11, &be_const_str_wd); +be_define_const_str(EC_C25519, "EC_C25519", 95492591u, 0, 9, &be_const_str__filename); +be_define_const_str(EVENT_DRAW_MAIN, "EVENT_DRAW_MAIN", 1955620614u, 0, 15, &be_const_str_from_to); +be_define_const_str(EVENT_DRAW_PART_BEGIN, "EVENT_DRAW_PART_BEGIN", 3391865024u, 0, 21, NULL); +be_define_const_str(EVENT_DRAW_PART_END, "EVENT_DRAW_PART_END", 3301625292u, 0, 19, &be_const_str_set_pixel_color); +be_define_const_str(False, "False", 2541049336u, 0, 5, &be_const_str_get_style_line_color); +be_define_const_str(GET, "GET", 2531704439u, 0, 3, &be_const_str_SERIAL_5N1); +be_define_const_str(HTTP_GET, "HTTP_GET", 1722467738u, 0, 8, &be_const_str_dac_voltage); +be_define_const_str(HTTP_POST, "HTTP_POST", 1999554144u, 0, 9, &be_const_str_widget_event_impl); +be_define_const_str(I2C_X3A, "I2C:", 813483371u, 0, 4, &be_const_str_WS2812); +be_define_const_str(I2C_Driver, "I2C_Driver", 1714501658u, 0, 10, &be_const_str_SERIAL_5O2); +be_define_const_str(LVG_X3A_X20call_X20to_X20unsupported_X20callback, "LVG: call to unsupported callback", 504176819u, 0, 33, &be_const_str__end_transmission); +be_define_const_str(Leds, "Leds", 2709245275u, 0, 4, &be_const_str_display_X2Eini); be_define_const_str(MD5, "MD5", 1935726387u, 0, 3, NULL); -be_define_const_str(No_X20callback_X20available, "No callback available", 633786138u, 0, 21, &be_const_str_gpio); -be_define_const_str(None, "None", 810547195u, 0, 4, &be_const_str_SERIAL_5E1); -be_define_const_str(OPTION_A, "OPTION_A", 1133299440u, 0, 8, &be_const_str_init_draw_line_dsc); -be_define_const_str(OneWire, "OneWire", 2298990722u, 0, 7, &be_const_str_Timer); -be_define_const_str(PART_MAIN, "PART_MAIN", 2473491508u, 0, 9, &be_const_str_STATE_DEFAULT); -be_define_const_str(POST, "POST", 1929554311u, 0, 4, NULL); +be_define_const_str(None, "None", 810547195u, 0, 4, &be_const_str_day); +be_define_const_str(OPTION_A, "OPTION_A", 1133299440u, 0, 8, &be_const_str_isnan); +be_define_const_str(OneWire, "OneWire", 2298990722u, 0, 7, &be_const_str_is_first_time); +be_define_const_str(PART_MAIN, "PART_MAIN", 2473491508u, 0, 9, &be_const_str__ccmd); +be_define_const_str(POST, "POST", 1929554311u, 0, 4, &be_const_str_getbits); be_define_const_str(Parameter_X20error, "Parameter error", 3840042038u, 0, 15, NULL); -be_define_const_str(RES_OK, "RES_OK", 1233817284u, 0, 6, &be_const_str_bri); -be_define_const_str(Restart_X201, "Restart 1", 3504455855u, 0, 9, &be_const_str_min); -be_define_const_str(SERIAL_5E1, "SERIAL_5E1", 1163775235u, 0, 10, &be_const_str_zero); -be_define_const_str(SERIAL_5E2, "SERIAL_5E2", 1180552854u, 0, 10, &be_const_str_lv_obj_class); -be_define_const_str(SERIAL_5N1, "SERIAL_5N1", 3313031680u, 0, 10, &be_const_str_ins_ramp); -be_define_const_str(SERIAL_5N2, "SERIAL_5N2", 3363364537u, 0, 10, NULL); -be_define_const_str(SERIAL_5O1, "SERIAL_5O1", 3782657917u, 0, 10, &be_const_str_flush); -be_define_const_str(SERIAL_5O2, "SERIAL_5O2", 3732325060u, 0, 10, NULL); +be_define_const_str(RES_OK, "RES_OK", 1233817284u, 0, 6, &be_const_str_k); +be_define_const_str(Restart_X201, "Restart 1", 3504455855u, 0, 9, &be_const_str_year); +be_define_const_str(SERIAL_5E1, "SERIAL_5E1", 1163775235u, 0, 10, &be_const_str_SERIAL_8N1); +be_define_const_str(SERIAL_5E2, "SERIAL_5E2", 1180552854u, 0, 10, &be_const_str_SERIAL_8N2); +be_define_const_str(SERIAL_5N1, "SERIAL_5N1", 3313031680u, 0, 10, NULL); +be_define_const_str(SERIAL_5N2, "SERIAL_5N2", 3363364537u, 0, 10, &be_const_str_read_sensors); +be_define_const_str(SERIAL_5O1, "SERIAL_5O1", 3782657917u, 0, 10, &be_const_str_return); +be_define_const_str(SERIAL_5O2, "SERIAL_5O2", 3732325060u, 0, 10, &be_const_str__t); be_define_const_str(SERIAL_6E1, "SERIAL_6E1", 334249486u, 0, 10, NULL); -be_define_const_str(SERIAL_6E2, "SERIAL_6E2", 317471867u, 0, 10, NULL); -be_define_const_str(SERIAL_6N1, "SERIAL_6N1", 198895701u, 0, 10, &be_const_str_char); -be_define_const_str(SERIAL_6N2, "SERIAL_6N2", 148562844u, 0, 10, &be_const_str_matrix); -be_define_const_str(SERIAL_6O1, "SERIAL_6O1", 266153272u, 0, 10, &be_const_str_atleast1); -be_define_const_str(SERIAL_6O2, "SERIAL_6O2", 316486129u, 0, 10, &be_const_str_content_send); -be_define_const_str(SERIAL_7E1, "SERIAL_7E1", 147718061u, 0, 10, &be_const_str_stop_iteration); -be_define_const_str(SERIAL_7E2, "SERIAL_7E2", 97385204u, 0, 10, &be_const_str_copy); -be_define_const_str(SERIAL_7N1, "SERIAL_7N1", 1891060246u, 0, 10, NULL); -be_define_const_str(SERIAL_7N2, "SERIAL_7N2", 1874282627u, 0, 10, &be_const_str_elif); -be_define_const_str(SERIAL_7O1, "SERIAL_7O1", 1823802675u, 0, 10, &be_const_str_init); -be_define_const_str(SERIAL_7O2, "SERIAL_7O2", 1840580294u, 0, 10, &be_const_str_global); -be_define_const_str(SERIAL_8E1, "SERIAL_8E1", 2371121616u, 0, 10, &be_const_str_scan); -be_define_const_str(SERIAL_8E2, "SERIAL_8E2", 2421454473u, 0, 10, &be_const_str_deregister_obj); -be_define_const_str(SERIAL_8N1, "SERIAL_8N1", 2369297235u, 0, 10, &be_const_str_resp_cmnd_done); -be_define_const_str(SERIAL_8N2, "SERIAL_8N2", 2386074854u, 0, 10, &be_const_str_sys); -be_define_const_str(SERIAL_8O1, "SERIAL_8O1", 289122742u, 0, 10, &be_const_str_get_vbus_current); -be_define_const_str(SERIAL_8O2, "SERIAL_8O2", 272345123u, 0, 10, &be_const_str_gamma10); -be_define_const_str(SK6812_GRBW, "SK6812_GRBW", 81157857u, 0, 11, NULL); -be_define_const_str(STATE_DEFAULT, "STATE_DEFAULT", 712406428u, 0, 13, &be_const_str_classname); -be_define_const_str(TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, "TAP: found Tasmota App '%s'", 2643152398u, 0, 27, NULL); -be_define_const_str(Tasmota, "Tasmota", 4047617668u, 0, 7, &be_const_str_top); -be_define_const_str(Tele, "Tele", 1329980653u, 0, 4, &be_const_str_exists); -be_define_const_str(Timer, "Timer", 3948127682u, 0, 5, &be_const_str_del); -be_define_const_str(True, "True", 3453902341u, 0, 4, &be_const_str_real); -be_define_const_str(Unknown_X20command, "Unknown command", 1830905432u, 0, 15, &be_const_str_get_percentage); -be_define_const_str(WS2812, "WS2812", 3539741218u, 0, 6, &be_const_str_finish); -be_define_const_str(WS2812_GRB, "WS2812_GRB", 1736405692u, 0, 10, &be_const_str_tasmota); -be_define_const_str(Wire, "Wire", 1938276536u, 0, 4, &be_const_str__begin_transmission); -be_define_const_str(_X5B, "[", 3725336506u, 0, 1, NULL); -be_define_const_str(_X5D, "]", 3624670792u, 0, 1, NULL); -be_define_const_str(_, "_", 3658226030u, 0, 1, NULL); -be_define_const_str(__iterator__, "__iterator__", 3884039703u, 0, 12, &be_const_str_pixel_count); -be_define_const_str(__lower__, "__lower__", 123855590u, 0, 9, &be_const_str_pin_mode); -be_define_const_str(__upper__, "__upper__", 3612202883u, 0, 9, &be_const_str_engine); -be_define_const_str(_anonymous_, "_anonymous_", 1957281476u, 0, 11, &be_const_str_get_light); -be_define_const_str(_archive, "_archive", 4004559404u, 0, 8, &be_const_str_cosh); -be_define_const_str(_available, "_available", 1306196581u, 0, 10, &be_const_str_is_running); -be_define_const_str(_begin_transmission, "_begin_transmission", 2779461176u, 0, 19, &be_const_str_lv_event_cb); -be_define_const_str(_buffer, "_buffer", 2044888568u, 0, 7, &be_const_str_every_50ms); -be_define_const_str(_cb, "_cb", 4043300367u, 0, 3, NULL); -be_define_const_str(_ccmd, "_ccmd", 2163421413u, 0, 5, &be_const_str_animators); -be_define_const_str(_class, "_class", 2732146350u, 0, 6, &be_const_str__X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); -be_define_const_str(_cmd, "_cmd", 3419822142u, 0, 4, NULL); -be_define_const_str(_debug_present, "_debug_present", 4063411725u, 0, 14, &be_const_str_call_native); +be_define_const_str(SERIAL_6E2, "SERIAL_6E2", 317471867u, 0, 10, &be_const_str_digital_write); +be_define_const_str(SERIAL_6N1, "SERIAL_6N1", 198895701u, 0, 10, &be_const_str__X5D); +be_define_const_str(SERIAL_6N2, "SERIAL_6N2", 148562844u, 0, 10, &be_const_str__settings_def); +be_define_const_str(SERIAL_6O1, "SERIAL_6O1", 266153272u, 0, 10, &be_const_str_couldn_X27t_X20not_X20initialize_X20noepixelbus); +be_define_const_str(SERIAL_6O2, "SERIAL_6O2", 316486129u, 0, 10, &be_const_str_deregister_obj); +be_define_const_str(SERIAL_7E1, "SERIAL_7E1", 147718061u, 0, 10, &be_const_str_call); +be_define_const_str(SERIAL_7E2, "SERIAL_7E2", 97385204u, 0, 10, &be_const_str_global); +be_define_const_str(SERIAL_7N1, "SERIAL_7N1", 1891060246u, 0, 10, &be_const_str_encrypt); +be_define_const_str(SERIAL_7N2, "SERIAL_7N2", 1874282627u, 0, 10, &be_const_str_alternate); +be_define_const_str(SERIAL_7O1, "SERIAL_7O1", 1823802675u, 0, 10, NULL); +be_define_const_str(SERIAL_7O2, "SERIAL_7O2", 1840580294u, 0, 10, &be_const_str_arch); +be_define_const_str(SERIAL_8E1, "SERIAL_8E1", 2371121616u, 0, 10, &be_const_str__available); +be_define_const_str(SERIAL_8E2, "SERIAL_8E2", 2421454473u, 0, 10, NULL); +be_define_const_str(SERIAL_8N1, "SERIAL_8N1", 2369297235u, 0, 10, &be_const_str_imin); +be_define_const_str(SERIAL_8N2, "SERIAL_8N2", 2386074854u, 0, 10, &be_const_str_gen_cb); +be_define_const_str(SERIAL_8O1, "SERIAL_8O1", 289122742u, 0, 10, &be_const_str_return_X20code_X3D_X25i); +be_define_const_str(SERIAL_8O2, "SERIAL_8O2", 272345123u, 0, 10, &be_const_str_tag); +be_define_const_str(SK6812_GRBW, "SK6812_GRBW", 81157857u, 0, 11, &be_const_str_item); +be_define_const_str(STATE_DEFAULT, "STATE_DEFAULT", 712406428u, 0, 13, &be_const_str_pop); +be_define_const_str(TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, "TAP: found Tasmota App '%s'", 2643152398u, 0, 27, &be_const_str_closure); +be_define_const_str(Tasmota, "Tasmota", 4047617668u, 0, 7, &be_const_str_dump); +be_define_const_str(Tele, "Tele", 1329980653u, 0, 4, &be_const_str_f); +be_define_const_str(Timer, "Timer", 3948127682u, 0, 5, &be_const_str_check_privileged_access); +be_define_const_str(True, "True", 3453902341u, 0, 4, &be_const_str_hs2rgb); +be_define_const_str(Unknown_X20command, "Unknown command", 1830905432u, 0, 15, &be_const_str_map); +be_define_const_str(WS2812, "WS2812", 3539741218u, 0, 6, NULL); +be_define_const_str(WS2812_GRB, "WS2812_GRB", 1736405692u, 0, 10, NULL); +be_define_const_str(Wire, "Wire", 1938276536u, 0, 4, NULL); +be_define_const_str(_X5B, "[", 3725336506u, 0, 1, &be_const_str_get_object_from_ptr); +be_define_const_str(_X5D, "]", 3624670792u, 0, 1, &be_const_str_x1); +be_define_const_str(_, "_", 3658226030u, 0, 1, &be_const_str_widget_struct_by_class); +be_define_const_str(__iterator__, "__iterator__", 3884039703u, 0, 12, &be_const_str_asin); +be_define_const_str(__lower__, "__lower__", 123855590u, 0, 9, &be_const_str_public_key); +be_define_const_str(__upper__, "__upper__", 3612202883u, 0, 9, &be_const_str_class_init_obj); +be_define_const_str(_anonymous_, "_anonymous_", 1957281476u, 0, 11, &be_const_str_matrix); +be_define_const_str(_archive, "_archive", 4004559404u, 0, 8, &be_const_str_isrunning); +be_define_const_str(_available, "_available", 1306196581u, 0, 10, &be_const_str_setitem); +be_define_const_str(_begin_transmission, "_begin_transmission", 2779461176u, 0, 19, NULL); +be_define_const_str(_buffer, "_buffer", 2044888568u, 0, 7, &be_const_str_seti); +be_define_const_str(_ccmd, "_ccmd", 2163421413u, 0, 5, &be_const_str_enabled); +be_define_const_str(_class, "_class", 2732146350u, 0, 6, &be_const_str__dirty); +be_define_const_str(_cmd, "_cmd", 3419822142u, 0, 4, &be_const_str_nan); +be_define_const_str(_debug_present, "_debug_present", 4063411725u, 0, 14, NULL); be_define_const_str(_def, "_def", 1985022181u, 0, 4, NULL); -be_define_const_str(_dirty, "_dirty", 283846766u, 0, 6, &be_const_str_get_coords); -be_define_const_str(_drivers, "_drivers", 3260328985u, 0, 8, &be_const_str__write); -be_define_const_str(_end_transmission, "_end_transmission", 3237480400u, 0, 17, NULL); -be_define_const_str(_energy, "_energy", 535372070u, 0, 7, &be_const_str_quality); -be_define_const_str(_error, "_error", 1132109656u, 0, 6, &be_const_str__ptr); -be_define_const_str(_filename, "_filename", 1430813195u, 0, 9, &be_const_str_set_text); -be_define_const_str(_get_cb, "_get_cb", 1448849122u, 0, 7, &be_const_str_find); -be_define_const_str(_global_addr, "_global_addr", 533766721u, 0, 12, &be_const_str_display_X2Eini); -be_define_const_str(_global_def, "_global_def", 646007001u, 0, 11, &be_const_str_get_warning_level); -be_define_const_str(_lvgl, "_lvgl", 2689219483u, 0, 5, &be_const_str_get_height); -be_define_const_str(_p, "_p", 1594591802u, 0, 2, &be_const_str_format); -be_define_const_str(_persist_X2Ejson, "_persist.json", 2008425138u, 0, 13, &be_const_str_value); -be_define_const_str(_ptr, "_ptr", 306235816u, 0, 4, &be_const_str_rtc); -be_define_const_str(_read, "_read", 346717030u, 0, 5, &be_const_str_is_dirty); -be_define_const_str(_request_from, "_request_from", 3965148604u, 0, 13, NULL); +be_define_const_str(_dirty, "_dirty", 283846766u, 0, 6, &be_const_str_content_start); +be_define_const_str(_drivers, "_drivers", 3260328985u, 0, 8, &be_const_str_del); +be_define_const_str(_end_transmission, "_end_transmission", 3237480400u, 0, 17, &be_const_str_math); +be_define_const_str(_energy, "_energy", 535372070u, 0, 7, &be_const_str_reduce); +be_define_const_str(_error, "_error", 1132109656u, 0, 6, NULL); +be_define_const_str(_filename, "_filename", 1430813195u, 0, 9, NULL); +be_define_const_str(_global_addr, "_global_addr", 533766721u, 0, 12, &be_const_str_add_rule); +be_define_const_str(_global_def, "_global_def", 646007001u, 0, 11, &be_const_str_destructor_cb); +be_define_const_str(_lvgl, "_lvgl", 2689219483u, 0, 5, NULL); +be_define_const_str(_p, "_p", 1594591802u, 0, 2, &be_const_str_scan); +be_define_const_str(_persist_X2Ejson, "_persist.json", 2008425138u, 0, 13, NULL); +be_define_const_str(_ptr, "_ptr", 306235816u, 0, 4, NULL); +be_define_const_str(_read, "_read", 346717030u, 0, 5, &be_const_str_calldepth); +be_define_const_str(_request_from, "_request_from", 3965148604u, 0, 13, &be_const_str_set_x); be_define_const_str(_rules, "_rules", 4266217105u, 0, 6, NULL); -be_define_const_str(_settings_def, "_settings_def", 3775560307u, 0, 13, &be_const_str_set); -be_define_const_str(_settings_ptr, "_settings_ptr", 1825772182u, 0, 13, &be_const_str_remove_cmd); -be_define_const_str(_t, "_t", 1527481326u, 0, 2, &be_const_str_draw_line_dsc_init); -be_define_const_str(_timers, "_timers", 2600100916u, 0, 7, &be_const_str_eth); -be_define_const_str(_write, "_write", 2215462825u, 0, 6, &be_const_str_v); -be_define_const_str(a, "a", 3826002220u, 0, 1, &be_const_str_add); -be_define_const_str(abs, "abs", 709362235u, 0, 3, &be_const_str_get_aps_voltage); -be_define_const_str(acos, "acos", 1006755615u, 0, 4, &be_const_str_lv); -be_define_const_str(add, "add", 993596020u, 0, 3, &be_const_str_bytes); -be_define_const_str(add_anim, "add_anim", 3980662668u, 0, 8, NULL); -be_define_const_str(add_cmd, "add_cmd", 3361630879u, 0, 7, &be_const_str_arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj); -be_define_const_str(add_driver, "add_driver", 1654458371u, 0, 10, NULL); -be_define_const_str(add_header, "add_header", 927130612u, 0, 10, &be_const_str_couldn_X27t_X20not_X20initialize_X20noepixelbus); -be_define_const_str(add_rule, "add_rule", 596540743u, 0, 8, &be_const_str_resp_cmnd_error); -be_define_const_str(addr, "addr", 1087856498u, 0, 4, &be_const_str_battery_present); -be_define_const_str(allocated, "allocated", 429986098u, 0, 9, &be_const_str_create_custom_widget); -be_define_const_str(alternate, "alternate", 1140253277u, 0, 9, &be_const_str_out_X20of_X20range); -be_define_const_str(animate, "animate", 3885786800u, 0, 7, &be_const_str_set_ldo_voltage); -be_define_const_str(animators, "animators", 279858213u, 0, 9, &be_const_str_read_bytes); -be_define_const_str(arch, "arch", 2952804297u, 0, 4, &be_const_str_arg_size); -be_define_const_str(area, "area", 2601460036u, 0, 4, &be_const_str_draw_arc); -be_define_const_str(arg, "arg", 1047474471u, 0, 3, &be_const_str_page_autoconf_mgr); -be_define_const_str(arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj, "arg must be a subclass of lv_obj", 1641882079u, 0, 32, &be_const_str_create_segment); -be_define_const_str(arg_name, "arg_name", 1345046155u, 0, 8, &be_const_str_has); +be_define_const_str(_settings_def, "_settings_def", 3775560307u, 0, 13, &be_const_str_offseta); +be_define_const_str(_settings_ptr, "_settings_ptr", 1825772182u, 0, 13, &be_const_str_event_send); +be_define_const_str(_t, "_t", 1527481326u, 0, 2, &be_const_str_resolvecmnd); +be_define_const_str(_timers, "_timers", 2600100916u, 0, 7, &be_const_str_add); +be_define_const_str(_write, "_write", 2215462825u, 0, 6, &be_const_str_read12); +be_define_const_str(a, "a", 3826002220u, 0, 1, &be_const_str_get_string); +be_define_const_str(abs, "abs", 709362235u, 0, 3, NULL); +be_define_const_str(acos, "acos", 1006755615u, 0, 4, &be_const_str_def); +be_define_const_str(add, "add", 993596020u, 0, 3, &be_const_str_zero); +be_define_const_str(add_anim, "add_anim", 3980662668u, 0, 8, &be_const_str_content_flush); +be_define_const_str(add_cmd, "add_cmd", 3361630879u, 0, 7, NULL); +be_define_const_str(add_driver, "add_driver", 1654458371u, 0, 10, &be_const_str_atan2); +be_define_const_str(add_header, "add_header", 927130612u, 0, 10, &be_const_str_set_percentage); +be_define_const_str(add_rule, "add_rule", 596540743u, 0, 8, &be_const_str_call_native); +be_define_const_str(addr, "addr", 1087856498u, 0, 4, &be_const_str_create_matrix); +be_define_const_str(allocated, "allocated", 429986098u, 0, 9, &be_const_str_toptr); +be_define_const_str(alternate, "alternate", 1140253277u, 0, 9, NULL); +be_define_const_str(animate, "animate", 3885786800u, 0, 7, &be_const_str_function); +be_define_const_str(animators, "animators", 279858213u, 0, 9, &be_const_str_traceback); +be_define_const_str(arch, "arch", 2952804297u, 0, 4, NULL); +be_define_const_str(area, "area", 2601460036u, 0, 4, &be_const_str_find); +be_define_const_str(arg, "arg", 1047474471u, 0, 3, NULL); +be_define_const_str(arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj, "arg must be a subclass of lv_obj", 1641882079u, 0, 32, &be_const_str_as); +be_define_const_str(arg_name, "arg_name", 1345046155u, 0, 8, &be_const_str_widget_height_def); be_define_const_str(arg_size, "arg_size", 3310243257u, 0, 8, NULL); be_define_const_str(as, "as", 1579491469u, 67, 2, NULL); -be_define_const_str(asin, "asin", 4272848550u, 0, 4, &be_const_str_destructor_cb); -be_define_const_str(assert, "assert", 2774883451u, 0, 6, &be_const_str_member); -be_define_const_str(asstring, "asstring", 1298225088u, 0, 8, &be_const_str_invalidate); -be_define_const_str(atan, "atan", 108579519u, 0, 4, &be_const_str_fromb64); -be_define_const_str(atan2, "atan2", 3173440503u, 0, 5, &be_const_str_millis); -be_define_const_str(atleast1, "atleast1", 1956331672u, 0, 8, &be_const_str_connected); -be_define_const_str(attrdump, "attrdump", 1521571304u, 0, 8, &be_const_str_counters); -be_define_const_str(autoexec, "autoexec", 3676861891u, 0, 8, NULL); -be_define_const_str(autorun, "autorun", 1447527407u, 0, 7, &be_const_str_return); -be_define_const_str(available, "available", 1727918744u, 0, 9, &be_const_str_fromstring); -be_define_const_str(b, "b", 3876335077u, 0, 1, &be_const_str_display); -be_define_const_str(back_forth, "back_forth", 2665042062u, 0, 10, &be_const_str_dac_voltage); -be_define_const_str(base_class, "base_class", 1107737279u, 0, 10, NULL); -be_define_const_str(battery_present, "battery_present", 3588397058u, 0, 15, &be_const_str_run_bat); -be_define_const_str(begin, "begin", 1748273790u, 0, 5, &be_const_str_gamma8); -be_define_const_str(bool, "bool", 3365180733u, 0, 4, &be_const_str_set_power); +be_define_const_str(asin, "asin", 4272848550u, 0, 4, &be_const_str_get_current_module_name); +be_define_const_str(assert, "assert", 2774883451u, 0, 6, &be_const_str_display); +be_define_const_str(asstring, "asstring", 1298225088u, 0, 8, &be_const_str_get_temp); +be_define_const_str(atan, "atan", 108579519u, 0, 4, &be_const_str_publish); +be_define_const_str(atan2, "atan2", 3173440503u, 0, 5, &be_const_str_json_fdump_list); +be_define_const_str(atleast1, "atleast1", 1956331672u, 0, 8, &be_const_str_exp); +be_define_const_str(attrdump, "attrdump", 1521571304u, 0, 8, &be_const_str_cb_do_nothing); +be_define_const_str(autoexec, "autoexec", 3676861891u, 0, 8, &be_const_str_cmd_res); +be_define_const_str(autorun, "autorun", 1447527407u, 0, 7, &be_const_str_log); +be_define_const_str(available, "available", 1727918744u, 0, 9, NULL); +be_define_const_str(b, "b", 3876335077u, 0, 1, &be_const_str_get_bri); +be_define_const_str(back_forth, "back_forth", 2665042062u, 0, 10, &be_const_str_debug); +be_define_const_str(base_class, "base_class", 1107737279u, 0, 10, &be_const_str_is_running); +be_define_const_str(battery_present, "battery_present", 3588397058u, 0, 15, NULL); +be_define_const_str(begin, "begin", 1748273790u, 0, 5, &be_const_str_char); +be_define_const_str(bool, "bool", 3365180733u, 0, 4, &be_const_str_log10); be_define_const_str(break, "break", 3378807160u, 58, 5, NULL); -be_define_const_str(bri, "bri", 2112284244u, 0, 3, &be_const_str_cos); -be_define_const_str(bus, "bus", 1607822841u, 0, 3, &be_const_str_get_vbus_voltage); -be_define_const_str(button_pressed, "button_pressed", 1694209616u, 0, 14, &be_const_str_insert); -be_define_const_str(byte, "byte", 1683620383u, 0, 4, NULL); -be_define_const_str(bytes, "bytes", 1706151940u, 0, 5, NULL); -be_define_const_str(c, "c", 3859557458u, 0, 1, &be_const_str_decrypt); -be_define_const_str(call, "call", 3018949801u, 0, 4, NULL); -be_define_const_str(call_native, "call_native", 1389147405u, 0, 11, &be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson); -be_define_const_str(calldepth, "calldepth", 3122364302u, 0, 9, &be_const_str_event_send); -be_define_const_str(can_show, "can_show", 960091187u, 0, 8, &be_const_str_ctypes_bytes_dyn); -be_define_const_str(cb_dispatch, "cb_dispatch", 1741510499u, 0, 11, &be_const_str_set_bri); -be_define_const_str(cb_do_nothing, "cb_do_nothing", 1488730702u, 0, 13, NULL); -be_define_const_str(cb_event_closure, "cb_event_closure", 3828267325u, 0, 16, NULL); -be_define_const_str(cb_obj, "cb_obj", 1195696482u, 0, 6, &be_const_str_rotate); -be_define_const_str(ceil, "ceil", 1659167240u, 0, 4, &be_const_str_set_width); -be_define_const_str(char, "char", 2823553821u, 0, 4, NULL); -be_define_const_str(chars_in_string, "chars_in_string", 3148785132u, 0, 15, &be_const_str_kv); -be_define_const_str(check_privileged_access, "check_privileged_access", 3692933968u, 0, 23, &be_const_str_group_def); +be_define_const_str(bri, "bri", 2112284244u, 0, 3, &be_const_str_set_style_pad_right); +be_define_const_str(bus, "bus", 1607822841u, 0, 3, &be_const_str_minute); +be_define_const_str(button_pressed, "button_pressed", 1694209616u, 0, 14, &be_const_str_editable); +be_define_const_str(byte, "byte", 1683620383u, 0, 4, &be_const_str_set_timeouts); +be_define_const_str(bytes, "bytes", 1706151940u, 0, 5, &be_const_str_read); +be_define_const_str(c, "c", 3859557458u, 0, 1, &be_const_str_state); +be_define_const_str(call, "call", 3018949801u, 0, 4, &be_const_str_get_coords); +be_define_const_str(call_native, "call_native", 1389147405u, 0, 11, &be_const_str_read8); +be_define_const_str(calldepth, "calldepth", 3122364302u, 0, 9, &be_const_str__X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); +be_define_const_str(can_show, "can_show", 960091187u, 0, 8, &be_const_str_month); +be_define_const_str(cb, "cb", 1428787088u, 0, 2, &be_const_str_get_bat_voltage); +be_define_const_str(cb_do_nothing, "cb_do_nothing", 1488730702u, 0, 13, &be_const_str_contains); +be_define_const_str(cb_event_closure, "cb_event_closure", 3828267325u, 0, 16, &be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E); +be_define_const_str(cb_obj, "cb_obj", 1195696482u, 0, 6, NULL); +be_define_const_str(ceil, "ceil", 1659167240u, 0, 4, NULL); +be_define_const_str(char, "char", 2823553821u, 0, 4, &be_const_str_every_50ms); +be_define_const_str(chars_in_string, "chars_in_string", 3148785132u, 0, 15, &be_const_str_draw_line_dsc); +be_define_const_str(check_privileged_access, "check_privileged_access", 3692933968u, 0, 23, &be_const_str_solidified); be_define_const_str(class, "class", 2872970239u, 57, 5, NULL); -be_define_const_str(class_init_obj, "class_init_obj", 178410604u, 0, 14, &be_const_str_set_useragent); +be_define_const_str(class_init_obj, "class_init_obj", 178410604u, 0, 14, NULL); be_define_const_str(classname, "classname", 1998589948u, 0, 9, NULL); -be_define_const_str(classof, "classof", 1796577762u, 0, 7, NULL); +be_define_const_str(classof, "classof", 1796577762u, 0, 7, &be_const_str_gamma); be_define_const_str(clear, "clear", 1550717474u, 0, 5, NULL); -be_define_const_str(clear_first_time, "clear_first_time", 632769909u, 0, 16, &be_const_str_read); -be_define_const_str(clear_to, "clear_to", 3528002130u, 0, 8, &be_const_str_geti); -be_define_const_str(close, "close", 667630371u, 0, 5, &be_const_str_depower); -be_define_const_str(closure, "closure", 1548407746u, 0, 7, &be_const_str_param); -be_define_const_str(cmd, "cmd", 4136785899u, 0, 3, &be_const_str_input); +be_define_const_str(clear_first_time, "clear_first_time", 632769909u, 0, 16, &be_const_str_get_power); +be_define_const_str(clear_to, "clear_to", 3528002130u, 0, 8, &be_const_str_tanh); +be_define_const_str(close, "close", 667630371u, 0, 5, &be_const_str_write_bit); +be_define_const_str(closure, "closure", 1548407746u, 0, 7, &be_const_str_cmd); +be_define_const_str(cmd, "cmd", 4136785899u, 0, 3, &be_const_str_get_switch); be_define_const_str(cmd_res, "cmd_res", 921166762u, 0, 7, NULL); -be_define_const_str(code, "code", 4180765940u, 0, 4, &be_const_str_null_cb); -be_define_const_str(codedump, "codedump", 1786337906u, 0, 8, NULL); -be_define_const_str(collect, "collect", 2399039025u, 0, 7, &be_const_str_json_fdump_any); -be_define_const_str(color, "color", 1031692888u, 0, 5, &be_const_str_has_arg); -be_define_const_str(compile, "compile", 1000265118u, 0, 7, NULL); -be_define_const_str(compress, "compress", 2818084237u, 0, 8, NULL); -be_define_const_str(concat, "concat", 4124019837u, 0, 6, NULL); -be_define_const_str(connect, "connect", 2866859257u, 0, 7, NULL); -be_define_const_str(connected, "connected", 1424938192u, 0, 9, &be_const_str_debug); -be_define_const_str(connection_error, "connection_error", 1358926260u, 0, 16, &be_const_str_json_fdump); -be_define_const_str(constructor_cb, "constructor_cb", 2489105297u, 0, 14, &be_const_str_minute); +be_define_const_str(code, "code", 4180765940u, 0, 4, &be_const_str_group_def); +be_define_const_str(codedump, "codedump", 1786337906u, 0, 8, &be_const_str_members); +be_define_const_str(collect, "collect", 2399039025u, 0, 7, &be_const_str_file); +be_define_const_str(color, "color", 1031692888u, 0, 5, &be_const_str_get_width); +be_define_const_str(compile, "compile", 1000265118u, 0, 7, &be_const_str_ctypes_bytes); +be_define_const_str(compress, "compress", 2818084237u, 0, 8, &be_const_str_find_op); +be_define_const_str(concat, "concat", 4124019837u, 0, 6, &be_const_str_widget_dtor_impl); +be_define_const_str(connect, "connect", 2866859257u, 0, 7, &be_const_str_stop); +be_define_const_str(connected, "connected", 1424938192u, 0, 9, &be_const_str_obj_event_base); +be_define_const_str(connection_error, "connection_error", 1358926260u, 0, 16, &be_const_str_wifi); +be_define_const_str(constructor_cb, "constructor_cb", 2489105297u, 0, 14, &be_const_str_round_start); be_define_const_str(contains, "contains", 1825239352u, 0, 8, &be_const_str_deinit); -be_define_const_str(content_button, "content_button", 1956476087u, 0, 14, &be_const_str_pixels_buffer); -be_define_const_str(content_flush, "content_flush", 214922475u, 0, 13, &be_const_str_leds); -be_define_const_str(content_send, "content_send", 1673733649u, 0, 12, &be_const_str_load); -be_define_const_str(content_send_style, "content_send_style", 1087907647u, 0, 18, &be_const_str_read8); -be_define_const_str(content_start, "content_start", 2937509069u, 0, 13, &be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf); -be_define_const_str(content_stop, "content_stop", 658554751u, 0, 12, NULL); +be_define_const_str(content_button, "content_button", 1956476087u, 0, 14, &be_const_str_write); +be_define_const_str(content_flush, "content_flush", 214922475u, 0, 13, NULL); +be_define_const_str(content_send, "content_send", 1673733649u, 0, 12, NULL); +be_define_const_str(content_send_style, "content_send_style", 1087907647u, 0, 18, &be_const_str_is_dirty); +be_define_const_str(content_start, "content_start", 2937509069u, 0, 13, NULL); +be_define_const_str(content_stop, "content_stop", 658554751u, 0, 12, &be_const_str_line_dsc); be_define_const_str(continue, "continue", 2977070660u, 59, 8, NULL); -be_define_const_str(copy, "copy", 3848464964u, 0, 4, &be_const_str_json_append); -be_define_const_str(cos, "cos", 4220379804u, 0, 3, &be_const_str_count); -be_define_const_str(cosh, "cosh", 4099687964u, 0, 4, &be_const_str_set_percentage); +be_define_const_str(copy, "copy", 3848464964u, 0, 4, &be_const_str_rad); +be_define_const_str(cos, "cos", 4220379804u, 0, 3, &be_const_str_start); +be_define_const_str(cosh, "cosh", 4099687964u, 0, 4, &be_const_str_h); be_define_const_str(couldn_X27t_X20not_X20initialize_X20noepixelbus, "couldn't not initialize noepixelbus", 2536490812u, 0, 35, NULL); -be_define_const_str(count, "count", 967958004u, 0, 5, &be_const_str_every_100ms); -be_define_const_str(counters, "counters", 4095866864u, 0, 8, &be_const_str_on); -be_define_const_str(create_custom_widget, "create_custom_widget", 1140594778u, 0, 20, &be_const_str_instance); -be_define_const_str(create_matrix, "create_matrix", 3528185923u, 0, 13, &be_const_str_dirty); -be_define_const_str(create_segment, "create_segment", 3863522719u, 0, 14, &be_const_str_exec_cmd); -be_define_const_str(ctor, "ctor", 375399343u, 0, 4, &be_const_str_tcpclient); +be_define_const_str(count, "count", 967958004u, 0, 5, &be_const_str_web_add_console_button); +be_define_const_str(counters, "counters", 4095866864u, 0, 8, &be_const_str_save); +be_define_const_str(create_custom_widget, "create_custom_widget", 1140594778u, 0, 20, &be_const_str_quality); +be_define_const_str(create_matrix, "create_matrix", 3528185923u, 0, 13, &be_const_str_y1); +be_define_const_str(create_segment, "create_segment", 3863522719u, 0, 14, &be_const_str_open); +be_define_const_str(ctor, "ctor", 375399343u, 0, 4, &be_const_str_push); be_define_const_str(ctypes_bytes, "ctypes_bytes", 3879019703u, 0, 12, NULL); -be_define_const_str(ctypes_bytes_dyn, "ctypes_bytes_dyn", 915205307u, 0, 16, &be_const_str_time_dump); -be_define_const_str(dac_voltage, "dac_voltage", 1552257222u, 0, 11, &be_const_str_reverse_gamma10); -be_define_const_str(day, "day", 3830391293u, 0, 3, &be_const_str_duration); -be_define_const_str(debug, "debug", 1483009432u, 0, 5, &be_const_str_str); -be_define_const_str(decompress, "decompress", 2887031650u, 0, 10, &be_const_str_imax); -be_define_const_str(decrypt, "decrypt", 2886974618u, 0, 7, &be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E); +be_define_const_str(ctypes_bytes_dyn, "ctypes_bytes_dyn", 915205307u, 0, 16, &be_const_str_reapply); +be_define_const_str(dac_voltage, "dac_voltage", 1552257222u, 0, 11, &be_const_str_time_reached); +be_define_const_str(day, "day", 3830391293u, 0, 3, &be_const_str_every_100ms); +be_define_const_str(debug, "debug", 1483009432u, 0, 5, &be_const_str_exec_rules); +be_define_const_str(decompress, "decompress", 2887031650u, 0, 10, NULL); +be_define_const_str(decrypt, "decrypt", 2886974618u, 0, 7, NULL); be_define_const_str(def, "def", 3310976652u, 55, 3, NULL); -be_define_const_str(deg, "deg", 3327754271u, 0, 3, &be_const_str_set_y); -be_define_const_str(deinit, "deinit", 2345559592u, 0, 6, &be_const_str_tan); -be_define_const_str(del, "del", 3478752842u, 0, 3, &be_const_str_range); -be_define_const_str(delay, "delay", 1322381784u, 0, 5, &be_const_str_shared_key); -be_define_const_str(delete_all_configs, "delete_all_configs", 2382067578u, 0, 18, &be_const_str_get_bat_voltage); -be_define_const_str(depower, "depower", 3563819571u, 0, 7, &be_const_str_get_battery_chargin_status); -be_define_const_str(deregister_obj, "deregister_obj", 3909966993u, 0, 14, &be_const_str_strip); -be_define_const_str(destructor_cb, "destructor_cb", 1930283190u, 0, 13, &be_const_str_state); -be_define_const_str(detect, "detect", 8884370u, 0, 6, &be_const_str_hex); -be_define_const_str(detected_X20on_X20bus, "detected on bus", 1432002650u, 0, 15, &be_const_str_nan); +be_define_const_str(deg, "deg", 3327754271u, 0, 3, NULL); +be_define_const_str(deinit, "deinit", 2345559592u, 0, 6, NULL); +be_define_const_str(del, "del", 3478752842u, 0, 3, NULL); +be_define_const_str(delay, "delay", 1322381784u, 0, 5, &be_const_str_run_deferred); +be_define_const_str(delete_all_configs, "delete_all_configs", 2382067578u, 0, 18, &be_const_str_wire1); +be_define_const_str(depower, "depower", 3563819571u, 0, 7, &be_const_str_get_bat_charge_current); +be_define_const_str(deregister_obj, "deregister_obj", 3909966993u, 0, 14, &be_const_str_get_alternate); +be_define_const_str(destructor_cb, "destructor_cb", 1930283190u, 0, 13, &be_const_str_p2); +be_define_const_str(detect, "detect", 8884370u, 0, 6, NULL); +be_define_const_str(detected_X20on_X20bus, "detected on bus", 1432002650u, 0, 15, &be_const_str_run); be_define_const_str(digital_read, "digital_read", 3585496928u, 0, 12, NULL); -be_define_const_str(digital_write, "digital_write", 3435877979u, 0, 13, &be_const_str_set_style_text_font); -be_define_const_str(dirty, "dirty", 2667581083u, 0, 5, NULL); -be_define_const_str(display, "display", 1164572437u, 0, 7, NULL); -be_define_const_str(display_X2Eini, "display.ini", 2646174001u, 0, 11, &be_const_str_function); +be_define_const_str(digital_write, "digital_write", 3435877979u, 0, 13, &be_const_str_gamma8); +be_define_const_str(dirty, "dirty", 2667581083u, 0, 5, &be_const_str_pop_path); +be_define_const_str(display, "display", 1164572437u, 0, 7, &be_const_str_finish); +be_define_const_str(display_X2Eini, "display.ini", 2646174001u, 0, 11, NULL); be_define_const_str(do, "do", 1646057492u, 65, 2, NULL); -be_define_const_str(draw_arc, "draw_arc", 1828251676u, 0, 8, &be_const_str_io_error); -be_define_const_str(draw_line, "draw_line", 1634465686u, 0, 9, &be_const_str_item); -be_define_const_str(draw_line_dsc, "draw_line_dsc", 4220676203u, 0, 13, &be_const_str_energy_struct); +be_define_const_str(draw_arc, "draw_arc", 1828251676u, 0, 8, &be_const_str_hour); +be_define_const_str(draw_line, "draw_line", 1634465686u, 0, 9, NULL); +be_define_const_str(draw_line_dsc, "draw_line_dsc", 4220676203u, 0, 13, &be_const_str_widget_instance_size); be_define_const_str(draw_line_dsc_init, "draw_line_dsc_init", 3866693646u, 0, 18, NULL); -be_define_const_str(due, "due", 3895530293u, 0, 3, &be_const_str_pow); +be_define_const_str(due, "due", 3895530293u, 0, 3, NULL); be_define_const_str(dump, "dump", 3663001223u, 0, 4, NULL); -be_define_const_str(duration, "duration", 799079693u, 0, 8, &be_const_str_time_reached); -be_define_const_str(editable, "editable", 60532369u, 0, 8, &be_const_str_resize); +be_define_const_str(duration, "duration", 799079693u, 0, 8, &be_const_str_rotate); +be_define_const_str(editable, "editable", 60532369u, 0, 8, &be_const_str_kv); be_define_const_str(elif, "elif", 3232090307u, 51, 4, NULL); be_define_const_str(else, "else", 3183434736u, 52, 4, NULL); -be_define_const_str(enabled, "enabled", 49525662u, 0, 7, &be_const_str_widget_width_def); -be_define_const_str(encrypt, "encrypt", 2194327650u, 0, 7, &be_const_str_introspect); -be_define_const_str(end, "end", 1787721130u, 56, 3, NULL); +be_define_const_str(enabled, "enabled", 49525662u, 0, 7, &be_const_str_write_file); +be_define_const_str(encrypt, "encrypt", 2194327650u, 0, 7, &be_const_str_static); +be_define_const_str(end, "end", 1787721130u, 56, 3, &be_const_str_try); be_define_const_str(energy_struct, "energy_struct", 1655792843u, 0, 13, NULL); -be_define_const_str(engine, "engine", 3993360443u, 0, 6, &be_const_str_obj_event_base); -be_define_const_str(erase, "erase", 1010949589u, 0, 5, &be_const_str_lv_obj); -be_define_const_str(escape, "escape", 2652972038u, 0, 6, &be_const_str_path); -be_define_const_str(eth, "eth", 2191266556u, 0, 3, &be_const_str_set_pixel_color); -be_define_const_str(event, "event", 4264611999u, 0, 5, &be_const_str_issubclass); -be_define_const_str(event_cb, "event_cb", 3128698017u, 0, 8, &be_const_str_get_power); -be_define_const_str(event_send, "event_send", 598925582u, 0, 10, &be_const_str_lvgl_event_dispatch); -be_define_const_str(every_100ms, "every_100ms", 1546407804u, 0, 11, &be_const_str_web_send_decimal); -be_define_const_str(every_50ms, "every_50ms", 2383884008u, 0, 10, &be_const_str_length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032); -be_define_const_str(every_second, "every_second", 2075451465u, 0, 12, &be_const_str_serial); +be_define_const_str(engine, "engine", 3993360443u, 0, 6, &be_const_str_widget_destructor); +be_define_const_str(erase, "erase", 1010949589u, 0, 5, &be_const_str_tolower); +be_define_const_str(escape, "escape", 2652972038u, 0, 6, &be_const_str_hex); +be_define_const_str(eth, "eth", 2191266556u, 0, 3, NULL); +be_define_const_str(event, "event", 4264611999u, 0, 5, &be_const_str_set_width); +be_define_const_str(event_cb, "event_cb", 3128698017u, 0, 8, &be_const_str_height_def); +be_define_const_str(event_send, "event_send", 598925582u, 0, 10, &be_const_str_gamma10); +be_define_const_str(every_100ms, "every_100ms", 1546407804u, 0, 11, NULL); +be_define_const_str(every_50ms, "every_50ms", 2383884008u, 0, 10, &be_const_str_page_autoconf_mgr); +be_define_const_str(every_second, "every_second", 2075451465u, 0, 12, &be_const_str_list); be_define_const_str(except, "except", 950914032u, 69, 6, NULL); -be_define_const_str(exec_cmd, "exec_cmd", 493567399u, 0, 8, &be_const_str__X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); -be_define_const_str(exec_rules, "exec_rules", 1445221092u, 0, 10, &be_const_str_write8); -be_define_const_str(exec_tele, "exec_tele", 1020751601u, 0, 9, NULL); -be_define_const_str(exists, "exists", 1002329533u, 0, 6, &be_const_str_get_bat_power); -be_define_const_str(exp, "exp", 1923516200u, 0, 3, &be_const_str_listdir); -be_define_const_str(f, "f", 3809224601u, 0, 1, NULL); +be_define_const_str(exec_cmd, "exec_cmd", 493567399u, 0, 8, &be_const_str_light); +be_define_const_str(exec_rules, "exec_rules", 1445221092u, 0, 10, &be_const_str_reverse); +be_define_const_str(exec_tele, "exec_tele", 1020751601u, 0, 9, &be_const_str_has); +be_define_const_str(exists, "exists", 1002329533u, 0, 6, &be_const_str_setbits); +be_define_const_str(exp, "exp", 1923516200u, 0, 3, &be_const_str_tasmota); +be_define_const_str(f, "f", 3809224601u, 0, 1, &be_const_str_input); be_define_const_str(false, "false", 184981848u, 62, 5, NULL); be_define_const_str(file, "file", 2867484483u, 0, 4, NULL); -be_define_const_str(file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27, "file extension is not '.be' or '.bec'", 3095719639u, 0, 37, &be_const_str_hour); -be_define_const_str(files, "files", 1055342736u, 0, 5, &be_const_str_page_autoconf_ctl); +be_define_const_str(file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27, "file extension is not '.be' or '.bec'", 3095719639u, 0, 37, NULL); +be_define_const_str(files, "files", 1055342736u, 0, 5, &be_const_str_param); be_define_const_str(find, "find", 3186656602u, 0, 4, NULL); -be_define_const_str(find_key_i, "find_key_i", 850136726u, 0, 10, &be_const_str_w); +be_define_const_str(find_key_i, "find_key_i", 850136726u, 0, 10, &be_const_str_pin); be_define_const_str(find_op, "find_op", 3766713376u, 0, 7, NULL); -be_define_const_str(finish, "finish", 1494643858u, 0, 6, &be_const_str_isinstance); -be_define_const_str(floor, "floor", 3102149661u, 0, 5, &be_const_str_get_style_bg_color); +be_define_const_str(finish, "finish", 1494643858u, 0, 6, NULL); +be_define_const_str(floor, "floor", 3102149661u, 0, 5, &be_const_str_local); be_define_const_str(flush, "flush", 3002334877u, 0, 5, NULL); be_define_const_str(for, "for", 2901640080u, 54, 3, NULL); -be_define_const_str(format, "format", 3114108242u, 0, 6, &be_const_str_pi); -be_define_const_str(from_to, "from_to", 21625507u, 0, 7, &be_const_str_static); +be_define_const_str(format, "format", 3114108242u, 0, 6, &be_const_str_memory); +be_define_const_str(from_to, "from_to", 21625507u, 0, 7, &be_const_str_load); be_define_const_str(fromb64, "fromb64", 2717019639u, 0, 7, NULL); -be_define_const_str(fromptr, "fromptr", 666189689u, 0, 7, &be_const_str_set_style_bg_color); -be_define_const_str(fromstring, "fromstring", 610302344u, 0, 10, &be_const_str_publish); -be_define_const_str(function, "function", 2664841801u, 0, 8, NULL); -be_define_const_str(gamma, "gamma", 3492353034u, 0, 5, &be_const_str_isnan); -be_define_const_str(gamma10, "gamma10", 3472052483u, 0, 7, NULL); -be_define_const_str(gamma8, "gamma8", 3802843830u, 0, 6, &be_const_str_memory); -be_define_const_str(gc, "gc", 1042313471u, 0, 2, &be_const_str_tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29); +be_define_const_str(fromptr, "fromptr", 666189689u, 0, 7, NULL); +be_define_const_str(fromstring, "fromstring", 610302344u, 0, 10, &be_const_str_get_input_power_status); +be_define_const_str(function, "function", 2664841801u, 0, 8, &be_const_str_tostring); +be_define_const_str(gamma, "gamma", 3492353034u, 0, 5, &be_const_str_widget_struct_default); +be_define_const_str(gamma10, "gamma10", 3472052483u, 0, 7, &be_const_str_get_free_heap); +be_define_const_str(gamma8, "gamma8", 3802843830u, 0, 6, &be_const_str_resp_cmnd); +be_define_const_str(gc, "gc", 1042313471u, 0, 2, NULL); be_define_const_str(gen_cb, "gen_cb", 3245227551u, 0, 6, NULL); -be_define_const_str(get, "get", 1410115415u, 0, 3, NULL); -be_define_const_str(get_alternate, "get_alternate", 1450148894u, 0, 13, &be_const_str_scale_uint); +be_define_const_str(get, "get", 1410115415u, 0, 3, &be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D); +be_define_const_str(get_alternate, "get_alternate", 1450148894u, 0, 13, NULL); be_define_const_str(get_aps_voltage, "get_aps_voltage", 2293036435u, 0, 15, NULL); -be_define_const_str(get_bat_charge_current, "get_bat_charge_current", 1385293050u, 0, 22, &be_const_str_read12); +be_define_const_str(get_bat_charge_current, "get_bat_charge_current", 1385293050u, 0, 22, &be_const_str_pi); be_define_const_str(get_bat_current, "get_bat_current", 1912106073u, 0, 15, NULL); -be_define_const_str(get_bat_power, "get_bat_power", 3067374853u, 0, 13, &be_const_str_json_fdump_list); -be_define_const_str(get_bat_voltage, "get_bat_voltage", 706676538u, 0, 15, &be_const_str_save_before_restart); -be_define_const_str(get_battery_chargin_status, "get_battery_chargin_status", 2233241571u, 0, 26, &be_const_str_split); -be_define_const_str(get_bri, "get_bri", 2041809895u, 0, 7, &be_const_str_math); -be_define_const_str(get_coords, "get_coords", 1044089006u, 0, 10, &be_const_str_get_temp); -be_define_const_str(get_current_module_name, "get_current_module_name", 2379270740u, 0, 23, &be_const_str_get_width); +be_define_const_str(get_bat_power, "get_bat_power", 3067374853u, 0, 13, &be_const_str_ins_time); +be_define_const_str(get_bat_voltage, "get_bat_voltage", 706676538u, 0, 15, NULL); +be_define_const_str(get_battery_chargin_status, "get_battery_chargin_status", 2233241571u, 0, 26, NULL); +be_define_const_str(get_bri, "get_bri", 2041809895u, 0, 7, &be_const_str_page_autoconf_ctl); +be_define_const_str(get_cb_list, "get_cb_list", 1605319182u, 0, 11, &be_const_str_offset); +be_define_const_str(get_coords, "get_coords", 1044089006u, 0, 10, &be_const_str_upper); +be_define_const_str(get_current_module_name, "get_current_module_name", 2379270740u, 0, 23, NULL); be_define_const_str(get_current_module_path, "get_current_module_path", 3206673408u, 0, 23, NULL); -be_define_const_str(get_free_heap, "get_free_heap", 625069757u, 0, 13, &be_const_str_push); -be_define_const_str(get_height, "get_height", 3571755523u, 0, 10, &be_const_str_ins_goto); -be_define_const_str(get_input_power_status, "get_input_power_status", 4102829177u, 0, 22, NULL); -be_define_const_str(get_light, "get_light", 381930476u, 0, 9, &be_const_str_setitem); -be_define_const_str(get_object_from_ptr, "get_object_from_ptr", 2345019201u, 0, 19, &be_const_str_log); +be_define_const_str(get_free_heap, "get_free_heap", 625069757u, 0, 13, &be_const_str_no_X20GPIO_X20specified_X20for_X20neopixelbus); +be_define_const_str(get_height, "get_height", 3571755523u, 0, 10, &be_const_str_obj_class_create_obj); +be_define_const_str(get_input_power_status, "get_input_power_status", 4102829177u, 0, 22, &be_const_str_get_style_bg_color); +be_define_const_str(get_light, "get_light", 381930476u, 0, 9, &be_const_str_unknown_X20instruction); +be_define_const_str(get_object_from_ptr, "get_object_from_ptr", 2345019201u, 0, 19, NULL); be_define_const_str(get_option, "get_option", 2123730033u, 0, 10, NULL); be_define_const_str(get_percentage, "get_percentage", 2880483992u, 0, 14, NULL); be_define_const_str(get_pixel_color, "get_pixel_color", 337490048u, 0, 15, NULL); -be_define_const_str(get_power, "get_power", 3009799377u, 0, 9, &be_const_str_open); -be_define_const_str(get_size, "get_size", 2803644713u, 0, 8, NULL); -be_define_const_str(get_string, "get_string", 4195847969u, 0, 10, NULL); -be_define_const_str(get_style_bg_color, "get_style_bg_color", 964794381u, 0, 18, &be_const_str_r); -be_define_const_str(get_style_line_color, "get_style_line_color", 805371932u, 0, 20, &be_const_str_time_str); +be_define_const_str(get_power, "get_power", 3009799377u, 0, 9, NULL); +be_define_const_str(get_size, "get_size", 2803644713u, 0, 8, &be_const_str_tomap); +be_define_const_str(get_string, "get_string", 4195847969u, 0, 10, &be_const_str_remove_driver); +be_define_const_str(get_style_bg_color, "get_style_bg_color", 964794381u, 0, 18, &be_const_str_number); +be_define_const_str(get_style_line_color, "get_style_line_color", 805371932u, 0, 20, &be_const_str_ins_ramp); be_define_const_str(get_style_pad_right, "get_style_pad_right", 3150287466u, 0, 19, NULL); -be_define_const_str(get_switch, "get_switch", 164821028u, 0, 10, &be_const_str_isrunning); -be_define_const_str(get_tasmota, "get_tasmota", 334356779u, 0, 11, &be_const_str_getbits); +be_define_const_str(get_switch, "get_switch", 164821028u, 0, 10, &be_const_str_set_y); +be_define_const_str(get_tasmota, "get_tasmota", 334356779u, 0, 11, &be_const_str_imax); be_define_const_str(get_temp, "get_temp", 3370919486u, 0, 8, NULL); -be_define_const_str(get_vbus_current, "get_vbus_current", 1205347942u, 0, 16, &be_const_str_while); -be_define_const_str(get_vbus_voltage, "get_vbus_voltage", 2398210401u, 0, 16, &be_const_str_return_X20code_X3D_X25i); -be_define_const_str(get_warning_level, "get_warning_level", 1737834441u, 0, 17, &be_const_str_map); -be_define_const_str(get_width, "get_width", 3293417300u, 0, 9, NULL); -be_define_const_str(getbits, "getbits", 3094168979u, 0, 7, &be_const_str_tag); -be_define_const_str(geti, "geti", 2381006490u, 0, 4, &be_const_str_k); -be_define_const_str(global, "global", 503252654u, 0, 6, &be_const_str_widget_constructor); -be_define_const_str(gpio, "gpio", 2638155258u, 0, 4, &be_const_str_line_dsc); -be_define_const_str(group_def, "group_def", 1524213328u, 0, 9, &be_const_str_web_send); -be_define_const_str(h, "h", 3977000791u, 0, 1, &be_const_str_value_error); -be_define_const_str(has, "has", 3988721635u, 0, 3, NULL); -be_define_const_str(has_arg, "has_arg", 424878688u, 0, 7, &be_const_str_rad); -be_define_const_str(height_def, "height_def", 2348238838u, 0, 10, &be_const_str_wire2); -be_define_const_str(hex, "hex", 4273249610u, 0, 3, &be_const_str_register_obj); -be_define_const_str(hour, "hour", 3053661199u, 0, 4, &be_const_str_widget_ctor_impl); -be_define_const_str(hs2rgb, "hs2rgb", 1040816349u, 0, 6, NULL); -be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s/%s.autoconf", 2743526309u, 0, 70, NULL); -be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s_manifest.json", 3657552045u, 0, 72, NULL); -be_define_const_str(i2c_enabled, "i2c_enabled", 218388101u, 0, 11, &be_const_str_keys); -be_define_const_str(id, "id", 926444256u, 0, 2, &be_const_str_print); +be_define_const_str(get_vbus_current, "get_vbus_current", 1205347942u, 0, 16, &be_const_str_tele); +be_define_const_str(get_vbus_voltage, "get_vbus_voltage", 2398210401u, 0, 16, &be_const_str_toupper); +be_define_const_str(get_warning_level, "get_warning_level", 1737834441u, 0, 17, NULL); +be_define_const_str(get_width, "get_width", 3293417300u, 0, 9, &be_const_str_readbytes); +be_define_const_str(getbits, "getbits", 3094168979u, 0, 7, &be_const_str_has_arg); +be_define_const_str(geti, "geti", 2381006490u, 0, 4, NULL); +be_define_const_str(global, "global", 503252654u, 0, 6, NULL); +be_define_const_str(gpio, "gpio", 2638155258u, 0, 4, &be_const_str_strptime); +be_define_const_str(group_def, "group_def", 1524213328u, 0, 9, NULL); +be_define_const_str(h, "h", 3977000791u, 0, 1, &be_const_str_init); +be_define_const_str(has, "has", 3988721635u, 0, 3, &be_const_str_pow); +be_define_const_str(has_arg, "has_arg", 424878688u, 0, 7, &be_const_str__X7D); +be_define_const_str(height_def, "height_def", 2348238838u, 0, 10, &be_const_str_set_height); +be_define_const_str(hex, "hex", 4273249610u, 0, 3, &be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson); +be_define_const_str(hour, "hour", 3053661199u, 0, 4, &be_const_str_pixel_count); +be_define_const_str(hs2rgb, "hs2rgb", 1040816349u, 0, 6, &be_const_str_path); +be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s/%s.autoconf", 2743526309u, 0, 70, &be_const_str_pc_abs); +be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s_manifest.json", 3657552045u, 0, 72, &be_const_str_int); +be_define_const_str(i2c_enabled, "i2c_enabled", 218388101u, 0, 11, NULL); +be_define_const_str(id, "id", 926444256u, 0, 2, &be_const_str_x); be_define_const_str(if, "if", 959999494u, 50, 2, NULL); -be_define_const_str(imax, "imax", 3084515410u, 0, 4, NULL); -be_define_const_str(imin, "imin", 2714127864u, 0, 4, &be_const_str_members); +be_define_const_str(imax, "imax", 3084515410u, 0, 4, &be_const_str_resize); +be_define_const_str(imin, "imin", 2714127864u, 0, 4, NULL); be_define_const_str(import, "import", 288002260u, 66, 6, NULL); -be_define_const_str(init, "init", 380752755u, 0, 4, NULL); -be_define_const_str(init_draw_line_dsc, "init_draw_line_dsc", 2507936040u, 0, 18, &be_const_str_pop); -be_define_const_str(input, "input", 4191711099u, 0, 5, &be_const_str_json); +be_define_const_str(init, "init", 380752755u, 0, 4, &be_const_str_pc_rel); +be_define_const_str(init_draw_line_dsc, "init_draw_line_dsc", 2507936040u, 0, 18, NULL); +be_define_const_str(input, "input", 4191711099u, 0, 5, &be_const_str_reset); be_define_const_str(ins_goto, "ins_goto", 1342843963u, 0, 8, NULL); -be_define_const_str(ins_ramp, "ins_ramp", 1068049360u, 0, 8, &be_const_str_wire_scan); -be_define_const_str(ins_time, "ins_time", 2980245553u, 0, 8, &be_const_str_target_search); -be_define_const_str(insert, "insert", 3332609576u, 0, 6, NULL); -be_define_const_str(instance, "instance", 193386898u, 0, 8, NULL); +be_define_const_str(ins_ramp, "ins_ramp", 1068049360u, 0, 8, &be_const_str_stop_iteration); +be_define_const_str(ins_time, "ins_time", 2980245553u, 0, 8, NULL); +be_define_const_str(insert, "insert", 3332609576u, 0, 6, &be_const_str_lvgl_event_dispatch); +be_define_const_str(instance, "instance", 193386898u, 0, 8, &be_const_str_set_matrix_pixel_color); be_define_const_str(instance_size, "instance_size", 4280269518u, 0, 13, NULL); -be_define_const_str(int, "int", 2515107422u, 0, 3, NULL); -be_define_const_str(internal_error, "internal_error", 2519158169u, 0, 14, &be_const_str_offseta); -be_define_const_str(introspect, "introspect", 164638290u, 0, 10, &be_const_str_widget_dtor_impl); -be_define_const_str(invalidate, "invalidate", 2649734928u, 0, 10, &be_const_str_no_X20GPIO_X20specified_X20for_X20neopixelbus); -be_define_const_str(io_error, "io_error", 1970281036u, 0, 8, &be_const_str_readbytes); -be_define_const_str(ip, "ip", 1261996636u, 0, 2, &be_const_str_super); -be_define_const_str(is_dirty, "is_dirty", 418034110u, 0, 8, &be_const_str_rand); -be_define_const_str(is_first_time, "is_first_time", 275242384u, 0, 13, &be_const_str_local); -be_define_const_str(is_running, "is_running", 2226847261u, 0, 10, &be_const_str_reverse); -be_define_const_str(isinstance, "isinstance", 3669352738u, 0, 10, NULL); -be_define_const_str(isnan, "isnan", 2981347434u, 0, 5, NULL); -be_define_const_str(isrunning, "isrunning", 1688182268u, 0, 9, &be_const_str_refr_size); -be_define_const_str(issubclass, "issubclass", 4078395519u, 0, 10, NULL); -be_define_const_str(item, "item", 2671260646u, 0, 4, &be_const_str_widget_editable); -be_define_const_str(iter, "iter", 3124256359u, 0, 4, &be_const_str_class); +be_define_const_str(int, "int", 2515107422u, 0, 3, &be_const_str_set_style_text_font); +be_define_const_str(internal_error, "internal_error", 2519158169u, 0, 14, &be_const_str_width_def); +be_define_const_str(introspect, "introspect", 164638290u, 0, 10, &be_const_str_preinit); +be_define_const_str(invalidate, "invalidate", 2649734928u, 0, 10, NULL); +be_define_const_str(io_error, "io_error", 1970281036u, 0, 8, NULL); +be_define_const_str(ip, "ip", 1261996636u, 0, 2, NULL); +be_define_const_str(is_dirty, "is_dirty", 418034110u, 0, 8, &be_const_str_on); +be_define_const_str(is_first_time, "is_first_time", 275242384u, 0, 13, &be_const_str_persist); +be_define_const_str(is_running, "is_running", 2226847261u, 0, 10, &be_const_str__X7B_X7D); +be_define_const_str(isinstance, "isinstance", 3669352738u, 0, 10, &be_const_str_last_modified); +be_define_const_str(isnan, "isnan", 2981347434u, 0, 5, &be_const_str_iter); +be_define_const_str(isrunning, "isrunning", 1688182268u, 0, 9, NULL); +be_define_const_str(issubclass, "issubclass", 4078395519u, 0, 10, &be_const_str_setmember); +be_define_const_str(item, "item", 2671260646u, 0, 4, &be_const_str_json_fdump_any); +be_define_const_str(iter, "iter", 3124256359u, 0, 4, &be_const_str_name); be_define_const_str(json, "json", 916562499u, 0, 4, NULL); -be_define_const_str(json_append, "json_append", 3002019284u, 0, 11, NULL); -be_define_const_str(json_fdump, "json_fdump", 1694216580u, 0, 10, &be_const_str_nil); -be_define_const_str(json_fdump_any, "json_fdump_any", 3348629385u, 0, 14, &be_const_str_pixel_size); -be_define_const_str(json_fdump_list, "json_fdump_list", 3903879853u, 0, 15, &be_const_str_json_fdump_map); -be_define_const_str(json_fdump_map, "json_fdump_map", 4091954653u, 0, 14, &be_const_str_select); -be_define_const_str(k, "k", 3993778410u, 0, 1, &be_const_str_set_auth); -be_define_const_str(keys, "keys", 4182378701u, 0, 4, NULL); -be_define_const_str(kv, "kv", 1497177492u, 0, 2, &be_const_str_persist_X2E_p_X20is_X20not_X20a_X20map); +be_define_const_str(json_append, "json_append", 3002019284u, 0, 11, &be_const_str_import); +be_define_const_str(json_fdump, "json_fdump", 1694216580u, 0, 10, NULL); +be_define_const_str(json_fdump_any, "json_fdump_any", 3348629385u, 0, 14, NULL); +be_define_const_str(json_fdump_list, "json_fdump_list", 3903879853u, 0, 15, &be_const_str_millis); +be_define_const_str(json_fdump_map, "json_fdump_map", 4091954653u, 0, 14, &be_const_str_save_before_restart); +be_define_const_str(k, "k", 3993778410u, 0, 1, &be_const_str_keys); +be_define_const_str(keys, "keys", 4182378701u, 0, 4, &be_const_str_min); +be_define_const_str(kv, "kv", 1497177492u, 0, 2, NULL); be_define_const_str(last_modified, "last_modified", 772177145u, 0, 13, NULL); -be_define_const_str(leds, "leds", 558858555u, 0, 4, &be_const_str__X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); -be_define_const_str(length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032, "length in bits must be between 0 and 32", 2584509128u, 0, 39, &be_const_str_lv_event); +be_define_const_str(leds, "leds", 558858555u, 0, 4, &be_const_str_elif); +be_define_const_str(length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032, "length in bits must be between 0 and 32", 2584509128u, 0, 39, &be_const_str_false); be_define_const_str(light, "light", 3801947695u, 0, 5, NULL); -be_define_const_str(line_dsc, "line_dsc", 4094490978u, 0, 8, &be_const_str_offset); +be_define_const_str(line_dsc, "line_dsc", 4094490978u, 0, 8, &be_const_str_print); be_define_const_str(list, "list", 217798785u, 0, 4, NULL); be_define_const_str(listdir, "listdir", 2005220720u, 0, 7, NULL); be_define_const_str(load, "load", 3859241449u, 0, 4, NULL); -be_define_const_str(load_templates, "load_templates", 3513870133u, 0, 14, NULL); -be_define_const_str(local, "local", 2621662984u, 0, 5, &be_const_str_round_start); -be_define_const_str(log, "log", 1062293841u, 0, 3, &be_const_str_read_sensors); -be_define_const_str(log10, "log10", 2346846000u, 0, 5, NULL); -be_define_const_str(loop, "loop", 3723446379u, 0, 4, NULL); -be_define_const_str(lower, "lower", 3038577850u, 0, 5, &be_const_str_end); -be_define_const_str(lv, "lv", 1529997255u, 0, 2, &be_const_str_x); -be_define_const_str(lv_event, "lv_event", 2434089968u, 0, 8, &be_const_str_remove_rule); -be_define_const_str(lv_event_cb, "lv_event_cb", 2480731016u, 0, 11, &be_const_str_run_deferred); -be_define_const_str(lv_obj, "lv_obj", 4257833149u, 0, 6, &be_const_str_traceback); +be_define_const_str(load_templates, "load_templates", 3513870133u, 0, 14, &be_const_str_set_bri); +be_define_const_str(local, "local", 2621662984u, 0, 5, NULL); +be_define_const_str(log, "log", 1062293841u, 0, 3, &be_const_str_the_X20second_X20argument_X20is_X20not_X20a_X20function); +be_define_const_str(log10, "log10", 2346846000u, 0, 5, &be_const_str_web_add_handler); +be_define_const_str(loop, "loop", 3723446379u, 0, 4, &be_const_str_continue); +be_define_const_str(lower, "lower", 3038577850u, 0, 5, &be_const_str_push_path); +be_define_const_str(lv, "lv", 1529997255u, 0, 2, NULL); +be_define_const_str(lv_event, "lv_event", 2434089968u, 0, 8, &be_const_str_set_timer); +be_define_const_str(lv_event_cb, "lv_event_cb", 2480731016u, 0, 11, &be_const_str_try_rule); +be_define_const_str(lv_obj, "lv_obj", 4257833149u, 0, 6, NULL); be_define_const_str(lv_obj_class, "lv_obj_class", 4039656294u, 0, 12, NULL); -be_define_const_str(lvgl_event_dispatch, "lvgl_event_dispatch", 2104396622u, 0, 19, &be_const_str_set_matrix_pixel_color); -be_define_const_str(map, "map", 3751997361u, 0, 3, &be_const_str_redirect); -be_define_const_str(math, "math", 4001929615u, 0, 4, NULL); -be_define_const_str(matrix, "matrix", 365099244u, 0, 6, NULL); -be_define_const_str(member, "member", 719708611u, 0, 6, NULL); -be_define_const_str(members, "members", 937576464u, 0, 7, &be_const_str_target); -be_define_const_str(memory, "memory", 2229924270u, 0, 6, &be_const_str_resp_cmnd_str); -be_define_const_str(millis, "millis", 1214679063u, 0, 6, NULL); -be_define_const_str(min, "min", 3381609815u, 0, 3, &be_const_str_widget_cb); +be_define_const_str(lvgl_event_dispatch, "lvgl_event_dispatch", 2104396622u, 0, 19, &be_const_str_rule); +be_define_const_str(map, "map", 3751997361u, 0, 3, NULL); +be_define_const_str(math, "math", 4001929615u, 0, 4, &be_const_str_widget_event_cb); +be_define_const_str(matrix, "matrix", 365099244u, 0, 6, &be_const_str_pixels_buffer); +be_define_const_str(member, "member", 719708611u, 0, 6, &be_const_str_web_add_management_button); +be_define_const_str(members, "members", 937576464u, 0, 7, &be_const_str_remove_rule); +be_define_const_str(memory, "memory", 2229924270u, 0, 6, NULL); +be_define_const_str(millis, "millis", 1214679063u, 0, 6, &be_const_str_module); +be_define_const_str(min, "min", 3381609815u, 0, 3, NULL); be_define_const_str(minute, "minute", 954666857u, 0, 6, NULL); -be_define_const_str(module, "module", 3617558685u, 0, 6, &be_const_str_percentage); -be_define_const_str(month, "month", 3598321157u, 0, 5, NULL); +be_define_const_str(module, "module", 3617558685u, 0, 6, &be_const_str_setrange); +be_define_const_str(month, "month", 3598321157u, 0, 5, &be_const_str_web_send); be_define_const_str(name, "name", 2369371622u, 0, 4, NULL); -be_define_const_str(nan, "nan", 797905850u, 0, 3, NULL); +be_define_const_str(nan, "nan", 797905850u, 0, 3, &be_const_str_size); be_define_const_str(nil, "nil", 228849900u, 63, 3, NULL); -be_define_const_str(no_X20GPIO_X20specified_X20for_X20neopixelbus, "no GPIO specified for neopixelbus", 42078528u, 0, 33, &be_const_str_number); -be_define_const_str(null_cb, "null_cb", 2333536460u, 0, 7, &be_const_str_public_key); -be_define_const_str(number, "number", 467038368u, 0, 6, NULL); -be_define_const_str(obj_class_create_obj, "obj_class_create_obj", 3304390632u, 0, 20, &be_const_str_write_bytes); +be_define_const_str(no_X20GPIO_X20specified_X20for_X20neopixelbus, "no GPIO specified for neopixelbus", 42078528u, 0, 33, NULL); +be_define_const_str(null_cb, "null_cb", 2333536460u, 0, 7, NULL); +be_define_const_str(number, "number", 467038368u, 0, 6, &be_const_str_range); +be_define_const_str(obj_class_create_obj, "obj_class_create_obj", 3304390632u, 0, 20, NULL); be_define_const_str(obj_event_base, "obj_event_base", 1624064363u, 0, 14, NULL); -be_define_const_str(offset, "offset", 348705738u, 0, 6, &be_const_str_sec); +be_define_const_str(offset, "offset", 348705738u, 0, 6, &be_const_str_web_add_button); be_define_const_str(offseta, "offseta", 1663383089u, 0, 7, NULL); -be_define_const_str(on, "on", 1630810064u, 0, 2, NULL); -be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will cause a restart.\");'>", 232646018u, 0, 57, NULL); -be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will change the current configuration and cause a restart.\");'>", 3792412559u, 0, 94, &be_const_str_sqrt); -be_define_const_str(open, "open", 3546203337u, 0, 4, NULL); +be_define_const_str(on, "on", 1630810064u, 0, 2, &be_const_str_webclient); +be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will cause a restart.\");'>", 232646018u, 0, 57, &be_const_str_wire2); +be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will change the current configuration and cause a restart.\");'>", 3792412559u, 0, 94, &be_const_str_srand); +be_define_const_str(open, "open", 3546203337u, 0, 4, &be_const_str_search); be_define_const_str(out_X20of_X20range, "out of range", 2236631477u, 0, 12, NULL); -be_define_const_str(p1, "p1", 2689521274u, 0, 2, &be_const_str_widget_event_cb); -be_define_const_str(p2, "p2", 2672743655u, 0, 2, NULL); -be_define_const_str(page_autoconf_ctl, "page_autoconf_ctl", 2453381496u, 0, 17, &be_const_str_pc_rel); -be_define_const_str(page_autoconf_mgr, "page_autoconf_mgr", 3643937031u, 0, 17, &be_const_str_reduce); -be_define_const_str(param, "param", 1309554226u, 0, 5, &be_const_str_set_dcdc_enable); -be_define_const_str(path, "path", 2223459638u, 0, 4, &be_const_str_pop_path); -be_define_const_str(pc, "pc", 1313756516u, 0, 2, &be_const_str_zip); -be_define_const_str(pc_abs, "pc_abs", 920256495u, 0, 6, NULL); -be_define_const_str(pc_rel, "pc_rel", 991921176u, 0, 6, NULL); -be_define_const_str(percentage, "percentage", 2538831285u, 0, 10, &be_const_str_web_add_config_button); +be_define_const_str(p1, "p1", 2689521274u, 0, 2, NULL); +be_define_const_str(p2, "p2", 2672743655u, 0, 2, &be_const_str_set_alternate); +be_define_const_str(page_autoconf_ctl, "page_autoconf_ctl", 2453381496u, 0, 17, NULL); +be_define_const_str(page_autoconf_mgr, "page_autoconf_mgr", 3643937031u, 0, 17, &be_const_str_write8); +be_define_const_str(param, "param", 1309554226u, 0, 5, &be_const_str_resp_cmnd_error); +be_define_const_str(path, "path", 2223459638u, 0, 4, &be_const_str_real); +be_define_const_str(pc, "pc", 1313756516u, 0, 2, &be_const_str_nil); +be_define_const_str(pc_abs, "pc_abs", 920256495u, 0, 6, &be_const_str_set); +be_define_const_str(pc_rel, "pc_rel", 991921176u, 0, 6, &be_const_str_web_add_config_button); +be_define_const_str(percentage, "percentage", 2538831285u, 0, 10, &be_const_str_tcpclient); be_define_const_str(persist, "persist", 3917083779u, 0, 7, NULL); -be_define_const_str(persist_X2E_p_X20is_X20not_X20a_X20map, "persist._p is not a map", 1176528732u, 0, 23, &be_const_str_publish_result); -be_define_const_str(pi, "pi", 1213090802u, 0, 2, &be_const_str_set_alternate); -be_define_const_str(pin, "pin", 1866532500u, 0, 3, &be_const_str_running); -be_define_const_str(pin_mode, "pin_mode", 3258314030u, 0, 8, &be_const_str_set_first_time); -be_define_const_str(pin_used, "pin_used", 4033854612u, 0, 8, &be_const_str_reapply); +be_define_const_str(persist_X2E_p_X20is_X20not_X20a_X20map, "persist._p is not a map", 1176528732u, 0, 23, NULL); +be_define_const_str(pi, "pi", 1213090802u, 0, 2, NULL); +be_define_const_str(pin, "pin", 1866532500u, 0, 3, NULL); +be_define_const_str(pin_mode, "pin_mode", 3258314030u, 0, 8, &be_const_str_set_ldo_voltage); +be_define_const_str(pin_used, "pin_used", 4033854612u, 0, 8, &be_const_str_set_auth); be_define_const_str(pixel_count, "pixel_count", 2439130743u, 0, 11, NULL); be_define_const_str(pixel_size, "pixel_size", 2209135785u, 0, 10, NULL); be_define_const_str(pixels_buffer, "pixels_buffer", 1229555807u, 0, 13, NULL); -be_define_const_str(point, "point", 414084241u, 0, 5, &be_const_str_setmember); -be_define_const_str(pop, "pop", 1362321360u, 0, 3, NULL); +be_define_const_str(point, "point", 414084241u, 0, 5, NULL); +be_define_const_str(pop, "pop", 1362321360u, 0, 3, &be_const_str_resp_cmnd_failed); be_define_const_str(pop_path, "pop_path", 2403243998u, 0, 8, NULL); -be_define_const_str(pow, "pow", 1479764693u, 0, 3, NULL); -be_define_const_str(preinit, "preinit", 2722007100u, 0, 7, NULL); -be_define_const_str(print, "print", 372738696u, 0, 5, &be_const_str_else); -be_define_const_str(public_key, "public_key", 4169142980u, 0, 10, &be_const_str_continue); -be_define_const_str(publish, "publish", 264247304u, 0, 7, &be_const_str_web_add_main_button); -be_define_const_str(publish_result, "publish_result", 2013351252u, 0, 14, &be_const_str_set_x); -be_define_const_str(push, "push", 2272264157u, 0, 4, &be_const_str_stop); +be_define_const_str(pow, "pow", 1479764693u, 0, 3, &be_const_str_seg7_font); +be_define_const_str(preinit, "preinit", 2722007100u, 0, 7, &be_const_str_widget_ctor_cb); +be_define_const_str(print, "print", 372738696u, 0, 5, NULL); +be_define_const_str(public_key, "public_key", 4169142980u, 0, 10, &be_const_str_read32); +be_define_const_str(publish, "publish", 264247304u, 0, 7, NULL); +be_define_const_str(publish_result, "publish_result", 2013351252u, 0, 14, &be_const_str_skip); +be_define_const_str(push, "push", 2272264157u, 0, 4, &be_const_str_width); be_define_const_str(push_path, "push_path", 1155254157u, 0, 9, NULL); -be_define_const_str(quality, "quality", 2597670950u, 0, 7, NULL); -be_define_const_str(r, "r", 4144776981u, 0, 1, &be_const_str_tele); -be_define_const_str(rad, "rad", 1358899048u, 0, 3, NULL); +be_define_const_str(quality, "quality", 2597670950u, 0, 7, &be_const_str_else); +be_define_const_str(r, "r", 4144776981u, 0, 1, &be_const_str_set_light); +be_define_const_str(rad, "rad", 1358899048u, 0, 3, &be_const_str_set_ldo_enable); be_define_const_str(raise, "raise", 1593437475u, 70, 5, NULL); be_define_const_str(rand, "rand", 2711325910u, 0, 4, NULL); -be_define_const_str(range, "range", 4208725202u, 0, 5, &be_const_str_web_add_handler); +be_define_const_str(range, "range", 4208725202u, 0, 5, &be_const_str_reverse_gamma10); be_define_const_str(read, "read", 3470762949u, 0, 4, NULL); be_define_const_str(read12, "read12", 4291076970u, 0, 6, NULL); -be_define_const_str(read13, "read13", 12887293u, 0, 6, &be_const_str_set_timer); +be_define_const_str(read13, "read13", 12887293u, 0, 6, NULL); be_define_const_str(read24, "read24", 1808533811u, 0, 6, NULL); -be_define_const_str(read32, "read32", 1741276240u, 0, 6, &be_const_str_break); -be_define_const_str(read8, "read8", 2802788167u, 0, 5, &be_const_str_readline); -be_define_const_str(read_bytes, "read_bytes", 3576733173u, 0, 10, &be_const_str_type); -be_define_const_str(read_sensors, "read_sensors", 892689201u, 0, 12, NULL); -be_define_const_str(readbytes, "readbytes", 2716426756u, 0, 9, &be_const_str_show); -be_define_const_str(readline, "readline", 1212709927u, 0, 8, &be_const_str_solidified); -be_define_const_str(real, "real", 3604983901u, 0, 4, &be_const_str__X7B_X7D); +be_define_const_str(read32, "read32", 1741276240u, 0, 6, NULL); +be_define_const_str(read8, "read8", 2802788167u, 0, 5, NULL); +be_define_const_str(read_bytes, "read_bytes", 3576733173u, 0, 10, NULL); +be_define_const_str(read_sensors, "read_sensors", 892689201u, 0, 12, &be_const_str_round_end); +be_define_const_str(readbytes, "readbytes", 2716426756u, 0, 9, NULL); +be_define_const_str(readline, "readline", 1212709927u, 0, 8, NULL); +be_define_const_str(real, "real", 3604983901u, 0, 4, NULL); be_define_const_str(reapply, "reapply", 3778939332u, 0, 7, NULL); -be_define_const_str(redirect, "redirect", 389758641u, 0, 8, NULL); -be_define_const_str(reduce, "reduce", 2002030311u, 0, 6, NULL); -be_define_const_str(refr_size, "refr_size", 1958144468u, 0, 9, NULL); -be_define_const_str(register_obj, "register_obj", 3982614770u, 0, 12, NULL); +be_define_const_str(redirect, "redirect", 389758641u, 0, 8, &be_const_str_rtc); +be_define_const_str(reduce, "reduce", 2002030311u, 0, 6, &be_const_str_sec); +be_define_const_str(refr_size, "refr_size", 1958144468u, 0, 9, &be_const_str_target_search); +be_define_const_str(register_obj, "register_obj", 3982614770u, 0, 12, &be_const_str_sys); be_define_const_str(remove, "remove", 3683784189u, 0, 6, NULL); be_define_const_str(remove_cmd, "remove_cmd", 3832315702u, 0, 10, NULL); -be_define_const_str(remove_driver, "remove_driver", 1030243768u, 0, 13, &be_const_str_string); -be_define_const_str(remove_rule, "remove_rule", 3456211328u, 0, 11, NULL); +be_define_const_str(remove_driver, "remove_driver", 1030243768u, 0, 13, &be_const_str_tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29); +be_define_const_str(remove_rule, "remove_rule", 3456211328u, 0, 11, &be_const_str_except); be_define_const_str(remove_timer, "remove_timer", 4141472215u, 0, 12, NULL); be_define_const_str(reset, "reset", 1695364032u, 0, 5, NULL); -be_define_const_str(reset_search, "reset_search", 1350414305u, 0, 12, &be_const_str_widget_destructor); +be_define_const_str(reset_search, "reset_search", 1350414305u, 0, 12, NULL); be_define_const_str(resize, "resize", 3514612129u, 0, 6, NULL); be_define_const_str(resolvecmnd, "resolvecmnd", 993361485u, 0, 11, NULL); -be_define_const_str(resp_cmnd, "resp_cmnd", 2869459626u, 0, 9, &be_const_str_web_add_management_button); -be_define_const_str(resp_cmnd_done, "resp_cmnd_done", 2601874875u, 0, 14, &be_const_str_raise); +be_define_const_str(resp_cmnd, "resp_cmnd", 2869459626u, 0, 9, &be_const_str_widget_editable); +be_define_const_str(resp_cmnd_done, "resp_cmnd_done", 2601874875u, 0, 14, NULL); be_define_const_str(resp_cmnd_error, "resp_cmnd_error", 2404088863u, 0, 15, NULL); -be_define_const_str(resp_cmnd_failed, "resp_cmnd_failed", 2136281562u, 0, 16, NULL); +be_define_const_str(resp_cmnd_failed, "resp_cmnd_failed", 2136281562u, 0, 16, &be_const_str_set_chg_current); be_define_const_str(resp_cmnd_str, "resp_cmnd_str", 737845590u, 0, 13, NULL); -be_define_const_str(response_append, "response_append", 450346371u, 0, 15, NULL); +be_define_const_str(response_append, "response_append", 450346371u, 0, 15, &be_const_str_set_first_time); be_define_const_str(return, "return", 2246981567u, 60, 6, NULL); -be_define_const_str(return_X20code_X3D_X25i, "return code=%i", 2127454401u, 0, 14, &be_const_str_set_ldo_enable); -be_define_const_str(reverse, "reverse", 558918661u, 0, 7, &be_const_str_sin); -be_define_const_str(reverse_gamma10, "reverse_gamma10", 739112262u, 0, 15, &be_const_str_to_gamma); +be_define_const_str(return_X20code_X3D_X25i, "return code=%i", 2127454401u, 0, 14, NULL); +be_define_const_str(reverse, "reverse", 558918661u, 0, 7, NULL); +be_define_const_str(reverse_gamma10, "reverse_gamma10", 739112262u, 0, 15, NULL); be_define_const_str(rotate, "rotate", 2784296202u, 0, 6, NULL); -be_define_const_str(round_end, "round_end", 985288225u, 0, 9, NULL); -be_define_const_str(round_start, "round_start", 2949484384u, 0, 11, &be_const_str_wire); -be_define_const_str(rtc, "rtc", 1070575216u, 0, 3, &be_const_str_settings); -be_define_const_str(rule, "rule", 4230889683u, 0, 4, NULL); -be_define_const_str(run, "run", 718098122u, 0, 3, NULL); -be_define_const_str(run_bat, "run_bat", 2536903298u, 0, 7, NULL); +be_define_const_str(round_end, "round_end", 985288225u, 0, 9, &be_const_str_strftime); +be_define_const_str(round_start, "round_start", 2949484384u, 0, 11, &be_const_str_sqrt); +be_define_const_str(rtc, "rtc", 1070575216u, 0, 3, NULL); +be_define_const_str(rule, "rule", 4230889683u, 0, 4, &be_const_str_settings); +be_define_const_str(run, "run", 718098122u, 0, 3, &be_const_str_set_style_line_color); +be_define_const_str(run_bat, "run_bat", 2536903298u, 0, 7, &be_const_str_valuer_error); be_define_const_str(run_deferred, "run_deferred", 371594696u, 0, 12, NULL); -be_define_const_str(running, "running", 343848780u, 0, 7, NULL); -be_define_const_str(save, "save", 3439296072u, 0, 4, &be_const_str_tanh); +be_define_const_str(running, "running", 343848780u, 0, 7, &be_const_str_string); +be_define_const_str(save, "save", 3439296072u, 0, 4, NULL); be_define_const_str(save_before_restart, "save_before_restart", 1253239338u, 0, 19, NULL); -be_define_const_str(scale_uint, "scale_uint", 3090811094u, 0, 10, &be_const_str_set_style_pad_right); -be_define_const_str(scan, "scan", 3974641896u, 0, 4, &be_const_str_set_dc_voltage); +be_define_const_str(scale_uint, "scale_uint", 3090811094u, 0, 10, &be_const_str_widget_group_def); +be_define_const_str(scan, "scan", 3974641896u, 0, 4, NULL); be_define_const_str(search, "search", 2150836393u, 0, 6, NULL); be_define_const_str(sec, "sec", 3139892658u, 0, 3, NULL); -be_define_const_str(seg7_font, "seg7_font", 4099690689u, 0, 9, NULL); +be_define_const_str(seg7_font, "seg7_font", 4099690689u, 0, 9, &be_const_str_set_useragent); be_define_const_str(select, "select", 297952813u, 0, 6, NULL); -be_define_const_str(serial, "serial", 3687697785u, 0, 6, &be_const_str_url_encode); +be_define_const_str(serial, "serial", 3687697785u, 0, 6, NULL); be_define_const_str(set, "set", 3324446467u, 0, 3, NULL); -be_define_const_str(set_alternate, "set_alternate", 1709680562u, 0, 13, &be_const_str_widget_struct_by_class); -be_define_const_str(set_auth, "set_auth", 1057170930u, 0, 8, NULL); -be_define_const_str(set_bri, "set_bri", 2789118779u, 0, 7, &be_const_str_wire1); +be_define_const_str(set_alternate, "set_alternate", 1709680562u, 0, 13, &be_const_str_widget_event); +be_define_const_str(set_auth, "set_auth", 1057170930u, 0, 8, &be_const_str_update); +be_define_const_str(set_bri, "set_bri", 2789118779u, 0, 7, &be_const_str_str); be_define_const_str(set_chg_current, "set_chg_current", 336304386u, 0, 15, NULL); -be_define_const_str(set_dc_voltage, "set_dc_voltage", 2181981936u, 0, 14, &be_const_str_toupper); -be_define_const_str(set_dcdc_enable, "set_dcdc_enable", 1594690786u, 0, 15, &be_const_str_tomap); -be_define_const_str(set_first_time, "set_first_time", 3111247550u, 0, 14, NULL); -be_define_const_str(set_height, "set_height", 1080207399u, 0, 10, &be_const_str_width_def); +be_define_const_str(set_dc_voltage, "set_dc_voltage", 2181981936u, 0, 14, NULL); +be_define_const_str(set_dcdc_enable, "set_dcdc_enable", 1594690786u, 0, 15, &be_const_str_class); +be_define_const_str(set_first_time, "set_first_time", 3111247550u, 0, 14, &be_const_str_tan); +be_define_const_str(set_height, "set_height", 1080207399u, 0, 10, NULL); be_define_const_str(set_ldo_enable, "set_ldo_enable", 2916502041u, 0, 14, NULL); -be_define_const_str(set_ldo_voltage, "set_ldo_voltage", 4090501160u, 0, 15, &be_const_str_tob64); -be_define_const_str(set_light, "set_light", 3176076152u, 0, 9, &be_const_str_setrange); +be_define_const_str(set_ldo_voltage, "set_ldo_voltage", 4090501160u, 0, 15, NULL); +be_define_const_str(set_light, "set_light", 3176076152u, 0, 9, NULL); be_define_const_str(set_matrix_pixel_color, "set_matrix_pixel_color", 1197149462u, 0, 22, NULL); -be_define_const_str(set_percentage, "set_percentage", 2952022724u, 0, 14, NULL); +be_define_const_str(set_percentage, "set_percentage", 2952022724u, 0, 14, &be_const_str__X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); be_define_const_str(set_pixel_color, "set_pixel_color", 1275248356u, 0, 15, NULL); -be_define_const_str(set_power, "set_power", 549820893u, 0, 9, &be_const_str_widget_height_def); +be_define_const_str(set_power, "set_power", 549820893u, 0, 9, &be_const_str_v); be_define_const_str(set_style_bg_color, "set_style_bg_color", 1689513089u, 0, 18, NULL); be_define_const_str(set_style_line_color, "set_style_line_color", 3665238976u, 0, 20, NULL); be_define_const_str(set_style_pad_right, "set_style_pad_right", 3314069054u, 0, 19, NULL); -be_define_const_str(set_style_text_font, "set_style_text_font", 1028590019u, 0, 19, NULL); +be_define_const_str(set_style_text_font, "set_style_text_font", 1028590019u, 0, 19, &be_const_str_widget_ctor_impl); be_define_const_str(set_text, "set_text", 1849641155u, 0, 8, NULL); -be_define_const_str(set_time, "set_time", 900236405u, 0, 8, NULL); -be_define_const_str(set_timeouts, "set_timeouts", 3732850900u, 0, 12, &be_const_str_import); -be_define_const_str(set_timer, "set_timer", 2135414533u, 0, 9, NULL); +be_define_const_str(set_time, "set_time", 900236405u, 0, 8, &be_const_str_if); +be_define_const_str(set_timeouts, "set_timeouts", 3732850900u, 0, 12, NULL); +be_define_const_str(set_timer, "set_timer", 2135414533u, 0, 9, &be_const_str_for); be_define_const_str(set_useragent, "set_useragent", 612237244u, 0, 13, NULL); -be_define_const_str(set_width, "set_width", 484671920u, 0, 9, &be_const_str__X7D); -be_define_const_str(set_x, "set_x", 1849400772u, 0, 5, &be_const_str_def); -be_define_const_str(set_y, "set_y", 1866178391u, 0, 5, NULL); -be_define_const_str(setbits, "setbits", 2762408167u, 0, 7, NULL); +be_define_const_str(set_width, "set_width", 484671920u, 0, 9, NULL); +be_define_const_str(set_x, "set_x", 1849400772u, 0, 5, &be_const_str_var); +be_define_const_str(set_y, "set_y", 1866178391u, 0, 5, &be_const_str_raise); +be_define_const_str(setbits, "setbits", 2762408167u, 0, 7, &be_const_str_super); be_define_const_str(seti, "seti", 1500556254u, 0, 4, NULL); be_define_const_str(setitem, "setitem", 1554834596u, 0, 7, NULL); -be_define_const_str(setmember, "setmember", 1432909441u, 0, 9, &be_const_str_strptime); +be_define_const_str(setmember, "setmember", 1432909441u, 0, 9, NULL); be_define_const_str(setrange, "setrange", 3794019032u, 0, 8, NULL); be_define_const_str(settings, "settings", 1745255176u, 0, 8, NULL); -be_define_const_str(shared_key, "shared_key", 2200833624u, 0, 10, &be_const_str_wifi); -be_define_const_str(show, "show", 2840060476u, 0, 4, &be_const_str_y); -be_define_const_str(sin, "sin", 3761252941u, 0, 3, NULL); -be_define_const_str(sinh, "sinh", 282220607u, 0, 4, &be_const_str_tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29); -be_define_const_str(size, "size", 597743964u, 0, 4, NULL); -be_define_const_str(skip, "skip", 1097563074u, 0, 4, NULL); +be_define_const_str(shared_key, "shared_key", 2200833624u, 0, 10, NULL); +be_define_const_str(show, "show", 2840060476u, 0, 4, NULL); +be_define_const_str(sin, "sin", 3761252941u, 0, 3, &be_const_str_widget_constructor); +be_define_const_str(sinh, "sinh", 282220607u, 0, 4, NULL); +be_define_const_str(size, "size", 597743964u, 0, 4, &be_const_str_top); +be_define_const_str(skip, "skip", 1097563074u, 0, 4, &be_const_str_tr); be_define_const_str(solidified, "solidified", 3257553487u, 0, 10, NULL); -be_define_const_str(split, "split", 2276994531u, 0, 5, &be_const_str_strftime); -be_define_const_str(sqrt, "sqrt", 2112764879u, 0, 4, NULL); +be_define_const_str(split, "split", 2276994531u, 0, 5, &be_const_str__X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); +be_define_const_str(sqrt, "sqrt", 2112764879u, 0, 4, &be_const_str_widget_cb); be_define_const_str(srand, "srand", 465518633u, 0, 5, NULL); be_define_const_str(start, "start", 1697318111u, 0, 5, NULL); be_define_const_str(state, "state", 2016490230u, 0, 5, NULL); @@ -641,43 +639,43 @@ be_define_const_str(str, "str", 3259748752u, 0, 3, NULL); be_define_const_str(strftime, "strftime", 187738851u, 0, 8, NULL); be_define_const_str(string, "string", 398550328u, 0, 6, NULL); be_define_const_str(strip, "strip", 4246411473u, 0, 5, NULL); -be_define_const_str(strptime, "strptime", 1277910361u, 0, 8, &be_const_str_unknown_X20instruction); -be_define_const_str(super, "super", 4152230356u, 0, 5, &be_const_str_year); +be_define_const_str(strptime, "strptime", 1277910361u, 0, 8, &be_const_str_wire_scan); +be_define_const_str(super, "super", 4152230356u, 0, 5, NULL); be_define_const_str(sys, "sys", 3277365014u, 0, 3, NULL); -be_define_const_str(tag, "tag", 2516003219u, 0, 3, &be_const_str_widget_instance_size); +be_define_const_str(tag, "tag", 2516003219u, 0, 3, NULL); be_define_const_str(tan, "tan", 2633446552u, 0, 3, NULL); -be_define_const_str(tanh, "tanh", 153638352u, 0, 4, NULL); -be_define_const_str(target, "target", 845187144u, 0, 6, NULL); -be_define_const_str(target_search, "target_search", 1947846553u, 0, 13, NULL); -be_define_const_str(tasmota, "tasmota", 424643812u, 0, 7, NULL); -be_define_const_str(tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29, "tasmota.get_light() is deprecated, use light.get()", 3525753647u, 0, 50, NULL); +be_define_const_str(tanh, "tanh", 153638352u, 0, 4, &be_const_str__X7B); +be_define_const_str(target, "target", 845187144u, 0, 6, &be_const_str_widget_width_def); +be_define_const_str(target_search, "target_search", 1947846553u, 0, 13, &be_const_str_url_encode); +be_define_const_str(tasmota, "tasmota", 424643812u, 0, 7, &be_const_str_value_error); +be_define_const_str(tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29, "tasmota.get_light() is deprecated, use light.get()", 3525753647u, 0, 50, &be_const_str_while); be_define_const_str(tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29, "tasmota.set_light() is deprecated, use light.set()", 2124937871u, 0, 50, NULL); be_define_const_str(tcpclient, "tcpclient", 3828797983u, 0, 9, NULL); -be_define_const_str(tele, "tele", 3474458061u, 0, 4, NULL); +be_define_const_str(tele, "tele", 3474458061u, 0, 4, &be_const_str_time_dump); be_define_const_str(the_X20second_X20argument_X20is_X20not_X20a_X20function, "the second argument is not a function", 3954574469u, 0, 37, NULL); be_define_const_str(time_dump, "time_dump", 3330410747u, 0, 9, NULL); -be_define_const_str(time_reached, "time_reached", 2075136773u, 0, 12, NULL); -be_define_const_str(time_str, "time_str", 2613827612u, 0, 8, &be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D); -be_define_const_str(to_gamma, "to_gamma", 1597139862u, 0, 8, NULL); +be_define_const_str(time_reached, "time_reached", 2075136773u, 0, 12, &be_const_str__X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); +be_define_const_str(time_str, "time_str", 2613827612u, 0, 8, NULL); +be_define_const_str(to_gamma, "to_gamma", 1597139862u, 0, 8, &be_const_str_value); be_define_const_str(tob64, "tob64", 373777640u, 0, 5, NULL); be_define_const_str(tolower, "tolower", 1042520049u, 0, 7, NULL); be_define_const_str(tomap, "tomap", 612167626u, 0, 5, NULL); be_define_const_str(top, "top", 2802900028u, 0, 3, NULL); be_define_const_str(toptr, "toptr", 3379847454u, 0, 5, NULL); be_define_const_str(tostring, "tostring", 2299708645u, 0, 8, NULL); -be_define_const_str(toupper, "toupper", 3691983576u, 0, 7, NULL); +be_define_const_str(toupper, "toupper", 3691983576u, 0, 7, &be_const_str_webserver); be_define_const_str(tr, "tr", 1195724803u, 0, 2, NULL); -be_define_const_str(traceback, "traceback", 3385188109u, 0, 9, &be_const_str_as); +be_define_const_str(traceback, "traceback", 3385188109u, 0, 9, NULL); be_define_const_str(true, "true", 1303515621u, 61, 4, NULL); be_define_const_str(try, "try", 2887626766u, 68, 3, NULL); -be_define_const_str(try_rule, "try_rule", 1986449405u, 0, 8, &be_const_str_widget_dtor_cb); +be_define_const_str(try_rule, "try_rule", 1986449405u, 0, 8, NULL); be_define_const_str(type, "type", 1361572173u, 0, 4, NULL); -be_define_const_str(unknown_X20instruction, "unknown instruction", 1093911841u, 0, 19, &be_const_str_widget_event_impl); +be_define_const_str(unknown_X20instruction, "unknown instruction", 1093911841u, 0, 19, NULL); be_define_const_str(update, "update", 672109684u, 0, 6, NULL); be_define_const_str(upper, "upper", 176974407u, 0, 5, NULL); be_define_const_str(url_encode, "url_encode", 528392145u, 0, 10, NULL); -be_define_const_str(v, "v", 4077666505u, 0, 1, &be_const_str_valuer_error); -be_define_const_str(value, "value", 1113510858u, 0, 5, &be_const_str_web_add_button); +be_define_const_str(v, "v", 4077666505u, 0, 1, NULL); +be_define_const_str(value, "value", 1113510858u, 0, 5, NULL); be_define_const_str(value_error, "value_error", 773297791u, 0, 11, NULL); be_define_const_str(valuer_error, "valuer_error", 2567947105u, 0, 12, NULL); be_define_const_str(var, "var", 2317739966u, 64, 3, NULL); @@ -688,21 +686,21 @@ be_define_const_str(web_add_config_button, "web_add_config_button", 639674325u, be_define_const_str(web_add_console_button, "web_add_console_button", 3481436192u, 0, 22, NULL); be_define_const_str(web_add_handler, "web_add_handler", 3990174962u, 0, 15, NULL); be_define_const_str(web_add_main_button, "web_add_main_button", 3960367664u, 0, 19, NULL); -be_define_const_str(web_add_management_button, "web_add_management_button", 2738877186u, 0, 25, &be_const_str_webclient); +be_define_const_str(web_add_management_button, "web_add_management_button", 2738877186u, 0, 25, &be_const_str_do); be_define_const_str(web_send, "web_send", 2989941448u, 0, 8, NULL); be_define_const_str(web_send_decimal, "web_send_decimal", 1407210204u, 0, 16, NULL); -be_define_const_str(web_sensor, "web_sensor", 2900096972u, 0, 10, &be_const_str_do); +be_define_const_str(web_sensor, "web_sensor", 2900096972u, 0, 10, &be_const_str_write_gpio); be_define_const_str(webclient, "webclient", 4076389146u, 0, 9, NULL); be_define_const_str(webserver, "webserver", 1572454038u, 0, 9, NULL); be_define_const_str(while, "while", 231090382u, 53, 5, NULL); -be_define_const_str(widget_cb, "widget_cb", 2763583055u, 0, 9, &be_const_str_width); -be_define_const_str(widget_constructor, "widget_constructor", 2543785934u, 0, 18, &be_const_str_yield); -be_define_const_str(widget_ctor_cb, "widget_ctor_cb", 876007560u, 0, 14, &be_const_str_for); -be_define_const_str(widget_ctor_impl, "widget_ctor_impl", 194252479u, 0, 16, &be_const_str_write_file); +be_define_const_str(widget_cb, "widget_cb", 2763583055u, 0, 9, NULL); +be_define_const_str(widget_constructor, "widget_constructor", 2543785934u, 0, 18, NULL); +be_define_const_str(widget_ctor_cb, "widget_ctor_cb", 876007560u, 0, 14, NULL); +be_define_const_str(widget_ctor_impl, "widget_ctor_impl", 194252479u, 0, 16, NULL); be_define_const_str(widget_destructor, "widget_destructor", 4207388345u, 0, 17, NULL); be_define_const_str(widget_dtor_cb, "widget_dtor_cb", 3151545845u, 0, 14, NULL); be_define_const_str(widget_dtor_impl, "widget_dtor_impl", 520430610u, 0, 16, NULL); -be_define_const_str(widget_editable, "widget_editable", 3821793286u, 0, 15, &be_const_str_try); +be_define_const_str(widget_editable, "widget_editable", 3821793286u, 0, 15, NULL); be_define_const_str(widget_event, "widget_event", 1951408186u, 0, 12, NULL); be_define_const_str(widget_event_cb, "widget_event_cb", 1508466754u, 0, 15, NULL); be_define_const_str(widget_event_impl, "widget_event_impl", 2178430561u, 0, 17, NULL); @@ -716,15 +714,15 @@ be_define_const_str(width, "width", 2508680735u, 0, 5, NULL); be_define_const_str(width_def, "width_def", 1143717879u, 0, 9, NULL); be_define_const_str(wifi, "wifi", 120087624u, 0, 4, NULL); be_define_const_str(wire, "wire", 4082753944u, 0, 4, NULL); -be_define_const_str(wire1, "wire1", 3212721419u, 0, 5, NULL); +be_define_const_str(wire1, "wire1", 3212721419u, 0, 5, &be_const_str_true); be_define_const_str(wire2, "wire2", 3229499038u, 0, 5, NULL); be_define_const_str(wire_scan, "wire_scan", 2671275880u, 0, 9, NULL); be_define_const_str(write, "write", 3190202204u, 0, 5, NULL); be_define_const_str(write8, "write8", 3133991532u, 0, 6, NULL); be_define_const_str(write_bit, "write_bit", 2660990436u, 0, 9, NULL); -be_define_const_str(write_bytes, "write_bytes", 1227543792u, 0, 11, &be_const_str_except); +be_define_const_str(write_bytes, "write_bytes", 1227543792u, 0, 11, NULL); be_define_const_str(write_file, "write_file", 3177658879u, 0, 10, NULL); -be_define_const_str(write_gpio, "write_gpio", 2267940334u, 0, 10, &be_const_str_if); +be_define_const_str(write_gpio, "write_gpio", 2267940334u, 0, 10, NULL); be_define_const_str(x, "x", 4245442695u, 0, 1, NULL); be_define_const_str(x1, "x1", 274927234u, 0, 2, NULL); be_define_const_str(y, "y", 4228665076u, 0, 1, NULL); @@ -732,7 +730,7 @@ be_define_const_str(y1, "y1", 2355101727u, 0, 2, NULL); be_define_const_str(year, "year", 2927578396u, 0, 4, NULL); be_define_const_str(yield, "yield", 1821831854u, 0, 5, NULL); be_define_const_str(zero, "zero", 2339366755u, 0, 4, NULL); -be_define_const_str(zip, "zip", 2877453236u, 0, 3, &be_const_str__X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); +be_define_const_str(zip, "zip", 2877453236u, 0, 3, NULL); be_define_const_str(_X7B, "{", 4262220314u, 0, 1, NULL); be_define_const_str(_X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D, "{s}Batt Current{m}%.1f mA{e}", 866537156u, 0, 28, NULL); be_define_const_str(_X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D, "{s}Batt Voltage{m}%.3f V{e}", 3184308199u, 0, 27, NULL); @@ -743,370 +741,369 @@ be_define_const_str(_X7B_X7D, "{}", 1415952421u, 0, 2, NULL); be_define_const_str(_X7D, "}", 4161554600u, 0, 1, NULL); static const bstring* const m_string_table[] = { - (const bstring *)&be_const_str__X3D, - (const bstring *)&be_const_str_point, - (const bstring *)&be_const_str_run, + (const bstring *)&be_const_str__X3E_X3D, + (const bstring *)&be_const_str_run_bat, NULL, - (const bstring *)&be_const_str_class_init_obj, - (const bstring *)&be_const_str_try_rule, - (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dzip_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, - (const bstring *)&be_const_str_setbits, - (const bstring *)&be_const_str_AXP192, - (const bstring *)&be_const_str_tolower, - (const bstring *)&be_const_str__X2B, - (const bstring *)&be_const_str_I2C_X3A, - (const bstring *)&be_const_str_exec_rules, - (const bstring *)&be_const_str_read13, - (const bstring *)&be_const_str__X2F, - (const bstring *)&be_const_str_pc_abs, - (const bstring *)&be_const_str__error, - (const bstring *)&be_const_str__X23autoexec_X2Ebat, - (const bstring *)&be_const_str__X23, - (const bstring *)&be_const_str__X2Ep, - (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, + NULL, + (const bstring *)&be_const_str_io_error, + (const bstring *)&be_const_str_depower, + (const bstring *)&be_const_str_SERIAL_6O1, + (const bstring *)&be_const_str_STATE_DEFAULT, (const bstring *)&be_const_str_SERIAL_6N1, - (const bstring *)&be_const_str_cb_do_nothing, - (const bstring *)&be_const_str_CFG_X3A_X20loading_X20, - (const bstring *)&be_const_str_HTTP_POST, - (const bstring *)&be_const_str__rules, + (const bstring *)&be_const_str_Auto_X2Dconfiguration, + (const bstring *)&be_const_str_decrypt, + (const bstring *)&be_const_str_insert, NULL, + (const bstring *)&be_const_str__X3D, + (const bstring *)&be_const_str_write_bytes, NULL, - NULL, - (const bstring *)&be_const_str_the_X20second_X20argument_X20is_X20not_X20a_X20function, - (const bstring *)&be_const_str_begin, - (const bstring *)&be_const_str_POST, - (const bstring *)&be_const_str_web_add_console_button, - (const bstring *)&be_const_str__X2F_X2Eautoconf, - NULL, - (const bstring *)&be_const_str__filename, - (const bstring *)&be_const_str_write_bit, - (const bstring *)&be_const_str_SERIAL_5O1, - (const bstring *)&be_const_str_AES_GCM, - (const bstring *)&be_const_str_set_height, - (const bstring *)&be_const_str__end_transmission, - (const bstring *)&be_const_str__X2D_X2D_X3A_X2D_X2D, - (const bstring *)&be_const_str_cb_obj, - (const bstring *)&be_const_str_CFG_X3A_X20removing_X20first_X20time_X20marker, - (const bstring *)&be_const_str__archive, - (const bstring *)&be_const_str_module, - (const bstring *)&be_const_str_SERIAL_7N1, - (const bstring *)&be_const_str_sinh, - (const bstring *)&be_const_str__X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, - (const bstring *)&be_const_str_SERIAL_6O2, - (const bstring *)&be_const_str_detected_X20on_X20bus, - (const bstring *)&be_const_str_response_append, - (const bstring *)&be_const_str_WS2812_GRB, - (const bstring *)&be_const_str__X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, - (const bstring *)&be_const_str_toptr, - (const bstring *)&be_const_str_get_bri, - NULL, - (const bstring *)&be_const_str_arch, - NULL, - (const bstring *)&be_const_str__X3C_X2Fform_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_connection_error, - (const bstring *)&be_const_str_, - (const bstring *)&be_const_str_calldepth, - (const bstring *)&be_const_str___iterator__, - (const bstring *)&be_const_str__X2Esize, - (const bstring *)&be_const_str_widget_group_def, - (const bstring *)&be_const_str_resp_cmnd, - (const bstring *)&be_const_str__X2Ep2, - (const bstring *)&be_const_str_get_switch, - (const bstring *)&be_const_str_clear_first_time, - NULL, + (const bstring *)&be_const_str_running, + (const bstring *)&be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, + (const bstring *)&be_const_str_read_bytes, + (const bstring *)&be_const_str_draw_arc, + (const bstring *)&be_const_str__X20, + (const bstring *)&be_const_str_event, + (const bstring *)&be_const_str_SERIAL_5E2, + (const bstring *)&be_const_str_SERIAL_6E1, + (const bstring *)&be_const_str_leds, + (const bstring *)&be_const_str__lvgl, + (const bstring *)&be_const_str_zip, (const bstring *)&be_const_str_EC_C25519, - (const bstring *)&be_const_str_save, - NULL, - NULL, - (const bstring *)&be_const_str_SERIAL_8N1, - (const bstring *)&be_const_str_ip, - (const bstring *)&be_const_str_alternate, - (const bstring *)&be_const_str_compile, - (const bstring *)&be_const_str_file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27, - (const bstring *)&be_const_str_animate, - (const bstring *)&be_const_str__X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, - NULL, - (const bstring *)&be_const_str_SERIAL_8O2, - (const bstring *)&be_const_str__X25s_X2Eautoconf, - NULL, - (const bstring *)&be_const_str__dirty, - (const bstring *)&be_const_str_y1, - (const bstring *)&be_const_str_remove_driver, - (const bstring *)&be_const_str_get_string, - (const bstring *)&be_const_str_CFG_X3A_X20removing_X20autoconf_X20files, - (const bstring *)&be_const_str_autoexec, - (const bstring *)&be_const_str_get_style_line_color, - (const bstring *)&be_const_str_bool, - (const bstring *)&be_const_str_write_gpio, - (const bstring *)&be_const_str__X3D_X3D, - (const bstring *)&be_const_str_id, - (const bstring *)&be_const_str_SERIAL_5N2, - NULL, - (const bstring *)&be_const_str_persist, - (const bstring *)&be_const_str_set_timeouts, - NULL, - (const bstring *)&be_const_str_AudioGenerator, - (const bstring *)&be_const_str_byte, - (const bstring *)&be_const_str_EVENT_DRAW_PART_BEGIN, - (const bstring *)&be_const_str_collect, - (const bstring *)&be_const_str_widget_event, - (const bstring *)&be_const_str_SERIAL_6E2, - (const bstring *)&be_const_str_add_anim, - (const bstring *)&be_const_str_erase, - (const bstring *)&be_const_str___lower__, - (const bstring *)&be_const_str_arg, - (const bstring *)&be_const_str_CFG_X3A_X20ran_X20_X20, - (const bstring *)&be_const_str_srand, - (const bstring *)&be_const_str_skip, - (const bstring *)&be_const_str_Leds, - NULL, - (const bstring *)&be_const_str__X23init_X2Ebat, - (const bstring *)&be_const_str__X3Clambda_X3E, - (const bstring *)&be_const_str_GET, - (const bstring *)&be_const_str_widget_ctor_cb, - (const bstring *)&be_const_str__global_addr, - (const bstring *)&be_const_str_OneWire, + (const bstring *)&be_const_str_COLOR_BLACK, + (const bstring *)&be_const_str_readline, (const bstring *)&be_const_str__X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_update, NULL, - NULL, - NULL, - (const bstring *)&be_const_str_AudioOutput, - NULL, - (const bstring *)&be_const_str_decompress, - NULL, - (const bstring *)&be_const_str_EVENT_DRAW_PART_END, (const bstring *)&be_const_str_load_templates, - (const bstring *)&be_const_str_get_alternate, - (const bstring *)&be_const_str_acos, - (const bstring *)&be_const_str__X2Elen, - (const bstring *)&be_const_str_constructor_cb, - (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X20, + (const bstring *)&be_const_str_get, + (const bstring *)&be_const_str_POST, + (const bstring *)&be_const_str___iterator__, + (const bstring *)&be_const_str_AudioGeneratorMP3, + (const bstring *)&be_const_str__energy, + (const bstring *)&be_const_str__rules, + (const bstring *)&be_const_str_break, + (const bstring *)&be_const_str__X2F_X2Eautoconf, + (const bstring *)&be_const_str_content_button, + (const bstring *)&be_const_str_copy, + (const bstring *)&be_const_str_get_aps_voltage, + (const bstring *)&be_const_str_AXP192, + (const bstring *)&be_const_str_select, + (const bstring *)&be_const_str_autoexec, + (const bstring *)&be_const_str__X0A, + (const bstring *)&be_const_str_available, NULL, - (const bstring *)&be_const_str_get_current_module_name, - (const bstring *)&be_const_str__X2Ebec, - (const bstring *)&be_const_str__settings_ptr, - (const bstring *)&be_const_str_dump, + (const bstring *)&be_const_str__X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, + (const bstring *)&be_const_str_gc, + (const bstring *)&be_const_str_CFG_X3A_X20loading_X20_X27_X25s_X27, + (const bstring *)&be_const_str__X21_X3D_X3D, + (const bstring *)&be_const_str_split, + (const bstring *)&be_const_str_lower, + (const bstring *)&be_const_str__X3Clabel_X3EChoose_X20a_X20device_X20configuration_X3A_X3C_X2Flabel_X3E_X3Cbr_X3E, + (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, + (const bstring *)&be_const_str_base_class, + (const bstring *)&be_const_str_connected, + (const bstring *)&be_const_str_instance, + NULL, + (const bstring *)&be_const_str__X2Etapp, + (const bstring *)&be_const_str__X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_attrdump, + (const bstring *)&be_const_str_EVENT_DRAW_MAIN, + (const bstring *)&be_const_str__request_from, + (const bstring *)&be_const_str__X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_acos, + (const bstring *)&be_const_str_get_light, + (const bstring *)&be_const_str_resp_cmnd_str, + NULL, + (const bstring *)&be_const_str_CFG_X3A_X20removing_X20autoconf_X20files, + NULL, + (const bstring *)&be_const_str_w, + (const bstring *)&be_const_str_draw_line, + NULL, + (const bstring *)&be_const_str_strip, + (const bstring *)&be_const_str_format, + (const bstring *)&be_const_str_Leds, + (const bstring *)&be_const_str_exec_tele, + (const bstring *)&be_const_str_chars_in_string, + (const bstring *)&be_const_str_CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, + NULL, + (const bstring *)&be_const_str_widget_dtor_cb, + (const bstring *)&be_const_str_invalidate, + (const bstring *)&be_const_str__X3A, + NULL, + (const bstring *)&be_const_str_out_X20of_X20range, + NULL, + (const bstring *)&be_const_str_lv_event_cb, + (const bstring *)&be_const_str_LVG_X3A_X20call_X20to_X20unsupported_X20callback, + (const bstring *)&be_const_str_escape, + (const bstring *)&be_const_str_event_cb, + (const bstring *)&be_const_str_init_draw_line_dsc, + NULL, + (const bstring *)&be_const_str_isinstance, + (const bstring *)&be_const_str_exists, + (const bstring *)&be_const_str_HTTP_GET, + (const bstring *)&be_const_str_clear_first_time, + (const bstring *)&be_const_str__X2Eautoconf, + (const bstring *)&be_const_str_clear, + (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, + (const bstring *)&be_const_str_SERIAL_7N1, + (const bstring *)&be_const_str_get_percentage, + (const bstring *)&be_const_str_SERIAL_7O1, + (const bstring *)&be_const_str_remove, + (const bstring *)&be_const_str_set_time, + (const bstring *)&be_const_str_get_size, + (const bstring *)&be_const_str_remove_timer, + (const bstring *)&be_const_str__X23autoexec_X2Ebat, + (const bstring *)&be_const_str__X2D_X2D_X3A_X2D_X2D, + (const bstring *)&be_const_str_due, + (const bstring *)&be_const_str__X2C, + (const bstring *)&be_const_str_instance_size, + (const bstring *)&be_const_str_Animate_X20pc_X20is_X20out_X20of_X20range, + (const bstring *)&be_const_str_cb, + (const bstring *)&be_const_str_resp_cmnd_done, + NULL, + (const bstring *)&be_const_str_energy_struct, NULL, (const bstring *)&be_const_str__drivers, + (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dzip_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, + (const bstring *)&be_const_str_tob64, + (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, + (const bstring *)&be_const_str_CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29, + (const bstring *)&be_const_str__X3C, + (const bstring *)&be_const_str_y, + (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_files, + (const bstring *)&be_const_str__X2Ew, + (const bstring *)&be_const_str_assert, + (const bstring *)&be_const_str_bytes, + (const bstring *)&be_const_str__X23, + (const bstring *)&be_const_str_abs, + (const bstring *)&be_const_str__X2E_X2E, + (const bstring *)&be_const_str__global_addr, + (const bstring *)&be_const_str_connect, + (const bstring *)&be_const_str__settings_ptr, + NULL, + (const bstring *)&be_const_str_CFG_X3A_X20ran_X20_X20, + (const bstring *)&be_const_str_BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, + NULL, + (const bstring *)&be_const_str__X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, + (const bstring *)&be_const_str_i2c_enabled, + (const bstring *)&be_const_str_ctypes_bytes_dyn, + (const bstring *)&be_const_str_CFG_X3A_X20loading_X20, + NULL, + NULL, + (const bstring *)&be_const_str_refr_size, + (const bstring *)&be_const_str_content_send_style, + NULL, + NULL, + (const bstring *)&be_const_str_begin, + (const bstring *)&be_const_str_c, + (const bstring *)&be_const_str_ins_goto, + (const bstring *)&be_const_str__buffer, + (const bstring *)&be_const_str_concat, + (const bstring *)&be_const_str_percentage, + NULL, + (const bstring *)&be_const_str_SERIAL_5N2, + NULL, + NULL, + (const bstring *)&be_const_str_SK6812_GRBW, + (const bstring *)&be_const_str__X3Cp_X3E_X3Csmall_X3E_X26nbsp_X3B_X28This_X20feature_X20requires_X20an_X20internet_X20connection_X29_X3C_X2Fsmall_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, + NULL, + NULL, + (const bstring *)&be_const_str_lv_obj, + (const bstring *)&be_const_str___upper__, + (const bstring *)&be_const_str_Restart_X201, + NULL, + (const bstring *)&be_const_str_introspect, + (const bstring *)&be_const_str__X23autoexec_X2Ebe, + (const bstring *)&be_const_str_CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27, + (const bstring *)&be_const_str_bool, + (const bstring *)&be_const_str_PART_MAIN, + (const bstring *)&be_const_str_back_forth, + (const bstring *)&be_const_str_lv_obj_class, + (const bstring *)&be_const_str_TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, + (const bstring *)&be_const_str_GET, + (const bstring *)&be_const_str_deg, (const bstring *)&be_const_str__X28_X29, NULL, - (const bstring *)&be_const_str__X2Ebe, - (const bstring *)&be_const_str_content_start, - (const bstring *)&be_const_str__class, - (const bstring *)&be_const_str_h, - (const bstring *)&be_const_str_Unknown_X20command, - (const bstring *)&be_const_str_CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, - (const bstring *)&be_const_str_p1, - NULL, - NULL, - (const bstring *)&be_const_str_b, - (const bstring *)&be_const_str_Parameter_X20error, - (const bstring *)&be_const_str_event, - (const bstring *)&be_const_str_read32, - (const bstring *)&be_const_str_f, - (const bstring *)&be_const_str_resp_cmnd_failed, - (const bstring *)&be_const_str_create_matrix, - (const bstring *)&be_const_str_SERIAL_7E2, - (const bstring *)&be_const_str_resolvecmnd, - (const bstring *)&be_const_str_draw_line, - (const bstring *)&be_const_str_autorun, - (const bstring *)&be_const_str__X2Eautoconf, - (const bstring *)&be_const_str_editable, - NULL, - NULL, - NULL, - (const bstring *)&be_const_str__X3A, - (const bstring *)&be_const_str_EVENT_DRAW_MAIN, - (const bstring *)&be_const_str_remove_timer, - (const bstring *)&be_const_str_Wire, - (const bstring *)&be_const_str__X3E, - (const bstring *)&be_const_str__X26lt_X3BNone_X26gt_X3B, - (const bstring *)&be_const_str__X3C, - (const bstring *)&be_const_str_pin, - (const bstring *)&be_const_str__def, - (const bstring *)&be_const_str_int, - (const bstring *)&be_const_str_atan2, - (const bstring *)&be_const_str_AudioOutputI2S, - (const bstring *)&be_const_str_last_modified, - (const bstring *)&be_const_str_get_style_pad_right, - (const bstring *)&be_const_str__settings_def, - (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X27_X25s_X27, - (const bstring *)&be_const_str__X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, - NULL, - (const bstring *)&be_const_str_start, - (const bstring *)&be_const_str_reset, - (const bstring *)&be_const_str__X2E, - (const bstring *)&be_const_str__X21_X3D_X3D, - (const bstring *)&be_const_str__X2C, (const bstring *)&be_const_str__X23preinit_X2Ebe, - (const bstring *)&be_const_str_month, - (const bstring *)&be_const_str_instance_size, - (const bstring *)&be_const_str__X20, - (const bstring *)&be_const_str_exp, - (const bstring *)&be_const_str_bus, - (const bstring *)&be_const_str_cmd_res, - (const bstring *)&be_const_str_draw_line_dsc, - (const bstring *)&be_const_str_BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, - (const bstring *)&be_const_str_tostring, - (const bstring *)&be_const_str_var, - (const bstring *)&be_const_str_upper, - (const bstring *)&be_const_str_color, - (const bstring *)&be_const_str_internal_error, - (const bstring *)&be_const_str_encrypt, - (const bstring *)&be_const_str__X21_X3D, - NULL, - NULL, - (const bstring *)&be_const_str_CFG_X3A_X20running_X20, - (const bstring *)&be_const_str_Restart_X201, - (const bstring *)&be_const_str_BUTTON_CONFIGURATION, - NULL, - (const bstring *)&be_const_str_HTTP_GET, - (const bstring *)&be_const_str_loop, - (const bstring *)&be_const_str_SERIAL_5O2, - (const bstring *)&be_const_str__X0A, - (const bstring *)&be_const_str_back_forth, - (const bstring *)&be_const_str_add_rule, - (const bstring *)&be_const_str_CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, - (const bstring *)&be_const_str_list, - (const bstring *)&be_const_str_closure, - (const bstring *)&be_const_str__X2F_X3Frst_X3D, - NULL, - (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, - (const bstring *)&be_const_str_COLOR_WHITE, - NULL, - (const bstring *)&be_const_str_SERIAL_6O1, - (const bstring *)&be_const_str_widget_struct_default, - (const bstring *)&be_const_str_gamma, - (const bstring *)&be_const_str_abs, - (const bstring *)&be_const_str_pc, - (const bstring *)&be_const_str_concat, - (const bstring *)&be_const_str_height_def, - NULL, - (const bstring *)&be_const_str_log10, - (const bstring *)&be_const_str_call, - (const bstring *)&be_const_str__p, - (const bstring *)&be_const_str_file, - (const bstring *)&be_const_str__request_from, - (const bstring *)&be_const_str_BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, - (const bstring *)&be_const_str__X2Ep1, - (const bstring *)&be_const_str_content_send_style, - (const bstring *)&be_const_str_AudioGeneratorWAV, - (const bstring *)&be_const_str_seg7_font, - NULL, - (const bstring *)&be_const_str_add_driver, - (const bstring *)&be_const_str_pin_used, - (const bstring *)&be_const_str_Tele, - (const bstring *)&be_const_str_SERIAL_8N2, - NULL, - (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, - (const bstring *)&be_const_str_get_input_power_status, - (const bstring *)&be_const_str__persist_X2Ejson, - NULL, - (const bstring *)&be_const_str__X23display_X2Eini, - (const bstring *)&be_const_str_Animate_X20pc_X20is_X20out_X20of_X20range, - (const bstring *)&be_const_str_SERIAL_8O1, - (const bstring *)&be_const_str_ctypes_bytes, - (const bstring *)&be_const_str__X3Clabel_X3EChoose_X20a_X20device_X20configuration_X3A_X3C_X2Flabel_X3E_X3Cbr_X3E, - (const bstring *)&be_const_str_round_end, - (const bstring *)&be_const_str_codedump, - (const bstring *)&be_const_str_MD5, - (const bstring *)&be_const_str_PART_MAIN, - NULL, - (const bstring *)&be_const_str_asin, - (const bstring *)&be_const_str_content_stop, - (const bstring *)&be_const_str_set_light, - (const bstring *)&be_const_str_get_bat_current, - (const bstring *)&be_const_str_x1, - NULL, - NULL, - (const bstring *)&be_const_str_compress, - (const bstring *)&be_const_str_escape, - (const bstring *)&be_const_str_atan, - (const bstring *)&be_const_str_SERIAL_5N1, - (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str__X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_tr, - (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, - (const bstring *)&be_const_str__X2E_X2E, - (const bstring *)&be_const_str_SERIAL_6E1, - (const bstring *)&be_const_str_content_button, - (const bstring *)&be_const_str_asstring, - NULL, - (const bstring *)&be_const_str_detect, - (const bstring *)&be_const_str_close, - (const bstring *)&be_const_str_add_header, - (const bstring *)&be_const_str_day, - (const bstring *)&be_const_str_seti, - (const bstring *)&be_const_str_light, - (const bstring *)&be_const_str__X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_event_cb, - (const bstring *)&be_const_str_AudioFileSource, - (const bstring *)&be_const_str_get_tasmota, - (const bstring *)&be_const_str_preinit, - (const bstring *)&be_const_str__available, - (const bstring *)&be_const_str_name, - NULL, - NULL, - (const bstring *)&be_const_str_reset_search, - (const bstring *)&be_const_str__X3C_X3D, - (const bstring *)&be_const_str_from_to, - NULL, - (const bstring *)&be_const_str_remove, - (const bstring *)&be_const_str__read, - (const bstring *)&be_const_str_deg, - (const bstring *)&be_const_str_obj_class_create_obj, - (const bstring *)&be_const_str_ins_time, - (const bstring *)&be_const_str__X2Etapp, - (const bstring *)&be_const_str_content_flush, - (const bstring *)&be_const_str_area, - (const bstring *)&be_const_str_CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found, - (const bstring *)&be_const_str_webserver, - (const bstring *)&be_const_str_iter, - (const bstring *)&be_const_str_ceil, - (const bstring *)&be_const_str__global_def, - (const bstring *)&be_const_str__get_cb, - (const bstring *)&be_const_str___upper__, - (const bstring *)&be_const_str_size, - (const bstring *)&be_const_str_cb_event_closure, - (const bstring *)&be_const_str_find_key_i, - (const bstring *)&be_const_str__cb, - (const bstring *)&be_const_str_AudioGeneratorMP3, - (const bstring *)&be_const_str_BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, - (const bstring *)&be_const_str_clear_to, - (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, - (const bstring *)&be_const_str_web_sensor, - (const bstring *)&be_const_str__ccmd, - NULL, - (const bstring *)&be_const_str_p2, - (const bstring *)&be_const_str_SERIAL_8E1, - (const bstring *)&be_const_str_connect, - (const bstring *)&be_const_str_c, - (const bstring *)&be_const_str_cmd, - (const bstring *)&be_const_str_a, - (const bstring *)&be_const_str_SERIAL_7E1, - (const bstring *)&be_const_str__cmd, - (const bstring *)&be_const_str_ctor, - (const bstring *)&be_const_str_attrdump, - (const bstring *)&be_const_str_every_second, - (const bstring *)&be_const_str__X5B, - (const bstring *)&be_const_str_can_show, - NULL, - (const bstring *)&be_const_str_Auto_X2Dconfiguration, - (const bstring *)&be_const_str__, - (const bstring *)&be_const_str_gen_cb, - (const bstring *)&be_const_str__X5D, - (const bstring *)&be_const_str_get_size, + (const bstring *)&be_const_str__class, NULL, + (const bstring *)&be_const_str__X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, + (const bstring *)&be_const_str_CFG_X3A_X20downloading_X20_X27_X25s_X27, (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, - (const bstring *)&be_const_str__X3E_X3D, + (const bstring *)&be_const_str_fromstring, + (const bstring *)&be_const_str_SERIAL_8E2, NULL, + (const bstring *)&be_const_str__anonymous_, + (const bstring *)&be_const_str__X2502d_X25s_X2502d, + (const bstring *)&be_const_str_CFG_X3A_X20return_code_X3D_X25i, + (const bstring *)&be_const_str_web_sensor, + (const bstring *)&be_const_str_detect, + (const bstring *)&be_const_str_exec_cmd, + (const bstring *)&be_const_str_to_gamma, + (const bstring *)&be_const_str__ptr, + (const bstring *)&be_const_str_null_cb, + (const bstring *)&be_const_str_eth, + (const bstring *)&be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf, + (const bstring *)&be_const_str_erase, + (const bstring *)&be_const_str__archive, + (const bstring *)&be_const_str_CFG_X3A_X20removed_X20file_X20_X27_X25s_X27, + (const bstring *)&be_const_str_code, + (const bstring *)&be_const_str_BUTTON_CONFIGURATION, + (const bstring *)&be_const_str_web_send_decimal, + (const bstring *)&be_const_str_fromptr, + (const bstring *)&be_const_str_SERIAL_8E1, + NULL, + (const bstring *)&be_const_str_set_style_bg_color, + (const bstring *)&be_const_str_end, + (const bstring *)&be_const_str__read, + (const bstring *)&be_const_str_cos, + (const bstring *)&be_const_str_codedump, + (const bstring *)&be_const_str__X23init_X2Ebat, + (const bstring *)&be_const_str_get_battery_chargin_status, + (const bstring *)&be_const_str__X2Ebec, + (const bstring *)&be_const_str_set_dcdc_enable, + NULL, + (const bstring *)&be_const_str_ctor, + (const bstring *)&be_const_str_digital_read, + (const bstring *)&be_const_str_close, + (const bstring *)&be_const_str__X2F, + (const bstring *)&be_const_str_cosh, + (const bstring *)&be_const_str_I2C_Driver, + (const bstring *)&be_const_str_read24, + (const bstring *)&be_const_str__write, + (const bstring *)&be_const_str__X23display_X2Eini, + (const bstring *)&be_const_str_get_bat_power, + (const bstring *)&be_const_str_pin_mode, + (const bstring *)&be_const_str__, + (const bstring *)&be_const_str_scale_uint, + (const bstring *)&be_const_str_WS2812_GRB, + (const bstring *)&be_const_str_AudioOutput, + (const bstring *)&be_const_str_animate, (const bstring *)&be_const_str__X3F, - (const bstring *)&be_const_str_base_class + (const bstring *)&be_const_str_id, + (const bstring *)&be_const_str_arg_name, + (const bstring *)&be_const_str_internal_error, + (const bstring *)&be_const_str_serial, + NULL, + NULL, + (const bstring *)&be_const_str_CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29, + (const bstring *)&be_const_str__begin_transmission, + (const bstring *)&be_const_str__X2Ep1, + (const bstring *)&be_const_str_engine, + (const bstring *)&be_const_str__def, + (const bstring *)&be_const_str_get_pixel_color, + (const bstring *)&be_const_str__X3C_X3D, + (const bstring *)&be_const_str_CFG_X3A_X20removing_X20first_X20time_X20marker, + (const bstring *)&be_const_str__X3D_X3D, + (const bstring *)&be_const_str_can_show, + (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, + (const bstring *)&be_const_str_response_append, + (const bstring *)&be_const_str_CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting, + (const bstring *)&be_const_str_content_send, + (const bstring *)&be_const_str_create_segment, + (const bstring *)&be_const_str_duration, + (const bstring *)&be_const_str_get_height, + (const bstring *)&be_const_str_delete_all_configs, + (const bstring *)&be_const_str_reset_search, + (const bstring *)&be_const_str_BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, + (const bstring *)&be_const_str_, + (const bstring *)&be_const_str_b, + (const bstring *)&be_const_str_SERIAL_5E1, + (const bstring *)&be_const_str_SERIAL_6E2, + (const bstring *)&be_const_str_read13, + (const bstring *)&be_const_str_BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, + (const bstring *)&be_const_str_publish_result, + (const bstring *)&be_const_str_get_bat_current, + NULL, + (const bstring *)&be_const_str_ceil, + (const bstring *)&be_const_str_autorun, + (const bstring *)&be_const_str_length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032, + (const bstring *)&be_const_str_set_text, + (const bstring *)&be_const_str__X3D_X3C_X3E_X21, + (const bstring *)&be_const_str_r, + (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X20, + (const bstring *)&be_const_str__X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str__X2Ep, + (const bstring *)&be_const_str__error, + (const bstring *)&be_const_str_lv, + (const bstring *)&be_const_str_flush, + (const bstring *)&be_const_str_AudioFileSource, + (const bstring *)&be_const_str_web_add_main_button, + (const bstring *)&be_const_str__X2Elen, + (const bstring *)&be_const_str_persist_X2E_p_X20is_X20not_X20a_X20map, + (const bstring *)&be_const_str_compile, + (const bstring *)&be_const_str_CFG_X3A_X20running_X20, + (const bstring *)&be_const_str_compress, + NULL, + (const bstring *)&be_const_str_pin_used, + (const bstring *)&be_const_str__X2Ebe, + (const bstring *)&be_const_str_SERIAL_8O1, + (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X27_X25s_X27, + (const bstring *)&be_const_str_EVENT_DRAW_PART_END, + NULL, + NULL, + (const bstring *)&be_const_str_button_pressed, + (const bstring *)&be_const_str_atleast1, + (const bstring *)&be_const_str_add_anim, + (const bstring *)&be_const_str_count, + (const bstring *)&be_const_str__X25s_X2Eautoconf, + (const bstring *)&be_const_str_False, + (const bstring *)&be_const_str_time_str, + (const bstring *)&be_const_str__X26lt_X3BNone_X26gt_X3B, + (const bstring *)&be_const_str_allocated, + NULL, + (const bstring *)&be_const_str_cb_obj, + (const bstring *)&be_const_str__X21_X3D, + (const bstring *)&be_const_str__X3Cselect_X20name_X3D_X27zip_X27_X3E, + (const bstring *)&be_const_str_OneWire, + (const bstring *)&be_const_str_classof, + (const bstring *)&be_const_str_json, + (const bstring *)&be_const_str_True, + (const bstring *)&be_const_str__X2B, + (const bstring *)&be_const_str_decompress, + (const bstring *)&be_const_str_CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, + (const bstring *)&be_const_str_lv_event, + (const bstring *)&be_const_str_counters, + (const bstring *)&be_const_str_pc, + (const bstring *)&be_const_str__X2Esize, + NULL, + (const bstring *)&be_const_str__X5B, + (const bstring *)&be_const_str__X3C_X2Fform_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_connection_error, + (const bstring *)&be_const_str_classname, + (const bstring *)&be_const_str_AudioGeneratorWAV, + (const bstring *)&be_const_str_AudioGenerator, + (const bstring *)&be_const_str_Parameter_X20error, + (const bstring *)&be_const_str_get_tasmota, + (const bstring *)&be_const_str_loop, + (const bstring *)&be_const_str__timers, + (const bstring *)&be_const_str_constructor_cb, + (const bstring *)&be_const_str_addr, + (const bstring *)&be_const_str__X2E, + (const bstring *)&be_const_str_RES_OK, + NULL, + (const bstring *)&be_const_str_OPTION_A, + NULL, + (const bstring *)&be_const_str_collect, + (const bstring *)&be_const_str_SERIAL_6O2, + (const bstring *)&be_const_str_AudioFileSourceFS, + (const bstring *)&be_const_str_show, + (const bstring *)&be_const_str__cmd, + (const bstring *)&be_const_str_SERIAL_7N2, + (const bstring *)&be_const_str_dirty, + (const bstring *)&be_const_str_SERIAL_7E2, + (const bstring *)&be_const_str__X3E, + (const bstring *)&be_const_str__X2F_X3Frst_X3D, + (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, + (const bstring *)&be_const_str_EVENT_DRAW_PART_BEGIN, + (const bstring *)&be_const_str__persist_X2Ejson, + (const bstring *)&be_const_str_tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29, + (const bstring *)&be_const_str__X3Clambda_X3E }; static const struct bconststrtab m_const_string_table = { - .size = 360, - .count = 743, + .size = 359, + .count = 741, .table = m_string_table }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h index dc2abcca8..05c140fe0 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h @@ -1,96 +1,93 @@ #include "be_constobj.h" static be_define_const_map_slots(be_class_tasmota_map) { - { be_const_key(gc, -1), be_const_closure(Tasmota_gc_closure) }, - { be_const_key(read_sensors, 7), be_const_func(l_read_sensors) }, - { be_const_key(_get_cb, -1), be_const_func(l_get_cb) }, - { be_const_key(response_append, 50), be_const_func(l_respAppend) }, - { be_const_key(try_rule, 74), be_const_closure(Tasmota_try_rule_closure) }, - { be_const_key(eth, -1), be_const_func(l_eth) }, - { be_const_key(find_key_i, -1), be_const_closure(Tasmota_find_key_i_closure) }, - { be_const_key(exec_tele, 73), be_const_closure(Tasmota_exec_tele_closure) }, - { be_const_key(remove_driver, 28), be_const_closure(Tasmota_remove_driver_closure) }, - { be_const_key(load, -1), be_const_closure(Tasmota_load_closure) }, - { be_const_key(_settings_ptr, -1), be_const_comptr(&Settings) }, - { be_const_key(cmd_res, -1), be_const_var(0) }, - { be_const_key(time_str, 43), be_const_closure(Tasmota_time_str_closure) }, - { be_const_key(set_power, -1), be_const_func(l_setpower) }, - { be_const_key(yield, 20), be_const_func(l_yield) }, - { be_const_key(set_light, -1), be_const_closure(Tasmota_set_light_closure) }, - { be_const_key(find_op, 32), be_const_closure(Tasmota_find_op_closure) }, - { be_const_key(get_power, -1), be_const_func(l_getpower) }, - { be_const_key(add_rule, -1), be_const_closure(Tasmota_add_rule_closure) }, - { be_const_key(cb_dispatch, -1), be_const_closure(Tasmota_cb_dispatch_closure) }, - { be_const_key(global, -1), be_const_var(1) }, - { be_const_key(i2c_enabled, -1), be_const_func(l_i2cenabled) }, - { be_const_key(remove_cmd, 10), be_const_closure(Tasmota_remove_cmd_closure) }, - { be_const_key(millis, 18), be_const_func(l_millis) }, - { be_const_key(publish, 69), be_const_func(l_publish) }, - { be_const_key(_drivers, -1), be_const_var(2) }, - { be_const_key(resp_cmnd, -1), be_const_func(l_respCmnd) }, - { be_const_key(time_dump, -1), be_const_func(l_time_dump) }, - { be_const_key(web_send, -1), be_const_func(l_webSend) }, - { be_const_key(hs2rgb, -1), be_const_closure(Tasmota_hs2rgb_closure) }, - { be_const_key(memory, -1), be_const_func(l_memory) }, - { be_const_key(gen_cb, 0), be_const_closure(Tasmota_gen_cb_closure) }, - { be_const_key(rtc, -1), be_const_func(l_rtc) }, - { be_const_key(get_option, -1), be_const_func(l_getoption) }, - { be_const_key(add_cmd, -1), be_const_closure(Tasmota_add_cmd_closure) }, - { be_const_key(init, -1), be_const_closure(Tasmota_init_closure) }, - { be_const_key(_timers, -1), be_const_var(3) }, - { be_const_key(_global_addr, -1), be_const_comptr(&TasmotaGlobal) }, - { be_const_key(wd, -1), be_const_var(4) }, - { be_const_key(exec_cmd, -1), be_const_closure(Tasmota_exec_cmd_closure) }, - { be_const_key(wire_scan, -1), be_const_closure(Tasmota_wire_scan_closure) }, - { be_const_key(_global_def, 61), be_const_comptr(&be_tasmota_global_struct) }, - { be_const_key(resp_cmnd_failed, 11), be_const_func(l_respCmndFailed) }, - { be_const_key(chars_in_string, -1), be_const_closure(Tasmota_chars_in_string_closure) }, - { be_const_key(web_send_decimal, -1), be_const_func(l_webSendDecimal) }, - { be_const_key(_debug_present, 4), be_const_var(5) }, - { be_const_key(cmd, -1), be_const_closure(Tasmota_cmd_closure) }, - { be_const_key(_cb, -1), be_const_var(6) }, - { be_const_key(remove_rule, -1), be_const_closure(Tasmota_remove_rule_closure) }, { be_const_key(run_deferred, -1), be_const_closure(Tasmota_run_deferred_closure) }, - { be_const_key(strftime, -1), be_const_func(l_strftime) }, - { be_const_key(add_driver, 3), be_const_closure(Tasmota_add_driver_closure) }, - { be_const_key(kv, 60), be_const_closure(Tasmota_kv_closure) }, - { be_const_key(set_timer, 58), be_const_closure(Tasmota_set_timer_closure) }, - { be_const_key(scale_uint, -1), be_const_func(l_scaleuint) }, - { be_const_key(remove_timer, -1), be_const_closure(Tasmota_remove_timer_closure) }, - { be_const_key(settings, 49), be_const_var(7) }, - { be_const_key(arch, -1), be_const_func(l_arch) }, - { be_const_key(_ccmd, 64), be_const_var(8) }, - { be_const_key(wire1, 46), be_const_var(9) }, - { be_const_key(exec_rules, 66), be_const_closure(Tasmota_exec_rules_closure) }, - { be_const_key(strptime, -1), be_const_func(l_strptime) }, - { be_const_key(_cmd, -1), be_const_func(l_cmd) }, - { be_const_key(resp_cmnd_error, -1), be_const_func(l_respCmndError) }, - { be_const_key(time_reached, -1), be_const_func(l_timereached) }, - { be_const_key(_rules, -1), be_const_var(10) }, - { be_const_key(publish_result, -1), be_const_func(l_publish_result) }, - { be_const_key(_settings_def, -1), be_const_comptr(&be_tasmota_settings_struct) }, - { be_const_key(get_switch, -1), be_const_func(l_getswitch) }, - { be_const_key(delay, 71), be_const_func(l_delay) }, + { be_const_key(publish, -1), be_const_func(l_publish) }, + { be_const_key(try_rule, 5), be_const_closure(Tasmota_try_rule_closure) }, + { be_const_key(_settings_ptr, -1), be_const_comptr(&Settings) }, + { be_const_key(get_free_heap, 47), be_const_func(l_getFreeHeap) }, + { be_const_key(eth, 56), be_const_func(l_eth) }, + { be_const_key(set_power, -1), be_const_func(l_setpower) }, + { be_const_key(exec_rules, -1), be_const_closure(Tasmota_exec_rules_closure) }, + { be_const_key(i2c_enabled, -1), be_const_func(l_i2cenabled) }, + { be_const_key(chars_in_string, 55), be_const_closure(Tasmota_chars_in_string_closure) }, + { be_const_key(hs2rgb, -1), be_const_closure(Tasmota_hs2rgb_closure) }, + { be_const_key(time_str, 0), be_const_closure(Tasmota_time_str_closure) }, + { be_const_key(set_light, -1), be_const_closure(Tasmota_set_light_closure) }, + { be_const_key(response_append, 1), be_const_func(l_respAppend) }, + { be_const_key(gen_cb, -1), be_const_closure(Tasmota_gen_cb_closure) }, + { be_const_key(remove_driver, 50), be_const_closure(Tasmota_remove_driver_closure) }, + { be_const_key(event, -1), be_const_closure(Tasmota_event_closure) }, + { be_const_key(exec_cmd, 2), be_const_closure(Tasmota_exec_cmd_closure) }, + { be_const_key(rtc, 12), be_const_func(l_rtc) }, + { be_const_key(read_sensors, -1), be_const_func(l_read_sensors) }, { be_const_key(resp_cmnd_str, -1), be_const_func(l_respCmndStr) }, - { be_const_key(wifi, -1), be_const_func(l_wifi) }, - { be_const_key(save, 15), be_const_func(l_save) }, - { be_const_key(log, 37), be_const_func(l_logInfo) }, + { be_const_key(set_timer, -1), be_const_closure(Tasmota_set_timer_closure) }, + { be_const_key(resp_cmnd_error, -1), be_const_func(l_respCmndError) }, + { be_const_key(exec_tele, -1), be_const_closure(Tasmota_exec_tele_closure) }, + { be_const_key(_global_def, -1), be_const_comptr(&be_tasmota_global_struct) }, + { be_const_key(cmd_res, -1), be_const_var(0) }, + { be_const_key(_global_addr, -1), be_const_comptr(&TasmotaGlobal) }, + { be_const_key(add_driver, 14), be_const_closure(Tasmota_add_driver_closure) }, + { be_const_key(_timers, -1), be_const_var(1) }, + { be_const_key(add_rule, -1), be_const_closure(Tasmota_add_rule_closure) }, + { be_const_key(resp_cmnd_failed, -1), be_const_func(l_respCmndFailed) }, + { be_const_key(remove_rule, 9), be_const_closure(Tasmota_remove_rule_closure) }, + { be_const_key(web_send, 16), be_const_func(l_webSend) }, + { be_const_key(resp_cmnd, -1), be_const_func(l_respCmnd) }, + { be_const_key(remove_timer, 10), be_const_closure(Tasmota_remove_timer_closure) }, + { be_const_key(memory, 52), be_const_func(l_memory) }, + { be_const_key(global, 71), be_const_var(2) }, + { be_const_key(find_op, -1), be_const_closure(Tasmota_find_op_closure) }, + { be_const_key(yield, 60), be_const_func(l_yield) }, { be_const_key(resolvecmnd, -1), be_const_func(l_resolveCmnd) }, - { be_const_key(resp_cmnd_done, -1), be_const_func(l_respCmndDone) }, - { be_const_key(get_light, 5), be_const_closure(Tasmota_get_light_closure) }, - { be_const_key(get_free_heap, -1), be_const_func(l_getFreeHeap) }, - { be_const_key(wire2, -1), be_const_var(11) }, - { be_const_key(event, 34), be_const_closure(Tasmota_event_closure) }, + { be_const_key(get_option, -1), be_const_func(l_getoption) }, + { be_const_key(kv, 43), be_const_closure(Tasmota_kv_closure) }, + { be_const_key(wire_scan, -1), be_const_closure(Tasmota_wire_scan_closure) }, + { be_const_key(wifi, 37), be_const_func(l_wifi) }, + { be_const_key(_cmd, -1), be_const_func(l_cmd) }, + { be_const_key(gc, -1), be_const_closure(Tasmota_gc_closure) }, + { be_const_key(get_power, -1), be_const_func(l_getpower) }, + { be_const_key(get_light, -1), be_const_closure(Tasmota_get_light_closure) }, + { be_const_key(time_dump, -1), be_const_func(l_time_dump) }, + { be_const_key(settings, -1), be_const_var(3) }, + { be_const_key(cmd, 62), be_const_closure(Tasmota_cmd_closure) }, + { be_const_key(load, -1), be_const_closure(Tasmota_load_closure) }, + { be_const_key(strptime, -1), be_const_func(l_strptime) }, + { be_const_key(_ccmd, -1), be_const_var(4) }, + { be_const_key(find_key_i, 25), be_const_closure(Tasmota_find_key_i_closure) }, + { be_const_key(delay, -1), be_const_func(l_delay) }, + { be_const_key(time_reached, -1), be_const_func(l_timereached) }, + { be_const_key(_settings_def, -1), be_const_comptr(&be_tasmota_settings_struct) }, + { be_const_key(save, 36), be_const_func(l_save) }, + { be_const_key(millis, -1), be_const_func(l_millis) }, + { be_const_key(wire2, -1), be_const_var(5) }, + { be_const_key(wire1, 72), be_const_var(6) }, + { be_const_key(web_send_decimal, -1), be_const_func(l_webSendDecimal) }, + { be_const_key(scale_uint, 51), be_const_func(l_scaleuint) }, + { be_const_key(get_switch, -1), be_const_func(l_getswitch) }, + { be_const_key(_debug_present, -1), be_const_var(7) }, + { be_const_key(publish_result, -1), be_const_func(l_publish_result) }, + { be_const_key(_drivers, -1), be_const_var(8) }, + { be_const_key(add_cmd, -1), be_const_closure(Tasmota_add_cmd_closure) }, + { be_const_key(strftime, -1), be_const_func(l_strftime) }, + { be_const_key(log, -1), be_const_func(l_logInfo) }, + { be_const_key(arch, -1), be_const_func(l_arch) }, + { be_const_key(resp_cmnd_done, 74), be_const_func(l_respCmndDone) }, + { be_const_key(_rules, 38), be_const_var(9) }, + { be_const_key(remove_cmd, -1), be_const_closure(Tasmota_remove_cmd_closure) }, + { be_const_key(init, -1), be_const_closure(Tasmota_init_closure) }, + { be_const_key(wd, 53), be_const_var(10) }, }; static be_define_const_map( be_class_tasmota_map, - 80 + 77 ); BE_EXPORT_VARIABLE be_define_const_class( be_class_tasmota, - 12, + 11, NULL, Tasmota ); diff --git a/lib/libesp32/Berry/generate/be_fixed_cb.h b/lib/libesp32/Berry/generate/be_fixed_cb.h new file mode 100644 index 000000000..ef458f363 --- /dev/null +++ b/lib/libesp32/Berry/generate/be_fixed_cb.h @@ -0,0 +1,18 @@ +#include "be_constobj.h" + +static be_define_const_map_slots(m_libcb_map) { + { be_const_key(get_cb_list, -1), be_const_func(be_cb_get_cb_list) }, + { be_const_key(gen_cb, -1), be_const_func(be_cb_gen_cb) }, +}; + +static be_define_const_map( + m_libcb_map, + 2 +); + +static be_define_const_module( + m_libcb, + "cb" +); + +BE_EXPORT_VARIABLE be_define_const_native_module(cb); diff --git a/lib/libesp32/Berry/src/be_exec.c b/lib/libesp32/Berry/src/be_exec.c index 7b741e4ff..14dbe903c 100644 --- a/lib/libesp32/Berry/src/be_exec.c +++ b/lib/libesp32/Berry/src/be_exec.c @@ -393,10 +393,7 @@ void be_stack_expansion(bvm *vm, int n) stack_resize(vm, size + 1); be_raise(vm, "runtime_error", STACK_OVER_MSG(BE_STACK_TOTAL_MAX)); } -#if BE_USE_OBSERVABILITY_HOOK - if (vm->obshook != NULL) - (*vm->obshook)(vm, BE_OBS_STACK_RESIZE_START, size * sizeof(bvalue), (size + n) * sizeof(bvalue)); -#endif + if (vm->obshook != NULL) (*vm->obshook)(vm, BE_OBS_STACK_RESIZE_START, size * sizeof(bvalue), (size + n) * sizeof(bvalue)); stack_resize(vm, size + n); } diff --git a/lib/libesp32/Berry/src/be_gc.c b/lib/libesp32/Berry/src/be_gc.c index b3cf7ab98..8d19affb1 100644 --- a/lib/libesp32/Berry/src/be_gc.c +++ b/lib/libesp32/Berry/src/be_gc.c @@ -544,10 +544,7 @@ void be_gc_collect(bvm *vm) vm->counter_gc_kept = 0; vm->counter_gc_freed = 0; #endif -#if BE_USE_OBSERVABILITY_HOOK - if (vm->obshook != NULL) - (*vm->obshook)(vm, BE_OBS_GC_START, vm->gc.usage); -#endif + if (vm->obshook != NULL) (*vm->obshook)(vm, BE_OBS_GC_START, vm->gc.usage); /* step 1: set root-set reference objects to unscanned */ premark_internal(vm); /* object internal the VM */ premark_global(vm); /* global objects */ @@ -564,8 +561,5 @@ void be_gc_collect(bvm *vm) reset_fixedlist(vm); /* step 5: calculate the next GC threshold */ vm->gc.threshold = next_threshold(vm->gc); -#if BE_USE_OBSERVABILITY_HOOK - if (vm->obshook != NULL) - (*vm->obshook)(vm, BE_OBS_GC_END, vm->gc.usage, vm->counter_gc_kept, vm->counter_gc_freed); -#endif + if (vm->obshook != NULL) (*vm->obshook)(vm, BE_OBS_GC_END, vm->gc.usage, vm->counter_gc_kept, vm->counter_gc_freed); } diff --git a/lib/libesp32/Berry/src/be_vm.c b/lib/libesp32/Berry/src/be_vm.c index 26c15a1a3..96329e898 100644 --- a/lib/libesp32/Berry/src/be_vm.c +++ b/lib/libesp32/Berry/src/be_vm.c @@ -55,7 +55,7 @@ #define COUNTER_HOOK() #endif -#if BE_USE_PERF_COUNTERS && BE_USE_OBSERVABILITY_HOOK +#if BE_USE_PERF_COUNTERS #define VM_HEARTBEAT() \ if ((vm->counter_ins & ((1<<(BE_VM_OBSERVABILITY_SAMPLING - 1))-1) ) == 0) { /* call every 2^BE_VM_OBSERVABILITY_SAMPLING instructions */ \ if (vm->obshook != NULL) \ @@ -461,9 +461,7 @@ BERRY_API bvm* be_vm_new(void) be_gc_setpause(vm, 1); be_loadlibs(vm); vm->compopt = 0; -#if BE_USE_OBSERVABILITY_HOOK vm->obshook = NULL; -#endif #if BE_USE_PERF_COUNTERS vm->counter_ins = 0; vm->counter_enter = 0; @@ -1269,7 +1267,5 @@ BERRY_API void be_set_obs_hook(bvm *vm, bobshook hook) (void)vm; /* avoid comiler warning */ (void)hook; /* avoid comiler warning */ -#if BE_USE_OBSERVABILITY_HOOK vm->obshook = hook; -#endif } diff --git a/lib/libesp32/Berry/src/be_vm.h b/lib/libesp32/Berry/src/be_vm.h index 4d98c590f..19d745a7c 100644 --- a/lib/libesp32/Berry/src/be_vm.h +++ b/lib/libesp32/Berry/src/be_vm.h @@ -101,9 +101,7 @@ struct bvm { blist *registry; /* registry list */ struct bgc gc; bbyte compopt; /* compilation options */ -#if BE_USE_OBSERVABILITY_HOOK bobshook obshook; -#endif #if BE_USE_PERF_COUNTERS uint32_t counter_ins; /* instructions counter */ uint32_t counter_enter; /* counter for times the VM was entered */ diff --git a/lib/libesp32/Berry/src/berry.h b/lib/libesp32/Berry/src/berry.h index e69a3bbe8..68f1efd4d 100644 --- a/lib/libesp32/Berry/src/berry.h +++ b/lib/libesp32/Berry/src/berry.h @@ -402,6 +402,7 @@ typedef void(*bntvhook)(bvm *vm, bhookinfo *info); typedef void(*bobshook)(bvm *vm, int event, ...); enum beobshookevents { + BE_OBS_PCALL_ERROR, /* called when be_callp() returned an error, most likely an exception */ BE_OBS_GC_START, /* start of GC, arg = allocated size */ BE_OBS_GC_END, /* end of GC, arg = allocated size */ BE_OBS_VM_HEARTBEAT, /* VM heartbeat called every million instructions */ diff --git a/lib/libesp32/berry_mapping/library.json b/lib/libesp32/berry_mapping/library.json new file mode 100644 index 000000000..6bcf119fa --- /dev/null +++ b/lib/libesp32/berry_mapping/library.json @@ -0,0 +1,17 @@ +{ + "name": "Berry mapping to C", + "version": "1.0", + "description": "Mapping to C functions", + "license": "MIT", + "homepage": "https://github.com/arendst/Tasmota", + "frameworks": "*", + "platforms": "*", + "authors": + { + "name": "Stephan Hadinger", + "maintainer": true + }, + "build": { + "flags": [ "-I$PROJECT_DIR/include" ] + } + } \ No newline at end of file diff --git a/lib/libesp32/berry_mapping/src/be_cb_module.c b/lib/libesp32/berry_mapping/src/be_cb_module.c new file mode 100644 index 000000000..191fe240d --- /dev/null +++ b/lib/libesp32/berry_mapping/src/be_cb_module.c @@ -0,0 +1,171 @@ +/******************************************************************** + * Callback module + * + * To use: `import cb` + * + *******************************************************************/ +#include "be_constobj.h" + +#include "be_mapping.h" +#include "be_gc.h" +#include "be_exec.h" +#include "be_vm.h" + +/*********************************************************************************************\ + * Callback structures + * + * We allow 4 parameters, or 3 if method (first arg is `self`) + * This could be extended if needed +\*********************************************************************************************/ +typedef int32_t (*berry_callback_t)(int32_t v0, int32_t v1, int32_t v2, int32_t v3); +static int32_t call_berry_cb(int32_t num, int32_t v0, int32_t v1, int32_t v2, int32_t v3); + +#define BERRY_CB(n) int32_t berry_cb_##n(int32_t v0, int32_t v1, int32_t v2, int32_t v3) { return call_berry_cb(n, v0, v1, v2, v3); } +// list the callbacks +BERRY_CB(0); +BERRY_CB(1); +BERRY_CB(2); +BERRY_CB(3); +BERRY_CB(4); +BERRY_CB(5); +BERRY_CB(6); +BERRY_CB(7); +BERRY_CB(8); +BERRY_CB(9); +BERRY_CB(10); +BERRY_CB(11); +BERRY_CB(12); +BERRY_CB(13); +BERRY_CB(14); +BERRY_CB(15); +BERRY_CB(16); +BERRY_CB(17); +BERRY_CB(18); +BERRY_CB(19); + +// array of callbacks +static const berry_callback_t berry_callback_array[BE_MAX_CB] = { + berry_cb_0, + berry_cb_1, + berry_cb_2, + berry_cb_3, + berry_cb_4, + berry_cb_5, + berry_cb_6, + berry_cb_7, + berry_cb_8, + berry_cb_9, + berry_cb_10, + berry_cb_11, + berry_cb_12, + berry_cb_13, + berry_cb_14, + berry_cb_15, + berry_cb_16, + berry_cb_17, + berry_cb_18, + berry_cb_19, +}; + +typedef struct be_callback_hook { + bvm *vm; + bgcobject *f; +} be_callback_hook; + +static be_callback_hook be_cb_hooks[BE_MAX_CB] = {0}; + +/*********************************************************************************************\ + * `gen_cb`: Generate a new callback + * + * arg1: function (or closure) +\*********************************************************************************************/ +static int32_t be_cb_gen_cb(bvm *vm) { + int32_t top = be_top(vm); + if (top >= 1 && be_isfunction(vm, 1)) { + // find first available slot + int32_t slot; + for (slot = 0; slot < BE_MAX_CB; slot++) { + if (be_cb_hooks[slot].f == NULL) break; + } + bvalue *v = be_indexof(vm, 1); + if (slot < BE_MAX_CB) { + // found a free slot + bgcobject * f = v->v.gc; + // mark the function as non-gc + be_gc_fix_set(vm, f, btrue); + // record pointers + be_cb_hooks[slot].vm = vm; + be_cb_hooks[slot].f = f; + be_pushcomptr(vm, (void*) berry_callback_array[slot]); + be_return(vm); + } else { + be_raise(vm, "internal_error", "no more callbacks available, increase BE_MAX_CB"); + } + } + be_raise(vm, "value_error", "arg must be a function"); +} + +/*********************************************************************************************\ + * `get_cb_list`: Return the list of callbacks for this vm + * +\*********************************************************************************************/ +static int32_t be_cb_get_cb_list(bvm *vm) { + be_newobject(vm, "list"); + int32_t i; + for (uint32_t i=0; i < BE_MAX_CB; i++) { + if (be_cb_hooks[i].vm) { + if (vm == be_cb_hooks[i].vm) { // make sure it corresponds to this vm + be_pushcomptr(vm, be_cb_hooks[i].f); + be_data_push(vm, -2); + be_pop(vm, 1); + } + } else { + break; + } + } + be_pop(vm, 1); + be_return(vm); +} + +/*********************************************************************************************\ + * Callback structures + * + * We allow 4 parameters, or 3 if method (first arg is `self`) + * This could be extended if needed +\*********************************************************************************************/ +static int32_t call_berry_cb(int32_t num, int32_t v0, int32_t v1, int32_t v2, int32_t v3) { + // call berry cb dispatcher + int32_t ret = 0; + // retrieve vm and function + if (num < 0 || num >= BE_MAX_CB || be_cb_hooks[num].vm == NULL) return 0; // invalid call, avoid a crash + + bvm * vm = be_cb_hooks[num].vm; + bgcobject * f = be_cb_hooks[num].f; + + // push function (don't check type) + bvalue *top = be_incrtop(vm); + var_setobj(top, f->type, f); + // push args + be_pushint(vm, v0); + be_pushint(vm, v1); + be_pushint(vm, v2); + be_pushint(vm, v3); + + ret = be_pcall(vm, 4); // 4 arguments + if (ret != 0) { + if (vm->obshook != NULL) (*vm->obshook)(vm, BE_OBS_PCALL_ERROR); + be_pop(vm, be_top(vm)); // clear Berry stack + return 0; + } + ret = be_toint(vm, -5); + be_pop(vm, 5); // remove result + return ret; +} + +/* @const_object_info_begin +module cb (scope: global) { + gen_cb, func(be_cb_gen_cb) + get_cb_list, func(be_cb_get_cb_list) +} +@const_object_info_end */ +#include "../../Berry/generate/be_fixed_cb.h" diff --git a/lib/libesp32/berry_mapping/src/be_mapping.h b/lib/libesp32/berry_mapping/src/be_mapping.h new file mode 100644 index 000000000..850cd08c0 --- /dev/null +++ b/lib/libesp32/berry_mapping/src/be_mapping.h @@ -0,0 +1,10 @@ + + +#ifndef __BE_MAPPING__ +#define __BE_MAPPING__ + +// include this header to force compilation fo this module + +#define BE_MAX_CB 20 // max number of callbacks, each callback requires a distinct address + +#endif // __BE_MAPPING__ diff --git a/tasmota/xdrv_52_0_berry_struct.ino b/tasmota/xdrv_52_0_berry_struct.ino index fe09b3c84..760358ab0 100644 --- a/tasmota/xdrv_52_0_berry_struct.ino +++ b/tasmota/xdrv_52_0_berry_struct.ino @@ -23,6 +23,7 @@ #include #include +#include "be_mapping.h" #include "re1.5.h" /*********************************************************************************************\ diff --git a/tasmota/xdrv_52_1_berry_native.ino b/tasmota/xdrv_52_1_berry_native.ino index 970d26c48..98757b730 100644 --- a/tasmota/xdrv_52_1_berry_native.ino +++ b/tasmota/xdrv_52_1_berry_native.ino @@ -45,8 +45,11 @@ extern "C" { * Responds to virtual constants \*********************************************************************************************/ extern "C" { - // Clear all elements on the stack - void be_pop_all(bvm *vm) { + #include "be_vm.h" + // Call error handler and pop all from stack + void be_error_pop_all(bvm *vm); + void be_error_pop_all(bvm *vm) { + if (vm->obshook != NULL) (*vm->obshook)(vm, BE_OBS_PCALL_ERROR); be_pop(vm, be_top(vm)); // clear Berry stack } @@ -267,113 +270,6 @@ extern "C" { * Warning, the following expect all parameters to be 32 bits wide \*********************************************************************************************/ -extern "C" { - - /*********************************************************************************************\ - * Callback structures - * - * We allow 4 parameters, or 3 if method (first arg is `self`) - * This could be extended if needed - \*********************************************************************************************/ - typedef int32_t (*berry_callback_t)(int32_t v0, int32_t v1, int32_t v2, int32_t v3); - - extern void BerryDumpErrorAndClear(bvm *vm, bool berry_console); - - /*********************************************************************************************\ - * Callback structures - * - * We allow 4 parameters, or 3 if method (first arg is `self`) - * This could be extended if needed - \*********************************************************************************************/ - int32_t call_berry_cb(int32_t num, int32_t v0, int32_t v1, int32_t v2, int32_t v3) { - // call berry cb dispatcher - int32_t ret = 0; - // get the 'tasmota' object (global) and call 'cb_dispatch' - be_getglobal(berry.vm, PSTR("tasmota")); - if (!be_isnil(berry.vm, -1)) { - be_getmethod(berry.vm, -1, PSTR("cb_dispatch")); - - if (!be_isnil(berry.vm, -1)) { - be_pushvalue(berry.vm, -2); // add instance as first arg - // push all args as ints (may be revised) - be_pushint(berry.vm, num); - be_pushint(berry.vm, v0); - be_pushint(berry.vm, v1); - be_pushint(berry.vm, v2); - be_pushint(berry.vm, v3); - - ret = be_pcall(berry.vm, 6); // 5 arguments - if (ret != 0) { - BerryDumpErrorAndClear(berry.vm, false); // log in Tasmota console only - be_pop_all(berry.vm); // clear Berry stack - return 0; - } - be_pop(berry.vm, 6); - - if (be_isint(berry.vm, -1) || be_isnil(berry.vm, -1)) { // sanity check - if (be_isint(berry.vm, -1)) { - ret = be_toint(berry.vm, -1); - } - // All good, we can proceed - be_pop(berry.vm, 2); // remove tasmota instance and result - return ret; - } - } - be_pop(berry.vm, 1); - } - be_pop(berry.vm, 1); - AddLog(LOG_LEVEL_ERROR, PSTR(D_LOG_BERRY "can't call 'tasmota.cb_dispatch'")); - return 0; - } - - #define BERRY_CB(n) int32_t berry_cb_##n(int32_t v0, int32_t v1, int32_t v2, int32_t v3) { return call_berry_cb(n, v0, v1, v2, v3); } - // list the callbacks - BERRY_CB(0); - BERRY_CB(1); - BERRY_CB(2); - BERRY_CB(3); - BERRY_CB(4); - BERRY_CB(5); - BERRY_CB(6); - BERRY_CB(7); - BERRY_CB(8); - BERRY_CB(9); - BERRY_CB(10); - BERRY_CB(11); - BERRY_CB(12); - BERRY_CB(13); - BERRY_CB(14); - BERRY_CB(15); - BERRY_CB(16); - BERRY_CB(17); - BERRY_CB(18); - BERRY_CB(19); - - // array of callbacks - berry_callback_t berry_callback_array[] { - berry_cb_0, - berry_cb_1, - berry_cb_2, - berry_cb_3, - berry_cb_4, - berry_cb_5, - berry_cb_6, - berry_cb_7, - berry_cb_8, - berry_cb_9, - berry_cb_10, - berry_cb_11, - berry_cb_12, - berry_cb_13, - berry_cb_14, - berry_cb_15, - berry_cb_16, - berry_cb_17, - berry_cb_18, - berry_cb_19, - }; -} - /*********************************************************************************************\ * Automatically parse Berry stack and call the C function accordingly * diff --git a/tasmota/xdrv_52_3_berry_tasmota.ino b/tasmota/xdrv_52_3_berry_tasmota.ino index cfc847e7a..a9d0ad734 100644 --- a/tasmota/xdrv_52_3_berry_tasmota.ino +++ b/tasmota/xdrv_52_3_berry_tasmota.ino @@ -26,25 +26,25 @@ const uint32_t BERRY_MAX_LOGS = 16; // max number of print output recorded when outside of REPL, used to avoid infinite grow of logs const uint32_t BERRY_MAX_REPL_LOGS = 1024; // max number of print output recorded when inside REPL -/*********************************************************************************************\ - * Return C callback from index - * -\*********************************************************************************************/ -extern "C" { - int32_t l_get_cb(struct bvm *vm); - int32_t l_get_cb(struct bvm *vm) { - int32_t argc = be_top(vm); // Get the number of arguments - if (argc >= 2 && be_isint(vm, 2)) { - int32_t idx = be_toint(vm, 2); - if (idx >= 0 && idx < ARRAY_SIZE(berry_callback_array)) { - const berry_callback_t c_ptr = berry_callback_array[idx]; - be_pushcomptr(vm, (void*) c_ptr); - be_return(vm); - } - } - be_raise(vm, kTypeError, nullptr); - } -} +// /*********************************************************************************************\ +// * Return C callback from index +// * +// \*********************************************************************************************/ +// extern "C" { +// extern int32_t be_cb__get_cb(struct bvm *vm); +// int32_t be_cb__get_cb(struct bvm *vm) { +// int32_t argc = be_top(vm); // Get the number of arguments +// if (argc >= 2 && be_isint(vm, 2)) { +// int32_t idx = be_toint(vm, 2); +// if (idx >= 0 && idx < ARRAY_SIZE(berry_callback_array)) { +// const berry_callback_t c_ptr = berry_callback_array[idx]; +// be_pushcomptr(vm, (void*) c_ptr); +// be_return(vm); +// } +// } +// be_raise(vm, kTypeError, nullptr); +// } +// } /*********************************************************************************************\ * Native functions mapped to Berry functions diff --git a/tasmota/xdrv_52_9_berry.ino b/tasmota/xdrv_52_9_berry.ino index 84a4f698c..b48281fde 100644 --- a/tasmota/xdrv_52_9_berry.ino +++ b/tasmota/xdrv_52_9_berry.ino @@ -110,24 +110,6 @@ size_t callBerryGC(void) { return callBerryEventDispatcher(PSTR("gc"), nullptr, 0, nullptr); } -void BerryDumpErrorAndClear(bvm *vm, bool berry_console); -void BerryDumpErrorAndClear(bvm *vm, bool berry_console) { - int32_t top = be_top(vm); - // check if we have two strings for an Exception - if (top >= 2 && be_isstring(vm, -1) && be_isstring(vm, -2)) { - if (berry_console) { - berry_log_C(PSTR(D_LOG_BERRY "Exception> '%s' - %s"), be_tostring(berry.vm, -2), be_tostring(berry.vm, -1)); - be_tracestack(vm); - top = be_top(vm); // update top after dump - } else { - AddLog(LOG_LEVEL_ERROR, PSTR(D_LOG_BERRY "Exception> '%s' - %s"), be_tostring(berry.vm, -2), be_tostring(berry.vm, -1)); - be_tracestack(vm); - } - } else { - be_dumpstack(vm); - } -} - // void callBerryMqttData(void) { // AddLog(LOG_LEVEL_INFO, D_LOG_BERRY "callBerryMqttData"); // if (nullptr == berry.vm) { return; } @@ -150,53 +132,6 @@ void BerryDumpErrorAndClear(bvm *vm, bool berry_console) { // checkBeTop(); // } -/* -// Call a method of a global object, with n args -// Before: stack must containt n args -// After: stack contains return value or nil if something wrong (args removes) -// returns true is successful, false if object or method not found -bool callMethodObjectWithArgs(const char * objname, const char * method, size_t argc) { - if (nullptr == berry.vm) { return false; } - int32_t top = be_top(berry.vm); - // stacks contains n x arg - be_getglobal(berry.vm, objname); - // stacks contains n x arg + object - if (!be_isnil(berry.vm, -1)) { - be_getmethod(berry.vm, -1, method); - // stacks contains n x arg + object + method - if (!be_isnil(berry.vm, -1)) { - // reshuffle the entire stack since we want: method + object + n x arg - be_pushvalue(berry.vm, -1); // add instance as first arg - // stacks contains n x arg + object + method + method - be_pushvalue(berry.vm, -3); // add instance as first arg - // stacks contains n x arg + object + method + method + object - // now move args 2 slots up to make room for method and object - for (uint32_t i = 1; i <= argc; i++) { - be_moveto(berry.vm, -4 - i, -2 - i); - } - // stacks contains free + free + n x arg + method + object - be_moveto(berry.vm, -2, -4 - argc); - be_moveto(berry.vm, -1, -3 - argc); - // stacks contains method + object + n x arg + method + object - be_pop(berry.vm, 2); - // stacks contains method + object + n x arg - be_pcall(berry.vm, argc + 1); - // stacks contains return_val + object + n x arg - be_pop(berry.vm, argc + 1); - // stacks contains return_val - return true; - } - be_pop(berry.vm, 1); // remove method - // stacks contains n x arg + object - } - // stacks contains n x arg + object - be_pop(berry.vm, argc + 1); // clear stack - be_pushnil(berry.vm); // put nil object - return false; -} -*/ - - // call the event dispatcher from Tasmota object // if data_len is non-zero, the event is also sent as raw `bytes()` object because the string may lose data int32_t callBerryEventDispatcher(const char *type, const char *cmd, int32_t idx, const char *payload, uint32_t data_len) { @@ -224,8 +159,7 @@ int32_t callBerryEventDispatcher(const char *type, const char *cmd, int32_t idx, } BrTimeoutReset(); if (ret != 0) { - BerryDumpErrorAndClear(vm, false); // log in Tasmota console only - be_pop_all(berry.vm); // clear Berry stack + be_error_pop_all(berry.vm); // clear Berry stack return ret; } be_pop(vm, 5); @@ -252,6 +186,17 @@ void BerryObservability(bvm *vm, int event...) { static uint32_t gc_time = 0; switch (event) { + case BE_OBS_PCALL_ERROR: // error after be_pcall + { + int32_t top = be_top(vm); + // check if we have two strings for an Exception + if (top >= 2 && be_isstring(vm, -1) && be_isstring(vm, -2)) { + berry_log_C(PSTR(D_LOG_BERRY "Exception> '%s' - %s"), be_tostring(berry.vm, -2), be_tostring(berry.vm, -1)); + be_tracestack(vm); + } else { + be_dumpstack(vm); + } + } case BE_OBS_GC_START: { gc_time = millis(); @@ -331,21 +276,18 @@ void BerryInit(void) { ret_code1 = be_loadstring(berry.vm, berry_prog); if (ret_code1 != 0) { - BerryDumpErrorAndClear(berry.vm, false); - be_pop_all(berry.vm); // clear Berry stack + be_error_pop_all(berry.vm); // clear Berry stack break; } // AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_BERRY "Berry code loaded, RAM used=%u"), be_gc_memcount(berry.vm)); ret_code2 = be_pcall(berry.vm, 0); if (ret_code1 != 0) { - BerryDumpErrorAndClear(berry.vm, false); - be_pop_all(berry.vm); // clear Berry stack + be_error_pop_all(berry.vm); // clear Berry stack break; } // AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_BERRY "Berry code ran, RAM used=%u"), be_gc_memcount(berry.vm)); if (be_top(berry.vm) > 1) { - BerryDumpErrorAndClear(berry.vm, false); - be_pop_all(berry.vm); // clear Berry stack + be_error_pop_all(berry.vm); // clear Berry stack } else { be_pop(berry.vm, 1); } @@ -389,8 +331,7 @@ void BrLoad(const char * script_name) { BrTimeoutStart(); if (be_pcall(berry.vm, 1) != 0) { - BerryDumpErrorAndClear(berry.vm, false); - be_pop_all(berry.vm); // clear Berry stack + be_error_pop_all(berry.vm); // clear Berry stack return; } BrTimeoutReset(); @@ -495,8 +436,7 @@ void BrREPLRun(char * cmd) { } } if (BE_EXCEPTION == ret_code) { - BerryDumpErrorAndClear(berry.vm, true); - be_pop_all(berry.vm); // clear Berry stack + be_error_pop_all(berry.vm); // clear Berry stack // be_dumpstack(berry.vm); // char exception_s[120]; // ext_snprintf_P(exception_s, sizeof(exception_s), PSTR("%s: %s"), be_tostring(berry.vm, -2), be_tostring(berry.vm, -1)); From 47deea04cec5d85093c3b68310bacccaa6e82357 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 12 Dec 2021 19:58:14 +0100 Subject: [PATCH 66/97] Berry fix exceptions --- lib/libesp32/Berry/src/be_vm.c | 6 ++++++ lib/libesp32/Berry/tests/exceptions.be | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 lib/libesp32/Berry/tests/exceptions.be diff --git a/lib/libesp32/Berry/src/be_vm.c b/lib/libesp32/Berry/src/be_vm.c index 26c15a1a3..25fd2ff2e 100644 --- a/lib/libesp32/Berry/src/be_vm.c +++ b/lib/libesp32/Berry/src/be_vm.c @@ -1062,7 +1062,13 @@ newframe: /* a new call frame */ if (!IGET_RA(ins)) { be_except_block_setup(vm); if (be_setjmp(vm->errjmp->b)) { + bvalue *top = vm->top; + bvalue e1 = top[0]; + bvalue e2 = top[1]; be_except_block_resume(vm); + top = vm->top; + top[0] = e1; + top[1] = e2; goto newframe; } reg = vm->reg; diff --git a/lib/libesp32/Berry/tests/exceptions.be b/lib/libesp32/Berry/tests/exceptions.be new file mode 100644 index 000000000..dc2ad54e4 --- /dev/null +++ b/lib/libesp32/Berry/tests/exceptions.be @@ -0,0 +1,7 @@ + +try + for k: 0..1 assert({'a':1}.contains('b'), 'failure') end +except .. as e,m + assert(e == "assert_failed") + assert(m == "failure") +end From b2024abaac6d15b4c3e58d000e42314dfc541b68 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 12 Dec 2021 23:34:56 +0100 Subject: [PATCH 67/97] safe guard using branch --- .github/workflows/Tasmota_build_devel.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/Tasmota_build_devel.yml b/.github/workflows/Tasmota_build_devel.yml index ac908be23..2bfc5d806 100644 --- a/.github/workflows/Tasmota_build_devel.yml +++ b/.github/workflows/Tasmota_build_devel.yml @@ -37,6 +37,8 @@ jobs: - tasmota32solo1 steps: - uses: actions/checkout@v2 + with: + ref: development - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -59,6 +61,8 @@ jobs: language: [ AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ] steps: - uses: actions/checkout@v2 + with: + ref: development - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies From 161c97892baa8ef80962a8eee16b71c35bd3af74 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 12 Dec 2021 23:36:46 +0100 Subject: [PATCH 68/97] safe guard using branch master --- .github/workflows/Tasmota_build_master.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/Tasmota_build_master.yml b/.github/workflows/Tasmota_build_master.yml index 9ae940bef..9ca6e1f6c 100644 --- a/.github/workflows/Tasmota_build_master.yml +++ b/.github/workflows/Tasmota_build_master.yml @@ -36,6 +36,8 @@ jobs: - tasmota32solo1 steps: - uses: actions/checkout@v2 + with: + ref: master - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -58,6 +60,8 @@ jobs: language: [ AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ] steps: - uses: actions/checkout@v2 + with: + ref: master - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies From 2841734465e4f7dcbc9f850757db0e0cda10391f Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Mon, 13 Dec 2021 19:19:32 +0100 Subject: [PATCH 69/97] Berry remove conversion from comptr to int --- lib/libesp32/Berry/default/be_lvgl_glob_lib.c | 90 +++++++++---------- .../Berry/default/embedded/lvgl_glob.be | 7 +- lib/libesp32/Berry/src/be_baselib.c | 2 - tasmota/xdrv_52_1_berry_native.ino | 4 +- tasmota/xdrv_52_3_berry_lvgl.ino | 2 +- 5 files changed, 48 insertions(+), 57 deletions(-) diff --git a/lib/libesp32/Berry/default/be_lvgl_glob_lib.c b/lib/libesp32/Berry/default/be_lvgl_glob_lib.c index 01bd4ed1d..06827fc0e 100644 --- a/lib/libesp32/Berry/default/be_lvgl_glob_lib.c +++ b/lib/libesp32/Berry/default/be_lvgl_glob_lib.c @@ -69,7 +69,7 @@ be_local_closure(LVGL_glob_widget_event_impl, /* name */ }), &be_const_str_widget_event_impl, &be_const_str_solidified, - ( &(const binstruction[30]) { /* code */ + ( &(const binstruction[28]) { /* code */ 0xA40E0000, // 0000 IMPORT R3 K0 0xB8120200, // 0001 GETNGBL R4 K1 0x8C100902, // 0002 GETMET R4 R4 K2 @@ -81,25 +81,23 @@ be_local_closure(LVGL_glob_widget_event_impl, /* name */ 0x7C140400, // 0008 CALL R5 2 0x88180B04, // 0009 GETMBR R6 R5 K4 0x8C1C0105, // 000A GETMET R7 R0 K5 - 0x60240009, // 000B GETGBL R9 G9 - 0x5C280C00, // 000C MOVE R10 R6 - 0x7C240200, // 000D CALL R9 1 - 0x7C1C0400, // 000E CALL R7 2 - 0x60200004, // 000F GETGBL R8 G4 - 0x5C240E00, // 0010 MOVE R9 R7 - 0x7C200200, // 0011 CALL R8 1 - 0x1C201106, // 0012 EQ R8 R8 K6 - 0x78220008, // 0013 JMPF R8 #001D - 0x8C200707, // 0014 GETMET R8 R3 K7 - 0x5C280E00, // 0015 MOVE R10 R7 - 0x582C0008, // 0016 LDCONST R11 K8 - 0x7C200600, // 0017 CALL R8 3 - 0x78220003, // 0018 JMPF R8 #001D - 0x8C200F08, // 0019 GETMET R8 R7 K8 - 0x5C280800, // 001A MOVE R10 R4 - 0x5C2C0A00, // 001B MOVE R11 R5 - 0x7C200600, // 001C CALL R8 3 - 0x80000000, // 001D RET 0 + 0x5C240C00, // 000B MOVE R9 R6 + 0x7C1C0400, // 000C CALL R7 2 + 0x60200004, // 000D GETGBL R8 G4 + 0x5C240E00, // 000E MOVE R9 R7 + 0x7C200200, // 000F CALL R8 1 + 0x1C201106, // 0010 EQ R8 R8 K6 + 0x78220008, // 0011 JMPF R8 #001B + 0x8C200707, // 0012 GETMET R8 R3 K7 + 0x5C280E00, // 0013 MOVE R10 R7 + 0x582C0008, // 0014 LDCONST R11 K8 + 0x7C200600, // 0015 CALL R8 3 + 0x78220003, // 0016 JMPF R8 #001B + 0x8C200F08, // 0017 GETMET R8 R7 K8 + 0x5C280800, // 0018 MOVE R10 R4 + 0x5C2C0A00, // 0019 MOVE R11 R5 + 0x7C200600, // 001A CALL R8 3 + 0x80000000, // 001B RET 0 }) ) ); @@ -130,7 +128,7 @@ be_local_closure(LVGL_glob_lvgl_event_dispatch, /* name */ }), &be_const_str_lvgl_event_dispatch, &be_const_str_solidified, - ( &(const binstruction[20]) { /* code */ + ( &(const binstruction[18]) { /* code */ 0xA40A0000, // 0000 IMPORT R2 K0 0xB80E0200, // 0001 GETNGBL R3 K1 0x8C0C0702, // 0002 GETMET R3 R3 K2 @@ -138,19 +136,17 @@ be_local_closure(LVGL_glob_lvgl_event_dispatch, /* name */ 0x5C1C0200, // 0004 MOVE R7 R1 0x7C140400, // 0005 CALL R5 2 0x7C0C0400, // 0006 CALL R3 2 - 0x60100009, // 0007 GETGBL R4 G9 - 0x88140704, // 0008 GETMBR R5 R3 K4 - 0x7C100200, // 0009 CALL R4 1 - 0x88140105, // 000A GETMBR R5 R0 K5 - 0x94140A04, // 000B GETIDX R5 R5 R4 - 0x8C180106, // 000C GETMET R6 R0 K6 - 0x5C200800, // 000D MOVE R8 R4 - 0x7C180400, // 000E CALL R6 2 - 0x5C1C0A00, // 000F MOVE R7 R5 - 0x5C200C00, // 0010 MOVE R8 R6 - 0x5C240600, // 0011 MOVE R9 R3 - 0x7C1C0400, // 0012 CALL R7 2 - 0x80000000, // 0013 RET 0 + 0x88100704, // 0007 GETMBR R4 R3 K4 + 0x88140105, // 0008 GETMBR R5 R0 K5 + 0x94140A04, // 0009 GETIDX R5 R5 R4 + 0x8C180106, // 000A GETMET R6 R0 K6 + 0x5C200800, // 000B MOVE R8 R4 + 0x7C180400, // 000C CALL R6 2 + 0x5C1C0A00, // 000D MOVE R7 R5 + 0x5C200C00, // 000E MOVE R8 R6 + 0x5C240600, // 000F MOVE R9 R3 + 0x7C1C0400, // 0010 CALL R7 2 + 0x80000000, // 0011 RET 0 }) ) ); @@ -229,7 +225,7 @@ be_local_closure(LVGL_glob_register_obj, /* name */ }), &be_const_str_register_obj, &be_const_str_solidified, - ( &(const binstruction[13]) { /* code */ + ( &(const binstruction[11]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x4C0C0000, // 0001 LDNIL R3 0x1C080403, // 0002 EQ R2 R2 R3 @@ -237,12 +233,10 @@ be_local_closure(LVGL_glob_register_obj, /* name */ 0x60080013, // 0004 GETGBL R2 G19 0x7C080000, // 0005 CALL R2 0 0x90020002, // 0006 SETMBR R0 K0 R2 - 0x60080009, // 0007 GETGBL R2 G9 - 0x880C0301, // 0008 GETMBR R3 R1 K1 - 0x7C080200, // 0009 CALL R2 1 - 0x880C0100, // 000A GETMBR R3 R0 K0 - 0x980C0401, // 000B SETIDX R3 R2 R1 - 0x80000000, // 000C RET 0 + 0x88080301, // 0007 GETMBR R2 R1 K1 + 0x880C0100, // 0008 GETMBR R3 R0 K0 + 0x980C0401, // 0009 SETIDX R3 R2 R1 + 0x80000000, // 000A RET 0 }) ) ); @@ -798,23 +792,23 @@ be_local_class(LVGL_glob, NULL, be_nested_map(20, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(widget_ctor_cb, 9), be_const_var(4) }, + { be_const_key(widget_ctor_cb, 8), be_const_var(4) }, { be_const_key(get_object_from_ptr, 4), be_const_closure(LVGL_glob_get_object_from_ptr_closure) }, { be_const_key(cb_obj, 7), be_const_var(0) }, { be_const_key(widget_struct_by_class, -1), be_const_var(8) }, { be_const_key(widget_event_impl, -1), be_const_closure(LVGL_glob_widget_event_impl_closure) }, { be_const_key(widget_dtor_cb, 6), be_const_var(5) }, { be_const_key(cb_event_closure, -1), be_const_var(1) }, - { be_const_key(lvgl_event_dispatch, 16), be_const_closure(LVGL_glob_lvgl_event_dispatch_closure) }, - { be_const_key(widget_dtor_impl, -1), be_const_closure(LVGL_glob_widget_dtor_impl_closure) }, + { be_const_key(cb_do_nothing, 16), be_const_static_closure(LVGL_glob__anonymous__closure) }, { be_const_key(null_cb, -1), be_const_var(3) }, - { be_const_key(register_obj, 8), be_const_closure(LVGL_glob_register_obj_closure) }, + { be_const_key(register_obj, -1), be_const_closure(LVGL_glob_register_obj_closure) }, + { be_const_key(widget_dtor_impl, 9), be_const_closure(LVGL_glob_widget_dtor_impl_closure) }, { be_const_key(gen_cb, -1), be_const_closure(LVGL_glob_gen_cb_closure) }, - { be_const_key(widget_struct_default, -1), be_const_var(7) }, - { be_const_key(deregister_obj, 12), be_const_closure(LVGL_glob_deregister_obj_closure) }, + { be_const_key(deregister_obj, -1), be_const_closure(LVGL_glob_deregister_obj_closure) }, + { be_const_key(widget_struct_default, 12), be_const_var(7) }, { be_const_key(widget_event_cb, -1), be_const_var(6) }, { be_const_key(widget_cb, -1), be_const_closure(LVGL_glob_widget_cb_closure) }, - { be_const_key(cb_do_nothing, 3), be_const_closure(LVGL_glob__anonymous__closure) }, + { be_const_key(lvgl_event_dispatch, 3), be_const_closure(LVGL_glob_lvgl_event_dispatch_closure) }, { be_const_key(event_cb, -1), be_const_var(2) }, { be_const_key(create_custom_widget, -1), be_const_closure(LVGL_glob_create_custom_widget_closure) }, { be_const_key(widget_ctor_impl, -1), be_const_closure(LVGL_glob_widget_ctor_impl_closure) }, diff --git a/lib/libesp32/Berry/default/embedded/lvgl_glob.be b/lib/libesp32/Berry/default/embedded/lvgl_glob.be index f7f6b8e84..04250ff54 100644 --- a/lib/libesp32/Berry/default/embedded/lvgl_glob.be +++ b/lib/libesp32/Berry/default/embedded/lvgl_glob.be @@ -23,8 +23,7 @@ class LVGL_glob #- register an lv.lv_* object in the mapping -# def register_obj(obj) if self.cb_obj == nil self.cb_obj = {} end - var native_ptr = int(obj._p) - self.cb_obj[native_ptr] = obj + self.cb_obj[obj._p] = obj end def get_object_from_ptr(ptr) @@ -38,7 +37,7 @@ class LVGL_glob var event = lv.lv_event(introspect.toptr(event_ptr)) - var target = int(event.target) + var target = event.target var f = self.cb_event_closure[target] var obj = self.get_object_from_ptr(target) #print('>> lvgl_event_dispatch', f, obj, event) @@ -87,7 +86,7 @@ class LVGL_glob var cl = lv.lv_obj_class(cl_ptr) var event = lv.lv_event(e_ptr) var obj_ptr = event.target - var obj = self.get_object_from_ptr(int(obj_ptr)) + var obj = self.get_object_from_ptr(obj_ptr) if type(obj) == 'instance' && introspect.get(obj, 'widget_event') obj.widget_event(cl, event) end diff --git a/lib/libesp32/Berry/src/be_baselib.c b/lib/libesp32/Berry/src/be_baselib.c index 6e92b47be..98f96b48e 100644 --- a/lib/libesp32/Berry/src/be_baselib.c +++ b/lib/libesp32/Berry/src/be_baselib.c @@ -233,8 +233,6 @@ static int l_int(bvm *vm) be_pushvalue(vm, 1); } else if (be_isbool(vm, 1)) { be_pushint(vm, be_tobool(vm, 1) ? 1 : 0); - } else if (be_iscomptr(vm, 1)) { - be_pushint(vm, (int) be_tocomptr(vm, 1)); } else { be_return_nil(vm); } diff --git a/tasmota/xdrv_52_1_berry_native.ino b/tasmota/xdrv_52_1_berry_native.ino index 98757b730..2bf1f152e 100644 --- a/tasmota/xdrv_52_1_berry_native.ino +++ b/tasmota/xdrv_52_1_berry_native.ino @@ -312,7 +312,7 @@ extern "C" { // read a single value at stack position idx, convert to int. // if object instance, get `_p` member and convert it recursively -int32_t be_convert_single_elt(bvm *vm, int32_t idx, const char * arg_type = nullptr, int32_t lv_obj_cb = 0) { +int32_t be_convert_single_elt(bvm *vm, int32_t idx, const char * arg_type = nullptr, void * lv_obj_cb = nullptr) { int32_t ret = 0; char provided_type = 0; idx = be_absindex(vm, idx); // make sure we have an absolute index @@ -332,7 +332,7 @@ int32_t be_convert_single_elt(bvm *vm, int32_t idx, const char * arg_type = null be_pushstring(vm, arg_type); be_pushvalue(vm, idx); be_pushvalue(vm, 1); - be_pushint(vm, lv_obj_cb); + be_pushcomptr(vm, lv_obj_cb); be_call(vm, 5); const void * func = be_tocomptr(vm, -6); be_pop(vm, 6); diff --git a/tasmota/xdrv_52_3_berry_lvgl.ino b/tasmota/xdrv_52_3_berry_lvgl.ino index 39e7737ed..f0cba617a 100644 --- a/tasmota/xdrv_52_3_berry_lvgl.ino +++ b/tasmota/xdrv_52_3_berry_lvgl.ino @@ -162,7 +162,7 @@ void be_check_arg_type(bvm *vm, int32_t arg_start, int32_t argc, const char * ar } } // AddLog(LOG_LEVEL_INFO, ">> be_call_c_func arg %i, type %s", i, arg_type_check ? type_short_name : ""); - p[i] = be_convert_single_elt(vm, i + arg_start, arg_type_check ? type_short_name : nullptr, p[0]); + p[i] = be_convert_single_elt(vm, i + arg_start, arg_type_check ? type_short_name : nullptr, (void*) p[0]); } // check if we are missing arguments From 63b9c6460358b285c7e2de1dd3c0b873a24b7e3d Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Mon, 13 Dec 2021 19:33:16 +0100 Subject: [PATCH 70/97] Fix warning --- lib/libesp32/Berry/src/be_byteslib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libesp32/Berry/src/be_byteslib.c b/lib/libesp32/Berry/src/be_byteslib.c index 0c3085faa..82f4ab2be 100644 --- a/lib/libesp32/Berry/src/be_byteslib.c +++ b/lib/libesp32/Berry/src/be_byteslib.c @@ -246,7 +246,7 @@ static unsigned int decode_base64(unsigned char input[], unsigned char output[]) static void buf_set_len(buf_impl* attr, const size_t len) { uint16_t old_len = attr->len; - attr->len = ((int32_t)len <= attr->size) ? len : attr->size; + attr->len = ((int32_t)len <= attr->size) ? (int32_t)len : attr->size; if (old_len < attr->len) { memset((void*) &attr->bufptr[old_len], 0, attr->len - old_len); } From 560e76948524978e69a78236bc8859e063c4f68c Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Tue, 14 Dec 2021 09:37:15 +0100 Subject: [PATCH 71/97] Rename Berry to berry --- lib/libesp32/berry/LICENSE | 21 + lib/libesp32/berry/Makefile | 105 + lib/libesp32/berry/README.md | 163 ++ lib/libesp32/berry/berry-logo.png | Bin 0 -> 11325 bytes lib/libesp32/berry/default/be_animate_lib.c | 712 ++++++ lib/libesp32/berry/default/be_autoconf_lib.c | 1394 +++++++++++ lib/libesp32/berry/default/be_crypto_lib.c | 56 + lib/libesp32/berry/default/be_ctypes.c | 494 ++++ lib/libesp32/berry/default/be_display_lib.c | 29 + lib/libesp32/berry/default/be_driverlib.c | 153 ++ .../default/be_energy_ctypes_definitions.c | 117 + lib/libesp32/berry/default/be_energylib.c | 186 ++ lib/libesp32/berry/default/be_flash_lib.c | 21 + lib/libesp32/berry/default/be_gpio_lib.c | 34 + .../berry/default/be_i2c_axp192_lib.c | 899 +++++++ lib/libesp32/berry/default/be_i2c_driverlib.c | 425 ++++ lib/libesp32/berry/default/be_i2s_audio_lib.c | 113 + .../berry/default/be_leds_animator_lib.c | 381 +++ lib/libesp32/berry/default/be_leds_lib.c | 1815 ++++++++++++++ lib/libesp32/berry/default/be_leds_ntv_lib.c | 50 + lib/libesp32/berry/default/be_light_lib.c | 28 + .../berry/default/be_lvgl_clock_icon_lib.c | 313 +++ .../default/be_lvgl_ctypes_definitions.c | 531 +++++ lib/libesp32/berry/default/be_lvgl_glob_lib.c | 826 +++++++ lib/libesp32/berry/default/be_lvgl_module.c | 692 ++++++ .../berry/default/be_lvgl_signal_arcs_lib.c | 434 ++++ .../berry/default/be_lvgl_signal_bars_lib.c | 392 ++++ .../berry/default/be_lvgl_widgets_lib.c | 1564 +++++++++++++ .../default/be_lvgl_wifi_arcs_icon_lib.c | 140 ++ .../berry/default/be_lvgl_wifi_arcs_lib.c | 167 ++ .../default/be_lvgl_wifi_bars_icon_lib.c | 136 ++ .../berry/default/be_lvgl_wifi_bars_lib.c | 167 ++ lib/libesp32/berry/default/be_md5_lib.c | 30 + lib/libesp32/berry/default/be_modtab.c | 230 ++ lib/libesp32/berry/default/be_onewire_lib.c | 57 + .../berry/default/be_path_tasmota_lib.c | 70 + lib/libesp32/berry/default/be_persist_lib.c | 703 ++++++ lib/libesp32/berry/default/be_port.cpp | 574 +++++ lib/libesp32/berry/default/be_python_compat.c | 58 + lib/libesp32/berry/default/be_re_lib.c | 254 ++ lib/libesp32/berry/default/be_serial_lib.c | 66 + lib/libesp32/berry/default/be_tapp_lib.c | 168 ++ lib/libesp32/berry/default/be_tasmotalib.c | 2079 +++++++++++++++++ lib/libesp32/berry/default/be_tcpclient_lib.c | 48 + lib/libesp32/berry/default/be_timer_class.c | 110 + lib/libesp32/berry/default/be_unishox_lib.c | 28 + lib/libesp32/berry/default/be_webclient_lib.c | 57 + lib/libesp32/berry/default/be_webserver_lib.c | 55 + lib/libesp32/berry/default/be_wirelib.c | 151 ++ lib/libesp32/berry/default/berry_conf.h | 247 ++ .../berry/default/embedded/Animate.be | 189 ++ lib/libesp32/berry/default/embedded/Driver.be | 29 + .../berry/default/embedded/Tasmota.be | 577 +++++ lib/libesp32/berry/default/embedded/Wire.be | 25 + .../berry/default/embedded/autoconf.be | 389 +++ .../berry/default/embedded/i2c_axp192.be | 176 ++ .../berry/default/embedded/i2c_driver.be | 104 + lib/libesp32/berry/default/embedded/leds.be | 338 +++ .../berry/default/embedded/leds_animator.be | 70 + .../berry/default/embedded/lv_clock_icon.be | 54 + .../berry/default/embedded/lv_signal_arcs.be | 133 ++ .../berry/default/embedded/lv_signal_bars.be | 118 + .../berry/default/embedded/lvgl_glob.be | 256 ++ .../berry/default/embedded/openhasp.be | 764 ++++++ .../default/embedded/openhasp/demo-all.jsonl | 61 + .../default/embedded/openhasp/demo1.jsonl | 23 + .../default/embedded/openhasp/demo2.jsonl | 35 + .../default/embedded/openhasp/demo3.jsonl | 4 + .../berry/default/embedded/persist.be | 161 ++ lib/libesp32/berry/default/embedded/tapp.be | 35 + .../berry/default/embedded/test_crypto.be | 30 + lib/libesp32/berry/default/static_block.hpp | 80 + lib/libesp32/berry/examples/anon_func.be | 20 + lib/libesp32/berry/examples/bigloop.be | 15 + lib/libesp32/berry/examples/bintree.be | 60 + lib/libesp32/berry/examples/calcpi.be | 16 + lib/libesp32/berry/examples/exception.be | 12 + lib/libesp32/berry/examples/fib_rec.be | 12 + lib/libesp32/berry/examples/guess_number.be | 26 + lib/libesp32/berry/examples/json.be | 4 + lib/libesp32/berry/examples/lambda.be | 8 + lib/libesp32/berry/examples/listdir.be | 16 + lib/libesp32/berry/examples/qsort.be | 42 + lib/libesp32/berry/examples/repl.be | 61 + lib/libesp32/berry/examples/string.be | 32 + lib/libesp32/berry/examples/strmod.be | 7 + lib/libesp32/berry/gen.sh | 2 + lib/libesp32/berry/generate/be_const_strtab.h | 741 ++++++ .../berry/generate/be_const_strtab_def.h | 1109 +++++++++ .../generate/be_fixed_be_class_aes_gcm.h | 22 + .../be_fixed_be_class_audio_file_source.h | 17 + .../be_fixed_be_class_audio_file_source_fs.h | 18 + .../be_fixed_be_class_audio_generator.h | 17 + .../be_fixed_be_class_audio_generator_mp3.h | 22 + .../be_fixed_be_class_audio_generator_wav.h | 22 + .../generate/be_fixed_be_class_audio_output.h | 17 + .../be_fixed_be_class_audio_output_i2s.h | 19 + .../berry/generate/be_fixed_be_class_bytes.h | 44 + .../berry/generate/be_fixed_be_class_ctypes.h | 22 + .../generate/be_fixed_be_class_ctypes_dyn.h | 18 + .../generate/be_fixed_be_class_ec_c25519.h | 18 + .../berry/generate/be_fixed_be_class_list.h | 38 + .../berry/generate/be_fixed_be_class_map.h | 30 + .../berry/generate/be_fixed_be_class_md5.h | 20 + .../berry/generate/be_fixed_be_class_range.h | 24 + .../generate/be_fixed_be_class_tasmota.h | 93 + .../be_fixed_be_class_tasmota_onewire.h | 28 + .../be_fixed_be_class_tasmota_serial.h | 47 + .../generate/be_fixed_be_class_tasmota_wire.h | 31 + .../generate/be_fixed_be_class_tcpclient.h | 26 + .../generate/be_fixed_be_class_webclient.h | 32 + lib/libesp32/berry/generate/be_fixed_cb.h | 18 + lib/libesp32/berry/generate/be_fixed_debug.h | 22 + lib/libesp32/berry/generate/be_fixed_flash.h | 19 + lib/libesp32/berry/generate/be_fixed_gc.h | 18 + lib/libesp32/berry/generate/be_fixed_global.h | 19 + lib/libesp32/berry/generate/be_fixed_gpio.h | 23 + .../berry/generate/be_fixed_introspect.h | 21 + lib/libesp32/berry/generate/be_fixed_json.h | 18 + lib/libesp32/berry/generate/be_fixed_light.h | 21 + .../berry/generate/be_fixed_m_builtin.h | 66 + lib/libesp32/berry/generate/be_fixed_math.h | 43 + lib/libesp32/berry/generate/be_fixed_os.h | 2 + lib/libesp32/berry/generate/be_fixed_path.h | 2 + .../berry/generate/be_fixed_solidify.h | 17 + lib/libesp32/berry/generate/be_fixed_strict.h | 17 + lib/libesp32/berry/generate/be_fixed_string.h | 27 + lib/libesp32/berry/generate/be_fixed_sys.h | 17 + .../berry/generate/be_fixed_tasmota_path.h | 20 + lib/libesp32/berry/generate/be_fixed_time.h | 2 + .../berry/generate/be_fixed_webserver.h | 31 + lib/libesp32/berry/include/be_ctypes.h | 89 + lib/libesp32/berry/include/be_lvgl.h | 40 + lib/libesp32/berry/library.json | 30 + lib/libesp32/berry/src/be_api.c | 1173 ++++++++++ lib/libesp32/berry/src/be_baselib.c | 520 +++++ lib/libesp32/berry/src/be_bytecode.c | 590 +++++ lib/libesp32/berry/src/be_bytecode.h | 17 + lib/libesp32/berry/src/be_byteslib.c | 1447 ++++++++++++ lib/libesp32/berry/src/be_class.c | 360 +++ lib/libesp32/berry/src/be_class.h | 68 + lib/libesp32/berry/src/be_code.c | 930 ++++++++ lib/libesp32/berry/src/be_code.h | 43 + lib/libesp32/berry/src/be_constobj.h | 384 +++ lib/libesp32/berry/src/be_debug.c | 402 ++++ lib/libesp32/berry/src/be_debug.h | 28 + lib/libesp32/berry/src/be_debuglib.c | 215 ++ lib/libesp32/berry/src/be_decoder.h | 74 + lib/libesp32/berry/src/be_exec.c | 497 ++++ lib/libesp32/berry/src/be_exec.h | 62 + lib/libesp32/berry/src/be_filelib.c | 224 ++ lib/libesp32/berry/src/be_func.c | 181 ++ lib/libesp32/berry/src/be_func.h | 27 + lib/libesp32/berry/src/be_gc.c | 565 +++++ lib/libesp32/berry/src/be_gc.h | 80 + lib/libesp32/berry/src/be_gclib.c | 47 + lib/libesp32/berry/src/be_globallib.c | 86 + lib/libesp32/berry/src/be_introspectlib.c | 157 ++ lib/libesp32/berry/src/be_jsonlib.c | 448 ++++ lib/libesp32/berry/src/be_lexer.c | 621 +++++ lib/libesp32/berry/src/be_lexer.h | 138 ++ lib/libesp32/berry/src/be_libs.c | 29 + lib/libesp32/berry/src/be_libs.h | 15 + lib/libesp32/berry/src/be_list.c | 207 ++ lib/libesp32/berry/src/be_list.h | 39 + lib/libesp32/berry/src/be_listlib.c | 546 +++++ lib/libesp32/berry/src/be_map.c | 352 +++ lib/libesp32/berry/src/be_map.h | 61 + lib/libesp32/berry/src/be_maplib.c | 313 +++ lib/libesp32/berry/src/be_mathlib.c | 351 +++ lib/libesp32/berry/src/be_mem.c | 79 + lib/libesp32/berry/src/be_mem.h | 29 + lib/libesp32/berry/src/be_module.c | 467 ++++ lib/libesp32/berry/src/be_module.h | 42 + lib/libesp32/berry/src/be_object.c | 73 + lib/libesp32/berry/src/be_object.h | 254 ++ lib/libesp32/berry/src/be_opcodes.h | 57 + lib/libesp32/berry/src/be_oslib.c | 271 +++ lib/libesp32/berry/src/be_parser.c | 1743 ++++++++++++++ lib/libesp32/berry/src/be_parser.h | 89 + lib/libesp32/berry/src/be_rangelib.c | 123 + lib/libesp32/berry/src/be_repl.c | 106 + lib/libesp32/berry/src/be_repl.h | 26 + lib/libesp32/berry/src/be_solidifylib.c | 517 ++++ lib/libesp32/berry/src/be_strictlib.c | 40 + lib/libesp32/berry/src/be_string.c | 302 +++ lib/libesp32/berry/src/be_string.h | 57 + lib/libesp32/berry/src/be_strlib.c | 876 +++++++ lib/libesp32/berry/src/be_strlib.h | 32 + lib/libesp32/berry/src/be_sys.h | 48 + lib/libesp32/berry/src/be_syslib.c | 36 + lib/libesp32/berry/src/be_timelib.c | 71 + lib/libesp32/berry/src/be_var.c | 142 ++ lib/libesp32/berry/src/be_var.h | 31 + lib/libesp32/berry/src/be_vector.c | 153 ++ lib/libesp32/berry/src/be_vector.h | 43 + lib/libesp32/berry/src/be_vm.c | 1277 ++++++++++ lib/libesp32/berry/src/be_vm.h | 135 ++ lib/libesp32/berry/src/berry.h | 586 +++++ lib/libesp32/berry/src/berry_conf.h | 1 + lib/libesp32/berry/testall.be | 44 + lib/libesp32/berry/tests/assignment.be | 34 + lib/libesp32/berry/tests/bool.be | 39 + lib/libesp32/berry/tests/bytes.be | 185 ++ lib/libesp32/berry/tests/bytes_b64.be | 15 + lib/libesp32/berry/tests/bytes_fixed.be | 67 + lib/libesp32/berry/tests/checkspace.be | 35 + lib/libesp32/berry/tests/class.be | 47 + lib/libesp32/berry/tests/class_const.be | 122 + lib/libesp32/berry/tests/closure.be | 13 + lib/libesp32/berry/tests/compiler.be | 28 + lib/libesp32/berry/tests/compound.be | 19 + lib/libesp32/berry/tests/cond_expr.be | 10 + lib/libesp32/berry/tests/debug.be | 4 + lib/libesp32/berry/tests/exceptions.be | 7 + lib/libesp32/berry/tests/for.be | 44 + lib/libesp32/berry/tests/function.be | 12 + lib/libesp32/berry/tests/global.be | 52 + lib/libesp32/berry/tests/introspect.be | 28 + lib/libesp32/berry/tests/json.be | 53 + lib/libesp32/berry/tests/lexer.be | 62 + lib/libesp32/berry/tests/lexergc.be | 12 + lib/libesp32/berry/tests/list.be | 140 ++ lib/libesp32/berry/tests/member_indirect.be | 75 + lib/libesp32/berry/tests/os.be | 51 + lib/libesp32/berry/tests/overload.be | 14 + lib/libesp32/berry/tests/relop.be | 40 + lib/libesp32/berry/tests/string.be | 41 + lib/libesp32/berry/tests/subobject.be | 29 + lib/libesp32/berry/tests/suffix.be | 28 + lib/libesp32/berry/tests/super_auto.be | 132 ++ lib/libesp32/berry/tests/super_leveled.be | 43 + lib/libesp32/berry/tests/vararg.be | 14 + lib/libesp32/berry/tests/virtual_methods.be | 66 + lib/libesp32/berry/tests/virtual_methods2.be | 28 + lib/libesp32/berry/tools/coc/.gitignore | 1 + lib/libesp32/berry/tools/coc/Makefile | 26 + lib/libesp32/berry/tools/coc/REEADME.md | 3 + .../berry/tools/coc/block_builder.cpp | 197 ++ lib/libesp32/berry/tools/coc/block_builder.h | 49 + lib/libesp32/berry/tools/coc/coc_parser.cpp | 190 ++ lib/libesp32/berry/tools/coc/coc_parser.h | 46 + lib/libesp32/berry/tools/coc/coc_string.cpp | 48 + lib/libesp32/berry/tools/coc/coc_string.h | 18 + lib/libesp32/berry/tools/coc/hash_map.cpp | 161 ++ lib/libesp32/berry/tools/coc/hash_map.h | 47 + lib/libesp32/berry/tools/coc/macro_table.cpp | 59 + lib/libesp32/berry/tools/coc/macro_table.h | 30 + lib/libesp32/berry/tools/coc/main.cpp | 141 ++ lib/libesp32/berry/tools/coc/main.h | 45 + lib/libesp32/berry/tools/coc/object_block.h | 26 + lib/libesp32/berry/tools/coc/str_build.cpp | 129 + lib/libesp32/berry/tools/coc/str_build.h | 39 + .../berry/tools/grammar/berry.bytecode | 92 + lib/libesp32/berry/tools/grammar/berry.ebnf | 45 + .../berry/tools/grammar/const_obj.ebnf | 11 + lib/libesp32/berry/tools/grammar/json.ebnf | 5 + .../vscode/skiars.berry-0.1.0/.vsixmanifest | 34 + .../vscode/skiars.berry-0.1.0/CHANGELOG.md | 7 + .../vscode/skiars.berry-0.1.0/README.md | 0 .../berry-configuration.json | 32 + .../vscode/skiars.berry-0.1.0/berry-icon.png | Bin 0 -> 5429 bytes .../vscode/skiars.berry-0.1.0/package.json | 52 + .../skiars.berry-0.1.0/syntaxes/berry.json | 109 + .../skiars.berry-0.1.0/syntaxes/bytecode.json | 58 + .../berry/tools/pycoc/block_builder.py | 152 ++ lib/libesp32/berry/tools/pycoc/coc_parser.py | 146 ++ lib/libesp32/berry/tools/pycoc/coc_string.py | 40 + .../berry/tools/pycoc/coc_string_test.py | 18 + lib/libesp32/berry/tools/pycoc/hash_map.py | 162 ++ lib/libesp32/berry/tools/pycoc/macro_table.py | 50 + lib/libesp32/berry/tools/pycoc/main.py | 64 + lib/libesp32/berry/tools/pycoc/str_build.py | 123 + lib/libesp32/berry_mapping/src/be_cb_module.c | 2 +- 274 files changed, 47676 insertions(+), 1 deletion(-) create mode 100644 lib/libesp32/berry/LICENSE create mode 100644 lib/libesp32/berry/Makefile create mode 100644 lib/libesp32/berry/README.md create mode 100644 lib/libesp32/berry/berry-logo.png create mode 100644 lib/libesp32/berry/default/be_animate_lib.c create mode 100644 lib/libesp32/berry/default/be_autoconf_lib.c create mode 100644 lib/libesp32/berry/default/be_crypto_lib.c create mode 100644 lib/libesp32/berry/default/be_ctypes.c create mode 100644 lib/libesp32/berry/default/be_display_lib.c create mode 100644 lib/libesp32/berry/default/be_driverlib.c create mode 100644 lib/libesp32/berry/default/be_energy_ctypes_definitions.c create mode 100644 lib/libesp32/berry/default/be_energylib.c create mode 100644 lib/libesp32/berry/default/be_flash_lib.c create mode 100644 lib/libesp32/berry/default/be_gpio_lib.c create mode 100644 lib/libesp32/berry/default/be_i2c_axp192_lib.c create mode 100644 lib/libesp32/berry/default/be_i2c_driverlib.c create mode 100644 lib/libesp32/berry/default/be_i2s_audio_lib.c create mode 100644 lib/libesp32/berry/default/be_leds_animator_lib.c create mode 100644 lib/libesp32/berry/default/be_leds_lib.c create mode 100644 lib/libesp32/berry/default/be_leds_ntv_lib.c create mode 100644 lib/libesp32/berry/default/be_light_lib.c create mode 100644 lib/libesp32/berry/default/be_lvgl_clock_icon_lib.c create mode 100644 lib/libesp32/berry/default/be_lvgl_ctypes_definitions.c create mode 100644 lib/libesp32/berry/default/be_lvgl_glob_lib.c create mode 100644 lib/libesp32/berry/default/be_lvgl_module.c create mode 100644 lib/libesp32/berry/default/be_lvgl_signal_arcs_lib.c create mode 100644 lib/libesp32/berry/default/be_lvgl_signal_bars_lib.c create mode 100644 lib/libesp32/berry/default/be_lvgl_widgets_lib.c create mode 100644 lib/libesp32/berry/default/be_lvgl_wifi_arcs_icon_lib.c create mode 100644 lib/libesp32/berry/default/be_lvgl_wifi_arcs_lib.c create mode 100644 lib/libesp32/berry/default/be_lvgl_wifi_bars_icon_lib.c create mode 100644 lib/libesp32/berry/default/be_lvgl_wifi_bars_lib.c create mode 100644 lib/libesp32/berry/default/be_md5_lib.c create mode 100644 lib/libesp32/berry/default/be_modtab.c create mode 100644 lib/libesp32/berry/default/be_onewire_lib.c create mode 100644 lib/libesp32/berry/default/be_path_tasmota_lib.c create mode 100644 lib/libesp32/berry/default/be_persist_lib.c create mode 100644 lib/libesp32/berry/default/be_port.cpp create mode 100644 lib/libesp32/berry/default/be_python_compat.c create mode 100644 lib/libesp32/berry/default/be_re_lib.c create mode 100644 lib/libesp32/berry/default/be_serial_lib.c create mode 100644 lib/libesp32/berry/default/be_tapp_lib.c create mode 100644 lib/libesp32/berry/default/be_tasmotalib.c create mode 100644 lib/libesp32/berry/default/be_tcpclient_lib.c create mode 100644 lib/libesp32/berry/default/be_timer_class.c create mode 100644 lib/libesp32/berry/default/be_unishox_lib.c create mode 100644 lib/libesp32/berry/default/be_webclient_lib.c create mode 100644 lib/libesp32/berry/default/be_webserver_lib.c create mode 100644 lib/libesp32/berry/default/be_wirelib.c create mode 100644 lib/libesp32/berry/default/berry_conf.h create mode 100644 lib/libesp32/berry/default/embedded/Animate.be create mode 100644 lib/libesp32/berry/default/embedded/Driver.be create mode 100644 lib/libesp32/berry/default/embedded/Tasmota.be create mode 100644 lib/libesp32/berry/default/embedded/Wire.be create mode 100644 lib/libesp32/berry/default/embedded/autoconf.be create mode 100644 lib/libesp32/berry/default/embedded/i2c_axp192.be create mode 100644 lib/libesp32/berry/default/embedded/i2c_driver.be create mode 100644 lib/libesp32/berry/default/embedded/leds.be create mode 100644 lib/libesp32/berry/default/embedded/leds_animator.be create mode 100644 lib/libesp32/berry/default/embedded/lv_clock_icon.be create mode 100644 lib/libesp32/berry/default/embedded/lv_signal_arcs.be create mode 100644 lib/libesp32/berry/default/embedded/lv_signal_bars.be create mode 100644 lib/libesp32/berry/default/embedded/lvgl_glob.be create mode 100644 lib/libesp32/berry/default/embedded/openhasp.be create mode 100644 lib/libesp32/berry/default/embedded/openhasp/demo-all.jsonl create mode 100644 lib/libesp32/berry/default/embedded/openhasp/demo1.jsonl create mode 100644 lib/libesp32/berry/default/embedded/openhasp/demo2.jsonl create mode 100644 lib/libesp32/berry/default/embedded/openhasp/demo3.jsonl create mode 100644 lib/libesp32/berry/default/embedded/persist.be create mode 100644 lib/libesp32/berry/default/embedded/tapp.be create mode 100644 lib/libesp32/berry/default/embedded/test_crypto.be create mode 100644 lib/libesp32/berry/default/static_block.hpp create mode 100644 lib/libesp32/berry/examples/anon_func.be create mode 100644 lib/libesp32/berry/examples/bigloop.be create mode 100644 lib/libesp32/berry/examples/bintree.be create mode 100644 lib/libesp32/berry/examples/calcpi.be create mode 100644 lib/libesp32/berry/examples/exception.be create mode 100644 lib/libesp32/berry/examples/fib_rec.be create mode 100644 lib/libesp32/berry/examples/guess_number.be create mode 100644 lib/libesp32/berry/examples/json.be create mode 100644 lib/libesp32/berry/examples/lambda.be create mode 100644 lib/libesp32/berry/examples/listdir.be create mode 100644 lib/libesp32/berry/examples/qsort.be create mode 100644 lib/libesp32/berry/examples/repl.be create mode 100644 lib/libesp32/berry/examples/string.be create mode 100644 lib/libesp32/berry/examples/strmod.be create mode 100755 lib/libesp32/berry/gen.sh create mode 100644 lib/libesp32/berry/generate/be_const_strtab.h create mode 100644 lib/libesp32/berry/generate/be_const_strtab_def.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_aes_gcm.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_audio_file_source.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_audio_file_source_fs.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_audio_generator.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_audio_generator_mp3.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_audio_generator_wav.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_audio_output.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_audio_output_i2s.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_bytes.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_ctypes.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_ctypes_dyn.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_ec_c25519.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_list.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_map.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_md5.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_range.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_tasmota.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_tasmota_onewire.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_tasmota_serial.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_tasmota_wire.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_tcpclient.h create mode 100644 lib/libesp32/berry/generate/be_fixed_be_class_webclient.h create mode 100644 lib/libesp32/berry/generate/be_fixed_cb.h create mode 100644 lib/libesp32/berry/generate/be_fixed_debug.h create mode 100644 lib/libesp32/berry/generate/be_fixed_flash.h create mode 100644 lib/libesp32/berry/generate/be_fixed_gc.h create mode 100644 lib/libesp32/berry/generate/be_fixed_global.h create mode 100644 lib/libesp32/berry/generate/be_fixed_gpio.h create mode 100644 lib/libesp32/berry/generate/be_fixed_introspect.h create mode 100644 lib/libesp32/berry/generate/be_fixed_json.h create mode 100644 lib/libesp32/berry/generate/be_fixed_light.h create mode 100644 lib/libesp32/berry/generate/be_fixed_m_builtin.h create mode 100644 lib/libesp32/berry/generate/be_fixed_math.h create mode 100644 lib/libesp32/berry/generate/be_fixed_os.h create mode 100644 lib/libesp32/berry/generate/be_fixed_path.h create mode 100644 lib/libesp32/berry/generate/be_fixed_solidify.h create mode 100644 lib/libesp32/berry/generate/be_fixed_strict.h create mode 100644 lib/libesp32/berry/generate/be_fixed_string.h create mode 100644 lib/libesp32/berry/generate/be_fixed_sys.h create mode 100644 lib/libesp32/berry/generate/be_fixed_tasmota_path.h create mode 100644 lib/libesp32/berry/generate/be_fixed_time.h create mode 100644 lib/libesp32/berry/generate/be_fixed_webserver.h create mode 100644 lib/libesp32/berry/include/be_ctypes.h create mode 100644 lib/libesp32/berry/include/be_lvgl.h create mode 100644 lib/libesp32/berry/library.json create mode 100644 lib/libesp32/berry/src/be_api.c create mode 100644 lib/libesp32/berry/src/be_baselib.c create mode 100644 lib/libesp32/berry/src/be_bytecode.c create mode 100644 lib/libesp32/berry/src/be_bytecode.h create mode 100644 lib/libesp32/berry/src/be_byteslib.c create mode 100644 lib/libesp32/berry/src/be_class.c create mode 100644 lib/libesp32/berry/src/be_class.h create mode 100644 lib/libesp32/berry/src/be_code.c create mode 100644 lib/libesp32/berry/src/be_code.h create mode 100644 lib/libesp32/berry/src/be_constobj.h create mode 100644 lib/libesp32/berry/src/be_debug.c create mode 100644 lib/libesp32/berry/src/be_debug.h create mode 100644 lib/libesp32/berry/src/be_debuglib.c create mode 100644 lib/libesp32/berry/src/be_decoder.h create mode 100644 lib/libesp32/berry/src/be_exec.c create mode 100644 lib/libesp32/berry/src/be_exec.h create mode 100644 lib/libesp32/berry/src/be_filelib.c create mode 100644 lib/libesp32/berry/src/be_func.c create mode 100644 lib/libesp32/berry/src/be_func.h create mode 100644 lib/libesp32/berry/src/be_gc.c create mode 100644 lib/libesp32/berry/src/be_gc.h create mode 100644 lib/libesp32/berry/src/be_gclib.c create mode 100644 lib/libesp32/berry/src/be_globallib.c create mode 100644 lib/libesp32/berry/src/be_introspectlib.c create mode 100644 lib/libesp32/berry/src/be_jsonlib.c create mode 100644 lib/libesp32/berry/src/be_lexer.c create mode 100644 lib/libesp32/berry/src/be_lexer.h create mode 100644 lib/libesp32/berry/src/be_libs.c create mode 100644 lib/libesp32/berry/src/be_libs.h create mode 100644 lib/libesp32/berry/src/be_list.c create mode 100644 lib/libesp32/berry/src/be_list.h create mode 100644 lib/libesp32/berry/src/be_listlib.c create mode 100644 lib/libesp32/berry/src/be_map.c create mode 100644 lib/libesp32/berry/src/be_map.h create mode 100644 lib/libesp32/berry/src/be_maplib.c create mode 100644 lib/libesp32/berry/src/be_mathlib.c create mode 100644 lib/libesp32/berry/src/be_mem.c create mode 100644 lib/libesp32/berry/src/be_mem.h create mode 100644 lib/libesp32/berry/src/be_module.c create mode 100644 lib/libesp32/berry/src/be_module.h create mode 100644 lib/libesp32/berry/src/be_object.c create mode 100644 lib/libesp32/berry/src/be_object.h create mode 100644 lib/libesp32/berry/src/be_opcodes.h create mode 100644 lib/libesp32/berry/src/be_oslib.c create mode 100644 lib/libesp32/berry/src/be_parser.c create mode 100644 lib/libesp32/berry/src/be_parser.h create mode 100644 lib/libesp32/berry/src/be_rangelib.c create mode 100644 lib/libesp32/berry/src/be_repl.c create mode 100644 lib/libesp32/berry/src/be_repl.h create mode 100644 lib/libesp32/berry/src/be_solidifylib.c create mode 100644 lib/libesp32/berry/src/be_strictlib.c create mode 100644 lib/libesp32/berry/src/be_string.c create mode 100644 lib/libesp32/berry/src/be_string.h create mode 100644 lib/libesp32/berry/src/be_strlib.c create mode 100644 lib/libesp32/berry/src/be_strlib.h create mode 100644 lib/libesp32/berry/src/be_sys.h create mode 100644 lib/libesp32/berry/src/be_syslib.c create mode 100644 lib/libesp32/berry/src/be_timelib.c create mode 100644 lib/libesp32/berry/src/be_var.c create mode 100644 lib/libesp32/berry/src/be_var.h create mode 100644 lib/libesp32/berry/src/be_vector.c create mode 100644 lib/libesp32/berry/src/be_vector.h create mode 100644 lib/libesp32/berry/src/be_vm.c create mode 100644 lib/libesp32/berry/src/be_vm.h create mode 100644 lib/libesp32/berry/src/berry.h create mode 100644 lib/libesp32/berry/src/berry_conf.h create mode 100755 lib/libesp32/berry/testall.be create mode 100644 lib/libesp32/berry/tests/assignment.be create mode 100644 lib/libesp32/berry/tests/bool.be create mode 100644 lib/libesp32/berry/tests/bytes.be create mode 100644 lib/libesp32/berry/tests/bytes_b64.be create mode 100644 lib/libesp32/berry/tests/bytes_fixed.be create mode 100644 lib/libesp32/berry/tests/checkspace.be create mode 100644 lib/libesp32/berry/tests/class.be create mode 100644 lib/libesp32/berry/tests/class_const.be create mode 100644 lib/libesp32/berry/tests/closure.be create mode 100644 lib/libesp32/berry/tests/compiler.be create mode 100644 lib/libesp32/berry/tests/compound.be create mode 100644 lib/libesp32/berry/tests/cond_expr.be create mode 100644 lib/libesp32/berry/tests/debug.be create mode 100644 lib/libesp32/berry/tests/exceptions.be create mode 100644 lib/libesp32/berry/tests/for.be create mode 100644 lib/libesp32/berry/tests/function.be create mode 100644 lib/libesp32/berry/tests/global.be create mode 100644 lib/libesp32/berry/tests/introspect.be create mode 100644 lib/libesp32/berry/tests/json.be create mode 100644 lib/libesp32/berry/tests/lexer.be create mode 100644 lib/libesp32/berry/tests/lexergc.be create mode 100644 lib/libesp32/berry/tests/list.be create mode 100644 lib/libesp32/berry/tests/member_indirect.be create mode 100644 lib/libesp32/berry/tests/os.be create mode 100644 lib/libesp32/berry/tests/overload.be create mode 100644 lib/libesp32/berry/tests/relop.be create mode 100644 lib/libesp32/berry/tests/string.be create mode 100644 lib/libesp32/berry/tests/subobject.be create mode 100644 lib/libesp32/berry/tests/suffix.be create mode 100644 lib/libesp32/berry/tests/super_auto.be create mode 100644 lib/libesp32/berry/tests/super_leveled.be create mode 100644 lib/libesp32/berry/tests/vararg.be create mode 100644 lib/libesp32/berry/tests/virtual_methods.be create mode 100644 lib/libesp32/berry/tests/virtual_methods2.be create mode 100644 lib/libesp32/berry/tools/coc/.gitignore create mode 100644 lib/libesp32/berry/tools/coc/Makefile create mode 100644 lib/libesp32/berry/tools/coc/REEADME.md create mode 100755 lib/libesp32/berry/tools/coc/block_builder.cpp create mode 100755 lib/libesp32/berry/tools/coc/block_builder.h create mode 100644 lib/libesp32/berry/tools/coc/coc_parser.cpp create mode 100644 lib/libesp32/berry/tools/coc/coc_parser.h create mode 100644 lib/libesp32/berry/tools/coc/coc_string.cpp create mode 100644 lib/libesp32/berry/tools/coc/coc_string.h create mode 100755 lib/libesp32/berry/tools/coc/hash_map.cpp create mode 100755 lib/libesp32/berry/tools/coc/hash_map.h create mode 100644 lib/libesp32/berry/tools/coc/macro_table.cpp create mode 100644 lib/libesp32/berry/tools/coc/macro_table.h create mode 100755 lib/libesp32/berry/tools/coc/main.cpp create mode 100644 lib/libesp32/berry/tools/coc/main.h create mode 100644 lib/libesp32/berry/tools/coc/object_block.h create mode 100644 lib/libesp32/berry/tools/coc/str_build.cpp create mode 100644 lib/libesp32/berry/tools/coc/str_build.h create mode 100755 lib/libesp32/berry/tools/grammar/berry.bytecode create mode 100644 lib/libesp32/berry/tools/grammar/berry.ebnf create mode 100755 lib/libesp32/berry/tools/grammar/const_obj.ebnf create mode 100644 lib/libesp32/berry/tools/grammar/json.ebnf create mode 100755 lib/libesp32/berry/tools/plugins/vscode/skiars.berry-0.1.0/.vsixmanifest create mode 100755 lib/libesp32/berry/tools/plugins/vscode/skiars.berry-0.1.0/CHANGELOG.md create mode 100755 lib/libesp32/berry/tools/plugins/vscode/skiars.berry-0.1.0/README.md create mode 100755 lib/libesp32/berry/tools/plugins/vscode/skiars.berry-0.1.0/berry-configuration.json create mode 100644 lib/libesp32/berry/tools/plugins/vscode/skiars.berry-0.1.0/berry-icon.png create mode 100755 lib/libesp32/berry/tools/plugins/vscode/skiars.berry-0.1.0/package.json create mode 100755 lib/libesp32/berry/tools/plugins/vscode/skiars.berry-0.1.0/syntaxes/berry.json create mode 100755 lib/libesp32/berry/tools/plugins/vscode/skiars.berry-0.1.0/syntaxes/bytecode.json create mode 100644 lib/libesp32/berry/tools/pycoc/block_builder.py create mode 100644 lib/libesp32/berry/tools/pycoc/coc_parser.py create mode 100644 lib/libesp32/berry/tools/pycoc/coc_string.py create mode 100644 lib/libesp32/berry/tools/pycoc/coc_string_test.py create mode 100644 lib/libesp32/berry/tools/pycoc/hash_map.py create mode 100644 lib/libesp32/berry/tools/pycoc/macro_table.py create mode 100644 lib/libesp32/berry/tools/pycoc/main.py create mode 100644 lib/libesp32/berry/tools/pycoc/str_build.py diff --git a/lib/libesp32/berry/LICENSE b/lib/libesp32/berry/LICENSE new file mode 100644 index 000000000..609969272 --- /dev/null +++ b/lib/libesp32/berry/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018-2020 Guan Wenliang + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/libesp32/berry/Makefile b/lib/libesp32/berry/Makefile new file mode 100644 index 000000000..f9d61125d --- /dev/null +++ b/lib/libesp32/berry/Makefile @@ -0,0 +1,105 @@ +CFLAGS = -Wall -Wextra -std=c99 -pedantic-errors -O2 +LIBS = -lm +TARGET = berry +CC ?= gcc +MKDIR = mkdir +LFLAGS = + +INCPATH = src default +SRCPATH = src default +GENERATE = generate +CONFIG = default/berry_conf.h +COC = tools/coc/coc +PY = python3 +PYCOC = tools/pycoc/main.py +CONST_TAB = $(GENERATE)/be_const_strtab.h +MAKE_COC = $(MAKE) -C tools/coc + +ifeq ($(OS), Windows_NT) # Windows + CFLAGS += -Wno-format # for "%I64d" warning + LFLAGS += -Wl,--out-implib,berry.lib # export symbols lib for dll linked + TARGET := $(TARGET).exe + COC := $(COC).exe + PY := $(PY).exe +else + CFLAGS += -DUSE_READLINE_LIB + LIBS += -lreadline -ldl + OS := $(shell uname) + ifeq ($(OS), Linux) + LFLAGS += -Wl,--export-dynamic + endif +endif + +ifneq ($(V), 1) + Q=@ + MSG=@echo + MAKE_COC += -s Q=$(Q) +else + MSG=@true +endif + +ifeq ($(TEST), 1) + CFLAGS += -fprofile-arcs -ftest-coverage + LFLAGS += -fprofile-arcs -ftest-coverage +endif + +SRCS = $(foreach dir, $(SRCPATH), $(wildcard $(dir)/*.c)) +OBJS = $(patsubst %.c, %.o, $(SRCS)) +DEPS = $(patsubst %.c, %.d, $(SRCS)) +INCFLAGS = $(foreach dir, $(INCPATH), -I"$(dir)") + +.PHONY : clean + +all: $(TARGET) + +debug: CFLAGS += -O0 -g -DBE_DEBUG +debug: all + +test: CFLAGS += --coverage +test: LFLAGS += --coverage +test: all + $(MSG) [Run Testcases...] + $(Q) ./testall.be + $(Q) $(RM) */*.gcno */*.gcda + +$(TARGET): $(OBJS) + $(MSG) [Linking...] + $(Q) $(CC) $(OBJS) $(LFLAGS) $(LIBS) -o $@ + $(MSG) done + +$(OBJS): %.o: %.c + $(MSG) [Compile] $< + $(Q) $(CC) -MM $(CFLAGS) $(INCFLAGS) -MT"$*.d" -MT"$(<:.c=.o)" $< > $*.d + $(Q) $(CC) $(CFLAGS) $(INCFLAGS) -c $< -o $@ + +sinclude $(DEPS) + +$(OBJS): $(CONST_TAB) + +$(CONST_TAB): $(COC) $(GENERATE) $(SRCS) $(CONFIG) + $(MSG) [Prebuild] generate resources + $(Q) $(COC) -i $(SRCPATH) -c $(CONFIG) -o $(GENERATE) + +$(GENERATE): + $(Q) $(MKDIR) $(GENERATE) + +$(COC): + $(MSG) [Make] coc + $(Q) $(MAKE_COC) + +install: + cp $(TARGET) /usr/local/bin + +uninstall: + $(RM) /usr/local/bin/$(TARGET) + +prebuild: $(COC) $(GENERATE) + $(MSG) [Prebuild] generate resources + $(Q) $(PY) $(PYCOC) -o $(GENERATE) $(SRCPATH) -c $(CONFIG) + $(MSG) done + +clean: + $(MSG) [Clean...] + $(Q) $(RM) $(OBJS) $(DEPS) $(GENERATE)/* berry.lib + $(Q) $(MAKE_COC) clean + $(MSG) done diff --git a/lib/libesp32/berry/README.md b/lib/libesp32/berry/README.md new file mode 100644 index 000000000..6d02dcd38 --- /dev/null +++ b/lib/libesp32/berry/README.md @@ -0,0 +1,163 @@ +

+

+ Berry +

+

The Berry Script Language.

+

+ +## Introduction + +Berry is a ultra-lightweight dynamically typed embedded scripting language. It is designed for lower-performance embedded devices. The Berry interpreter-core's code size is less than 40KiB and can run on less than 4KiB heap (on ARM Cortex M4 CPU, Thumb ISA and ARMCC compiler). + +The interpreter of Berry include a one-pass compiler and register-based VM, all the code is written in ANSI C99. In Berry not every type is a class object. Some simple value types, such as int, real, boolean and string are not class object, but list, map and range are class object. This is a consideration about performance. +Register-based VM is the same meaning as above. + +Berry has the following advantages: + +* Lightweight: A well-optimized interpreter with very little resources. Ideal for use in microprocessors. +* Fast: optimized one-pass bytecode compiler and register-based virtual machine. +* Powerful: supports imperative programming, object-oriented programming, functional programming. +* Flexible: Berry is a dynamic type script, and it's intended for embedding in applications. It can provide good dynamic scalability for the host system. +* Simple: simple and natural syntax, support garbage collection, and easy to use FFI (foreign function interface). +* RAM saving: With compile-time object construction, most of the constant objects are stored in read-only code data segments, so the RAM usage of the interpreter is very low when it starts. + +## Documents + +LaTeX documents repository: [https://github.com/Skiars/berry_doc](https://github.com/Skiars/berry_doc) + +Short Manual: [berry_short_manual.pdf](https://github.com/Skiars/berry_doc/releases/download/latest/berry_short_manual.pdf). + +Reference Manual: [berry_rm_en_us.pdf](https://github.com/Skiars/berry_doc/releases/download/latest/berry_rm_en_us.pdf), [berry_rm_zh_cn.pdf](https://github.com/Skiars/berry_doc/releases/download/latest/berry_rm_zh_cn.pdf). + +Berry's EBNF grammar definition: [tools/grammar/berry.ebnf](./tools/grammar/berry.ebnf) + +## Features + +* Base Type + * Nil: `nil` + * Boolean: `true` and `false` + * Numerical: Integer (`int`) and Real (`real`) + * String: Single quotation-mark string and double quotation-mark string + * Class: Instance template, read only + * Instance: Object constructed by class + * Module: Read-write key-value pair table + * List: Ordered container, like `[1, 2, 3]` + * Map: Hash Map container, like `{ 'a': 1, 2: 3, 'map': {} }` + * Range: include a lower and a upper integer value, like `0..5` +* Operator and Expression + * Assign operator: `=`, `+=`, `-=`, `*=`, `/=`, `%=`, `&=`, `|=`, `^=`, `<<=`, `>>=` + * Relational operator: `<`, `<=`, `==`, `!=`, `>`, `>=` + * Logic operator: `&&`, `||`, `!` + * Arithmetic operator: `+`, `-`, `*`, `/`, `%` + * Bitwise operator: `&`, `|`, `~`, `^`, `<<`, `>>` + * Field operator: `.` + * Subscript operator: `[]` + * Connect string operator: `+` + * Conditional operator: `? :` + * Brackets: `()` +* Control Structure + * Conditional statement: `if-else` + * Iteration statement: `while` and `for` + * Jump statement: `break` and `continue` +* Function + * Local variable and block scope + * Return statement + * Nested functions definition + * Closure based on Upvalue + * Anonymous function + * Lambda expression +* Class + * Inheritance (only public single inheritance) + * Method and Operator Overload + * Constructor method + * Destructive method +* Module Management + * Built-in module that takes almost no RAM + * Extension module support: script module, bytecode file module and shared library (like *.so, *.dll) module +* GC (Garbage collection) + * Mark-Sweep GC +* Exceptional Handling + * Throw any exception value using the `raise` statement + * Multiple catch mode +* Bytecode file support + * Export function to bytecode file + * Load the bytecode file and execute + +## Build and Run + +1. Install the readline library (Windows does not need): + + ``` bash + sudo apt install libreadline-dev # Ubuntu + brew install readline # MacOS + ``` + +2. Build (The default compiler is GCC): + + ``` + make + ``` + +3. Run: + + ``` bash + ./berry # Bash or PowerShell + berry # Windows CMD + ``` + +4. Install (Only Unix-like): + + ``` bash + make install + ``` + +## Editor pulgins + +[Visual Studio Code](https://code.visualstudio.com/) pulgin are in this directory: [./tools/pulgins/vscode](./tools/pulgins/vscode). + +## Examples + +After compiling successfully, use the `berry` command with no parameters to enter the REPL environment: +``` +Berry 0.0.1 (build in Dec 24 2018, 18:12:49) +[GCC 8.2.0] on Linux (default) +> +``` + +Now enter this code: + +``` lua +print("Hello world!") +``` + +You will see this output: + +``` +Hello world! +``` + +You can copy this code to the REPL: + +``` ruby +def fib(x) + if x <= 1 + return x + end + return fib(x - 1) + fib(x - 2) +end +fib(10) +``` + +This example code will output the result `55` and you can save the above code to a plain text file (eg test.be) and run this command: + +``` bash +./berry test.be +``` + +This will also get the correct output. + +## License + +Berry is free software distributed under the [MIT license](./LICENSE). + +The Berry interpreter partly referred to [Lua](http://www.lua.org/)'s design. View Lua's license here: http://www.lua.org/license.html. diff --git a/lib/libesp32/berry/berry-logo.png b/lib/libesp32/berry/berry-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1eb41908963a04e02ea5aa91d264903b1c0895e2 GIT binary patch literal 11325 zcmX9^cRbYpAOD~TDI+6Mvd5jBz2|X8WS$i{oEaINnX=CwciG`iR!C=NWn`Sl6&kX) zvSo$e`TqX!IFI-H^?tqI@7MgiU$1BUeIs2u8g?200O<4}TBZO%4h8@+$}5zlk#ct& zJL!k|F~s@_0I)J%{E@j95=m6RO@D1G{|7!U{y~m@a6sMJ#|h4*=jG@MH-$SoBYg+p zN&p}-sHdfF_VmZ^{AnMKf&6bCI+=LlhF?>I-_Fg(+28UiJx13w9m2m^Q9V3ad^YoJ z{x>&u>YZmgKBJmkG*rA|WYQXEKvF@bEL~)X99O6Njh;BMVPtOYM6-74(p*1F&26Ixs+mM}%7_X{AYe-ZHKSUsA$MZIHrv z8Bl`(#MG=(1(jk+T947U>;nV}eKr683^sOKV5!(vrwy7EM%nnZ8=zx_eEc>=A!`*)t=nB4N4aE6w9(x?&IjWN2b9dorS965e&Os9Sk! zcQKl-1Hc1369`F3>#S`-RbTQ5$AxKSpe8WhyAFtRYQeaC9Mc9G+Q_LA zEBbGqVMdf#fM-$SN|&tr_04;kyfCz|OOh#kGe!VOS)Jb22w_!O`8<8A{=WYVsLn~T zGOgBMh-50*%c;z{Y4MF-31mR$eZ_7qTX8NC^}SIw3;Ty)Ml@wF06e_L4HmB~gRt1> zrSlUo9+~~Lo-2N27i;}8v-o~-p=!+p)6%-SdTfAa(m%LjVjq&5lvga9WNGU!SUKZ9 zGv4$e1Bj6jS`GnWMiXi?CClj9!htA0HLDAYhd7wB;IaL8O_;fbztGY`b1xJM(KAKI zXu-2h)&HZZ)xIBdJtmZ%<-bjtGfE2mY6qztFHDgu&F$)flbZO46!U!vK1t+^m>kNlq50$%O|T&edCGF1qU@4C^NGqxcxXLOZLit);10qRJ*?h(VtEI`j0N^ z!V2D^eL|NB5u2yF4yRNJ&K}yVEPolvfm-12ZH2C^S~K$z*-J_{vZ$zP{%sa+I^?bY zacDgpJ-bX(E;sqWH|p|#N2_AUy1XB%+4+{qE$yX7Ez5xZ3#W_iJ=3z>_eQ^VNj|C0 zNGWXn>*%vdTNB!J?osngl?$FgWt$v@GnBY+1DSsPSMc7$s2^=-s}85r0)-)mU;0or z5%_cDep5uw`yo!}==;iy=+xp1zB}lw7WzLCx17H?TND-D`1VjGQ^NXgTRLB)vXbIT2aIFTyEVa8}E77P~g zN+2f*WB_VGo<+=KzVz`HgpG>i77M~6V=E=hoFdis6yzDySEw9cVM*?iHt%%2WEdY!^Lf_yCBh_4mD@gIMFkYog(*;OiB%)F+q z2h1Y)D=#T}rN6F~E>2N2Gn9dh|0>)({qZ*>o^w96qr4Kp+hc^ zxV?S*!B&vylxn|nn#A12ATJ|}9%Wz__d(&*6st-DSNBE|#5U(EDe@2{-_$~CFkk;& zp4WXJ;U%)%mL#e>M=a&PIN-p_5S7j1*`2VbYY#U^j5%9(=D!%*pAa4x3mrY@3c1yG zz9NE4`X$zu`9&yHgb|aPbKw9VsR{kRata0OcV{O*oF+93Kn&DV;l%Yq(fl)1o5M)( zkei4C`Wpl3vj!orXT?9 zr$2&DNWN5Bv8c_y&ivD7=&HrdHs*L}EXiBdMzM=8LqSL`O_5}qH^kRKql zptEWPWn<8ohBx~ja%+Af>1cC%DgbELCoNwhpA6XVx}F)lC*XSUx35Yj-Tu&>SL9Fe z6j$&t%C;kbDUeRr?i(FD&bT^@<2GUa?*F+Zz9oHPk(AsF8q*@RhGF6T1=3?>H6y1uYqa!Pw}emFaw9dNzmRvKO! zW!qT)BbU2W()CTwZn@G=HUCHRv3HF*0RsWBZ{{M!$l%OlIYCAi`-Cqj)V=J~6z&kV zu#*g*)*IAApaV@ujGAs2w`6c1@k<88%6R(8U2ckJ_{0o!!;Z)x_sOMu+>Wb$B10fi z+7^blewsSp|< zthTF;t(M!H$vEE_y_V?21}!4@PV?`TRcQXeV>m66Yzwn<<9z&e!LmY^)3xj-4o*ob zr%xYuL+V?1nZ9`Z;|n)f(AAzUkb|24bH?YH*M*wSM3FvueLuuw1`uBw=e-=7uWK)D*b8>#%m~ma6j#YbOtX5?)%lc`D=zv}N+z zF&!MyqkXvU8WBEQC>nZzsX_Nq+F_UNu_3s%@B0wZqWi`m%4b~=CJ27<@6$O|i_(FU$9Ik%{A4{F=!%$XdF;M`5XDScm$STTaW8Nv zZ0+lRN;gxFZ@L3-HkfOg?8Q}b#98El|5#2{hn|mG4tsArJ>2M2Kd} zLW**WYVO*y-=2Whs~tSVS%fh8l0D9BPCKuc61!es$@JJqJf+vjo9c9mq{PIt;4jg; zVYt>OvwsE;g3h`HrsWPs&!V$P;-oEb>A!auY~$V_sAGPou1+@w`|g{*TDWnn0AnXB z!dEt`F;62GQt{Ubg zCPzt|1>bs1sT2=*oBlO`v741M$;nPb_*c%RDkF|Z!YZ%izwgm98?*A4N-s3>?^j&$ z5Y9*5U+^H?(t%BKvZs$}+%#l%BMPrb zSM`_d*@za*_P2IJ|G=EIVc&40A0Ox_lcwE$MsfU$iXNwz#D2&)@;5N)JiKksYr@jk z%(?edAqWL!P(d1n4qSFFo(xI0dzY2Z(I!SrXVE+2FgUiq&EudP*022i6W1EtCVMO( z)@HC$=Bo?@35lwHgPR!lV9PsywLvwqP}&|dj$OUvk4&@yeXcK8;+I=y9X=?-gA@Zt z8sh7osw*l~EBd!b>WYOjHH||8!NTWivMujgLom8+jU}5|AC1`Mtre!;{w}Dj7#(dZ zXD6S-7JQO@7H|`O@Qt_w3vm$_Z4XK{dA-&>M*dY5#@{%S&cAhgRC%)=!?W3m>~y zz+*#F4y+^=sDk-MbD+z=2U=MsNZRvTcsV$!xQJ4SyM~Zc{rtRO?6I5ndAt4IN$yR% zb>ipxsjo?fUe9-bCmz|S)dabM-v5veF&gMdy4GA1fhG7LpHJH;mh*tq890kXGpzlJ z?8b^EJEIQmKOM@Kjc|d){PDJEw9KbA%O;D$NGiBDFHy2O$a4kW_-cqZ`aNbF8muR4 zM*LR2U^NlD!aI$2<^4hJ%o-mT9dCbG`?tWU9p9o{no_xM&Ui3{i{putFrswdb`=Q zy!QU`xH!(?<($!kVHT()SX{$GGs}x*ew}}s4rZkRSNRg^_Fx(Q+_ktUT{i|#3R0DW zZ@!*hK^5XT6)f*yd$k_@AgtILCcgJ^k&rMyur<`8Bx+3U2LO1{qpXIG-z&6DZ%A*bj=nWeiN-gn^xn_+A3|z#Zst|~OSWFNb2b$DRK!hj z@EYNW6#uaKhP^dLI%+YyY-Q{|e?z0y;476|lm+pn27ZAiu!e7JqsF9gRp93qx1w)F z!y)R8;h)V(rHik_^7jVILE5Kr=8t1D9O!7O;!oTi%P1bTJQCM?Z*ng{70U(6)2*vGk$Dl_2^90ltDz45!QO^QRA%=^z;BT00@) zg8~Di>4<+>$t`8@l?t{W`G?zFkFhaJF_RK|S?aLthx^EJCFBzOpu@P*x0G`EI(2E; zh5F1zq_L34A68uN8~Pwib%raP@*~=@gr}no%O(ed3yOxH=$iA!l_>KQlt0OXY+zH1 zO}M$l(RJarR=KRijKsyMnL96%{>*-SskgwdfP@Mu@zBBL2DyiX8u^*H!M&Z?!R?Ib zir}#fDK^i%V9H^*-oeg#4BwU?tTK8}e%heK*K}K4=V`jV!N!#br z(b`j((&aHd<7W9)tc&s_-^9fDqL2Grg$U<2Fxc`}QBd#02Onq6b=OU-?}6K5J{V0Z zpIVRgjsD81F?{UcPxtF*WO@94OfiTD?q$?0EovN&*5FD*i8#hTuXTWV+RlZ@e+mU1 zYr9uiw&39KrBf@c3Hnz=R(Ai$bH0NyJ-Rjs#I;8Wm+TFqqU$hyXV`9NGpTjoMxe^Y z5p&Nx~A~S`uDtG(LYcMm)jd~s$r@78{lq-ovrY+15M>mwj3?$ z(#&J@j?@NuHIS4ksNm)@-=~HJG)pVhqd^UBRy~Pl_4;mc4Mm$0{2<-oPnHNh#b9*9=hvcNV-%33)os~( zFeCO-KOtgQDB9`new&5_mPvYRK|!XzDyp3IW%FqYk)Gu){*{VBBOfAbOz&mEqxvFK z+rS9ygTlQtTbZpqX|n_qmZGXj>ju4%_f}1&(~%DvoGh2V@YZp+ZMw5`Ih7sAy-L&J z@zlG`_{Aha2i=w4wUlOalN$Bbs4en9lep|0HYxRoxJ6Gi1;tf0kKP*2X(Z|oM0BB) z?zf*nX*v0Dn?l$-iyT!Xi#+!+9{6a5Wx~AJy z1_GLR!N5aHA4xH1qh##SCSO03l;NchJ;V)*!8UIujj#1H?fNzwb*bo9EJ3Sb;o-++ ztu@fTAT5zxru#7$QS#c&fA zP8#eJPhR#(CdMP7Z#V?BbDz438Y%wHartY5z5J>ZD{f7csb0^=7-nJi6bwPveQ;)l zFRqsIuSu7K%;@qorTSdEdyagTTD{cl6;%Y_?=Nz%bn z3Ke@inq74WuC6rv>$ZZ~oqasEGJiR#u+MoCv|LB3==YYuQrD&VL?gZEvhDBjG5Y_S znP^}vcrYb`$>a<0>P~HlA87jW)m3VC6P9bSW;ghS{PG+rL#wf2O;|{GvwBJY0j#M!2>LtF ze6!6;@!i!CHdqo~{?F!kN09nKAjN6+k`mUOA|uLB3$~MN%G(~37uy&^@Z~FUeV4s; zQ1xlYvxOH-O9Sj|FvO0cKK9tAd|2pHpSQJK^%No&n2Z}h2paxLvr+r$eSyNIl6yH# zH5Yuc&|qkRZ}W8Zt*0^=BN%z1WoGX^L|Se|$tyvw@+FB;arSkFb$bhA)rrbu?QhbP z&%~g6PBHei@hj@uiygZ=Z+mNo_q~up~^g;vz_k8%+}cNAD-pj6MiTe|FbS~cVPGXl~CmM6@_00yQdyp zgLPS2!GnWCo{!ii1cjA#hu^IY?yuRhV(7vb2d|#o00#$mT$9<6su!t^k8_)N;o4n# z@GO4ER&tV>jo*Y^C5^?Bh?BCt4E2<5VIuzOhY@(CSX+rKksHB*c^0iW$40wNpqX-Zy{lr z5U%L_*nv@}>5xvXzPYBms-#q^1vhUPqBkxsR@l|DNznY1w(GxmwL5)rxE%f3{!e52mc7A0rT5ZG&Vy?o{2(9<4Zp?Ph0&%c zdD{*#VqGbzk}1+VJ*$c3Lr@_IrTVh>ZU*%%oazv-#Zmi;iUjd9(n!0IQjiX*_;cM$ zRaZ0j!y>T>E1qX^3Bh2E@rx`rLevH z?))yGwZ1HyJ&8$9goC{~$_-(}ikH_KKe?7=YTH5nV-V72_ za19PEAUzYzvlQheZL_ai+#_nZ{CsgoIuU8mF8g+3B&S`Kl04JdX!K#n>jD)GD1Uf* z2_HXxD|?eYlydR5k>uuUgdgMKs^LlMZ3VUk-JMyu#cR#}{8H2AKg6ZTcybBN}&gC3UFhA|fs?A&=8_4^q zK7AbX`Jw)?5`VCMNz>fQktOX`Kfe)>y}O0E-fe@J+T9T~l9c{xFkd{F{8uBDMb)?5 z-p*Ryxng^0esQvP<#IAU)IyL+5ju=<)PQ+zY~?mByE1<q*j5WG8u^z%b)cL|yP_Q$ED`gi79`rMVY4qLB zF~6)b3kz%6X_cGEts0xk9E&8#k7vcNztNhQ-4$=Rp6y(Dnba1TdhkiQV-k+AHp@R! zi`=!PhU#Uo!at4wc{TlH!PYR-!(}t3tcVra=3ZCrva+A;9v8Y{btE2t&zF&q88|GX zH*Q*==90Onjfj6Y=29YT*7{$Gsn@+e`Q;Qo2E9ypwC@6(MSnx}CnW57P4Y?&)qR zp41qsR^QzO8B&dWXGTbH?;%>_{JSSUkNChs4Bvd(A)>Q%C{16fzBglb-7-4myqDRA zFDL%$AjB5koqmFEg;|LeLXpxkSpTqVZdUAroC z!_O#EKjPXKi!O{?-%J})@4D_K#84y~?DiBJ56lj=A+r4CK=CV5FK;-4QDV@&X_F+a zpwKC^jo)>OuWhHoqzkUHM_#|o5KX>YECB3p6d0HnBH4_E_UPV z)A;1=E<1LB6-v?qLamM?ZUlH({} zvg=6QWEN+@ttgy%dN%E-t;oZsS_y>0BeCsCdW`Au_0(3ds7zG!yuKAIK$_-$Pto0p zsNRLvH1wb-otCyLQ+MnDQk5V6vqvZXI!A;|aI*3(1bD=LBzQIW`wPsjcx77Cjr!Qt zgj$eb(C&KEp6v|@=FWwy$1}vltx$Idk}K zc1o~%Xvty(O`!}^}lY6fUMoPCD+Bn0bTK)Ys z!@C)gdW!7u;!#3~WH>QIkK4*lXUv8S5i#q z&o4q;PDv@*R%sjd#}Mga_wCT%PBz9bs)1%O3O;pzduIiN+4or)R#!whN`)o8(=ir% zod$J{@ko9065bzN+uFXqa+-|?cQD(9Y^-X1ghD~0?<^$eOr;fep+9kFjpyczv#iQZ zIX=yG6Q3o-%1Y~8%gSD-P{Hm8i_#8Wg5SBy$uCfJomcE@`TYaNCO`o)>-I2WpoLe{nI2Btn|NIb`I<{qhz1p|Zhp4)Z(}&b z_3wy$=)GYb>&`(+%?(`i-FS{5A9+5cuEnCioyTNsATimH@Ky=LWba`7={CGM&3}2% z6UXPB`eQJ~jdm`*uD1U?)NIY?RDH3C(5;E#K_DKy1!f}gyoioB@pV@gh0eUblqghj z$kgT^DKx$#)%U-q$%B?paD%c3Mw@cM+PS1A{!?z!=L2ZwbDfZ%Of$Y`U};>53G*Hl zYXkzBhHq9dIQBIL4R6Q?oBy`E478_WDfmrTDjOVxjE^>RZ(FQzD(_wXLJNiF*QR%l zx)E9)y_Y9}L$pTj>8JNL!GHe4u44I;8z#4Ey~VWY9$OmA#cbEr(Q`WPHCE1_mA@E8 z^D|!s3Q`xsT2PWXMBD9#Yb@6*G3D|vMwug_*)t_dkz=5L0=?L0>%)c5j18Qoy2Nhu=;xK zCwTF!Kuh4QADbc9nk1BlBdIiWJBtpeE@2wr8;JXbzc*nd z|6$~KN`zC(uB&S}AZ;C8_MlZk&_w@mdRqD9Z7=C9|B^rsgkM1=GV)rJH6ywMX_rXf z44lFzjjpnhiPYhb<)lqB@0L6jEGwS__3QjKIhs>Hn)6YXhp#isa!d}~1RmZn%<`O; ztyFxR;o75I?YsL(suvNw@TQxm;OBf{RZmQNj!u5K|JrKb`O=uN7%XrMyG{j&eU4v9 z_iW}dL05d5urk{F5^g-m87;jqVXicdTm4i!y4$aB?BF2GC_IWDQ3e0>U*s;Lvkw4f zs6XXJs05^I!wO`Bi}V}tgK%ExW1H)kW`2=6hg2&5O_yswb!*6Ox3_4RA{!1y-VsLQpotl!XjqOR`c(TjT3 zpl#a@Y@q&WE7XaT1n5X{Tl%+~{g9u?C>ukhpIU5>r=THKD`^eR6!rQTveXE0@aC5z zW7mU*je?N8*E55)pBbTfWSvy*^|Bca9Y$K#L;BE3IepExF7RG9rDSNJ^IeG%KKNF% z+k;3Y6Zd5YP^h11--D;9(`cZR2eHZ*I?}zbyL&q>J77D*Q;F&;|6ZfC~Ms5VPU9-z>^BDZF zL@Gl5_$Q}#d3M^Z&+B7W=|3FOKb?ARa6uV(<2issEn*&QU6dM?YD7#t4z%foMv^6W z7zU1nzg+C*q=sThxVJkbMOO>_%PIAk$ag6fljx-L2FoSO7UTshmpDJEyXln6NCl)o zggJ(_t%+G^IUDa+bG1sHkh8Om>=U8$gpjn_DpMjbLrZEnN_I#fOh1>RCJMY|S$!iV zLc=!q2twg)TF2~}lE70PV)Dxj6Z9UAj|C%2N5#>XXS&?p926`NUBhDHf};lxAQF6ZqTp& zAL6O!a^2kzQMUhqk<@Lu6kT4Xiez|CYg|mCLA{IY=42XMPv@>SzcAM@Xt_Y}NHVip zKi9s^`chg`l#p|QB(Uwpah@Kbxfdgfvbi*?u}cpBU*6iQt#L{=XX?p~koS&*qzmbh z`g}rUz>Sp99eiSmlvuo9*Gid*cJG42NJK@rNw~tlLhrXWQh?f9AseJcouYr3P2I`c zy0TaQ{d9ssW#5w*AWw0%+vwUC|d z$kv6CQgoJ#HVHZgA#Cpu6O${=?$wbmNRMZu3S_kg#jL?vdr|B@l*}a>d1F{ae>B&|DkT z2KSDo*c3t&x;!~(^g%+L!nZCsMDXcwONwecIrka|LCo0xUSQvF54ol2UsjxD@{Ht( zrz_%KFJglPh4=r6GXDn;&Eu7#g*j!O*|Hsy1NI67(0)(>Bto)_C~*e_#+`sQ>@~ literal 0 HcmV?d00001 diff --git a/lib/libesp32/berry/default/be_animate_lib.c b/lib/libesp32/berry/default/be_animate_lib.c new file mode 100644 index 000000000..398f87b66 --- /dev/null +++ b/lib/libesp32/berry/default/be_animate_lib.c @@ -0,0 +1,712 @@ +/******************************************************************** + * Berry module `animate` + * + * To use: `import animate` + * + *******************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Animate_rotate_init, /* name */ + be_nested_proto( + 12, /* nstack */ + 5, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(closure), + /* K2 */ be_nested_str(code), + /* K3 */ be_nested_str(push), + /* K4 */ be_nested_str(animate), + /* K5 */ be_nested_str(ins_ramp), + /* K6 */ be_nested_str(ins_goto), + /* K7 */ be_const_int(0), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0x60140003, // 0000 GETGBL R5 G3 + 0x5C180000, // 0001 MOVE R6 R0 + 0x7C140200, // 0002 CALL R5 1 + 0x8C140B00, // 0003 GETMET R5 R5 K0 + 0x7C140200, // 0004 CALL R5 1 + 0x90020201, // 0005 SETMBR R0 K1 R1 + 0x88140102, // 0006 GETMBR R5 R0 K2 + 0x8C140B03, // 0007 GETMET R5 R5 K3 + 0xB81E0800, // 0008 GETNGBL R7 K4 + 0x8C1C0F05, // 0009 GETMET R7 R7 K5 + 0x5C240400, // 000A MOVE R9 R2 + 0x5C280600, // 000B MOVE R10 R3 + 0x5C2C0800, // 000C MOVE R11 R4 + 0x7C1C0800, // 000D CALL R7 4 + 0x7C140400, // 000E CALL R5 2 + 0x88140102, // 000F GETMBR R5 R0 K2 + 0x8C140B03, // 0010 GETMET R5 R5 K3 + 0xB81E0800, // 0011 GETNGBL R7 K4 + 0x8C1C0F06, // 0012 GETMET R7 R7 K6 + 0x58240007, // 0013 LDCONST R9 K7 + 0x58280007, // 0014 LDCONST R10 K7 + 0x582C0007, // 0015 LDCONST R11 K7 + 0x7C1C0800, // 0016 CALL R7 4 + 0x7C140400, // 0017 CALL R5 2 + 0x80000000, // 0018 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Animate_rotate +********************************************************************/ +extern const bclass be_class_Animate_engine; +be_local_class(Animate_rotate, + 0, + &be_class_Animate_engine, + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(Animate_rotate_init_closure) }, + })), + be_str_literal("Animate_rotate") +); + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Animate_from_to_init, /* name */ + be_nested_proto( + 12, /* nstack */ + 5, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(closure), + /* K2 */ be_nested_str(code), + /* K3 */ be_nested_str(push), + /* K4 */ be_nested_str(animate), + /* K5 */ be_nested_str(ins_ramp), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x60140003, // 0000 GETGBL R5 G3 + 0x5C180000, // 0001 MOVE R6 R0 + 0x7C140200, // 0002 CALL R5 1 + 0x8C140B00, // 0003 GETMET R5 R5 K0 + 0x7C140200, // 0004 CALL R5 1 + 0x90020201, // 0005 SETMBR R0 K1 R1 + 0x88140102, // 0006 GETMBR R5 R0 K2 + 0x8C140B03, // 0007 GETMET R5 R5 K3 + 0xB81E0800, // 0008 GETNGBL R7 K4 + 0x8C1C0F05, // 0009 GETMET R7 R7 K5 + 0x5C240400, // 000A MOVE R9 R2 + 0x5C280600, // 000B MOVE R10 R3 + 0x5C2C0800, // 000C MOVE R11 R4 + 0x7C1C0800, // 000D CALL R7 4 + 0x7C140400, // 000E CALL R5 2 + 0x80000000, // 000F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Animate_from_to +********************************************************************/ +extern const bclass be_class_Animate_engine; +be_local_class(Animate_from_to, + 0, + &be_class_Animate_engine, + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(Animate_from_to_init_closure) }, + })), + be_str_literal("Animate_from_to") +); + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Animate_back_forth_init, /* name */ + be_nested_proto( + 12, /* nstack */ + 5, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(closure), + /* K2 */ be_nested_str(code), + /* K3 */ be_nested_str(push), + /* K4 */ be_nested_str(animate), + /* K5 */ be_nested_str(ins_ramp), + /* K6 */ be_const_int(2), + /* K7 */ be_nested_str(ins_goto), + /* K8 */ be_const_int(0), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[34]) { /* code */ + 0x60140003, // 0000 GETGBL R5 G3 + 0x5C180000, // 0001 MOVE R6 R0 + 0x7C140200, // 0002 CALL R5 1 + 0x8C140B00, // 0003 GETMET R5 R5 K0 + 0x7C140200, // 0004 CALL R5 1 + 0x90020201, // 0005 SETMBR R0 K1 R1 + 0x88140102, // 0006 GETMBR R5 R0 K2 + 0x8C140B03, // 0007 GETMET R5 R5 K3 + 0xB81E0800, // 0008 GETNGBL R7 K4 + 0x8C1C0F05, // 0009 GETMET R7 R7 K5 + 0x5C240400, // 000A MOVE R9 R2 + 0x5C280600, // 000B MOVE R10 R3 + 0x0C2C0906, // 000C DIV R11 R4 K6 + 0x7C1C0800, // 000D CALL R7 4 + 0x7C140400, // 000E CALL R5 2 + 0x88140102, // 000F GETMBR R5 R0 K2 + 0x8C140B03, // 0010 GETMET R5 R5 K3 + 0xB81E0800, // 0011 GETNGBL R7 K4 + 0x8C1C0F05, // 0012 GETMET R7 R7 K5 + 0x5C240600, // 0013 MOVE R9 R3 + 0x5C280400, // 0014 MOVE R10 R2 + 0x0C2C0906, // 0015 DIV R11 R4 K6 + 0x7C1C0800, // 0016 CALL R7 4 + 0x7C140400, // 0017 CALL R5 2 + 0x88140102, // 0018 GETMBR R5 R0 K2 + 0x8C140B03, // 0019 GETMET R5 R5 K3 + 0xB81E0800, // 001A GETNGBL R7 K4 + 0x8C1C0F07, // 001B GETMET R7 R7 K7 + 0x58240008, // 001C LDCONST R9 K8 + 0x58280008, // 001D LDCONST R10 K8 + 0x582C0008, // 001E LDCONST R11 K8 + 0x7C1C0800, // 001F CALL R7 4 + 0x7C140400, // 0020 CALL R5 2 + 0x80000000, // 0021 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Animate_back_forth +********************************************************************/ +extern const bclass be_class_Animate_engine; +be_local_class(Animate_back_forth, + 0, + &be_class_Animate_engine, + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(Animate_back_forth_init_closure) }, + })), + be_str_literal("Animate_back_forth") +); + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Animate_ins_goto_init, /* name */ + be_nested_proto( + 4, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(pc_rel), + /* K1 */ be_nested_str(pc_abs), + /* K2 */ be_nested_str(duration), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x90020403, // 0002 SETMBR R0 K2 R3 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Animate_ins_goto +********************************************************************/ +be_local_class(Animate_ins_goto, + 3, + NULL, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(pc_rel, -1), be_const_var(0) }, + { be_const_key(duration, -1), be_const_var(2) }, + { be_const_key(pc_abs, -1), be_const_var(1) }, + { be_const_key(init, 2), be_const_closure(Animate_ins_goto_init_closure) }, + })), + be_str_literal("Animate_ins_goto") +); + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Animate_ins_ramp_init, /* name */ + be_nested_proto( + 4, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(a), + /* K1 */ be_nested_str(b), + /* K2 */ be_nested_str(duration), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x90020403, // 0002 SETMBR R0 K2 R3 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Animate_ins_ramp +********************************************************************/ +be_local_class(Animate_ins_ramp, + 3, + NULL, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(a, -1), be_const_var(0) }, + { be_const_key(b, 2), be_const_var(1) }, + { be_const_key(duration, -1), be_const_var(2) }, + { be_const_key(init, -1), be_const_closure(Animate_ins_ramp_init_closure) }, + })), + be_str_literal("Animate_ins_ramp") +); + +/******************************************************************** +** Solidified function: run +********************************************************************/ +be_local_closure(Animate_engine_run, /* name */ + be_nested_proto( + 6, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(millis), + /* K2 */ be_nested_str(value), + /* K3 */ be_nested_str(ins_time), + /* K4 */ be_nested_str(running), + /* K5 */ be_nested_str(add_driver), + }), + &be_const_str_run, + &be_const_str_solidified, + ( &(const binstruction[19]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x1C0C0203, // 0001 EQ R3 R1 R3 + 0x780E0003, // 0002 JMPF R3 #0007 + 0xB80E0000, // 0003 GETNGBL R3 K0 + 0x8C0C0701, // 0004 GETMET R3 R3 K1 + 0x7C0C0200, // 0005 CALL R3 1 + 0x5C040600, // 0006 MOVE R1 R3 + 0x4C0C0000, // 0007 LDNIL R3 + 0x200C0403, // 0008 NE R3 R2 R3 + 0x780E0000, // 0009 JMPF R3 #000B + 0x90020402, // 000A SETMBR R0 K2 R2 + 0x90020601, // 000B SETMBR R0 K3 R1 + 0x500C0200, // 000C LDBOOL R3 1 0 + 0x90020803, // 000D SETMBR R0 K4 R3 + 0xB80E0000, // 000E GETNGBL R3 K0 + 0x8C0C0705, // 000F GETMET R3 R3 K5 + 0x5C140000, // 0010 MOVE R5 R0 + 0x7C0C0400, // 0011 CALL R3 2 + 0x80000000, // 0012 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Animate_engine_init, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(code), + /* K1 */ be_nested_str(pc), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str(ins_time), + /* K4 */ be_nested_str(running), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x60040012, // 0000 GETGBL R1 G18 + 0x7C040000, // 0001 CALL R1 0 + 0x90020001, // 0002 SETMBR R0 K0 R1 + 0x90020302, // 0003 SETMBR R0 K1 K2 + 0x90020702, // 0004 SETMBR R0 K3 K2 + 0x50040000, // 0005 LDBOOL R1 0 0 + 0x90020801, // 0006 SETMBR R0 K4 R1 + 0x80000000, // 0007 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: autorun +********************************************************************/ +be_local_closure(Animate_engine_autorun, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(run), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(add_driver), + }), + &be_const_str_autorun, + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x8C0C0100, // 0000 GETMET R3 R0 K0 + 0x5C140200, // 0001 MOVE R5 R1 + 0x5C180400, // 0002 MOVE R6 R2 + 0x7C0C0600, // 0003 CALL R3 3 + 0xB80E0200, // 0004 GETNGBL R3 K1 + 0x8C0C0702, // 0005 GETMET R3 R3 K2 + 0x5C140000, // 0006 MOVE R5 R0 + 0x7C0C0400, // 0007 CALL R3 2 + 0x80000000, // 0008 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: stop +********************************************************************/ +be_local_closure(Animate_engine_stop, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(running), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(remove_driver), + }), + &be_const_str_stop, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x50040000, // 0000 LDBOOL R1 0 0 + 0x90020001, // 0001 SETMBR R0 K0 R1 + 0xB8060200, // 0002 GETNGBL R1 K1 + 0x8C040302, // 0003 GETMET R1 R1 K2 + 0x5C0C0000, // 0004 MOVE R3 R0 + 0x7C040400, // 0005 CALL R1 2 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: is_running +********************************************************************/ +be_local_closure(Animate_engine_is_running, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(running), + }), + &be_const_str_is_running, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_50ms +********************************************************************/ +be_local_closure(Animate_engine_every_50ms, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(animate), + }), + &be_const_str_every_50ms, + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: animate +********************************************************************/ +be_local_closure(Animate_engine_animate, /* name */ + be_nested_proto( + 12, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[22]) { /* constants */ + /* K0 */ be_nested_str(running), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(millis), + /* K3 */ be_nested_str(ins_time), + /* K4 */ be_nested_str(pc), + /* K5 */ be_nested_str(code), + /* K6 */ be_const_int(0), + /* K7 */ be_nested_str(internal_error), + /* K8 */ be_nested_str(Animate_X20pc_X20is_X20out_X20of_X20range), + /* K9 */ be_nested_str(animate), + /* K10 */ be_nested_str(ins_ramp), + /* K11 */ be_nested_str(closure), + /* K12 */ be_nested_str(duration), + /* K13 */ be_nested_str(value), + /* K14 */ be_nested_str(scale_uint), + /* K15 */ be_nested_str(a), + /* K16 */ be_nested_str(b), + /* K17 */ be_const_int(1), + /* K18 */ be_nested_str(ins_goto), + /* K19 */ be_nested_str(pc_rel), + /* K20 */ be_nested_str(pc_abs), + /* K21 */ be_nested_str(unknown_X20instruction), + }), + &be_const_str_animate, + &be_const_str_solidified, + ( &(const binstruction[99]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x740A0000, // 0001 JMPT R2 #0003 + 0x80000400, // 0002 RET 0 + 0x4C080000, // 0003 LDNIL R2 + 0x1C080202, // 0004 EQ R2 R1 R2 + 0x780A0003, // 0005 JMPF R2 #000A + 0xB80A0200, // 0006 GETNGBL R2 K1 + 0x8C080502, // 0007 GETMET R2 R2 K2 + 0x7C080200, // 0008 CALL R2 1 + 0x5C040400, // 0009 MOVE R1 R2 + 0x50080200, // 000A LDBOOL R2 1 0 + 0x780A0054, // 000B JMPF R2 #0061 + 0x88080103, // 000C GETMBR R2 R0 K3 + 0x04080202, // 000D SUB R2 R1 R2 + 0x880C0104, // 000E GETMBR R3 R0 K4 + 0x6010000C, // 000F GETGBL R4 G12 + 0x88140105, // 0010 GETMBR R5 R0 K5 + 0x7C100200, // 0011 CALL R4 1 + 0x280C0604, // 0012 GE R3 R3 R4 + 0x780E0002, // 0013 JMPF R3 #0017 + 0x500C0000, // 0014 LDBOOL R3 0 0 + 0x90020003, // 0015 SETMBR R0 K0 R3 + 0x70020049, // 0016 JMP #0061 + 0x880C0104, // 0017 GETMBR R3 R0 K4 + 0x140C0706, // 0018 LT R3 R3 K6 + 0x780E0000, // 0019 JMPF R3 #001B + 0xB0060F08, // 001A RAISE 1 K7 K8 + 0x880C0104, // 001B GETMBR R3 R0 K4 + 0x88100105, // 001C GETMBR R4 R0 K5 + 0x940C0803, // 001D GETIDX R3 R4 R3 + 0x6014000F, // 001E GETGBL R5 G15 + 0x5C180600, // 001F MOVE R6 R3 + 0xB81E1200, // 0020 GETNGBL R7 K9 + 0x881C0F0A, // 0021 GETMBR R7 R7 K10 + 0x7C140400, // 0022 CALL R5 2 + 0x78160020, // 0023 JMPF R5 #0045 + 0x8810010B, // 0024 GETMBR R4 R0 K11 + 0x8814070C, // 0025 GETMBR R5 R3 K12 + 0x14140405, // 0026 LT R5 R2 R5 + 0x7816000E, // 0027 JMPF R5 #0037 + 0xB8160200, // 0028 GETNGBL R5 K1 + 0x8C140B0E, // 0029 GETMET R5 R5 K14 + 0x5C1C0400, // 002A MOVE R7 R2 + 0x58200006, // 002B LDCONST R8 K6 + 0x8824070C, // 002C GETMBR R9 R3 K12 + 0x8828070F, // 002D GETMBR R10 R3 K15 + 0x882C0710, // 002E GETMBR R11 R3 K16 + 0x7C140C00, // 002F CALL R5 6 + 0x90021A05, // 0030 SETMBR R0 K13 R5 + 0x78120002, // 0031 JMPF R4 #0035 + 0x5C140800, // 0032 MOVE R5 R4 + 0x8818010D, // 0033 GETMBR R6 R0 K13 + 0x7C140200, // 0034 CALL R5 1 + 0x7002002A, // 0035 JMP #0061 + 0x7002000C, // 0036 JMP #0044 + 0x88140710, // 0037 GETMBR R5 R3 K16 + 0x90021A05, // 0038 SETMBR R0 K13 R5 + 0x78120002, // 0039 JMPF R4 #003D + 0x5C140800, // 003A MOVE R5 R4 + 0x8818010D, // 003B GETMBR R6 R0 K13 + 0x7C140200, // 003C CALL R5 1 + 0x88140104, // 003D GETMBR R5 R0 K4 + 0x00140B11, // 003E ADD R5 R5 K17 + 0x90020805, // 003F SETMBR R0 K4 R5 + 0x8814070C, // 0040 GETMBR R5 R3 K12 + 0x04140405, // 0041 SUB R5 R2 R5 + 0x04140205, // 0042 SUB R5 R1 R5 + 0x90020605, // 0043 SETMBR R0 K3 R5 + 0x7002001A, // 0044 JMP #0060 + 0x6010000F, // 0045 GETGBL R4 G15 + 0x5C140600, // 0046 MOVE R5 R3 + 0xB81A1200, // 0047 GETNGBL R6 K9 + 0x88180D12, // 0048 GETMBR R6 R6 K18 + 0x7C100400, // 0049 CALL R4 2 + 0x78120013, // 004A JMPF R4 #005F + 0x8810070C, // 004B GETMBR R4 R3 K12 + 0x14100404, // 004C LT R4 R2 R4 + 0x78120001, // 004D JMPF R4 #0050 + 0x70020011, // 004E JMP #0061 + 0x7002000D, // 004F JMP #005E + 0x88100713, // 0050 GETMBR R4 R3 K19 + 0x20100906, // 0051 NE R4 R4 K6 + 0x78120004, // 0052 JMPF R4 #0058 + 0x88100104, // 0053 GETMBR R4 R0 K4 + 0x88140713, // 0054 GETMBR R5 R3 K19 + 0x00100805, // 0055 ADD R4 R4 R5 + 0x90020804, // 0056 SETMBR R0 K4 R4 + 0x70020001, // 0057 JMP #005A + 0x88100714, // 0058 GETMBR R4 R3 K20 + 0x90020804, // 0059 SETMBR R0 K4 R4 + 0x8810070C, // 005A GETMBR R4 R3 K12 + 0x04100404, // 005B SUB R4 R2 R4 + 0x04100204, // 005C SUB R4 R1 R4 + 0x90020604, // 005D SETMBR R0 K3 R4 + 0x70020000, // 005E JMP #0060 + 0xB0060F15, // 005F RAISE 1 K7 K21 + 0x7001FFA8, // 0060 JMP #000A + 0x8808010D, // 0061 GETMBR R2 R0 K13 + 0x80040400, // 0062 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Animate_engine +********************************************************************/ +be_local_class(Animate_engine, + 6, + NULL, + be_nested_map(13, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(code, -1), be_const_var(0) }, + { be_const_key(run, 4), be_const_closure(Animate_engine_run_closure) }, + { be_const_key(running, 8), be_const_var(4) }, + { be_const_key(init, -1), be_const_closure(Animate_engine_init_closure) }, + { be_const_key(autorun, -1), be_const_closure(Animate_engine_autorun_closure) }, + { be_const_key(value, -1), be_const_var(5) }, + { be_const_key(stop, 3), be_const_closure(Animate_engine_stop_closure) }, + { be_const_key(pc, -1), be_const_var(2) }, + { be_const_key(is_running, 11), be_const_closure(Animate_engine_is_running_closure) }, + { be_const_key(every_50ms, 10), be_const_closure(Animate_engine_every_50ms_closure) }, + { be_const_key(animate, -1), be_const_closure(Animate_engine_animate_closure) }, + { be_const_key(closure, -1), be_const_var(1) }, + { be_const_key(ins_time, 9), be_const_var(3) }, + })), + be_str_literal("Animate_engine") +); + +/******************************************************************** +** Solidified module: animate +********************************************************************/ +be_local_module(animate, + "animate", + be_nested_map(6, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(rotate, 2), be_const_class(be_class_Animate_rotate) }, + { be_const_key(from_to, 3), be_const_class(be_class_Animate_from_to) }, + { be_const_key(back_forth, -1), be_const_class(be_class_Animate_back_forth) }, + { be_const_key(ins_goto, -1), be_const_class(be_class_Animate_ins_goto) }, + { be_const_key(ins_ramp, -1), be_const_class(be_class_Animate_ins_ramp) }, + { be_const_key(engine, -1), be_const_class(be_class_Animate_engine) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(animate); +/********************************************************************/ diff --git a/lib/libesp32/berry/default/be_autoconf_lib.c b/lib/libesp32/berry/default/be_autoconf_lib.c new file mode 100644 index 000000000..da41707c7 --- /dev/null +++ b/lib/libesp32/berry/default/be_autoconf_lib.c @@ -0,0 +1,1394 @@ +/******************************************************************** + * Tasmota lib + * + * To use: `import autoconf` + * + *******************************************************************/ +#include "be_constobj.h" + + +/******************************************************************** +** Solidified function: page_autoconf_ctl +********************************************************************/ +be_local_closure(Autoconf_page_autoconf_ctl, /* name */ + be_nested_proto( + 13, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[41]) { /* constants */ + /* K0 */ be_nested_str(webserver), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(path), + /* K3 */ be_nested_str(check_privileged_access), + /* K4 */ be_nested_str(has_arg), + /* K5 */ be_nested_str(reapply), + /* K6 */ be_nested_str(tasmota), + /* K7 */ be_nested_str(log), + /* K8 */ be_nested_str(CFG_X3A_X20removing_X20first_X20time_X20marker), + /* K9 */ be_const_int(2), + /* K10 */ be_nested_str(clear_first_time), + /* K11 */ be_nested_str(redirect), + /* K12 */ be_nested_str(_X2F_X3Frst_X3D), + /* K13 */ be_nested_str(zip), + /* K14 */ be_nested_str(CFG_X3A_X20removing_X20autoconf_X20files), + /* K15 */ be_nested_str(delete_all_configs), + /* K16 */ be_nested_str(arg), + /* K17 */ be_nested_str(reset), + /* K18 */ be_nested_str(format), + /* K19 */ be_nested_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf), + /* K20 */ be_nested_str(arch), + /* K21 */ be_nested_str(CFG_X3A_X20downloading_X20_X27_X25s_X27), + /* K22 */ be_nested_str(_X25s_X2Eautoconf), + /* K23 */ be_nested_str(webclient), + /* K24 */ be_nested_str(begin), + /* K25 */ be_nested_str(GET), + /* K26 */ be_nested_str(return_X20code_X3D_X25i), + /* K27 */ be_nested_str(connection_error), + /* K28 */ be_nested_str(write_file), + /* K29 */ be_nested_str(close), + /* K30 */ be_nested_str(value_error), + /* K31 */ be_nested_str(Unknown_X20command), + /* K32 */ be_nested_str(CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s), + /* K33 */ be_nested_str(content_start), + /* K34 */ be_nested_str(Parameter_X20error), + /* K35 */ be_nested_str(content_send_style), + /* K36 */ be_nested_str(content_send), + /* K37 */ be_nested_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E), + /* K38 */ be_nested_str(content_button), + /* K39 */ be_nested_str(BUTTON_CONFIGURATION), + /* K40 */ be_nested_str(content_stop), + }), + &be_const_str_page_autoconf_ctl, + &be_const_str_solidified, + ( &(const binstruction[117]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0xA40E0400, // 0002 IMPORT R3 K2 + 0x8C100303, // 0003 GETMET R4 R1 K3 + 0x7C100200, // 0004 CALL R4 1 + 0x74120001, // 0005 JMPT R4 #0008 + 0x4C100000, // 0006 LDNIL R4 + 0x80040800, // 0007 RET 1 R4 + 0xA802004E, // 0008 EXBLK 0 #0058 + 0x8C100304, // 0009 GETMET R4 R1 K4 + 0x58180005, // 000A LDCONST R6 K5 + 0x7C100400, // 000B CALL R4 2 + 0x7812000A, // 000C JMPF R4 #0018 + 0xB8120C00, // 000D GETNGBL R4 K6 + 0x8C100907, // 000E GETMET R4 R4 K7 + 0x58180008, // 000F LDCONST R6 K8 + 0x581C0009, // 0010 LDCONST R7 K9 + 0x7C100600, // 0011 CALL R4 3 + 0x8C10010A, // 0012 GETMET R4 R0 K10 + 0x7C100200, // 0013 CALL R4 1 + 0x8C10030B, // 0014 GETMET R4 R1 K11 + 0x5818000C, // 0015 LDCONST R6 K12 + 0x7C100400, // 0016 CALL R4 2 + 0x7002003D, // 0017 JMP #0056 + 0x8C100304, // 0018 GETMET R4 R1 K4 + 0x5818000D, // 0019 LDCONST R6 K13 + 0x7C100400, // 001A CALL R4 2 + 0x78120038, // 001B JMPF R4 #0055 + 0xB8120C00, // 001C GETNGBL R4 K6 + 0x8C100907, // 001D GETMET R4 R4 K7 + 0x5818000E, // 001E LDCONST R6 K14 + 0x581C0009, // 001F LDCONST R7 K9 + 0x7C100600, // 0020 CALL R4 3 + 0x8C10010F, // 0021 GETMET R4 R0 K15 + 0x7C100200, // 0022 CALL R4 1 + 0x8C100310, // 0023 GETMET R4 R1 K16 + 0x5818000D, // 0024 LDCONST R6 K13 + 0x7C100400, // 0025 CALL R4 2 + 0x20140911, // 0026 NE R5 R4 K17 + 0x78160026, // 0027 JMPF R5 #004F + 0x8C140512, // 0028 GETMET R5 R2 K18 + 0x581C0013, // 0029 LDCONST R7 K19 + 0xB8220C00, // 002A GETNGBL R8 K6 + 0x8C201114, // 002B GETMET R8 R8 K20 + 0x7C200200, // 002C CALL R8 1 + 0x5C240800, // 002D MOVE R9 R4 + 0x7C140800, // 002E CALL R5 4 + 0xB81A0C00, // 002F GETNGBL R6 K6 + 0x8C180D07, // 0030 GETMET R6 R6 K7 + 0x8C200512, // 0031 GETMET R8 R2 K18 + 0x58280015, // 0032 LDCONST R10 K21 + 0x5C2C0A00, // 0033 MOVE R11 R5 + 0x7C200600, // 0034 CALL R8 3 + 0x58240009, // 0035 LDCONST R9 K9 + 0x7C180600, // 0036 CALL R6 3 + 0x8C180512, // 0037 GETMET R6 R2 K18 + 0x58200016, // 0038 LDCONST R8 K22 + 0x5C240800, // 0039 MOVE R9 R4 + 0x7C180600, // 003A CALL R6 3 + 0xB81E2E00, // 003B GETNGBL R7 K23 + 0x7C1C0000, // 003C CALL R7 0 + 0x8C200F18, // 003D GETMET R8 R7 K24 + 0x5C280A00, // 003E MOVE R10 R5 + 0x7C200400, // 003F CALL R8 2 + 0x8C200F19, // 0040 GETMET R8 R7 K25 + 0x7C200200, // 0041 CALL R8 1 + 0x542600C7, // 0042 LDINT R9 200 + 0x20241009, // 0043 NE R9 R8 R9 + 0x78260004, // 0044 JMPF R9 #004A + 0x8C240512, // 0045 GETMET R9 R2 K18 + 0x582C001A, // 0046 LDCONST R11 K26 + 0x5C301000, // 0047 MOVE R12 R8 + 0x7C240600, // 0048 CALL R9 3 + 0xB0063609, // 0049 RAISE 1 K27 R9 + 0x8C240F1C, // 004A GETMET R9 R7 K28 + 0x5C2C0C00, // 004B MOVE R11 R6 + 0x7C240400, // 004C CALL R9 2 + 0x8C240F1D, // 004D GETMET R9 R7 K29 + 0x7C240200, // 004E CALL R9 1 + 0x8C14010A, // 004F GETMET R5 R0 K10 + 0x7C140200, // 0050 CALL R5 1 + 0x8C14030B, // 0051 GETMET R5 R1 K11 + 0x581C000C, // 0052 LDCONST R7 K12 + 0x7C140400, // 0053 CALL R5 2 + 0x70020000, // 0054 JMP #0056 + 0xB0063D1F, // 0055 RAISE 1 K30 K31 + 0xA8040001, // 0056 EXBLK 1 1 + 0x7002001B, // 0057 JMP #0074 + 0xAC100002, // 0058 CATCH R4 0 2 + 0x70020018, // 0059 JMP #0073 + 0x60180001, // 005A GETGBL R6 G1 + 0x8C1C0512, // 005B GETMET R7 R2 K18 + 0x58240020, // 005C LDCONST R9 K32 + 0x5C280800, // 005D MOVE R10 R4 + 0x5C2C0A00, // 005E MOVE R11 R5 + 0x7C1C0800, // 005F CALL R7 4 + 0x7C180200, // 0060 CALL R6 1 + 0x8C180321, // 0061 GETMET R6 R1 K33 + 0x58200022, // 0062 LDCONST R8 K34 + 0x7C180400, // 0063 CALL R6 2 + 0x8C180323, // 0064 GETMET R6 R1 K35 + 0x7C180200, // 0065 CALL R6 1 + 0x8C180324, // 0066 GETMET R6 R1 K36 + 0x8C200512, // 0067 GETMET R8 R2 K18 + 0x58280025, // 0068 LDCONST R10 K37 + 0x5C2C0800, // 0069 MOVE R11 R4 + 0x5C300A00, // 006A MOVE R12 R5 + 0x7C200800, // 006B CALL R8 4 + 0x7C180400, // 006C CALL R6 2 + 0x8C180326, // 006D GETMET R6 R1 K38 + 0x88200327, // 006E GETMBR R8 R1 K39 + 0x7C180400, // 006F CALL R6 2 + 0x8C180328, // 0070 GETMET R6 R1 K40 + 0x7C180200, // 0071 CALL R6 1 + 0x70020000, // 0072 JMP #0074 + 0xB0080000, // 0073 RAISE 2 R0 R0 + 0x80000000, // 0074 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: autoexec +********************************************************************/ +be_local_closure(Autoconf_autoexec, /* name */ + be_nested_proto( + 9, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[32]) { /* constants */ + /* K0 */ be_nested_str(_archive), + /* K1 */ be_nested_str(path), + /* K2 */ be_nested_str(_X23init_X2Ebat), + /* K3 */ be_nested_str(is_first_time), + /* K4 */ be_nested_str(exists), + /* K5 */ be_nested_str(set_first_time), + /* K6 */ be_nested_str(run_bat), + /* K7 */ be_nested_str(tasmota), + /* K8 */ be_nested_str(log), + /* K9 */ be_nested_str(CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str(cmd), + /* K12 */ be_nested_str(Restart_X201), + /* K13 */ be_nested_str(_X23display_X2Eini), + /* K14 */ be_nested_str(gpio), + /* K15 */ be_nested_str(pin_used), + /* K16 */ be_nested_str(OPTION_A), + /* K17 */ be_nested_str(display_X2Eini), + /* K18 */ be_nested_str(CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem), + /* K19 */ be_nested_str(display), + /* K20 */ be_nested_str(r), + /* K21 */ be_nested_str(read), + /* K22 */ be_nested_str(close), + /* K23 */ be_nested_str(start), + /* K24 */ be_nested_str(_X23autoexec_X2Ebat), + /* K25 */ be_nested_str(CFG_X3A_X20running_X20), + /* K26 */ be_const_int(3), + /* K27 */ be_nested_str(CFG_X3A_X20ran_X20_X20), + /* K28 */ be_nested_str(_X23autoexec_X2Ebe), + /* K29 */ be_nested_str(CFG_X3A_X20loading_X20), + /* K30 */ be_nested_str(load), + /* K31 */ be_nested_str(CFG_X3A_X20loaded_X20_X20), + }), + &be_const_str_autoexec, + &be_const_str_solidified, + ( &(const binstruction[107]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x4C080000, // 0001 LDNIL R2 + 0x1C040202, // 0002 EQ R1 R1 R2 + 0x78060000, // 0003 JMPF R1 #0005 + 0x80000200, // 0004 RET 0 + 0xA4060200, // 0005 IMPORT R1 K1 + 0x88080100, // 0006 GETMBR R2 R0 K0 + 0x00080502, // 0007 ADD R2 R2 K2 + 0x8C0C0103, // 0008 GETMET R3 R0 K3 + 0x7C0C0200, // 0009 CALL R3 1 + 0x780E0012, // 000A JMPF R3 #001E + 0x8C0C0304, // 000B GETMET R3 R1 K4 + 0x5C140400, // 000C MOVE R5 R2 + 0x7C0C0400, // 000D CALL R3 2 + 0x780E000E, // 000E JMPF R3 #001E + 0x8C0C0105, // 000F GETMET R3 R0 K5 + 0x7C0C0200, // 0010 CALL R3 1 + 0x8C0C0106, // 0011 GETMET R3 R0 K6 + 0x5C140400, // 0012 MOVE R5 R2 + 0x7C0C0400, // 0013 CALL R3 2 + 0xB80E0E00, // 0014 GETNGBL R3 K7 + 0x8C0C0708, // 0015 GETMET R3 R3 K8 + 0x58140009, // 0016 LDCONST R5 K9 + 0x5818000A, // 0017 LDCONST R6 K10 + 0x7C0C0600, // 0018 CALL R3 3 + 0xB80E0E00, // 0019 GETNGBL R3 K7 + 0x8C0C070B, // 001A GETMET R3 R3 K11 + 0x5814000C, // 001B LDCONST R5 K12 + 0x7C0C0400, // 001C CALL R3 2 + 0x80000600, // 001D RET 0 + 0x880C0100, // 001E GETMBR R3 R0 K0 + 0x000C070D, // 001F ADD R3 R3 K13 + 0x5C080600, // 0020 MOVE R2 R3 + 0xB80E1C00, // 0021 GETNGBL R3 K14 + 0x8C0C070F, // 0022 GETMET R3 R3 K15 + 0xB8161C00, // 0023 GETNGBL R5 K14 + 0x88140B10, // 0024 GETMBR R5 R5 K16 + 0x5818000A, // 0025 LDCONST R6 K10 + 0x7C0C0600, // 0026 CALL R3 3 + 0x780E0019, // 0027 JMPF R3 #0042 + 0x8C0C0304, // 0028 GETMET R3 R1 K4 + 0x5C140400, // 0029 MOVE R5 R2 + 0x7C0C0400, // 002A CALL R3 2 + 0x780E0015, // 002B JMPF R3 #0042 + 0x8C0C0304, // 002C GETMET R3 R1 K4 + 0x58140011, // 002D LDCONST R5 K17 + 0x7C0C0400, // 002E CALL R3 2 + 0x780E0005, // 002F JMPF R3 #0036 + 0xB80E0E00, // 0030 GETNGBL R3 K7 + 0x8C0C0708, // 0031 GETMET R3 R3 K8 + 0x58140012, // 0032 LDCONST R5 K18 + 0x5818000A, // 0033 LDCONST R6 K10 + 0x7C0C0600, // 0034 CALL R3 3 + 0x7002000B, // 0035 JMP #0042 + 0xA40E2600, // 0036 IMPORT R3 K19 + 0x60100011, // 0037 GETGBL R4 G17 + 0x5C140400, // 0038 MOVE R5 R2 + 0x58180014, // 0039 LDCONST R6 K20 + 0x7C100400, // 003A CALL R4 2 + 0x8C140915, // 003B GETMET R5 R4 K21 + 0x7C140200, // 003C CALL R5 1 + 0x8C180916, // 003D GETMET R6 R4 K22 + 0x7C180200, // 003E CALL R6 1 + 0x8C180717, // 003F GETMET R6 R3 K23 + 0x5C200A00, // 0040 MOVE R8 R5 + 0x7C180400, // 0041 CALL R6 2 + 0x880C0100, // 0042 GETMBR R3 R0 K0 + 0x000C0718, // 0043 ADD R3 R3 K24 + 0x5C080600, // 0044 MOVE R2 R3 + 0x8C0C0304, // 0045 GETMET R3 R1 K4 + 0x5C140400, // 0046 MOVE R5 R2 + 0x7C0C0400, // 0047 CALL R3 2 + 0x780E000C, // 0048 JMPF R3 #0056 + 0xB80E0E00, // 0049 GETNGBL R3 K7 + 0x8C0C0708, // 004A GETMET R3 R3 K8 + 0x00163202, // 004B ADD R5 K25 R2 + 0x5818001A, // 004C LDCONST R6 K26 + 0x7C0C0600, // 004D CALL R3 3 + 0x8C0C0106, // 004E GETMET R3 R0 K6 + 0x5C140400, // 004F MOVE R5 R2 + 0x7C0C0400, // 0050 CALL R3 2 + 0xB80E0E00, // 0051 GETNGBL R3 K7 + 0x8C0C0708, // 0052 GETMET R3 R3 K8 + 0x00163602, // 0053 ADD R5 K27 R2 + 0x5818001A, // 0054 LDCONST R6 K26 + 0x7C0C0600, // 0055 CALL R3 3 + 0x880C0100, // 0056 GETMBR R3 R0 K0 + 0x000C071C, // 0057 ADD R3 R3 K28 + 0x5C080600, // 0058 MOVE R2 R3 + 0x8C0C0304, // 0059 GETMET R3 R1 K4 + 0x5C140400, // 005A MOVE R5 R2 + 0x7C0C0400, // 005B CALL R3 2 + 0x780E000C, // 005C JMPF R3 #006A + 0xB80E0E00, // 005D GETNGBL R3 K7 + 0x8C0C0708, // 005E GETMET R3 R3 K8 + 0x00163A02, // 005F ADD R5 K29 R2 + 0x5818001A, // 0060 LDCONST R6 K26 + 0x7C0C0600, // 0061 CALL R3 3 + 0xB80E3C00, // 0062 GETNGBL R3 K30 + 0x5C100400, // 0063 MOVE R4 R2 + 0x7C0C0200, // 0064 CALL R3 1 + 0xB80E0E00, // 0065 GETNGBL R3 K7 + 0x8C0C0708, // 0066 GETMET R3 R3 K8 + 0x00163E02, // 0067 ADD R5 K31 R2 + 0x5818001A, // 0068 LDCONST R6 K26 + 0x7C0C0600, // 0069 CALL R3 3 + 0x80000000, // 006A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: run_bat +********************************************************************/ +be_local_closure(Autoconf_run_bat, /* name */ + be_nested_proto( + 13, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(r), + /* K2 */ be_nested_str(readline), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str(_X0A), + /* K5 */ be_nested_str(tasmota), + /* K6 */ be_nested_str(cmd), + /* K7 */ be_nested_str(close), + /* K8 */ be_nested_str(format), + /* K9 */ be_nested_str(CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29), + }), + &be_const_str_run_bat, + &be_const_str_solidified, + ( &(const binstruction[54]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0xA8020023, // 0002 EXBLK 0 #0027 + 0x60100011, // 0003 GETGBL R4 G17 + 0x5C140200, // 0004 MOVE R5 R1 + 0x58180001, // 0005 LDCONST R6 K1 + 0x7C100400, // 0006 CALL R4 2 + 0x5C0C0800, // 0007 MOVE R3 R4 + 0x50100200, // 0008 LDBOOL R4 1 0 + 0x78120018, // 0009 JMPF R4 #0023 + 0x8C100702, // 000A GETMET R4 R3 K2 + 0x7C100200, // 000B CALL R4 1 + 0x6014000C, // 000C GETGBL R5 G12 + 0x5C180800, // 000D MOVE R6 R4 + 0x7C140200, // 000E CALL R5 1 + 0x1C140B03, // 000F EQ R5 R5 K3 + 0x78160000, // 0010 JMPF R5 #0012 + 0x70020010, // 0011 JMP #0023 + 0x5415FFFE, // 0012 LDINT R5 -1 + 0x94140805, // 0013 GETIDX R5 R4 R5 + 0x1C140B04, // 0014 EQ R5 R5 K4 + 0x78160002, // 0015 JMPF R5 #0019 + 0x5415FFFD, // 0016 LDINT R5 -2 + 0x40160605, // 0017 CONNECT R5 K3 R5 + 0x94100805, // 0018 GETIDX R4 R4 R5 + 0x6014000C, // 0019 GETGBL R5 G12 + 0x5C180800, // 001A MOVE R6 R4 + 0x7C140200, // 001B CALL R5 1 + 0x24140B03, // 001C GT R5 R5 K3 + 0x78160003, // 001D JMPF R5 #0022 + 0xB8160A00, // 001E GETNGBL R5 K5 + 0x8C140B06, // 001F GETMET R5 R5 K6 + 0x5C1C0800, // 0020 MOVE R7 R4 + 0x7C140400, // 0021 CALL R5 2 + 0x7001FFE4, // 0022 JMP #0008 + 0x8C100707, // 0023 GETMET R4 R3 K7 + 0x7C100200, // 0024 CALL R4 1 + 0xA8040001, // 0025 EXBLK 1 1 + 0x7002000D, // 0026 JMP #0035 + 0xAC100002, // 0027 CATCH R4 0 2 + 0x7002000A, // 0028 JMP #0034 + 0x60180001, // 0029 GETGBL R6 G1 + 0x8C1C0508, // 002A GETMET R7 R2 K8 + 0x58240009, // 002B LDCONST R9 K9 + 0x5C280200, // 002C MOVE R10 R1 + 0x5C2C0800, // 002D MOVE R11 R4 + 0x5C300A00, // 002E MOVE R12 R5 + 0x7C1C0A00, // 002F CALL R7 5 + 0x7C180200, // 0030 CALL R6 1 + 0x8C180707, // 0031 GETMET R6 R3 K7 + 0x7C180200, // 0032 CALL R6 1 + 0x70020000, // 0033 JMP #0035 + 0xB0080000, // 0034 RAISE 2 R0 R0 + 0x80000000, // 0035 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: page_autoconf_mgr +********************************************************************/ +be_local_closure(Autoconf_page_autoconf_mgr, /* name */ + be_nested_proto( + 19, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[39]) { /* constants */ + /* K0 */ be_nested_str(webserver), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(check_privileged_access), + /* K3 */ be_nested_str(content_start), + /* K4 */ be_nested_str(Auto_X2Dconfiguration), + /* K5 */ be_nested_str(content_send_style), + /* K6 */ be_nested_str(content_send), + /* K7 */ be_nested_str(_X3Cp_X3E_X3Csmall_X3E_X26nbsp_X3B_X28This_X20feature_X20requires_X20an_X20internet_X20connection_X29_X3C_X2Fsmall_X3E_X3C_X2Fp_X3E), + /* K8 */ be_nested_str(get_current_module_path), + /* K9 */ be_nested_str(tr), + /* K10 */ be_nested_str(get_current_module_name), + /* K11 */ be_nested_str(_), + /* K12 */ be_nested_str(_X20), + /* K13 */ be_nested_str(_error), + /* K14 */ be_nested_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B), + /* K15 */ be_nested_str(_X26lt_X3BNone_X26gt_X3B), + /* K16 */ be_nested_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E), + /* K17 */ be_nested_str(format), + /* K18 */ be_nested_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E), + /* K19 */ be_nested_str(_X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E), + /* K20 */ be_nested_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20), + /* K21 */ be_nested_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E), + /* K22 */ be_nested_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E), + /* K23 */ be_nested_str(_X3C_X2Fform_X3E_X3C_X2Fp_X3E), + /* K24 */ be_nested_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E), + /* K25 */ be_nested_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E), + /* K26 */ be_nested_str(_X3Cp_X3E_X3Cform_X20id_X3Dzip_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20), + /* K27 */ be_nested_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E), + /* K28 */ be_nested_str(_X3Clabel_X3EChoose_X20a_X20device_X20configuration_X3A_X3C_X2Flabel_X3E_X3Cbr_X3E), + /* K29 */ be_nested_str(_X3Cselect_X20name_X3D_X27zip_X27_X3E), + /* K30 */ be_nested_str(load_templates), + /* K31 */ be_nested_str(_X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E), + /* K32 */ be_nested_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E), + /* K33 */ be_nested_str(stop_iteration), + /* K34 */ be_nested_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E), + /* K35 */ be_nested_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E), + /* K36 */ be_nested_str(content_button), + /* K37 */ be_nested_str(BUTTON_CONFIGURATION), + /* K38 */ be_nested_str(content_stop), + }), + &be_const_str_page_autoconf_mgr, + &be_const_str_solidified, + ( &(const binstruction[124]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x8C0C0302, // 0002 GETMET R3 R1 K2 + 0x7C0C0200, // 0003 CALL R3 1 + 0x740E0001, // 0004 JMPT R3 #0007 + 0x4C0C0000, // 0005 LDNIL R3 + 0x80040600, // 0006 RET 1 R3 + 0x8C0C0303, // 0007 GETMET R3 R1 K3 + 0x58140004, // 0008 LDCONST R5 K4 + 0x7C0C0400, // 0009 CALL R3 2 + 0x8C0C0305, // 000A GETMET R3 R1 K5 + 0x7C0C0200, // 000B CALL R3 1 + 0x8C0C0306, // 000C GETMET R3 R1 K6 + 0x58140007, // 000D LDCONST R5 K7 + 0x7C0C0400, // 000E CALL R3 2 + 0x8C0C0108, // 000F GETMET R3 R0 K8 + 0x7C0C0200, // 0010 CALL R3 1 + 0x780E0006, // 0011 JMPF R3 #0019 + 0x8C100509, // 0012 GETMET R4 R2 K9 + 0x8C18010A, // 0013 GETMET R6 R0 K10 + 0x7C180200, // 0014 CALL R6 1 + 0x581C000B, // 0015 LDCONST R7 K11 + 0x5820000C, // 0016 LDCONST R8 K12 + 0x7C100800, // 0017 CALL R4 4 + 0x70020004, // 0018 JMP #001E + 0x8810010D, // 0019 GETMBR R4 R0 K13 + 0x78120001, // 001A JMPF R4 #001D + 0x5810000E, // 001B LDCONST R4 K14 + 0x70020000, // 001C JMP #001E + 0x5810000F, // 001D LDCONST R4 K15 + 0x8C140306, // 001E GETMET R5 R1 K6 + 0x581C0010, // 001F LDCONST R7 K16 + 0x7C140400, // 0020 CALL R5 2 + 0x8C140306, // 0021 GETMET R5 R1 K6 + 0x8C1C0511, // 0022 GETMET R7 R2 K17 + 0x58240012, // 0023 LDCONST R9 K18 + 0x7C1C0400, // 0024 CALL R7 2 + 0x7C140400, // 0025 CALL R5 2 + 0x8C140306, // 0026 GETMET R5 R1 K6 + 0x8C1C0511, // 0027 GETMET R7 R2 K17 + 0x58240013, // 0028 LDCONST R9 K19 + 0x5C280800, // 0029 MOVE R10 R4 + 0x7C1C0600, // 002A CALL R7 3 + 0x7C140400, // 002B CALL R5 2 + 0x780E000B, // 002C JMPF R3 #0039 + 0x8C140306, // 002D GETMET R5 R1 K6 + 0x581C0014, // 002E LDCONST R7 K20 + 0x7C140400, // 002F CALL R5 2 + 0x8C140306, // 0030 GETMET R5 R1 K6 + 0x581C0015, // 0031 LDCONST R7 K21 + 0x7C140400, // 0032 CALL R5 2 + 0x8C140306, // 0033 GETMET R5 R1 K6 + 0x581C0016, // 0034 LDCONST R7 K22 + 0x7C140400, // 0035 CALL R5 2 + 0x8C140306, // 0036 GETMET R5 R1 K6 + 0x581C0017, // 0037 LDCONST R7 K23 + 0x7C140400, // 0038 CALL R5 2 + 0x8C140306, // 0039 GETMET R5 R1 K6 + 0x581C0018, // 003A LDCONST R7 K24 + 0x7C140400, // 003B CALL R5 2 + 0x8C140306, // 003C GETMET R5 R1 K6 + 0x581C0010, // 003D LDCONST R7 K16 + 0x7C140400, // 003E CALL R5 2 + 0x8C140306, // 003F GETMET R5 R1 K6 + 0x8C1C0511, // 0040 GETMET R7 R2 K17 + 0x58240019, // 0041 LDCONST R9 K25 + 0x7C1C0400, // 0042 CALL R7 2 + 0x7C140400, // 0043 CALL R5 2 + 0x8C140306, // 0044 GETMET R5 R1 K6 + 0x581C001A, // 0045 LDCONST R7 K26 + 0x7C140400, // 0046 CALL R5 2 + 0x8C140306, // 0047 GETMET R5 R1 K6 + 0x581C001B, // 0048 LDCONST R7 K27 + 0x7C140400, // 0049 CALL R5 2 + 0x8C140306, // 004A GETMET R5 R1 K6 + 0x581C001C, // 004B LDCONST R7 K28 + 0x7C140400, // 004C CALL R5 2 + 0x8C140306, // 004D GETMET R5 R1 K6 + 0x581C001D, // 004E LDCONST R7 K29 + 0x7C140400, // 004F CALL R5 2 + 0x8C14011E, // 0050 GETMET R5 R0 K30 + 0x7C140200, // 0051 CALL R5 1 + 0x8C180306, // 0052 GETMET R6 R1 K6 + 0x5820001F, // 0053 LDCONST R8 K31 + 0x7C180400, // 0054 CALL R6 2 + 0x60180010, // 0055 GETGBL R6 G16 + 0x5C1C0A00, // 0056 MOVE R7 R5 + 0x7C180200, // 0057 CALL R6 1 + 0xA802000D, // 0058 EXBLK 0 #0067 + 0x5C1C0C00, // 0059 MOVE R7 R6 + 0x7C1C0000, // 005A CALL R7 0 + 0x8C200306, // 005B GETMET R8 R1 K6 + 0x8C280511, // 005C GETMET R10 R2 K17 + 0x58300020, // 005D LDCONST R12 K32 + 0x5C340E00, // 005E MOVE R13 R7 + 0x8C380509, // 005F GETMET R14 R2 K9 + 0x5C400E00, // 0060 MOVE R16 R7 + 0x5844000B, // 0061 LDCONST R17 K11 + 0x5848000C, // 0062 LDCONST R18 K12 + 0x7C380800, // 0063 CALL R14 4 + 0x7C280800, // 0064 CALL R10 4 + 0x7C200400, // 0065 CALL R8 2 + 0x7001FFF1, // 0066 JMP #0059 + 0x58180021, // 0067 LDCONST R6 K33 + 0xAC180200, // 0068 CATCH R6 1 0 + 0xB0080000, // 0069 RAISE 2 R0 R0 + 0x8C180306, // 006A GETMET R6 R1 K6 + 0x58200022, // 006B LDCONST R8 K34 + 0x7C180400, // 006C CALL R6 2 + 0x8C180306, // 006D GETMET R6 R1 K6 + 0x58200023, // 006E LDCONST R8 K35 + 0x7C180400, // 006F CALL R6 2 + 0x8C180306, // 0070 GETMET R6 R1 K6 + 0x58200017, // 0071 LDCONST R8 K23 + 0x7C180400, // 0072 CALL R6 2 + 0x8C180306, // 0073 GETMET R6 R1 K6 + 0x58200018, // 0074 LDCONST R8 K24 + 0x7C180400, // 0075 CALL R6 2 + 0x8C180324, // 0076 GETMET R6 R1 K36 + 0x88200325, // 0077 GETMBR R8 R1 K37 + 0x7C180400, // 0078 CALL R6 2 + 0x8C180326, // 0079 GETMET R6 R1 K38 + 0x7C180200, // 007A CALL R6 1 + 0x80000000, // 007B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_current_module_name +********************************************************************/ +be_local_closure(Autoconf_get_current_module_name, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(_archive), + /* K1 */ be_const_int(0), + }), + &be_const_str_get_current_module_name, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x5405FFF5, // 0000 LDINT R1 -10 + 0x40060201, // 0001 CONNECT R1 K1 R1 + 0x88080100, // 0002 GETMBR R2 R0 K0 + 0x94040401, // 0003 GETIDX R1 R2 R1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: delete_all_configs +********************************************************************/ +be_local_closure(Autoconf_delete_all_configs, /* name */ + be_nested_proto( + 10, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str(path), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(listdir), + /* K3 */ be_nested_str(_X2F), + /* K4 */ be_nested_str(find), + /* K5 */ be_nested_str(_X2Eautoconf), + /* K6 */ be_const_int(0), + /* K7 */ be_nested_str(remove), + /* K8 */ be_nested_str(stop_iteration), + }), + &be_const_str_delete_all_configs, + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x8C0C0302, // 0002 GETMET R3 R1 K2 + 0x58140003, // 0003 LDCONST R5 K3 + 0x7C0C0400, // 0004 CALL R3 2 + 0x60100010, // 0005 GETGBL R4 G16 + 0x5C140600, // 0006 MOVE R5 R3 + 0x7C100200, // 0007 CALL R4 1 + 0xA802000B, // 0008 EXBLK 0 #0015 + 0x5C140800, // 0009 MOVE R5 R4 + 0x7C140000, // 000A CALL R5 0 + 0x8C180504, // 000B GETMET R6 R2 K4 + 0x5C200A00, // 000C MOVE R8 R5 + 0x58240005, // 000D LDCONST R9 K5 + 0x7C180600, // 000E CALL R6 3 + 0x24180D06, // 000F GT R6 R6 K6 + 0x781A0002, // 0010 JMPF R6 #0014 + 0x8C180307, // 0011 GETMET R6 R1 K7 + 0x5C200A00, // 0012 MOVE R8 R5 + 0x7C180400, // 0013 CALL R6 2 + 0x7001FFF3, // 0014 JMP #0009 + 0x58100008, // 0015 LDCONST R4 K8 + 0xAC100200, // 0016 CATCH R4 1 0 + 0xB0080000, // 0017 RAISE 2 R0 R0 + 0x80000000, // 0018 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_first_time +********************************************************************/ +be_local_closure(Autoconf_set_first_time, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(_X2F_X2Eautoconf), + /* K1 */ be_nested_str(w), + /* K2 */ be_nested_str(close), + }), + &be_const_str_set_first_time, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x60040011, // 0000 GETGBL R1 G17 + 0x58080000, // 0001 LDCONST R2 K0 + 0x580C0001, // 0002 LDCONST R3 K1 + 0x7C040400, // 0003 CALL R1 2 + 0x8C080302, // 0004 GETMET R2 R1 K2 + 0x7C080200, // 0005 CALL R2 1 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: load_templates +********************************************************************/ +be_local_closure(Autoconf_load_templates, /* name */ + be_nested_proto( + 15, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[21]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(json), + /* K2 */ be_nested_str(format), + /* K3 */ be_nested_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson), + /* K4 */ be_nested_str(tasmota), + /* K5 */ be_nested_str(arch), + /* K6 */ be_nested_str(log), + /* K7 */ be_nested_str(CFG_X3A_X20loading_X20_X27_X25s_X27), + /* K8 */ be_const_int(3), + /* K9 */ be_nested_str(webclient), + /* K10 */ be_nested_str(begin), + /* K11 */ be_nested_str(GET), + /* K12 */ be_nested_str(CFG_X3A_X20return_code_X3D_X25i), + /* K13 */ be_const_int(2), + /* K14 */ be_nested_str(get_string), + /* K15 */ be_nested_str(close), + /* K16 */ be_nested_str(load), + /* K17 */ be_nested_str(CFG_X3A_X20loaded_X20_X27_X25s_X27), + /* K18 */ be_nested_str(find), + /* K19 */ be_nested_str(files), + /* K20 */ be_nested_str(CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27), + }), + &be_const_str_load_templates, + &be_const_str_solidified, + ( &(const binstruction[86]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0xA8020042, // 0002 EXBLK 0 #0046 + 0x8C0C0302, // 0003 GETMET R3 R1 K2 + 0x58140003, // 0004 LDCONST R5 K3 + 0xB81A0800, // 0005 GETNGBL R6 K4 + 0x8C180D05, // 0006 GETMET R6 R6 K5 + 0x7C180200, // 0007 CALL R6 1 + 0x7C0C0600, // 0008 CALL R3 3 + 0xB8120800, // 0009 GETNGBL R4 K4 + 0x8C100906, // 000A GETMET R4 R4 K6 + 0x8C180302, // 000B GETMET R6 R1 K2 + 0x58200007, // 000C LDCONST R8 K7 + 0x5C240600, // 000D MOVE R9 R3 + 0x7C180600, // 000E CALL R6 3 + 0x581C0008, // 000F LDCONST R7 K8 + 0x7C100600, // 0010 CALL R4 3 + 0xB8121200, // 0011 GETNGBL R4 K9 + 0x7C100000, // 0012 CALL R4 0 + 0x8C14090A, // 0013 GETMET R5 R4 K10 + 0x5C1C0600, // 0014 MOVE R7 R3 + 0x7C140400, // 0015 CALL R5 2 + 0x8C14090B, // 0016 GETMET R5 R4 K11 + 0x7C140200, // 0017 CALL R5 1 + 0x541A00C7, // 0018 LDINT R6 200 + 0x20180A06, // 0019 NE R6 R5 R6 + 0x781A000A, // 001A JMPF R6 #0026 + 0xB81A0800, // 001B GETNGBL R6 K4 + 0x8C180D06, // 001C GETMET R6 R6 K6 + 0x8C200302, // 001D GETMET R8 R1 K2 + 0x5828000C, // 001E LDCONST R10 K12 + 0x5C2C0A00, // 001F MOVE R11 R5 + 0x7C200600, // 0020 CALL R8 3 + 0x5824000D, // 0021 LDCONST R9 K13 + 0x7C180600, // 0022 CALL R6 3 + 0x4C180000, // 0023 LDNIL R6 + 0xA8040001, // 0024 EXBLK 1 1 + 0x80040C00, // 0025 RET 1 R6 + 0x8C18090E, // 0026 GETMET R6 R4 K14 + 0x7C180200, // 0027 CALL R6 1 + 0x8C1C090F, // 0028 GETMET R7 R4 K15 + 0x7C1C0200, // 0029 CALL R7 1 + 0x8C1C0510, // 002A GETMET R7 R2 K16 + 0x5C240C00, // 002B MOVE R9 R6 + 0x7C1C0400, // 002C CALL R7 2 + 0xB8220800, // 002D GETNGBL R8 K4 + 0x8C201106, // 002E GETMET R8 R8 K6 + 0x8C280302, // 002F GETMET R10 R1 K2 + 0x58300011, // 0030 LDCONST R12 K17 + 0x60340008, // 0031 GETGBL R13 G8 + 0x5C380E00, // 0032 MOVE R14 R7 + 0x7C340200, // 0033 CALL R13 1 + 0x7C280600, // 0034 CALL R10 3 + 0x582C0008, // 0035 LDCONST R11 K8 + 0x7C200600, // 0036 CALL R8 3 + 0x8C200F12, // 0037 GETMET R8 R7 K18 + 0x58280013, // 0038 LDCONST R10 K19 + 0x7C200400, // 0039 CALL R8 2 + 0x6024000F, // 003A GETGBL R9 G15 + 0x5C281000, // 003B MOVE R10 R8 + 0x602C0012, // 003C GETGBL R11 G18 + 0x7C240400, // 003D CALL R9 2 + 0x78260001, // 003E JMPF R9 #0041 + 0xA8040001, // 003F EXBLK 1 1 + 0x80041000, // 0040 RET 1 R8 + 0x4C240000, // 0041 LDNIL R9 + 0xA8040001, // 0042 EXBLK 1 1 + 0x80041200, // 0043 RET 1 R9 + 0xA8040001, // 0044 EXBLK 1 1 + 0x7002000E, // 0045 JMP #0055 + 0xAC0C0002, // 0046 CATCH R3 0 2 + 0x7002000B, // 0047 JMP #0054 + 0xB8160800, // 0048 GETNGBL R5 K4 + 0x8C140B06, // 0049 GETMET R5 R5 K6 + 0x8C1C0302, // 004A GETMET R7 R1 K2 + 0x58240014, // 004B LDCONST R9 K20 + 0x5C280600, // 004C MOVE R10 R3 + 0x5C2C0800, // 004D MOVE R11 R4 + 0x7C1C0800, // 004E CALL R7 4 + 0x5820000D, // 004F LDCONST R8 K13 + 0x7C140600, // 0050 CALL R5 3 + 0x4C140000, // 0051 LDNIL R5 + 0x80040A00, // 0052 RET 1 R5 + 0x70020000, // 0053 JMP #0055 + 0xB0080000, // 0054 RAISE 2 R0 R0 + 0x80000000, // 0055 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: web_add_config_button +********************************************************************/ +be_local_closure(Autoconf_web_add_config_button, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(webserver), + /* K1 */ be_nested_str(content_send), + /* K2 */ be_nested_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E), + }), + &be_const_str_web_add_config_button, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x58100002, // 0002 LDCONST R4 K2 + 0x7C080400, // 0003 CALL R2 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: is_first_time +********************************************************************/ +be_local_closure(Autoconf_is_first_time, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(path), + /* K1 */ be_nested_str(exists), + /* K2 */ be_nested_str(_X2F_X2Eautoconf), + }), + &be_const_str_is_first_time, + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x58100002, // 0002 LDCONST R4 K2 + 0x7C080400, // 0003 CALL R2 2 + 0x780A0000, // 0004 JMPF R2 #0006 + 0x50080001, // 0005 LDBOOL R2 0 1 + 0x50080200, // 0006 LDBOOL R2 1 0 + 0x80040400, // 0007 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Autoconf_init, /* name */ + be_nested_proto( + 12, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[17]) { /* constants */ + /* K0 */ be_nested_str(path), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(listdir), + /* K3 */ be_nested_str(_X2F), + /* K4 */ be_nested_str(tasmota), + /* K5 */ be_nested_str(add_driver), + /* K6 */ be_const_int(0), + /* K7 */ be_nested_str(find), + /* K8 */ be_nested_str(_X2Eautoconf), + /* K9 */ be_nested_str(format), + /* K10 */ be_nested_str(CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29), + /* K11 */ be_nested_str(_error), + /* K12 */ be_const_int(1), + /* K13 */ be_nested_str(log), + /* K14 */ be_nested_str(CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found), + /* K15 */ be_const_int(2), + /* K16 */ be_nested_str(_archive), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[51]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x8C0C0302, // 0002 GETMET R3 R1 K2 + 0x58140003, // 0003 LDCONST R5 K3 + 0x7C0C0400, // 0004 CALL R3 2 + 0x4C100000, // 0005 LDNIL R4 + 0xB8160800, // 0006 GETNGBL R5 K4 + 0x8C140B05, // 0007 GETMET R5 R5 K5 + 0x5C1C0000, // 0008 MOVE R7 R0 + 0x7C140400, // 0009 CALL R5 2 + 0x58140006, // 000A LDCONST R5 K6 + 0x6018000C, // 000B GETGBL R6 G12 + 0x5C1C0600, // 000C MOVE R7 R3 + 0x7C180200, // 000D CALL R6 1 + 0x14180A06, // 000E LT R6 R5 R6 + 0x781A0016, // 000F JMPF R6 #0027 + 0x8C180507, // 0010 GETMET R6 R2 K7 + 0x94200605, // 0011 GETIDX R8 R3 R5 + 0x58240008, // 0012 LDCONST R9 K8 + 0x7C180600, // 0013 CALL R6 3 + 0x24180D06, // 0014 GT R6 R6 K6 + 0x781A000E, // 0015 JMPF R6 #0025 + 0x4C180000, // 0016 LDNIL R6 + 0x20180806, // 0017 NE R6 R4 R6 + 0x781A000A, // 0018 JMPF R6 #0024 + 0x60180001, // 0019 GETGBL R6 G1 + 0x8C1C0509, // 001A GETMET R7 R2 K9 + 0x5824000A, // 001B LDCONST R9 K10 + 0x5C280800, // 001C MOVE R10 R4 + 0x942C0605, // 001D GETIDX R11 R3 R5 + 0x7C1C0800, // 001E CALL R7 4 + 0x7C180200, // 001F CALL R6 1 + 0x50180200, // 0020 LDBOOL R6 1 0 + 0x90021606, // 0021 SETMBR R0 K11 R6 + 0x4C180000, // 0022 LDNIL R6 + 0x80040C00, // 0023 RET 1 R6 + 0x94100605, // 0024 GETIDX R4 R3 R5 + 0x00140B0C, // 0025 ADD R5 R5 K12 + 0x7001FFE3, // 0026 JMP #000B + 0x4C180000, // 0027 LDNIL R6 + 0x1C180806, // 0028 EQ R6 R4 R6 + 0x781A0006, // 0029 JMPF R6 #0031 + 0xB81A0800, // 002A GETNGBL R6 K4 + 0x8C180D0D, // 002B GETMET R6 R6 K13 + 0x5820000E, // 002C LDCONST R8 K14 + 0x5824000F, // 002D LDCONST R9 K15 + 0x7C180600, // 002E CALL R6 3 + 0x4C180000, // 002F LDNIL R6 + 0x80040C00, // 0030 RET 1 R6 + 0x90022004, // 0031 SETMBR R0 K16 R4 + 0x80000000, // 0032 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: preinit +********************************************************************/ +be_local_closure(Autoconf_preinit, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str(_archive), + /* K1 */ be_nested_str(path), + /* K2 */ be_nested_str(_X23preinit_X2Ebe), + /* K3 */ be_nested_str(exists), + /* K4 */ be_nested_str(tasmota), + /* K5 */ be_nested_str(log), + /* K6 */ be_nested_str(CFG_X3A_X20loading_X20), + /* K7 */ be_const_int(3), + /* K8 */ be_nested_str(load), + /* K9 */ be_nested_str(CFG_X3A_X20loaded_X20_X20), + }), + &be_const_str_preinit, + &be_const_str_solidified, + ( &(const binstruction[26]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x4C080000, // 0001 LDNIL R2 + 0x1C040202, // 0002 EQ R1 R1 R2 + 0x78060000, // 0003 JMPF R1 #0005 + 0x80000200, // 0004 RET 0 + 0xA4060200, // 0005 IMPORT R1 K1 + 0x88080100, // 0006 GETMBR R2 R0 K0 + 0x00080502, // 0007 ADD R2 R2 K2 + 0x8C0C0303, // 0008 GETMET R3 R1 K3 + 0x5C140400, // 0009 MOVE R5 R2 + 0x7C0C0400, // 000A CALL R3 2 + 0x780E000C, // 000B JMPF R3 #0019 + 0xB80E0800, // 000C GETNGBL R3 K4 + 0x8C0C0705, // 000D GETMET R3 R3 K5 + 0x00160C02, // 000E ADD R5 K6 R2 + 0x58180007, // 000F LDCONST R6 K7 + 0x7C0C0600, // 0010 CALL R3 3 + 0xB80E1000, // 0011 GETNGBL R3 K8 + 0x5C100400, // 0012 MOVE R4 R2 + 0x7C0C0200, // 0013 CALL R3 1 + 0xB80E0800, // 0014 GETNGBL R3 K4 + 0x8C0C0705, // 0015 GETMET R3 R3 K5 + 0x00161202, // 0016 ADD R5 K9 R2 + 0x58180007, // 0017 LDCONST R6 K7 + 0x7C0C0600, // 0018 CALL R3 3 + 0x80000000, // 0019 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: reset +********************************************************************/ +be_local_closure(Autoconf_reset, /* name */ + be_nested_proto( + 12, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[13]) { /* constants */ + /* K0 */ be_nested_str(path), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(listdir), + /* K3 */ be_nested_str(_X2F), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str(find), + /* K6 */ be_nested_str(_X2Eautoconf), + /* K7 */ be_nested_str(remove), + /* K8 */ be_nested_str(format), + /* K9 */ be_nested_str(CFG_X3A_X20removed_X20file_X20_X27_X25s_X27), + /* K10 */ be_const_int(1), + /* K11 */ be_nested_str(_archive), + /* K12 */ be_nested_str(_error), + }), + &be_const_str_reset, + &be_const_str_solidified, + ( &(const binstruction[35]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x8C0C0302, // 0002 GETMET R3 R1 K2 + 0x58140003, // 0003 LDCONST R5 K3 + 0x7C0C0400, // 0004 CALL R3 2 + 0x4C100000, // 0005 LDNIL R4 + 0x58140004, // 0006 LDCONST R5 K4 + 0x6018000C, // 0007 GETGBL R6 G12 + 0x5C1C0600, // 0008 MOVE R7 R3 + 0x7C180200, // 0009 CALL R6 1 + 0x14180A06, // 000A LT R6 R5 R6 + 0x781A0011, // 000B JMPF R6 #001E + 0x94180605, // 000C GETIDX R6 R3 R5 + 0x8C1C0505, // 000D GETMET R7 R2 K5 + 0x5C240C00, // 000E MOVE R9 R6 + 0x58280006, // 000F LDCONST R10 K6 + 0x7C1C0600, // 0010 CALL R7 3 + 0x241C0F04, // 0011 GT R7 R7 K4 + 0x781E0008, // 0012 JMPF R7 #001C + 0x8C1C0307, // 0013 GETMET R7 R1 K7 + 0x5C240C00, // 0014 MOVE R9 R6 + 0x7C1C0400, // 0015 CALL R7 2 + 0x601C0001, // 0016 GETGBL R7 G1 + 0x8C200508, // 0017 GETMET R8 R2 K8 + 0x58280009, // 0018 LDCONST R10 K9 + 0x5C2C0C00, // 0019 MOVE R11 R6 + 0x7C200600, // 001A CALL R8 3 + 0x7C1C0200, // 001B CALL R7 1 + 0x00140B0A, // 001C ADD R5 R5 K10 + 0x7001FFE8, // 001D JMP #0007 + 0x4C180000, // 001E LDNIL R6 + 0x90021606, // 001F SETMBR R0 K11 R6 + 0x4C180000, // 0020 LDNIL R6 + 0x90021806, // 0021 SETMBR R0 K12 R6 + 0x80000000, // 0022 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: web_add_handler +********************************************************************/ +be_local_closure(Autoconf_web_add_handler, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 2]) { + be_nested_proto( + 2, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(page_autoconf_mgr), + }), + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x68000000, // 0000 GETUPV R0 U0 + 0x8C000100, // 0001 GETMET R0 R0 K0 + 0x7C000200, // 0002 CALL R0 1 + 0x80040000, // 0003 RET 1 R0 + }) + ), + be_nested_proto( + 2, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(page_autoconf_ctl), + }), + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x68000000, // 0000 GETUPV R0 U0 + 0x8C000100, // 0001 GETMET R0 R0 K0 + 0x7C000200, // 0002 CALL R0 1 + 0x80040000, // 0003 RET 1 R0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(webserver), + /* K1 */ be_nested_str(on), + /* K2 */ be_nested_str(_X2Fac), + /* K3 */ be_nested_str(HTTP_GET), + /* K4 */ be_nested_str(HTTP_POST), + }), + &be_const_str_web_add_handler, + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x58100002, // 0002 LDCONST R4 K2 + 0x84140000, // 0003 CLOSURE R5 P0 + 0x88180303, // 0004 GETMBR R6 R1 K3 + 0x7C080800, // 0005 CALL R2 4 + 0x8C080301, // 0006 GETMET R2 R1 K1 + 0x58100002, // 0007 LDCONST R4 K2 + 0x84140001, // 0008 CLOSURE R5 P1 + 0x88180304, // 0009 GETMBR R6 R1 K4 + 0x7C080800, // 000A CALL R2 4 + 0xA0000000, // 000B CLOSE R0 + 0x80000000, // 000C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: clear_first_time +********************************************************************/ +be_local_closure(Autoconf_clear_first_time, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(path), + /* K1 */ be_nested_str(remove), + /* K2 */ be_nested_str(_X2F_X2Eautoconf), + }), + &be_const_str_clear_first_time, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x58100002, // 0002 LDCONST R4 K2 + 0x7C080400, // 0003 CALL R2 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_current_module_path +********************************************************************/ +be_local_closure(Autoconf_get_current_module_path, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(_archive), + }), + &be_const_str_get_current_module_path, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Autoconf +********************************************************************/ +be_local_class(Autoconf, + 2, + NULL, + be_nested_map(18, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(page_autoconf_ctl, -1), be_const_closure(Autoconf_page_autoconf_ctl_closure) }, + { be_const_key(autoexec, -1), be_const_closure(Autoconf_autoexec_closure) }, + { be_const_key(run_bat, 17), be_const_closure(Autoconf_run_bat_closure) }, + { be_const_key(page_autoconf_mgr, -1), be_const_closure(Autoconf_page_autoconf_mgr_closure) }, + { be_const_key(get_current_module_path, 13), be_const_closure(Autoconf_get_current_module_path_closure) }, + { be_const_key(preinit, -1), be_const_closure(Autoconf_preinit_closure) }, + { be_const_key(clear_first_time, -1), be_const_closure(Autoconf_clear_first_time_closure) }, + { be_const_key(load_templates, -1), be_const_closure(Autoconf_load_templates_closure) }, + { be_const_key(_archive, -1), be_const_var(0) }, + { be_const_key(web_add_config_button, -1), be_const_closure(Autoconf_web_add_config_button_closure) }, + { be_const_key(is_first_time, -1), be_const_closure(Autoconf_is_first_time_closure) }, + { be_const_key(web_add_handler, -1), be_const_closure(Autoconf_web_add_handler_closure) }, + { be_const_key(delete_all_configs, 4), be_const_closure(Autoconf_delete_all_configs_closure) }, + { be_const_key(reset, 5), be_const_closure(Autoconf_reset_closure) }, + { be_const_key(get_current_module_name, 11), be_const_closure(Autoconf_get_current_module_name_closure) }, + { be_const_key(init, 6), be_const_closure(Autoconf_init_closure) }, + { be_const_key(_error, -1), be_const_var(1) }, + { be_const_key(set_first_time, -1), be_const_closure(Autoconf_set_first_time_closure) }, + })), + be_str_literal("Autoconf") +); + +/******************************************************************** +** Solidified function: _anonymous_ +********************************************************************/ +be_local_closure(_anonymous_, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_const_class(be_class_Autoconf), + }), + &be_const_str__anonymous_, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x58040000, // 0000 LDCONST R1 K0 + 0xB4000000, // 0001 CLASS K0 + 0x5C080200, // 0002 MOVE R2 R1 + 0x7C080000, // 0003 CALL R2 0 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified module: autoconf +********************************************************************/ +be_local_module(autoconf, + "autoconf", + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(_anonymous__closure) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(autoconf); +/********************************************************************/ diff --git a/lib/libesp32/berry/default/be_crypto_lib.c b/lib/libesp32/berry/default/be_crypto_lib.c new file mode 100644 index 000000000..04a10b28e --- /dev/null +++ b/lib/libesp32/berry/default/be_crypto_lib.c @@ -0,0 +1,56 @@ +/******************************************************************** + * Berry module `webserver` + * + * To use: `import webserver` + * + * Allows to respond to HTTP request + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_ALEXA_AVS + +extern int m_aes_gcm_init(bvm *vm); +extern int m_aes_gcm_encryt(bvm *vm); +extern int m_aes_gcm_decryt(bvm *vm); +extern int m_aes_gcm_tag(bvm *vm); + +extern int m_ec_c25519_pubkey(bvm *vm); +extern int m_ec_c25519_sharedkey(bvm *vm); + +#include "../generate/be_fixed_be_class_aes_gcm.h" +#include "../generate/be_fixed_be_class_ec_c25519.h" + +void be_load_crypto_lib(bvm *vm) { + // insert the class GCM in module AES + be_newmodule(vm); + be_setname(vm, -1, "crypto"); + be_setglobal(vm, "crypto"); + + be_pushntvclass(vm, &be_class_aes_gcm); + be_setmember(vm, -2, "AES_GCM"); + be_pop(vm, 1); + + be_pushntvclass(vm, &be_class_ec_c25519); + be_setmember(vm, -2, "EC_C25519"); + be_pop(vm, 2); +} +/* @const_object_info_begin + +class be_class_aes_gcm (scope: global, name: AES_GCM) { + .p1, var + .p2, var + + init, func(m_aes_gcm_init) + encrypt, func(m_aes_gcm_encryt) + decrypt, func(m_aes_gcm_decryt) + tag, func(m_aes_gcm_tag) +} + +class be_class_ec_c25519 (scope: global, name: EC_C25519) { + public_key, func(m_ec_c25519_pubkey) + shared_key, func(m_ec_c25519_sharedkey) +} + +@const_object_info_end */ + +#endif // USE_ALEXA_AVS diff --git a/lib/libesp32/berry/default/be_ctypes.c b/lib/libesp32/berry/default/be_ctypes.c new file mode 100644 index 000000000..18e655d8b --- /dev/null +++ b/lib/libesp32/berry/default/be_ctypes.c @@ -0,0 +1,494 @@ +/******************************************************************** + * Tasmota ctypes mapping + *******************************************************************/ +#include "be_constobj.h" +#include + +extern __attribute__((noreturn)) void be_raisef(bvm *vm, const char *except, const char *msg, ...); + +// binary search within an array of sorted strings +// the first 4 bytes are a pointer to a string +// returns 0..total_elements-1 or -1 if not found + +int32_t bin_search_ctypes(const char * needle, const void * table, size_t elt_size, size_t total_elements) { + int32_t low = 0; + int32_t high = total_elements - 1; + int32_t mid = (low + high) / 2; + // start a dissect + while (low <= high) { + const char * elt = *(const char **) ( ((uint8_t*)table) + mid * elt_size ); + int32_t comp = strcmp(needle, elt); + if (comp < 0) { + high = mid - 1; + } else if (comp > 0) { + low = mid + 1; + } else { + break; + } + mid = (low + high) / 2; + } + if (low <= high) { + return mid; + } else { + return -1; + } +} + +enum { + ctypes_i32 = 14, + ctypes_i16 = 12, + ctypes_i8 = 11, + ctypes_u32 = 4, + ctypes_u16 = 2, + ctypes_u8 = 1, + + // big endian + ctypes_be_i32 = -14, + ctypes_be_i16 = -12, + ctypes_be_i8 = -11, + ctypes_be_u32 = -4, + ctypes_be_u16 = -2, + ctypes_be_u8 = -1, + + // floating point + ctypes_float = 5, + ctypes_double = 10, + + // pointer + ctypes_ptr32 = 9, + ctypes_ptr64 = -9, + + ctypes_bf = 0, //bif-field +}; + +typedef struct be_ctypes_structure_item_t { + const char * name; + uint16_t offset_bytes; + uint8_t offset_bits : 3; + uint8_t len_bits : 5; + int8_t type : 5; + uint8_t mapping : 3; +} be_ctypes_structure_item_t; + +typedef struct be_ctypes_structure_t { + uint16_t size_bytes; /* size in bytes */ + uint16_t size_elt; /* number of elements */ + const char **instance_mapping; /* array of instance class names for automatic instanciation of class */ + const be_ctypes_structure_item_t * items; +} be_ctypes_structure_t; + +typedef struct be_ctypes_class_t { + const char * name; + const be_ctypes_structure_t * definitions; +} be_ctypes_class_t; + +typedef struct be_ctypes_classes_t { + uint16_t size; + const char **instance_mapping; /* array of instance class names for automatic instanciation of class */ + const be_ctypes_class_t * classes; +} be_ctypes_classes_t; + +// const be_ctypes_class_t * g_ctypes_classes = NULL; + +// +// Constructor for ctypes structure +// +// If no arg: allocate a bytes() structure of the right size, filled with zeroes +// Arg1 is instance self +// If arg 2 is int or comptr (and not null): create a mapped bytes buffer to read/write at a specific location (can be copied if need a snapshot) +// If arg 2 is a bytes object, consider it's comptr and map the buffer (it's basically casting). WARNING no size check is done so you can easily corrupt memory +int be_ctypes_init(bvm *vm) { + int argc = be_top(vm); + void * src_data = NULL; + if (argc > 1 && (be_isint(vm, 2) || be_iscomptr(vm, 2) || be_isbytes(vm, 2))) { + if (be_iscomptr(vm, 2)) { + src_data = be_tocomptr(vm, 2); + } else if (be_isbytes(vm, 2)) { + be_getmember(vm, 2, ".p"); + src_data = be_tocomptr(vm, -1); + be_pop(vm, 1); + } else { + src_data = (void*) be_toint(vm, 2); + } + } + + // look for class definition + be_getmember(vm, 1, "_def"); // static class comptr + const be_ctypes_structure_t *definitions; + definitions = (const be_ctypes_structure_t *) be_tocomptr(vm, -1); + be_pop(vm, 1); + + // call super(self, bytes) + be_getglobal(vm, "super"); // push super function + be_pushvalue(vm, 1); // push self instance + be_getglobal(vm, "bytes"); // push bytes class + be_call(vm, 2); + be_pop(vm, 2); + // berry_log_C("be_ctypes_init> super found %p", be_toint(vm, -1)); + + // call bytes.init(self) + be_getmember(vm, -1, "init"); + be_pushvalue(vm, -2); + if (src_data) { be_pushcomptr(vm, src_data); } // if mapped, push address + be_pushint(vm, definitions ? -definitions->size_bytes : 0); // negative size signals a fixed size + be_call(vm, src_data ? 3 : 2); // call with 2 or 3 arguments depending on provided address + be_pop(vm, src_data ? 4 : 3); + // super(self, bytes) still on top of stack + + be_pop(vm, 1); + + be_return(vm); +} + +// +// copy ctypes_bytes, with same class and same content +// +int be_ctypes_copy(bvm *vm) { + size_t len; + const void * src = be_tobytes(vm, 1, &len); + be_classof(vm, 1); + // stack: 1/self + class_object + be_call(vm, 0); // call empty constructor to build empty resizable copy + // stack: 1/ self + new_empty_instance + + // source object (self) + be_getmember(vm, 1, ".p"); + const void* src_buf = be_tocomptr(vm, -1); + be_pop(vm, 1); + + be_getmember(vm, 1, ".len"); + int32_t src_len = be_toint(vm, -1); + be_pop(vm, 1); + + // dest object + be_getmember(vm, -1, ".p"); + const void* dst_buf = be_tocomptr(vm, -1); + be_pop(vm, 1); + + be_getmember(vm, -1, ".len"); + int32_t dst_len = be_toint(vm, -1); + be_pop(vm, 1); + + if (src_len != dst_len) { + be_raisef(vm, "internal_error", "new object has wrong size %i (should be %i)", dst_len, src_len); + } + + // copy bytes + memmove((void*)dst_buf, src_buf, src_len); + + be_return(vm); +} + +// get an attribute from a ctypes structure +// arg1: ctypes instance +// arg2: name of the argument +// The class has a `_def` static class attribute with the C low-level mapping definition +int be_ctypes_member(bvm *vm) { + int argc = be_top(vm); + be_getmember(vm, 1, "_def"); + const be_ctypes_structure_t *definitions; + definitions = (const be_ctypes_structure_t *) be_tocomptr(vm, -1); + be_pop(vm, 1); + const char *name = be_tostring(vm, 2); + + // look for member + int32_t member_idx = bin_search_ctypes(name, &definitions->items[0], sizeof(be_ctypes_structure_item_t), definitions->size_elt); + if (member_idx >= 0) { + const be_ctypes_structure_item_t *member = &definitions->items[member_idx]; + // berry_log_C("member found bytes=%i, bits=%i, len_bits=%i, type=%i", member->offset_bytes, member->offset_bits, member->len_bits, member->type); + + // dispatch according to types + if (ctypes_bf == member->type) { + // bitfield + be_getmember(vm, 1, "getbits"); + be_pushvalue(vm, 1); // self + be_pushint(vm, member->offset_bytes * 8 + member->offset_bits); + be_pushint(vm, member->len_bits); + be_call(vm, 3); + be_pop(vm, 3); + // int result at top of stack + } else if (ctypes_float == member->type) { + // Note: double not supported (no need identified) + // get raw int32_t + be_getmember(vm, 1, "geti"); // self.get or self.geti + be_pushvalue(vm, 1); // push self + be_pushint(vm, member->offset_bytes); + be_pushint(vm, 4); // size is 4 bytes + be_call(vm, 3); + be_pop(vm, 3); + // get int and convert to float + int32_t val = be_toint(vm, -1); + be_pop(vm, 1); + float *fval = (float*) &val; // type wizardry + be_pushreal(vm, *fval); + } else if (ctypes_ptr32 == member->type) { + be_getmember(vm, 1, "geti"); // self.get or self.geti + be_pushvalue(vm, 1); // push self + be_pushint(vm, member->offset_bytes); + be_pushint(vm, 4); // size is 4 bytes TODO 32 bits only supported here + be_call(vm, 3); + be_pop(vm, 3); + // convert to ptr + int32_t val = be_toint(vm, -1); + be_pop(vm, 1); + be_pushcomptr(vm, (void*) val); + } else { + // general int support + int size = member->type; // eventually 1/2/4, positive if little endian, negative if big endian + int sign = bfalse; // signed int + if (size >= ctypes_i8) { + size -= ctypes_i8 - 1; + sign = btrue; + } + if (size <= ctypes_be_i8) { + size += ctypes_be_i8 - 1; + sign = btrue; + } + // get + be_getmember(vm, 1, sign ? "geti" : "get"); // self.get or self.geti + be_pushvalue(vm, 1); // push self + be_pushint(vm, member->offset_bytes); + be_pushint(vm, size); + be_call(vm, 3); + be_pop(vm, 3); + // int result at top of stack + } + // the int result is at top of the stack + // check if we need an instance mapping + if (member->mapping > 0 && definitions->instance_mapping) { + const char * mapping_name = definitions->instance_mapping[member->mapping - 1]; + if (mapping_name) { + be_getglobal(vm, mapping_name); // stack: class + be_pushvalue(vm, -2); // stack: class, value + be_pushint(vm, -1); // stack; class, value, -1 + be_call(vm, 2); // call constructor with 2 parameters + be_pop(vm, 2); // leave new instance on top of stack + } + } + be_return(vm); + } + + be_return_nil(vm); +} + +// setmember takes 3 arguments: +// 1: self (subclass of bytes()) +// 2: name of member +// 3: value +int be_ctypes_setmember(bvm *vm) { + int argc = be_top(vm); + + // If the value is an instance, we call 'toint()' and replace the value + if (be_isinstance(vm, 3)) { + + be_getmember(vm, 3, "toint"); + if (!be_isnil(vm, -1)) { + be_pushvalue(vm, 3); + be_call(vm, 1); + be_pop(vm, 1); + be_moveto(vm, -1, 3); + } else { + be_raise(vm, "value_error", "Value is an instance without 'toint()' method"); + } + be_pop(vm, 1); + } + + // If the value is a pointer, replace with an int of same value (works only on 32 bits CPU) + if (be_iscomptr(vm, 3)) { + void * v = be_tocomptr(vm, 3); + be_pushint(vm, (int32_t) v); + be_moveto(vm, -1, 3); + be_pop(vm, 1); + } + + be_getmember(vm, 1, "_def"); + const be_ctypes_structure_t *definitions; + definitions = (const be_ctypes_structure_t *) be_tocomptr(vm, -1); + be_pop(vm, 1); + const char *name = be_tostring(vm, 2); + + // look for member + int32_t member_idx = bin_search_ctypes(name, &definitions->items[0], sizeof(be_ctypes_structure_item_t), definitions->size_elt); + if (member_idx >= 0) { + const be_ctypes_structure_item_t *member = &definitions->items[member_idx]; + // berry_log_C("member found bytes=%i, bits=%i, len_bits=%i, type=%i", member->offset_bytes, member->offset_bits, member->len_bits, member->type); + + // dispatch according to types + if (ctypes_bf == member->type) { + // bitfield + be_getmember(vm, 1, "setbits"); + be_pushvalue(vm, 1); // self + be_pushint(vm, member->offset_bytes * 8 + member->offset_bits); + be_pushint(vm, member->len_bits); + be_pushvalue(vm, 3); // val + be_call(vm, 4); + be_pop(vm, 5); + be_return_nil(vm); + } else if (ctypes_float == member->type) { + // Note: double not supported (no need identified) + float val = be_toreal(vm, 3); + int32_t *ival = (int32_t*) &val; + // set + be_getmember(vm, 1, "seti"); + be_pushvalue(vm, 1); // push self + be_pushint(vm, member->offset_bytes); + be_pushint(vm, *ival); + be_pushint(vm, 4); // size is 4 bytes + be_call(vm, 4); + be_pop(vm, 5); + be_return_nil(vm); + } else if (ctypes_ptr32 == member->type) { + // Note: 64 bits pointer not supported + int32_t ptr; + if (be_iscomptr(vm, 3)) { + ptr = (int32_t) be_tocomptr(vm, 3); + } else { + ptr = be_toint(vm, 3); + } + // set + be_getmember(vm, 1, "seti"); + be_pushvalue(vm, 1); // push self + be_pushint(vm, member->offset_bytes); + be_pushint(vm, ptr); + be_pushint(vm, 4); // size is 4 bytes - 64 bits not suppported + be_call(vm, 4); + be_pop(vm, 5); + be_return_nil(vm); + } else { + // general int support + int size = member->type; // eventually 1/2/4, positive if little endian, negative if big endian + int sign = bfalse; // signed int + if (size >= ctypes_i8) { + size -= ctypes_i8 - 1; + sign = btrue; + } + if (size <= ctypes_be_i8) { + size += ctypes_be_i8 - 1; + sign = btrue; + } + // set + be_getmember(vm, 1, sign ? "seti" : "set"); // self.get or self.geti + be_pushvalue(vm, 1); // push self + be_pushint(vm, member->offset_bytes); + be_pushvalue(vm, 3); // val + be_pushint(vm, size); + be_call(vm, 4); + be_pop(vm, 5); + be_return_nil(vm); + } + } else { + be_raisef(vm, "attribute_error", "class '%s' cannot assign to attribute '%s'", + be_classname(vm, 1), be_tostring(vm, 2)); + } +} + +// +// tomap, create a map instance containing all values decoded +// +int be_ctypes_tomap(bvm *vm) { + // don't need argc + be_getmember(vm, 1, "_def"); + const be_ctypes_structure_t *definitions; + definitions = (const be_ctypes_structure_t *) be_tocomptr(vm, -1); + be_pop(vm, 1); + + // create empty map + be_newobject(vm, "map"); + + for (uint32_t i = 0; i < definitions->size_elt; i++) { + const be_ctypes_structure_item_t * item = &definitions->items[i]; + + be_pushstring(vm, item->name); // stack: map - key + + be_getmember(vm, 1, "member"); + be_pushvalue(vm, 1); + be_pushstring(vm, item->name); + be_call(vm, 2); + be_pop(vm, 2); // stack: map - key - value + + be_data_insert(vm, -3); + be_pop(vm, 2); // stack: map + } + + be_pop(vm, 1); // remove map struct, to leave map instance + be_return(vm); +} + +// +// Constructor for ctypes_dyn structure +// +// Arg1 is instance self +// Arg2 is int or comptr (and not null): create a mapped bytes buffer to read/write at a specific location +// Arg3 is int or comptr (and not null): the binary definition of the struct (dynamic and not fixed as static member) +int be_ctypes_dyn_init(bvm *vm) { + int argc = be_top(vm); + void * src_data = NULL; + const be_ctypes_structure_t * definitions = NULL; + if (argc > 2 && (be_isint(vm, 2) || be_iscomptr(vm, 2)) && (be_isint(vm, 3) || be_iscomptr(vm, 3))) { + if (be_iscomptr(vm, 2)) { + src_data = be_tocomptr(vm, 2); + } else { + src_data = (void*) be_toint(vm, 2); + } + if (be_iscomptr(vm, 3)) { + definitions = (const be_ctypes_structure_t *) be_tocomptr(vm, 3); + } else { + definitions = (const be_ctypes_structure_t *) be_toint(vm, 3); + } + } + if (!src_data || !definitions) { + be_raise(vm, "value_error", "'address' and 'definition' cannot be null"); + } + + // store definition in member variable + be_pushcomptr(vm, (void*) definitions); + be_setmember(vm, 1, "_def"); // static class comptr + be_pop(vm, 1); + + // call bytes.init(self) + be_getbuiltin(vm, "bytes"); // shortcut `ctypes` init and call directly bytes.init() + be_getmember(vm, -1, "init"); + be_pushvalue(vm, 1); + be_pushcomptr(vm, src_data); + be_pushint(vm, -definitions->size_bytes); // negative size signals a fixed size + be_call(vm, 3); // call with 2 or 3 arguments depending on provided address + be_pop(vm, 4); + // super(self, bytes) still on top of stack + + be_pop(vm, 1); + + be_return(vm); +} + +BE_EXPORT_VARIABLE extern const bclass be_class_bytes; + +#include "../generate/be_fixed_be_class_ctypes.h" +#include "../generate/be_fixed_be_class_ctypes_dyn.h" + +void be_load_ctypes_lib(bvm *vm) { + be_pushntvclass(vm, &be_class_ctypes); + be_setglobal(vm, "ctypes_bytes"); + be_pop(vm, 1); + be_pushntvclass(vm, &be_class_ctypes_dyn); + be_setglobal(vm, "ctypes_bytes_dyn"); + be_pop(vm, 1); +} + +/* @const_object_info_begin +class be_class_ctypes (scope: global, name: ctypes_bytes, super: be_class_bytes) { + _def, nil() + copy, func(be_ctypes_copy) + init, func(be_ctypes_init) + member, func(be_ctypes_member) + setmember, func(be_ctypes_setmember) + + tomap, func(be_ctypes_tomap) +} +@const_object_info_end */ + +/* @const_object_info_begin +class be_class_ctypes_dyn (scope: global, name: ctypes_bytes_dyn, super: be_class_ctypes) { + _def, var + init, func(be_ctypes_dyn_init) +} +@const_object_info_end */ diff --git a/lib/libesp32/berry/default/be_display_lib.c b/lib/libesp32/berry/default/be_display_lib.c new file mode 100644 index 000000000..3943396fc --- /dev/null +++ b/lib/libesp32/berry/default/be_display_lib.c @@ -0,0 +1,29 @@ +/******************************************************************** + * Tasmota lib + * + * To use: `import display` + * + * Initialize Universal Display driver + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_DISPLAY + +// Tasmota specific + +extern int be_ntv_display_start(bvm *vm); + +/******************************************************************** +** Solidified module: display +********************************************************************/ +be_local_module(display, + "display", + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(start, -1), be_const_func(be_ntv_display_start) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(display); +/********************************************************************/ + +#endif // USE_DISPLAY \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_driverlib.c b/lib/libesp32/berry/default/be_driverlib.c new file mode 100644 index 000000000..45a611382 --- /dev/null +++ b/lib/libesp32/berry/default/be_driverlib.c @@ -0,0 +1,153 @@ +/******************************************************************** + * Tasmota lib + * + * To use: `d = Driver()` + * + *******************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Driver_init, /* name */ + be_nested_proto( + 1, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_tasmota +********************************************************************/ +be_local_closure(Driver_get_tasmota, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + }), + &be_const_str_get_tasmota, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_cmd +********************************************************************/ +be_local_closure(Driver_add_cmd, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 2]) { /* upvals */ + be_local_const_upval(1, 2), + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x68100000, // 0000 GETUPV R4 U0 + 0x68140001, // 0001 GETUPV R5 U1 + 0x5C180000, // 0002 MOVE R6 R0 + 0x5C1C0200, // 0003 MOVE R7 R1 + 0x5C200400, // 0004 MOVE R8 R2 + 0x5C240600, // 0005 MOVE R9 R3 + 0x7C100A00, // 0006 CALL R4 5 + 0x80040800, // 0007 RET 1 R4 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(add_cmd), + }), + &be_const_str_add_cmd, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0xB80E0000, // 0000 GETNGBL R3 K0 + 0x8C0C0701, // 0001 GETMET R3 R3 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x84180000, // 0003 CLOSURE R6 P0 + 0x7C0C0600, // 0004 CALL R3 3 + 0xA0000000, // 0005 CLOSE R0 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Driver +********************************************************************/ +be_local_class(Driver, + 13, + NULL, + be_nested_map(16, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(web_add_main_button, 14), be_const_var(4) }, + { be_const_key(web_add_console_button, -1), be_const_var(7) }, + { be_const_key(web_add_management_button, 8), be_const_var(5) }, + { be_const_key(init, -1), be_const_closure(Driver_init_closure) }, + { be_const_key(json_append, -1), be_const_var(10) }, + { be_const_key(web_add_config_button, 7), be_const_var(6) }, + { be_const_key(every_100ms, -1), be_const_var(1) }, + { be_const_key(display, -1), be_const_var(12) }, + { be_const_key(web_add_button, 13), be_const_var(3) }, + { be_const_key(every_second, -1), be_const_var(0) }, + { be_const_key(save_before_restart, -1), be_const_var(8) }, + { be_const_key(get_tasmota, -1), be_const_closure(Driver_get_tasmota_closure) }, + { be_const_key(web_sensor, 6), be_const_var(9) }, + { be_const_key(web_add_handler, -1), be_const_var(2) }, + { be_const_key(button_pressed, 1), be_const_var(11) }, + { be_const_key(add_cmd, -1), be_const_closure(Driver_add_cmd_closure) }, + })), + be_str_literal("Driver") +); +/*******************************************************************/ + +void be_load_Driver_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Driver); + be_setglobal(vm, "Driver"); + be_pop(vm, 1); +} diff --git a/lib/libesp32/berry/default/be_energy_ctypes_definitions.c b/lib/libesp32/berry/default/be_energy_ctypes_definitions.c new file mode 100644 index 000000000..86f84ef64 --- /dev/null +++ b/lib/libesp32/berry/default/be_energy_ctypes_definitions.c @@ -0,0 +1,117 @@ +/******************************************************************** + * Tasmota LVGL ctypes mapping + *******************************************************************/ +#include "be_ctypes.h" + +#ifdef USE_ENERGY_SENSOR + +/******************************************************************** + * Generated code, don't edit + *******************************************************************/ + +static const char * be_ctypes_instance_mappings[]; /* forward definition */ + +const be_ctypes_structure_t be_energy_struct = { + 250, /* size in bytes */ + 85, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[85]) { + { "active_power", 24, 0, 0, ctypes_float, 0 }, + { "active_power_2", 28, 0, 0, ctypes_float, 0 }, + { "active_power_3", 32, 0, 0, ctypes_float, 0 }, + { "apparent_power", 36, 0, 0, ctypes_float, 0 }, + { "apparent_power_2", 40, 0, 0, ctypes_float, 0 }, + { "apparent_power_3", 44, 0, 0, ctypes_float, 0 }, + { "command_code", 205, 0, 0, ctypes_u8, 0 }, + { "current", 12, 0, 0, ctypes_float, 0 }, + { "current_2", 16, 0, 0, ctypes_float, 0 }, + { "current_3", 20, 0, 0, ctypes_float, 0 }, + { "current_available", 215, 0, 0, ctypes_u8, 0 }, + { "daily", 120, 0, 0, ctypes_float, 0 }, + { "daily_2", 124, 0, 0, ctypes_float, 0 }, + { "daily_3", 128, 0, 0, ctypes_float, 0 }, + { "daily_sum", 144, 0, 0, ctypes_float, 0 }, + { "data_valid", 206, 0, 0, ctypes_u8, 0 }, + { "data_valid_2", 207, 0, 0, ctypes_u8, 0 }, + { "data_valid_3", 208, 0, 0, ctypes_u8, 0 }, + { "export_active", 96, 0, 0, ctypes_float, 0 }, + { "export_active_2", 100, 0, 0, ctypes_float, 0 }, + { "export_active_3", 104, 0, 0, ctypes_float, 0 }, + { "fifth_second", 204, 0, 0, ctypes_u8, 0 }, + { "frequency", 72, 0, 0, ctypes_float, 0 }, + { "frequency_2", 76, 0, 0, ctypes_float, 0 }, + { "frequency_3", 80, 0, 0, ctypes_float, 0 }, + { "frequency_common", 211, 0, 0, ctypes_u8, 0 }, + { "import_active", 84, 0, 0, ctypes_float, 0 }, + { "import_active_2", 88, 0, 0, ctypes_float, 0 }, + { "import_active_3", 92, 0, 0, ctypes_float, 0 }, + { "max_current_flag", 242, 0, 0, ctypes_u8, 0 }, + { "max_energy_state", 249, 0, 0, ctypes_u8, 0 }, + { "max_power_flag", 238, 0, 0, ctypes_u8, 0 }, + { "max_voltage_flag", 240, 0, 0, ctypes_u8, 0 }, + { "min_current_flag", 241, 0, 0, ctypes_u8, 0 }, + { "min_power_flag", 237, 0, 0, ctypes_u8, 0 }, + { "min_voltage_flag", 239, 0, 0, ctypes_u8, 0 }, + { "mplh_counter", 244, 0, 0, ctypes_u16, 0 }, + { "mplr_counter", 248, 0, 0, ctypes_u8, 0 }, + { "mplw_counter", 246, 0, 0, ctypes_u16, 0 }, + { "period", 192, 0, 0, ctypes_u32, 0 }, + { "period_2", 196, 0, 0, ctypes_u32, 0 }, + { "period_3", 200, 0, 0, ctypes_u32, 0 }, + { "phase_count", 209, 0, 0, ctypes_u8, 0 }, + { "power_factor", 60, 0, 0, ctypes_float, 0 }, + { "power_factor_2", 64, 0, 0, ctypes_float, 0 }, + { "power_factor_3", 68, 0, 0, ctypes_float, 0 }, + { "power_history_0", 218, 0, 0, ctypes_u16, 0 }, + { "power_history_0_2", 220, 0, 0, ctypes_u16, 0 }, + { "power_history_0_3", 222, 0, 0, ctypes_u16, 0 }, + { "power_history_1", 224, 0, 0, ctypes_u16, 0 }, + { "power_history_1_2", 226, 0, 0, ctypes_u16, 0 }, + { "power_history_1_3", 228, 0, 0, ctypes_u16, 0 }, + { "power_history_2", 230, 0, 0, ctypes_u16, 0 }, + { "power_history_2_2", 232, 0, 0, ctypes_u16, 0 }, + { "power_history_2_3", 234, 0, 0, ctypes_u16, 0 }, + { "power_on", 217, 0, 0, ctypes_u8, 0 }, + { "power_steady_counter", 236, 0, 0, ctypes_u8, 0 }, + { "reactive_power", 48, 0, 0, ctypes_float, 0 }, + { "reactive_power_2", 52, 0, 0, ctypes_float, 0 }, + { "reactive_power_3", 56, 0, 0, ctypes_float, 0 }, + { "start_energy", 108, 0, 0, ctypes_float, 0 }, + { "start_energy_2", 112, 0, 0, ctypes_float, 0 }, + { "start_energy_3", 116, 0, 0, ctypes_float, 0 }, + { "today_delta_kwh", 156, 0, 0, ctypes_u32, 0 }, + { "today_delta_kwh_2", 160, 0, 0, ctypes_u32, 0 }, + { "today_delta_kwh_3", 164, 0, 0, ctypes_u32, 0 }, + { "today_kwh", 180, 0, 0, ctypes_u32, 0 }, + { "today_kwh_2", 184, 0, 0, ctypes_u32, 0 }, + { "today_kwh_3", 188, 0, 0, ctypes_u32, 0 }, + { "today_offset_init_kwh", 213, 0, 0, ctypes_u8, 0 }, + { "today_offset_kwh", 168, 0, 0, ctypes_u32, 0 }, + { "today_offset_kwh_2", 172, 0, 0, ctypes_u32, 0 }, + { "today_offset_kwh_3", 176, 0, 0, ctypes_u32, 0 }, + { "total", 132, 0, 0, ctypes_float, 0 }, + { "total_2", 136, 0, 0, ctypes_float, 0 }, + { "total_3", 140, 0, 0, ctypes_float, 0 }, + { "total_sum", 148, 0, 0, ctypes_float, 0 }, + { "type_dc", 216, 0, 0, ctypes_u8, 0 }, + { "use_overtemp", 212, 0, 0, ctypes_u8, 0 }, + { "voltage", 0, 0, 0, ctypes_float, 0 }, + { "voltage_2", 4, 0, 0, ctypes_float, 0 }, + { "voltage_3", 8, 0, 0, ctypes_float, 0 }, + { "voltage_available", 214, 0, 0, ctypes_u8, 0 }, + { "voltage_common", 210, 0, 0, ctypes_u8, 0 }, + { "yesterday_sum", 152, 0, 0, ctypes_float, 0 }, +}}; + +static const char * be_ctypes_instance_mappings[] = { + NULL +}; + +static be_define_ctypes_class(energy_struct, &be_energy_struct, &be_class_ctypes, "energy_struct"); + +void be_load_ctypes_energy_definitions_lib(bvm *vm) { + ctypes_register_class(vm, &be_class_energy_struct, &be_energy_struct); +} +/********************************************************************/ + +#endif // USE_ENERGY_SENSOR \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_energylib.c b/lib/libesp32/berry/default/be_energylib.c new file mode 100644 index 000000000..cbdddbfca --- /dev/null +++ b/lib/libesp32/berry/default/be_energylib.c @@ -0,0 +1,186 @@ +/******************************************************************** + * Tasmota lib + * + * To use: `import power` + * + * read power values + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_ENERGY_SENSOR + +extern struct ENERGY Energy; +/* + +_energy = nil # avoid compilation error +energy = module("energy") +energy._ptr = nil + +def init(m) + import global + global._energy = energy_struct(m._ptr) + return m +end +energy.init = init + +def read() + return _energy.tomap() +end +energy.read = read + +def member(k) + return _energy.(k) +end +energy.member = member + +def setmember(k, v) + _energy.(k) = v +end +energy.setmember = setmember + +import solidify +solidify.dump(energy) +*/ + + +/******************************************************************** +** Solidified function: member +********************************************************************/ +be_local_closure(energy_member, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(_energy), + }), + &be_const_str_member, + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040200, // 0001 GETMBR R1 R1 R0 + 0x80040200, // 0002 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: setmember +********************************************************************/ +be_local_closure(energy_setmember, /* name */ + be_nested_proto( + 3, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(_energy), + }), + &be_const_str_setmember, + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x90080001, // 0001 SETMBR R2 R0 R1 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read +********************************************************************/ +be_local_closure(energy_read, /* name */ + be_nested_proto( + 2, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(_energy), + /* K1 */ be_nested_str(tomap), + }), + &be_const_str_read, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0xB8020000, // 0000 GETNGBL R0 K0 + 0x8C000101, // 0001 GETMET R0 R0 K1 + 0x7C000200, // 0002 CALL R0 1 + 0x80040000, // 0003 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(energy_init, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(global), + /* K1 */ be_nested_str(_energy), + /* K2 */ be_nested_str(energy_struct), + /* K3 */ be_nested_str(_ptr), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xB80A0400, // 0001 GETNGBL R2 K2 + 0x880C0103, // 0002 GETMBR R3 R0 K3 + 0x7C080200, // 0003 CALL R2 1 + 0x90060202, // 0004 SETMBR R1 K1 R2 + 0x80040000, // 0005 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified module: energy +********************************************************************/ +be_local_module(energy, + "energy", + be_nested_map(5, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(energy_init_closure) }, + { be_const_key(member, 2), be_const_closure(energy_member_closure) }, + { be_const_key(_ptr, 3), be_const_comptr(&Energy) }, + { be_const_key(setmember, -1), be_const_closure(energy_setmember_closure) }, + { be_const_key(read, -1), be_const_closure(energy_read_closure) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(energy); +/********************************************************************/ + + +// { be_const_key(_ptr, 3), be_const_comptr(&Energy) }, /* patch */ + +#endif // USE_ENERGY_SENSOR \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_flash_lib.c b/lib/libesp32/berry/default/be_flash_lib.c new file mode 100644 index 000000000..539805d5d --- /dev/null +++ b/lib/libesp32/berry/default/be_flash_lib.c @@ -0,0 +1,21 @@ +/******************************************************************** + * Berry module `webserver` + * + * To use: `import webserver` + * + * Allows to respond to HTTP request + *******************************************************************/ +#include "be_constobj.h" + +extern int p_flash_read(bvm *vm); +extern int p_flash_write(bvm *vm); +extern int p_flash_erase(bvm *vm); + +/* @const_object_info_begin +module flash (scope: global) { + read, func(p_flash_read) + write, func(p_flash_write) + erase, func(p_flash_erase) +} +@const_object_info_end */ +#include "../generate/be_fixed_flash.h" diff --git a/lib/libesp32/berry/default/be_gpio_lib.c b/lib/libesp32/berry/default/be_gpio_lib.c new file mode 100644 index 000000000..3f0b2b3ed --- /dev/null +++ b/lib/libesp32/berry/default/be_gpio_lib.c @@ -0,0 +1,34 @@ +/******************************************************************** + * Tasmota lib + * + * To use: `import power` + * + * read power values + *******************************************************************/ +#include "be_constobj.h" + +// Tasmota specific + +extern int gp_member(bvm *vm); +extern int gp_pin_mode(bvm *vm); +extern int gp_digital_write(bvm *vm); +extern int gp_digital_read(bvm *vm); +extern int gp_dac_voltage(bvm *vm); + +extern int gp_pin_used(bvm *vm); +extern int gp_pin(bvm *vm); + +/* @const_object_info_begin +module gpio (scope: global) { + member, func(gp_member) + + pin_mode, func(gp_pin_mode) + digital_write, func(gp_digital_write) + digital_read, func(gp_digital_read) + dac_voltage, func(gp_dac_voltage) + + pin_used, func(gp_pin_used) + pin, func(gp_pin) +} +@const_object_info_end */ +#include "../generate/be_fixed_gpio.h" diff --git a/lib/libesp32/berry/default/be_i2c_axp192_lib.c b/lib/libesp32/berry/default/be_i2c_axp192_lib.c new file mode 100644 index 000000000..4f9f02307 --- /dev/null +++ b/lib/libesp32/berry/default/be_i2c_axp192_lib.c @@ -0,0 +1,899 @@ +/******************************************************************** + * Tasmota LVGL lv_signal_bars widget + *******************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: get_warning_level +********************************************************************/ +be_local_closure(AXP192_get_warning_level, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(read12), + /* K1 */ be_const_int(1), + }), + &be_const_str_get_warning_level, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0046, // 0001 LDINT R3 71 + 0x7C040400, // 0002 CALL R1 2 + 0x2C040301, // 0003 AND R1 R1 K1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_vbus_current +********************************************************************/ +be_local_closure(AXP192_get_vbus_current, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(read12), + /* K1 */ be_const_real_hex(0x3EC00000), + }), + &be_const_str_get_vbus_current, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E005B, // 0001 LDINT R3 92 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_chg_current +********************************************************************/ +be_local_closure(AXP192_set_chg_current, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(write8), + /* K1 */ be_nested_str(read8), + }), + &be_const_str_set_chg_current, + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 + 0x54120032, // 0001 LDINT R4 51 + 0x8C140101, // 0002 GETMET R5 R0 K1 + 0x541E0032, // 0003 LDINT R7 51 + 0x7C140400, // 0004 CALL R5 2 + 0x541A00EF, // 0005 LDINT R6 240 + 0x2C140A06, // 0006 AND R5 R5 R6 + 0x541A000E, // 0007 LDINT R6 15 + 0x2C180206, // 0008 AND R6 R1 R6 + 0x30140A06, // 0009 OR R5 R5 R6 + 0x7C080600, // 000A CALL R2 3 + 0x80000000, // 000B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_bat_current +********************************************************************/ +be_local_closure(AXP192_get_bat_current, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(read13), + /* K1 */ be_const_real_hex(0x3F000000), + }), + &be_const_str_get_bat_current, + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0079, // 0001 LDINT R3 122 + 0x7C040400, // 0002 CALL R1 2 + 0x8C080100, // 0003 GETMET R2 R0 K0 + 0x5412007B, // 0004 LDINT R4 124 + 0x7C080400, // 0005 CALL R2 2 + 0x04040202, // 0006 SUB R1 R1 R2 + 0x08040301, // 0007 MUL R1 R1 K1 + 0x80040200, // 0008 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_bat_power +********************************************************************/ +be_local_closure(AXP192_get_bat_power, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(read24), + /* K1 */ be_const_real_hex(0x3A102DE1), + }), + &be_const_str_get_bat_power, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E006F, // 0001 LDINT R3 112 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: json_append +********************************************************************/ +be_local_closure(AXP192_json_append, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(wire), + }), + &be_const_str_json_append, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x74060001, // 0001 JMPT R1 #0004 + 0x4C040000, // 0002 LDNIL R1 + 0x80040200, // 0003 RET 1 R1 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_vbus_voltage +********************************************************************/ +be_local_closure(AXP192_get_vbus_voltage, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(read12), + /* K1 */ be_const_real_hex(0x3ADED28A), + }), + &be_const_str_get_vbus_voltage, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0059, // 0001 LDINT R3 90 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_temp +********************************************************************/ +be_local_closure(AXP192_get_temp, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(read12), + /* K1 */ be_const_real_hex(0x3DCCCCCD), + /* K2 */ be_const_real_hex(0x4310B333), + }), + &be_const_str_get_temp, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E005D, // 0001 LDINT R3 94 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x04040302, // 0004 SUB R1 R1 K2 + 0x80040200, // 0005 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: battery_present +********************************************************************/ +be_local_closure(AXP192_battery_present, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read), + /* K2 */ be_nested_str(addr), + /* K3 */ be_const_int(1), + }), + &be_const_str_battery_present, + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x58100003, // 0003 LDCONST R4 K3 + 0x58140003, // 0004 LDCONST R5 K3 + 0x7C040800, // 0005 CALL R1 4 + 0x540A001F, // 0006 LDINT R2 32 + 0x2C040202, // 0007 AND R1 R1 R2 + 0x78060002, // 0008 JMPF R1 #000C + 0x50040200, // 0009 LDBOOL R1 1 0 + 0x80040200, // 000A RET 1 R1 + 0x70020001, // 000B JMP #000E + 0x50040000, // 000C LDBOOL R1 0 0 + 0x80040200, // 000D RET 1 R1 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_aps_voltage +********************************************************************/ +be_local_closure(AXP192_get_aps_voltage, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(read12), + /* K1 */ be_const_real_hex(0x3AB78035), + }), + &be_const_str_get_aps_voltage, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E007D, // 0001 LDINT R3 126 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_dcdc_enable +********************************************************************/ +be_local_closure(AXP192_set_dcdc_enable, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_const_int(1), + /* K1 */ be_nested_str(write_bit), + /* K2 */ be_const_int(0), + /* K3 */ be_const_int(2), + /* K4 */ be_const_int(3), + }), + &be_const_str_set_dcdc_enable, + &be_const_str_solidified, + ( &(const binstruction[22]) { /* code */ + 0x1C0C0300, // 0000 EQ R3 R1 K0 + 0x780E0004, // 0001 JMPF R3 #0007 + 0x8C0C0101, // 0002 GETMET R3 R0 K1 + 0x54160011, // 0003 LDINT R5 18 + 0x58180002, // 0004 LDCONST R6 K2 + 0x5C1C0400, // 0005 MOVE R7 R2 + 0x7C0C0800, // 0006 CALL R3 4 + 0x1C0C0303, // 0007 EQ R3 R1 K3 + 0x780E0004, // 0008 JMPF R3 #000E + 0x8C0C0101, // 0009 GETMET R3 R0 K1 + 0x54160011, // 000A LDINT R5 18 + 0x541A0003, // 000B LDINT R6 4 + 0x5C1C0400, // 000C MOVE R7 R2 + 0x7C0C0800, // 000D CALL R3 4 + 0x1C0C0304, // 000E EQ R3 R1 K4 + 0x780E0004, // 000F JMPF R3 #0015 + 0x8C0C0101, // 0010 GETMET R3 R0 K1 + 0x54160011, // 0011 LDINT R5 18 + 0x58180000, // 0012 LDCONST R6 K0 + 0x5C1C0400, // 0013 MOVE R7 R2 + 0x7C0C0800, // 0014 CALL R3 4 + 0x80000000, // 0015 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_ldo_voltage +********************************************************************/ +be_local_closure(AXP192_set_ldo_voltage, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_const_int(2), + /* K1 */ be_nested_str(write8), + /* K2 */ be_nested_str(read8), + /* K3 */ be_const_int(3), + }), + &be_const_str_set_ldo_voltage, + &be_const_str_solidified, + ( &(const binstruction[39]) { /* code */ + 0x540E0CE3, // 0000 LDINT R3 3300 + 0x240C0403, // 0001 GT R3 R2 R3 + 0x780E0001, // 0002 JMPF R3 #0005 + 0x540A000E, // 0003 LDINT R2 15 + 0x70020004, // 0004 JMP #000A + 0x540E0063, // 0005 LDINT R3 100 + 0x0C0C0403, // 0006 DIV R3 R2 R3 + 0x54120011, // 0007 LDINT R4 18 + 0x040C0604, // 0008 SUB R3 R3 R4 + 0x5C080600, // 0009 MOVE R2 R3 + 0x1C0C0300, // 000A EQ R3 R1 K0 + 0x780E000C, // 000B JMPF R3 #0019 + 0x8C0C0101, // 000C GETMET R3 R0 K1 + 0x54160027, // 000D LDINT R5 40 + 0x8C180102, // 000E GETMET R6 R0 K2 + 0x54220027, // 000F LDINT R8 40 + 0x7C180400, // 0010 CALL R6 2 + 0x541E000E, // 0011 LDINT R7 15 + 0x2C180C07, // 0012 AND R6 R6 R7 + 0x541E000E, // 0013 LDINT R7 15 + 0x2C1C0407, // 0014 AND R7 R2 R7 + 0x54220003, // 0015 LDINT R8 4 + 0x381C0E08, // 0016 SHL R7 R7 R8 + 0x30180C07, // 0017 OR R6 R6 R7 + 0x7C0C0600, // 0018 CALL R3 3 + 0x1C0C0303, // 0019 EQ R3 R1 K3 + 0x780E000A, // 001A JMPF R3 #0026 + 0x8C0C0101, // 001B GETMET R3 R0 K1 + 0x54160027, // 001C LDINT R5 40 + 0x8C180102, // 001D GETMET R6 R0 K2 + 0x54220027, // 001E LDINT R8 40 + 0x7C180400, // 001F CALL R6 2 + 0x541E00EF, // 0020 LDINT R7 240 + 0x2C180C07, // 0021 AND R6 R6 R7 + 0x541E000E, // 0022 LDINT R7 15 + 0x2C1C0407, // 0023 AND R7 R2 R7 + 0x30180C07, // 0024 OR R6 R6 R7 + 0x7C0C0600, // 0025 CALL R3 3 + 0x80000000, // 0026 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(AXP192_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(I2C_Driver), + /* K1 */ be_nested_str(init), + /* K2 */ be_nested_str(AXP192), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x60040003, // 0000 GETGBL R1 G3 + 0x5C080000, // 0001 MOVE R2 R0 + 0xB80E0000, // 0002 GETNGBL R3 K0 + 0x7C040400, // 0003 CALL R1 2 + 0x8C040301, // 0004 GETMET R1 R1 K1 + 0x580C0002, // 0005 LDCONST R3 K2 + 0x54120033, // 0006 LDINT R4 52 + 0x7C040600, // 0007 CALL R1 3 + 0x80000000, // 0008 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_bat_voltage +********************************************************************/ +be_local_closure(AXP192_get_bat_voltage, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(read12), + /* K1 */ be_const_real_hex(0x3A902DE0), + }), + &be_const_str_get_bat_voltage, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0077, // 0001 LDINT R3 120 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_ldo_enable +********************************************************************/ +be_local_closure(AXP192_set_ldo_enable, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_const_int(2), + /* K1 */ be_nested_str(write_bit), + /* K2 */ be_const_int(3), + }), + &be_const_str_set_ldo_enable, + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x1C0C0300, // 0000 EQ R3 R1 K0 + 0x780E0004, // 0001 JMPF R3 #0007 + 0x8C0C0101, // 0002 GETMET R3 R0 K1 + 0x54160011, // 0003 LDINT R5 18 + 0x58180000, // 0004 LDCONST R6 K0 + 0x5C1C0400, // 0005 MOVE R7 R2 + 0x7C0C0800, // 0006 CALL R3 4 + 0x1C0C0302, // 0007 EQ R3 R1 K2 + 0x780E0004, // 0008 JMPF R3 #000E + 0x8C0C0101, // 0009 GETMET R3 R0 K1 + 0x54160011, // 000A LDINT R5 18 + 0x58180002, // 000B LDCONST R6 K2 + 0x5C1C0400, // 000C MOVE R7 R2 + 0x7C0C0800, // 000D CALL R3 4 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_dc_voltage +********************************************************************/ +be_local_closure(AXP192_set_dc_voltage, /* name */ + be_nested_proto( + 11, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_const_int(1), + /* K1 */ be_const_int(3), + /* K2 */ be_const_int(0), + /* K3 */ be_const_int(2), + /* K4 */ be_nested_str(write8), + /* K5 */ be_nested_str(read8), + }), + &be_const_str_set_dc_voltage, + &be_const_str_solidified, + ( &(const binstruction[48]) { /* code */ + 0x140C0300, // 0000 LT R3 R1 K0 + 0x740E0001, // 0001 JMPT R3 #0004 + 0x240C0301, // 0002 GT R3 R1 K1 + 0x780E0000, // 0003 JMPF R3 #0005 + 0x80000600, // 0004 RET 0 + 0x4C0C0000, // 0005 LDNIL R3 + 0x541202BB, // 0006 LDINT R4 700 + 0x14100404, // 0007 LT R4 R2 R4 + 0x78120001, // 0008 JMPF R4 #000B + 0x580C0002, // 0009 LDCONST R3 K2 + 0x70020010, // 000A JMP #001C + 0x54120DAB, // 000B LDINT R4 3500 + 0x24100404, // 000C GT R4 R2 R4 + 0x78120001, // 000D JMPF R4 #0010 + 0x540E006F, // 000E LDINT R3 112 + 0x7002000B, // 000F JMP #001C + 0x1C100303, // 0010 EQ R4 R1 K3 + 0x78120004, // 0011 JMPF R4 #0017 + 0x541208E2, // 0012 LDINT R4 2275 + 0x24100404, // 0013 GT R4 R2 R4 + 0x78120001, // 0014 JMPF R4 #0017 + 0x540E003E, // 0015 LDINT R3 63 + 0x70020004, // 0016 JMP #001C + 0x541202BB, // 0017 LDINT R4 700 + 0x04100404, // 0018 SUB R4 R2 R4 + 0x54160018, // 0019 LDINT R5 25 + 0x0C100805, // 001A DIV R4 R4 R5 + 0x5C0C0800, // 001B MOVE R3 R4 + 0x54120025, // 001C LDINT R4 38 + 0x1C140301, // 001D EQ R5 R1 K1 + 0x78160001, // 001E JMPF R5 #0021 + 0x54120026, // 001F LDINT R4 39 + 0x70020002, // 0020 JMP #0024 + 0x1C140303, // 0021 EQ R5 R1 K3 + 0x78160000, // 0022 JMPF R5 #0024 + 0x54120022, // 0023 LDINT R4 35 + 0x8C140104, // 0024 GETMET R5 R0 K4 + 0x5C1C0800, // 0025 MOVE R7 R4 + 0x8C200105, // 0026 GETMET R8 R0 K5 + 0x5C280800, // 0027 MOVE R10 R4 + 0x7C200400, // 0028 CALL R8 2 + 0x5426007F, // 0029 LDINT R9 128 + 0x2C201009, // 002A AND R8 R8 R9 + 0x5426007E, // 002B LDINT R9 127 + 0x2C240609, // 002C AND R9 R3 R9 + 0x30201009, // 002D OR R8 R8 R9 + 0x7C140600, // 002E CALL R5 3 + 0x80000000, // 002F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: write_gpio +********************************************************************/ +be_local_closure(AXP192_write_gpio, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_const_int(2), + /* K2 */ be_nested_str(write_bit), + /* K3 */ be_const_int(3), + }), + &be_const_str_write_gpio, + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0x280C0300, // 0000 GE R3 R1 K0 + 0x780E0007, // 0001 JMPF R3 #000A + 0x180C0301, // 0002 LE R3 R1 K1 + 0x780E0005, // 0003 JMPF R3 #000A + 0x8C0C0102, // 0004 GETMET R3 R0 K2 + 0x54160093, // 0005 LDINT R5 148 + 0x5C180200, // 0006 MOVE R6 R1 + 0x5C1C0400, // 0007 MOVE R7 R2 + 0x7C0C0800, // 0008 CALL R3 4 + 0x70020009, // 0009 JMP #0014 + 0x280C0303, // 000A GE R3 R1 K3 + 0x780E0007, // 000B JMPF R3 #0014 + 0x540E0003, // 000C LDINT R3 4 + 0x180C0203, // 000D LE R3 R1 R3 + 0x780E0004, // 000E JMPF R3 #0014 + 0x8C0C0102, // 000F GETMET R3 R0 K2 + 0x54160095, // 0010 LDINT R5 150 + 0x04180303, // 0011 SUB R6 R1 K3 + 0x5C1C0400, // 0012 MOVE R7 R2 + 0x7C0C0800, // 0013 CALL R3 4 + 0x80000000, // 0014 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: web_sensor +********************************************************************/ +be_local_closure(AXP192_web_sensor, /* name */ + be_nested_proto( + 11, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[14]) { /* constants */ + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(format), + /* K3 */ be_nested_str(_X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D), + /* K4 */ be_nested_str(_X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D), + /* K5 */ be_nested_str(_X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D), + /* K6 */ be_nested_str(_X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D), + /* K7 */ be_nested_str(_X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D), + /* K8 */ be_nested_str(get_vbus_voltage), + /* K9 */ be_nested_str(get_bat_voltage), + /* K10 */ be_nested_str(get_bat_current), + /* K11 */ be_nested_str(get_temp), + /* K12 */ be_nested_str(tasmota), + /* K13 */ be_nested_str(web_send_decimal), + }), + &be_const_str_web_sensor, + &be_const_str_solidified, + ( &(const binstruction[26]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x74060001, // 0001 JMPT R1 #0004 + 0x4C040000, // 0002 LDNIL R1 + 0x80040200, // 0003 RET 1 R1 + 0xA4060200, // 0004 IMPORT R1 K1 + 0x8C080302, // 0005 GETMET R2 R1 K2 + 0x40120704, // 0006 CONNECT R4 K3 K4 + 0x40100905, // 0007 CONNECT R4 R4 K5 + 0x40100906, // 0008 CONNECT R4 R4 K6 + 0x40100907, // 0009 CONNECT R4 R4 K7 + 0x8C140108, // 000A GETMET R5 R0 K8 + 0x7C140200, // 000B CALL R5 1 + 0x8C180108, // 000C GETMET R6 R0 K8 + 0x7C180200, // 000D CALL R6 1 + 0x8C1C0109, // 000E GETMET R7 R0 K9 + 0x7C1C0200, // 000F CALL R7 1 + 0x8C20010A, // 0010 GETMET R8 R0 K10 + 0x7C200200, // 0011 CALL R8 1 + 0x8C24010B, // 0012 GETMET R9 R0 K11 + 0x7C240200, // 0013 CALL R9 1 + 0x7C080E00, // 0014 CALL R2 7 + 0xB80E1800, // 0015 GETNGBL R3 K12 + 0x8C0C070D, // 0016 GETMET R3 R3 K13 + 0x5C140400, // 0017 MOVE R5 R2 + 0x7C0C0400, // 0018 CALL R3 2 + 0x80000000, // 0019 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_bat_charge_current +********************************************************************/ +be_local_closure(AXP192_get_bat_charge_current, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(read13), + /* K1 */ be_const_real_hex(0x3F000000), + }), + &be_const_str_get_bat_charge_current, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0079, // 0001 LDINT R3 122 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_battery_chargin_status +********************************************************************/ +be_local_closure(AXP192_get_battery_chargin_status, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read), + /* K2 */ be_nested_str(addr), + /* K3 */ be_const_int(1), + }), + &be_const_str_get_battery_chargin_status, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x58100003, // 0003 LDCONST R4 K3 + 0x58140003, // 0004 LDCONST R5 K3 + 0x7C040800, // 0005 CALL R1 4 + 0x80040200, // 0006 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_input_power_status +********************************************************************/ +be_local_closure(AXP192_get_input_power_status, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read), + /* K2 */ be_nested_str(addr), + /* K3 */ be_const_int(0), + /* K4 */ be_const_int(1), + }), + &be_const_str_get_input_power_status, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x58100003, // 0003 LDCONST R4 K3 + 0x58140004, // 0004 LDCONST R5 K4 + 0x7C040800, // 0005 CALL R1 4 + 0x80040200, // 0006 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: AXP192 +********************************************************************/ +extern const bclass be_class_I2C_Driver; +be_local_class(AXP192, + 0, + &be_class_I2C_Driver, + be_nested_map(21, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(get_warning_level, -1), be_const_closure(AXP192_get_warning_level_closure) }, + { be_const_key(get_vbus_current, -1), be_const_closure(AXP192_get_vbus_current_closure) }, + { be_const_key(get_aps_voltage, -1), be_const_closure(AXP192_get_aps_voltage_closure) }, + { be_const_key(get_bat_current, -1), be_const_closure(AXP192_get_bat_current_closure) }, + { be_const_key(get_bat_power, 2), be_const_closure(AXP192_get_bat_power_closure) }, + { be_const_key(json_append, -1), be_const_closure(AXP192_json_append_closure) }, + { be_const_key(get_vbus_voltage, -1), be_const_closure(AXP192_get_vbus_voltage_closure) }, + { be_const_key(get_battery_chargin_status, 9), be_const_closure(AXP192_get_battery_chargin_status_closure) }, + { be_const_key(battery_present, -1), be_const_closure(AXP192_battery_present_closure) }, + { be_const_key(get_bat_charge_current, 14), be_const_closure(AXP192_get_bat_charge_current_closure) }, + { be_const_key(set_dcdc_enable, -1), be_const_closure(AXP192_set_dcdc_enable_closure) }, + { be_const_key(get_temp, 19), be_const_closure(AXP192_get_temp_closure) }, + { be_const_key(set_chg_current, 13), be_const_closure(AXP192_set_chg_current_closure) }, + { be_const_key(set_ldo_enable, 18), be_const_closure(AXP192_set_ldo_enable_closure) }, + { be_const_key(set_dc_voltage, -1), be_const_closure(AXP192_set_dc_voltage_closure) }, + { be_const_key(get_bat_voltage, 7), be_const_closure(AXP192_get_bat_voltage_closure) }, + { be_const_key(write_gpio, -1), be_const_closure(AXP192_write_gpio_closure) }, + { be_const_key(web_sensor, -1), be_const_closure(AXP192_web_sensor_closure) }, + { be_const_key(init, -1), be_const_closure(AXP192_init_closure) }, + { be_const_key(set_ldo_voltage, -1), be_const_closure(AXP192_set_ldo_voltage_closure) }, + { be_const_key(get_input_power_status, -1), be_const_closure(AXP192_get_input_power_status_closure) }, + })), + be_str_literal("AXP192") +); +/*******************************************************************/ + +void be_load_AXP192_class(bvm *vm) { + be_pushntvclass(vm, &be_class_AXP192); + be_setglobal(vm, "AXP192"); + be_pop(vm, 1); +} diff --git a/lib/libesp32/berry/default/be_i2c_driverlib.c b/lib/libesp32/berry/default/be_i2c_driverlib.c new file mode 100644 index 000000000..45f829e19 --- /dev/null +++ b/lib/libesp32/berry/default/be_i2c_driverlib.c @@ -0,0 +1,425 @@ +/******************************************************************** + * Tasmota I2C_Driver class + * + * To use: `d = I2C_Driver(addr, name)` + * where: + * addr: I2C address of the device + * name: name of the I2C chip for logging + * + *******************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: read32 +********************************************************************/ +be_local_closure(I2C_Driver_read32, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read_bytes), + /* K2 */ be_nested_str(addr), + /* K3 */ be_const_int(0), + /* K4 */ be_const_int(1), + /* K5 */ be_const_int(2), + /* K6 */ be_const_int(3), + }), + &be_const_str_read32, + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x88100102, // 0002 GETMBR R4 R0 K2 + 0x5C140200, // 0003 MOVE R5 R1 + 0x541A0003, // 0004 LDINT R6 4 + 0x7C080800, // 0005 CALL R2 4 + 0x940C0503, // 0006 GETIDX R3 R2 K3 + 0x54120017, // 0007 LDINT R4 24 + 0x380C0604, // 0008 SHL R3 R3 R4 + 0x94100504, // 0009 GETIDX R4 R2 K4 + 0x5416000F, // 000A LDINT R5 16 + 0x38100805, // 000B SHL R4 R4 R5 + 0x000C0604, // 000C ADD R3 R3 R4 + 0x94100505, // 000D GETIDX R4 R2 K5 + 0x54160007, // 000E LDINT R5 8 + 0x38100805, // 000F SHL R4 R4 R5 + 0x000C0604, // 0010 ADD R3 R3 R4 + 0x94100506, // 0011 GETIDX R4 R2 K6 + 0x000C0604, // 0012 ADD R3 R3 R4 + 0x80040600, // 0013 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: write8 +********************************************************************/ +be_local_closure(I2C_Driver_write8, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(write), + /* K2 */ be_nested_str(addr), + /* K3 */ be_const_int(1), + }), + &be_const_str_write8, + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x8C0C0701, // 0001 GETMET R3 R3 K1 + 0x88140102, // 0002 GETMBR R5 R0 K2 + 0x5C180200, // 0003 MOVE R6 R1 + 0x5C1C0400, // 0004 MOVE R7 R2 + 0x58200003, // 0005 LDCONST R8 K3 + 0x7C0C0A00, // 0006 CALL R3 5 + 0x80040600, // 0007 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read12 +********************************************************************/ +be_local_closure(I2C_Driver_read12, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read_bytes), + /* K2 */ be_nested_str(addr), + /* K3 */ be_const_int(2), + /* K4 */ be_const_int(0), + /* K5 */ be_const_int(1), + }), + &be_const_str_read12, + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x88100102, // 0002 GETMBR R4 R0 K2 + 0x5C140200, // 0003 MOVE R5 R1 + 0x58180003, // 0004 LDCONST R6 K3 + 0x7C080800, // 0005 CALL R2 4 + 0x940C0504, // 0006 GETIDX R3 R2 K4 + 0x54120003, // 0007 LDINT R4 4 + 0x380C0604, // 0008 SHL R3 R3 R4 + 0x94100505, // 0009 GETIDX R4 R2 K5 + 0x000C0604, // 000A ADD R3 R3 R4 + 0x80040600, // 000B RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: write_bit +********************************************************************/ +be_local_closure(I2C_Driver_write_bit, /* name */ + be_nested_proto( + 11, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_const_int(1), + /* K2 */ be_nested_str(write8), + /* K3 */ be_nested_str(read8), + }), + &be_const_str_write_bit, + &be_const_str_solidified, + ( &(const binstruction[26]) { /* code */ + 0x14100500, // 0000 LT R4 R2 K0 + 0x74120002, // 0001 JMPT R4 #0005 + 0x54120006, // 0002 LDINT R4 7 + 0x24100404, // 0003 GT R4 R2 R4 + 0x78120000, // 0004 JMPF R4 #0006 + 0x80000800, // 0005 RET 0 + 0x38120202, // 0006 SHL R4 K1 R2 + 0x780E0007, // 0007 JMPF R3 #0010 + 0x8C140102, // 0008 GETMET R5 R0 K2 + 0x5C1C0200, // 0009 MOVE R7 R1 + 0x8C200103, // 000A GETMET R8 R0 K3 + 0x5C280200, // 000B MOVE R10 R1 + 0x7C200400, // 000C CALL R8 2 + 0x30201004, // 000D OR R8 R8 R4 + 0x7C140600, // 000E CALL R5 3 + 0x70020008, // 000F JMP #0019 + 0x8C140102, // 0010 GETMET R5 R0 K2 + 0x5C1C0200, // 0011 MOVE R7 R1 + 0x8C200103, // 0012 GETMET R8 R0 K3 + 0x5C280200, // 0013 MOVE R10 R1 + 0x7C200400, // 0014 CALL R8 2 + 0x542600FE, // 0015 LDINT R9 255 + 0x04241204, // 0016 SUB R9 R9 R4 + 0x2C201009, // 0017 AND R8 R8 R9 + 0x7C140600, // 0018 CALL R5 3 + 0x80000000, // 0019 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read24 +********************************************************************/ +be_local_closure(I2C_Driver_read24, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read_bytes), + /* K2 */ be_nested_str(addr), + /* K3 */ be_const_int(3), + /* K4 */ be_const_int(0), + /* K5 */ be_const_int(1), + /* K6 */ be_const_int(2), + }), + &be_const_str_read24, + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x88100102, // 0002 GETMBR R4 R0 K2 + 0x5C140200, // 0003 MOVE R5 R1 + 0x58180003, // 0004 LDCONST R6 K3 + 0x7C080800, // 0005 CALL R2 4 + 0x940C0504, // 0006 GETIDX R3 R2 K4 + 0x5412000F, // 0007 LDINT R4 16 + 0x380C0604, // 0008 SHL R3 R3 R4 + 0x94100505, // 0009 GETIDX R4 R2 K5 + 0x54160007, // 000A LDINT R5 8 + 0x38100805, // 000B SHL R4 R4 R5 + 0x000C0604, // 000C ADD R3 R3 R4 + 0x94100506, // 000D GETIDX R4 R2 K6 + 0x000C0604, // 000E ADD R3 R3 R4 + 0x80040600, // 000F RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read8 +********************************************************************/ +be_local_closure(I2C_Driver_read8, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read), + /* K2 */ be_nested_str(addr), + /* K3 */ be_const_int(1), + }), + &be_const_str_read8, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x88100102, // 0002 GETMBR R4 R0 K2 + 0x5C140200, // 0003 MOVE R5 R1 + 0x58180003, // 0004 LDCONST R6 K3 + 0x7C080800, // 0005 CALL R2 4 + 0x80040400, // 0006 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(I2C_Driver_init, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str(get_tasmota), + /* K1 */ be_nested_str(i2c_enabled), + /* K2 */ be_nested_str(addr), + /* K3 */ be_nested_str(wire), + /* K4 */ be_nested_str(wire_scan), + /* K5 */ be_nested_str(function), + /* K6 */ be_nested_str(name), + /* K7 */ be_nested_str(I2C_X3A), + /* K8 */ be_nested_str(detected_X20on_X20bus), + /* K9 */ be_nested_str(bus), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[44]) { /* code */ + 0x8C100100, // 0000 GETMET R4 R0 K0 + 0x7C100200, // 0001 CALL R4 1 + 0x4C140000, // 0002 LDNIL R5 + 0x20140605, // 0003 NE R5 R3 R5 + 0x78160004, // 0004 JMPF R5 #000A + 0x8C140901, // 0005 GETMET R5 R4 K1 + 0x5C1C0600, // 0006 MOVE R7 R3 + 0x7C140400, // 0007 CALL R5 2 + 0x74160000, // 0008 JMPT R5 #000A + 0x80000A00, // 0009 RET 0 + 0x90020402, // 000A SETMBR R0 K2 R2 + 0x8C140904, // 000B GETMET R5 R4 K4 + 0x881C0102, // 000C GETMBR R7 R0 K2 + 0x7C140400, // 000D CALL R5 2 + 0x90020605, // 000E SETMBR R0 K3 R5 + 0x88140103, // 000F GETMBR R5 R0 K3 + 0x78160019, // 0010 JMPF R5 #002B + 0x60140004, // 0011 GETGBL R5 G4 + 0x5C180200, // 0012 MOVE R6 R1 + 0x7C140200, // 0013 CALL R5 1 + 0x1C140B05, // 0014 EQ R5 R5 K5 + 0x78160004, // 0015 JMPF R5 #001B + 0x5C140200, // 0016 MOVE R5 R1 + 0x5C180000, // 0017 MOVE R6 R0 + 0x7C140200, // 0018 CALL R5 1 + 0x90020C05, // 0019 SETMBR R0 K6 R5 + 0x70020000, // 001A JMP #001C + 0x90020C01, // 001B SETMBR R0 K6 R1 + 0x88140106, // 001C GETMBR R5 R0 K6 + 0x4C180000, // 001D LDNIL R6 + 0x1C140A06, // 001E EQ R5 R5 R6 + 0x78160001, // 001F JMPF R5 #0022 + 0x4C140000, // 0020 LDNIL R5 + 0x90020605, // 0021 SETMBR R0 K3 R5 + 0x88140103, // 0022 GETMBR R5 R0 K3 + 0x78160006, // 0023 JMPF R5 #002B + 0x60140001, // 0024 GETGBL R5 G1 + 0x58180007, // 0025 LDCONST R6 K7 + 0x881C0106, // 0026 GETMBR R7 R0 K6 + 0x58200008, // 0027 LDCONST R8 K8 + 0x88240103, // 0028 GETMBR R9 R0 K3 + 0x88241309, // 0029 GETMBR R9 R9 K9 + 0x7C140800, // 002A CALL R5 4 + 0x80000000, // 002B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read13 +********************************************************************/ +be_local_closure(I2C_Driver_read13, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(read_bytes), + /* K2 */ be_nested_str(addr), + /* K3 */ be_const_int(2), + /* K4 */ be_const_int(0), + /* K5 */ be_const_int(1), + }), + &be_const_str_read13, + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x88100102, // 0002 GETMBR R4 R0 K2 + 0x5C140200, // 0003 MOVE R5 R1 + 0x58180003, // 0004 LDCONST R6 K3 + 0x7C080800, // 0005 CALL R2 4 + 0x940C0504, // 0006 GETIDX R3 R2 K4 + 0x54120004, // 0007 LDINT R4 5 + 0x380C0604, // 0008 SHL R3 R3 R4 + 0x94100505, // 0009 GETIDX R4 R2 K5 + 0x000C0604, // 000A ADD R3 R3 R4 + 0x80040600, // 000B RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: I2C_Driver +********************************************************************/ +be_local_class(I2C_Driver, + 3, + NULL, + be_nested_map(11, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(read32, -1), be_const_closure(I2C_Driver_read32_closure) }, + { be_const_key(write8, 6), be_const_closure(I2C_Driver_write8_closure) }, + { be_const_key(name, -1), be_const_var(2) }, + { be_const_key(addr, 8), be_const_var(1) }, + { be_const_key(read12, -1), be_const_closure(I2C_Driver_read12_closure) }, + { be_const_key(wire, 10), be_const_var(0) }, + { be_const_key(read13, -1), be_const_closure(I2C_Driver_read13_closure) }, + { be_const_key(read24, -1), be_const_closure(I2C_Driver_read24_closure) }, + { be_const_key(read8, -1), be_const_closure(I2C_Driver_read8_closure) }, + { be_const_key(init, -1), be_const_closure(I2C_Driver_init_closure) }, + { be_const_key(write_bit, -1), be_const_closure(I2C_Driver_write_bit_closure) }, + })), + be_str_literal("I2C_Driver") +); +/*******************************************************************/ + +void be_load_I2C_Driver_class(bvm *vm) { + be_pushntvclass(vm, &be_class_I2C_Driver); + be_setglobal(vm, "I2C_Driver"); + be_pop(vm, 1); +} diff --git a/lib/libesp32/berry/default/be_i2s_audio_lib.c b/lib/libesp32/berry/default/be_i2s_audio_lib.c new file mode 100644 index 000000000..ef8720b23 --- /dev/null +++ b/lib/libesp32/berry/default/be_i2s_audio_lib.c @@ -0,0 +1,113 @@ +/******************************************************************** + * Tasmota I2S audio classes + * + * + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_I2S +#ifdef USE_I2S_AUDIO_BERRY + +extern int i2s_output_i2s_init(bvm *vm); +extern int i2s_output_i2s_deinit(bvm *vm); +extern int i2s_output_i2s_stop(bvm *vm); + +extern int i2s_generator_wav_init(bvm *vm); +extern int i2s_generator_wav_deinit(bvm *vm); +extern int i2s_generator_wav_begin(bvm *vm); +extern int i2s_generator_wav_loop(bvm *vm); +extern int i2s_generator_wav_stop(bvm *vm); +extern int i2s_generator_wav_isrunning(bvm *vm); + +extern int i2s_generator_mp3_init(bvm *vm); +extern int i2s_generator_mp3_deinit(bvm *vm); +extern int i2s_generator_mp3_begin(bvm *vm); +extern int i2s_generator_mp3_loop(bvm *vm); +extern int i2s_generator_mp3_stop(bvm *vm); +extern int i2s_generator_mp3_isrunning(bvm *vm); + +#ifdef USE_UFILESYS +extern int i2s_file_source_fs_init(bvm *vm); +extern int i2s_file_source_fs_deinit(bvm *vm); +#endif // USE_UFILESYS + + +#include "../generate/be_fixed_be_class_audio_output.h" +#include "../generate/be_fixed_be_class_audio_output_i2s.h" +#include "../generate/be_fixed_be_class_audio_generator.h" +#include "../generate/be_fixed_be_class_audio_generator_wav.h" +#include "../generate/be_fixed_be_class_audio_generator_mp3.h" +#include "../generate/be_fixed_be_class_audio_file_source.h" +#include "../generate/be_fixed_be_class_audio_file_source_fs.h" + +void be_load_driver_audio_lib(bvm *vm) { + be_pushntvclass(vm, &be_class_audio_output); + be_setglobal(vm, "AudioOutput"); + be_pop(vm, 1); + + be_pushntvclass(vm, &be_class_audio_output_i2s); + be_setglobal(vm, "AudioOutputI2S"); + be_pop(vm, 1); + + be_pushntvclass(vm, &be_class_audio_generator_wav); + be_setglobal(vm, "AudioGeneratorWAV"); + be_pop(vm, 1); + + be_pushntvclass(vm, &be_class_audio_generator_mp3); + be_setglobal(vm, "AudioGeneratorMP3"); + be_pop(vm, 1); + +#ifdef USE_UFILESYS + be_pushntvclass(vm, &be_class_audio_file_source_fs); + be_setglobal(vm, "AudioFileSourceFS"); + be_pop(vm, 1); +#endif // USE_UFILESYS +} + +/* @const_object_info_begin + +class be_class_audio_output (scope: global, name: AudioOutput) { + .p, var +} + +class be_class_audio_generator (scope: global, name: AudioGenerator) { + .p, var +} + +class be_class_audio_file_source (scope: global, name: AudioFileSource) { + .p, var +} + +class be_class_audio_output_i2s (scope: global, name: AudioOutputI2S, super: be_class_audio_output) { + init, func(i2s_output_i2s_init) + deinit, func(i2s_output_i2s_deinit) + stop, func(i2s_output_i2s_stop) +} + +class be_class_audio_generator_wav (scope: global, name: AudioGeneratorWAV, super: be_class_audio_generator) { + init, func(i2s_generator_wav_init) + deinit, func(i2s_generator_wav_deinit) + begin, func(i2s_generator_wav_begin) + loop, func(i2s_generator_wav_loop) + stop, func(i2s_generator_wav_stop) + isrunning, func(i2s_generator_wav_isrunning) +} + +class be_class_audio_generator_mp3 (scope: global, name: AudioGeneratorMP3, super: be_class_audio_generator) { + init, func(i2s_generator_mp3_init) + deinit, func(i2s_generator_mp3_deinit) + begin, func(i2s_generator_mp3_begin) + loop, func(i2s_generator_mp3_loop) + stop, func(i2s_generator_mp3_stop) + isrunning, func(i2s_generator_mp3_isrunning) +} + +class be_class_audio_file_source_fs (scope: global, name: AudioFileSourceFS, super: be_class_audio_file_source) { + init, func(i2s_file_source_fs_init) + deinit, func(i2s_file_source_fs_deinit) +} + +@const_object_info_end */ + +#endif // USE_I2S_AUDIO_BERRY +#endif // USE_I2S \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_leds_animator_lib.c b/lib/libesp32/berry/default/be_leds_animator_lib.c new file mode 100644 index 000000000..bd82193b9 --- /dev/null +++ b/lib/libesp32/berry/default/be_leds_animator_lib.c @@ -0,0 +1,381 @@ +/******************************************************************** + * Berry class `Leds_animator` + * + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_WS2812 + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Leds_animator_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(bri), + /* K2 */ be_nested_str(running), + /* K3 */ be_nested_str(pixel_count), + /* K4 */ be_nested_str(animators), + /* K5 */ be_nested_str(clear), + /* K6 */ be_nested_str(tasmota), + /* K7 */ be_nested_str(add_driver), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x540A0031, // 0001 LDINT R2 50 + 0x90020202, // 0002 SETMBR R0 K1 R2 + 0x50080000, // 0003 LDBOOL R2 0 0 + 0x90020402, // 0004 SETMBR R0 K2 R2 + 0x8C080303, // 0005 GETMET R2 R1 K3 + 0x7C080200, // 0006 CALL R2 1 + 0x90020602, // 0007 SETMBR R0 K3 R2 + 0x60080012, // 0008 GETGBL R2 G18 + 0x7C080000, // 0009 CALL R2 0 + 0x90020802, // 000A SETMBR R0 K4 R2 + 0x8C080105, // 000B GETMET R2 R0 K5 + 0x7C080200, // 000C CALL R2 1 + 0xB80A0C00, // 000D GETNGBL R2 K6 + 0x8C080507, // 000E GETMET R2 R2 K7 + 0x5C100000, // 000F MOVE R4 R0 + 0x7C080400, // 0010 CALL R2 2 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_bri +********************************************************************/ +be_local_closure(Leds_animator_set_bri, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(bri), + }), + &be_const_str_set_bri, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x80000000, // 0001 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: stop +********************************************************************/ +be_local_closure(Leds_animator_stop, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(running), + }), + &be_const_str_stop, + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x50040000, // 0000 LDBOOL R1 0 0 + 0x90020001, // 0001 SETMBR R0 K0 R1 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: animate +********************************************************************/ +be_local_closure(Leds_animator_animate, /* name */ + be_nested_proto( + 1, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + &be_const_str_animate, + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove +********************************************************************/ +be_local_closure(Leds_animator_remove, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(remove_driver), + }), + &be_const_str_remove, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C040400, // 0003 CALL R1 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_50ms +********************************************************************/ +be_local_closure(Leds_animator_every_50ms, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str(running), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(animators), + /* K3 */ be_nested_str(is_running), + /* K4 */ be_nested_str(animate), + /* K5 */ be_const_int(1), + /* K6 */ be_nested_str(remove), + }), + &be_const_str_every_50ms, + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x78060015, // 0001 JMPF R1 #0018 + 0x58040001, // 0002 LDCONST R1 K1 + 0x6008000C, // 0003 GETGBL R2 G12 + 0x880C0102, // 0004 GETMBR R3 R0 K2 + 0x7C080200, // 0005 CALL R2 1 + 0x14080202, // 0006 LT R2 R1 R2 + 0x780A000D, // 0007 JMPF R2 #0016 + 0x88080102, // 0008 GETMBR R2 R0 K2 + 0x94080401, // 0009 GETIDX R2 R2 R1 + 0x8C0C0503, // 000A GETMET R3 R2 K3 + 0x7C0C0200, // 000B CALL R3 1 + 0x780E0003, // 000C JMPF R3 #0011 + 0x8C0C0504, // 000D GETMET R3 R2 K4 + 0x7C0C0200, // 000E CALL R3 1 + 0x00040305, // 000F ADD R1 R1 K5 + 0x70020003, // 0010 JMP #0015 + 0x880C0102, // 0011 GETMBR R3 R0 K2 + 0x8C0C0706, // 0012 GETMET R3 R3 K6 + 0x5C140200, // 0013 MOVE R5 R1 + 0x7C0C0400, // 0014 CALL R3 2 + 0x7001FFEC, // 0015 JMP #0003 + 0x8C080104, // 0016 GETMET R2 R0 K4 + 0x7C080200, // 0017 CALL R2 1 + 0x80000000, // 0018 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_bri +********************************************************************/ +be_local_closure(Leds_animator_get_bri, /* name */ + be_nested_proto( + 3, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(bri), + }), + &be_const_str_get_bri, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x80040400, // 0001 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start +********************************************************************/ +be_local_closure(Leds_animator_start, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(running), + }), + &be_const_str_start, + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x50040200, // 0000 LDBOOL R1 1 0 + 0x90020001, // 0001 SETMBR R0 K0 R1 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_anim +********************************************************************/ +be_local_closure(Leds_animator_add_anim, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(animators), + /* K1 */ be_nested_str(push), + /* K2 */ be_nested_str(run), + }), + &be_const_str_add_anim, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x8C080302, // 0004 GETMET R2 R1 K2 + 0x7C080200, // 0005 CALL R2 1 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: clear +********************************************************************/ +be_local_closure(Leds_animator_clear, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(stop), + /* K1 */ be_nested_str(strip), + /* K2 */ be_nested_str(clear), + }), + &be_const_str_clear, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0x88040101, // 0002 GETMBR R1 R0 K1 + 0x8C040302, // 0003 GETMET R1 R1 K2 + 0x7C040200, // 0004 CALL R1 1 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Leds_animator +********************************************************************/ +be_local_class(Leds_animator, + 5, + NULL, + be_nested_map(15, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, 12), be_const_closure(Leds_animator_init_closure) }, + { be_const_key(clear, -1), be_const_closure(Leds_animator_clear_closure) }, + { be_const_key(stop, -1), be_const_closure(Leds_animator_stop_closure) }, + { be_const_key(strip, 4), be_const_var(0) }, + { be_const_key(pixel_count, 6), be_const_var(1) }, + { be_const_key(animate, -1), be_const_closure(Leds_animator_animate_closure) }, + { be_const_key(add_anim, 13), be_const_closure(Leds_animator_add_anim_closure) }, + { be_const_key(bri, -1), be_const_var(2) }, + { be_const_key(every_50ms, -1), be_const_closure(Leds_animator_every_50ms_closure) }, + { be_const_key(remove, 7), be_const_closure(Leds_animator_remove_closure) }, + { be_const_key(get_bri, -1), be_const_closure(Leds_animator_get_bri_closure) }, + { be_const_key(start, -1), be_const_closure(Leds_animator_start_closure) }, + { be_const_key(running, -1), be_const_var(3) }, + { be_const_key(animators, -1), be_const_var(4) }, + { be_const_key(set_bri, 1), be_const_closure(Leds_animator_set_bri_closure) }, + })), + be_str_literal("Leds_animator") +); +/*******************************************************************/ + +void be_load_Leds_animator_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Leds_animator); + be_setglobal(vm, "Leds_animator"); + be_pop(vm, 1); +} + +#endif // USE_WS2812 diff --git a/lib/libesp32/berry/default/be_leds_lib.c b/lib/libesp32/berry/default/be_leds_lib.c new file mode 100644 index 000000000..58b0a991e --- /dev/null +++ b/lib/libesp32/berry/default/be_leds_lib.c @@ -0,0 +1,1815 @@ +/******************************************************************** + * Berry class `Leds` + * + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_WS2812 + +/******************************************************************** +** Solidified function: pixel_count +********************************************************************/ +be_local_closure(Leds_matrix_pixel_count, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(w), + /* K1 */ be_nested_str(h), + }), + &be_const_str_pixel_count, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x08040202, // 0002 MUL R1 R1 R2 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_alternate +********************************************************************/ +be_local_closure(Leds_matrix_set_alternate, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(alternate), + }), + &be_const_str_set_alternate, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x80000000, // 0001 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: pixel_size +********************************************************************/ +be_local_closure(Leds_matrix_pixel_size, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(pixel_size), + }), + &be_const_str_pixel_size, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_pixel_color +********************************************************************/ +be_local_closure(Leds_matrix_set_pixel_color, /* name */ + be_nested_proto( + 9, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(set_pixel_color), + /* K2 */ be_nested_str(offset), + }), + &be_const_str_set_pixel_color, + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x88100100, // 0000 GETMBR R4 R0 K0 + 0x8C100901, // 0001 GETMET R4 R4 K1 + 0x88180102, // 0002 GETMBR R6 R0 K2 + 0x00180206, // 0003 ADD R6 R1 R6 + 0x5C1C0400, // 0004 MOVE R7 R2 + 0x5C200600, // 0005 MOVE R8 R3 + 0x7C100800, // 0006 CALL R4 4 + 0x80000000, // 0007 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_matrix_pixel_color +********************************************************************/ +be_local_closure(Leds_matrix_set_matrix_pixel_color, /* name */ + be_nested_proto( + 10, /* nstack */ + 5, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str(alternate), + /* K1 */ be_const_int(2), + /* K2 */ be_nested_str(strip), + /* K3 */ be_nested_str(set_pixel_color), + /* K4 */ be_nested_str(w), + /* K5 */ be_nested_str(h), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str(offset), + }), + &be_const_str_set_matrix_pixel_color, + &be_const_str_solidified, + ( &(const binstruction[29]) { /* code */ + 0x88140100, // 0000 GETMBR R5 R0 K0 + 0x7816000F, // 0001 JMPF R5 #0012 + 0x10140301, // 0002 MOD R5 R1 K1 + 0x7816000D, // 0003 JMPF R5 #0012 + 0x88140102, // 0004 GETMBR R5 R0 K2 + 0x8C140B03, // 0005 GETMET R5 R5 K3 + 0x881C0104, // 0006 GETMBR R7 R0 K4 + 0x081C0207, // 0007 MUL R7 R1 R7 + 0x88200105, // 0008 GETMBR R8 R0 K5 + 0x001C0E08, // 0009 ADD R7 R7 R8 + 0x041C0E02, // 000A SUB R7 R7 R2 + 0x041C0F06, // 000B SUB R7 R7 K6 + 0x88200107, // 000C GETMBR R8 R0 K7 + 0x001C0E08, // 000D ADD R7 R7 R8 + 0x5C200600, // 000E MOVE R8 R3 + 0x5C240800, // 000F MOVE R9 R4 + 0x7C140800, // 0010 CALL R5 4 + 0x70020009, // 0011 JMP #001C + 0x88140102, // 0012 GETMBR R5 R0 K2 + 0x8C140B03, // 0013 GETMET R5 R5 K3 + 0x881C0104, // 0014 GETMBR R7 R0 K4 + 0x081C0207, // 0015 MUL R7 R1 R7 + 0x001C0E02, // 0016 ADD R7 R7 R2 + 0x88200107, // 0017 GETMBR R8 R0 K7 + 0x001C0E08, // 0018 ADD R7 R7 R8 + 0x5C200600, // 0019 MOVE R8 R3 + 0x5C240800, // 001A MOVE R9 R4 + 0x7C140800, // 001B CALL R5 4 + 0x80000000, // 001C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: show +********************************************************************/ +be_local_closure(Leds_matrix_show, /* name */ + be_nested_proto( + 4, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str(offset), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(w), + /* K3 */ be_nested_str(h), + /* K4 */ be_nested_str(strip), + /* K5 */ be_nested_str(leds), + /* K6 */ be_nested_str(show), + }), + &be_const_str_show, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x60080017, // 0000 GETGBL R2 G23 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x7C080200, // 0002 CALL R2 1 + 0x740A0009, // 0003 JMPT R2 #000E + 0x88080100, // 0004 GETMBR R2 R0 K0 + 0x1C080501, // 0005 EQ R2 R2 K1 + 0x780A0009, // 0006 JMPF R2 #0011 + 0x88080102, // 0007 GETMBR R2 R0 K2 + 0x880C0103, // 0008 GETMBR R3 R0 K3 + 0x08080403, // 0009 MUL R2 R2 R3 + 0x880C0104, // 000A GETMBR R3 R0 K4 + 0x880C0705, // 000B GETMBR R3 R3 K5 + 0x1C080403, // 000C EQ R2 R2 R3 + 0x780A0002, // 000D JMPF R2 #0011 + 0x88080104, // 000E GETMBR R2 R0 K4 + 0x8C080506, // 000F GETMET R2 R2 K6 + 0x7C080200, // 0010 CALL R2 1 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: is_dirty +********************************************************************/ +be_local_closure(Leds_matrix_is_dirty, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(is_dirty), + }), + &be_const_str_is_dirty, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: clear_to +********************************************************************/ +be_local_closure(Leds_matrix_clear_to, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str(w), + /* K2 */ be_nested_str(h), + /* K3 */ be_nested_str(strip), + /* K4 */ be_nested_str(set_pixel_color), + /* K5 */ be_nested_str(offset), + /* K6 */ be_const_int(1), + }), + &be_const_str_clear_to, + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x580C0000, // 0000 LDCONST R3 K0 + 0x88100101, // 0001 GETMBR R4 R0 K1 + 0x88140102, // 0002 GETMBR R5 R0 K2 + 0x08100805, // 0003 MUL R4 R4 R5 + 0x14100604, // 0004 LT R4 R3 R4 + 0x78120008, // 0005 JMPF R4 #000F + 0x88100103, // 0006 GETMBR R4 R0 K3 + 0x8C100904, // 0007 GETMET R4 R4 K4 + 0x88180105, // 0008 GETMBR R6 R0 K5 + 0x00180606, // 0009 ADD R6 R3 R6 + 0x5C1C0200, // 000A MOVE R7 R1 + 0x5C200400, // 000B MOVE R8 R2 + 0x7C100800, // 000C CALL R4 4 + 0x000C0706, // 000D ADD R3 R3 K6 + 0x7001FFF1, // 000E JMP #0001 + 0x80000000, // 000F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: clear +********************************************************************/ +be_local_closure(Leds_matrix_clear, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(clear_to), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(show), + }), + &be_const_str_clear, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x580C0001, // 0001 LDCONST R3 K1 + 0x7C040400, // 0002 CALL R1 2 + 0x8C040102, // 0003 GETMET R1 R0 K2 + 0x7C040200, // 0004 CALL R1 1 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: pixels_buffer +********************************************************************/ +be_local_closure(Leds_matrix_pixels_buffer, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + &be_const_str_pixels_buffer, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x4C040000, // 0000 LDNIL R1 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Leds_matrix_init, /* name */ + be_nested_proto( + 6, /* nstack */ + 5, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(offset), + /* K2 */ be_nested_str(h), + /* K3 */ be_nested_str(w), + /* K4 */ be_nested_str(alternate), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020204, // 0001 SETMBR R0 K1 R4 + 0x90020403, // 0002 SETMBR R0 K2 R3 + 0x90020602, // 0003 SETMBR R0 K3 R2 + 0x50140000, // 0004 LDBOOL R5 0 0 + 0x90020805, // 0005 SETMBR R0 K4 R5 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: dirty +********************************************************************/ +be_local_closure(Leds_matrix_dirty, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(dirty), + }), + &be_const_str_dirty, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_pixel_color +********************************************************************/ +be_local_closure(Leds_matrix_get_pixel_color, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(get_pixel_color), + /* K2 */ be_nested_str(offseta), + }), + &be_const_str_get_pixel_color, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x88100102, // 0002 GETMBR R4 R0 K2 + 0x00100204, // 0003 ADD R4 R1 R4 + 0x7C080400, // 0004 CALL R2 2 + 0x80040400, // 0005 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_alternate +********************************************************************/ +be_local_closure(Leds_matrix_get_alternate, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(alternate), + }), + &be_const_str_get_alternate, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: begin +********************************************************************/ +be_local_closure(Leds_matrix_begin, /* name */ + be_nested_proto( + 1, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + &be_const_str_begin, + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: can_show +********************************************************************/ +be_local_closure(Leds_matrix_can_show, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(can_show), + }), + &be_const_str_can_show, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Leds_matrix +********************************************************************/ +be_local_class(Leds_matrix, + 5, + NULL, + be_nested_map(21, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(pixel_count, -1), be_const_closure(Leds_matrix_pixel_count_closure) }, + { be_const_key(h, 6), be_const_var(2) }, + { be_const_key(set_alternate, 7), be_const_closure(Leds_matrix_set_alternate_closure) }, + { be_const_key(pixel_size, 16), be_const_closure(Leds_matrix_pixel_size_closure) }, + { be_const_key(set_pixel_color, 19), be_const_closure(Leds_matrix_set_pixel_color_closure) }, + { be_const_key(set_matrix_pixel_color, 10), be_const_closure(Leds_matrix_set_matrix_pixel_color_closure) }, + { be_const_key(show, -1), be_const_closure(Leds_matrix_show_closure) }, + { be_const_key(alternate, -1), be_const_var(4) }, + { be_const_key(strip, -1), be_const_var(0) }, + { be_const_key(clear_to, -1), be_const_closure(Leds_matrix_clear_to_closure) }, + { be_const_key(w, 15), be_const_var(3) }, + { be_const_key(pixels_buffer, -1), be_const_closure(Leds_matrix_pixels_buffer_closure) }, + { be_const_key(init, -1), be_const_closure(Leds_matrix_init_closure) }, + { be_const_key(dirty, -1), be_const_closure(Leds_matrix_dirty_closure) }, + { be_const_key(get_pixel_color, -1), be_const_closure(Leds_matrix_get_pixel_color_closure) }, + { be_const_key(get_alternate, 17), be_const_closure(Leds_matrix_get_alternate_closure) }, + { be_const_key(offset, 8), be_const_var(1) }, + { be_const_key(clear, -1), be_const_closure(Leds_matrix_clear_closure) }, + { be_const_key(begin, -1), be_const_closure(Leds_matrix_begin_closure) }, + { be_const_key(is_dirty, -1), be_const_closure(Leds_matrix_is_dirty_closure) }, + { be_const_key(can_show, -1), be_const_closure(Leds_matrix_can_show_closure) }, + })), + be_str_literal("Leds_matrix") +); + +/******************************************************************** +** Solidified function: create_matrix +********************************************************************/ +be_local_closure(Leds_create_matrix, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str(leds), + /* K2 */ be_nested_str(value_error), + /* K3 */ be_nested_str(out_X20of_X20range), + /* K4 */ be_const_class(be_class_Leds_matrix), + }), + &be_const_str_create_matrix, + &be_const_str_solidified, + ( &(const binstruction[37]) { /* code */ + 0x60100009, // 0000 GETGBL R4 G9 + 0x5C140600, // 0001 MOVE R5 R3 + 0x7C100200, // 0002 CALL R4 1 + 0x5C0C0800, // 0003 MOVE R3 R4 + 0x60100009, // 0004 GETGBL R4 G9 + 0x5C140200, // 0005 MOVE R5 R1 + 0x7C100200, // 0006 CALL R4 1 + 0x5C040800, // 0007 MOVE R1 R4 + 0x60100009, // 0008 GETGBL R4 G9 + 0x5C140400, // 0009 MOVE R5 R2 + 0x7C100200, // 000A CALL R4 1 + 0x5C080800, // 000B MOVE R2 R4 + 0x4C100000, // 000C LDNIL R4 + 0x1C100604, // 000D EQ R4 R3 R4 + 0x78120000, // 000E JMPF R4 #0010 + 0x580C0000, // 000F LDCONST R3 K0 + 0x08100202, // 0010 MUL R4 R1 R2 + 0x00100803, // 0011 ADD R4 R4 R3 + 0x88140101, // 0012 GETMBR R5 R0 K1 + 0x24100805, // 0013 GT R4 R4 R5 + 0x74120005, // 0014 JMPT R4 #001B + 0x14100500, // 0015 LT R4 R2 K0 + 0x74120003, // 0016 JMPT R4 #001B + 0x14100300, // 0017 LT R4 R1 K0 + 0x74120001, // 0018 JMPT R4 #001B + 0x14100700, // 0019 LT R4 R3 K0 + 0x78120000, // 001A JMPF R4 #001C + 0xB0060503, // 001B RAISE 1 K2 K3 + 0x58100004, // 001C LDCONST R4 K4 + 0xB4000004, // 001D CLASS K4 + 0x5C140800, // 001E MOVE R5 R4 + 0x5C180000, // 001F MOVE R6 R0 + 0x5C1C0200, // 0020 MOVE R7 R1 + 0x5C200400, // 0021 MOVE R8 R2 + 0x5C240600, // 0022 MOVE R9 R3 + 0x7C140800, // 0023 CALL R5 4 + 0x80040A00, // 0024 RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: begin +********************************************************************/ +be_local_closure(Leds_begin, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(call_native), + /* K1 */ be_const_int(1), + }), + &be_const_str_begin, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x580C0001, // 0001 LDCONST R3 K1 + 0x7C040400, // 0002 CALL R1 2 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: to_gamma +********************************************************************/ +be_local_closure(Leds_to_gamma, /* name */ + be_nested_proto( + 12, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(scale_uint), + /* K2 */ be_const_int(0), + /* K3 */ be_const_int(16711680), + /* K4 */ be_nested_str(gamma), + /* K5 */ be_nested_str(light), + /* K6 */ be_nested_str(gamma8), + }), + &be_const_str_to_gamma, + &be_const_str_solidified, + ( &(const binstruction[67]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x200C0403, // 0001 NE R3 R2 R3 + 0x780E0001, // 0002 JMPF R3 #0005 + 0x5C0C0400, // 0003 MOVE R3 R2 + 0x70020000, // 0004 JMP #0006 + 0x540E0063, // 0005 LDINT R3 100 + 0x5C080600, // 0006 MOVE R2 R3 + 0xB80E0000, // 0007 GETNGBL R3 K0 + 0x8C0C0701, // 0008 GETMET R3 R3 K1 + 0x5C140400, // 0009 MOVE R5 R2 + 0x58180002, // 000A LDCONST R6 K2 + 0x541E0063, // 000B LDINT R7 100 + 0x58200002, // 000C LDCONST R8 K2 + 0x2C240303, // 000D AND R9 R1 K3 + 0x542A000F, // 000E LDINT R10 16 + 0x3C24120A, // 000F SHR R9 R9 R10 + 0x7C0C0C00, // 0010 CALL R3 6 + 0xB8120000, // 0011 GETNGBL R4 K0 + 0x8C100901, // 0012 GETMET R4 R4 K1 + 0x5C180400, // 0013 MOVE R6 R2 + 0x581C0002, // 0014 LDCONST R7 K2 + 0x54220063, // 0015 LDINT R8 100 + 0x58240002, // 0016 LDCONST R9 K2 + 0x542AFEFF, // 0017 LDINT R10 65280 + 0x2C28020A, // 0018 AND R10 R1 R10 + 0x542E0007, // 0019 LDINT R11 8 + 0x3C28140B, // 001A SHR R10 R10 R11 + 0x7C100C00, // 001B CALL R4 6 + 0xB8160000, // 001C GETNGBL R5 K0 + 0x8C140B01, // 001D GETMET R5 R5 K1 + 0x5C1C0400, // 001E MOVE R7 R2 + 0x58200002, // 001F LDCONST R8 K2 + 0x54260063, // 0020 LDINT R9 100 + 0x58280002, // 0021 LDCONST R10 K2 + 0x542E00FE, // 0022 LDINT R11 255 + 0x2C2C020B, // 0023 AND R11 R1 R11 + 0x7C140C00, // 0024 CALL R5 6 + 0x88180104, // 0025 GETMBR R6 R0 K4 + 0x781A0013, // 0026 JMPF R6 #003B + 0xB81A0A00, // 0027 GETNGBL R6 K5 + 0x8C180D06, // 0028 GETMET R6 R6 K6 + 0x5C200600, // 0029 MOVE R8 R3 + 0x7C180400, // 002A CALL R6 2 + 0x541E000F, // 002B LDINT R7 16 + 0x38180C07, // 002C SHL R6 R6 R7 + 0xB81E0A00, // 002D GETNGBL R7 K5 + 0x8C1C0F06, // 002E GETMET R7 R7 K6 + 0x5C240800, // 002F MOVE R9 R4 + 0x7C1C0400, // 0030 CALL R7 2 + 0x54220007, // 0031 LDINT R8 8 + 0x381C0E08, // 0032 SHL R7 R7 R8 + 0x30180C07, // 0033 OR R6 R6 R7 + 0xB81E0A00, // 0034 GETNGBL R7 K5 + 0x8C1C0F06, // 0035 GETMET R7 R7 K6 + 0x5C240A00, // 0036 MOVE R9 R5 + 0x7C1C0400, // 0037 CALL R7 2 + 0x30180C07, // 0038 OR R6 R6 R7 + 0x80040C00, // 0039 RET 1 R6 + 0x70020006, // 003A JMP #0042 + 0x541A000F, // 003B LDINT R6 16 + 0x38180606, // 003C SHL R6 R3 R6 + 0x541E0007, // 003D LDINT R7 8 + 0x381C0807, // 003E SHL R7 R4 R7 + 0x30180C07, // 003F OR R6 R6 R7 + 0x30180C05, // 0040 OR R6 R6 R5 + 0x80040C00, // 0041 RET 1 R6 + 0x80000000, // 0042 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: pixel_count +********************************************************************/ +be_local_closure(Leds_pixel_count, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(call_native), + }), + &be_const_str_pixel_count, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0007, // 0001 LDINT R3 8 + 0x7C040400, // 0002 CALL R1 2 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: matrix +********************************************************************/ +be_local_closure(Leds_matrix, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(Leds), + /* K1 */ be_nested_str(create_matrix), + /* K2 */ be_const_int(0), + }), + &be_const_str_matrix, + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0xB8120000, // 0000 GETNGBL R4 K0 + 0x08140001, // 0001 MUL R5 R0 R1 + 0x5C180400, // 0002 MOVE R6 R2 + 0x5C1C0600, // 0003 MOVE R7 R3 + 0x7C100600, // 0004 CALL R4 3 + 0x8C140901, // 0005 GETMET R5 R4 K1 + 0x5C1C0000, // 0006 MOVE R7 R0 + 0x5C200200, // 0007 MOVE R8 R1 + 0x58240002, // 0008 LDCONST R9 K2 + 0x7C140800, // 0009 CALL R5 4 + 0x80040A00, // 000A RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: pixel_size +********************************************************************/ +be_local_closure(Leds_pixel_size, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(call_native), + }), + &be_const_str_pixel_size, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0006, // 0001 LDINT R3 7 + 0x7C040400, // 0002 CALL R1 2 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: pixels_buffer +********************************************************************/ +be_local_closure(Leds_pixels_buffer, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(call_native), + }), + &be_const_str_pixels_buffer, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0005, // 0001 LDINT R3 6 + 0x7C040400, // 0002 CALL R1 2 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_pixel_color +********************************************************************/ +be_local_closure(Leds_get_pixel_color, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(call_native), + }), + &be_const_str_get_pixel_color, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 + 0x5412000A, // 0001 LDINT R4 11 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C080600, // 0003 CALL R2 3 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_pixel_color +********************************************************************/ +be_local_closure(Leds_set_pixel_color, /* name */ + be_nested_proto( + 12, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(call_native), + /* K1 */ be_nested_str(to_gamma), + }), + &be_const_str_set_pixel_color, + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x8C100100, // 0000 GETMET R4 R0 K0 + 0x541A0009, // 0001 LDINT R6 10 + 0x5C1C0200, // 0002 MOVE R7 R1 + 0x8C200101, // 0003 GETMET R8 R0 K1 + 0x5C280400, // 0004 MOVE R10 R2 + 0x5C2C0600, // 0005 MOVE R11 R3 + 0x7C200600, // 0006 CALL R8 3 + 0x7C100800, // 0007 CALL R4 4 + 0x80000000, // 0008 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: is_dirty +********************************************************************/ +be_local_closure(Leds_is_dirty, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(call_native), + }), + &be_const_str_is_dirty, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0003, // 0001 LDINT R3 4 + 0x7C040400, // 0002 CALL R1 2 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Leds_init, /* name */ + be_nested_proto( + 11, /* nstack */ + 5, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str(gamma), + /* K1 */ be_nested_str(leds), + /* K2 */ be_nested_str(pin), + /* K3 */ be_nested_str(WS2812), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str(valuer_error), + /* K6 */ be_nested_str(no_X20GPIO_X20specified_X20for_X20neopixelbus), + /* K7 */ be_nested_str(ctor), + /* K8 */ be_nested_str(_p), + /* K9 */ be_nested_str(internal_error), + /* K10 */ be_nested_str(couldn_X27t_X20not_X20initialize_X20noepixelbus), + /* K11 */ be_nested_str(begin), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[36]) { /* code */ + 0x50140200, // 0000 LDBOOL R5 1 0 + 0x90020005, // 0001 SETMBR R0 K0 R5 + 0x60140009, // 0002 GETGBL R5 G9 + 0x5C180200, // 0003 MOVE R6 R1 + 0x7C140200, // 0004 CALL R5 1 + 0x90020205, // 0005 SETMBR R0 K1 R5 + 0x4C140000, // 0006 LDNIL R5 + 0x1C140405, // 0007 EQ R5 R2 R5 + 0x78160008, // 0008 JMPF R5 #0012 + 0x8C140502, // 0009 GETMET R5 R2 K2 + 0x881C0503, // 000A GETMBR R7 R2 K3 + 0x7C140400, // 000B CALL R5 2 + 0x28140B04, // 000C GE R5 R5 K4 + 0x78160003, // 000D JMPF R5 #0012 + 0x8C140502, // 000E GETMET R5 R2 K2 + 0x881C0503, // 000F GETMBR R7 R2 K3 + 0x7C140400, // 0010 CALL R5 2 + 0x5C080A00, // 0011 MOVE R2 R5 + 0x4C140000, // 0012 LDNIL R5 + 0x1C140405, // 0013 EQ R5 R2 R5 + 0x78160000, // 0014 JMPF R5 #0016 + 0xB0060B06, // 0015 RAISE 1 K5 K6 + 0x8C140107, // 0016 GETMET R5 R0 K7 + 0x881C0101, // 0017 GETMBR R7 R0 K1 + 0x5C200400, // 0018 MOVE R8 R2 + 0x5C240600, // 0019 MOVE R9 R3 + 0x5C280800, // 001A MOVE R10 R4 + 0x7C140A00, // 001B CALL R5 5 + 0x88140108, // 001C GETMBR R5 R0 K8 + 0x4C180000, // 001D LDNIL R6 + 0x1C140A06, // 001E EQ R5 R5 R6 + 0x78160000, // 001F JMPF R5 #0021 + 0xB006130A, // 0020 RAISE 1 K9 K10 + 0x8C14010B, // 0021 GETMET R5 R0 K11 + 0x7C140200, // 0022 CALL R5 1 + 0x80000000, // 0023 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: clear_to +********************************************************************/ +be_local_closure(Leds_clear_to, /* name */ + be_nested_proto( + 10, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(call_native), + /* K1 */ be_nested_str(to_gamma), + }), + &be_const_str_clear_to, + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x8C0C0100, // 0000 GETMET R3 R0 K0 + 0x54160008, // 0001 LDINT R5 9 + 0x8C180101, // 0002 GETMET R6 R0 K1 + 0x5C200200, // 0003 MOVE R8 R1 + 0x5C240400, // 0004 MOVE R9 R2 + 0x7C180600, // 0005 CALL R6 3 + 0x7C0C0600, // 0006 CALL R3 3 + 0x80000000, // 0007 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: can_show +********************************************************************/ +be_local_closure(Leds_can_show, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(call_native), + /* K1 */ be_const_int(3), + }), + &be_const_str_can_show, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x580C0001, // 0001 LDCONST R3 K1 + 0x7C040400, // 0002 CALL R1 2 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: clear +********************************************************************/ +be_local_closure(Leds_clear, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(clear_to), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(show), + }), + &be_const_str_clear, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x580C0001, // 0001 LDCONST R3 K1 + 0x7C040400, // 0002 CALL R1 2 + 0x8C040102, // 0003 GETMET R1 R0 K2 + 0x7C040200, // 0004 CALL R1 1 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: show +********************************************************************/ +be_local_closure(Leds_show, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(call_native), + /* K1 */ be_const_int(2), + }), + &be_const_str_show, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x580C0001, // 0001 LDCONST R3 K1 + 0x7C040400, // 0002 CALL R1 2 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: ctor +********************************************************************/ +be_local_closure(Leds_ctor, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(call_native), + /* K1 */ be_const_int(0), + }), + &be_const_str_ctor, + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x4C100000, // 0000 LDNIL R4 + 0x1C100604, // 0001 EQ R4 R3 R4 + 0x78120005, // 0002 JMPF R4 #0009 + 0x8C100100, // 0003 GETMET R4 R0 K0 + 0x58180001, // 0004 LDCONST R6 K1 + 0x5C1C0200, // 0005 MOVE R7 R1 + 0x5C200400, // 0006 MOVE R8 R2 + 0x7C100800, // 0007 CALL R4 4 + 0x70020005, // 0008 JMP #000F + 0x8C100100, // 0009 GETMET R4 R0 K0 + 0x58180001, // 000A LDCONST R6 K1 + 0x5C1C0200, // 000B MOVE R7 R1 + 0x5C200400, // 000C MOVE R8 R2 + 0x5C240600, // 000D MOVE R9 R3 + 0x7C100A00, // 000E CALL R4 5 + 0x80000000, // 000F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: dirty +********************************************************************/ +be_local_closure(Leds_dirty, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(call_native), + }), + &be_const_str_dirty, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0004, // 0001 LDINT R3 5 + 0x7C040400, // 0002 CALL R1 2 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_pixel_color +********************************************************************/ +be_local_closure(Leds_segment_get_pixel_color, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(get_pixel_color), + /* K2 */ be_nested_str(offseta), + }), + &be_const_str_get_pixel_color, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x88100102, // 0002 GETMBR R4 R0 K2 + 0x00100204, // 0003 ADD R4 R1 R4 + 0x7C080400, // 0004 CALL R2 2 + 0x80040400, // 0005 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: clear_to +********************************************************************/ +be_local_closure(Leds_segment_clear_to, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str(leds), + /* K2 */ be_nested_str(strip), + /* K3 */ be_nested_str(set_pixel_color), + /* K4 */ be_nested_str(offset), + /* K5 */ be_const_int(1), + }), + &be_const_str_clear_to, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x580C0000, // 0000 LDCONST R3 K0 + 0x88100101, // 0001 GETMBR R4 R0 K1 + 0x14100604, // 0002 LT R4 R3 R4 + 0x78120008, // 0003 JMPF R4 #000D + 0x88100102, // 0004 GETMBR R4 R0 K2 + 0x8C100903, // 0005 GETMET R4 R4 K3 + 0x88180104, // 0006 GETMBR R6 R0 K4 + 0x00180606, // 0007 ADD R6 R3 R6 + 0x5C1C0200, // 0008 MOVE R7 R1 + 0x5C200400, // 0009 MOVE R8 R2 + 0x7C100800, // 000A CALL R4 4 + 0x000C0705, // 000B ADD R3 R3 K5 + 0x7001FFF3, // 000C JMP #0001 + 0x80000000, // 000D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: can_show +********************************************************************/ +be_local_closure(Leds_segment_can_show, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(can_show), + }), + &be_const_str_can_show, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_pixel_color +********************************************************************/ +be_local_closure(Leds_segment_set_pixel_color, /* name */ + be_nested_proto( + 9, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(set_pixel_color), + /* K2 */ be_nested_str(offset), + }), + &be_const_str_set_pixel_color, + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x88100100, // 0000 GETMBR R4 R0 K0 + 0x8C100901, // 0001 GETMET R4 R4 K1 + 0x88180102, // 0002 GETMBR R6 R0 K2 + 0x00180206, // 0003 ADD R6 R1 R6 + 0x5C1C0400, // 0004 MOVE R7 R2 + 0x5C200600, // 0005 MOVE R8 R3 + 0x7C100800, // 0006 CALL R4 4 + 0x80000000, // 0007 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: clear +********************************************************************/ +be_local_closure(Leds_segment_clear, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(clear_to), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(show), + }), + &be_const_str_clear, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x580C0001, // 0001 LDCONST R3 K1 + 0x7C040400, // 0002 CALL R1 2 + 0x8C040102, // 0003 GETMET R1 R0 K2 + 0x7C040200, // 0004 CALL R1 1 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: begin +********************************************************************/ +be_local_closure(Leds_segment_begin, /* name */ + be_nested_proto( + 1, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + &be_const_str_begin, + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: pixel_count +********************************************************************/ +be_local_closure(Leds_segment_pixel_count, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(leds), + }), + &be_const_str_pixel_count, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Leds_segment_init, /* name */ + be_nested_proto( + 6, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(offset), + /* K2 */ be_nested_str(leds), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x60100009, // 0001 GETGBL R4 G9 + 0x5C140400, // 0002 MOVE R5 R2 + 0x7C100200, // 0003 CALL R4 1 + 0x90020204, // 0004 SETMBR R0 K1 R4 + 0x60100009, // 0005 GETGBL R4 G9 + 0x5C140600, // 0006 MOVE R5 R3 + 0x7C100200, // 0007 CALL R4 1 + 0x90020404, // 0008 SETMBR R0 K2 R4 + 0x80000000, // 0009 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: pixel_size +********************************************************************/ +be_local_closure(Leds_segment_pixel_size, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(pixel_size), + }), + &be_const_str_pixel_size, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: dirty +********************************************************************/ +be_local_closure(Leds_segment_dirty, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(dirty), + }), + &be_const_str_dirty, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: show +********************************************************************/ +be_local_closure(Leds_segment_show, /* name */ + be_nested_proto( + 4, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(offset), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(leds), + /* K3 */ be_nested_str(strip), + /* K4 */ be_nested_str(show), + }), + &be_const_str_show, + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x60080017, // 0000 GETGBL R2 G23 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x7C080200, // 0002 CALL R2 1 + 0x740A0007, // 0003 JMPT R2 #000C + 0x88080100, // 0004 GETMBR R2 R0 K0 + 0x1C080501, // 0005 EQ R2 R2 K1 + 0x780A0007, // 0006 JMPF R2 #000F + 0x88080102, // 0007 GETMBR R2 R0 K2 + 0x880C0103, // 0008 GETMBR R3 R0 K3 + 0x880C0702, // 0009 GETMBR R3 R3 K2 + 0x1C080403, // 000A EQ R2 R2 R3 + 0x780A0002, // 000B JMPF R2 #000F + 0x88080103, // 000C GETMBR R2 R0 K3 + 0x8C080504, // 000D GETMET R2 R2 K4 + 0x7C080200, // 000E CALL R2 1 + 0x80000000, // 000F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: is_dirty +********************************************************************/ +be_local_closure(Leds_segment_is_dirty, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(strip), + /* K1 */ be_nested_str(is_dirty), + }), + &be_const_str_is_dirty, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: pixels_buffer +********************************************************************/ +be_local_closure(Leds_segment_pixels_buffer, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + &be_const_str_pixels_buffer, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x4C040000, // 0000 LDNIL R1 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Leds_segment +********************************************************************/ +be_local_class(Leds_segment, + 3, + NULL, + be_nested_map(16, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(get_pixel_color, -1), be_const_closure(Leds_segment_get_pixel_color_closure) }, + { be_const_key(strip, -1), be_const_var(0) }, + { be_const_key(clear_to, 5), be_const_closure(Leds_segment_clear_to_closure) }, + { be_const_key(can_show, 13), be_const_closure(Leds_segment_can_show_closure) }, + { be_const_key(set_pixel_color, -1), be_const_closure(Leds_segment_set_pixel_color_closure) }, + { be_const_key(clear, -1), be_const_closure(Leds_segment_clear_closure) }, + { be_const_key(is_dirty, -1), be_const_closure(Leds_segment_is_dirty_closure) }, + { be_const_key(pixel_count, -1), be_const_closure(Leds_segment_pixel_count_closure) }, + { be_const_key(leds, -1), be_const_var(2) }, + { be_const_key(pixel_size, -1), be_const_closure(Leds_segment_pixel_size_closure) }, + { be_const_key(offset, -1), be_const_var(1) }, + { be_const_key(dirty, 8), be_const_closure(Leds_segment_dirty_closure) }, + { be_const_key(show, -1), be_const_closure(Leds_segment_show_closure) }, + { be_const_key(init, -1), be_const_closure(Leds_segment_init_closure) }, + { be_const_key(begin, 6), be_const_closure(Leds_segment_begin_closure) }, + { be_const_key(pixels_buffer, -1), be_const_closure(Leds_segment_pixels_buffer_closure) }, + })), + be_str_literal("Leds_segment") +); + +/******************************************************************** +** Solidified function: create_segment +********************************************************************/ +be_local_closure(Leds_create_segment, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(leds), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(value_error), + /* K3 */ be_nested_str(out_X20of_X20range), + /* K4 */ be_const_class(be_class_Leds_segment), + }), + &be_const_str_create_segment, + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0x600C0009, // 0000 GETGBL R3 G9 + 0x5C100200, // 0001 MOVE R4 R1 + 0x7C0C0200, // 0002 CALL R3 1 + 0x60100009, // 0003 GETGBL R4 G9 + 0x5C140400, // 0004 MOVE R5 R2 + 0x7C100200, // 0005 CALL R4 1 + 0x000C0604, // 0006 ADD R3 R3 R4 + 0x88100100, // 0007 GETMBR R4 R0 K0 + 0x240C0604, // 0008 GT R3 R3 R4 + 0x740E0003, // 0009 JMPT R3 #000E + 0x140C0301, // 000A LT R3 R1 K1 + 0x740E0001, // 000B JMPT R3 #000E + 0x140C0501, // 000C LT R3 R2 K1 + 0x780E0000, // 000D JMPF R3 #000F + 0xB0060503, // 000E RAISE 1 K2 K3 + 0x580C0004, // 000F LDCONST R3 K4 + 0xB4000004, // 0010 CLASS K4 + 0x5C100600, // 0011 MOVE R4 R3 + 0x5C140000, // 0012 MOVE R5 R0 + 0x5C180200, // 0013 MOVE R6 R1 + 0x5C1C0400, // 0014 MOVE R7 R2 + 0x7C100600, // 0015 CALL R4 3 + 0x80040800, // 0016 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Leds +********************************************************************/ +extern const bclass be_class_Leds_ntv; +be_local_class(Leds, + 2, + &be_class_Leds_ntv, + be_nested_map(20, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(pixel_count, -1), be_const_closure(Leds_pixel_count_closure) }, + { be_const_key(dirty, 6), be_const_closure(Leds_dirty_closure) }, + { be_const_key(to_gamma, -1), be_const_closure(Leds_to_gamma_closure) }, + { be_const_key(create_matrix, 1), be_const_closure(Leds_create_matrix_closure) }, + { be_const_key(matrix, -1), be_const_static_closure(Leds_matrix_closure) }, + { be_const_key(pixel_size, -1), be_const_closure(Leds_pixel_size_closure) }, + { be_const_key(ctor, 0), be_const_closure(Leds_ctor_closure) }, + { be_const_key(pixels_buffer, 13), be_const_closure(Leds_pixels_buffer_closure) }, + { be_const_key(get_pixel_color, -1), be_const_closure(Leds_get_pixel_color_closure) }, + { be_const_key(show, -1), be_const_closure(Leds_show_closure) }, + { be_const_key(begin, 17), be_const_closure(Leds_begin_closure) }, + { be_const_key(leds, -1), be_const_var(1) }, + { be_const_key(clear, -1), be_const_closure(Leds_clear_closure) }, + { be_const_key(can_show, -1), be_const_closure(Leds_can_show_closure) }, + { be_const_key(gamma, 12), be_const_var(0) }, + { be_const_key(init, 11), be_const_closure(Leds_init_closure) }, + { be_const_key(set_pixel_color, 9), be_const_closure(Leds_set_pixel_color_closure) }, + { be_const_key(clear_to, 18), be_const_closure(Leds_clear_to_closure) }, + { be_const_key(is_dirty, -1), be_const_closure(Leds_is_dirty_closure) }, + { be_const_key(create_segment, -1), be_const_closure(Leds_create_segment_closure) }, + })), + be_str_literal("Leds") +); +/*******************************************************************/ + +void be_load_Leds_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Leds); + be_setglobal(vm, "Leds"); + be_pop(vm, 1); +} + +#endif // USE_WS2812 diff --git a/lib/libesp32/berry/default/be_leds_ntv_lib.c b/lib/libesp32/berry/default/be_leds_ntv_lib.c new file mode 100644 index 000000000..4d5b07bb6 --- /dev/null +++ b/lib/libesp32/berry/default/be_leds_ntv_lib.c @@ -0,0 +1,50 @@ +/******************************************************************** + * Berry class `neopixelbus_ntv` + * + *******************************************************************/ +/* + +class Leds_ntv + var _p # pointer to internal object of type `NeoPixelBus(uint16_t countPixels, uint8_t pin)` + var _t # type of led strip + static WS2812_GRB = 1 + static SK6812_GRBW = 2 + + # skeleton for native call + def call_native() end +end + +*/ +#include "be_constobj.h" + +#ifdef USE_WS2812 + +extern int be_neopixelbus_call_native(bvm *vm); + + +/******************************************************************** +** Solidified class: Leds_ntv +********************************************************************/ +be_local_class(Leds_ntv, + 2, + NULL, + be_nested_map(5, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(call_native, -1), be_const_func(be_neopixelbus_call_native) }, + { be_const_key(_t, -1), be_const_var(1) }, + { be_const_key(_p, 3), be_const_var(0) }, + { be_const_key(SK6812_GRBW, 4), be_const_int(2) }, + { be_const_key(WS2812_GRB, -1), be_const_int(1) }, + })), + be_str_literal("Leds_ntv") +); +/*******************************************************************/ + +void be_load_Leds_ntv_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Leds_ntv); + be_setglobal(vm, "Leds_ntv"); + be_pop(vm, 1); +} + +// be_const_func(be_neopixelbus_call_native) +#endif // USE_WS2812 diff --git a/lib/libesp32/berry/default/be_light_lib.c b/lib/libesp32/berry/default/be_light_lib.c new file mode 100644 index 000000000..6d020eca8 --- /dev/null +++ b/lib/libesp32/berry/default/be_light_lib.c @@ -0,0 +1,28 @@ +/******************************************************************** + * Tasmota lib + * + * To use: `import tasmota` + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_LIGHT +extern int l_getlight(bvm *vm); +extern int l_setlight(bvm *vm); + +extern int l_gamma8(bvm *vm); +extern int l_gamma10(bvm *vm); +extern int l_rev_gamma10(bvm *vm); + +/* @const_object_info_begin +module light (scope: global) { + get, func(l_getlight) + set, func(l_setlight) + + gamma8, func(l_gamma8) + gamma10, func(l_gamma10) + reverse_gamma10, func(l_rev_gamma10) +} +@const_object_info_end */ +#include "../generate/be_fixed_light.h" + +#endif // USE_LIGHT \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_lvgl_clock_icon_lib.c b/lib/libesp32/berry/default/be_lvgl_clock_icon_lib.c new file mode 100644 index 000000000..c9cf7f207 --- /dev/null +++ b/lib/libesp32/berry/default/be_lvgl_clock_icon_lib.c @@ -0,0 +1,313 @@ +/******************************************************************** + * Tasmota LVGL lv_signal_bars widget + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_LVGL + +#include "lvgl.h" + +/******************************************************************** +** Solidified function: set_time +********************************************************************/ +be_local_closure(lv_clock_icon_set_time, /* name */ + be_nested_proto( + 11, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(hour), + /* K2 */ be_nested_str(minute), + /* K3 */ be_nested_str(sec), + /* K4 */ be_nested_str(format), + /* K5 */ be_nested_str(_X2502d_X25s_X2502d), + /* K6 */ be_const_int(2), + /* K7 */ be_nested_str(_X3A), + /* K8 */ be_nested_str(_X20), + /* K9 */ be_nested_str(set_text), + }), + &be_const_str_set_time, + &be_const_str_solidified, + ( &(const binstruction[27]) { /* code */ + 0xA4120000, // 0000 IMPORT R4 K0 + 0x88140101, // 0001 GETMBR R5 R0 K1 + 0x20140205, // 0002 NE R5 R1 R5 + 0x74160005, // 0003 JMPT R5 #000A + 0x88140102, // 0004 GETMBR R5 R0 K2 + 0x20140405, // 0005 NE R5 R2 R5 + 0x74160002, // 0006 JMPT R5 #000A + 0x88140103, // 0007 GETMBR R5 R0 K3 + 0x20140605, // 0008 NE R5 R3 R5 + 0x7816000F, // 0009 JMPF R5 #001A + 0x8C140904, // 000A GETMET R5 R4 K4 + 0x581C0005, // 000B LDCONST R7 K5 + 0x5C200200, // 000C MOVE R8 R1 + 0x10240706, // 000D MOD R9 R3 K6 + 0x78260001, // 000E JMPF R9 #0011 + 0x58240007, // 000F LDCONST R9 K7 + 0x70020000, // 0010 JMP #0012 + 0x58240008, // 0011 LDCONST R9 K8 + 0x5C280400, // 0012 MOVE R10 R2 + 0x7C140A00, // 0013 CALL R5 5 + 0x90020201, // 0014 SETMBR R0 K1 R1 + 0x90020402, // 0015 SETMBR R0 K2 R2 + 0x90020603, // 0016 SETMBR R0 K3 R3 + 0x8C180109, // 0017 GETMET R6 R0 K9 + 0x5C200A00, // 0018 MOVE R8 R5 + 0x7C180400, // 0019 CALL R6 2 + 0x80000000, // 001A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(lv_clock_icon_every_second, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(time_dump), + /* K2 */ be_nested_str(rtc), + /* K3 */ be_nested_str(local), + /* K4 */ be_nested_str(year), + /* K5 */ be_nested_str(set_time), + /* K6 */ be_nested_str(hour), + /* K7 */ be_nested_str(min), + /* K8 */ be_nested_str(sec), + }), + &be_const_str_every_second, + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0xB80E0000, // 0002 GETNGBL R3 K0 + 0x8C0C0702, // 0003 GETMET R3 R3 K2 + 0x7C0C0200, // 0004 CALL R3 1 + 0x940C0703, // 0005 GETIDX R3 R3 K3 + 0x7C040400, // 0006 CALL R1 2 + 0x94080304, // 0007 GETIDX R2 R1 K4 + 0x540E07B1, // 0008 LDINT R3 1970 + 0x20080403, // 0009 NE R2 R2 R3 + 0x780A0004, // 000A JMPF R2 #0010 + 0x8C080105, // 000B GETMET R2 R0 K5 + 0x94100306, // 000C GETIDX R4 R1 K6 + 0x94140307, // 000D GETIDX R5 R1 K7 + 0x94180308, // 000E GETIDX R6 R1 K8 + 0x7C080800, // 000F CALL R2 4 + 0x80000000, // 0010 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_clock_icon_init, /* name */ + be_nested_proto( + 11, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[22]) { /* constants */ + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(lv), + /* K2 */ be_nested_str(seg7_font), + /* K3 */ be_nested_str(set_style_text_font), + /* K4 */ be_nested_str(PART_MAIN), + /* K5 */ be_nested_str(STATE_DEFAULT), + /* K6 */ be_nested_str(get_height), + /* K7 */ be_nested_str(set_text), + /* K8 */ be_nested_str(_X2D_X2D_X3A_X2D_X2D), + /* K9 */ be_nested_str(refr_size), + /* K10 */ be_nested_str(get_width), + /* K11 */ be_nested_str(set_y), + /* K12 */ be_const_int(2), + /* K13 */ be_nested_str(get_style_pad_right), + /* K14 */ be_nested_str(set_x), + /* K15 */ be_const_int(3), + /* K16 */ be_nested_str(set_style_pad_right), + /* K17 */ be_nested_str(set_style_bg_color), + /* K18 */ be_nested_str(color), + /* K19 */ be_nested_str(COLOR_BLACK), + /* K20 */ be_nested_str(tasmota), + /* K21 */ be_nested_str(add_driver), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[82]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0xB80A0200, // 0006 GETNGBL R2 K1 + 0x8C080502, // 0007 GETMET R2 R2 K2 + 0x5412000F, // 0008 LDINT R4 16 + 0x7C080400, // 0009 CALL R2 2 + 0x4C0C0000, // 000A LDNIL R3 + 0x200C0403, // 000B NE R3 R2 R3 + 0x780E0007, // 000C JMPF R3 #0015 + 0x8C0C0103, // 000D GETMET R3 R0 K3 + 0x5C140400, // 000E MOVE R5 R2 + 0xB81A0200, // 000F GETNGBL R6 K1 + 0x88180D04, // 0010 GETMBR R6 R6 K4 + 0xB81E0200, // 0011 GETNGBL R7 K1 + 0x881C0F05, // 0012 GETMBR R7 R7 K5 + 0x30180C07, // 0013 OR R6 R6 R7 + 0x7C0C0600, // 0014 CALL R3 3 + 0x4C0C0000, // 0015 LDNIL R3 + 0x200C0203, // 0016 NE R3 R1 R3 + 0x780E0034, // 0017 JMPF R3 #004D + 0x8C0C0306, // 0018 GETMET R3 R1 K6 + 0x7C0C0200, // 0019 CALL R3 1 + 0x8C100107, // 001A GETMET R4 R0 K7 + 0x58180008, // 001B LDCONST R6 K8 + 0x7C100400, // 001C CALL R4 2 + 0x8C100109, // 001D GETMET R4 R0 K9 + 0x7C100200, // 001E CALL R4 1 + 0x8C10010A, // 001F GETMET R4 R0 K10 + 0x7C100200, // 0020 CALL R4 1 + 0x8C14010B, // 0021 GETMET R5 R0 K11 + 0x8C1C0306, // 0022 GETMET R7 R1 K6 + 0x7C1C0200, // 0023 CALL R7 1 + 0x8C200106, // 0024 GETMET R8 R0 K6 + 0x7C200200, // 0025 CALL R8 1 + 0x041C0E08, // 0026 SUB R7 R7 R8 + 0x0C1C0F0C, // 0027 DIV R7 R7 K12 + 0x7C140400, // 0028 CALL R5 2 + 0x8C14030D, // 0029 GETMET R5 R1 K13 + 0xB81E0200, // 002A GETNGBL R7 K1 + 0x881C0F04, // 002B GETMBR R7 R7 K4 + 0xB8220200, // 002C GETNGBL R8 K1 + 0x88201105, // 002D GETMBR R8 R8 K5 + 0x301C0E08, // 002E OR R7 R7 R8 + 0x7C140400, // 002F CALL R5 2 + 0x8C18010E, // 0030 GETMET R6 R0 K14 + 0x8C20030A, // 0031 GETMET R8 R1 K10 + 0x7C200200, // 0032 CALL R8 1 + 0x04201004, // 0033 SUB R8 R8 R4 + 0x04201005, // 0034 SUB R8 R8 R5 + 0x0420110F, // 0035 SUB R8 R8 K15 + 0x7C180400, // 0036 CALL R6 2 + 0x8C180310, // 0037 GETMET R6 R1 K16 + 0x00200A04, // 0038 ADD R8 R5 R4 + 0x54260005, // 0039 LDINT R9 6 + 0x00201009, // 003A ADD R8 R8 R9 + 0xB8260200, // 003B GETNGBL R9 K1 + 0x88241304, // 003C GETMBR R9 R9 K4 + 0xB82A0200, // 003D GETNGBL R10 K1 + 0x88281505, // 003E GETMBR R10 R10 K5 + 0x3024120A, // 003F OR R9 R9 R10 + 0x7C180600, // 0040 CALL R6 3 + 0x8C180111, // 0041 GETMET R6 R0 K17 + 0xB8220200, // 0042 GETNGBL R8 K1 + 0x8C201112, // 0043 GETMET R8 R8 K18 + 0xB82A0200, // 0044 GETNGBL R10 K1 + 0x88281513, // 0045 GETMBR R10 R10 K19 + 0x7C200400, // 0046 CALL R8 2 + 0xB8260200, // 0047 GETNGBL R9 K1 + 0x88241304, // 0048 GETMBR R9 R9 K4 + 0xB82A0200, // 0049 GETNGBL R10 K1 + 0x88281505, // 004A GETMBR R10 R10 K5 + 0x3024120A, // 004B OR R9 R9 R10 + 0x7C180600, // 004C CALL R6 3 + 0xB80E2800, // 004D GETNGBL R3 K20 + 0x8C0C0715, // 004E GETMET R3 R3 K21 + 0x5C140000, // 004F MOVE R5 R0 + 0x7C0C0400, // 0050 CALL R3 2 + 0x80000000, // 0051 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: del +********************************************************************/ +be_local_closure(lv_clock_icon_del, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(del), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(remove_driver), + }), + &be_const_str_del, + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x60040003, // 0000 GETGBL R1 G3 + 0x5C080000, // 0001 MOVE R2 R0 + 0x7C040200, // 0002 CALL R1 1 + 0x8C040300, // 0003 GETMET R1 R1 K0 + 0x7C040200, // 0004 CALL R1 1 + 0xB8060200, // 0005 GETNGBL R1 K1 + 0x8C040302, // 0006 GETMET R1 R1 K2 + 0x5C0C0000, // 0007 MOVE R3 R0 + 0x7C040400, // 0008 CALL R1 2 + 0x80000000, // 0009 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_clock_icon +********************************************************************/ +extern const bclass be_class_lv_label; +be_local_class(lv_clock_icon, + 3, + &be_class_lv_label, + be_nested_map(7, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(sec, -1), be_const_var(2) }, + { be_const_key(hour, -1), be_const_var(0) }, + { be_const_key(set_time, 6), be_const_closure(lv_clock_icon_set_time_closure) }, + { be_const_key(every_second, -1), be_const_closure(lv_clock_icon_every_second_closure) }, + { be_const_key(minute, -1), be_const_var(1) }, + { be_const_key(init, 2), be_const_closure(lv_clock_icon_init_closure) }, + { be_const_key(del, -1), be_const_closure(lv_clock_icon_del_closure) }, + })), + be_str_literal("lv_clock_icon") +); +/*******************************************************************/ + +void be_load_lv_clock_icon_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_clock_icon); + be_setglobal(vm, "lv_clock_icon"); + be_pop(vm, 1); +} + +#endif // USE_LVGL \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_lvgl_ctypes_definitions.c b/lib/libesp32/berry/default/be_lvgl_ctypes_definitions.c new file mode 100644 index 000000000..bb1ffb65c --- /dev/null +++ b/lib/libesp32/berry/default/be_lvgl_ctypes_definitions.c @@ -0,0 +1,531 @@ +/******************************************************************** + * Tasmota LVGL ctypes mapping + *******************************************************************/ +#include "be_ctypes.h" + +#ifdef USE_LVGL + +#include "lvgl.h" +#include "be_lvgl.h" + +/******************************************************************** + * Generated code, don't edit + *******************************************************************/ + +static const char * be_ctypes_instance_mappings[]; /* forward definition */ + +const be_ctypes_structure_t be_lv_point = { + 4, /* size in bytes */ + 2, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[2]) { + { "x", 0, 0, 0, ctypes_i16, 0 }, + { "y", 2, 0, 0, ctypes_i16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_area = { + 8, /* size in bytes */ + 4, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[4]) { + { "x1", 0, 0, 0, ctypes_i16, 0 }, + { "x2", 4, 0, 0, ctypes_i16, 0 }, + { "y1", 2, 0, 0, ctypes_i16, 0 }, + { "y2", 6, 0, 0, ctypes_i16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_rect_dsc = { + 51, /* size in bytes */ + 29, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[29]) { + { "bg_color", 4, 0, 0, ctypes_u16, 1 }, + { "bg_grad_color", 6, 0, 0, ctypes_u16, 1 }, + { "bg_grad_color_stop", 9, 0, 0, ctypes_u8, 0 }, + { "bg_grad_dir", 11, 0, 3, ctypes_bf, 0 }, + { "bg_img_opa", 22, 0, 0, ctypes_u8, 0 }, + { "bg_img_recolor", 20, 0, 0, ctypes_u16, 1 }, + { "bg_img_recolor_opa", 23, 0, 0, ctypes_u8, 0 }, + { "bg_img_src", 12, 0, 0, ctypes_ptr32, 0 }, + { "bg_img_symbol_font", 16, 0, 0, ctypes_ptr32, 0 }, + { "bg_img_tiled", 24, 0, 0, ctypes_u8, 0 }, + { "bg_main_color_stop", 8, 0, 0, ctypes_u8, 0 }, + { "bg_opa", 10, 0, 0, ctypes_u8, 0 }, + { "blend_mode", 2, 0, 0, ctypes_u8, 0 }, + { "border_color", 26, 0, 0, ctypes_u16, 1 }, + { "border_opa", 30, 0, 0, ctypes_u8, 0 }, + { "border_post", 31, 0, 1, ctypes_bf, 0 }, + { "border_side", 31, 1, 5, ctypes_bf, 0 }, + { "border_width", 28, 0, 0, ctypes_i16, 0 }, + { "outline_color", 32, 0, 0, ctypes_u16, 1 }, + { "outline_opa", 38, 0, 0, ctypes_u8, 0 }, + { "outline_pad", 36, 0, 0, ctypes_i16, 0 }, + { "outline_width", 34, 0, 0, ctypes_i16, 0 }, + { "radius", 0, 0, 0, ctypes_i16, 0 }, + { "shadow_color", 40, 0, 0, ctypes_u16, 1 }, + { "shadow_ofs_x", 44, 0, 0, ctypes_i16, 0 }, + { "shadow_ofs_y", 46, 0, 0, ctypes_i16, 0 }, + { "shadow_opa", 50, 0, 0, ctypes_u8, 0 }, + { "shadow_spread", 48, 0, 0, ctypes_i16, 0 }, + { "shadow_width", 42, 0, 0, ctypes_i16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_line_dsc = { + 10, /* size in bytes */ + 9, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[9]) { + { "blend_mode", 9, 0, 2, ctypes_bf, 0 }, + { "color", 0, 0, 0, ctypes_u16, 1 }, + { "dash_gap", 6, 0, 0, ctypes_i16, 0 }, + { "dash_width", 4, 0, 0, ctypes_i16, 0 }, + { "opa", 8, 0, 0, ctypes_u8, 0 }, + { "raw_end", 9, 4, 1, ctypes_bf, 0 }, + { "round_end", 9, 3, 1, ctypes_bf, 0 }, + { "round_start", 9, 2, 1, ctypes_bf, 0 }, + { "width", 2, 0, 0, ctypes_i16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_img_dsc = { + 21, /* size in bytes */ + 10, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[10]) { + { "angle", 0, 0, 0, ctypes_u16, 0 }, + { "antialias", 20, 0, 1, ctypes_bf, 0 }, + { "blend_mode", 12, 0, 4, ctypes_bf, 0 }, + { "frame_id", 16, 0, 0, ctypes_i32, 0 }, + { "opa", 11, 0, 0, ctypes_u8, 0 }, + { "pivot_x", 4, 0, 0, ctypes_i16, 0 }, + { "pivot_y", 6, 0, 0, ctypes_i16, 0 }, + { "recolor", 8, 0, 0, ctypes_u16, 1 }, + { "recolor_opa", 10, 0, 0, ctypes_u8, 0 }, + { "zoom", 2, 0, 0, ctypes_u16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_mask_common_dsc = { + 5, /* size in bytes */ + 2, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[2]) { + { "cb", 0, 0, 0, ctypes_ptr32, 0 }, + { "type", 4, 0, 0, ctypes_u8, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_mask_line_param_cfg = { + 9, /* size in bytes */ + 5, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[5]) { + { "p1_x", 0, 0, 0, ctypes_i16, 0 }, + { "p1_y", 2, 0, 0, ctypes_i16, 0 }, + { "p2_x", 4, 0, 0, ctypes_i16, 0 }, + { "p2_y", 6, 0, 0, ctypes_i16, 0 }, + { "side", 8, 0, 2, ctypes_bf, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_mask_line_param = { + 41, /* size in bytes */ + 15, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[15]) { + { "cfg_p1_x", 8, 0, 0, ctypes_i16, 0 }, + { "cfg_p1_y", 10, 0, 0, ctypes_i16, 0 }, + { "cfg_p2_x", 12, 0, 0, ctypes_i16, 0 }, + { "cfg_p2_y", 14, 0, 0, ctypes_i16, 0 }, + { "cfg_side", 16, 0, 2, ctypes_bf, 0 }, + { "dsc_cb", 0, 0, 0, ctypes_ptr32, 0 }, + { "dsc_type", 4, 0, 0, ctypes_u8, 0 }, + { "flat", 40, 0, 1, ctypes_bf, 0 }, + { "inv", 40, 1, 1, ctypes_bf, 0 }, + { "origo_x", 20, 0, 0, ctypes_i16, 0 }, + { "origo_y", 22, 0, 0, ctypes_i16, 0 }, + { "spx", 36, 0, 0, ctypes_i32, 0 }, + { "steep", 32, 0, 0, ctypes_i32, 0 }, + { "xy_steep", 24, 0, 0, ctypes_i32, 0 }, + { "yx_steep", 28, 0, 0, ctypes_i32, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_mask_angle_param_cfg = { + 8, /* size in bytes */ + 4, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[4]) { + { "end_angle", 6, 0, 0, ctypes_i16, 0 }, + { "start_angle", 4, 0, 0, ctypes_i16, 0 }, + { "vertex_p_x", 0, 0, 0, ctypes_i16, 0 }, + { "vertex_p_y", 2, 0, 0, ctypes_i16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_mask_angle_param = { + 104, /* size in bytes */ + 37, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[37]) { + { "cfg_end_angle", 14, 0, 0, ctypes_i16, 0 }, + { "cfg_start_angle", 12, 0, 0, ctypes_i16, 0 }, + { "cfg_vertex_p_x", 8, 0, 0, ctypes_i16, 0 }, + { "cfg_vertex_p_y", 10, 0, 0, ctypes_i16, 0 }, + { "delta_deg", 102, 0, 0, ctypes_u16, 0 }, + { "dsc_cb", 0, 0, 0, ctypes_ptr32, 0 }, + { "dsc_type", 4, 0, 0, ctypes_u8, 0 }, + { "end_line_cfg_p1_x", 68, 0, 0, ctypes_i16, 0 }, + { "end_line_cfg_p1_y", 70, 0, 0, ctypes_i16, 0 }, + { "end_line_cfg_p2_x", 72, 0, 0, ctypes_i16, 0 }, + { "end_line_cfg_p2_y", 74, 0, 0, ctypes_i16, 0 }, + { "end_line_cfg_side", 76, 0, 2, ctypes_bf, 0 }, + { "end_line_dsc_cb", 60, 0, 0, ctypes_ptr32, 0 }, + { "end_line_dsc_type", 64, 0, 0, ctypes_u8, 0 }, + { "end_line_flat", 100, 0, 1, ctypes_bf, 0 }, + { "end_line_inv", 100, 1, 1, ctypes_bf, 0 }, + { "end_line_origo_x", 80, 0, 0, ctypes_i16, 0 }, + { "end_line_origo_y", 82, 0, 0, ctypes_i16, 0 }, + { "end_line_spx", 96, 0, 0, ctypes_i32, 0 }, + { "end_line_steep", 92, 0, 0, ctypes_i32, 0 }, + { "end_line_xy_steep", 84, 0, 0, ctypes_i32, 0 }, + { "end_line_yx_steep", 88, 0, 0, ctypes_i32, 0 }, + { "start_line_cfg_p1_x", 24, 0, 0, ctypes_i16, 0 }, + { "start_line_cfg_p1_y", 26, 0, 0, ctypes_i16, 0 }, + { "start_line_cfg_p2_x", 28, 0, 0, ctypes_i16, 0 }, + { "start_line_cfg_p2_y", 30, 0, 0, ctypes_i16, 0 }, + { "start_line_cfg_side", 32, 0, 2, ctypes_bf, 0 }, + { "start_line_dsc_cb", 16, 0, 0, ctypes_ptr32, 0 }, + { "start_line_dsc_type", 20, 0, 0, ctypes_u8, 0 }, + { "start_line_flat", 56, 0, 1, ctypes_bf, 0 }, + { "start_line_inv", 56, 1, 1, ctypes_bf, 0 }, + { "start_line_origo_x", 36, 0, 0, ctypes_i16, 0 }, + { "start_line_origo_y", 38, 0, 0, ctypes_i16, 0 }, + { "start_line_spx", 52, 0, 0, ctypes_i32, 0 }, + { "start_line_steep", 48, 0, 0, ctypes_i32, 0 }, + { "start_line_xy_steep", 40, 0, 0, ctypes_i32, 0 }, + { "start_line_yx_steep", 44, 0, 0, ctypes_i32, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_mask_radius_param_cfg = { + 11, /* size in bytes */ + 6, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[6]) { + { "outer", 10, 0, 1, ctypes_bf, 0 }, + { "radius", 8, 0, 0, ctypes_i16, 0 }, + { "rect_x1", 0, 0, 0, ctypes_i16, 0 }, + { "rect_x2", 4, 0, 0, ctypes_i16, 0 }, + { "rect_y1", 2, 0, 0, ctypes_i16, 0 }, + { "rect_y2", 6, 0, 0, ctypes_i16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_sqrt_res = { + 4, /* size in bytes */ + 2, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[2]) { + { "f", 2, 0, 0, ctypes_u16, 0 }, + { "i", 0, 0, 0, ctypes_u16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_mask_radius_param = { + 28, /* size in bytes */ + 11, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[11]) { + { "cfg_outer", 18, 0, 1, ctypes_bf, 0 }, + { "cfg_radius", 16, 0, 0, ctypes_i16, 0 }, + { "cfg_rect_x1", 8, 0, 0, ctypes_i16, 0 }, + { "cfg_rect_x2", 12, 0, 0, ctypes_i16, 0 }, + { "cfg_rect_y1", 10, 0, 0, ctypes_i16, 0 }, + { "cfg_rect_y2", 14, 0, 0, ctypes_i16, 0 }, + { "dsc_cb", 0, 0, 0, ctypes_ptr32, 0 }, + { "dsc_type", 4, 0, 0, ctypes_u8, 0 }, + { "y_prev", 20, 0, 0, ctypes_i32, 0 }, + { "y_prev_x_f", 26, 0, 0, ctypes_u16, 0 }, + { "y_prev_x_i", 24, 0, 0, ctypes_u16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_mask_fade_param_cfg = { + 14, /* size in bytes */ + 8, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[8]) { + { "coords_x1", 0, 0, 0, ctypes_i16, 0 }, + { "coords_x2", 4, 0, 0, ctypes_i16, 0 }, + { "coords_y1", 2, 0, 0, ctypes_i16, 0 }, + { "coords_y2", 6, 0, 0, ctypes_i16, 0 }, + { "opa_bottom", 13, 0, 0, ctypes_u8, 0 }, + { "opa_top", 12, 0, 0, ctypes_u8, 0 }, + { "y_bottom", 10, 0, 0, ctypes_i16, 0 }, + { "y_top", 8, 0, 0, ctypes_i16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_mask_fade_param = { + 22, /* size in bytes */ + 10, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[10]) { + { "cfg_coords_x1", 8, 0, 0, ctypes_i16, 0 }, + { "cfg_coords_x2", 12, 0, 0, ctypes_i16, 0 }, + { "cfg_coords_y1", 10, 0, 0, ctypes_i16, 0 }, + { "cfg_coords_y2", 14, 0, 0, ctypes_i16, 0 }, + { "cfg_opa_bottom", 21, 0, 0, ctypes_u8, 0 }, + { "cfg_opa_top", 20, 0, 0, ctypes_u8, 0 }, + { "cfg_y_bottom", 18, 0, 0, ctypes_i16, 0 }, + { "cfg_y_top", 16, 0, 0, ctypes_i16, 0 }, + { "dsc_cb", 0, 0, 0, ctypes_ptr32, 0 }, + { "dsc_type", 4, 0, 0, ctypes_u8, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_mask_map_param_cfg = { + 12, /* size in bytes */ + 5, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[5]) { + { "coords_x1", 0, 0, 0, ctypes_i16, 0 }, + { "coords_x2", 4, 0, 0, ctypes_i16, 0 }, + { "coords_y1", 2, 0, 0, ctypes_i16, 0 }, + { "coords_y2", 6, 0, 0, ctypes_i16, 0 }, + { "map", 8, 0, 0, ctypes_ptr32, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_mask_map_param = { + 20, /* size in bytes */ + 7, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[7]) { + { "cfg_coords_x1", 8, 0, 0, ctypes_i16, 0 }, + { "cfg_coords_x2", 12, 0, 0, ctypes_i16, 0 }, + { "cfg_coords_y1", 10, 0, 0, ctypes_i16, 0 }, + { "cfg_coords_y2", 14, 0, 0, ctypes_i16, 0 }, + { "cfg_map", 16, 0, 0, ctypes_ptr32, 0 }, + { "dsc_cb", 0, 0, 0, ctypes_ptr32, 0 }, + { "dsc_type", 4, 0, 0, ctypes_u8, 0 }, +}}; + +const be_ctypes_structure_t be_lv_draw_mask_saved = { + 8, /* size in bytes */ + 2, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[2]) { + { "custom_id", 4, 0, 0, ctypes_ptr32, 0 }, + { "param", 0, 0, 0, ctypes_ptr32, 0 }, +}}; + +const be_ctypes_structure_t be_lv_meter_scale = { + 34, /* size in bytes */ + 15, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[15]) { + { "angle_range", 30, 0, 0, ctypes_u16, 0 }, + { "label_color", 18, 0, 0, ctypes_i16, 0 }, + { "label_gap", 16, 0, 0, ctypes_i16, 0 }, + { "max", 24, 0, 0, ctypes_i32, 0 }, + { "min", 20, 0, 0, ctypes_i32, 0 }, + { "r_mod", 28, 0, 0, ctypes_i16, 0 }, + { "rotation", 32, 0, 0, ctypes_i16, 0 }, + { "tick_cnt", 2, 0, 0, ctypes_u16, 0 }, + { "tick_color", 0, 0, 0, ctypes_u16, 1 }, + { "tick_length", 4, 0, 0, ctypes_u16, 0 }, + { "tick_major_color", 8, 0, 0, ctypes_u16, 1 }, + { "tick_major_length", 12, 0, 0, ctypes_u16, 0 }, + { "tick_major_nth", 10, 0, 0, ctypes_u16, 0 }, + { "tick_major_width", 14, 0, 0, ctypes_u16, 0 }, + { "tick_width", 6, 0, 0, ctypes_u16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_meter_indicator = { + 16, /* size in bytes */ + 5, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[5]) { + { "end_value", 12, 0, 0, ctypes_i32, 0 }, + { "opa", 5, 0, 0, ctypes_u8, 0 }, + { "scale", 0, 0, 0, ctypes_ptr32, 0 }, + { "start_value", 8, 0, 0, ctypes_i32, 0 }, + { "type", 4, 0, 0, ctypes_u8, 0 }, +}}; + +const be_ctypes_structure_t be_lv_meter_indicator_needle_img = { + 24, /* size in bytes */ + 8, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[8]) { + { "end_value", 12, 0, 0, ctypes_i32, 0 }, + { "opa", 5, 0, 0, ctypes_u8, 0 }, + { "pivot_x", 20, 0, 0, ctypes_i16, 0 }, + { "pivot_y", 22, 0, 0, ctypes_i16, 0 }, + { "scale", 0, 0, 0, ctypes_ptr32, 0 }, + { "src", 16, 0, 0, ctypes_ptr32, 0 }, + { "start_value", 8, 0, 0, ctypes_i32, 0 }, + { "type", 4, 0, 0, ctypes_u8, 0 }, +}}; + +const be_ctypes_structure_t be_lv_meter_indicator_needle_line = { + 22, /* size in bytes */ + 8, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[8]) { + { "color", 20, 0, 0, ctypes_u16, 1 }, + { "end_value", 12, 0, 0, ctypes_i32, 0 }, + { "opa", 5, 0, 0, ctypes_u8, 0 }, + { "r_mod", 18, 0, 0, ctypes_i16, 0 }, + { "scale", 0, 0, 0, ctypes_ptr32, 0 }, + { "start_value", 8, 0, 0, ctypes_i32, 0 }, + { "type", 4, 0, 0, ctypes_u8, 0 }, + { "width", 16, 0, 0, ctypes_u16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_meter_indicator_arc = { + 28, /* size in bytes */ + 9, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[9]) { + { "color", 24, 0, 0, ctypes_u16, 1 }, + { "end_value", 12, 0, 0, ctypes_i32, 0 }, + { "opa", 5, 0, 0, ctypes_u8, 0 }, + { "r_mod", 26, 0, 0, ctypes_i16, 0 }, + { "scale", 0, 0, 0, ctypes_ptr32, 0 }, + { "src", 20, 0, 0, ctypes_ptr32, 0 }, + { "start_value", 8, 0, 0, ctypes_i32, 0 }, + { "type", 4, 0, 0, ctypes_u8, 0 }, + { "width", 16, 0, 0, ctypes_u16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_meter_indicator_scale_lines = { + 23, /* size in bytes */ + 9, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[9]) { + { "color_end", 20, 0, 0, ctypes_u16, 1 }, + { "color_start", 18, 0, 0, ctypes_u16, 1 }, + { "end_value", 12, 0, 0, ctypes_i32, 0 }, + { "local_grad", 22, 0, 1, ctypes_bf, 0 }, + { "opa", 5, 0, 0, ctypes_u8, 0 }, + { "scale", 0, 0, 0, ctypes_ptr32, 0 }, + { "start_value", 8, 0, 0, ctypes_i32, 0 }, + { "type", 4, 0, 0, ctypes_u8, 0 }, + { "width_mod", 16, 0, 0, ctypes_i16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_obj_class = { + 27, /* size in bytes */ + 10, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[10]) { + { "base_class", 0, 0, 0, ctypes_ptr32, 0 }, + { "constructor_cb", 4, 0, 0, ctypes_ptr32, 0 }, + { "destructor_cb", 8, 0, 0, ctypes_ptr32, 0 }, + { "editable", 24, 0, 2, ctypes_bf, 0 }, + { "event_cb", 16, 0, 0, ctypes_ptr32, 0 }, + { "group_def", 24, 2, 2, ctypes_bf, 0 }, + { "height_def", 22, 0, 0, ctypes_i16, 0 }, + { "instance_size", 24, 4, 16, ctypes_bf, 0 }, + { "user_data", 12, 0, 0, ctypes_ptr32, 0 }, + { "width_def", 20, 0, 0, ctypes_i16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_event = { + 25, /* size in bytes */ + 7, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[7]) { + { "code", 8, 0, 0, ctypes_i32, 0 }, + { "current_target", 4, 0, 0, ctypes_ptr32, 0 }, + { "deleted", 24, 0, 1, ctypes_bf, 0 }, + { "param", 16, 0, 0, ctypes_ptr32, 0 }, + { "prev", 20, 0, 0, ctypes_ptr32, 0 }, + { "target", 0, 0, 0, ctypes_ptr32, 0 }, + { "user_data", 12, 0, 0, ctypes_ptr32, 0 }, +}}; + +static const char * be_ctypes_instance_mappings[] = { + "lv_color", + NULL +}; + +static be_define_ctypes_class(lv_area, &be_lv_area, &be_class_ctypes, "lv_area"); +static be_define_ctypes_class(lv_draw_img_dsc, &be_lv_draw_img_dsc, &be_class_ctypes, "lv_draw_img_dsc"); +static be_define_ctypes_class(lv_draw_line_dsc, &be_lv_draw_line_dsc, &be_class_ctypes, "lv_draw_line_dsc"); +static be_define_ctypes_class(lv_draw_mask_angle_param, &be_lv_draw_mask_angle_param, &be_class_ctypes, "lv_draw_mask_angle_param"); +static be_define_ctypes_class(lv_draw_mask_angle_param_cfg, &be_lv_draw_mask_angle_param_cfg, &be_class_ctypes, "lv_draw_mask_angle_param_cfg"); +static be_define_ctypes_class(lv_draw_mask_common_dsc, &be_lv_draw_mask_common_dsc, &be_class_ctypes, "lv_draw_mask_common_dsc"); +static be_define_ctypes_class(lv_draw_mask_fade_param, &be_lv_draw_mask_fade_param, &be_class_ctypes, "lv_draw_mask_fade_param"); +static be_define_ctypes_class(lv_draw_mask_fade_param_cfg, &be_lv_draw_mask_fade_param_cfg, &be_class_ctypes, "lv_draw_mask_fade_param_cfg"); +static be_define_ctypes_class(lv_draw_mask_line_param, &be_lv_draw_mask_line_param, &be_class_ctypes, "lv_draw_mask_line_param"); +static be_define_ctypes_class(lv_draw_mask_line_param_cfg, &be_lv_draw_mask_line_param_cfg, &be_class_ctypes, "lv_draw_mask_line_param_cfg"); +static be_define_ctypes_class(lv_draw_mask_map_param, &be_lv_draw_mask_map_param, &be_class_ctypes, "lv_draw_mask_map_param"); +static be_define_ctypes_class(lv_draw_mask_map_param_cfg, &be_lv_draw_mask_map_param_cfg, &be_class_ctypes, "lv_draw_mask_map_param_cfg"); +static be_define_ctypes_class(lv_draw_mask_radius_param, &be_lv_draw_mask_radius_param, &be_class_ctypes, "lv_draw_mask_radius_param"); +static be_define_ctypes_class(lv_draw_mask_radius_param_cfg, &be_lv_draw_mask_radius_param_cfg, &be_class_ctypes, "lv_draw_mask_radius_param_cfg"); +static be_define_ctypes_class(lv_draw_mask_saved, &be_lv_draw_mask_saved, &be_class_ctypes, "lv_draw_mask_saved"); +static be_define_ctypes_class(lv_draw_rect_dsc, &be_lv_draw_rect_dsc, &be_class_ctypes, "lv_draw_rect_dsc"); +static be_define_ctypes_class(lv_event, &be_lv_event, &be_class_ctypes, "lv_event"); +static be_define_ctypes_class(lv_meter_indicator, &be_lv_meter_indicator, &be_class_ctypes, "lv_meter_indicator"); +static be_define_ctypes_class(lv_meter_indicator_arc, &be_lv_meter_indicator_arc, &be_class_ctypes, "lv_meter_indicator_arc"); +static be_define_ctypes_class(lv_meter_indicator_needle_img, &be_lv_meter_indicator_needle_img, &be_class_ctypes, "lv_meter_indicator_needle_img"); +static be_define_ctypes_class(lv_meter_indicator_needle_line, &be_lv_meter_indicator_needle_line, &be_class_ctypes, "lv_meter_indicator_needle_line"); +static be_define_ctypes_class(lv_meter_indicator_scale_lines, &be_lv_meter_indicator_scale_lines, &be_class_ctypes, "lv_meter_indicator_scale_lines"); +static be_define_ctypes_class(lv_meter_scale, &be_lv_meter_scale, &be_class_ctypes, "lv_meter_scale"); +static be_define_ctypes_class(lv_obj_class, &be_lv_obj_class, &be_class_ctypes, "lv_obj_class"); +static be_define_ctypes_class(lv_point, &be_lv_point, &be_class_ctypes, "lv_point"); +static be_define_ctypes_class(lv_sqrt_res, &be_lv_sqrt_res, &be_class_ctypes, "lv_sqrt_res"); + +void be_load_ctypes_lvgl_definitions_lib(bvm *vm) { + ctypes_register_class(vm, &be_class_lv_area, &be_lv_area); + ctypes_register_class(vm, &be_class_lv_draw_img_dsc, &be_lv_draw_img_dsc); + ctypes_register_class(vm, &be_class_lv_draw_line_dsc, &be_lv_draw_line_dsc); + ctypes_register_class(vm, &be_class_lv_draw_mask_angle_param, &be_lv_draw_mask_angle_param); + ctypes_register_class(vm, &be_class_lv_draw_mask_angle_param_cfg, &be_lv_draw_mask_angle_param_cfg); + ctypes_register_class(vm, &be_class_lv_draw_mask_common_dsc, &be_lv_draw_mask_common_dsc); + ctypes_register_class(vm, &be_class_lv_draw_mask_fade_param, &be_lv_draw_mask_fade_param); + ctypes_register_class(vm, &be_class_lv_draw_mask_fade_param_cfg, &be_lv_draw_mask_fade_param_cfg); + ctypes_register_class(vm, &be_class_lv_draw_mask_line_param, &be_lv_draw_mask_line_param); + ctypes_register_class(vm, &be_class_lv_draw_mask_line_param_cfg, &be_lv_draw_mask_line_param_cfg); + ctypes_register_class(vm, &be_class_lv_draw_mask_map_param, &be_lv_draw_mask_map_param); + ctypes_register_class(vm, &be_class_lv_draw_mask_map_param_cfg, &be_lv_draw_mask_map_param_cfg); + ctypes_register_class(vm, &be_class_lv_draw_mask_radius_param, &be_lv_draw_mask_radius_param); + ctypes_register_class(vm, &be_class_lv_draw_mask_radius_param_cfg, &be_lv_draw_mask_radius_param_cfg); + ctypes_register_class(vm, &be_class_lv_draw_mask_saved, &be_lv_draw_mask_saved); + ctypes_register_class(vm, &be_class_lv_draw_rect_dsc, &be_lv_draw_rect_dsc); + ctypes_register_class(vm, &be_class_lv_event, &be_lv_event); + ctypes_register_class(vm, &be_class_lv_meter_indicator, &be_lv_meter_indicator); + ctypes_register_class(vm, &be_class_lv_meter_indicator_arc, &be_lv_meter_indicator_arc); + ctypes_register_class(vm, &be_class_lv_meter_indicator_needle_img, &be_lv_meter_indicator_needle_img); + ctypes_register_class(vm, &be_class_lv_meter_indicator_needle_line, &be_lv_meter_indicator_needle_line); + ctypes_register_class(vm, &be_class_lv_meter_indicator_scale_lines, &be_lv_meter_indicator_scale_lines); + ctypes_register_class(vm, &be_class_lv_meter_scale, &be_lv_meter_scale); + ctypes_register_class(vm, &be_class_lv_obj_class, &be_lv_obj_class); + ctypes_register_class(vm, &be_class_lv_point, &be_lv_point); + ctypes_register_class(vm, &be_class_lv_sqrt_res, &be_lv_sqrt_res); +} + +be_ctypes_class_by_name_t be_ctypes_lvgl_classes[] = { + { "lv_area", &be_class_lv_area }, + { "lv_draw_img_dsc", &be_class_lv_draw_img_dsc }, + { "lv_draw_line_dsc", &be_class_lv_draw_line_dsc }, + { "lv_draw_mask_angle_param", &be_class_lv_draw_mask_angle_param }, + { "lv_draw_mask_angle_param_cfg", &be_class_lv_draw_mask_angle_param_cfg }, + { "lv_draw_mask_common_dsc", &be_class_lv_draw_mask_common_dsc }, + { "lv_draw_mask_fade_param", &be_class_lv_draw_mask_fade_param }, + { "lv_draw_mask_fade_param_cfg", &be_class_lv_draw_mask_fade_param_cfg }, + { "lv_draw_mask_line_param", &be_class_lv_draw_mask_line_param }, + { "lv_draw_mask_line_param_cfg", &be_class_lv_draw_mask_line_param_cfg }, + { "lv_draw_mask_map_param", &be_class_lv_draw_mask_map_param }, + { "lv_draw_mask_map_param_cfg", &be_class_lv_draw_mask_map_param_cfg }, + { "lv_draw_mask_radius_param", &be_class_lv_draw_mask_radius_param }, + { "lv_draw_mask_radius_param_cfg", &be_class_lv_draw_mask_radius_param_cfg }, + { "lv_draw_mask_saved", &be_class_lv_draw_mask_saved }, + { "lv_draw_rect_dsc", &be_class_lv_draw_rect_dsc }, + { "lv_event", &be_class_lv_event }, + { "lv_meter_indicator", &be_class_lv_meter_indicator }, + { "lv_meter_indicator_arc", &be_class_lv_meter_indicator_arc }, + { "lv_meter_indicator_needle_img", &be_class_lv_meter_indicator_needle_img }, + { "lv_meter_indicator_needle_line", &be_class_lv_meter_indicator_needle_line }, + { "lv_meter_indicator_scale_lines", &be_class_lv_meter_indicator_scale_lines }, + { "lv_meter_scale", &be_class_lv_meter_scale }, + { "lv_obj_class", &be_class_lv_obj_class }, + { "lv_point", &be_class_lv_point }, + { "lv_sqrt_res", &be_class_lv_sqrt_res }, +}; +const size_t be_ctypes_lvgl_classes_size = sizeof(be_ctypes_lvgl_classes)/sizeof(be_ctypes_lvgl_classes[0]); + +/********************************************************************/ + +#endif // USE_LVGL \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_lvgl_glob_lib.c b/lib/libesp32/berry/default/be_lvgl_glob_lib.c new file mode 100644 index 000000000..06827fc0e --- /dev/null +++ b/lib/libesp32/berry/default/be_lvgl_glob_lib.c @@ -0,0 +1,826 @@ +/******************************************************************** + * Tasmota LVGL lv_signal_bars widget + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_LVGL + +#include "lvgl.h" + +/******************************************************************** +** Solidified function: get_object_from_ptr +********************************************************************/ +be_local_closure(LVGL_glob_get_object_from_ptr, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(cb_obj), + /* K1 */ be_nested_str(find), + }), + &be_const_str_get_object_from_ptr, + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0x20080403, // 0002 NE R2 R2 R3 + 0x780A0004, // 0003 JMPF R2 #0009 + 0x88080100, // 0004 GETMBR R2 R0 K0 + 0x8C080501, // 0005 GETMET R2 R2 K1 + 0x5C100200, // 0006 MOVE R4 R1 + 0x7C080400, // 0007 CALL R2 2 + 0x80040400, // 0008 RET 1 R2 + 0x80000000, // 0009 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: widget_event_impl +********************************************************************/ +be_local_closure(LVGL_glob_widget_event_impl, /* name */ + be_nested_proto( + 12, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str(introspect), + /* K1 */ be_nested_str(lv), + /* K2 */ be_nested_str(lv_obj_class), + /* K3 */ be_nested_str(lv_event), + /* K4 */ be_nested_str(target), + /* K5 */ be_nested_str(get_object_from_ptr), + /* K6 */ be_nested_str(instance), + /* K7 */ be_nested_str(get), + /* K8 */ be_nested_str(widget_event), + }), + &be_const_str_widget_event_impl, + &be_const_str_solidified, + ( &(const binstruction[28]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0xB8120200, // 0001 GETNGBL R4 K1 + 0x8C100902, // 0002 GETMET R4 R4 K2 + 0x5C180200, // 0003 MOVE R6 R1 + 0x7C100400, // 0004 CALL R4 2 + 0xB8160200, // 0005 GETNGBL R5 K1 + 0x8C140B03, // 0006 GETMET R5 R5 K3 + 0x5C1C0400, // 0007 MOVE R7 R2 + 0x7C140400, // 0008 CALL R5 2 + 0x88180B04, // 0009 GETMBR R6 R5 K4 + 0x8C1C0105, // 000A GETMET R7 R0 K5 + 0x5C240C00, // 000B MOVE R9 R6 + 0x7C1C0400, // 000C CALL R7 2 + 0x60200004, // 000D GETGBL R8 G4 + 0x5C240E00, // 000E MOVE R9 R7 + 0x7C200200, // 000F CALL R8 1 + 0x1C201106, // 0010 EQ R8 R8 K6 + 0x78220008, // 0011 JMPF R8 #001B + 0x8C200707, // 0012 GETMET R8 R3 K7 + 0x5C280E00, // 0013 MOVE R10 R7 + 0x582C0008, // 0014 LDCONST R11 K8 + 0x7C200600, // 0015 CALL R8 3 + 0x78220003, // 0016 JMPF R8 #001B + 0x8C200F08, // 0017 GETMET R8 R7 K8 + 0x5C280800, // 0018 MOVE R10 R4 + 0x5C2C0A00, // 0019 MOVE R11 R5 + 0x7C200600, // 001A CALL R8 3 + 0x80000000, // 001B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: lvgl_event_dispatch +********************************************************************/ +be_local_closure(LVGL_glob_lvgl_event_dispatch, /* name */ + be_nested_proto( + 10, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str(introspect), + /* K1 */ be_nested_str(lv), + /* K2 */ be_nested_str(lv_event), + /* K3 */ be_nested_str(toptr), + /* K4 */ be_nested_str(target), + /* K5 */ be_nested_str(cb_event_closure), + /* K6 */ be_nested_str(get_object_from_ptr), + }), + &be_const_str_lvgl_event_dispatch, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0xB80E0200, // 0001 GETNGBL R3 K1 + 0x8C0C0702, // 0002 GETMET R3 R3 K2 + 0x8C140503, // 0003 GETMET R5 R2 K3 + 0x5C1C0200, // 0004 MOVE R7 R1 + 0x7C140400, // 0005 CALL R5 2 + 0x7C0C0400, // 0006 CALL R3 2 + 0x88100704, // 0007 GETMBR R4 R3 K4 + 0x88140105, // 0008 GETMBR R5 R0 K5 + 0x94140A04, // 0009 GETIDX R5 R5 R4 + 0x8C180106, // 000A GETMET R6 R0 K6 + 0x5C200800, // 000B MOVE R8 R4 + 0x7C180400, // 000C CALL R6 2 + 0x5C1C0A00, // 000D MOVE R7 R5 + 0x5C200C00, // 000E MOVE R8 R6 + 0x5C240600, // 000F MOVE R9 R3 + 0x7C1C0400, // 0010 CALL R7 2 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: widget_dtor_impl +********************************************************************/ +be_local_closure(LVGL_glob_widget_dtor_impl, /* name */ + be_nested_proto( + 10, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str(introspect), + /* K1 */ be_nested_str(lv), + /* K2 */ be_nested_str(lv_obj_class), + /* K3 */ be_nested_str(get_object_from_ptr), + /* K4 */ be_nested_str(instance), + /* K5 */ be_nested_str(get), + /* K6 */ be_nested_str(widget_destructor), + }), + &be_const_str_widget_dtor_impl, + &be_const_str_solidified, + ( &(const binstruction[22]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0xB8120200, // 0001 GETNGBL R4 K1 + 0x8C100902, // 0002 GETMET R4 R4 K2 + 0x5C180200, // 0003 MOVE R6 R1 + 0x7C100400, // 0004 CALL R4 2 + 0x8C140103, // 0005 GETMET R5 R0 K3 + 0x5C1C0400, // 0006 MOVE R7 R2 + 0x7C140400, // 0007 CALL R5 2 + 0x60180004, // 0008 GETGBL R6 G4 + 0x5C1C0A00, // 0009 MOVE R7 R5 + 0x7C180200, // 000A CALL R6 1 + 0x1C180D04, // 000B EQ R6 R6 K4 + 0x781A0007, // 000C JMPF R6 #0015 + 0x8C180705, // 000D GETMET R6 R3 K5 + 0x5C200A00, // 000E MOVE R8 R5 + 0x58240006, // 000F LDCONST R9 K6 + 0x7C180600, // 0010 CALL R6 3 + 0x781A0002, // 0011 JMPF R6 #0015 + 0x8C180B06, // 0012 GETMET R6 R5 K6 + 0x5C200800, // 0013 MOVE R8 R4 + 0x7C180400, // 0014 CALL R6 2 + 0x80000000, // 0015 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: register_obj +********************************************************************/ +be_local_closure(LVGL_glob_register_obj, /* name */ + be_nested_proto( + 4, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(cb_obj), + /* K1 */ be_nested_str(_p), + }), + &be_const_str_register_obj, + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0x1C080403, // 0002 EQ R2 R2 R3 + 0x780A0002, // 0003 JMPF R2 #0007 + 0x60080013, // 0004 GETGBL R2 G19 + 0x7C080000, // 0005 CALL R2 0 + 0x90020002, // 0006 SETMBR R0 K0 R2 + 0x88080301, // 0007 GETMBR R2 R1 K1 + 0x880C0100, // 0008 GETMBR R3 R0 K0 + 0x980C0401, // 0009 SETIDX R3 R2 R1 + 0x80000000, // 000A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: gen_cb +********************************************************************/ +be_local_closure(LVGL_glob_gen_cb, /* name */ + be_nested_proto( + 8, /* nstack */ + 5, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(lvgl_event_dispatch), + }), + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x68040000, // 0000 GETUPV R1 U0 + 0x8C040300, // 0001 GETMET R1 R1 K0 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C040400, // 0003 CALL R1 2 + 0x80040200, // 0004 RET 1 R1 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str(lv_event_cb), + /* K1 */ be_nested_str(cb_event_closure), + /* K2 */ be_nested_str(event_cb), + /* K3 */ be_nested_str(tasmota), + /* K4 */ be_nested_str(gen_cb), + /* K5 */ be_nested_str(register_obj), + /* K6 */ be_nested_str(null_cb), + /* K7 */ be_nested_str(cb_do_nothing), + }), + &be_const_str_gen_cb, + &be_const_str_solidified, + ( &(const binstruction[41]) { /* code */ + 0x1C140300, // 0000 EQ R5 R1 K0 + 0x78160018, // 0001 JMPF R5 #001B + 0x88140101, // 0002 GETMBR R5 R0 K1 + 0x4C180000, // 0003 LDNIL R6 + 0x1C140A06, // 0004 EQ R5 R5 R6 + 0x78160002, // 0005 JMPF R5 #0009 + 0x60140013, // 0006 GETGBL R5 G19 + 0x7C140000, // 0007 CALL R5 0 + 0x90020205, // 0008 SETMBR R0 K1 R5 + 0x88140102, // 0009 GETMBR R5 R0 K2 + 0x4C180000, // 000A LDNIL R6 + 0x1C140A06, // 000B EQ R5 R5 R6 + 0x78160004, // 000C JMPF R5 #0012 + 0xB8160600, // 000D GETNGBL R5 K3 + 0x8C140B04, // 000E GETMET R5 R5 K4 + 0x841C0000, // 000F CLOSURE R7 P0 + 0x7C140400, // 0010 CALL R5 2 + 0x90020405, // 0011 SETMBR R0 K2 R5 + 0x8C140105, // 0012 GETMET R5 R0 K5 + 0x5C1C0600, // 0013 MOVE R7 R3 + 0x7C140400, // 0014 CALL R5 2 + 0x88140101, // 0015 GETMBR R5 R0 K1 + 0x98140802, // 0016 SETIDX R5 R4 R2 + 0x88140102, // 0017 GETMBR R5 R0 K2 + 0xA0000000, // 0018 CLOSE R0 + 0x80040A00, // 0019 RET 1 R5 + 0x7002000B, // 001A JMP #0027 + 0x88140106, // 001B GETMBR R5 R0 K6 + 0x4C180000, // 001C LDNIL R6 + 0x1C140A06, // 001D EQ R5 R5 R6 + 0x78160004, // 001E JMPF R5 #0024 + 0xB8160600, // 001F GETNGBL R5 K3 + 0x8C140B04, // 0020 GETMET R5 R5 K4 + 0x881C0107, // 0021 GETMBR R7 R0 K7 + 0x7C140400, // 0022 CALL R5 2 + 0x90020C05, // 0023 SETMBR R0 K6 R5 + 0x88140106, // 0024 GETMBR R5 R0 K6 + 0xA0000000, // 0025 CLOSE R0 + 0x80040A00, // 0026 RET 1 R5 + 0xA0000000, // 0027 CLOSE R0 + 0x80000000, // 0028 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: deregister_obj +********************************************************************/ +be_local_closure(LVGL_glob_deregister_obj, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(cb_obj), + /* K1 */ be_nested_str(remove), + /* K2 */ be_nested_str(cb_event_closure), + }), + &be_const_str_deregister_obj, + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0x20080403, // 0002 NE R2 R2 R3 + 0x780A0003, // 0003 JMPF R2 #0008 + 0x88080100, // 0004 GETMBR R2 R0 K0 + 0x8C080501, // 0005 GETMET R2 R2 K1 + 0x5C100200, // 0006 MOVE R4 R1 + 0x7C080400, // 0007 CALL R2 2 + 0x88080102, // 0008 GETMBR R2 R0 K2 + 0x4C0C0000, // 0009 LDNIL R3 + 0x20080403, // 000A NE R2 R2 R3 + 0x780A0003, // 000B JMPF R2 #0010 + 0x88080102, // 000C GETMBR R2 R0 K2 + 0x8C080501, // 000D GETMET R2 R2 K1 + 0x5C100200, // 000E MOVE R4 R1 + 0x7C080400, // 000F CALL R2 2 + 0x80000000, // 0010 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: widget_cb +********************************************************************/ +be_local_closure(LVGL_glob_widget_cb, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 3]) { + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(widget_ctor_impl), + }), + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x68080000, // 0000 GETUPV R2 U0 + 0x8C080500, // 0001 GETMET R2 R2 K0 + 0x5C100000, // 0002 MOVE R4 R0 + 0x5C140200, // 0003 MOVE R5 R1 + 0x7C080600, // 0004 CALL R2 3 + 0x80040400, // 0005 RET 1 R2 + }) + ), + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(widget_dtor_impl), + }), + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x68080000, // 0000 GETUPV R2 U0 + 0x8C080500, // 0001 GETMET R2 R2 K0 + 0x5C100000, // 0002 MOVE R4 R0 + 0x5C140200, // 0003 MOVE R5 R1 + 0x7C080600, // 0004 CALL R2 3 + 0x80040400, // 0005 RET 1 R2 + }) + ), + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(widget_event_impl), + }), + &be_const_str__X3Clambda_X3E, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x68080000, // 0000 GETUPV R2 U0 + 0x8C080500, // 0001 GETMET R2 R2 K0 + 0x5C100000, // 0002 MOVE R4 R0 + 0x5C140200, // 0003 MOVE R5 R1 + 0x7C080600, // 0004 CALL R2 3 + 0x80040400, // 0005 RET 1 R2 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[15]) { /* constants */ + /* K0 */ be_nested_str(widget_ctor_cb), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(gen_cb), + /* K3 */ be_nested_str(widget_dtor_cb), + /* K4 */ be_nested_str(widget_event_cb), + /* K5 */ be_nested_str(widget_struct_default), + /* K6 */ be_nested_str(lv), + /* K7 */ be_nested_str(lv_obj_class), + /* K8 */ be_nested_str(lv_obj), + /* K9 */ be_nested_str(_class), + /* K10 */ be_nested_str(copy), + /* K11 */ be_nested_str(base_class), + /* K12 */ be_nested_str(constructor_cb), + /* K13 */ be_nested_str(destructor_cb), + /* K14 */ be_nested_str(event_cb), + }), + &be_const_str_widget_cb, + &be_const_str_solidified, + ( &(const binstruction[56]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x4C080000, // 0001 LDNIL R2 + 0x1C040202, // 0002 EQ R1 R1 R2 + 0x78060004, // 0003 JMPF R1 #0009 + 0xB8060200, // 0004 GETNGBL R1 K1 + 0x8C040302, // 0005 GETMET R1 R1 K2 + 0x840C0000, // 0006 CLOSURE R3 P0 + 0x7C040400, // 0007 CALL R1 2 + 0x90020001, // 0008 SETMBR R0 K0 R1 + 0x88040103, // 0009 GETMBR R1 R0 K3 + 0x4C080000, // 000A LDNIL R2 + 0x1C040202, // 000B EQ R1 R1 R2 + 0x78060004, // 000C JMPF R1 #0012 + 0xB8060200, // 000D GETNGBL R1 K1 + 0x8C040302, // 000E GETMET R1 R1 K2 + 0x840C0001, // 000F CLOSURE R3 P1 + 0x7C040400, // 0010 CALL R1 2 + 0x90020601, // 0011 SETMBR R0 K3 R1 + 0x88040104, // 0012 GETMBR R1 R0 K4 + 0x4C080000, // 0013 LDNIL R2 + 0x1C040202, // 0014 EQ R1 R1 R2 + 0x78060004, // 0015 JMPF R1 #001B + 0xB8060200, // 0016 GETNGBL R1 K1 + 0x8C040302, // 0017 GETMET R1 R1 K2 + 0x840C0002, // 0018 CLOSURE R3 P2 + 0x7C040400, // 0019 CALL R1 2 + 0x90020801, // 001A SETMBR R0 K4 R1 + 0x88040105, // 001B GETMBR R1 R0 K5 + 0x4C080000, // 001C LDNIL R2 + 0x1C040202, // 001D EQ R1 R1 R2 + 0x78060016, // 001E JMPF R1 #0036 + 0xB8060C00, // 001F GETNGBL R1 K6 + 0x8C040307, // 0020 GETMET R1 R1 K7 + 0xB80E0C00, // 0021 GETNGBL R3 K6 + 0x880C0708, // 0022 GETMBR R3 R3 K8 + 0x880C0709, // 0023 GETMBR R3 R3 K9 + 0x7C040400, // 0024 CALL R1 2 + 0x8C04030A, // 0025 GETMET R1 R1 K10 + 0x7C040200, // 0026 CALL R1 1 + 0x90020A01, // 0027 SETMBR R0 K5 R1 + 0x88040105, // 0028 GETMBR R1 R0 K5 + 0xB80A0C00, // 0029 GETNGBL R2 K6 + 0x88080508, // 002A GETMBR R2 R2 K8 + 0x88080509, // 002B GETMBR R2 R2 K9 + 0x90061602, // 002C SETMBR R1 K11 R2 + 0x88040105, // 002D GETMBR R1 R0 K5 + 0x88080100, // 002E GETMBR R2 R0 K0 + 0x90061802, // 002F SETMBR R1 K12 R2 + 0x88040105, // 0030 GETMBR R1 R0 K5 + 0x88080103, // 0031 GETMBR R2 R0 K3 + 0x90061A02, // 0032 SETMBR R1 K13 R2 + 0x88040105, // 0033 GETMBR R1 R0 K5 + 0x88080104, // 0034 GETMBR R2 R0 K4 + 0x90061C02, // 0035 SETMBR R1 K14 R2 + 0xA0000000, // 0036 CLOSE R0 + 0x80000000, // 0037 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: _anonymous_ +********************************************************************/ +be_local_closure(LVGL_glob__anonymous_, /* name */ + be_nested_proto( + 2, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(LVG_X3A_X20call_X20to_X20unsupported_X20callback), + }), + &be_const_str__anonymous_, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x60000001, // 0000 GETGBL R0 G1 + 0x58040000, // 0001 LDCONST R1 K0 + 0x7C000200, // 0002 CALL R0 1 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: create_custom_widget +********************************************************************/ +be_local_closure(LVGL_glob_create_custom_widget, /* name */ + be_nested_proto( + 10, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[27]) { /* constants */ + /* K0 */ be_nested_str(introspect), + /* K1 */ be_nested_str(lv), + /* K2 */ be_nested_str(lv_obj), + /* K3 */ be_nested_str(value_error), + /* K4 */ be_nested_str(arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj), + /* K5 */ be_nested_str(widget_struct_by_class), + /* K6 */ be_nested_str(find), + /* K7 */ be_nested_str(widget_cb), + /* K8 */ be_nested_str(widget_struct_default), + /* K9 */ be_nested_str(copy), + /* K10 */ be_nested_str(base_class), + /* K11 */ be_nested_str(_class), + /* K12 */ be_nested_str(get), + /* K13 */ be_nested_str(widget_width_def), + /* K14 */ be_nested_str(width_def), + /* K15 */ be_nested_str(widget_height_def), + /* K16 */ be_nested_str(height_def), + /* K17 */ be_nested_str(widget_editable), + /* K18 */ be_nested_str(editable), + /* K19 */ be_nested_str(widget_group_def), + /* K20 */ be_nested_str(group_def), + /* K21 */ be_nested_str(widget_instance_size), + /* K22 */ be_nested_str(instance_size), + /* K23 */ be_nested_str(obj_class_create_obj), + /* K24 */ be_nested_str(_p), + /* K25 */ be_nested_str(register_obj), + /* K26 */ be_nested_str(class_init_obj), + }), + &be_const_str_create_custom_widget, + &be_const_str_solidified, + ( &(const binstruction[86]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0x6010000F, // 0001 GETGBL R4 G15 + 0x5C140200, // 0002 MOVE R5 R1 + 0xB81A0200, // 0003 GETNGBL R6 K1 + 0x88180D02, // 0004 GETMBR R6 R6 K2 + 0x7C100400, // 0005 CALL R4 2 + 0x74120000, // 0006 JMPT R4 #0008 + 0xB0060704, // 0007 RAISE 1 K3 K4 + 0x88100105, // 0008 GETMBR R4 R0 K5 + 0x4C140000, // 0009 LDNIL R5 + 0x1C100805, // 000A EQ R4 R4 R5 + 0x78120002, // 000B JMPF R4 #000F + 0x60100013, // 000C GETGBL R4 G19 + 0x7C100000, // 000D CALL R4 0 + 0x90020A04, // 000E SETMBR R0 K5 R4 + 0x60100005, // 000F GETGBL R4 G5 + 0x5C140200, // 0010 MOVE R5 R1 + 0x7C100200, // 0011 CALL R4 1 + 0x88140105, // 0012 GETMBR R5 R0 K5 + 0x8C140B06, // 0013 GETMET R5 R5 K6 + 0x5C1C0800, // 0014 MOVE R7 R4 + 0x7C140400, // 0015 CALL R5 2 + 0x4C180000, // 0016 LDNIL R6 + 0x1C180A06, // 0017 EQ R6 R5 R6 + 0x781A002F, // 0018 JMPF R6 #0049 + 0x8C180107, // 0019 GETMET R6 R0 K7 + 0x7C180200, // 001A CALL R6 1 + 0x88180108, // 001B GETMBR R6 R0 K8 + 0x8C180D09, // 001C GETMET R6 R6 K9 + 0x7C180200, // 001D CALL R6 1 + 0x5C140C00, // 001E MOVE R5 R6 + 0x60180003, // 001F GETGBL R6 G3 + 0x5C1C0200, // 0020 MOVE R7 R1 + 0x7C180200, // 0021 CALL R6 1 + 0x88180D0B, // 0022 GETMBR R6 R6 K11 + 0x90161406, // 0023 SETMBR R5 K10 R6 + 0x8C18070C, // 0024 GETMET R6 R3 K12 + 0x5C200200, // 0025 MOVE R8 R1 + 0x5824000D, // 0026 LDCONST R9 K13 + 0x7C180600, // 0027 CALL R6 3 + 0x781A0001, // 0028 JMPF R6 #002B + 0x8818030D, // 0029 GETMBR R6 R1 K13 + 0x90161C06, // 002A SETMBR R5 K14 R6 + 0x8C18070C, // 002B GETMET R6 R3 K12 + 0x5C200200, // 002C MOVE R8 R1 + 0x5824000F, // 002D LDCONST R9 K15 + 0x7C180600, // 002E CALL R6 3 + 0x781A0001, // 002F JMPF R6 #0032 + 0x8818030F, // 0030 GETMBR R6 R1 K15 + 0x90162006, // 0031 SETMBR R5 K16 R6 + 0x8C18070C, // 0032 GETMET R6 R3 K12 + 0x5C200200, // 0033 MOVE R8 R1 + 0x58240011, // 0034 LDCONST R9 K17 + 0x7C180600, // 0035 CALL R6 3 + 0x781A0001, // 0036 JMPF R6 #0039 + 0x88180311, // 0037 GETMBR R6 R1 K17 + 0x90162406, // 0038 SETMBR R5 K18 R6 + 0x8C18070C, // 0039 GETMET R6 R3 K12 + 0x5C200200, // 003A MOVE R8 R1 + 0x58240013, // 003B LDCONST R9 K19 + 0x7C180600, // 003C CALL R6 3 + 0x781A0001, // 003D JMPF R6 #0040 + 0x88180313, // 003E GETMBR R6 R1 K19 + 0x90162806, // 003F SETMBR R5 K20 R6 + 0x8C18070C, // 0040 GETMET R6 R3 K12 + 0x5C200200, // 0041 MOVE R8 R1 + 0x58240015, // 0042 LDCONST R9 K21 + 0x7C180600, // 0043 CALL R6 3 + 0x781A0001, // 0044 JMPF R6 #0047 + 0x88180315, // 0045 GETMBR R6 R1 K21 + 0x90162C06, // 0046 SETMBR R5 K22 R6 + 0x88180105, // 0047 GETMBR R6 R0 K5 + 0x98180805, // 0048 SETIDX R6 R4 R5 + 0xB81A0200, // 0049 GETNGBL R6 K1 + 0x8C180D17, // 004A GETMET R6 R6 K23 + 0x5C200A00, // 004B MOVE R8 R5 + 0x5C240400, // 004C MOVE R9 R2 + 0x7C180600, // 004D CALL R6 3 + 0x881C0D18, // 004E GETMBR R7 R6 K24 + 0x90063007, // 004F SETMBR R1 K24 R7 + 0x8C1C0119, // 0050 GETMET R7 R0 K25 + 0x5C240200, // 0051 MOVE R9 R1 + 0x7C1C0400, // 0052 CALL R7 2 + 0x8C1C031A, // 0053 GETMET R7 R1 K26 + 0x7C1C0200, // 0054 CALL R7 1 + 0x80000000, // 0055 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: widget_ctor_impl +********************************************************************/ +be_local_closure(LVGL_glob_widget_ctor_impl, /* name */ + be_nested_proto( + 10, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str(introspect), + /* K1 */ be_nested_str(lv), + /* K2 */ be_nested_str(lv_obj_class), + /* K3 */ be_nested_str(get_object_from_ptr), + /* K4 */ be_nested_str(cb_obj), + /* K5 */ be_nested_str(find), + /* K6 */ be_nested_str(instance), + /* K7 */ be_nested_str(get), + /* K8 */ be_nested_str(widget_constructor), + }), + &be_const_str_widget_ctor_impl, + &be_const_str_solidified, + ( &(const binstruction[29]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0xB8120200, // 0001 GETNGBL R4 K1 + 0x8C100902, // 0002 GETMET R4 R4 K2 + 0x5C180200, // 0003 MOVE R6 R1 + 0x7C100400, // 0004 CALL R4 2 + 0x8C140103, // 0005 GETMET R5 R0 K3 + 0x5C1C0400, // 0006 MOVE R7 R2 + 0x7C140400, // 0007 CALL R5 2 + 0x88180104, // 0008 GETMBR R6 R0 K4 + 0x8C180D05, // 0009 GETMET R6 R6 K5 + 0x5C200A00, // 000A MOVE R8 R5 + 0x7C180400, // 000B CALL R6 2 + 0x781A0001, // 000C JMPF R6 #000F + 0x88180104, // 000D GETMBR R6 R0 K4 + 0x94140C05, // 000E GETIDX R5 R6 R5 + 0x60180004, // 000F GETGBL R6 G4 + 0x5C1C0A00, // 0010 MOVE R7 R5 + 0x7C180200, // 0011 CALL R6 1 + 0x1C180D06, // 0012 EQ R6 R6 K6 + 0x781A0007, // 0013 JMPF R6 #001C + 0x8C180707, // 0014 GETMET R6 R3 K7 + 0x5C200A00, // 0015 MOVE R8 R5 + 0x58240008, // 0016 LDCONST R9 K8 + 0x7C180600, // 0017 CALL R6 3 + 0x781A0002, // 0018 JMPF R6 #001C + 0x8C180B08, // 0019 GETMET R6 R5 K8 + 0x5C200800, // 001A MOVE R8 R4 + 0x7C180400, // 001B CALL R6 2 + 0x80000000, // 001C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: LVGL_glob +********************************************************************/ +be_local_class(LVGL_glob, + 9, + NULL, + be_nested_map(20, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(widget_ctor_cb, 8), be_const_var(4) }, + { be_const_key(get_object_from_ptr, 4), be_const_closure(LVGL_glob_get_object_from_ptr_closure) }, + { be_const_key(cb_obj, 7), be_const_var(0) }, + { be_const_key(widget_struct_by_class, -1), be_const_var(8) }, + { be_const_key(widget_event_impl, -1), be_const_closure(LVGL_glob_widget_event_impl_closure) }, + { be_const_key(widget_dtor_cb, 6), be_const_var(5) }, + { be_const_key(cb_event_closure, -1), be_const_var(1) }, + { be_const_key(cb_do_nothing, 16), be_const_static_closure(LVGL_glob__anonymous__closure) }, + { be_const_key(null_cb, -1), be_const_var(3) }, + { be_const_key(register_obj, -1), be_const_closure(LVGL_glob_register_obj_closure) }, + { be_const_key(widget_dtor_impl, 9), be_const_closure(LVGL_glob_widget_dtor_impl_closure) }, + { be_const_key(gen_cb, -1), be_const_closure(LVGL_glob_gen_cb_closure) }, + { be_const_key(deregister_obj, -1), be_const_closure(LVGL_glob_deregister_obj_closure) }, + { be_const_key(widget_struct_default, 12), be_const_var(7) }, + { be_const_key(widget_event_cb, -1), be_const_var(6) }, + { be_const_key(widget_cb, -1), be_const_closure(LVGL_glob_widget_cb_closure) }, + { be_const_key(lvgl_event_dispatch, 3), be_const_closure(LVGL_glob_lvgl_event_dispatch_closure) }, + { be_const_key(event_cb, -1), be_const_var(2) }, + { be_const_key(create_custom_widget, -1), be_const_closure(LVGL_glob_create_custom_widget_closure) }, + { be_const_key(widget_ctor_impl, -1), be_const_closure(LVGL_glob_widget_ctor_impl_closure) }, + })), + be_str_literal("LVGL_glob") +); +/*******************************************************************/ + +void be_load_LVGL_glob_class(bvm *vm) { + be_pushntvclass(vm, &be_class_LVGL_glob); + be_setglobal(vm, "LVGL_glob"); + be_pop(vm, 1); +} + +#endif // USE_LVGL \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_lvgl_module.c b/lib/libesp32/berry/default/be_lvgl_module.c new file mode 100644 index 000000000..890efd2ff --- /dev/null +++ b/lib/libesp32/berry/default/be_lvgl_module.c @@ -0,0 +1,692 @@ +/******************************************************************** + * Generated code, don't edit + *******************************************************************/ +/******************************************************************** + * LVGL Module + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_LVGL + +#include "lvgl.h" +#include "be_lvgl.h" +#include "lv_theme_openhasp.h" + +extern int lv0_member(bvm *vm); // resolve virtual members + +extern int lv0_start(bvm *vm); + +extern int lv0_register_button_encoder(bvm *vm); // add buttons with encoder logic + +extern int lv0_load_montserrat_font(bvm *vm); +extern int lv0_load_seg7_font(bvm *vm); +extern int lv0_load_robotocondensed_latin1_font(bvm *vm); +extern int lv0_load_font(bvm *vm); +extern int lv0_load_freetype_font(bvm *vm); + +extern int lv0_screenshot(bvm *vm); + +static int lv_get_hor_res(void) { + return lv_disp_get_hor_res(lv_disp_get_default()); +} +static int lv_get_ver_res(void) { + return lv_disp_get_ver_res(lv_disp_get_default()); +} + +/* `lv` methods */ +const lvbe_call_c_t lv_func[] = { + + { "clamp_height", (void*) &lv_clamp_height, "i", "iiii" }, + { "clamp_width", (void*) &lv_clamp_width, "i", "iiii" }, + { "color_mix", (void*) &lv_color_mix, "lv.lv_color", "(lv.lv_color)(lv.lv_color)i" }, + { "dpx", (void*) &lv_dpx, "i", "i" }, + { "draw_arc", (void*) &lv_draw_arc, "", "iiiii(lv.lv_area)(lv.lv_draw_arc_dsc)" }, + { "draw_arc_dsc_init", (void*) &lv_draw_arc_dsc_init, "", "(lv.lv_draw_arc_dsc)" }, + { "draw_arc_get_area", (void*) &lv_draw_arc_get_area, "", "iiiiiib(lv.lv_area)" }, + { "draw_img", (void*) &lv_draw_img, "", "(lv.lv_area)(lv.lv_area).(lv.lv_draw_img_dsc)" }, + { "draw_img_dsc_init", (void*) &lv_draw_img_dsc_init, "", "(lv.lv_draw_img_dsc)" }, + { "draw_label", (void*) &lv_draw_label, "", "(lv.lv_area)(lv.lv_area)(lv.lv_draw_label_dsc)s(lv.lv_draw_label_hint)" }, + { "draw_label_dsc_init", (void*) &lv_draw_label_dsc_init, "", "(lv.lv_draw_label_dsc)" }, + { "draw_letter", (void*) &lv_draw_letter, "", "(lv.lv_point)(lv.lv_area)(lv.lv_font)i(lv.lv_color)ii" }, + { "draw_line", (void*) &lv_draw_line, "", "(lv.lv_point)(lv.lv_point)(lv.lv_area)(lv.lv_draw_line_dsc)" }, + { "draw_line_dsc_init", (void*) &lv_draw_line_dsc_init, "", "(lv.lv_draw_line_dsc)" }, + { "draw_mask_add", (void*) &lv_draw_mask_add, "i", ".." }, + { "draw_mask_angle_init", (void*) &lv_draw_mask_angle_init, "", "(lv.lv_draw_mask_angle_param)iiii" }, + { "draw_mask_fade_init", (void*) &lv_draw_mask_fade_init, "", "(lv.lv_draw_mask_fade_param)(lv.lv_area)iiii" }, + { "draw_mask_get_cnt", (void*) &lv_draw_mask_get_cnt, "i", "" }, + { "draw_mask_line_angle_init", (void*) &lv_draw_mask_line_angle_init, "", "(lv.lv_draw_mask_line_param)iiii" }, + { "draw_mask_line_points_init", (void*) &lv_draw_mask_line_points_init, "", "(lv.lv_draw_mask_line_param)iiiii" }, + { "draw_mask_map_init", (void*) &lv_draw_mask_map_init, "", "(lv.lv_draw_mask_map_param)(lv.lv_area)(lv.lv_opa)" }, + { "draw_mask_radius_init", (void*) &lv_draw_mask_radius_init, "", "(lv.lv_draw_mask_radius_param)(lv.lv_area)ib" }, + { "draw_mask_remove_custom", (void*) &lv_draw_mask_remove_custom, ".", "." }, + { "draw_mask_remove_id", (void*) &lv_draw_mask_remove_id, ".", "i" }, + { "draw_polygon", (void*) &lv_draw_polygon, "", "ii(lv.lv_area)(lv.lv_draw_rect_dsc)" }, + { "draw_rect", (void*) &lv_draw_rect, "", "(lv.lv_area)(lv.lv_area)(lv.lv_draw_rect_dsc)" }, + { "draw_rect_dsc_init", (void*) &lv_draw_rect_dsc_init, "", "(lv.lv_draw_rect_dsc)" }, + { "draw_triangle", (void*) &lv_draw_triangle, "", "i(lv.lv_area)(lv.lv_draw_rect_dsc)" }, + { "event_register_id", (void*) &lv_event_register_id, "i", "" }, + { "event_send", (void*) &lv_event_send, "i", "(lv.lv_obj)i." }, + { "event_set_cover_res", (void*) &lv_event_set_cover_res, "", "(lv.lv_event)(lv.lv_cover_res)" }, + { "event_set_ext_draw_size", (void*) &lv_event_set_ext_draw_size, "", "(lv.lv_event)i" }, + { "get_hor_res", (void*) &lv_get_hor_res, "i", "" }, + { "get_ver_res", (void*) &lv_get_ver_res, "i", "" }, + { "group_get_default", (void*) &lv_group_get_default, "lv.lv_group", "" }, + { "img_src_get_type", (void*) &lv_img_src_get_type, "i", "." }, + { "indev_get_act", (void*) &lv_indev_get_act, "lv.lv_indev", "" }, + { "indev_get_obj_act", (void*) &lv_indev_get_obj_act, "lv.lv_obj", "" }, + { "indev_read_timer_cb", (void*) &lv_indev_read_timer_cb, "", "(lv.lv_timer)" }, + { "layer_sys", (void*) &lv_layer_sys, "lv.lv_obj", "" }, + { "layer_top", (void*) &lv_layer_top, "lv.lv_obj", "" }, + { "layout_register", (void*) &lv_layout_register, "i", "^lv_layout_update_cb^." }, + { "obj_class_create_obj", (void*) &lv_obj_class_create_obj, "lv.lv_obj", "(lv._lv_obj_class)(lv.lv_obj)" }, + { "obj_del_anim_ready_cb", (void*) &lv_obj_del_anim_ready_cb, "", "(lv.lv_anim)" }, + { "obj_draw_dsc_init", (void*) &lv_obj_draw_dsc_init, "", "(lv.lv_obj_draw_part_dsc)(lv.lv_area)" }, + { "obj_enable_style_refresh", (void*) &lv_obj_enable_style_refresh, "", "b" }, + { "obj_event_base", (void*) &lv_obj_event_base, "i", "(lv.lv_obj_class)(lv.lv_event)" }, + { "obj_report_style_change", (void*) &lv_obj_report_style_change, "", "(lv.lv_style)" }, + { "obj_style_get_selector_part", (void*) &lv_obj_style_get_selector_part, "i", "i" }, + { "obj_style_get_selector_state", (void*) &lv_obj_style_get_selector_state, "i", "i" }, + { "refr_now", (void*) &lv_refr_now, "", "(lv.lv_disp)" }, + { "scr_act", (void*) &lv_scr_act, "lv.lv_obj", "" }, + { "scr_load", (void*) &lv_scr_load, "", "(lv.lv_obj)" }, + { "scr_load_anim", (void*) &lv_scr_load_anim, "", "(lv.lv_obj)iiib" }, + { "theme_apply", (void*) &lv_theme_apply, "", "(lv.lv_obj)" }, + { "theme_default_init", (void*) &lv_theme_default_init, "lv.lv_theme", "(lv.lv_disp)(lv.lv_color)(lv.lv_color)b(lv.lv_font)" }, + { "theme_default_is_inited", (void*) &lv_theme_default_is_inited, "b", "" }, + { "theme_get_color_primary", (void*) &lv_theme_get_color_primary, "lv.lv_color", "(lv.lv_obj)" }, + { "theme_get_color_secondary", (void*) &lv_theme_get_color_secondary, "lv.lv_color", "(lv.lv_obj)" }, + { "theme_get_font_large", (void*) &lv_theme_get_font_large, "lv.lv_font", "(lv.lv_obj)" }, + { "theme_get_font_normal", (void*) &lv_theme_get_font_normal, "lv.lv_font", "(lv.lv_obj)" }, + { "theme_get_font_small", (void*) &lv_theme_get_font_small, "lv.lv_font", "(lv.lv_obj)" }, + { "theme_get_from_obj", (void*) &lv_theme_get_from_obj, "lv.lv_theme", "(lv.lv_obj)" }, + { "theme_mono_init", (void*) &lv_theme_mono_init, "lv.lv_theme", "(lv.lv_disp)b(lv.lv_font)" }, + { "theme_openhasp_init", (void*) &lv_theme_openhasp_init, "lv.lv_theme", "(lv.lv_disp)(lv.lv_color)(lv.lv_color)b(lv.lv_font)" }, + { "theme_openhasp_is_inited", (void*) &lv_theme_openhasp_is_inited, "b", "" }, + { "theme_set_apply_cb", (void*) &lv_theme_set_apply_cb, "", "(lv.lv_theme)^lv_theme_apply_cb^" }, + { "theme_set_parent", (void*) &lv_theme_set_parent, "", "(lv.lv_theme)(lv.lv_theme)" }, + +}; +const size_t lv_func_size = sizeof(lv_func) / sizeof(lv_func[0]); + + + + +typedef struct be_constint_t { + const char * name; + int32_t value; +} be_constint_t; + +const be_constint_t lv0_constants[] = { + + { "ALIGN_BOTTOM_LEFT", LV_ALIGN_BOTTOM_LEFT }, + { "ALIGN_BOTTOM_MID", LV_ALIGN_BOTTOM_MID }, + { "ALIGN_BOTTOM_RIGHT", LV_ALIGN_BOTTOM_RIGHT }, + { "ALIGN_CENTER", LV_ALIGN_CENTER }, + { "ALIGN_DEFAULT", LV_ALIGN_DEFAULT }, + { "ALIGN_LEFT_MID", LV_ALIGN_LEFT_MID }, + { "ALIGN_OUT_BOTTOM_LEFT", LV_ALIGN_OUT_BOTTOM_LEFT }, + { "ALIGN_OUT_BOTTOM_MID", LV_ALIGN_OUT_BOTTOM_MID }, + { "ALIGN_OUT_BOTTOM_RIGHT", LV_ALIGN_OUT_BOTTOM_RIGHT }, + { "ALIGN_OUT_LEFT_BOTTOM", LV_ALIGN_OUT_LEFT_BOTTOM }, + { "ALIGN_OUT_LEFT_MID", LV_ALIGN_OUT_LEFT_MID }, + { "ALIGN_OUT_LEFT_TOP", LV_ALIGN_OUT_LEFT_TOP }, + { "ALIGN_OUT_RIGHT_BOTTOM", LV_ALIGN_OUT_RIGHT_BOTTOM }, + { "ALIGN_OUT_RIGHT_MID", LV_ALIGN_OUT_RIGHT_MID }, + { "ALIGN_OUT_RIGHT_TOP", LV_ALIGN_OUT_RIGHT_TOP }, + { "ALIGN_OUT_TOP_LEFT", LV_ALIGN_OUT_TOP_LEFT }, + { "ALIGN_OUT_TOP_MID", LV_ALIGN_OUT_TOP_MID }, + { "ALIGN_OUT_TOP_RIGHT", LV_ALIGN_OUT_TOP_RIGHT }, + { "ALIGN_RIGHT_MID", LV_ALIGN_RIGHT_MID }, + { "ALIGN_TOP_LEFT", LV_ALIGN_TOP_LEFT }, + { "ALIGN_TOP_MID", LV_ALIGN_TOP_MID }, + { "ALIGN_TOP_RIGHT", LV_ALIGN_TOP_RIGHT }, + { "ANIM_IMG_PART_MAIN", LV_ANIM_IMG_PART_MAIN }, + { "ANIM_OFF", LV_ANIM_OFF }, + { "ANIM_ON", LV_ANIM_ON }, + { "ARC_MODE_NORMAL", LV_ARC_MODE_NORMAL }, + { "ARC_MODE_REVERSE", LV_ARC_MODE_REVERSE }, + { "ARC_MODE_SYMMETRICAL", LV_ARC_MODE_SYMMETRICAL }, + { "BAR_MODE_NORMAL", LV_BAR_MODE_NORMAL }, + { "BAR_MODE_RANGE", LV_BAR_MODE_RANGE }, + { "BAR_MODE_SYMMETRICAL", LV_BAR_MODE_SYMMETRICAL }, + { "BASE_DIR_AUTO", LV_BASE_DIR_AUTO }, + { "BASE_DIR_LTR", LV_BASE_DIR_LTR }, + { "BASE_DIR_NEUTRAL", LV_BASE_DIR_NEUTRAL }, + { "BASE_DIR_RTL", LV_BASE_DIR_RTL }, + { "BASE_DIR_WEAK", LV_BASE_DIR_WEAK }, + { "BLEND_MODE_ADDITIVE", LV_BLEND_MODE_ADDITIVE }, + { "BLEND_MODE_NORMAL", LV_BLEND_MODE_NORMAL }, + { "BLEND_MODE_SUBTRACTIVE", LV_BLEND_MODE_SUBTRACTIVE }, + { "BORDER_SIDE_BOTTOM", LV_BORDER_SIDE_BOTTOM }, + { "BORDER_SIDE_FULL", LV_BORDER_SIDE_FULL }, + { "BORDER_SIDE_INTERNAL", LV_BORDER_SIDE_INTERNAL }, + { "BORDER_SIDE_LEFT", LV_BORDER_SIDE_LEFT }, + { "BORDER_SIDE_NONE", LV_BORDER_SIDE_NONE }, + { "BORDER_SIDE_RIGHT", LV_BORDER_SIDE_RIGHT }, + { "BORDER_SIDE_TOP", LV_BORDER_SIDE_TOP }, + { "BTNMATRIX_CTRL_CHECKABLE", LV_BTNMATRIX_CTRL_CHECKABLE }, + { "BTNMATRIX_CTRL_CHECKED", LV_BTNMATRIX_CTRL_CHECKED }, + { "BTNMATRIX_CTRL_CLICK_TRIG", LV_BTNMATRIX_CTRL_CLICK_TRIG }, + { "BTNMATRIX_CTRL_CUSTOM_1", LV_BTNMATRIX_CTRL_CUSTOM_1 }, + { "BTNMATRIX_CTRL_CUSTOM_2", LV_BTNMATRIX_CTRL_CUSTOM_2 }, + { "BTNMATRIX_CTRL_DISABLED", LV_BTNMATRIX_CTRL_DISABLED }, + { "BTNMATRIX_CTRL_HIDDEN", LV_BTNMATRIX_CTRL_HIDDEN }, + { "BTNMATRIX_CTRL_NO_REPEAT", LV_BTNMATRIX_CTRL_NO_REPEAT }, + { "BTNMATRIX_CTRL_RECOLOR", LV_BTNMATRIX_CTRL_RECOLOR }, + { "CHART_AXIS_PRIMARY_X", LV_CHART_AXIS_PRIMARY_X }, + { "CHART_AXIS_PRIMARY_Y", LV_CHART_AXIS_PRIMARY_Y }, + { "CHART_AXIS_SECONDARY_X", LV_CHART_AXIS_SECONDARY_X }, + { "CHART_AXIS_SECONDARY_Y", LV_CHART_AXIS_SECONDARY_Y }, + { "CHART_TYPE_BAR", LV_CHART_TYPE_BAR }, + { "CHART_TYPE_LINE", LV_CHART_TYPE_LINE }, + { "CHART_TYPE_NONE", LV_CHART_TYPE_NONE }, + { "CHART_TYPE_SCATTER", LV_CHART_TYPE_SCATTER }, + { "CHART_UPDATE_MODE_CIRCULAR", LV_CHART_UPDATE_MODE_CIRCULAR }, + { "CHART_UPDATE_MODE_SHIFT", LV_CHART_UPDATE_MODE_SHIFT }, + { "COLORWHEEL_MODE_HUE", LV_COLORWHEEL_MODE_HUE }, + { "COLORWHEEL_MODE_SATURATION", LV_COLORWHEEL_MODE_SATURATION }, + { "COLORWHEEL_MODE_VALUE", LV_COLORWHEEL_MODE_VALUE }, + { "COLOR_AQUA", (int32_t) 0x00FFFF }, + { "COLOR_BLACK", (int32_t) 0x000000 }, + { "COLOR_BLUE", (int32_t) 0x0000FF }, + { "COLOR_CYAN", (int32_t) 0x00FFFF }, + { "COLOR_GRAY", (int32_t) 0x808080 }, + { "COLOR_GREEN", (int32_t) 0x008000 }, + { "COLOR_LIME", (int32_t) 0x00FF00 }, + { "COLOR_MAGENTA", (int32_t) 0xFF00FF }, + { "COLOR_MAROON", (int32_t) 0x800000 }, + { "COLOR_NAVY", (int32_t) 0x000080 }, + { "COLOR_OLIVE", (int32_t) 0x808000 }, + { "COLOR_PURPLE", (int32_t) 0x800080 }, + { "COLOR_RED", (int32_t) 0xFF0000 }, + { "COLOR_SILVER", (int32_t) 0xC0C0C0 }, + { "COLOR_TEAL", (int32_t) 0x008080 }, + { "COLOR_WHITE", (int32_t) 0xFFFFFF }, + { "COLOR_YELLOW", (int32_t) 0xFFFF00 }, + { "COVER_RES_COVER", LV_COVER_RES_COVER }, + { "COVER_RES_MASKED", LV_COVER_RES_MASKED }, + { "COVER_RES_NOT_COVER", LV_COVER_RES_NOT_COVER }, + { "DIR_ALL", LV_DIR_ALL }, + { "DIR_BOTTOM", LV_DIR_BOTTOM }, + { "DIR_HOR", LV_DIR_HOR }, + { "DIR_LEFT", LV_DIR_LEFT }, + { "DIR_NONE", LV_DIR_NONE }, + { "DIR_RIGHT", LV_DIR_RIGHT }, + { "DIR_TOP", LV_DIR_TOP }, + { "DIR_VER", LV_DIR_VER }, + { "DISP_ROT_180", LV_DISP_ROT_180 }, + { "DISP_ROT_270", LV_DISP_ROT_270 }, + { "DISP_ROT_90", LV_DISP_ROT_90 }, + { "DISP_ROT_NONE", LV_DISP_ROT_NONE }, + { "DRAW_MASK_LINE_SIDE_BOTTOM", LV_DRAW_MASK_LINE_SIDE_BOTTOM }, + { "DRAW_MASK_LINE_SIDE_LEFT", LV_DRAW_MASK_LINE_SIDE_LEFT }, + { "DRAW_MASK_LINE_SIDE_RIGHT", LV_DRAW_MASK_LINE_SIDE_RIGHT }, + { "DRAW_MASK_LINE_SIDE_TOP", LV_DRAW_MASK_LINE_SIDE_TOP }, + { "DRAW_MASK_RES_CHANGED", LV_DRAW_MASK_RES_CHANGED }, + { "DRAW_MASK_RES_FULL_COVER", LV_DRAW_MASK_RES_FULL_COVER }, + { "DRAW_MASK_RES_TRANSP", LV_DRAW_MASK_RES_TRANSP }, + { "DRAW_MASK_RES_UNKNOWN", LV_DRAW_MASK_RES_UNKNOWN }, + { "DRAW_MASK_TYPE_ANGLE", LV_DRAW_MASK_TYPE_ANGLE }, + { "DRAW_MASK_TYPE_FADE", LV_DRAW_MASK_TYPE_FADE }, + { "DRAW_MASK_TYPE_LINE", LV_DRAW_MASK_TYPE_LINE }, + { "DRAW_MASK_TYPE_MAP", LV_DRAW_MASK_TYPE_MAP }, + { "DRAW_MASK_TYPE_RADIUS", LV_DRAW_MASK_TYPE_RADIUS }, + { "EVENT_ALL", LV_EVENT_ALL }, + { "EVENT_CANCEL", LV_EVENT_CANCEL }, + { "EVENT_CHILD_CHANGED", LV_EVENT_CHILD_CHANGED }, + { "EVENT_CLICKED", LV_EVENT_CLICKED }, + { "EVENT_COVER_CHECK", LV_EVENT_COVER_CHECK }, + { "EVENT_DEFOCUSED", LV_EVENT_DEFOCUSED }, + { "EVENT_DELETE", LV_EVENT_DELETE }, + { "EVENT_DRAW_MAIN", LV_EVENT_DRAW_MAIN }, + { "EVENT_DRAW_MAIN_BEGIN", LV_EVENT_DRAW_MAIN_BEGIN }, + { "EVENT_DRAW_MAIN_END", LV_EVENT_DRAW_MAIN_END }, + { "EVENT_DRAW_PART_BEGIN", LV_EVENT_DRAW_PART_BEGIN }, + { "EVENT_DRAW_PART_END", LV_EVENT_DRAW_PART_END }, + { "EVENT_DRAW_POST", LV_EVENT_DRAW_POST }, + { "EVENT_DRAW_POST_BEGIN", LV_EVENT_DRAW_POST_BEGIN }, + { "EVENT_DRAW_POST_END", LV_EVENT_DRAW_POST_END }, + { "EVENT_FOCUSED", LV_EVENT_FOCUSED }, + { "EVENT_GESTURE", LV_EVENT_GESTURE }, + { "EVENT_GET_SELF_SIZE", LV_EVENT_GET_SELF_SIZE }, + { "EVENT_HIT_TEST", LV_EVENT_HIT_TEST }, + { "EVENT_INSERT", LV_EVENT_INSERT }, + { "EVENT_KEY", LV_EVENT_KEY }, + { "EVENT_LAYOUT_CHANGED", LV_EVENT_LAYOUT_CHANGED }, + { "EVENT_LEAVE", LV_EVENT_LEAVE }, + { "EVENT_LONG_PRESSED", LV_EVENT_LONG_PRESSED }, + { "EVENT_LONG_PRESSED_REPEAT", LV_EVENT_LONG_PRESSED_REPEAT }, + { "EVENT_PRESSED", LV_EVENT_PRESSED }, + { "EVENT_PRESSING", LV_EVENT_PRESSING }, + { "EVENT_PRESS_LOST", LV_EVENT_PRESS_LOST }, + { "EVENT_READY", LV_EVENT_READY }, + { "EVENT_REFRESH", LV_EVENT_REFRESH }, + { "EVENT_REFR_EXT_DRAW_SIZE", LV_EVENT_REFR_EXT_DRAW_SIZE }, + { "EVENT_RELEASED", LV_EVENT_RELEASED }, + { "EVENT_SCROLL", LV_EVENT_SCROLL }, + { "EVENT_SCROLL_BEGIN", LV_EVENT_SCROLL_BEGIN }, + { "EVENT_SCROLL_END", LV_EVENT_SCROLL_END }, + { "EVENT_SHORT_CLICKED", LV_EVENT_SHORT_CLICKED }, + { "EVENT_SIZE_CHANGED", LV_EVENT_SIZE_CHANGED }, + { "EVENT_STYLE_CHANGED", LV_EVENT_STYLE_CHANGED }, + { "EVENT_VALUE_CHANGED", LV_EVENT_VALUE_CHANGED }, + { "FLEX_ALIGN_CENTER", LV_FLEX_ALIGN_CENTER }, + { "FLEX_ALIGN_END", LV_FLEX_ALIGN_END }, + { "FLEX_ALIGN_SPACE_AROUND", LV_FLEX_ALIGN_SPACE_AROUND }, + { "FLEX_ALIGN_SPACE_BETWEEN", LV_FLEX_ALIGN_SPACE_BETWEEN }, + { "FLEX_ALIGN_SPACE_EVENLY", LV_FLEX_ALIGN_SPACE_EVENLY }, + { "FLEX_ALIGN_START", LV_FLEX_ALIGN_START }, + { "FLEX_FLOW_COLUMN", LV_FLEX_FLOW_COLUMN }, + { "FLEX_FLOW_COLUMN_REVERSE", LV_FLEX_FLOW_COLUMN_REVERSE }, + { "FLEX_FLOW_COLUMN_WRAP", LV_FLEX_FLOW_COLUMN_WRAP }, + { "FLEX_FLOW_COLUMN_WRAP_REVERSE", LV_FLEX_FLOW_COLUMN_WRAP_REVERSE }, + { "FLEX_FLOW_ROW", LV_FLEX_FLOW_ROW }, + { "FLEX_FLOW_ROW_REVERSE", LV_FLEX_FLOW_ROW_REVERSE }, + { "FLEX_FLOW_ROW_WRAP", LV_FLEX_FLOW_ROW_WRAP }, + { "FLEX_FLOW_ROW_WRAP_REVERSE", LV_FLEX_FLOW_ROW_WRAP_REVERSE }, + { "FS_MODE_RD", LV_FS_MODE_RD }, + { "FS_MODE_WR", LV_FS_MODE_WR }, + { "FS_RES_BUSY", LV_FS_RES_BUSY }, + { "FS_RES_DENIED", LV_FS_RES_DENIED }, + { "FS_RES_FS_ERR", LV_FS_RES_FS_ERR }, + { "FS_RES_FULL", LV_FS_RES_FULL }, + { "FS_RES_HW_ERR", LV_FS_RES_HW_ERR }, + { "FS_RES_INV_PARAM", LV_FS_RES_INV_PARAM }, + { "FS_RES_LOCKED", LV_FS_RES_LOCKED }, + { "FS_RES_NOT_EX", LV_FS_RES_NOT_EX }, + { "FS_RES_NOT_IMP", LV_FS_RES_NOT_IMP }, + { "FS_RES_OK", LV_FS_RES_OK }, + { "FS_RES_OUT_OF_MEM", LV_FS_RES_OUT_OF_MEM }, + { "FS_RES_TOUT", LV_FS_RES_TOUT }, + { "FS_RES_UNKNOWN", LV_FS_RES_UNKNOWN }, + { "FS_SEEK_CUR", LV_FS_SEEK_CUR }, + { "FS_SEEK_END", LV_FS_SEEK_END }, + { "FS_SEEK_SET", LV_FS_SEEK_SET }, + { "GRAD_DIR_HOR", LV_GRAD_DIR_HOR }, + { "GRAD_DIR_NONE", LV_GRAD_DIR_NONE }, + { "GRAD_DIR_VER", LV_GRAD_DIR_VER }, + { "GRID_ALIGN_CENTER", LV_GRID_ALIGN_CENTER }, + { "GRID_ALIGN_END", LV_GRID_ALIGN_END }, + { "GRID_ALIGN_SPACE_AROUND", LV_GRID_ALIGN_SPACE_AROUND }, + { "GRID_ALIGN_SPACE_BETWEEN", LV_GRID_ALIGN_SPACE_BETWEEN }, + { "GRID_ALIGN_SPACE_EVENLY", LV_GRID_ALIGN_SPACE_EVENLY }, + { "GRID_ALIGN_START", LV_GRID_ALIGN_START }, + { "GRID_ALIGN_STRETCH", LV_GRID_ALIGN_STRETCH }, + { "GROUP_REFOCUS_POLICY_NEXT", LV_GROUP_REFOCUS_POLICY_NEXT }, + { "GROUP_REFOCUS_POLICY_PREV", LV_GROUP_REFOCUS_POLICY_PREV }, + { "IMGBTN_STATE_CHECKED_DISABLED", LV_IMGBTN_STATE_CHECKED_DISABLED }, + { "IMGBTN_STATE_CHECKED_PRESSED", LV_IMGBTN_STATE_CHECKED_PRESSED }, + { "IMGBTN_STATE_CHECKED_RELEASED", LV_IMGBTN_STATE_CHECKED_RELEASED }, + { "IMGBTN_STATE_DISABLED", LV_IMGBTN_STATE_DISABLED }, + { "IMGBTN_STATE_PRESSED", LV_IMGBTN_STATE_PRESSED }, + { "IMGBTN_STATE_RELEASED", LV_IMGBTN_STATE_RELEASED }, + { "IMG_CF_ALPHA_1BIT", LV_IMG_CF_ALPHA_1BIT }, + { "IMG_CF_ALPHA_2BIT", LV_IMG_CF_ALPHA_2BIT }, + { "IMG_CF_ALPHA_4BIT", LV_IMG_CF_ALPHA_4BIT }, + { "IMG_CF_ALPHA_8BIT", LV_IMG_CF_ALPHA_8BIT }, + { "IMG_CF_INDEXED_1BIT", LV_IMG_CF_INDEXED_1BIT }, + { "IMG_CF_INDEXED_2BIT", LV_IMG_CF_INDEXED_2BIT }, + { "IMG_CF_INDEXED_4BIT", LV_IMG_CF_INDEXED_4BIT }, + { "IMG_CF_INDEXED_8BIT", LV_IMG_CF_INDEXED_8BIT }, + { "IMG_CF_RAW", LV_IMG_CF_RAW }, + { "IMG_CF_RAW_ALPHA", LV_IMG_CF_RAW_ALPHA }, + { "IMG_CF_RAW_CHROMA_KEYED", LV_IMG_CF_RAW_CHROMA_KEYED }, + { "IMG_CF_TRUE_COLOR", LV_IMG_CF_TRUE_COLOR }, + { "IMG_CF_TRUE_COLOR_ALPHA", LV_IMG_CF_TRUE_COLOR_ALPHA }, + { "IMG_CF_TRUE_COLOR_CHROMA_KEYED", LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED }, + { "IMG_CF_UNKNOWN", LV_IMG_CF_UNKNOWN }, + { "IMG_SRC_FILE", LV_IMG_SRC_FILE }, + { "IMG_SRC_SYMBOL", LV_IMG_SRC_SYMBOL }, + { "IMG_SRC_UNKNOWN", LV_IMG_SRC_UNKNOWN }, + { "IMG_SRC_VARIABLE", LV_IMG_SRC_VARIABLE }, + { "INDEV_STATE_PRESSED", LV_INDEV_STATE_PRESSED }, + { "INDEV_STATE_RELEASED", LV_INDEV_STATE_RELEASED }, + { "INDEV_TYPE_BUTTON", LV_INDEV_TYPE_BUTTON }, + { "INDEV_TYPE_ENCODER", LV_INDEV_TYPE_ENCODER }, + { "INDEV_TYPE_KEYPAD", LV_INDEV_TYPE_KEYPAD }, + { "INDEV_TYPE_NONE", LV_INDEV_TYPE_NONE }, + { "INDEV_TYPE_POINTER", LV_INDEV_TYPE_POINTER }, + { "KEY_BACKSPACE", LV_KEY_BACKSPACE }, + { "KEY_DEL", LV_KEY_DEL }, + { "KEY_DOWN", LV_KEY_DOWN }, + { "KEY_END", LV_KEY_END }, + { "KEY_ENTER", LV_KEY_ENTER }, + { "KEY_ESC", LV_KEY_ESC }, + { "KEY_HOME", LV_KEY_HOME }, + { "KEY_LEFT", LV_KEY_LEFT }, + { "KEY_NEXT", LV_KEY_NEXT }, + { "KEY_PREV", LV_KEY_PREV }, + { "KEY_RIGHT", LV_KEY_RIGHT }, + { "KEY_UP", LV_KEY_UP }, + { "LABEL_LONG_CLIP", LV_LABEL_LONG_CLIP }, + { "LABEL_LONG_DOT", LV_LABEL_LONG_DOT }, + { "LABEL_LONG_SCROLL", LV_LABEL_LONG_SCROLL }, + { "LABEL_LONG_SCROLL_CIRCULAR", LV_LABEL_LONG_SCROLL_CIRCULAR }, + { "LABEL_LONG_WRAP", LV_LABEL_LONG_WRAP }, + { "METER_INDICATOR_TYPE_ARC", LV_METER_INDICATOR_TYPE_ARC }, + { "METER_INDICATOR_TYPE_NEEDLE_IMG", LV_METER_INDICATOR_TYPE_NEEDLE_IMG }, + { "METER_INDICATOR_TYPE_NEEDLE_LINE", LV_METER_INDICATOR_TYPE_NEEDLE_LINE }, + { "METER_INDICATOR_TYPE_SCALE_LINES", LV_METER_INDICATOR_TYPE_SCALE_LINES }, + { "OBJ_CLASS_EDITABLE_FALSE", LV_OBJ_CLASS_EDITABLE_FALSE }, + { "OBJ_CLASS_EDITABLE_INHERIT", LV_OBJ_CLASS_EDITABLE_INHERIT }, + { "OBJ_CLASS_EDITABLE_TRUE", LV_OBJ_CLASS_EDITABLE_TRUE }, + { "OBJ_CLASS_GROUP_DEF_FALSE", LV_OBJ_CLASS_GROUP_DEF_FALSE }, + { "OBJ_CLASS_GROUP_DEF_INHERIT", LV_OBJ_CLASS_GROUP_DEF_INHERIT }, + { "OBJ_CLASS_GROUP_DEF_TRUE", LV_OBJ_CLASS_GROUP_DEF_TRUE }, + { "OBJ_FLAG_ADV_HITTEST", LV_OBJ_FLAG_ADV_HITTEST }, + { "OBJ_FLAG_CHECKABLE", LV_OBJ_FLAG_CHECKABLE }, + { "OBJ_FLAG_CLICKABLE", LV_OBJ_FLAG_CLICKABLE }, + { "OBJ_FLAG_CLICK_FOCUSABLE", LV_OBJ_FLAG_CLICK_FOCUSABLE }, + { "OBJ_FLAG_EVENT_BUBBLE", LV_OBJ_FLAG_EVENT_BUBBLE }, + { "OBJ_FLAG_FLOATING", LV_OBJ_FLAG_FLOATING }, + { "OBJ_FLAG_GESTURE_BUBBLE", LV_OBJ_FLAG_GESTURE_BUBBLE }, + { "OBJ_FLAG_HIDDEN", LV_OBJ_FLAG_HIDDEN }, + { "OBJ_FLAG_IGNORE_LAYOUT", LV_OBJ_FLAG_IGNORE_LAYOUT }, + { "OBJ_FLAG_LAYOUT_1", LV_OBJ_FLAG_LAYOUT_1 }, + { "OBJ_FLAG_LAYOUT_2", LV_OBJ_FLAG_LAYOUT_2 }, + { "OBJ_FLAG_PRESS_LOCK", LV_OBJ_FLAG_PRESS_LOCK }, + { "OBJ_FLAG_SCROLLABLE", LV_OBJ_FLAG_SCROLLABLE }, + { "OBJ_FLAG_SCROLL_CHAIN", LV_OBJ_FLAG_SCROLL_CHAIN }, + { "OBJ_FLAG_SCROLL_ELASTIC", LV_OBJ_FLAG_SCROLL_ELASTIC }, + { "OBJ_FLAG_SCROLL_MOMENTUM", LV_OBJ_FLAG_SCROLL_MOMENTUM }, + { "OBJ_FLAG_SCROLL_ONE", LV_OBJ_FLAG_SCROLL_ONE }, + { "OBJ_FLAG_SCROLL_ON_FOCUS", LV_OBJ_FLAG_SCROLL_ON_FOCUS }, + { "OBJ_FLAG_SNAPABLE", LV_OBJ_FLAG_SNAPABLE }, + { "OBJ_FLAG_USER_1", LV_OBJ_FLAG_USER_1 }, + { "OBJ_FLAG_USER_2", LV_OBJ_FLAG_USER_2 }, + { "OBJ_FLAG_USER_3", LV_OBJ_FLAG_USER_3 }, + { "OBJ_FLAG_USER_4", LV_OBJ_FLAG_USER_4 }, + { "OBJ_FLAG_WIDGET_1", LV_OBJ_FLAG_WIDGET_1 }, + { "OBJ_FLAG_WIDGET_2", LV_OBJ_FLAG_WIDGET_2 }, + { "OBJ_TREE_WALK_END", LV_OBJ_TREE_WALK_END }, + { "OBJ_TREE_WALK_NEXT", LV_OBJ_TREE_WALK_NEXT }, + { "OBJ_TREE_WALK_SKIP_CHILDREN", LV_OBJ_TREE_WALK_SKIP_CHILDREN }, + { "OPA_0", LV_OPA_0 }, + { "OPA_10", LV_OPA_10 }, + { "OPA_100", LV_OPA_100 }, + { "OPA_20", LV_OPA_20 }, + { "OPA_30", LV_OPA_30 }, + { "OPA_40", LV_OPA_40 }, + { "OPA_50", LV_OPA_50 }, + { "OPA_60", LV_OPA_60 }, + { "OPA_70", LV_OPA_70 }, + { "OPA_80", LV_OPA_80 }, + { "OPA_90", LV_OPA_90 }, + { "OPA_COVER", LV_OPA_COVER }, + { "OPA_TRANSP", LV_OPA_TRANSP }, + { "PALETTE_AMBER", LV_PALETTE_AMBER }, + { "PALETTE_BLUE", LV_PALETTE_BLUE }, + { "PALETTE_BLUE_GREY", LV_PALETTE_BLUE_GREY }, + { "PALETTE_BROWN", LV_PALETTE_BROWN }, + { "PALETTE_CYAN", LV_PALETTE_CYAN }, + { "PALETTE_DEEP_ORANGE", LV_PALETTE_DEEP_ORANGE }, + { "PALETTE_DEEP_PURPLE", LV_PALETTE_DEEP_PURPLE }, + { "PALETTE_GREEN", LV_PALETTE_GREEN }, + { "PALETTE_GREY", LV_PALETTE_GREY }, + { "PALETTE_INDIGO", LV_PALETTE_INDIGO }, + { "PALETTE_LIGHT_BLUE", LV_PALETTE_LIGHT_BLUE }, + { "PALETTE_LIGHT_GREEN", LV_PALETTE_LIGHT_GREEN }, + { "PALETTE_LIME", LV_PALETTE_LIME }, + { "PALETTE_NONE", LV_PALETTE_NONE }, + { "PALETTE_ORANGE", LV_PALETTE_ORANGE }, + { "PALETTE_PINK", LV_PALETTE_PINK }, + { "PALETTE_PURPLE", LV_PALETTE_PURPLE }, + { "PALETTE_RED", LV_PALETTE_RED }, + { "PALETTE_TEAL", LV_PALETTE_TEAL }, + { "PALETTE_YELLOW", LV_PALETTE_YELLOW }, + { "PART_ANY", LV_PART_ANY }, + { "PART_CURSOR", LV_PART_CURSOR }, + { "PART_CUSTOM_FIRST", LV_PART_CUSTOM_FIRST }, + { "PART_INDICATOR", LV_PART_INDICATOR }, + { "PART_ITEMS", LV_PART_ITEMS }, + { "PART_KNOB", LV_PART_KNOB }, + { "PART_MAIN", LV_PART_MAIN }, + { "PART_SCROLLBAR", LV_PART_SCROLLBAR }, + { "PART_SELECTED", LV_PART_SELECTED }, + { "PART_TEXTAREA_PLACEHOLDER", LV_PART_TEXTAREA_PLACEHOLDER }, + { "PART_TICKS", LV_PART_TICKS }, + { "RADIUS_CIRCLE", LV_RADIUS_CIRCLE }, + { "RES_INV", LV_RES_INV }, + { "RES_OK", LV_RES_OK }, + { "ROLLER_MODE_INFINITE", LV_ROLLER_MODE_INFINITE }, + { "ROLLER_MODE_NORMAL", LV_ROLLER_MODE_NORMAL }, + { "SCROLLBAR_MODE_ACTIVE", LV_SCROLLBAR_MODE_ACTIVE }, + { "SCROLLBAR_MODE_AUTO", LV_SCROLLBAR_MODE_AUTO }, + { "SCROLLBAR_MODE_OFF", LV_SCROLLBAR_MODE_OFF }, + { "SCROLLBAR_MODE_ON", LV_SCROLLBAR_MODE_ON }, + { "SCROLL_SNAP_CENTER", LV_SCROLL_SNAP_CENTER }, + { "SCROLL_SNAP_END", LV_SCROLL_SNAP_END }, + { "SCROLL_SNAP_NONE", LV_SCROLL_SNAP_NONE }, + { "SCROLL_SNAP_START", LV_SCROLL_SNAP_START }, + { "SCR_LOAD_ANIM_FADE_ON", LV_SCR_LOAD_ANIM_FADE_ON }, + { "SCR_LOAD_ANIM_MOVE_BOTTOM", LV_SCR_LOAD_ANIM_MOVE_BOTTOM }, + { "SCR_LOAD_ANIM_MOVE_LEFT", LV_SCR_LOAD_ANIM_MOVE_LEFT }, + { "SCR_LOAD_ANIM_MOVE_RIGHT", LV_SCR_LOAD_ANIM_MOVE_RIGHT }, + { "SCR_LOAD_ANIM_MOVE_TOP", LV_SCR_LOAD_ANIM_MOVE_TOP }, + { "SCR_LOAD_ANIM_NONE", LV_SCR_LOAD_ANIM_NONE }, + { "SCR_LOAD_ANIM_OVER_BOTTOM", LV_SCR_LOAD_ANIM_OVER_BOTTOM }, + { "SCR_LOAD_ANIM_OVER_LEFT", LV_SCR_LOAD_ANIM_OVER_LEFT }, + { "SCR_LOAD_ANIM_OVER_RIGHT", LV_SCR_LOAD_ANIM_OVER_RIGHT }, + { "SCR_LOAD_ANIM_OVER_TOP", LV_SCR_LOAD_ANIM_OVER_TOP }, + { "SIZE_CONTENT", LV_SIZE_CONTENT }, + { "SLIDER_MODE_NORMAL", LV_SLIDER_MODE_NORMAL }, + { "SLIDER_MODE_RANGE", LV_SLIDER_MODE_RANGE }, + { "SLIDER_MODE_SYMMETRICAL", LV_SLIDER_MODE_SYMMETRICAL }, + { "SPAN_MODE_BREAK", LV_SPAN_MODE_BREAK }, + { "SPAN_MODE_EXPAND", LV_SPAN_MODE_EXPAND }, + { "SPAN_MODE_FIXED", LV_SPAN_MODE_FIXED }, + { "SPAN_OVERFLOW_CLIP", LV_SPAN_OVERFLOW_CLIP }, + { "SPAN_OVERFLOW_ELLIPSIS", LV_SPAN_OVERFLOW_ELLIPSIS }, + { "STATE_ANY", LV_STATE_ANY }, + { "STATE_CHECKED", LV_STATE_CHECKED }, + { "STATE_DEFAULT", LV_STATE_DEFAULT }, + { "STATE_DISABLED", LV_STATE_DISABLED }, + { "STATE_EDITED", LV_STATE_EDITED }, + { "STATE_FOCUSED", LV_STATE_FOCUSED }, + { "STATE_FOCUS_KEY", LV_STATE_FOCUS_KEY }, + { "STATE_HOVERED", LV_STATE_HOVERED }, + { "STATE_PRESSED", LV_STATE_PRESSED }, + { "STATE_SCROLLED", LV_STATE_SCROLLED }, + { "STATE_USER_1", LV_STATE_USER_1 }, + { "STATE_USER_2", LV_STATE_USER_2 }, + { "STATE_USER_3", LV_STATE_USER_3 }, + { "STATE_USER_4", LV_STATE_USER_4 }, + { "STYLE_ALIGN", LV_STYLE_ALIGN }, + { "STYLE_ANIM_SPEED", LV_STYLE_ANIM_SPEED }, + { "STYLE_ANIM_TIME", LV_STYLE_ANIM_TIME }, + { "STYLE_ARC_COLOR", LV_STYLE_ARC_COLOR }, + { "STYLE_ARC_COLOR_FILTERED", LV_STYLE_ARC_COLOR_FILTERED }, + { "STYLE_ARC_IMG_SRC", LV_STYLE_ARC_IMG_SRC }, + { "STYLE_ARC_OPA", LV_STYLE_ARC_OPA }, + { "STYLE_ARC_ROUNDED", LV_STYLE_ARC_ROUNDED }, + { "STYLE_ARC_WIDTH", LV_STYLE_ARC_WIDTH }, + { "STYLE_BASE_DIR", LV_STYLE_BASE_DIR }, + { "STYLE_BG_COLOR", LV_STYLE_BG_COLOR }, + { "STYLE_BG_COLOR_FILTERED", LV_STYLE_BG_COLOR_FILTERED }, + { "STYLE_BG_GRAD_COLOR", LV_STYLE_BG_GRAD_COLOR }, + { "STYLE_BG_GRAD_COLOR_FILTERED", LV_STYLE_BG_GRAD_COLOR_FILTERED }, + { "STYLE_BG_GRAD_DIR", LV_STYLE_BG_GRAD_DIR }, + { "STYLE_BG_GRAD_STOP", LV_STYLE_BG_GRAD_STOP }, + { "STYLE_BG_IMG_OPA", LV_STYLE_BG_IMG_OPA }, + { "STYLE_BG_IMG_RECOLOR", LV_STYLE_BG_IMG_RECOLOR }, + { "STYLE_BG_IMG_RECOLOR_FILTERED", LV_STYLE_BG_IMG_RECOLOR_FILTERED }, + { "STYLE_BG_IMG_RECOLOR_OPA", LV_STYLE_BG_IMG_RECOLOR_OPA }, + { "STYLE_BG_IMG_SRC", LV_STYLE_BG_IMG_SRC }, + { "STYLE_BG_IMG_TILED", LV_STYLE_BG_IMG_TILED }, + { "STYLE_BG_MAIN_STOP", LV_STYLE_BG_MAIN_STOP }, + { "STYLE_BG_OPA", LV_STYLE_BG_OPA }, + { "STYLE_BLEND_MODE", LV_STYLE_BLEND_MODE }, + { "STYLE_BORDER_COLOR", LV_STYLE_BORDER_COLOR }, + { "STYLE_BORDER_COLOR_FILTERED", LV_STYLE_BORDER_COLOR_FILTERED }, + { "STYLE_BORDER_OPA", LV_STYLE_BORDER_OPA }, + { "STYLE_BORDER_POST", LV_STYLE_BORDER_POST }, + { "STYLE_BORDER_SIDE", LV_STYLE_BORDER_SIDE }, + { "STYLE_BORDER_WIDTH", LV_STYLE_BORDER_WIDTH }, + { "STYLE_CLIP_CORNER", LV_STYLE_CLIP_CORNER }, + { "STYLE_COLOR_FILTER_DSC", LV_STYLE_COLOR_FILTER_DSC }, + { "STYLE_COLOR_FILTER_OPA", LV_STYLE_COLOR_FILTER_OPA }, + { "STYLE_HEIGHT", LV_STYLE_HEIGHT }, + { "STYLE_IMG_OPA", LV_STYLE_IMG_OPA }, + { "STYLE_IMG_RECOLOR", LV_STYLE_IMG_RECOLOR }, + { "STYLE_IMG_RECOLOR_FILTERED", LV_STYLE_IMG_RECOLOR_FILTERED }, + { "STYLE_IMG_RECOLOR_OPA", LV_STYLE_IMG_RECOLOR_OPA }, + { "STYLE_LAYOUT", LV_STYLE_LAYOUT }, + { "STYLE_LINE_COLOR", LV_STYLE_LINE_COLOR }, + { "STYLE_LINE_COLOR_FILTERED", LV_STYLE_LINE_COLOR_FILTERED }, + { "STYLE_LINE_DASH_GAP", LV_STYLE_LINE_DASH_GAP }, + { "STYLE_LINE_DASH_WIDTH", LV_STYLE_LINE_DASH_WIDTH }, + { "STYLE_LINE_OPA", LV_STYLE_LINE_OPA }, + { "STYLE_LINE_ROUNDED", LV_STYLE_LINE_ROUNDED }, + { "STYLE_LINE_WIDTH", LV_STYLE_LINE_WIDTH }, + { "STYLE_MAX_HEIGHT", LV_STYLE_MAX_HEIGHT }, + { "STYLE_MAX_WIDTH", LV_STYLE_MAX_WIDTH }, + { "STYLE_MIN_HEIGHT", LV_STYLE_MIN_HEIGHT }, + { "STYLE_MIN_WIDTH", LV_STYLE_MIN_WIDTH }, + { "STYLE_OPA", LV_STYLE_OPA }, + { "STYLE_OUTLINE_COLOR", LV_STYLE_OUTLINE_COLOR }, + { "STYLE_OUTLINE_COLOR_FILTERED", LV_STYLE_OUTLINE_COLOR_FILTERED }, + { "STYLE_OUTLINE_OPA", LV_STYLE_OUTLINE_OPA }, + { "STYLE_OUTLINE_PAD", LV_STYLE_OUTLINE_PAD }, + { "STYLE_OUTLINE_WIDTH", LV_STYLE_OUTLINE_WIDTH }, + { "STYLE_PAD_BOTTOM", LV_STYLE_PAD_BOTTOM }, + { "STYLE_PAD_COLUMN", LV_STYLE_PAD_COLUMN }, + { "STYLE_PAD_LEFT", LV_STYLE_PAD_LEFT }, + { "STYLE_PAD_RIGHT", LV_STYLE_PAD_RIGHT }, + { "STYLE_PAD_ROW", LV_STYLE_PAD_ROW }, + { "STYLE_PAD_TOP", LV_STYLE_PAD_TOP }, + { "STYLE_PROP_ANY", LV_STYLE_PROP_ANY }, + { "STYLE_PROP_INV", LV_STYLE_PROP_INV }, + { "STYLE_RADIUS", LV_STYLE_RADIUS }, + { "STYLE_SHADOW_COLOR", LV_STYLE_SHADOW_COLOR }, + { "STYLE_SHADOW_COLOR_FILTERED", LV_STYLE_SHADOW_COLOR_FILTERED }, + { "STYLE_SHADOW_OFS_X", LV_STYLE_SHADOW_OFS_X }, + { "STYLE_SHADOW_OFS_Y", LV_STYLE_SHADOW_OFS_Y }, + { "STYLE_SHADOW_OPA", LV_STYLE_SHADOW_OPA }, + { "STYLE_SHADOW_SPREAD", LV_STYLE_SHADOW_SPREAD }, + { "STYLE_SHADOW_WIDTH", LV_STYLE_SHADOW_WIDTH }, + { "STYLE_TEXT_ALIGN", LV_STYLE_TEXT_ALIGN }, + { "STYLE_TEXT_COLOR", LV_STYLE_TEXT_COLOR }, + { "STYLE_TEXT_COLOR_FILTERED", LV_STYLE_TEXT_COLOR_FILTERED }, + { "STYLE_TEXT_DECOR", LV_STYLE_TEXT_DECOR }, + { "STYLE_TEXT_FONT", LV_STYLE_TEXT_FONT }, + { "STYLE_TEXT_LETTER_SPACE", LV_STYLE_TEXT_LETTER_SPACE }, + { "STYLE_TEXT_LINE_SPACE", LV_STYLE_TEXT_LINE_SPACE }, + { "STYLE_TEXT_OPA", LV_STYLE_TEXT_OPA }, + { "STYLE_TRANSFORM_ANGLE", LV_STYLE_TRANSFORM_ANGLE }, + { "STYLE_TRANSFORM_HEIGHT", LV_STYLE_TRANSFORM_HEIGHT }, + { "STYLE_TRANSFORM_WIDTH", LV_STYLE_TRANSFORM_WIDTH }, + { "STYLE_TRANSFORM_ZOOM", LV_STYLE_TRANSFORM_ZOOM }, + { "STYLE_TRANSITION", LV_STYLE_TRANSITION }, + { "STYLE_TRANSLATE_X", LV_STYLE_TRANSLATE_X }, + { "STYLE_TRANSLATE_Y", LV_STYLE_TRANSLATE_Y }, + { "STYLE_WIDTH", LV_STYLE_WIDTH }, + { "STYLE_X", LV_STYLE_X }, + { "STYLE_Y", LV_STYLE_Y }, + { "$SYMBOL_AUDIO", (int32_t) "\xef\x80\x81" }, + { "$SYMBOL_BACKSPACE", (int32_t) "\xef\x95\x9A" }, + { "$SYMBOL_BATTERY_1", (int32_t) "\xef\x89\x83" }, + { "$SYMBOL_BATTERY_2", (int32_t) "\xef\x89\x82" }, + { "$SYMBOL_BATTERY_3", (int32_t) "\xef\x89\x81" }, + { "$SYMBOL_BATTERY_EMPTY", (int32_t) "\xef\x89\x84" }, + { "$SYMBOL_BATTERY_FULL", (int32_t) "\xef\x89\x80" }, + { "$SYMBOL_BELL", (int32_t) "\xef\x83\xb3" }, + { "$SYMBOL_BLUETOOTH", (int32_t) "\xef\x8a\x93" }, + { "$SYMBOL_BULLET", (int32_t) "\xE2\x80\xA2" }, + { "$SYMBOL_CALL", (int32_t) "\xef\x82\x95" }, + { "$SYMBOL_CHARGE", (int32_t) "\xef\x83\xa7" }, + { "$SYMBOL_CLOSE", (int32_t) "\xef\x80\x8d" }, + { "$SYMBOL_COPY", (int32_t) "\xef\x83\x85" }, + { "$SYMBOL_CUT", (int32_t) "\xef\x83\x84" }, + { "$SYMBOL_DIRECTORY", (int32_t) "\xef\x81\xbb" }, + { "$SYMBOL_DOWN", (int32_t) "\xef\x81\xb8" }, + { "$SYMBOL_DOWNLOAD", (int32_t) "\xef\x80\x99" }, + { "$SYMBOL_DRIVE", (int32_t) "\xef\x80\x9c" }, + { "$SYMBOL_DUMMY", (int32_t) "\xEF\xA3\xBF" }, + { "$SYMBOL_EDIT", (int32_t) "\xef\x8C\x84" }, + { "$SYMBOL_EJECT", (int32_t) "\xef\x81\x92" }, + { "$SYMBOL_EYE_CLOSE", (int32_t) "\xef\x81\xb0" }, + { "$SYMBOL_EYE_OPEN", (int32_t) "\xef\x81\xae" }, + { "$SYMBOL_FILE", (int32_t) "\xef\x85\x9b" }, + { "$SYMBOL_GPS", (int32_t) "\xef\x84\xa4" }, + { "$SYMBOL_HOME", (int32_t) "\xef\x80\x95" }, + { "$SYMBOL_IMAGE", (int32_t) "\xef\x80\xbe" }, + { "$SYMBOL_KEYBOARD", (int32_t) "\xef\x84\x9c" }, + { "$SYMBOL_LEFT", (int32_t) "\xef\x81\x93" }, + { "$SYMBOL_LIST", (int32_t) "\xef\x80\x8b" }, + { "$SYMBOL_LOOP", (int32_t) "\xef\x81\xb9" }, + { "$SYMBOL_MINUS", (int32_t) "\xef\x81\xa8" }, + { "$SYMBOL_MUTE", (int32_t) "\xef\x80\xa6" }, + { "$SYMBOL_NEW_LINE", (int32_t) "\xef\xA2\xA2" }, + { "$SYMBOL_NEXT", (int32_t) "\xef\x81\x91" }, + { "$SYMBOL_OK", (int32_t) "\xef\x80\x8c" }, + { "$SYMBOL_PASTE", (int32_t) "\xef\x83\xAA" }, + { "$SYMBOL_PAUSE", (int32_t) "\xef\x81\x8c" }, + { "$SYMBOL_PLAY", (int32_t) "\xef\x81\x8b" }, + { "$SYMBOL_PLUS", (int32_t) "\xef\x81\xa7" }, + { "$SYMBOL_POWER", (int32_t) "\xef\x80\x91" }, + { "$SYMBOL_PREV", (int32_t) "\xef\x81\x88" }, + { "$SYMBOL_REFRESH", (int32_t) "\xef\x80\xa1" }, + { "$SYMBOL_RIGHT", (int32_t) "\xef\x81\x94" }, + { "$SYMBOL_SAVE", (int32_t) "\xef\x83\x87" }, + { "$SYMBOL_SD_CARD", (int32_t) "\xef\x9F\x82" }, + { "$SYMBOL_SETTINGS", (int32_t) "\xef\x80\x93" }, + { "$SYMBOL_SHUFFLE", (int32_t) "\xef\x81\xb4" }, + { "$SYMBOL_STOP", (int32_t) "\xef\x81\x8d" }, + { "$SYMBOL_TRASH", (int32_t) "\xef\x8B\xAD" }, + { "$SYMBOL_UP", (int32_t) "\xef\x81\xb7" }, + { "$SYMBOL_UPLOAD", (int32_t) "\xef\x82\x93" }, + { "$SYMBOL_USB", (int32_t) "\xef\x8a\x87" }, + { "$SYMBOL_VIDEO", (int32_t) "\xef\x80\x88" }, + { "$SYMBOL_VOLUME_MAX", (int32_t) "\xef\x80\xa8" }, + { "$SYMBOL_VOLUME_MID", (int32_t) "\xef\x80\xa7" }, + { "$SYMBOL_WARNING", (int32_t) "\xef\x81\xb1" }, + { "$SYMBOL_WIFI", (int32_t) "\xef\x87\xab" }, + { "TABLE_CELL_CTRL_CUSTOM_1", LV_TABLE_CELL_CTRL_CUSTOM_1 }, + { "TABLE_CELL_CTRL_CUSTOM_2", LV_TABLE_CELL_CTRL_CUSTOM_2 }, + { "TABLE_CELL_CTRL_CUSTOM_3", LV_TABLE_CELL_CTRL_CUSTOM_3 }, + { "TABLE_CELL_CTRL_CUSTOM_4", LV_TABLE_CELL_CTRL_CUSTOM_4 }, + { "TABLE_CELL_CTRL_MERGE_RIGHT", LV_TABLE_CELL_CTRL_MERGE_RIGHT }, + { "TABLE_CELL_CTRL_TEXT_CROP", LV_TABLE_CELL_CTRL_TEXT_CROP }, + { "TEXTAREA_CURSOR_LAST", LV_TEXTAREA_CURSOR_LAST }, + { "TEXT_ALIGN_AUTO", LV_TEXT_ALIGN_AUTO }, + { "TEXT_ALIGN_CENTER", LV_TEXT_ALIGN_CENTER }, + { "TEXT_ALIGN_LEFT", LV_TEXT_ALIGN_LEFT }, + { "TEXT_ALIGN_RIGHT", LV_TEXT_ALIGN_RIGHT }, + { "TEXT_CMD_STATE_IN", LV_TEXT_CMD_STATE_IN }, + { "TEXT_CMD_STATE_PAR", LV_TEXT_CMD_STATE_PAR }, + { "TEXT_CMD_STATE_WAIT", LV_TEXT_CMD_STATE_WAIT }, + { "TEXT_DECOR_NONE", LV_TEXT_DECOR_NONE }, + { "TEXT_DECOR_STRIKETHROUGH", LV_TEXT_DECOR_STRIKETHROUGH }, + { "TEXT_DECOR_UNDERLINE", LV_TEXT_DECOR_UNDERLINE }, + { "TEXT_FLAG_EXPAND", LV_TEXT_FLAG_EXPAND }, + { "TEXT_FLAG_FIT", LV_TEXT_FLAG_FIT }, + { "TEXT_FLAG_NONE", LV_TEXT_FLAG_NONE }, + { "TEXT_FLAG_RECOLOR", LV_TEXT_FLAG_RECOLOR }, + { "&font_montserrat", (int32_t) &lv0_load_montserrat_font }, + { "&font_robotocondensed_latin1", (int32_t) &lv0_load_robotocondensed_latin1_font }, + { "&font_seg7", (int32_t) &lv0_load_seg7_font }, + { "&load_font", (int32_t) &lv0_load_font }, + { "&load_freetype_font", (int32_t) &lv0_load_freetype_font }, + { "&montserrat_font", (int32_t) &lv0_load_montserrat_font }, + { "®ister_button_encoder", (int32_t) &lv0_register_button_encoder }, + { "&screenshot", (int32_t) &lv0_screenshot }, + { "&seg7_font", (int32_t) &lv0_load_seg7_font }, + +}; + +const size_t lv0_constants_size = sizeof(lv0_constants)/sizeof(lv0_constants[0]); + +/* generated */ +be_local_module(lv, + "lv", + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("member", 719708611, 6, -1), be_const_func(lv0_member) }, + { be_nested_key("start", 1697318111, 5, 0), be_const_func(lv0_start) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(lv); + +#endif // USE_LVGL + +/********************************************************************/ diff --git a/lib/libesp32/berry/default/be_lvgl_signal_arcs_lib.c b/lib/libesp32/berry/default/be_lvgl_signal_arcs_lib.c new file mode 100644 index 000000000..a127cddd9 --- /dev/null +++ b/lib/libesp32/berry/default/be_lvgl_signal_arcs_lib.c @@ -0,0 +1,434 @@ +/******************************************************************** + * Tasmota LVGL lv_signal_bars widget + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_LVGL + +#include "lvgl.h" + +/******************************************************************** +** Solidified function: set_percentage +********************************************************************/ +be_local_closure(lv_signal_arcs_set_percentage, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(percentage), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(invalidate), + }), + &be_const_str_set_percentage, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x540E0018, // 0001 LDINT R3 25 + 0x0C080403, // 0002 DIV R2 R2 R3 + 0x540E0063, // 0003 LDINT R3 100 + 0x240C0203, // 0004 GT R3 R1 R3 + 0x780E0000, // 0005 JMPF R3 #0007 + 0x54060063, // 0006 LDINT R1 100 + 0x140C0301, // 0007 LT R3 R1 K1 + 0x780E0000, // 0008 JMPF R3 #000A + 0x58040001, // 0009 LDCONST R1 K1 + 0x90020001, // 000A SETMBR R0 K0 R1 + 0x540E0018, // 000B LDINT R3 25 + 0x0C0C0203, // 000C DIV R3 R1 R3 + 0x200C0403, // 000D NE R3 R2 R3 + 0x780E0001, // 000E JMPF R3 #0011 + 0x8C0C0102, // 000F GETMET R3 R0 K2 + 0x7C0C0200, // 0010 CALL R3 1 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_signal_arcs_init, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str(_lvgl), + /* K1 */ be_nested_str(create_custom_widget), + /* K2 */ be_nested_str(percentage), + /* K3 */ be_nested_str(p1), + /* K4 */ be_nested_str(lv), + /* K5 */ be_nested_str(point), + /* K6 */ be_nested_str(p2), + /* K7 */ be_nested_str(area), + /* K8 */ be_nested_str(line_dsc), + /* K9 */ be_nested_str(draw_line_dsc), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100000, // 0002 MOVE R4 R0 + 0x5C140200, // 0003 MOVE R5 R1 + 0x7C080600, // 0004 CALL R2 3 + 0x540A0063, // 0005 LDINT R2 100 + 0x90020402, // 0006 SETMBR R0 K2 R2 + 0xB80A0800, // 0007 GETNGBL R2 K4 + 0x8C080505, // 0008 GETMET R2 R2 K5 + 0x7C080200, // 0009 CALL R2 1 + 0x90020602, // 000A SETMBR R0 K3 R2 + 0xB80A0800, // 000B GETNGBL R2 K4 + 0x8C080505, // 000C GETMET R2 R2 K5 + 0x7C080200, // 000D CALL R2 1 + 0x90020C02, // 000E SETMBR R0 K6 R2 + 0xB80A0800, // 000F GETNGBL R2 K4 + 0x8C080507, // 0010 GETMET R2 R2 K7 + 0x7C080200, // 0011 CALL R2 1 + 0x90020E02, // 0012 SETMBR R0 K7 R2 + 0xB80A0800, // 0013 GETNGBL R2 K4 + 0x8C080509, // 0014 GETMET R2 R2 K9 + 0x7C080200, // 0015 CALL R2 1 + 0x90021002, // 0016 SETMBR R0 K8 R2 + 0x80000000, // 0017 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: widget_event +********************************************************************/ +be_local_closure(lv_signal_arcs_widget_event, /* name */ + be_nested_proto( + 28, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_const_int(1), + }), + &be_const_str_atleast1, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x28040100, // 0000 GE R1 R0 K0 + 0x78060001, // 0001 JMPF R1 #0004 + 0x80040000, // 0002 RET 1 R0 + 0x70020000, // 0003 JMP #0005 + 0x80060000, // 0004 RET 1 K0 + 0x80000000, // 0005 RET 0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[35]) { /* constants */ + /* K0 */ be_nested_str(lv), + /* K1 */ be_nested_str(obj_event_base), + /* K2 */ be_nested_str(RES_OK), + /* K3 */ be_nested_str(code), + /* K4 */ be_nested_str(math), + /* K5 */ be_nested_str(get_height), + /* K6 */ be_nested_str(get_width), + /* K7 */ be_const_int(2), + /* K8 */ be_const_int(3), + /* K9 */ be_nested_str(EVENT_DRAW_MAIN), + /* K10 */ be_nested_str(area), + /* K11 */ be_nested_str(param), + /* K12 */ be_nested_str(get_coords), + /* K13 */ be_nested_str(x1), + /* K14 */ be_nested_str(y1), + /* K15 */ be_nested_str(draw_line_dsc_init), + /* K16 */ be_nested_str(line_dsc), + /* K17 */ be_nested_str(init_draw_line_dsc), + /* K18 */ be_nested_str(PART_MAIN), + /* K19 */ be_nested_str(round_start), + /* K20 */ be_const_int(1), + /* K21 */ be_nested_str(round_end), + /* K22 */ be_nested_str(width), + /* K23 */ be_nested_str(get_style_line_color), + /* K24 */ be_nested_str(STATE_DEFAULT), + /* K25 */ be_nested_str(get_style_bg_color), + /* K26 */ be_nested_str(deg), + /* K27 */ be_nested_str(acos), + /* K28 */ be_nested_str(p1), + /* K29 */ be_nested_str(x), + /* K30 */ be_nested_str(y), + /* K31 */ be_nested_str(color), + /* K32 */ be_nested_str(percentage), + /* K33 */ be_nested_str(draw_arc), + /* K34 */ be_const_int(0), + }), + &be_const_str_widget_event, + &be_const_str_solidified, + ( &(const binstruction[182]) { /* code */ + 0xB80E0000, // 0000 GETNGBL R3 K0 + 0x8C0C0701, // 0001 GETMET R3 R3 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x5C180400, // 0003 MOVE R6 R2 + 0x7C0C0600, // 0004 CALL R3 3 + 0xB8120000, // 0005 GETNGBL R4 K0 + 0x88100902, // 0006 GETMBR R4 R4 K2 + 0x200C0604, // 0007 NE R3 R3 R4 + 0x780E0000, // 0008 JMPF R3 #000A + 0x80000600, // 0009 RET 0 + 0x880C0503, // 000A GETMBR R3 R2 K3 + 0xA4120800, // 000B IMPORT R4 K4 + 0x84140000, // 000C CLOSURE R5 P0 + 0x8C180105, // 000D GETMET R6 R0 K5 + 0x7C180200, // 000E CALL R6 1 + 0x8C1C0106, // 000F GETMET R7 R0 K6 + 0x7C1C0200, // 0010 CALL R7 1 + 0x5C200A00, // 0011 MOVE R8 R5 + 0x54260007, // 0012 LDINT R9 8 + 0x0C240C09, // 0013 DIV R9 R6 R9 + 0x7C200200, // 0014 CALL R8 1 + 0x5C240A00, // 0015 MOVE R9 R5 + 0x08281107, // 0016 MUL R10 R8 K7 + 0x04280C0A, // 0017 SUB R10 R6 R10 + 0x0C281508, // 0018 DIV R10 R10 K8 + 0x7C240200, // 0019 CALL R9 1 + 0x0C281307, // 001A DIV R10 R9 K7 + 0xB82E0000, // 001B GETNGBL R11 K0 + 0x882C1709, // 001C GETMBR R11 R11 K9 + 0x1C2C060B, // 001D EQ R11 R3 R11 + 0x782E0095, // 001E JMPF R11 #00B5 + 0xB82E0000, // 001F GETNGBL R11 K0 + 0x8C2C170A, // 0020 GETMET R11 R11 K10 + 0x8834050B, // 0021 GETMBR R13 R2 K11 + 0x7C2C0400, // 0022 CALL R11 2 + 0x8C30010C, // 0023 GETMET R12 R0 K12 + 0x8838010A, // 0024 GETMBR R14 R0 K10 + 0x7C300400, // 0025 CALL R12 2 + 0x8830010A, // 0026 GETMBR R12 R0 K10 + 0x8830190D, // 0027 GETMBR R12 R12 K13 + 0x8834010A, // 0028 GETMBR R13 R0 K10 + 0x88341B0E, // 0029 GETMBR R13 R13 K14 + 0xB83A0000, // 002A GETNGBL R14 K0 + 0x8C381D0F, // 002B GETMET R14 R14 K15 + 0x88400110, // 002C GETMBR R16 R0 K16 + 0x7C380400, // 002D CALL R14 2 + 0x8C380111, // 002E GETMET R14 R0 K17 + 0xB8420000, // 002F GETNGBL R16 K0 + 0x88402112, // 0030 GETMBR R16 R16 K18 + 0x88440110, // 0031 GETMBR R17 R0 K16 + 0x7C380600, // 0032 CALL R14 3 + 0x88380110, // 0033 GETMBR R14 R0 K16 + 0x903A2714, // 0034 SETMBR R14 K19 K20 + 0x88380110, // 0035 GETMBR R14 R0 K16 + 0x903A2B14, // 0036 SETMBR R14 K21 K20 + 0x88380110, // 0037 GETMBR R14 R0 K16 + 0x083C1308, // 0038 MUL R15 R9 K8 + 0x003C1F14, // 0039 ADD R15 R15 K20 + 0x54420003, // 003A LDINT R16 4 + 0x0C3C1E10, // 003B DIV R15 R15 R16 + 0x903A2C0F, // 003C SETMBR R14 K22 R15 + 0x8C380117, // 003D GETMET R14 R0 K23 + 0xB8420000, // 003E GETNGBL R16 K0 + 0x88402112, // 003F GETMBR R16 R16 K18 + 0xB8460000, // 0040 GETNGBL R17 K0 + 0x88442318, // 0041 GETMBR R17 R17 K24 + 0x30402011, // 0042 OR R16 R16 R17 + 0x7C380400, // 0043 CALL R14 2 + 0x8C3C0119, // 0044 GETMET R15 R0 K25 + 0xB8460000, // 0045 GETNGBL R17 K0 + 0x88442312, // 0046 GETMBR R17 R17 K18 + 0xB84A0000, // 0047 GETNGBL R18 K0 + 0x88482518, // 0048 GETMBR R18 R18 K24 + 0x30442212, // 0049 OR R17 R17 R18 + 0x7C3C0400, // 004A CALL R15 2 + 0x04400C09, // 004B SUB R16 R6 R9 + 0x0C440F07, // 004C DIV R17 R7 K7 + 0x0444220A, // 004D SUB R17 R17 R10 + 0x60480009, // 004E GETGBL R18 G9 + 0x544E0059, // 004F LDINT R19 90 + 0x8C50091A, // 0050 GETMET R20 R4 K26 + 0x8C58091B, // 0051 GETMET R22 R4 K27 + 0x6060000A, // 0052 GETGBL R24 G10 + 0x5C642200, // 0053 MOVE R25 R17 + 0x7C600200, // 0054 CALL R24 1 + 0x6064000A, // 0055 GETGBL R25 G10 + 0x5C682000, // 0056 MOVE R26 R16 + 0x7C640200, // 0057 CALL R25 1 + 0x0C603019, // 0058 DIV R24 R24 R25 + 0x7C580400, // 0059 CALL R22 2 + 0x7C500400, // 005A CALL R20 2 + 0x044C2614, // 005B SUB R19 R19 R20 + 0x7C480200, // 005C CALL R18 1 + 0x544E002C, // 005D LDINT R19 45 + 0x244C2413, // 005E GT R19 R18 R19 + 0x784E0000, // 005F JMPF R19 #0061 + 0x544A002C, // 0060 LDINT R18 45 + 0x884C011C, // 0061 GETMBR R19 R0 K28 + 0x0C500F07, // 0062 DIV R20 R7 K7 + 0x00501814, // 0063 ADD R20 R12 R20 + 0x904E3A14, // 0064 SETMBR R19 K29 R20 + 0x884C011C, // 0065 GETMBR R19 R0 K28 + 0x00501A06, // 0066 ADD R20 R13 R6 + 0x04502914, // 0067 SUB R20 R20 K20 + 0x0450280A, // 0068 SUB R20 R20 R10 + 0x904E3C14, // 0069 SETMBR R19 K30 R20 + 0x884C0110, // 006A GETMBR R19 R0 K16 + 0x88500120, // 006B GETMBR R20 R0 K32 + 0x54560018, // 006C LDINT R21 25 + 0x28502815, // 006D GE R20 R20 R21 + 0x78520001, // 006E JMPF R20 #0071 + 0x5C501C00, // 006F MOVE R20 R14 + 0x70020000, // 0070 JMP #0072 + 0x5C501E00, // 0071 MOVE R20 R15 + 0x904E3E14, // 0072 SETMBR R19 K31 R20 + 0xB84E0000, // 0073 GETNGBL R19 K0 + 0x8C4C2721, // 0074 GETMET R19 R19 K33 + 0x8854011C, // 0075 GETMBR R21 R0 K28 + 0x88542B1D, // 0076 GETMBR R21 R21 K29 + 0x8858011C, // 0077 GETMBR R22 R0 K28 + 0x88582D1E, // 0078 GETMBR R22 R22 K30 + 0x005C1208, // 0079 ADD R23 R9 R8 + 0x085E4417, // 007A MUL R23 K34 R23 + 0x005C2E0A, // 007B ADD R23 R23 R10 + 0x58600022, // 007C LDCONST R24 K34 + 0x54660167, // 007D LDINT R25 360 + 0x5C681600, // 007E MOVE R26 R11 + 0x886C0110, // 007F GETMBR R27 R0 K16 + 0x7C4C1000, // 0080 CALL R19 8 + 0x884C0110, // 0081 GETMBR R19 R0 K16 + 0x88500120, // 0082 GETMBR R20 R0 K32 + 0x54560031, // 0083 LDINT R21 50 + 0x28502815, // 0084 GE R20 R20 R21 + 0x78520001, // 0085 JMPF R20 #0088 + 0x5C501C00, // 0086 MOVE R20 R14 + 0x70020000, // 0087 JMP #0089 + 0x5C501E00, // 0088 MOVE R20 R15 + 0x904E3E14, // 0089 SETMBR R19 K31 R20 + 0xB84E0000, // 008A GETNGBL R19 K0 + 0x8C4C2721, // 008B GETMET R19 R19 K33 + 0x8854011C, // 008C GETMBR R21 R0 K28 + 0x88542B1D, // 008D GETMBR R21 R21 K29 + 0x8858011C, // 008E GETMBR R22 R0 K28 + 0x88582D1E, // 008F GETMBR R22 R22 K30 + 0x005C1208, // 0090 ADD R23 R9 R8 + 0x085E2817, // 0091 MUL R23 K20 R23 + 0x005C2E0A, // 0092 ADD R23 R23 R10 + 0x045C2F14, // 0093 SUB R23 R23 K20 + 0x5462010D, // 0094 LDINT R24 270 + 0x04603012, // 0095 SUB R24 R24 R18 + 0x5466010D, // 0096 LDINT R25 270 + 0x00643212, // 0097 ADD R25 R25 R18 + 0x5C681600, // 0098 MOVE R26 R11 + 0x886C0110, // 0099 GETMBR R27 R0 K16 + 0x7C4C1000, // 009A CALL R19 8 + 0x884C0110, // 009B GETMBR R19 R0 K16 + 0x88500120, // 009C GETMBR R20 R0 K32 + 0x5456004A, // 009D LDINT R21 75 + 0x28502815, // 009E GE R20 R20 R21 + 0x78520001, // 009F JMPF R20 #00A2 + 0x5C501C00, // 00A0 MOVE R20 R14 + 0x70020000, // 00A1 JMP #00A3 + 0x5C501E00, // 00A2 MOVE R20 R15 + 0x904E3E14, // 00A3 SETMBR R19 K31 R20 + 0xB84E0000, // 00A4 GETNGBL R19 K0 + 0x8C4C2721, // 00A5 GETMET R19 R19 K33 + 0x8854011C, // 00A6 GETMBR R21 R0 K28 + 0x88542B1D, // 00A7 GETMBR R21 R21 K29 + 0x8858011C, // 00A8 GETMBR R22 R0 K28 + 0x88582D1E, // 00A9 GETMBR R22 R22 K30 + 0x005C1208, // 00AA ADD R23 R9 R8 + 0x085E0E17, // 00AB MUL R23 K7 R23 + 0x005C2E0A, // 00AC ADD R23 R23 R10 + 0x045C2F07, // 00AD SUB R23 R23 K7 + 0x5462010D, // 00AE LDINT R24 270 + 0x04603012, // 00AF SUB R24 R24 R18 + 0x5466010D, // 00B0 LDINT R25 270 + 0x00643212, // 00B1 ADD R25 R25 R18 + 0x5C681600, // 00B2 MOVE R26 R11 + 0x886C0110, // 00B3 GETMBR R27 R0 K16 + 0x7C4C1000, // 00B4 CALL R19 8 + 0x80000000, // 00B5 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_percentage +********************************************************************/ +be_local_closure(lv_signal_arcs_get_percentage, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(percentage), + }), + &be_const_str_get_percentage, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_signal_arcs +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_signal_arcs, + 5, + &be_class_lv_obj, + be_nested_map(9, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(percentage, 4), be_const_var(0) }, + { be_const_key(p1, 3), be_const_var(1) }, + { be_const_key(p2, -1), be_const_var(2) }, + { be_const_key(area, -1), be_const_var(3) }, + { be_const_key(line_dsc, -1), be_const_var(4) }, + { be_const_key(set_percentage, -1), be_const_closure(lv_signal_arcs_set_percentage_closure) }, + { be_const_key(init, -1), be_const_closure(lv_signal_arcs_init_closure) }, + { be_const_key(widget_event, -1), be_const_closure(lv_signal_arcs_widget_event_closure) }, + { be_const_key(get_percentage, 5), be_const_closure(lv_signal_arcs_get_percentage_closure) }, + })), + be_str_literal("lv_signal_arcs") +); +/*******************************************************************/ + +void be_load_lv_signal_arcs_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_signal_arcs); + be_setglobal(vm, "lv_signal_arcs"); + be_pop(vm, 1); +} + +#endif // USE_LVGL \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_lvgl_signal_bars_lib.c b/lib/libesp32/berry/default/be_lvgl_signal_bars_lib.c new file mode 100644 index 000000000..18452ae34 --- /dev/null +++ b/lib/libesp32/berry/default/be_lvgl_signal_bars_lib.c @@ -0,0 +1,392 @@ +/******************************************************************** + * Tasmota LVGL lv_signal_bars widget + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_LVGL + +#include "lvgl.h" + +/******************************************************************** +** Solidified function: set_percentage +********************************************************************/ +be_local_closure(lv_signal_bars_set_percentage, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(percentage), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(invalidate), + }), + &be_const_str_set_percentage, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x540E0013, // 0001 LDINT R3 20 + 0x0C080403, // 0002 DIV R2 R2 R3 + 0x540E0063, // 0003 LDINT R3 100 + 0x240C0203, // 0004 GT R3 R1 R3 + 0x780E0000, // 0005 JMPF R3 #0007 + 0x54060063, // 0006 LDINT R1 100 + 0x140C0301, // 0007 LT R3 R1 K1 + 0x780E0000, // 0008 JMPF R3 #000A + 0x58040001, // 0009 LDCONST R1 K1 + 0x90020001, // 000A SETMBR R0 K0 R1 + 0x540E0013, // 000B LDINT R3 20 + 0x0C0C0203, // 000C DIV R3 R1 R3 + 0x200C0403, // 000D NE R3 R2 R3 + 0x780E0001, // 000E JMPF R3 #0011 + 0x8C0C0102, // 000F GETMET R3 R0 K2 + 0x7C0C0200, // 0010 CALL R3 1 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_signal_bars_init, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str(_lvgl), + /* K1 */ be_nested_str(create_custom_widget), + /* K2 */ be_nested_str(percentage), + /* K3 */ be_nested_str(p1), + /* K4 */ be_nested_str(lv), + /* K5 */ be_nested_str(point), + /* K6 */ be_nested_str(p2), + /* K7 */ be_nested_str(area), + /* K8 */ be_nested_str(line_dsc), + /* K9 */ be_nested_str(draw_line_dsc), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100000, // 0002 MOVE R4 R0 + 0x5C140200, // 0003 MOVE R5 R1 + 0x7C080600, // 0004 CALL R2 3 + 0x540A0063, // 0005 LDINT R2 100 + 0x90020402, // 0006 SETMBR R0 K2 R2 + 0xB80A0800, // 0007 GETNGBL R2 K4 + 0x8C080505, // 0008 GETMET R2 R2 K5 + 0x7C080200, // 0009 CALL R2 1 + 0x90020602, // 000A SETMBR R0 K3 R2 + 0xB80A0800, // 000B GETNGBL R2 K4 + 0x8C080505, // 000C GETMET R2 R2 K5 + 0x7C080200, // 000D CALL R2 1 + 0x90020C02, // 000E SETMBR R0 K6 R2 + 0xB80A0800, // 000F GETNGBL R2 K4 + 0x8C080507, // 0010 GETMET R2 R2 K7 + 0x7C080200, // 0011 CALL R2 1 + 0x90020E02, // 0012 SETMBR R0 K7 R2 + 0xB80A0800, // 0013 GETNGBL R2 K4 + 0x8C080509, // 0014 GETMET R2 R2 K9 + 0x7C080200, // 0015 CALL R2 1 + 0x90021002, // 0016 SETMBR R0 K8 R2 + 0x80000000, // 0017 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: widget_event +********************************************************************/ +be_local_closure(lv_signal_bars_widget_event, /* name */ + be_nested_proto( + 23, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_const_int(1), + }), + &be_const_str_atleast1, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x28040100, // 0000 GE R1 R0 K0 + 0x78060001, // 0001 JMPF R1 #0004 + 0x80040000, // 0002 RET 1 R0 + 0x70020000, // 0003 JMP #0005 + 0x80060000, // 0004 RET 1 K0 + 0x80000000, // 0005 RET 0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[37]) { /* constants */ + /* K0 */ be_nested_str(lv), + /* K1 */ be_nested_str(obj_event_base), + /* K2 */ be_nested_str(RES_OK), + /* K3 */ be_nested_str(code), + /* K4 */ be_nested_str(get_height), + /* K5 */ be_nested_str(get_width), + /* K6 */ be_const_int(3), + /* K7 */ be_const_int(2), + /* K8 */ be_nested_str(EVENT_DRAW_MAIN), + /* K9 */ be_nested_str(area), + /* K10 */ be_nested_str(param), + /* K11 */ be_nested_str(get_coords), + /* K12 */ be_nested_str(x1), + /* K13 */ be_nested_str(y1), + /* K14 */ be_nested_str(draw_line_dsc_init), + /* K15 */ be_nested_str(line_dsc), + /* K16 */ be_nested_str(init_draw_line_dsc), + /* K17 */ be_nested_str(PART_MAIN), + /* K18 */ be_nested_str(round_start), + /* K19 */ be_const_int(1), + /* K20 */ be_nested_str(round_end), + /* K21 */ be_nested_str(width), + /* K22 */ be_nested_str(get_style_line_color), + /* K23 */ be_nested_str(STATE_DEFAULT), + /* K24 */ be_nested_str(get_style_bg_color), + /* K25 */ be_nested_str(event_send), + /* K26 */ be_nested_str(EVENT_DRAW_PART_BEGIN), + /* K27 */ be_const_int(0), + /* K28 */ be_nested_str(color), + /* K29 */ be_nested_str(percentage), + /* K30 */ be_nested_str(p1), + /* K31 */ be_nested_str(y), + /* K32 */ be_nested_str(x), + /* K33 */ be_nested_str(p2), + /* K34 */ be_nested_str(draw_line), + /* K35 */ be_nested_str(stop_iteration), + /* K36 */ be_nested_str(EVENT_DRAW_PART_END), + }), + &be_const_str_widget_event, + &be_const_str_solidified, + ( &(const binstruction[138]) { /* code */ + 0xB80E0000, // 0000 GETNGBL R3 K0 + 0x8C0C0701, // 0001 GETMET R3 R3 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x5C180400, // 0003 MOVE R6 R2 + 0x7C0C0600, // 0004 CALL R3 3 + 0xB8120000, // 0005 GETNGBL R4 K0 + 0x88100902, // 0006 GETMBR R4 R4 K2 + 0x200C0604, // 0007 NE R3 R3 R4 + 0x780E0000, // 0008 JMPF R3 #000A + 0x80000600, // 0009 RET 0 + 0x880C0503, // 000A GETMBR R3 R2 K3 + 0x84100000, // 000B CLOSURE R4 P0 + 0x8C140104, // 000C GETMET R5 R0 K4 + 0x7C140200, // 000D CALL R5 1 + 0x8C180105, // 000E GETMET R6 R0 K5 + 0x7C180200, // 000F CALL R6 1 + 0x5C1C0800, // 0010 MOVE R7 R4 + 0x5422000E, // 0011 LDINT R8 15 + 0x0C200C08, // 0012 DIV R8 R6 R8 + 0x7C1C0200, // 0013 CALL R7 1 + 0x5C200800, // 0014 MOVE R8 R4 + 0x08240F06, // 0015 MUL R9 R7 K6 + 0x04240C09, // 0016 SUB R9 R6 R9 + 0x542A0003, // 0017 LDINT R10 4 + 0x0C24120A, // 0018 DIV R9 R9 R10 + 0x7C200200, // 0019 CALL R8 1 + 0x0C241107, // 001A DIV R9 R8 K7 + 0xB82A0000, // 001B GETNGBL R10 K0 + 0x88281508, // 001C GETMBR R10 R10 K8 + 0x1C28060A, // 001D EQ R10 R3 R10 + 0x782A0069, // 001E JMPF R10 #0089 + 0xB82A0000, // 001F GETNGBL R10 K0 + 0x8C281509, // 0020 GETMET R10 R10 K9 + 0x8830050A, // 0021 GETMBR R12 R2 K10 + 0x7C280400, // 0022 CALL R10 2 + 0x8C2C010B, // 0023 GETMET R11 R0 K11 + 0x88340109, // 0024 GETMBR R13 R0 K9 + 0x7C2C0400, // 0025 CALL R11 2 + 0x882C0109, // 0026 GETMBR R11 R0 K9 + 0x882C170C, // 0027 GETMBR R11 R11 K12 + 0x88300109, // 0028 GETMBR R12 R0 K9 + 0x8830190D, // 0029 GETMBR R12 R12 K13 + 0xB8360000, // 002A GETNGBL R13 K0 + 0x8C341B0E, // 002B GETMET R13 R13 K14 + 0x883C010F, // 002C GETMBR R15 R0 K15 + 0x7C340400, // 002D CALL R13 2 + 0x8C340110, // 002E GETMET R13 R0 K16 + 0xB83E0000, // 002F GETNGBL R15 K0 + 0x883C1F11, // 0030 GETMBR R15 R15 K17 + 0x8840010F, // 0031 GETMBR R16 R0 K15 + 0x7C340600, // 0032 CALL R13 3 + 0x8834010F, // 0033 GETMBR R13 R0 K15 + 0x90362513, // 0034 SETMBR R13 K18 K19 + 0x8834010F, // 0035 GETMBR R13 R0 K15 + 0x90362913, // 0036 SETMBR R13 K20 K19 + 0x8834010F, // 0037 GETMBR R13 R0 K15 + 0x90362A08, // 0038 SETMBR R13 K21 R8 + 0x8C340116, // 0039 GETMET R13 R0 K22 + 0xB83E0000, // 003A GETNGBL R15 K0 + 0x883C1F11, // 003B GETMBR R15 R15 K17 + 0xB8420000, // 003C GETNGBL R16 K0 + 0x88402117, // 003D GETMBR R16 R16 K23 + 0x303C1E10, // 003E OR R15 R15 R16 + 0x7C340400, // 003F CALL R13 2 + 0x8C380118, // 0040 GETMET R14 R0 K24 + 0xB8420000, // 0041 GETNGBL R16 K0 + 0x88402111, // 0042 GETMBR R16 R16 K17 + 0xB8460000, // 0043 GETNGBL R17 K0 + 0x88442317, // 0044 GETMBR R17 R17 K23 + 0x30402011, // 0045 OR R16 R16 R17 + 0x7C380400, // 0046 CALL R14 2 + 0xB83E0000, // 0047 GETNGBL R15 K0 + 0x8C3C1F19, // 0048 GETMET R15 R15 K25 + 0x5C440000, // 0049 MOVE R17 R0 + 0xB84A0000, // 004A GETNGBL R18 K0 + 0x8848251A, // 004B GETMBR R18 R18 K26 + 0x884C010F, // 004C GETMBR R19 R0 K15 + 0x7C3C0800, // 004D CALL R15 4 + 0x603C0010, // 004E GETGBL R15 G16 + 0x40423706, // 004F CONNECT R16 K27 K6 + 0x7C3C0200, // 0050 CALL R15 1 + 0xA802002C, // 0051 EXBLK 0 #007F + 0x5C401E00, // 0052 MOVE R16 R15 + 0x7C400000, // 0053 CALL R16 0 + 0x8844010F, // 0054 GETMBR R17 R0 K15 + 0x8848011D, // 0055 GETMBR R18 R0 K29 + 0x004C2113, // 0056 ADD R19 R16 K19 + 0x54520013, // 0057 LDINT R20 20 + 0x084C2614, // 0058 MUL R19 R19 R20 + 0x28482413, // 0059 GE R18 R18 R19 + 0x784A0001, // 005A JMPF R18 #005D + 0x5C481A00, // 005B MOVE R18 R13 + 0x70020000, // 005C JMP #005E + 0x5C481C00, // 005D MOVE R18 R14 + 0x90463812, // 005E SETMBR R17 K28 R18 + 0x8844011E, // 005F GETMBR R17 R0 K30 + 0x00481805, // 0060 ADD R18 R12 R5 + 0x04482513, // 0061 SUB R18 R18 K19 + 0x04482409, // 0062 SUB R18 R18 R9 + 0x90463E12, // 0063 SETMBR R17 K31 R18 + 0x8844011E, // 0064 GETMBR R17 R0 K30 + 0x00481007, // 0065 ADD R18 R8 R7 + 0x08482012, // 0066 MUL R18 R16 R18 + 0x00481612, // 0067 ADD R18 R11 R18 + 0x00482409, // 0068 ADD R18 R18 R9 + 0x90464012, // 0069 SETMBR R17 K32 R18 + 0x88440121, // 006A GETMBR R17 R0 K33 + 0x044A0C10, // 006B SUB R18 K6 R16 + 0x044C0A08, // 006C SUB R19 R5 R8 + 0x08482413, // 006D MUL R18 R18 R19 + 0x544E0003, // 006E LDINT R19 4 + 0x0C482413, // 006F DIV R18 R18 R19 + 0x00481812, // 0070 ADD R18 R12 R18 + 0x00482409, // 0071 ADD R18 R18 R9 + 0x90463E12, // 0072 SETMBR R17 K31 R18 + 0x88440121, // 0073 GETMBR R17 R0 K33 + 0x8848011E, // 0074 GETMBR R18 R0 K30 + 0x88482520, // 0075 GETMBR R18 R18 K32 + 0x90464012, // 0076 SETMBR R17 K32 R18 + 0xB8460000, // 0077 GETNGBL R17 K0 + 0x8C442322, // 0078 GETMET R17 R17 K34 + 0x884C011E, // 0079 GETMBR R19 R0 K30 + 0x88500121, // 007A GETMBR R20 R0 K33 + 0x5C541400, // 007B MOVE R21 R10 + 0x8858010F, // 007C GETMBR R22 R0 K15 + 0x7C440A00, // 007D CALL R17 5 + 0x7001FFD2, // 007E JMP #0052 + 0x583C0023, // 007F LDCONST R15 K35 + 0xAC3C0200, // 0080 CATCH R15 1 0 + 0xB0080000, // 0081 RAISE 2 R0 R0 + 0xB83E0000, // 0082 GETNGBL R15 K0 + 0x8C3C1F19, // 0083 GETMET R15 R15 K25 + 0x5C440000, // 0084 MOVE R17 R0 + 0xB84A0000, // 0085 GETNGBL R18 K0 + 0x88482524, // 0086 GETMBR R18 R18 K36 + 0x884C010F, // 0087 GETMBR R19 R0 K15 + 0x7C3C0800, // 0088 CALL R15 4 + 0x80000000, // 0089 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_percentage +********************************************************************/ +be_local_closure(lv_signal_bars_get_percentage, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(percentage), + }), + &be_const_str_get_percentage, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_signal_bars +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_signal_bars, + 5, + &be_class_lv_obj, + be_nested_map(9, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(percentage, 4), be_const_var(0) }, + { be_const_key(p1, 3), be_const_var(1) }, + { be_const_key(p2, -1), be_const_var(2) }, + { be_const_key(area, -1), be_const_var(3) }, + { be_const_key(line_dsc, -1), be_const_var(4) }, + { be_const_key(set_percentage, -1), be_const_closure(lv_signal_bars_set_percentage_closure) }, + { be_const_key(init, -1), be_const_closure(lv_signal_bars_init_closure) }, + { be_const_key(widget_event, -1), be_const_closure(lv_signal_bars_widget_event_closure) }, + { be_const_key(get_percentage, 5), be_const_closure(lv_signal_bars_get_percentage_closure) }, + })), + be_str_literal("lv_signal_bars") +); +/*******************************************************************/ + +void be_load_lv_signal_bars_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_signal_bars); + be_setglobal(vm, "lv_signal_bars"); + be_pop(vm, 1); +} + +#endif // USE_LVGL \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_lvgl_widgets_lib.c b/lib/libesp32/berry/default/be_lvgl_widgets_lib.c new file mode 100644 index 000000000..68950d144 --- /dev/null +++ b/lib/libesp32/berry/default/be_lvgl_widgets_lib.c @@ -0,0 +1,1564 @@ + +/******************************************************************** + * Generated code, don't edit + *******************************************************************/ + + /******************************************************************** + * Tasmota LVGL classes for widgets + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_LVGL + +#include "lvgl.h" + +extern int lv0_init(bvm *vm); + +extern int lco_init(bvm *vm); // generic function +extern int lco_tostring(bvm *vm); // generic function +extern int lco_toint(bvm *vm); // generic function + +extern int lvx_member(bvm *vm); +extern int lvx_tostring(bvm *vm); // generic function + +extern int lvs_init(bvm *vm); +extern int lvs_tostring(bvm *vm); + +BE_EXPORT_VARIABLE extern const bclass be_class_lv_obj; + +extern int lvbe_font_create(bvm *vm); +extern int lvbe_theme_create(bvm *vm); + + +/* `lv_style` external functions definitions */ +extern int lvbe_style_set_width(bvm *vm); +extern int lvbe_style_set_min_width(bvm *vm); +extern int lvbe_style_set_max_width(bvm *vm); +extern int lvbe_style_set_height(bvm *vm); +extern int lvbe_style_set_min_height(bvm *vm); +extern int lvbe_style_set_max_height(bvm *vm); +extern int lvbe_style_set_x(bvm *vm); +extern int lvbe_style_set_y(bvm *vm); +extern int lvbe_style_set_align(bvm *vm); +extern int lvbe_style_set_transform_width(bvm *vm); +extern int lvbe_style_set_transform_height(bvm *vm); +extern int lvbe_style_set_translate_x(bvm *vm); +extern int lvbe_style_set_translate_y(bvm *vm); +extern int lvbe_style_set_transform_zoom(bvm *vm); +extern int lvbe_style_set_transform_angle(bvm *vm); +extern int lvbe_style_set_pad_top(bvm *vm); +extern int lvbe_style_set_pad_bottom(bvm *vm); +extern int lvbe_style_set_pad_left(bvm *vm); +extern int lvbe_style_set_pad_right(bvm *vm); +extern int lvbe_style_set_pad_row(bvm *vm); +extern int lvbe_style_set_pad_column(bvm *vm); +extern int lvbe_style_set_radius(bvm *vm); +extern int lvbe_style_set_clip_corner(bvm *vm); +extern int lvbe_style_set_opa(bvm *vm); +extern int lvbe_style_set_color_filter_dsc(bvm *vm); +extern int lvbe_style_set_color_filter_opa(bvm *vm); +extern int lvbe_style_set_anim_time(bvm *vm); +extern int lvbe_style_set_anim_speed(bvm *vm); +extern int lvbe_style_set_transition(bvm *vm); +extern int lvbe_style_set_blend_mode(bvm *vm); +extern int lvbe_style_set_layout(bvm *vm); +extern int lvbe_style_set_base_dir(bvm *vm); +extern int lvbe_style_set_bg_color(bvm *vm); +extern int lvbe_style_set_bg_color_filtered(bvm *vm); +extern int lvbe_style_set_bg_opa(bvm *vm); +extern int lvbe_style_set_bg_grad_color(bvm *vm); +extern int lvbe_style_set_bg_grad_color_filtered(bvm *vm); +extern int lvbe_style_set_bg_grad_dir(bvm *vm); +extern int lvbe_style_set_bg_main_stop(bvm *vm); +extern int lvbe_style_set_bg_grad_stop(bvm *vm); +extern int lvbe_style_set_bg_img_src(bvm *vm); +extern int lvbe_style_set_bg_img_opa(bvm *vm); +extern int lvbe_style_set_bg_img_recolor(bvm *vm); +extern int lvbe_style_set_bg_img_recolor_filtered(bvm *vm); +extern int lvbe_style_set_bg_img_recolor_opa(bvm *vm); +extern int lvbe_style_set_bg_img_tiled(bvm *vm); +extern int lvbe_style_set_border_color(bvm *vm); +extern int lvbe_style_set_border_color_filtered(bvm *vm); +extern int lvbe_style_set_border_opa(bvm *vm); +extern int lvbe_style_set_border_width(bvm *vm); +extern int lvbe_style_set_border_side(bvm *vm); +extern int lvbe_style_set_border_post(bvm *vm); +extern int lvbe_style_set_text_color(bvm *vm); +extern int lvbe_style_set_text_color_filtered(bvm *vm); +extern int lvbe_style_set_text_opa(bvm *vm); +extern int lvbe_style_set_text_font(bvm *vm); +extern int lvbe_style_set_text_letter_space(bvm *vm); +extern int lvbe_style_set_text_line_space(bvm *vm); +extern int lvbe_style_set_text_decor(bvm *vm); +extern int lvbe_style_set_text_align(bvm *vm); +extern int lvbe_style_set_img_opa(bvm *vm); +extern int lvbe_style_set_img_recolor(bvm *vm); +extern int lvbe_style_set_img_recolor_filtered(bvm *vm); +extern int lvbe_style_set_img_recolor_opa(bvm *vm); +extern int lvbe_style_set_outline_width(bvm *vm); +extern int lvbe_style_set_outline_color(bvm *vm); +extern int lvbe_style_set_outline_color_filtered(bvm *vm); +extern int lvbe_style_set_outline_opa(bvm *vm); +extern int lvbe_style_set_outline_pad(bvm *vm); +extern int lvbe_style_set_shadow_width(bvm *vm); +extern int lvbe_style_set_shadow_ofs_x(bvm *vm); +extern int lvbe_style_set_shadow_ofs_y(bvm *vm); +extern int lvbe_style_set_shadow_spread(bvm *vm); +extern int lvbe_style_set_shadow_color(bvm *vm); +extern int lvbe_style_set_shadow_color_filtered(bvm *vm); +extern int lvbe_style_set_shadow_opa(bvm *vm); +extern int lvbe_style_set_line_width(bvm *vm); +extern int lvbe_style_set_line_dash_width(bvm *vm); +extern int lvbe_style_set_line_dash_gap(bvm *vm); +extern int lvbe_style_set_line_rounded(bvm *vm); +extern int lvbe_style_set_line_color(bvm *vm); +extern int lvbe_style_set_line_color_filtered(bvm *vm); +extern int lvbe_style_set_line_opa(bvm *vm); +extern int lvbe_style_set_arc_width(bvm *vm); +extern int lvbe_style_set_arc_rounded(bvm *vm); +extern int lvbe_style_set_arc_color(bvm *vm); +extern int lvbe_style_set_arc_color_filtered(bvm *vm); +extern int lvbe_style_set_arc_opa(bvm *vm); +extern int lvbe_style_set_arc_img_src(bvm *vm); + +/* `lv_font` external functions definitions */ + +/* `lv_color` external functions definitions */ + +/* `lv_theme` external functions definitions */ + +/* `lv_img` external functions definitions */ +extern int lvbe_img_set_tasmota_logo(bvm *vm); +extern int lvbe_img_create(bvm *vm); +extern int lvbe_img_set_src(bvm *vm); +extern int lvbe_img_set_offset_x(bvm *vm); +extern int lvbe_img_set_offset_y(bvm *vm); +extern int lvbe_img_set_angle(bvm *vm); +extern int lvbe_img_set_pivot(bvm *vm); +extern int lvbe_img_set_zoom(bvm *vm); +extern int lvbe_img_set_antialias(bvm *vm); +extern int lvbe_img_get_src(bvm *vm); +extern int lvbe_img_get_offset_x(bvm *vm); +extern int lvbe_img_get_offset_y(bvm *vm); +extern int lvbe_img_get_angle(bvm *vm); +extern int lvbe_img_get_pivot(bvm *vm); +extern int lvbe_img_get_zoom(bvm *vm); +extern int lvbe_img_get_antialias(bvm *vm); + +/* `lv_disp` external functions definitions */ +extern int lvbe_disp_get_scr_act(bvm *vm); +extern int lvbe_disp_get_scr_prev(bvm *vm); +extern int lvbe_disp_load_scr(bvm *vm); +extern int lvbe_disp_get_layer_top(bvm *vm); +extern int lvbe_disp_get_layer_sys(bvm *vm); +extern int lvbe_disp_set_theme(bvm *vm); +extern int lvbe_disp_get_theme(bvm *vm); +extern int lvbe_disp_set_bg_color(bvm *vm); +extern int lvbe_disp_set_bg_image(bvm *vm); +extern int lvbe_disp_set_bg_opa(bvm *vm); +extern int lvbe_disp_get_inactive_time(bvm *vm); +extern int lvbe_disp_trig_activity(bvm *vm); +extern int lvbe_disp_clean_dcache(bvm *vm); +extern int lvbe_disp_dpx(bvm *vm); + +/* `lv_obj` external functions definitions */ +extern int lvbe_obj_add_event_cb(bvm *vm); +extern int lvbe_obj_remove_event_cb(bvm *vm); +extern int lvbe_obj_remove_event_dsc(bvm *vm); +extern int lvbe_obj_create(bvm *vm); +extern int lvbe_obj_add_flag(bvm *vm); +extern int lvbe_obj_clear_flag(bvm *vm); +extern int lvbe_obj_add_state(bvm *vm); +extern int lvbe_obj_clear_state(bvm *vm); +extern int lvbe_obj_set_user_data(bvm *vm); +extern int lvbe_obj_has_flag(bvm *vm); +extern int lvbe_obj_has_flag_any(bvm *vm); +extern int lvbe_obj_get_state(bvm *vm); +extern int lvbe_obj_has_state(bvm *vm); +extern int lvbe_obj_get_group(bvm *vm); +extern int lvbe_obj_get_user_data(bvm *vm); +extern int lvbe_obj_allocate_spec_attr(bvm *vm); +extern int lvbe_obj_check_type(bvm *vm); +extern int lvbe_obj_has_class(bvm *vm); +extern int lvbe_obj_get_class(bvm *vm); +extern int lvbe_obj_is_valid(bvm *vm); +extern int lvbe_obj_dpx(bvm *vm); +extern int lvbe_obj_class_init_obj(bvm *vm); +extern int lvbe_obj_is_editable(bvm *vm); +extern int lvbe_obj_is_group_def(bvm *vm); +extern int lvbe_obj_init_draw_rect_dsc(bvm *vm); +extern int lvbe_obj_init_draw_label_dsc(bvm *vm); +extern int lvbe_obj_init_draw_img_dsc(bvm *vm); +extern int lvbe_obj_init_draw_line_dsc(bvm *vm); +extern int lvbe_obj_init_draw_arc_dsc(bvm *vm); +extern int lvbe_obj_calculate_ext_draw_size(bvm *vm); +extern int lvbe_obj_refresh_ext_draw_size(bvm *vm); +extern int lvbe_obj_set_pos(bvm *vm); +extern int lvbe_obj_set_x(bvm *vm); +extern int lvbe_obj_set_y(bvm *vm); +extern int lvbe_obj_set_size(bvm *vm); +extern int lvbe_obj_refr_size(bvm *vm); +extern int lvbe_obj_set_width(bvm *vm); +extern int lvbe_obj_set_height(bvm *vm); +extern int lvbe_obj_set_content_width(bvm *vm); +extern int lvbe_obj_set_content_height(bvm *vm); +extern int lvbe_obj_set_layout(bvm *vm); +extern int lvbe_obj_is_layout_positioned(bvm *vm); +extern int lvbe_obj_mark_layout_as_dirty(bvm *vm); +extern int lvbe_obj_update_layout(bvm *vm); +extern int lvbe_obj_set_align(bvm *vm); +extern int lvbe_obj_align(bvm *vm); +extern int lvbe_obj_align_to(bvm *vm); +extern int lvbe_obj_center(bvm *vm); +extern int lvbe_obj_get_coords(bvm *vm); +extern int lvbe_obj_get_x(bvm *vm); +extern int lvbe_obj_get_x2(bvm *vm); +extern int lvbe_obj_get_y(bvm *vm); +extern int lvbe_obj_get_y2(bvm *vm); +extern int lvbe_obj_get_width(bvm *vm); +extern int lvbe_obj_get_height(bvm *vm); +extern int lvbe_obj_get_content_width(bvm *vm); +extern int lvbe_obj_get_content_height(bvm *vm); +extern int lvbe_obj_get_content_coords(bvm *vm); +extern int lvbe_obj_get_self_width(bvm *vm); +extern int lvbe_obj_get_self_height(bvm *vm); +extern int lvbe_obj_refresh_self_size(bvm *vm); +extern int lvbe_obj_refr_pos(bvm *vm); +extern int lvbe_obj_move_to(bvm *vm); +extern int lvbe_obj_move_children_by(bvm *vm); +extern int lvbe_obj_invalidate_area(bvm *vm); +extern int lvbe_obj_invalidate(bvm *vm); +extern int lvbe_obj_area_is_visible(bvm *vm); +extern int lvbe_obj_is_visible(bvm *vm); +extern int lvbe_obj_set_ext_click_area(bvm *vm); +extern int lvbe_obj_get_click_area(bvm *vm); +extern int lvbe_obj_hit_test(bvm *vm); +extern int lvbe_obj_set_scrollbar_mode(bvm *vm); +extern int lvbe_obj_set_scroll_dir(bvm *vm); +extern int lvbe_obj_set_scroll_snap_x(bvm *vm); +extern int lvbe_obj_set_scroll_snap_y(bvm *vm); +extern int lvbe_obj_get_scrollbar_mode(bvm *vm); +extern int lvbe_obj_get_scroll_dir(bvm *vm); +extern int lvbe_obj_get_scroll_snap_x(bvm *vm); +extern int lvbe_obj_get_scroll_snap_y(bvm *vm); +extern int lvbe_obj_get_scroll_x(bvm *vm); +extern int lvbe_obj_get_scroll_y(bvm *vm); +extern int lvbe_obj_get_scroll_top(bvm *vm); +extern int lvbe_obj_get_scroll_bottom(bvm *vm); +extern int lvbe_obj_get_scroll_left(bvm *vm); +extern int lvbe_obj_get_scroll_right(bvm *vm); +extern int lvbe_obj_get_scroll_end(bvm *vm); +extern int lvbe_obj_scroll_by(bvm *vm); +extern int lvbe_obj_scroll_to(bvm *vm); +extern int lvbe_obj_scroll_to_x(bvm *vm); +extern int lvbe_obj_scroll_to_y(bvm *vm); +extern int lvbe_obj_scroll_to_view(bvm *vm); +extern int lvbe_obj_scroll_to_view_recursive(bvm *vm); +extern int lvbe_obj_is_scrolling(bvm *vm); +extern int lvbe_obj_update_snap(bvm *vm); +extern int lvbe_obj_get_scrollbar_area(bvm *vm); +extern int lvbe_obj_scrollbar_invalidate(bvm *vm); +extern int lvbe_obj_readjust_scroll(bvm *vm); +extern int lvbe_obj_add_style(bvm *vm); +extern int lvbe_obj_remove_style(bvm *vm); +extern int lvbe_obj_remove_style_all(bvm *vm); +extern int lvbe_obj_refresh_style(bvm *vm); +extern int lvbe_obj_get_style_prop(bvm *vm); +extern int lvbe_obj_set_local_style_prop(bvm *vm); +extern int lvbe_obj_get_local_style_prop(bvm *vm); +extern int lvbe_obj_remove_local_style_prop(bvm *vm); +extern int lvbe_obj_fade_in(bvm *vm); +extern int lvbe_obj_fade_out(bvm *vm); +extern int lvbe_obj_set_style_pad_all(bvm *vm); +extern int lvbe_obj_set_style_pad_hor(bvm *vm); +extern int lvbe_obj_set_style_pad_ver(bvm *vm); +extern int lvbe_obj_set_style_pad_gap(bvm *vm); +extern int lvbe_obj_set_style_size(bvm *vm); +extern int lvbe_obj_get_style_width(bvm *vm); +extern int lvbe_obj_get_style_min_width(bvm *vm); +extern int lvbe_obj_get_style_max_width(bvm *vm); +extern int lvbe_obj_get_style_height(bvm *vm); +extern int lvbe_obj_get_style_min_height(bvm *vm); +extern int lvbe_obj_get_style_max_height(bvm *vm); +extern int lvbe_obj_get_style_x(bvm *vm); +extern int lvbe_obj_get_style_y(bvm *vm); +extern int lvbe_obj_get_style_align(bvm *vm); +extern int lvbe_obj_get_style_transform_width(bvm *vm); +extern int lvbe_obj_get_style_transform_height(bvm *vm); +extern int lvbe_obj_get_style_translate_x(bvm *vm); +extern int lvbe_obj_get_style_translate_y(bvm *vm); +extern int lvbe_obj_get_style_transform_zoom(bvm *vm); +extern int lvbe_obj_get_style_transform_angle(bvm *vm); +extern int lvbe_obj_get_style_pad_top(bvm *vm); +extern int lvbe_obj_get_style_pad_bottom(bvm *vm); +extern int lvbe_obj_get_style_pad_left(bvm *vm); +extern int lvbe_obj_get_style_pad_right(bvm *vm); +extern int lvbe_obj_get_style_pad_row(bvm *vm); +extern int lvbe_obj_get_style_pad_column(bvm *vm); +extern int lvbe_obj_get_style_radius(bvm *vm); +extern int lvbe_obj_get_style_clip_corner(bvm *vm); +extern int lvbe_obj_get_style_opa(bvm *vm); +extern int lvbe_obj_get_style_color_filter_opa(bvm *vm); +extern int lvbe_obj_get_style_anim_time(bvm *vm); +extern int lvbe_obj_get_style_anim_speed(bvm *vm); +extern int lvbe_obj_get_style_blend_mode(bvm *vm); +extern int lvbe_obj_get_style_layout(bvm *vm); +extern int lvbe_obj_get_style_base_dir(bvm *vm); +extern int lvbe_obj_get_style_bg_color(bvm *vm); +extern int lvbe_obj_get_style_bg_color_filtered(bvm *vm); +extern int lvbe_obj_get_style_bg_opa(bvm *vm); +extern int lvbe_obj_get_style_bg_grad_color(bvm *vm); +extern int lvbe_obj_get_style_bg_grad_color_filtered(bvm *vm); +extern int lvbe_obj_get_style_bg_grad_dir(bvm *vm); +extern int lvbe_obj_get_style_bg_main_stop(bvm *vm); +extern int lvbe_obj_get_style_bg_grad_stop(bvm *vm); +extern int lvbe_obj_get_style_bg_img_src(bvm *vm); +extern int lvbe_obj_get_style_bg_img_opa(bvm *vm); +extern int lvbe_obj_get_style_bg_img_recolor(bvm *vm); +extern int lvbe_obj_get_style_bg_img_recolor_filtered(bvm *vm); +extern int lvbe_obj_get_style_bg_img_recolor_opa(bvm *vm); +extern int lvbe_obj_get_style_bg_img_tiled(bvm *vm); +extern int lvbe_obj_get_style_border_color(bvm *vm); +extern int lvbe_obj_get_style_border_color_filtered(bvm *vm); +extern int lvbe_obj_get_style_border_opa(bvm *vm); +extern int lvbe_obj_get_style_border_width(bvm *vm); +extern int lvbe_obj_get_style_border_side(bvm *vm); +extern int lvbe_obj_get_style_border_post(bvm *vm); +extern int lvbe_obj_get_style_text_color(bvm *vm); +extern int lvbe_obj_get_style_text_color_filtered(bvm *vm); +extern int lvbe_obj_get_style_text_opa(bvm *vm); +extern int lvbe_obj_get_style_text_font(bvm *vm); +extern int lvbe_obj_get_style_text_letter_space(bvm *vm); +extern int lvbe_obj_get_style_text_line_space(bvm *vm); +extern int lvbe_obj_get_style_text_decor(bvm *vm); +extern int lvbe_obj_get_style_text_align(bvm *vm); +extern int lvbe_obj_get_style_img_opa(bvm *vm); +extern int lvbe_obj_get_style_img_recolor(bvm *vm); +extern int lvbe_obj_get_style_img_recolor_filtered(bvm *vm); +extern int lvbe_obj_get_style_img_recolor_opa(bvm *vm); +extern int lvbe_obj_get_style_outline_width(bvm *vm); +extern int lvbe_obj_get_style_outline_color(bvm *vm); +extern int lvbe_obj_get_style_outline_color_filtered(bvm *vm); +extern int lvbe_obj_get_style_outline_opa(bvm *vm); +extern int lvbe_obj_get_style_outline_pad(bvm *vm); +extern int lvbe_obj_get_style_shadow_width(bvm *vm); +extern int lvbe_obj_get_style_shadow_ofs_x(bvm *vm); +extern int lvbe_obj_get_style_shadow_ofs_y(bvm *vm); +extern int lvbe_obj_get_style_shadow_spread(bvm *vm); +extern int lvbe_obj_get_style_shadow_color(bvm *vm); +extern int lvbe_obj_get_style_shadow_color_filtered(bvm *vm); +extern int lvbe_obj_get_style_shadow_opa(bvm *vm); +extern int lvbe_obj_get_style_line_width(bvm *vm); +extern int lvbe_obj_get_style_line_dash_width(bvm *vm); +extern int lvbe_obj_get_style_line_dash_gap(bvm *vm); +extern int lvbe_obj_get_style_line_rounded(bvm *vm); +extern int lvbe_obj_get_style_line_color(bvm *vm); +extern int lvbe_obj_get_style_line_color_filtered(bvm *vm); +extern int lvbe_obj_get_style_line_opa(bvm *vm); +extern int lvbe_obj_get_style_arc_width(bvm *vm); +extern int lvbe_obj_get_style_arc_rounded(bvm *vm); +extern int lvbe_obj_get_style_arc_color(bvm *vm); +extern int lvbe_obj_get_style_arc_color_filtered(bvm *vm); +extern int lvbe_obj_get_style_arc_opa(bvm *vm); +extern int lvbe_obj_get_style_arc_img_src(bvm *vm); +extern int lvbe_obj_set_style_width(bvm *vm); +extern int lvbe_obj_set_style_min_width(bvm *vm); +extern int lvbe_obj_set_style_max_width(bvm *vm); +extern int lvbe_obj_set_style_height(bvm *vm); +extern int lvbe_obj_set_style_min_height(bvm *vm); +extern int lvbe_obj_set_style_max_height(bvm *vm); +extern int lvbe_obj_set_style_x(bvm *vm); +extern int lvbe_obj_set_style_y(bvm *vm); +extern int lvbe_obj_set_style_align(bvm *vm); +extern int lvbe_obj_set_style_transform_width(bvm *vm); +extern int lvbe_obj_set_style_transform_height(bvm *vm); +extern int lvbe_obj_set_style_translate_x(bvm *vm); +extern int lvbe_obj_set_style_translate_y(bvm *vm); +extern int lvbe_obj_set_style_transform_zoom(bvm *vm); +extern int lvbe_obj_set_style_transform_angle(bvm *vm); +extern int lvbe_obj_set_style_pad_top(bvm *vm); +extern int lvbe_obj_set_style_pad_bottom(bvm *vm); +extern int lvbe_obj_set_style_pad_left(bvm *vm); +extern int lvbe_obj_set_style_pad_right(bvm *vm); +extern int lvbe_obj_set_style_pad_row(bvm *vm); +extern int lvbe_obj_set_style_pad_column(bvm *vm); +extern int lvbe_obj_set_style_radius(bvm *vm); +extern int lvbe_obj_set_style_clip_corner(bvm *vm); +extern int lvbe_obj_set_style_opa(bvm *vm); +extern int lvbe_obj_set_style_color_filter_dsc(bvm *vm); +extern int lvbe_obj_set_style_color_filter_opa(bvm *vm); +extern int lvbe_obj_set_style_anim_time(bvm *vm); +extern int lvbe_obj_set_style_anim_speed(bvm *vm); +extern int lvbe_obj_set_style_transition(bvm *vm); +extern int lvbe_obj_set_style_blend_mode(bvm *vm); +extern int lvbe_obj_set_style_layout(bvm *vm); +extern int lvbe_obj_set_style_base_dir(bvm *vm); +extern int lvbe_obj_set_style_bg_color(bvm *vm); +extern int lvbe_obj_set_style_bg_color_filtered(bvm *vm); +extern int lvbe_obj_set_style_bg_opa(bvm *vm); +extern int lvbe_obj_set_style_bg_grad_color(bvm *vm); +extern int lvbe_obj_set_style_bg_grad_color_filtered(bvm *vm); +extern int lvbe_obj_set_style_bg_grad_dir(bvm *vm); +extern int lvbe_obj_set_style_bg_main_stop(bvm *vm); +extern int lvbe_obj_set_style_bg_grad_stop(bvm *vm); +extern int lvbe_obj_set_style_bg_img_src(bvm *vm); +extern int lvbe_obj_set_style_bg_img_opa(bvm *vm); +extern int lvbe_obj_set_style_bg_img_recolor(bvm *vm); +extern int lvbe_obj_set_style_bg_img_recolor_filtered(bvm *vm); +extern int lvbe_obj_set_style_bg_img_recolor_opa(bvm *vm); +extern int lvbe_obj_set_style_bg_img_tiled(bvm *vm); +extern int lvbe_obj_set_style_border_color(bvm *vm); +extern int lvbe_obj_set_style_border_color_filtered(bvm *vm); +extern int lvbe_obj_set_style_border_opa(bvm *vm); +extern int lvbe_obj_set_style_border_width(bvm *vm); +extern int lvbe_obj_set_style_border_side(bvm *vm); +extern int lvbe_obj_set_style_border_post(bvm *vm); +extern int lvbe_obj_set_style_text_color(bvm *vm); +extern int lvbe_obj_set_style_text_color_filtered(bvm *vm); +extern int lvbe_obj_set_style_text_opa(bvm *vm); +extern int lvbe_obj_set_style_text_font(bvm *vm); +extern int lvbe_obj_set_style_text_letter_space(bvm *vm); +extern int lvbe_obj_set_style_text_line_space(bvm *vm); +extern int lvbe_obj_set_style_text_decor(bvm *vm); +extern int lvbe_obj_set_style_text_align(bvm *vm); +extern int lvbe_obj_set_style_img_opa(bvm *vm); +extern int lvbe_obj_set_style_img_recolor(bvm *vm); +extern int lvbe_obj_set_style_img_recolor_filtered(bvm *vm); +extern int lvbe_obj_set_style_img_recolor_opa(bvm *vm); +extern int lvbe_obj_set_style_outline_width(bvm *vm); +extern int lvbe_obj_set_style_outline_color(bvm *vm); +extern int lvbe_obj_set_style_outline_color_filtered(bvm *vm); +extern int lvbe_obj_set_style_outline_opa(bvm *vm); +extern int lvbe_obj_set_style_outline_pad(bvm *vm); +extern int lvbe_obj_set_style_shadow_width(bvm *vm); +extern int lvbe_obj_set_style_shadow_ofs_x(bvm *vm); +extern int lvbe_obj_set_style_shadow_ofs_y(bvm *vm); +extern int lvbe_obj_set_style_shadow_spread(bvm *vm); +extern int lvbe_obj_set_style_shadow_color(bvm *vm); +extern int lvbe_obj_set_style_shadow_color_filtered(bvm *vm); +extern int lvbe_obj_set_style_shadow_opa(bvm *vm); +extern int lvbe_obj_set_style_line_width(bvm *vm); +extern int lvbe_obj_set_style_line_dash_width(bvm *vm); +extern int lvbe_obj_set_style_line_dash_gap(bvm *vm); +extern int lvbe_obj_set_style_line_rounded(bvm *vm); +extern int lvbe_obj_set_style_line_color(bvm *vm); +extern int lvbe_obj_set_style_line_color_filtered(bvm *vm); +extern int lvbe_obj_set_style_line_opa(bvm *vm); +extern int lvbe_obj_set_style_arc_width(bvm *vm); +extern int lvbe_obj_set_style_arc_rounded(bvm *vm); +extern int lvbe_obj_set_style_arc_color(bvm *vm); +extern int lvbe_obj_set_style_arc_color_filtered(bvm *vm); +extern int lvbe_obj_set_style_arc_opa(bvm *vm); +extern int lvbe_obj_set_style_arc_img_src(bvm *vm); +extern int lvbe_obj_del(bvm *vm); +extern int lvbe_obj_clean(bvm *vm); +extern int lvbe_obj_del_async(bvm *vm); +extern int lvbe_obj_set_parent(bvm *vm); +extern int lvbe_obj_move_foreground(bvm *vm); +extern int lvbe_obj_move_background(bvm *vm); +extern int lvbe_obj_get_screen(bvm *vm); +extern int lvbe_obj_get_disp(bvm *vm); +extern int lvbe_obj_get_parent(bvm *vm); +extern int lvbe_obj_get_child(bvm *vm); +extern int lvbe_obj_get_child_cnt(bvm *vm); +extern int lvbe_obj_get_child_id(bvm *vm); +extern int lvbe_obj_tree_walk(bvm *vm); + +/* `lv_group` external functions definitions */ +extern int lvbe_group_create(bvm *vm); +extern int lvbe_group_del(bvm *vm); +extern int lvbe_group_set_default(bvm *vm); +extern int lvbe_group_add_obj(bvm *vm); +extern int lvbe_group_remove_obj(bvm *vm); +extern int lvbe_group_remove_all_objs(bvm *vm); +extern int lvbe_group_focus_obj(bvm *vm); +extern int lvbe_group_focus_next(bvm *vm); +extern int lvbe_group_focus_prev(bvm *vm); +extern int lvbe_group_focus_freeze(bvm *vm); +extern int lvbe_group_send_data(bvm *vm); +extern int lvbe_group_set_focus_cb(bvm *vm); +extern int lvbe_group_set_refocus_policy(bvm *vm); +extern int lvbe_group_set_editing(bvm *vm); +extern int lvbe_group_set_wrap(bvm *vm); +extern int lvbe_group_get_focused(bvm *vm); +extern int lvbe_group_get_focus_cb(bvm *vm); +extern int lvbe_group_get_editing(bvm *vm); +extern int lvbe_group_get_wrap(bvm *vm); +extern int lvbe_group_get_obj_count(bvm *vm); + +/* `lv_indev` external functions definitions */ +extern int lvbe_indev_enable(bvm *vm); +extern int lvbe_indev_get_type(bvm *vm); +extern int lvbe_indev_reset(bvm *vm); +extern int lvbe_indev_reset_long_press(bvm *vm); +extern int lvbe_indev_set_cursor(bvm *vm); +extern int lvbe_indev_set_group(bvm *vm); +extern int lvbe_indev_set_button_points(bvm *vm); +extern int lvbe_indev_get_point(bvm *vm); +extern int lvbe_indev_get_gesture_dir(bvm *vm); +extern int lvbe_indev_get_key(bvm *vm); +extern int lvbe_indev_get_scroll_dir(bvm *vm); +extern int lvbe_indev_get_scroll_obj(bvm *vm); +extern int lvbe_indev_get_vect(bvm *vm); +extern int lvbe_indev_wait_release(bvm *vm); +extern int lvbe_indev_search_obj(bvm *vm); + +/* `lv_chart` external functions definitions */ +extern int lvbe_chart_create(bvm *vm); +extern int lvbe_chart_set_type(bvm *vm); +extern int lvbe_chart_set_point_count(bvm *vm); +extern int lvbe_chart_set_range(bvm *vm); +extern int lvbe_chart_set_update_mode(bvm *vm); +extern int lvbe_chart_set_div_line_count(bvm *vm); +extern int lvbe_chart_set_zoom_x(bvm *vm); +extern int lvbe_chart_set_zoom_y(bvm *vm); +extern int lvbe_chart_get_zoom_x(bvm *vm); +extern int lvbe_chart_get_zoom_y(bvm *vm); +extern int lvbe_chart_set_axis_tick(bvm *vm); +extern int lvbe_chart_get_type(bvm *vm); +extern int lvbe_chart_get_point_count(bvm *vm); +extern int lvbe_chart_get_x_start_point(bvm *vm); +extern int lvbe_chart_get_point_pos_by_id(bvm *vm); +extern int lvbe_chart_refresh(bvm *vm); +extern int lvbe_chart_remove_series(bvm *vm); +extern int lvbe_chart_hide_series(bvm *vm); +extern int lvbe_chart_set_series_color(bvm *vm); +extern int lvbe_chart_set_x_start_point(bvm *vm); +extern int lvbe_chart_set_cursor_pos(bvm *vm); +extern int lvbe_chart_set_cursor_point(bvm *vm); +extern int lvbe_chart_get_cursor_point(bvm *vm); +extern int lvbe_chart_set_all_value(bvm *vm); +extern int lvbe_chart_set_next_value(bvm *vm); +extern int lvbe_chart_set_next_value2(bvm *vm); +extern int lvbe_chart_set_value_by_id(bvm *vm); +extern int lvbe_chart_set_value_by_id2(bvm *vm); +extern int lvbe_chart_set_ext_y_array(bvm *vm); +extern int lvbe_chart_set_ext_x_array(bvm *vm); +extern int lvbe_chart_get_pressed_point(bvm *vm); + +/* `lv_colorwheel` external functions definitions */ +extern int lvbe_colorwheel_create(bvm *vm); +extern int lvbe_colorwheel_set_hsv(bvm *vm); +extern int lvbe_colorwheel_set_rgb(bvm *vm); +extern int lvbe_colorwheel_set_mode(bvm *vm); +extern int lvbe_colorwheel_set_mode_fixed(bvm *vm); +extern int lvbe_colorwheel_get_hsv(bvm *vm); +extern int lvbe_colorwheel_get_rgb(bvm *vm); +extern int lvbe_colorwheel_get_color_mode(bvm *vm); +extern int lvbe_colorwheel_get_color_mode_fixed(bvm *vm); + +/* `lv_imgbtn` external functions definitions */ +extern int lvbe_imgbtn_create(bvm *vm); +extern int lvbe_imgbtn_set_src(bvm *vm); + +/* `lv_led` external functions definitions */ +extern int lvbe_led_create(bvm *vm); +extern int lvbe_led_set_color(bvm *vm); +extern int lvbe_led_set_brightness(bvm *vm); +extern int lvbe_led_on(bvm *vm); +extern int lvbe_led_off(bvm *vm); +extern int lvbe_led_toggle(bvm *vm); +extern int lvbe_led_get_brightness(bvm *vm); + +/* `lv_meter` external functions definitions */ +extern int lvbe_meter_create(bvm *vm); +extern int lvbe_meter_add_scale(bvm *vm); +extern int lvbe_meter_set_scale_ticks(bvm *vm); +extern int lvbe_meter_set_scale_major_ticks(bvm *vm); +extern int lvbe_meter_set_scale_range(bvm *vm); +extern int lvbe_meter_add_needle_line(bvm *vm); +extern int lvbe_meter_add_needle_img(bvm *vm); +extern int lvbe_meter_add_arc(bvm *vm); +extern int lvbe_meter_add_scale_lines(bvm *vm); +extern int lvbe_meter_set_indicator_value(bvm *vm); +extern int lvbe_meter_set_indicator_start_value(bvm *vm); +extern int lvbe_meter_set_indicator_end_value(bvm *vm); + +/* `lv_msgbox` external functions definitions */ +extern int lvbe_msgbox_create(bvm *vm); +extern int lvbe_msgbox_get_title(bvm *vm); +extern int lvbe_msgbox_get_close_btn(bvm *vm); +extern int lvbe_msgbox_get_text(bvm *vm); +extern int lvbe_msgbox_get_btns(bvm *vm); +extern int lvbe_msgbox_get_active_btn_text(bvm *vm); +extern int lvbe_msgbox_close(bvm *vm); + +/* `lv_spinbox` external functions definitions */ +extern int lvbe_spinbox_create(bvm *vm); +extern int lvbe_spinbox_set_value(bvm *vm); +extern int lvbe_spinbox_set_rollover(bvm *vm); +extern int lvbe_spinbox_set_digit_format(bvm *vm); +extern int lvbe_spinbox_set_step(bvm *vm); +extern int lvbe_spinbox_set_range(bvm *vm); +extern int lvbe_spinbox_get_rollover(bvm *vm); +extern int lvbe_spinbox_get_value(bvm *vm); +extern int lvbe_spinbox_get_step(bvm *vm); +extern int lvbe_spinbox_step_next(bvm *vm); +extern int lvbe_spinbox_step_prev(bvm *vm); +extern int lvbe_spinbox_increment(bvm *vm); +extern int lvbe_spinbox_decrement(bvm *vm); + +/* `lv_spinner` external functions definitions */ +extern int lvbe_spinner_create(bvm *vm); + +/* `lv_arc` external functions definitions */ +extern int lvbe_arc_create(bvm *vm); +extern int lvbe_arc_set_start_angle(bvm *vm); +extern int lvbe_arc_set_end_angle(bvm *vm); +extern int lvbe_arc_set_angles(bvm *vm); +extern int lvbe_arc_set_bg_start_angle(bvm *vm); +extern int lvbe_arc_set_bg_end_angle(bvm *vm); +extern int lvbe_arc_set_bg_angles(bvm *vm); +extern int lvbe_arc_set_rotation(bvm *vm); +extern int lvbe_arc_set_mode(bvm *vm); +extern int lvbe_arc_set_value(bvm *vm); +extern int lvbe_arc_set_range(bvm *vm); +extern int lvbe_arc_set_change_rate(bvm *vm); +extern int lvbe_arc_get_angle_start(bvm *vm); +extern int lvbe_arc_get_angle_end(bvm *vm); +extern int lvbe_arc_get_bg_angle_start(bvm *vm); +extern int lvbe_arc_get_bg_angle_end(bvm *vm); +extern int lvbe_arc_get_value(bvm *vm); +extern int lvbe_arc_get_min_value(bvm *vm); +extern int lvbe_arc_get_max_value(bvm *vm); +extern int lvbe_arc_get_mode(bvm *vm); + +/* `lv_bar` external functions definitions */ +extern int lvbe_bar_create(bvm *vm); +extern int lvbe_bar_set_value(bvm *vm); +extern int lvbe_bar_set_start_value(bvm *vm); +extern int lvbe_bar_set_range(bvm *vm); +extern int lvbe_bar_set_mode(bvm *vm); +extern int lvbe_bar_get_value(bvm *vm); +extern int lvbe_bar_get_start_value(bvm *vm); +extern int lvbe_bar_get_min_value(bvm *vm); +extern int lvbe_bar_get_max_value(bvm *vm); +extern int lvbe_bar_get_mode(bvm *vm); + +/* `lv_btn` external functions definitions */ +extern int lvbe_btn_create(bvm *vm); + +/* `lv_btnmatrix` external functions definitions */ +extern int lvbe_btnmatrix_create(bvm *vm); +extern int lvbe_btnmatrix_set_map(bvm *vm); +extern int lvbe_btnmatrix_set_ctrl_map(bvm *vm); +extern int lvbe_btnmatrix_set_selected_btn(bvm *vm); +extern int lvbe_btnmatrix_set_btn_ctrl(bvm *vm); +extern int lvbe_btnmatrix_clear_btn_ctrl(bvm *vm); +extern int lvbe_btnmatrix_set_btn_ctrl_all(bvm *vm); +extern int lvbe_btnmatrix_clear_btn_ctrl_all(bvm *vm); +extern int lvbe_btnmatrix_set_btn_width(bvm *vm); +extern int lvbe_btnmatrix_set_one_checked(bvm *vm); +extern int lvbe_btnmatrix_get_selected_btn(bvm *vm); +extern int lvbe_btnmatrix_get_btn_text(bvm *vm); +extern int lvbe_btnmatrix_has_btn_ctrl(bvm *vm); +extern int lvbe_btnmatrix_get_one_checked(bvm *vm); + +/* `lv_canvas` external functions definitions */ +extern int lvbe_canvas_create(bvm *vm); +extern int lvbe_canvas_set_buffer(bvm *vm); +extern int lvbe_canvas_set_px(bvm *vm); +extern int lvbe_canvas_set_palette(bvm *vm); +extern int lvbe_canvas_get_px(bvm *vm); +extern int lvbe_canvas_copy_buf(bvm *vm); +extern int lvbe_canvas_transform(bvm *vm); +extern int lvbe_canvas_blur_hor(bvm *vm); +extern int lvbe_canvas_blur_ver(bvm *vm); +extern int lvbe_canvas_fill_bg(bvm *vm); +extern int lvbe_canvas_draw_rect(bvm *vm); +extern int lvbe_canvas_draw_text(bvm *vm); +extern int lvbe_canvas_draw_img(bvm *vm); +extern int lvbe_canvas_draw_line(bvm *vm); +extern int lvbe_canvas_draw_polygon(bvm *vm); +extern int lvbe_canvas_draw_arc(bvm *vm); + +/* `lv_checkbox` external functions definitions */ +extern int lvbe_checkbox_create(bvm *vm); +extern int lvbe_checkbox_set_text(bvm *vm); +extern int lvbe_checkbox_set_text_static(bvm *vm); +extern int lvbe_checkbox_get_text(bvm *vm); + +/* `lv_dropdown` external functions definitions */ +extern int lvbe_dropdown_create(bvm *vm); +extern int lvbe_dropdown_set_text(bvm *vm); +extern int lvbe_dropdown_set_options(bvm *vm); +extern int lvbe_dropdown_set_options_static(bvm *vm); +extern int lvbe_dropdown_add_option(bvm *vm); +extern int lvbe_dropdown_clear_options(bvm *vm); +extern int lvbe_dropdown_set_selected(bvm *vm); +extern int lvbe_dropdown_set_dir(bvm *vm); +extern int lvbe_dropdown_set_symbol(bvm *vm); +extern int lvbe_dropdown_set_selected_highlight(bvm *vm); +extern int lvbe_dropdown_get_list(bvm *vm); +extern int lvbe_dropdown_get_text(bvm *vm); +extern int lvbe_dropdown_get_options(bvm *vm); +extern int lvbe_dropdown_get_selected(bvm *vm); +extern int lvbe_dropdown_get_option_cnt(bvm *vm); +extern int lvbe_dropdown_get_selected_str(bvm *vm); +extern int lvbe_dropdown_get_symbol(bvm *vm); +extern int lvbe_dropdown_get_selected_highlight(bvm *vm); +extern int lvbe_dropdown_get_dir(bvm *vm); +extern int lvbe_dropdown_open(bvm *vm); +extern int lvbe_dropdown_close(bvm *vm); + +/* `lv_label` external functions definitions */ +extern int lvbe_label_create(bvm *vm); +extern int lvbe_label_set_text(bvm *vm); +extern int lvbe_label_set_text_fmt(bvm *vm); +extern int lvbe_label_set_text_static(bvm *vm); +extern int lvbe_label_set_long_mode(bvm *vm); +extern int lvbe_label_set_recolor(bvm *vm); +extern int lvbe_label_set_text_sel_start(bvm *vm); +extern int lvbe_label_set_text_sel_end(bvm *vm); +extern int lvbe_label_get_text(bvm *vm); +extern int lvbe_label_get_long_mode(bvm *vm); +extern int lvbe_label_get_recolor(bvm *vm); +extern int lvbe_label_get_letter_pos(bvm *vm); +extern int lvbe_label_get_letter_on(bvm *vm); +extern int lvbe_label_is_char_under_pos(bvm *vm); +extern int lvbe_label_get_text_selection_start(bvm *vm); +extern int lvbe_label_get_text_selection_end(bvm *vm); +extern int lvbe_label_ins_text(bvm *vm); +extern int lvbe_label_cut_text(bvm *vm); + +/* `lv_line` external functions definitions */ +extern int lvbe_line_create(bvm *vm); +extern int lvbe_line_set_points(bvm *vm); +extern int lvbe_line_set_y_invert(bvm *vm); +extern int lvbe_line_get_y_invert(bvm *vm); + +/* `lv_roller` external functions definitions */ +extern int lvbe_roller_create(bvm *vm); +extern int lvbe_roller_set_options(bvm *vm); +extern int lvbe_roller_set_selected(bvm *vm); +extern int lvbe_roller_set_visible_row_count(bvm *vm); +extern int lvbe_roller_get_selected(bvm *vm); +extern int lvbe_roller_get_selected_str(bvm *vm); +extern int lvbe_roller_get_options(bvm *vm); +extern int lvbe_roller_get_option_cnt(bvm *vm); + +/* `lv_slider` external functions definitions */ +extern int lvbe_slider_create(bvm *vm); +extern int lvbe_slider_set_value(bvm *vm); +extern int lvbe_slider_set_left_value(bvm *vm); +extern int lvbe_slider_set_range(bvm *vm); +extern int lvbe_slider_set_mode(bvm *vm); +extern int lvbe_slider_get_value(bvm *vm); +extern int lvbe_slider_get_left_value(bvm *vm); +extern int lvbe_slider_get_min_value(bvm *vm); +extern int lvbe_slider_get_max_value(bvm *vm); +extern int lvbe_slider_is_dragged(bvm *vm); +extern int lvbe_slider_get_mode(bvm *vm); + +/* `lv_switch` external functions definitions */ +extern int lvbe_switch_create(bvm *vm); + +/* `lv_table` external functions definitions */ +extern int lvbe_table_create(bvm *vm); +extern int lvbe_table_set_cell_value(bvm *vm); +extern int lvbe_table_set_cell_value_fmt(bvm *vm); +extern int lvbe_table_set_row_cnt(bvm *vm); +extern int lvbe_table_set_col_cnt(bvm *vm); +extern int lvbe_table_set_col_width(bvm *vm); +extern int lvbe_table_add_cell_ctrl(bvm *vm); +extern int lvbe_table_clear_cell_ctrl(bvm *vm); +extern int lvbe_table_get_cell_value(bvm *vm); +extern int lvbe_table_get_row_cnt(bvm *vm); +extern int lvbe_table_get_col_cnt(bvm *vm); +extern int lvbe_table_get_col_width(bvm *vm); +extern int lvbe_table_has_cell_ctrl(bvm *vm); +extern int lvbe_table_get_selected_cell(bvm *vm); + +/* `lv_textarea` external functions definitions */ +extern int lvbe_textarea_create(bvm *vm); +extern int lvbe_textarea_add_char(bvm *vm); +extern int lvbe_textarea_add_text(bvm *vm); +extern int lvbe_textarea_del_char(bvm *vm); +extern int lvbe_textarea_del_char_forward(bvm *vm); +extern int lvbe_textarea_set_text(bvm *vm); +extern int lvbe_textarea_set_placeholder_text(bvm *vm); +extern int lvbe_textarea_set_cursor_pos(bvm *vm); +extern int lvbe_textarea_set_cursor_click_pos(bvm *vm); +extern int lvbe_textarea_set_password_mode(bvm *vm); +extern int lvbe_textarea_set_one_line(bvm *vm); +extern int lvbe_textarea_set_accepted_chars(bvm *vm); +extern int lvbe_textarea_set_max_length(bvm *vm); +extern int lvbe_textarea_set_insert_replace(bvm *vm); +extern int lvbe_textarea_set_text_selection(bvm *vm); +extern int lvbe_textarea_set_password_show_time(bvm *vm); +extern int lvbe_textarea_set_align(bvm *vm); +extern int lvbe_textarea_get_text(bvm *vm); +extern int lvbe_textarea_get_placeholder_text(bvm *vm); +extern int lvbe_textarea_get_label(bvm *vm); +extern int lvbe_textarea_get_cursor_pos(bvm *vm); +extern int lvbe_textarea_get_cursor_click_pos(bvm *vm); +extern int lvbe_textarea_get_password_mode(bvm *vm); +extern int lvbe_textarea_get_one_line(bvm *vm); +extern int lvbe_textarea_get_accepted_chars(bvm *vm); +extern int lvbe_textarea_get_max_length(bvm *vm); +extern int lvbe_textarea_text_is_selected(bvm *vm); +extern int lvbe_textarea_get_text_selection(bvm *vm); +extern int lvbe_textarea_get_password_show_time(bvm *vm); +extern int lvbe_textarea_clear_selection(bvm *vm); +extern int lvbe_textarea_cursor_right(bvm *vm); +extern int lvbe_textarea_cursor_left(bvm *vm); +extern int lvbe_textarea_cursor_down(bvm *vm); +extern int lvbe_textarea_cursor_up(bvm *vm); + +extern int be_ntv_lv_style_init(bvm *vm); +extern int be_ntv_lv_font_init(bvm *vm); +extern int be_ntv_lv_color_init(bvm *vm); +extern int be_ntv_lv_theme_init(bvm *vm); +extern int be_ntv_lv_img_init(bvm *vm); +extern int be_ntv_lv_disp_init(bvm *vm); +extern int be_ntv_lv_obj_init(bvm *vm); +extern int be_ntv_lv_group_init(bvm *vm); +extern int be_ntv_lv_indev_init(bvm *vm); +extern int be_ntv_lv_chart_init(bvm *vm); +extern int be_ntv_lv_colorwheel_init(bvm *vm); +extern int be_ntv_lv_imgbtn_init(bvm *vm); +extern int be_ntv_lv_led_init(bvm *vm); +extern int be_ntv_lv_meter_init(bvm *vm); +extern int be_ntv_lv_msgbox_init(bvm *vm); +extern int be_ntv_lv_spinbox_init(bvm *vm); +extern int be_ntv_lv_spinner_init(bvm *vm); +extern int be_ntv_lv_arc_init(bvm *vm); +extern int be_ntv_lv_bar_init(bvm *vm); +extern int be_ntv_lv_btn_init(bvm *vm); +extern int be_ntv_lv_btnmatrix_init(bvm *vm); +extern int be_ntv_lv_canvas_init(bvm *vm); +extern int be_ntv_lv_checkbox_init(bvm *vm); +extern int be_ntv_lv_dropdown_init(bvm *vm); +extern int be_ntv_lv_label_init(bvm *vm); +extern int be_ntv_lv_line_init(bvm *vm); +extern int be_ntv_lv_roller_init(bvm *vm); +extern int be_ntv_lv_slider_init(bvm *vm); +extern int be_ntv_lv_switch_init(bvm *vm); +extern int be_ntv_lv_table_init(bvm *vm); +extern int be_ntv_lv_textarea_init(bvm *vm); + +extern const bclass be_class_lv_arc; +extern const bclass be_class_lv_bar; +extern const bclass be_class_lv_btn; +extern const bclass be_class_lv_btnmatrix; +extern const bclass be_class_lv_canvas; +extern const bclass be_class_lv_chart; +extern const bclass be_class_lv_checkbox; +extern const bclass be_class_lv_color; +extern const bclass be_class_lv_colorwheel; +extern const bclass be_class_lv_disp; +extern const bclass be_class_lv_dropdown; +extern const bclass be_class_lv_font; +extern const bclass be_class_lv_group; +extern const bclass be_class_lv_img; +extern const bclass be_class_lv_imgbtn; +extern const bclass be_class_lv_indev; +extern const bclass be_class_lv_label; +extern const bclass be_class_lv_led; +extern const bclass be_class_lv_line; +extern const bclass be_class_lv_meter; +extern const bclass be_class_lv_msgbox; +extern const bclass be_class_lv_obj; +extern const bclass be_class_lv_roller; +extern const bclass be_class_lv_slider; +extern const bclass be_class_lv_spinbox; +extern const bclass be_class_lv_spinner; +extern const bclass be_class_lv_style; +extern const bclass be_class_lv_switch; +extern const bclass be_class_lv_table; +extern const bclass be_class_lv_textarea; +extern const bclass be_class_lv_theme; + + +/******************************************************************** +** Solidified class: lv_style +********************************************************************/ +be_local_class(lv_style, + 1, + NULL, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("init", 380752755, 4, -1), be_const_func(lvs_init) }, + { be_nested_key("tostring", -1995258651, 8, -1), be_const_func(lvs_tostring) }, + { be_nested_key("_p", 1594591802, 2, -1), be_const_var(0) }, + { be_nested_key("member", 719708611, 6, 0), be_const_func(lvx_member) }, + })), + (be_nested_const_str("lv_style", -143355747, 8)) +); +/*******************************************************************/ + +/******************************************************************** +** Solidified class: lv_obj +********************************************************************/ +be_local_class(lv_obj, + 1, + NULL, + be_nested_map(5, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("tostring", -1995258651, 8, 3), be_const_func(lvx_tostring) }, + { be_nested_key("member", 719708611, 6, -1), be_const_func(lvx_member) }, + { be_nested_key("_p", 1594591802, 2, -1), be_const_var(0) }, + { be_nested_key("init", 380752755, 4, 4), be_const_func(be_ntv_lv_obj_init) }, + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_obj_class) }, + })), + (be_nested_const_str("lv_obj", -37134147, 6)) +); +/*******************************************************************/ + +/******************************************************************** +** Solidified class: lv_group +********************************************************************/ +be_local_class(lv_group, + 1, + NULL, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_group_init) }, + { be_nested_key("tostring", -1995258651, 8, -1), be_const_func(lvx_tostring) }, + { be_nested_key("_p", 1594591802, 2, -1), be_const_var(0) }, + { be_nested_key("member", 719708611, 6, 0), be_const_func(lvx_member) }, + })), + (be_nested_const_str("lv_group", -442928277, 8)) +); +/*******************************************************************/ + +/******************************************************************** +** Solidified class: lv_indev +********************************************************************/ +be_local_class(lv_indev, + 1, + NULL, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("init", 380752755, 4, -1), be_const_func(lv0_init) }, + { be_nested_key("tostring", -1995258651, 8, -1), be_const_func(lvx_tostring) }, + { be_nested_key("_p", 1594591802, 2, -1), be_const_var(0) }, + { be_nested_key("member", 719708611, 6, 0), be_const_func(lvx_member) }, + })), + (be_nested_const_str("lv_indev", 225602374, 8)) +); +/*******************************************************************/ + +/******************************************************************** +** Solidified class: lv_disp +********************************************************************/ +be_local_class(lv_disp, + 1, + NULL, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("init", 380752755, 4, -1), be_const_func(lv0_init) }, + { be_nested_key("tostring", -1995258651, 8, -1), be_const_func(lvx_tostring) }, + { be_nested_key("_p", 1594591802, 2, -1), be_const_var(0) }, + { be_nested_key("member", 719708611, 6, 0), be_const_func(lvx_member) }, + })), + (be_nested_const_str("lv_disp", 609712084, 8)) +); +/*******************************************************************/ + +/******************************************************************** +** Solidified class: lv_font +********************************************************************/ +be_local_class(lv_font, + 1, + NULL, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("init", 380752755, 4, -1), be_const_func(lvbe_font_create) }, + { be_nested_key("tostring", -1995258651, 8, -1), be_const_func(lvx_tostring) }, + { be_nested_key("_p", 1594591802, 2, -1), be_const_var(0) }, + })), + (be_nested_const_str("lv_font", 1550958453, 7)) +); +/*******************************************************************/ + +/******************************************************************** +** Solidified class: lv_theme +********************************************************************/ +be_local_class(lv_theme, + 1, + NULL, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("init", 380752755, 4, -1), be_const_func(lvbe_theme_create) }, + { be_nested_key("tostring", -1995258651, 8, -1), be_const_func(lvx_tostring) }, + { be_nested_key("_p", 1594591802, 2, -1), be_const_var(0) }, + })), + (be_nested_const_str("lv_theme", 1550958453, 7)) +); +/*******************************************************************/ + +/******************************************************************** +** Solidified class: lv_color +********************************************************************/ +be_local_class(lv_color, + 1, + NULL, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("toint", -681784387, 5, -1), be_const_func(lco_toint) }, + { be_nested_key("tostring", -1995258651, 8, 0), be_const_func(lco_tostring) }, + { be_nested_key("_p", 1594591802, 2, -1), be_const_var(0) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(lco_init) }, + })), + (be_nested_const_str("lv_color", 1419148319, 8)) +); +/*******************************************************************/ + +void be_load_lv_style_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_style); + be_setglobal(vm, "lv_style"); + be_pop(vm, 1); +} + +void be_load_lv_font_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_font); + be_setglobal(vm, "lv_font"); + be_pop(vm, 1); +} + +void be_load_lv_color_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_color); + be_setglobal(vm, "lv_color"); + be_pop(vm, 1); +} + +void be_load_lv_theme_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_theme); + be_setglobal(vm, "lv_theme"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_img +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_img, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_img_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_img_init) }, + })), + (be_nested_const_str("lv_img", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_img_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_img); + be_setglobal(vm, "lv_img"); + be_pop(vm, 1); +} + +void be_load_lv_disp_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_disp); + be_setglobal(vm, "lv_disp"); + be_pop(vm, 1); +} + +void be_load_lv_obj_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_obj); + be_setglobal(vm, "lv_obj"); + be_pop(vm, 1); +} + +void be_load_lv_group_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_group); + be_setglobal(vm, "lv_group"); + be_pop(vm, 1); +} + +void be_load_lv_indev_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_indev); + be_setglobal(vm, "lv_indev"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_chart +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_chart, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_chart_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_chart_init) }, + })), + (be_nested_const_str("lv_chart", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_chart_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_chart); + be_setglobal(vm, "lv_chart"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_colorwheel +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_colorwheel, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_colorwheel_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_colorwheel_init) }, + })), + (be_nested_const_str("lv_colorwheel", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_colorwheel_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_colorwheel); + be_setglobal(vm, "lv_colorwheel"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_imgbtn +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_imgbtn, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_imgbtn_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_imgbtn_init) }, + })), + (be_nested_const_str("lv_imgbtn", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_imgbtn_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_imgbtn); + be_setglobal(vm, "lv_imgbtn"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_led +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_led, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_led_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_led_init) }, + })), + (be_nested_const_str("lv_led", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_led_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_led); + be_setglobal(vm, "lv_led"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_meter +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_meter, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_meter_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_meter_init) }, + })), + (be_nested_const_str("lv_meter", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_meter_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_meter); + be_setglobal(vm, "lv_meter"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_msgbox +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_msgbox, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_msgbox_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_msgbox_init) }, + })), + (be_nested_const_str("lv_msgbox", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_msgbox_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_msgbox); + be_setglobal(vm, "lv_msgbox"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_spinbox +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_spinbox, + 0, + &be_class_lv_textarea, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_spinbox_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_spinbox_init) }, + })), + (be_nested_const_str("lv_spinbox", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_spinbox_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_spinbox); + be_setglobal(vm, "lv_spinbox"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_spinner +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_spinner, + 0, + &be_class_lv_arc, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_spinner_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_spinner_init) }, + })), + (be_nested_const_str("lv_spinner", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_spinner_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_spinner); + be_setglobal(vm, "lv_spinner"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_arc +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_arc, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_arc_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_arc_init) }, + })), + (be_nested_const_str("lv_arc", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_arc_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_arc); + be_setglobal(vm, "lv_arc"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_bar +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_bar, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_bar_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_bar_init) }, + })), + (be_nested_const_str("lv_bar", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_bar_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_bar); + be_setglobal(vm, "lv_bar"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_btn +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_btn, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_btn_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_btn_init) }, + })), + (be_nested_const_str("lv_btn", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_btn_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_btn); + be_setglobal(vm, "lv_btn"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_btnmatrix +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_btnmatrix, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_btnmatrix_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_btnmatrix_init) }, + })), + (be_nested_const_str("lv_btnmatrix", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_btnmatrix_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_btnmatrix); + be_setglobal(vm, "lv_btnmatrix"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_canvas +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_canvas, + 0, + &be_class_lv_img, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_canvas_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_canvas_init) }, + })), + (be_nested_const_str("lv_canvas", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_canvas_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_canvas); + be_setglobal(vm, "lv_canvas"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_checkbox +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_checkbox, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_checkbox_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_checkbox_init) }, + })), + (be_nested_const_str("lv_checkbox", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_checkbox_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_checkbox); + be_setglobal(vm, "lv_checkbox"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_dropdown +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_dropdown, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_dropdown_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_dropdown_init) }, + })), + (be_nested_const_str("lv_dropdown", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_dropdown_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_dropdown); + be_setglobal(vm, "lv_dropdown"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_label +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_label, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_label_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_label_init) }, + })), + (be_nested_const_str("lv_label", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_label_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_label); + be_setglobal(vm, "lv_label"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_line +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_line, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_line_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_line_init) }, + })), + (be_nested_const_str("lv_line", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_line_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_line); + be_setglobal(vm, "lv_line"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_roller +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_roller, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_roller_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_roller_init) }, + })), + (be_nested_const_str("lv_roller", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_roller_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_roller); + be_setglobal(vm, "lv_roller"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_slider +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_slider, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_slider_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_slider_init) }, + })), + (be_nested_const_str("lv_slider", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_slider_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_slider); + be_setglobal(vm, "lv_slider"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_switch +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_switch, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_switch_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_switch_init) }, + })), + (be_nested_const_str("lv_switch", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_switch_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_switch); + be_setglobal(vm, "lv_switch"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_table +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_table, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_table_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_table_init) }, + })), + (be_nested_const_str("lv_table", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_table_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_table); + be_setglobal(vm, "lv_table"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified class: lv_textarea +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_textarea, + 0, + &be_class_lv_obj, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_class", -1562820946, 6, -1), be_const_comptr(&lv_textarea_class) }, + { be_nested_key("init", 380752755, 4, -1), be_const_func(be_ntv_lv_textarea_init) }, + })), + (be_nested_const_str("lv_textarea", 1612829968, 6)) +); +/*******************************************************************/ + +void be_load_lv_textarea_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_textarea); + be_setglobal(vm, "lv_textarea"); + be_pop(vm, 1); +} + + +#endif // USE_LVGL + diff --git a/lib/libesp32/berry/default/be_lvgl_wifi_arcs_icon_lib.c b/lib/libesp32/berry/default/be_lvgl_wifi_arcs_icon_lib.c new file mode 100644 index 000000000..d8fe9ce08 --- /dev/null +++ b/lib/libesp32/berry/default/be_lvgl_wifi_arcs_icon_lib.c @@ -0,0 +1,140 @@ +/******************************************************************** + * Tasmota LVGL lv_signal_bars widget + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_LVGL + +#include "lvgl.h" + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_wifi_arcs_icon_init, /* name */ + be_nested_proto( + 10, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[18]) { /* constants */ + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(set_style_line_color), + /* K2 */ be_nested_str(lv), + /* K3 */ be_nested_str(color), + /* K4 */ be_nested_str(COLOR_WHITE), + /* K5 */ be_nested_str(PART_MAIN), + /* K6 */ be_nested_str(STATE_DEFAULT), + /* K7 */ be_nested_str(set_style_bg_color), + /* K8 */ be_nested_str(COLOR_BLACK), + /* K9 */ be_nested_str(get_height), + /* K10 */ be_nested_str(get_style_pad_right), + /* K11 */ be_nested_str(set_height), + /* K12 */ be_const_int(3), + /* K13 */ be_nested_str(set_width), + /* K14 */ be_nested_str(set_x), + /* K15 */ be_nested_str(get_width), + /* K16 */ be_nested_str(set_style_pad_right), + /* K17 */ be_const_int(1), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[67]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x8C080101, // 0006 GETMET R2 R0 K1 + 0xB8120400, // 0007 GETNGBL R4 K2 + 0x8C100903, // 0008 GETMET R4 R4 K3 + 0xB81A0400, // 0009 GETNGBL R6 K2 + 0x88180D04, // 000A GETMBR R6 R6 K4 + 0x7C100400, // 000B CALL R4 2 + 0xB8160400, // 000C GETNGBL R5 K2 + 0x88140B05, // 000D GETMBR R5 R5 K5 + 0xB81A0400, // 000E GETNGBL R6 K2 + 0x88180D06, // 000F GETMBR R6 R6 K6 + 0x30140A06, // 0010 OR R5 R5 R6 + 0x7C080600, // 0011 CALL R2 3 + 0x8C080107, // 0012 GETMET R2 R0 K7 + 0xB8120400, // 0013 GETNGBL R4 K2 + 0x8C100903, // 0014 GETMET R4 R4 K3 + 0xB81A0400, // 0015 GETNGBL R6 K2 + 0x88180D08, // 0016 GETMBR R6 R6 K8 + 0x7C100400, // 0017 CALL R4 2 + 0xB8160400, // 0018 GETNGBL R5 K2 + 0x88140B05, // 0019 GETMBR R5 R5 K5 + 0xB81A0400, // 001A GETNGBL R6 K2 + 0x88180D06, // 001B GETMBR R6 R6 K6 + 0x30140A06, // 001C OR R5 R5 R6 + 0x7C080600, // 001D CALL R2 3 + 0x4C080000, // 001E LDNIL R2 + 0x20080202, // 001F NE R2 R1 R2 + 0x780A0020, // 0020 JMPF R2 #0042 + 0x8C080309, // 0021 GETMET R2 R1 K9 + 0x7C080200, // 0022 CALL R2 1 + 0x8C0C030A, // 0023 GETMET R3 R1 K10 + 0xB8160400, // 0024 GETNGBL R5 K2 + 0x88140B05, // 0025 GETMBR R5 R5 K5 + 0xB81A0400, // 0026 GETNGBL R6 K2 + 0x88180D06, // 0027 GETMBR R6 R6 K6 + 0x30140A06, // 0028 OR R5 R5 R6 + 0x7C0C0400, // 0029 CALL R3 2 + 0x8C10010B, // 002A GETMET R4 R0 K11 + 0x5C180400, // 002B MOVE R6 R2 + 0x7C100400, // 002C CALL R4 2 + 0x54120003, // 002D LDINT R4 4 + 0x08100404, // 002E MUL R4 R2 R4 + 0x0C10090C, // 002F DIV R4 R4 K12 + 0x8C14010D, // 0030 GETMET R5 R0 K13 + 0x5C1C0800, // 0031 MOVE R7 R4 + 0x7C140400, // 0032 CALL R5 2 + 0x8C14010E, // 0033 GETMET R5 R0 K14 + 0x8C1C030F, // 0034 GETMET R7 R1 K15 + 0x7C1C0200, // 0035 CALL R7 1 + 0x041C0E04, // 0036 SUB R7 R7 R4 + 0x041C0E03, // 0037 SUB R7 R7 R3 + 0x7C140400, // 0038 CALL R5 2 + 0x8C140310, // 0039 GETMET R5 R1 K16 + 0x001C0604, // 003A ADD R7 R3 R4 + 0x001C0F11, // 003B ADD R7 R7 K17 + 0xB8220400, // 003C GETNGBL R8 K2 + 0x88201105, // 003D GETMBR R8 R8 K5 + 0xB8260400, // 003E GETNGBL R9 K2 + 0x88241306, // 003F GETMBR R9 R9 K6 + 0x30201009, // 0040 OR R8 R8 R9 + 0x7C140600, // 0041 CALL R5 3 + 0x80000000, // 0042 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_wifi_arcs_icon +********************************************************************/ +extern const bclass be_class_lv_wifi_arcs; +be_local_class(lv_wifi_arcs_icon, + 0, + &be_class_lv_wifi_arcs, + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(lv_wifi_arcs_icon_init_closure) }, + })), + be_str_literal("lv_wifi_arcs_icon") +); +/*******************************************************************/ + +void be_load_lv_wifi_arcs_icon_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_wifi_arcs_icon); + be_setglobal(vm, "lv_wifi_arcs_icon"); + be_pop(vm, 1); +} + +#endif // USE_LVGL \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_lvgl_wifi_arcs_lib.c b/lib/libesp32/berry/default/be_lvgl_wifi_arcs_lib.c new file mode 100644 index 000000000..57cbf18a9 --- /dev/null +++ b/lib/libesp32/berry/default/be_lvgl_wifi_arcs_lib.c @@ -0,0 +1,167 @@ +/******************************************************************** + * Tasmota LVGL lv_signal_bars widget + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_LVGL + +#include "lvgl.h" + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(lv_wifi_arcs_every_second, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(wifi), + /* K2 */ be_nested_str(find), + /* K3 */ be_nested_str(quality), + /* K4 */ be_nested_str(ip), + /* K5 */ be_nested_str(set_percentage), + /* K6 */ be_const_int(0), + }), + &be_const_str_every_second, + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x8C080302, // 0003 GETMET R2 R1 K2 + 0x58100003, // 0004 LDCONST R4 K3 + 0x7C080400, // 0005 CALL R2 2 + 0x8C0C0302, // 0006 GETMET R3 R1 K2 + 0x58140004, // 0007 LDCONST R5 K4 + 0x7C0C0400, // 0008 CALL R3 2 + 0x4C100000, // 0009 LDNIL R4 + 0x1C100604, // 000A EQ R4 R3 R4 + 0x78120003, // 000B JMPF R4 #0010 + 0x8C100105, // 000C GETMET R4 R0 K5 + 0x58180006, // 000D LDCONST R6 K6 + 0x7C100400, // 000E CALL R4 2 + 0x70020005, // 000F JMP #0016 + 0x4C100000, // 0010 LDNIL R4 + 0x20100404, // 0011 NE R4 R2 R4 + 0x78120002, // 0012 JMPF R4 #0016 + 0x8C100105, // 0013 GETMET R4 R0 K5 + 0x5C180400, // 0014 MOVE R6 R2 + 0x7C100400, // 0015 CALL R4 2 + 0x80000000, // 0016 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_wifi_arcs_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(add_driver), + /* K3 */ be_nested_str(set_percentage), + /* K4 */ be_const_int(0), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0xB80A0200, // 0006 GETNGBL R2 K1 + 0x8C080502, // 0007 GETMET R2 R2 K2 + 0x5C100000, // 0008 MOVE R4 R0 + 0x7C080400, // 0009 CALL R2 2 + 0x8C080103, // 000A GETMET R2 R0 K3 + 0x58100004, // 000B LDCONST R4 K4 + 0x7C080400, // 000C CALL R2 2 + 0x80000000, // 000D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: del +********************************************************************/ +be_local_closure(lv_wifi_arcs_del, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(del), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(remove_driver), + }), + &be_const_str_del, + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x60040003, // 0000 GETGBL R1 G3 + 0x5C080000, // 0001 MOVE R2 R0 + 0x7C040200, // 0002 CALL R1 1 + 0x8C040300, // 0003 GETMET R1 R1 K0 + 0x7C040200, // 0004 CALL R1 1 + 0xB8060200, // 0005 GETNGBL R1 K1 + 0x8C040302, // 0006 GETMET R1 R1 K2 + 0x5C0C0000, // 0007 MOVE R3 R0 + 0x7C040400, // 0008 CALL R1 2 + 0x80000000, // 0009 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_wifi_arcs +********************************************************************/ +extern const bclass be_class_lv_signal_arcs; +be_local_class(lv_wifi_arcs, + 0, + &be_class_lv_signal_arcs, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(every_second, 1), be_const_closure(lv_wifi_arcs_every_second_closure) }, + { be_const_key(init, -1), be_const_closure(lv_wifi_arcs_init_closure) }, + { be_const_key(del, -1), be_const_closure(lv_wifi_arcs_del_closure) }, + })), + be_str_literal("lv_wifi_arcs") +); +/*******************************************************************/ + +void be_load_lv_wifi_arcs_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_wifi_arcs); + be_setglobal(vm, "lv_wifi_arcs"); + be_pop(vm, 1); +} + +#endif // USE_LVGL \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_lvgl_wifi_bars_icon_lib.c b/lib/libesp32/berry/default/be_lvgl_wifi_bars_icon_lib.c new file mode 100644 index 000000000..a1cf693e5 --- /dev/null +++ b/lib/libesp32/berry/default/be_lvgl_wifi_bars_icon_lib.c @@ -0,0 +1,136 @@ +/******************************************************************** + * Tasmota LVGL lv_signal_bars widget + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_LVGL + +#include "lvgl.h" + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_wifi_bars_icon_init, /* name */ + be_nested_proto( + 9, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[17]) { /* constants */ + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(set_style_line_color), + /* K2 */ be_nested_str(lv), + /* K3 */ be_nested_str(color), + /* K4 */ be_nested_str(COLOR_WHITE), + /* K5 */ be_nested_str(PART_MAIN), + /* K6 */ be_nested_str(STATE_DEFAULT), + /* K7 */ be_nested_str(set_style_bg_color), + /* K8 */ be_nested_str(COLOR_BLACK), + /* K9 */ be_nested_str(get_height), + /* K10 */ be_nested_str(get_style_pad_right), + /* K11 */ be_nested_str(set_height), + /* K12 */ be_nested_str(set_width), + /* K13 */ be_nested_str(set_x), + /* K14 */ be_nested_str(get_width), + /* K15 */ be_nested_str(set_style_pad_right), + /* K16 */ be_const_int(1), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[64]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x8C080101, // 0006 GETMET R2 R0 K1 + 0xB8120400, // 0007 GETNGBL R4 K2 + 0x8C100903, // 0008 GETMET R4 R4 K3 + 0xB81A0400, // 0009 GETNGBL R6 K2 + 0x88180D04, // 000A GETMBR R6 R6 K4 + 0x7C100400, // 000B CALL R4 2 + 0xB8160400, // 000C GETNGBL R5 K2 + 0x88140B05, // 000D GETMBR R5 R5 K5 + 0xB81A0400, // 000E GETNGBL R6 K2 + 0x88180D06, // 000F GETMBR R6 R6 K6 + 0x30140A06, // 0010 OR R5 R5 R6 + 0x7C080600, // 0011 CALL R2 3 + 0x8C080107, // 0012 GETMET R2 R0 K7 + 0xB8120400, // 0013 GETNGBL R4 K2 + 0x8C100903, // 0014 GETMET R4 R4 K3 + 0xB81A0400, // 0015 GETNGBL R6 K2 + 0x88180D08, // 0016 GETMBR R6 R6 K8 + 0x7C100400, // 0017 CALL R4 2 + 0xB8160400, // 0018 GETNGBL R5 K2 + 0x88140B05, // 0019 GETMBR R5 R5 K5 + 0xB81A0400, // 001A GETNGBL R6 K2 + 0x88180D06, // 001B GETMBR R6 R6 K6 + 0x30140A06, // 001C OR R5 R5 R6 + 0x7C080600, // 001D CALL R2 3 + 0x4C080000, // 001E LDNIL R2 + 0x20080202, // 001F NE R2 R1 R2 + 0x780A001D, // 0020 JMPF R2 #003F + 0x8C080309, // 0021 GETMET R2 R1 K9 + 0x7C080200, // 0022 CALL R2 1 + 0x8C0C030A, // 0023 GETMET R3 R1 K10 + 0xB8160400, // 0024 GETNGBL R5 K2 + 0x88140B05, // 0025 GETMBR R5 R5 K5 + 0xB81A0400, // 0026 GETNGBL R6 K2 + 0x88180D06, // 0027 GETMBR R6 R6 K6 + 0x30140A06, // 0028 OR R5 R5 R6 + 0x7C0C0400, // 0029 CALL R3 2 + 0x8C10010B, // 002A GETMET R4 R0 K11 + 0x5C180400, // 002B MOVE R6 R2 + 0x7C100400, // 002C CALL R4 2 + 0x8C10010C, // 002D GETMET R4 R0 K12 + 0x5C180400, // 002E MOVE R6 R2 + 0x7C100400, // 002F CALL R4 2 + 0x8C10010D, // 0030 GETMET R4 R0 K13 + 0x8C18030E, // 0031 GETMET R6 R1 K14 + 0x7C180200, // 0032 CALL R6 1 + 0x04180C02, // 0033 SUB R6 R6 R2 + 0x04180C03, // 0034 SUB R6 R6 R3 + 0x7C100400, // 0035 CALL R4 2 + 0x8C10030F, // 0036 GETMET R4 R1 K15 + 0x00180602, // 0037 ADD R6 R3 R2 + 0x00180D10, // 0038 ADD R6 R6 K16 + 0xB81E0400, // 0039 GETNGBL R7 K2 + 0x881C0F05, // 003A GETMBR R7 R7 K5 + 0xB8220400, // 003B GETNGBL R8 K2 + 0x88201106, // 003C GETMBR R8 R8 K6 + 0x301C0E08, // 003D OR R7 R7 R8 + 0x7C100600, // 003E CALL R4 3 + 0x80000000, // 003F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_wifi_bars_icon +********************************************************************/ +extern const bclass be_class_lv_wifi_bars; +be_local_class(lv_wifi_bars_icon, + 0, + &be_class_lv_wifi_bars, + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(lv_wifi_bars_icon_init_closure) }, + })), + be_str_literal("lv_wifi_bars_icon") +); +/*******************************************************************/ + +void be_load_lv_wifi_bars_icon_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_wifi_bars_icon); + be_setglobal(vm, "lv_wifi_bars_icon"); + be_pop(vm, 1); +} + +#endif // USE_LVGL \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_lvgl_wifi_bars_lib.c b/lib/libesp32/berry/default/be_lvgl_wifi_bars_lib.c new file mode 100644 index 000000000..c61cb2bb3 --- /dev/null +++ b/lib/libesp32/berry/default/be_lvgl_wifi_bars_lib.c @@ -0,0 +1,167 @@ +/******************************************************************** + * Tasmota LVGL lv_signal_bars widget + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_LVGL + +#include "lvgl.h" + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(lv_wifi_bars_every_second, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(wifi), + /* K2 */ be_nested_str(find), + /* K3 */ be_nested_str(quality), + /* K4 */ be_nested_str(ip), + /* K5 */ be_nested_str(set_percentage), + /* K6 */ be_const_int(0), + }), + &be_const_str_every_second, + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x8C080302, // 0003 GETMET R2 R1 K2 + 0x58100003, // 0004 LDCONST R4 K3 + 0x7C080400, // 0005 CALL R2 2 + 0x8C0C0302, // 0006 GETMET R3 R1 K2 + 0x58140004, // 0007 LDCONST R5 K4 + 0x7C0C0400, // 0008 CALL R3 2 + 0x4C100000, // 0009 LDNIL R4 + 0x1C100604, // 000A EQ R4 R3 R4 + 0x78120003, // 000B JMPF R4 #0010 + 0x8C100105, // 000C GETMET R4 R0 K5 + 0x58180006, // 000D LDCONST R6 K6 + 0x7C100400, // 000E CALL R4 2 + 0x70020005, // 000F JMP #0016 + 0x4C100000, // 0010 LDNIL R4 + 0x20100404, // 0011 NE R4 R2 R4 + 0x78120002, // 0012 JMPF R4 #0016 + 0x8C100105, // 0013 GETMET R4 R0 K5 + 0x5C180400, // 0014 MOVE R6 R2 + 0x7C100400, // 0015 CALL R4 2 + 0x80000000, // 0016 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_wifi_bars_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(add_driver), + /* K3 */ be_nested_str(set_percentage), + /* K4 */ be_const_int(0), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0xB80A0200, // 0006 GETNGBL R2 K1 + 0x8C080502, // 0007 GETMET R2 R2 K2 + 0x5C100000, // 0008 MOVE R4 R0 + 0x7C080400, // 0009 CALL R2 2 + 0x8C080103, // 000A GETMET R2 R0 K3 + 0x58100004, // 000B LDCONST R4 K4 + 0x7C080400, // 000C CALL R2 2 + 0x80000000, // 000D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: del +********************************************************************/ +be_local_closure(lv_wifi_bars_del, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(del), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(remove_driver), + }), + &be_const_str_del, + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x60040003, // 0000 GETGBL R1 G3 + 0x5C080000, // 0001 MOVE R2 R0 + 0x7C040200, // 0002 CALL R1 1 + 0x8C040300, // 0003 GETMET R1 R1 K0 + 0x7C040200, // 0004 CALL R1 1 + 0xB8060200, // 0005 GETNGBL R1 K1 + 0x8C040302, // 0006 GETMET R1 R1 K2 + 0x5C0C0000, // 0007 MOVE R3 R0 + 0x7C040400, // 0008 CALL R1 2 + 0x80000000, // 0009 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_wifi_bars +********************************************************************/ +extern const bclass be_class_lv_signal_bars; +be_local_class(lv_wifi_bars, + 0, + &be_class_lv_signal_bars, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(every_second, 1), be_const_closure(lv_wifi_bars_every_second_closure) }, + { be_const_key(init, -1), be_const_closure(lv_wifi_bars_init_closure) }, + { be_const_key(del, -1), be_const_closure(lv_wifi_bars_del_closure) }, + })), + be_str_literal("lv_wifi_bars") +); +/*******************************************************************/ + +void be_load_lv_wifi_bars_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_wifi_bars); + be_setglobal(vm, "lv_wifi_bars"); + be_pop(vm, 1); +} + +#endif // USE_LVGL \ No newline at end of file diff --git a/lib/libesp32/berry/default/be_md5_lib.c b/lib/libesp32/berry/default/be_md5_lib.c new file mode 100644 index 000000000..2c8dfd77b --- /dev/null +++ b/lib/libesp32/berry/default/be_md5_lib.c @@ -0,0 +1,30 @@ +/******************************************************************** + * Berry module `webserver` + * + * To use: `import webserver` + * + * Allows to respond to HTTP request + *******************************************************************/ +#include "be_constobj.h" + +extern int m_md5_init(bvm *vm); +extern int m_md5_update(bvm *vm); +extern int m_md5_finish(bvm *vm); + +#include "../generate/be_fixed_be_class_md5.h" + +void be_load_md5_lib(bvm *vm) { + be_pushntvclass(vm, &be_class_md5); + be_setglobal(vm, "MD5"); + be_pop(vm, 1); +} +/* @const_object_info_begin + +class be_class_md5 (scope: global, name: MD5) { + .p, var + + init, func(m_md5_init) + update, func(m_md5_update) + finish, func(m_md5_finish) +} +@const_object_info_end */ diff --git a/lib/libesp32/berry/default/be_modtab.c b/lib/libesp32/berry/default/be_modtab.c new file mode 100644 index 000000000..934400bbb --- /dev/null +++ b/lib/libesp32/berry/default/be_modtab.c @@ -0,0 +1,230 @@ +/******************************************************************** +** Copyright (c) 2018-2020 Guan Wenliang +** This file is part of the Berry default interpreter. +** skiars@qq.com, https://github.com/Skiars/berry +** See Copyright Notice in the LICENSE file or at +** https://github.com/Skiars/berry/blob/master/LICENSE +********************************************************************/ +#include "berry.h" + +/* this file contains the declaration of the module table. */ + +/* default modules declare */ +be_extern_native_module(string); +be_extern_native_module(json); +be_extern_native_module(math); +be_extern_native_module(time); +be_extern_native_module(os); +be_extern_native_module(global); +be_extern_native_module(sys); +be_extern_native_module(debug); +be_extern_native_module(gc); +be_extern_native_module(solidify); +be_extern_native_module(introspect); +be_extern_native_module(strict); + +/* Berry extensions */ +#include "be_mapping.h" +be_extern_native_module(cb); + +/* Tasmota specific */ +be_extern_native_module(python_compat); +be_extern_native_module(re); +be_extern_native_module(persist); +be_extern_native_module(autoconf); +be_extern_native_module(tapp); +be_extern_native_module(light); +be_extern_native_module(gpio); +be_extern_native_module(display); +be_extern_native_module(energy); +be_extern_native_module(webserver); +be_extern_native_module(flash); +be_extern_native_module(path); +be_extern_native_module(unishox); +be_extern_native_module(animate); +#ifdef USE_LVGL +be_extern_native_module(lv); +#endif // USE_LVGL + +/* user-defined modules declare start */ + +/* user-defined modules declare end */ + +/* module list declaration */ +BERRY_LOCAL const bntvmodule* const be_module_table[] = { +/* default modules register */ +#if BE_USE_STRING_MODULE + &be_native_module(string), +#endif +#if BE_USE_JSON_MODULE + &be_native_module(json), +#endif +#if BE_USE_MATH_MODULE + &be_native_module(math), +#endif +#if BE_USE_TIME_MODULE + &be_native_module(time), +#endif +#if BE_USE_OS_MODULE + &be_native_module(os), +#endif +#if BE_USE_GLOBAL_MODULE + &be_native_module(global), +#endif +#if BE_USE_SYS_MODULE + &be_native_module(sys), +#endif +#if BE_USE_DEBUG_MODULE + &be_native_module(debug), +#endif +#if BE_USE_GC_MODULE + &be_native_module(gc), +#endif +#if BE_USE_SOLIDIFY_MODULE + &be_native_module(solidify), +#endif +#if BE_USE_INTROSPECT_MODULE + &be_native_module(introspect), +#endif +#if BE_USE_STRICT_MODULE + &be_native_module(strict), +#endif + + /* Berry extensions */ + &be_native_module(cb), + + /* user-defined modules register start */ + + &be_native_module(python_compat), + &be_native_module(re), + &be_native_module(path), + &be_native_module(persist), +#ifdef USE_AUTOCONF + &be_native_module(autoconf), +#endif // USE_AUTOCONF + &be_native_module(tapp), + &be_native_module(gpio), +#ifdef USE_DISPLAY + &be_native_module(display), +#endif // USE_DISPLAY +#ifdef USE_LIGHT + &be_native_module(light), +#endif + +#ifdef USE_UNISHOX_COMPRESSION + &be_native_module(unishox), +#endif // USE_UNISHOX_COMPRESSION + &be_native_module(animate), + +#ifdef USE_LVGL + &be_native_module(lv), +#endif // USE_LVGL +#ifdef USE_ENERGY_SENSOR + &be_native_module(energy), +#endif // USE_ENERGY_SENSOR +#ifdef USE_WEBSERVER + &be_native_module(webserver), +#endif // USE_WEBSERVER + &be_native_module(flash), + + + /* user-defined modules register end */ + NULL /* do not remove */ +}; + +#ifdef ESP32 +extern void be_load_tasmota_ntvlib(bvm *vm); +extern void be_load_wirelib(bvm *vm); +extern void be_load_onewirelib(bvm *vm); +extern void be_load_serial_lib(bvm *vm); +extern void be_load_Driver_class(bvm *vm); +extern void be_load_Timer_class(bvm *vm); +extern void be_load_I2C_Driver_class(bvm *vm); +extern void be_load_AXP192_class(bvm *vm); +extern void be_load_md5_lib(bvm *vm); +extern void be_load_webclient_lib(bvm *vm); +extern void be_load_tcpclient_lib(bvm *vm); +extern void be_load_crypto_lib(bvm *vm); +extern void be_load_Leds_ntv_class(bvm *vm); +extern void be_load_Leds_class(bvm *vm); +extern void be_load_Leds_animator_class(bvm *vm); + +extern void be_load_ctypes_lib(bvm *vm); +extern void be_load_ctypes_energy_definitions_lib(bvm *vm); + +#ifdef USE_I2S_AUDIO_BERRY +extern void be_load_driver_audio_lib(bvm *vm); +#endif + +#ifdef USE_LVGL +extern void be_load_lv_color_class(bvm *vm); +extern void be_load_lv_font_class(bvm *vm); +extern void be_load_LVGL_glob_class(bvm *vm); +// custom widgets +extern void be_load_lv_signal_bars_class(bvm *vm); +extern void be_load_lv_wifi_bars_class(bvm *vm); +extern void be_load_lv_wifi_bars_icon_class(bvm *vm); +extern void be_load_lv_signal_arcs_class(bvm *vm); +extern void be_load_lv_wifi_arcs_class(bvm *vm); +extern void be_load_lv_wifi_arcs_icon_class(bvm *vm); +extern void be_load_lv_clock_icon_class(bvm *vm); +#endif// USE_LVGL + +/* this code loads the native class definitions */ +BERRY_API void be_load_custom_libs(bvm *vm) +{ + (void)vm; /* prevent a compiler warning */ + + /* add here custom libs */ +#if !BE_USE_PRECOMPILED_OBJECT + /* be_load_xxxlib(vm); */ +#endif + be_load_Timer_class(vm); + be_load_tasmota_ntvlib(vm); + be_load_Driver_class(vm); + be_load_md5_lib(vm); + be_load_serial_lib(vm); + be_load_ctypes_lib(vm); +#ifdef USE_ALEXA_AVS + be_load_crypto_lib(vm); +#endif +#ifdef USE_I2C + be_load_wirelib(vm); + be_load_I2C_Driver_class(vm); + be_load_AXP192_class(vm); +#endif // USE_I2C +#ifdef USE_ENERGY_SENSOR + be_load_ctypes_energy_definitions_lib(vm); +#endif // USE_ENERGY_SENSOR +#ifdef USE_WEBCLIENT + be_load_webclient_lib(vm); + be_load_tcpclient_lib(vm); +#endif // USE_WEBCLIENT +#if defined(USE_ONEWIRE) || defined(USE_DS18x20) + be_load_onewirelib(vm); +#endif +#ifdef USE_WS2812 + be_load_Leds_ntv_class(vm); + be_load_Leds_class(vm); + be_load_Leds_animator_class(vm); +#endif // USE_WS2812 +#ifdef USE_I2S_AUDIO_BERRY + be_load_driver_audio_lib(vm); +#endif +#ifdef USE_LVGL + // LVGL + be_load_lv_color_class(vm); + be_load_lv_font_class(vm); + + be_load_LVGL_glob_class(vm); + // custom widgets + be_load_lv_signal_bars_class(vm); + be_load_lv_wifi_bars_class(vm); + be_load_lv_wifi_bars_icon_class(vm); + be_load_lv_signal_arcs_class(vm); + be_load_lv_wifi_arcs_class(vm); + be_load_lv_wifi_arcs_icon_class(vm); + be_load_lv_clock_icon_class(vm); +#endif // USE_LVGL +} +#endif diff --git a/lib/libesp32/berry/default/be_onewire_lib.c b/lib/libesp32/berry/default/be_onewire_lib.c new file mode 100644 index 000000000..838e6ccf9 --- /dev/null +++ b/lib/libesp32/berry/default/be_onewire_lib.c @@ -0,0 +1,57 @@ +/******************************************************************** + * Tasmota lib + * + * To use: `import wire` + * + * 2 wire communication - I2C + *******************************************************************/ +#include "be_constobj.h" + +#if defined(USE_ONEWIRE) || defined(USE_DS18x20) + +extern int b_onewire_init(bvm *vm); +extern int b_onewire_deinit(bvm *vm); + +extern int b_onewire_reset(bvm *vm); +extern int b_onewire_select(bvm *vm); +extern int b_onewire_skip(bvm *vm); +extern int b_onewire_depower(bvm *vm); + +extern int b_onewire_write(bvm *vm); +extern int b_onewire_read(bvm *vm); + +extern int b_onewire_reset_search(bvm *vm); +extern int b_onewire_target_search(bvm *vm); +extern int b_onewire_search(bvm *vm); + +#include "../generate/be_fixed_be_class_tasmota_onewire.h" + +void be_load_onewirelib(bvm *vm) { + be_pushntvclass(vm, &be_class_tasmota_onewire); + be_setglobal(vm, "OneWire"); + be_pop(vm, 1); +} + +/* @const_object_info_begin + +class be_class_tasmota_onewire (scope: global, name: OneWire) { + .p, var + + init, func(b_onewire_init) + deinit, func(b_onewire_deinit) + + reset, func(b_onewire_reset) + select, func(b_onewire_select) + skip, func(b_onewire_skip) + depower, func(b_onewire_depower) + + write, func(b_onewire_write) + read, func(b_onewire_read) + + reset_search, func(b_onewire_reset_search) + target_search, func(b_onewire_target_search) + search, func(b_onewire_search) +} +@const_object_info_end */ + +#endif // defined(USE_ONEWIRE) || defined(USE_DS18x20) diff --git a/lib/libesp32/berry/default/be_path_tasmota_lib.c b/lib/libesp32/berry/default/be_path_tasmota_lib.c new file mode 100644 index 000000000..81711a053 --- /dev/null +++ b/lib/libesp32/berry/default/be_path_tasmota_lib.c @@ -0,0 +1,70 @@ +/******************************************************************** +** Copyright (c) 2018-2020 Guan Wenliang +** This file is part of the Berry default interpreter. +** skiars@qq.com, https://github.com/Skiars/berry +** See Copyright Notice in the LICENSE file or at +** https://github.com/Skiars/berry/blob/master/LICENSE +********************************************************************/ + +/******************************************************************** + * Berry module `path` + * + * Minimal version of `import path` + * + *******************************************************************/ +#include "be_object.h" +#include "be_strlib.h" +#include "be_mem.h" +#include "be_sys.h" +#include + +extern int m_path_listdir(bvm *vm); + +static int m_path_exists(bvm *vm) +{ + const char *path = NULL; + if (be_top(vm) >= 1 && be_isstring(vm, 1)) { + path = be_tostring(vm, 1); + be_pushbool(vm, be_isexist(path)); + } else { + be_pushbool(vm, bfalse); + } + be_return(vm); +} +extern time_t be_last_modified(void *hfile); + +static int m_path_last_modified(bvm *vm) +{ + if (be_top(vm) >= 1 && be_isstring(vm, 1)) { + const char *path = be_tostring(vm, 1); + void * f = be_fopen(path, "r"); + if (f) { + be_pushint(vm, be_last_modified(f)); + be_fclose(f); + be_return(vm); + } + } + be_return_nil(vm); +} + +static int m_path_remove(bvm *vm) +{ + const char *path = NULL; + if (be_top(vm) >= 1 && be_isstring(vm, 1)) { + path = be_tostring(vm, 1); + be_pushbool(vm, be_unlink(path)); + } else { + be_pushbool(vm, bfalse); + } + be_return(vm); +} + +/* @const_object_info_begin +module path (scope: global, file: tasmota_path) { + exists, func(m_path_exists) + last_modified, func(m_path_last_modified) + listdir, func(m_path_listdir) + remove, func(m_path_remove) +} +@const_object_info_end */ +#include "../generate/be_fixed_tasmota_path.h" diff --git a/lib/libesp32/berry/default/be_persist_lib.c b/lib/libesp32/berry/default/be_persist_lib.c new file mode 100644 index 000000000..0581081c7 --- /dev/null +++ b/lib/libesp32/berry/default/be_persist_lib.c @@ -0,0 +1,703 @@ +/******************************************************************** + * Tasmota lib + * + * To use: `import power` + * + * read power values + *******************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: json_fdump_map +********************************************************************/ +be_local_closure(Persist_json_fdump_map, /* name */ + be_nested_proto( + 13, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str(json), + /* K1 */ be_nested_str(write), + /* K2 */ be_nested_str(_X7B), + /* K3 */ be_nested_str(keys), + /* K4 */ be_nested_str(dump), + /* K5 */ be_nested_str(_X3A), + /* K6 */ be_nested_str(json_fdump_any), + /* K7 */ be_nested_str(_X2C), + /* K8 */ be_nested_str(stop_iteration), + /* K9 */ be_nested_str(_X7D), + }), + &be_const_str_json_fdump_map, + &be_const_str_solidified, + ( &(const binstruction[41]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0x8C100301, // 0001 GETMET R4 R1 K1 + 0x58180002, // 0002 LDCONST R6 K2 + 0x7C100400, // 0003 CALL R4 2 + 0x4C100000, // 0004 LDNIL R4 + 0x60140010, // 0005 GETGBL R5 G16 + 0x8C180503, // 0006 GETMET R6 R2 K3 + 0x7C180200, // 0007 CALL R6 1 + 0x7C140200, // 0008 CALL R5 1 + 0xA8020017, // 0009 EXBLK 0 #0022 + 0x5C180A00, // 000A MOVE R6 R5 + 0x7C180000, // 000B CALL R6 0 + 0x4C1C0000, // 000C LDNIL R7 + 0x201C0807, // 000D NE R7 R4 R7 + 0x781E0002, // 000E JMPF R7 #0012 + 0x8C1C0301, // 000F GETMET R7 R1 K1 + 0x5C240800, // 0010 MOVE R9 R4 + 0x7C1C0400, // 0011 CALL R7 2 + 0x8C1C0301, // 0012 GETMET R7 R1 K1 + 0x8C240704, // 0013 GETMET R9 R3 K4 + 0x602C0008, // 0014 GETGBL R11 G8 + 0x5C300C00, // 0015 MOVE R12 R6 + 0x7C2C0200, // 0016 CALL R11 1 + 0x7C240400, // 0017 CALL R9 2 + 0x7C1C0400, // 0018 CALL R7 2 + 0x8C1C0301, // 0019 GETMET R7 R1 K1 + 0x58240005, // 001A LDCONST R9 K5 + 0x7C1C0400, // 001B CALL R7 2 + 0x8C1C0106, // 001C GETMET R7 R0 K6 + 0x5C240200, // 001D MOVE R9 R1 + 0x94280406, // 001E GETIDX R10 R2 R6 + 0x7C1C0600, // 001F CALL R7 3 + 0x58100007, // 0020 LDCONST R4 K7 + 0x7001FFE7, // 0021 JMP #000A + 0x58140008, // 0022 LDCONST R5 K8 + 0xAC140200, // 0023 CATCH R5 1 0 + 0xB0080000, // 0024 RAISE 2 R0 R0 + 0x8C140301, // 0025 GETMET R5 R1 K1 + 0x581C0009, // 0026 LDCONST R7 K9 + 0x7C140400, // 0027 CALL R5 2 + 0x80000000, // 0028 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: setmember +********************************************************************/ +be_local_closure(Persist_setmember, /* name */ + be_nested_proto( + 4, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(_p), + /* K1 */ be_nested_str(_dirty), + }), + &be_const_str_setmember, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x980C0202, // 0001 SETIDX R3 R1 R2 + 0x500C0200, // 0002 LDBOOL R3 1 0 + 0x90020203, // 0003 SETMBR R0 K1 R3 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: zero +********************************************************************/ +be_local_closure(Persist_zero, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(_p), + /* K1 */ be_nested_str(_dirty), + }), + &be_const_str_zero, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x60040013, // 0000 GETGBL R1 G19 + 0x7C040000, // 0001 CALL R1 0 + 0x90020001, // 0002 SETMBR R0 K0 R1 + 0x50040200, // 0003 LDBOOL R1 1 0 + 0x90020201, // 0004 SETMBR R0 K1 R1 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: member +********************************************************************/ +be_local_closure(Persist_member, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(_p), + /* K1 */ be_nested_str(find), + }), + &be_const_str_member, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: json_fdump +********************************************************************/ +be_local_closure(Persist_json_fdump, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(json), + /* K1 */ be_nested_str(_p), + /* K2 */ be_nested_str(json_fdump_map), + /* K3 */ be_nested_str(internal_error), + /* K4 */ be_nested_str(persist_X2E_p_X20is_X20not_X20a_X20map), + }), + &be_const_str_json_fdump, + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x600C000F, // 0001 GETGBL R3 G15 + 0x88100101, // 0002 GETMBR R4 R0 K1 + 0x60140013, // 0003 GETGBL R5 G19 + 0x7C0C0400, // 0004 CALL R3 2 + 0x780E0004, // 0005 JMPF R3 #000B + 0x8C0C0102, // 0006 GETMET R3 R0 K2 + 0x5C140200, // 0007 MOVE R5 R1 + 0x88180101, // 0008 GETMBR R6 R0 K1 + 0x7C0C0600, // 0009 CALL R3 3 + 0x70020000, // 000A JMP #000C + 0xB0060704, // 000B RAISE 1 K3 K4 + 0x80000000, // 000C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove +********************************************************************/ +be_local_closure(Persist_remove, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(_p), + /* K1 */ be_nested_str(remove), + /* K2 */ be_nested_str(_dirty), + }), + &be_const_str_remove, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x50080200, // 0004 LDBOOL R2 1 0 + 0x90020402, // 0005 SETMBR R0 K2 R2 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: json_fdump_any +********************************************************************/ +be_local_closure(Persist_json_fdump_any, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(json), + /* K1 */ be_nested_str(json_fdump_map), + /* K2 */ be_nested_str(json_fdump_list), + /* K3 */ be_nested_str(write), + /* K4 */ be_nested_str(dump), + }), + &be_const_str_json_fdump_any, + &be_const_str_solidified, + ( &(const binstruction[27]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0x6010000F, // 0001 GETGBL R4 G15 + 0x5C140400, // 0002 MOVE R5 R2 + 0x60180013, // 0003 GETGBL R6 G19 + 0x7C100400, // 0004 CALL R4 2 + 0x78120004, // 0005 JMPF R4 #000B + 0x8C100101, // 0006 GETMET R4 R0 K1 + 0x5C180200, // 0007 MOVE R6 R1 + 0x5C1C0400, // 0008 MOVE R7 R2 + 0x7C100600, // 0009 CALL R4 3 + 0x7002000E, // 000A JMP #001A + 0x6010000F, // 000B GETGBL R4 G15 + 0x5C140400, // 000C MOVE R5 R2 + 0x60180012, // 000D GETGBL R6 G18 + 0x7C100400, // 000E CALL R4 2 + 0x78120004, // 000F JMPF R4 #0015 + 0x8C100102, // 0010 GETMET R4 R0 K2 + 0x5C180200, // 0011 MOVE R6 R1 + 0x5C1C0400, // 0012 MOVE R7 R2 + 0x7C100600, // 0013 CALL R4 3 + 0x70020004, // 0014 JMP #001A + 0x8C100303, // 0015 GETMET R4 R1 K3 + 0x8C180704, // 0016 GETMET R6 R3 K4 + 0x5C200400, // 0017 MOVE R8 R2 + 0x7C180400, // 0018 CALL R6 2 + 0x7C100400, // 0019 CALL R4 2 + 0x80000000, // 001A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: save +********************************************************************/ +be_local_closure(Persist_save, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str(_filename), + /* K1 */ be_nested_str(w), + /* K2 */ be_nested_str(json_fdump), + /* K3 */ be_nested_str(close), + /* K4 */ be_nested_str(write), + /* K5 */ be_nested_str(_X7B_X7D), + /* K6 */ be_nested_str(_dirty), + }), + &be_const_str_save, + &be_const_str_solidified, + ( &(const binstruction[37]) { /* code */ + 0x4C040000, // 0000 LDNIL R1 + 0xA802000B, // 0001 EXBLK 0 #000E + 0x60080011, // 0002 GETGBL R2 G17 + 0x880C0100, // 0003 GETMBR R3 R0 K0 + 0x58100001, // 0004 LDCONST R4 K1 + 0x7C080400, // 0005 CALL R2 2 + 0x5C040400, // 0006 MOVE R1 R2 + 0x8C080102, // 0007 GETMET R2 R0 K2 + 0x5C100200, // 0008 MOVE R4 R1 + 0x7C080400, // 0009 CALL R2 2 + 0x8C080303, // 000A GETMET R2 R1 K3 + 0x7C080200, // 000B CALL R2 1 + 0xA8040001, // 000C EXBLK 1 1 + 0x70020013, // 000D JMP #0022 + 0xAC080002, // 000E CATCH R2 0 2 + 0x70020010, // 000F JMP #0021 + 0x4C100000, // 0010 LDNIL R4 + 0x20100204, // 0011 NE R4 R1 R4 + 0x78120001, // 0012 JMPF R4 #0015 + 0x8C100303, // 0013 GETMET R4 R1 K3 + 0x7C100200, // 0014 CALL R4 1 + 0x60100011, // 0015 GETGBL R4 G17 + 0x88140100, // 0016 GETMBR R5 R0 K0 + 0x58180001, // 0017 LDCONST R6 K1 + 0x7C100400, // 0018 CALL R4 2 + 0x5C040800, // 0019 MOVE R1 R4 + 0x8C100304, // 001A GETMET R4 R1 K4 + 0x58180005, // 001B LDCONST R6 K5 + 0x7C100400, // 001C CALL R4 2 + 0x8C100303, // 001D GETMET R4 R1 K3 + 0x7C100200, // 001E CALL R4 1 + 0xB0040403, // 001F RAISE 1 R2 R3 + 0x70020000, // 0020 JMP #0022 + 0xB0080000, // 0021 RAISE 2 R0 R0 + 0x50080000, // 0022 LDBOOL R2 0 0 + 0x90020C02, // 0023 SETMBR R0 K6 R2 + 0x80000000, // 0024 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: load +********************************************************************/ +be_local_closure(Persist_load, /* name */ + be_nested_proto( + 9, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str(json), + /* K1 */ be_nested_str(path), + /* K2 */ be_nested_str(exists), + /* K3 */ be_nested_str(_filename), + /* K4 */ be_nested_str(r), + /* K5 */ be_nested_str(load), + /* K6 */ be_nested_str(read), + /* K7 */ be_nested_str(close), + /* K8 */ be_nested_str(_p), + /* K9 */ be_nested_str(BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson), + /* K10 */ be_nested_str(_dirty), + /* K11 */ be_nested_str(save), + }), + &be_const_str_load, + &be_const_str_solidified, + ( &(const binstruction[49]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x4C0C0000, // 0002 LDNIL R3 + 0x4C100000, // 0003 LDNIL R4 + 0x8C140502, // 0004 GETMET R5 R2 K2 + 0x881C0103, // 0005 GETMBR R7 R0 K3 + 0x7C140400, // 0006 CALL R5 2 + 0x78160025, // 0007 JMPF R5 #002E + 0xA802000D, // 0008 EXBLK 0 #0017 + 0x60140011, // 0009 GETGBL R5 G17 + 0x88180103, // 000A GETMBR R6 R0 K3 + 0x581C0004, // 000B LDCONST R7 K4 + 0x7C140400, // 000C CALL R5 2 + 0x5C0C0A00, // 000D MOVE R3 R5 + 0x8C140305, // 000E GETMET R5 R1 K5 + 0x8C1C0706, // 000F GETMET R7 R3 K6 + 0x7C1C0200, // 0010 CALL R7 1 + 0x7C140400, // 0011 CALL R5 2 + 0x5C100A00, // 0012 MOVE R4 R5 + 0x8C140707, // 0013 GETMET R5 R3 K7 + 0x7C140200, // 0014 CALL R5 1 + 0xA8040001, // 0015 EXBLK 1 1 + 0x70020009, // 0016 JMP #0021 + 0xAC140002, // 0017 CATCH R5 0 2 + 0x70020006, // 0018 JMP #0020 + 0x4C1C0000, // 0019 LDNIL R7 + 0x201C0607, // 001A NE R7 R3 R7 + 0x781E0001, // 001B JMPF R7 #001E + 0x8C1C0707, // 001C GETMET R7 R3 K7 + 0x7C1C0200, // 001D CALL R7 1 + 0xB0040A06, // 001E RAISE 1 R5 R6 + 0x70020000, // 001F JMP #0021 + 0xB0080000, // 0020 RAISE 2 R0 R0 + 0x6014000F, // 0021 GETGBL R5 G15 + 0x5C180800, // 0022 MOVE R6 R4 + 0x601C0013, // 0023 GETGBL R7 G19 + 0x7C140400, // 0024 CALL R5 2 + 0x78160001, // 0025 JMPF R5 #0028 + 0x90021004, // 0026 SETMBR R0 K8 R4 + 0x70020002, // 0027 JMP #002B + 0x60140001, // 0028 GETGBL R5 G1 + 0x58180009, // 0029 LDCONST R6 K9 + 0x7C140200, // 002A CALL R5 1 + 0x50140000, // 002B LDBOOL R5 0 0 + 0x90021405, // 002C SETMBR R0 K10 R5 + 0x70020001, // 002D JMP #0030 + 0x8C14010B, // 002E GETMET R5 R0 K11 + 0x7C140200, // 002F CALL R5 1 + 0x80000000, // 0030 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: find +********************************************************************/ +be_local_closure(Persist_find, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(_p), + /* K1 */ be_nested_str(find), + }), + &be_const_str_find, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x8C0C0701, // 0001 GETMET R3 R3 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x5C180400, // 0003 MOVE R6 R2 + 0x7C0C0600, // 0004 CALL R3 3 + 0x80040600, // 0005 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Persist_init, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str(_filename), + /* K1 */ be_nested_str(_persist_X2Ejson), + /* K2 */ be_nested_str(_p), + /* K3 */ be_nested_str(copy), + /* K4 */ be_nested_str(load), + /* K5 */ be_nested_str(_dirty), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0x90020101, // 0000 SETMBR R0 K0 K1 + 0x6008000F, // 0001 GETGBL R2 G15 + 0x5C0C0200, // 0002 MOVE R3 R1 + 0x60100013, // 0003 GETGBL R4 G19 + 0x7C080400, // 0004 CALL R2 2 + 0x780A0003, // 0005 JMPF R2 #000A + 0x8C080303, // 0006 GETMET R2 R1 K3 + 0x7C080200, // 0007 CALL R2 1 + 0x90020402, // 0008 SETMBR R0 K2 R2 + 0x70020002, // 0009 JMP #000D + 0x60080013, // 000A GETGBL R2 G19 + 0x7C080000, // 000B CALL R2 0 + 0x90020402, // 000C SETMBR R0 K2 R2 + 0x8C080104, // 000D GETMET R2 R0 K4 + 0x88100102, // 000E GETMBR R4 R0 K2 + 0x88140100, // 000F GETMBR R5 R0 K0 + 0x7C080600, // 0010 CALL R2 3 + 0x50080000, // 0011 LDBOOL R2 0 0 + 0x90020A02, // 0012 SETMBR R0 K5 R2 + 0x80000000, // 0013 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: json_fdump_list +********************************************************************/ +be_local_closure(Persist_json_fdump_list, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str(json), + /* K1 */ be_nested_str(write), + /* K2 */ be_nested_str(_X5B), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str(_X2C), + /* K5 */ be_nested_str(json_fdump_any), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str(_X5D), + }), + &be_const_str_json_fdump_list, + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0x8C100301, // 0001 GETMET R4 R1 K1 + 0x58180002, // 0002 LDCONST R6 K2 + 0x7C100400, // 0003 CALL R4 2 + 0x58100003, // 0004 LDCONST R4 K3 + 0x6014000C, // 0005 GETGBL R5 G12 + 0x5C180400, // 0006 MOVE R6 R2 + 0x7C140200, // 0007 CALL R5 1 + 0x14140805, // 0008 LT R5 R4 R5 + 0x7816000A, // 0009 JMPF R5 #0015 + 0x24140903, // 000A GT R5 R4 K3 + 0x78160002, // 000B JMPF R5 #000F + 0x8C140301, // 000C GETMET R5 R1 K1 + 0x581C0004, // 000D LDCONST R7 K4 + 0x7C140400, // 000E CALL R5 2 + 0x8C140105, // 000F GETMET R5 R0 K5 + 0x5C1C0200, // 0010 MOVE R7 R1 + 0x94200404, // 0011 GETIDX R8 R2 R4 + 0x7C140600, // 0012 CALL R5 3 + 0x00100906, // 0013 ADD R4 R4 K6 + 0x7001FFEF, // 0014 JMP #0005 + 0x8C140301, // 0015 GETMET R5 R1 K1 + 0x581C0007, // 0016 LDCONST R7 K7 + 0x7C140400, // 0017 CALL R5 2 + 0x80000000, // 0018 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: has +********************************************************************/ +be_local_closure(Persist_has, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(_p), + /* K1 */ be_nested_str(has), + }), + &be_const_str_has, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Persist +********************************************************************/ +be_local_class(Persist, + 3, + NULL, + be_nested_map(16, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(has, 6), be_const_closure(Persist_has_closure) }, + { be_const_key(setmember, -1), be_const_closure(Persist_setmember_closure) }, + { be_const_key(remove, -1), be_const_closure(Persist_remove_closure) }, + { be_const_key(zero, 0), be_const_closure(Persist_zero_closure) }, + { be_const_key(json_fdump, -1), be_const_closure(Persist_json_fdump_closure) }, + { be_const_key(json_fdump_list, 2), be_const_closure(Persist_json_fdump_list_closure) }, + { be_const_key(init, 15), be_const_closure(Persist_init_closure) }, + { be_const_key(find, -1), be_const_closure(Persist_find_closure) }, + { be_const_key(save, -1), be_const_closure(Persist_save_closure) }, + { be_const_key(json_fdump_any, 12), be_const_closure(Persist_json_fdump_any_closure) }, + { be_const_key(_p, 7), be_const_var(1) }, + { be_const_key(_filename, -1), be_const_var(0) }, + { be_const_key(load, -1), be_const_closure(Persist_load_closure) }, + { be_const_key(json_fdump_map, 5), be_const_closure(Persist_json_fdump_map_closure) }, + { be_const_key(_dirty, -1), be_const_var(2) }, + { be_const_key(member, -1), be_const_closure(Persist_member_closure) }, + })), + be_str_literal("Persist") +); + +/******************************************************************** +** Solidified function: _anonymous_ +********************************************************************/ +be_local_closure(persist__anonymous_, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_const_class(be_class_Persist), + }), + &be_const_str__anonymous_, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x58040000, // 0000 LDCONST R1 K0 + 0xB4000000, // 0001 CLASS K0 + 0x5C080200, // 0002 MOVE R2 R1 + 0x7C080000, // 0003 CALL R2 0 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified module: persist +********************************************************************/ +be_local_module(persist, + "persist", + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(persist__anonymous__closure) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(persist); +/********************************************************************/ diff --git a/lib/libesp32/berry/default/be_port.cpp b/lib/libesp32/berry/default/be_port.cpp new file mode 100644 index 000000000..5da10f47e --- /dev/null +++ b/lib/libesp32/berry/default/be_port.cpp @@ -0,0 +1,574 @@ +/******************************************************************** +** Copyright (c) 2018-2020 Guan Wenliang +** This file is part of the Berry default interpreter. +** skiars@qq.com, https://github.com/Skiars/berry +** See Copyright Notice in the LICENSE file or at +** https://github.com/Skiars/berry/blob/master/LICENSE +********************************************************************/ +#include "berry.h" +#include "be_mem.h" +#include "be_sys.h" +// #include +#include +#include + +// from https://github.com/eyalroz/cpp-static-block +#include "static_block.hpp" + +// Local pointer for file managment +#ifdef USE_UFILESYS + #include + #include "ZipReadFS.h" + extern FS *ffsp; + FS zip_ufsp(ZipReadFSImplPtr(new ZipReadFSImpl(&ffsp))); +#endif // USE_UFILESYS + +/* this file contains configuration for the file system. */ + +/* standard input and output */ +extern "C" { + int strncmp_PP(const char * str1P, const char * str2P, size_t size) + { + int result = 0; + + while (size > 0) + { + char ch1 = pgm_read_byte(str1P++); + char ch2 = pgm_read_byte(str2P++); + result = ch1 - ch2; + if (result != 0 || ch2 == '\0') + { + break; + } + + size--; + } + + return result; + } + + // + char * strchr_P(const char *s, int c) { + do { + if (pgm_read_byte(s) == c) { + return (char*)s; + } + } while (pgm_read_byte(s++)); + return (0); + } +} + +// We need to create a local buffer, since we might mess up mqtt_data +#ifndef BERRY_LOGSZ +#define BERRY_LOGSZ 700 +#endif + +static char * log_berry_buffer = nullptr; +static_block { + log_berry_buffer = (char*) malloc(BERRY_LOGSZ); + if (log_berry_buffer) log_berry_buffer[0] = 0; +} +extern void berry_log(const char * berry_buf); + +BERRY_API void be_writebuffer(const char *buffer, size_t length) +{ + if (!log_berry_buffer) return; + if (buffer == nullptr || length == 0) { return; } + uint32_t idx = 0; + while (idx < length) { + int32_t cr_pos = -1; + // find next occurence of '\n' or '\r' + for (uint32_t i = idx; i < length; i++) { + if ((pgm_read_byte(&buffer[i]) == '\n') || (pgm_read_byte(&buffer[i]) == '\r')) { + cr_pos = i; + break; + } + } + uint32_t chars_to_append = (cr_pos >= 0) ? cr_pos - idx : length - idx; // note cr_pos < length + snprintf(log_berry_buffer, BERRY_LOGSZ, "%s%.*s", log_berry_buffer, chars_to_append, &buffer[idx]); // append at most `length` chars + if (cr_pos >= 0) { + // flush + berry_log(log_berry_buffer); + log_berry_buffer[0] = 0; // clear string + } + idx += chars_to_append + 1; // skip '\n' + } + // Serial.write(buffer, length); + // be_fwrite(stdout, buffer, length); +} + + +extern "C" { + int m_path_listdir(bvm *vm) + { + if (be_top(vm) >= 1 && be_isstring(vm, 1)) { + const char *path = be_tostring(vm, 1); + be_newobject(vm, "list"); + + File dir = ffsp->open(path, "r"); + if (dir) { + dir.rewindDirectory(); + while (1) { + File entry = dir.openNextFile(); + if (!entry) { + break; + } + const char * fn = entry.name(); + if (strcmp(fn, ".") && strcmp(fn, "..")) { + be_pushstring(vm, fn); + be_data_push(vm, -2); + be_pop(vm, 1); + } + + } + } + be_pop(vm, 1); + be_return(vm); + + } + be_return_nil(vm); + } +} + +BERRY_API char* be_readstring(char *buffer, size_t size) +{ + return be_fgets(stdin, buffer, (int)size); +} + +/* use the standard library implementation file API. */ + +void* be_fopen(const char *filename, const char *modes) +{ +#ifdef USE_UFILESYS + if (filename != nullptr && modes != nullptr) { + char fname2[strlen(filename) + 2]; + if (filename[0] == '/') { + strcpy(fname2, filename); // copy unchanged + } else { + fname2[0] = '/'; + strcpy(fname2 + 1, filename); // prepend with '/' + } + // Serial.printf("be_fopen filename=%s, modes=%s\n", filename, modes); + File f = zip_ufsp.open(fname2, modes); // returns an object, not a pointer + if (f) { + File * f_ptr = new File(f); // copy to dynamic object + *f_ptr = f; // TODO is this necessary? + return f_ptr; + } + } +#endif // USE_UFILESYS + return nullptr; + // return fopen(filename, modes); +} + +// Tasmota specific, get the underlying Arduino File +File * be_get_arduino_file(void *hfile) +{ +#ifdef USE_UFILESYS + if (hfile != nullptr) { + File * f_ptr = (File*) hfile; + return f_ptr; + } +#endif // USE_UFILESYS + return nullptr; + // return fopen(filename, modes); +} + +int be_fclose(void *hfile) +{ +#ifdef USE_UFILESYS + // Serial.printf("be_fclose\n"); + if (hfile != nullptr) { + File * f_ptr = (File*) hfile; + f_ptr->close(); + delete f_ptr; + return 0; + } +#endif // USE_UFILESYS + return -1; + // return fclose(hfile); +} + +size_t be_fwrite(void *hfile, const void *buffer, size_t length) +{ +#ifdef USE_UFILESYS + // Serial.printf("be_fwrite %d\n", length); + if (hfile != nullptr && buffer != nullptr) { + File * f_ptr = (File*) hfile; + return f_ptr->write((const uint8_t*) buffer, length); + } +#endif // USE_UFILESYS + return 0; + // return fwrite(buffer, 1, length, hfile); +} + +size_t be_fread(void *hfile, void *buffer, size_t length) +{ +#ifdef USE_UFILESYS + // Serial.printf("be_fread %d\n", length); + if (hfile != nullptr && buffer != nullptr) { + File * f_ptr = (File*) hfile; + int32_t ret = f_ptr->read((uint8_t*) buffer, length); + if (ret >= 0) { + // Serial.printf("be_fread ret = %d\n", ret); + return ret; + } + } +#endif // USE_UFILESYS + return 0; + // return fread(buffer, 1, length, hfile); +} + +char* be_fgets(void *hfile, void *buffer, int size) +{ +#ifdef USE_UFILESYS + if (size <= 2) { return nullptr; } // can't work if size is 2 or less + // Serial.printf("be_fgets size=%d hfile=%p buf=%p\n", size, hfile, buffer); + uint8_t * buf = (uint8_t*) buffer; + if (hfile != nullptr && buffer != nullptr && size > 0) { + File * f_ptr = (File*) hfile; + int ret = f_ptr->readBytesUntil('\n', buf, size - 2); + // Serial.printf("be_fgets ret=%d\n", ret); + if (ret >= 0) { + buf[ret] = 0; // add string terminator + if (ret > 0 && ret < size - 2) { + buf[ret] = '\n'; + buf[ret+1] = 0; + } + return (char*) buffer; + } + } +#endif // USE_UFILESYS + return nullptr; + // return fgets(buffer, size, hfile); +} + +int be_fseek(void *hfile, long offset) +{ +#ifdef USE_UFILESYS + // Serial.printf("be_fseek %d\n", offset); + if (hfile != nullptr) { + File * f_ptr = (File*) hfile; + if (f_ptr->seek(offset)) { + return 0; // success + } + } +#endif // USE_UFILESYS + return -1; + // return fseek(hfile, offset, SEEK_SET); +} + +long int be_ftell(void *hfile) +{ +#ifdef USE_UFILESYS + // Serial.printf("be_ftell\n"); + if (hfile != nullptr) { + File * f_ptr = (File*) hfile; + return f_ptr->position(); + } +#endif // USE_UFILESYS + return 0; + // return ftell(hfile); +} + +long int be_fflush(void *hfile) +{ +#ifdef USE_UFILESYS + // Serial.printf("be_fflush\n"); + if (hfile != nullptr) { + File * f_ptr = (File*) hfile; + f_ptr->flush(); + } +#endif // USE_UFILESYS + return 0; + // return fflush(hfile); +} + +size_t be_fsize(void *hfile) +{ +#ifdef USE_UFILESYS + // Serial.printf("be_fsize\n"); + if (hfile != nullptr) { + File * f_ptr = (File*) hfile; + return f_ptr->size(); + } + // long int size, offset = be_ftell(hfile); + // fseek(hfile, 0L, SEEK_END); + // size = ftell(hfile); + // fseek(hfile, offset, SEEK_SET); + // return size; +#endif // USE_UFILESYS + return 0; +} + +extern "C" time_t be_last_modified(void *hfile) +{ +#ifdef USE_UFILESYS + if (hfile != nullptr) { + File * f_ptr = (File*) hfile; + return f_ptr->getLastWrite(); + } +#endif // USE_UFILESYS + return 0; +} + +int be_isexist(const char *filename) +{ +#ifdef USE_UFILESYS + char fname2[strlen(filename) + 2]; + if (filename[0] == '/') { + strcpy(fname2, filename); // copy unchanged + } else { + fname2[0] = '/'; + strcpy(fname2 + 1, filename); // prepend with '/' + } + return zip_ufsp.exists(fname2); +#endif // USE_UFILESYS + return 0; +} + +int be_unlink(const char *filename) +{ +#ifdef USE_UFILESYS + char fname2[strlen(filename) + 2]; + if (filename[0] == '/') { + strcpy(fname2, filename); // copy unchanged + } else { + fname2[0] = '/'; + strcpy(fname2 + 1, filename); // prepend with '/' + } + return zip_ufsp.remove(fname2); +#endif // USE_UFILESYS + return 0; +} + +#if BE_USE_FILE_SYSTEM +#if defined(USE_FATFS) /* FatFs */ + +int be_isdir(const char *path) +{ + FILINFO fno; + FRESULT fr = f_stat(path, &fno); + return fr == FR_OK && fno.fattrib & AM_DIR; +} + +int be_isfile(const char *path) +{ + FILINFO fno; + FRESULT fr = f_stat(path, &fno); + return fr == FR_OK && !(fno.fattrib & AM_DIR); +} + +int be_isexist(const char *path) +{ + FILINFO fno; + return f_stat(path, &fno) == FR_OK; +} + +char* be_getcwd(char *buf, size_t size) +{ + FRESULT fr = f_getcwd(buf, (UINT)size); + return fr == FR_OK ? buf : NULL; +} + +int be_chdir(const char *path) +{ + return f_chdir(path); +} + +int be_mkdir(const char *path) +{ + return f_mkdir(path); +} + +int be_unlink(const char *filename) +{ + return f_unlink(filename); +} + +int be_dirfirst(bdirinfo *info, const char *path) +{ + info->dir = be_os_malloc(sizeof(DIR)); + info->file = be_os_malloc(sizeof(FILINFO)); + if (info->dir && info->file) { + FRESULT fr = f_opendir(info->dir, path); + return fr == FR_OK ? be_dirnext(info) : 1; + } + be_os_free(info->dir); + be_os_free(info->file); + info->dir = NULL; + info->file = NULL; + return 1; +} + +int be_dirnext(bdirinfo *info) +{ + FRESULT fr = f_readdir(info->dir, info->file); + info->name = ((FILINFO *)info->file)->fname; + return fr != FR_OK || *info->name == '\0'; +} + +int be_dirclose(bdirinfo *info) +{ + if (info->dir) { + int res = f_closedir(info->dir) != FR_OK; + be_os_free(info->dir); + be_os_free(info->file); + return res; + } + return 1; +} + +#elif defined(_MSC_VER) /* MSVC*/ + +#include +#include +#include + +int be_isdir(const char *path) +{ + DWORD type = GetFileAttributes(path); + return type != INVALID_FILE_ATTRIBUTES + && (type & FILE_ATTRIBUTE_DIRECTORY) != 0; +} + +int be_isfile(const char *path) +{ + DWORD type = GetFileAttributes(path); + return type != INVALID_FILE_ATTRIBUTES + && (type & FILE_ATTRIBUTE_DIRECTORY) == 0; +} + +int be_isexist(const char *path) +{ + return GetFileAttributes(path) != INVALID_FILE_ATTRIBUTES; +} + +char* be_getcwd(char *buf, size_t size) +{ + return _getcwd(buf, (int)size); +} + +int be_chdir(const char *path) +{ + return _chdir(path); +} + +int be_mkdir(const char *path) +{ + return _mkdir(path); +} + +int be_unlink(const char *filename) +{ + return remove(filename); +} + +int be_dirfirst(bdirinfo *info, const char *path) +{ + char *buf = be_os_malloc(strlen(path) + 3); + info->file = be_os_malloc(sizeof(struct _finddata_t)); + info->dir = NULL; + if (buf && info->file) { + struct _finddata_t *cfile = info->file; + strcat(strcpy(buf, path), "/*"); + info->dir = (void *)_findfirst(buf, cfile); + info->name = cfile->name; + be_os_free(buf); + return (intptr_t)info->dir == -1; + } + be_os_free(buf); + return 1; +} + +int be_dirnext(bdirinfo *info) +{ + struct _finddata_t *cfile = info->file; + int res = _findnext((intptr_t)info->dir, cfile) != 0; + info->name = cfile->name; + return res; +} + +int be_dirclose(bdirinfo *info) +{ + be_os_free(info->file); + return _findclose((intptr_t)info->dir) != 0; +} + +#else /* must be POSIX */ + +#include +#include +#include + +int be_isdir(const char *path) +{ + struct stat path_stat; + int res = stat(path, &path_stat); + return res == 0 && S_ISDIR(path_stat.st_mode); +} + +int be_isfile(const char *path) +{ + struct stat path_stat; + int res = stat(path, &path_stat); + return res == 0 && !S_ISDIR(path_stat.st_mode); +} + +int be_isexist(const char *path) +{ + struct stat path_stat; + return stat(path, &path_stat) == 0; +} + +char* be_getcwd(char *buf, size_t size) +{ + return getcwd(buf, size); +} + +int be_chdir(const char *path) +{ + return chdir(path); +} + +int be_mkdir(const char *path) +{ +#ifdef _WIN32 + return mkdir(path); +#else + return mkdir(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); +#endif +} + +int be_unlink(const char *filename) +{ + return remove(filename); +} + +int be_dirfirst(bdirinfo *info, const char *path) +{ + info->dir = opendir(path); + if (info->dir) { + return be_dirnext(info); + } + return 1; +} + +int be_dirnext(bdirinfo *info) +{ + struct dirent *file; + info->file = file = readdir(info->dir); + if (file) { + info->name = file->d_name; + return 0; + } + return 1; +} + +int be_dirclose(bdirinfo *info) +{ + return closedir(info->dir) != 0; +} + +#endif /* POSIX */ +#endif /* BE_USE_OS_MODULE || BE_USE_FILE_SYSTEM */ diff --git a/lib/libesp32/berry/default/be_python_compat.c b/lib/libesp32/berry/default/be_python_compat.c new file mode 100644 index 000000000..5b3ec64d0 --- /dev/null +++ b/lib/libesp32/berry/default/be_python_compat.c @@ -0,0 +1,58 @@ +/******************************************************************** + * Berry python compatibility module + * + * `import python_compat` + *******************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: _anonymous_ +********************************************************************/ +be_local_closure(python_compat__anonymous_, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(global), + /* K1 */ be_nested_str(True), + /* K2 */ be_nested_str(False), + /* K3 */ be_nested_str(None), + /* K4 */ be_nested_str(b), + }), + &be_const_str__anonymous_, + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x50080200, // 0001 LDBOOL R2 1 0 + 0x90060202, // 0002 SETMBR R1 K1 R2 + 0x50080000, // 0003 LDBOOL R2 0 0 + 0x90060402, // 0004 SETMBR R1 K2 R2 + 0x4C080000, // 0005 LDNIL R2 + 0x90060602, // 0006 SETMBR R1 K3 R2 + 0x60080015, // 0007 GETGBL R2 G21 + 0x90060802, // 0008 SETMBR R1 K4 R2 + 0x80040000, // 0009 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified module: python_compat +********************************************************************/ +be_local_module(python_compat, + "python_compat", + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(python_compat__anonymous__closure) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(python_compat); +/********************************************************************/ diff --git a/lib/libesp32/berry/default/be_re_lib.c b/lib/libesp32/berry/default/be_re_lib.c new file mode 100644 index 000000000..bc28c0e67 --- /dev/null +++ b/lib/libesp32/berry/default/be_re_lib.c @@ -0,0 +1,254 @@ +/******************************************************************** + * Tasmota lib + * + * To use: `import re` + * + * Regex using re1.5 + *******************************************************************/ +#include "be_constobj.h" +#include "be_mem.h" +#include "re1.5.h" + +/******************************************************************** +# Berry skeleton for `re` module +# + +class re_pattern + var _p # comobj containing the compiled bytecode for the pattern + + def search() end + def match() end + def split() end +end + +re = module("re") + +re.compile = def (regex_str) end # native +re.match = def (regex_str, str) end # native +re.search = def (regex_str, str) end # native +re.split = def (regex_str, str) end # native + + +*******************************************************************/ + +extern const bclass be_class_re_pattern; + +int be_free_comobj(bvm* vm) { + int argc = be_top(vm); + if (argc > 0) { + void * obj = be_tocomptr(vm, 1); + if (obj != NULL) { be_os_free(obj); } + } + be_return_nil(vm); +} + +// Native functions be_const_func() +// Berry: `re.compile(pattern:string) -> instance(be_pattern)` +int be_re_compile(bvm *vm) { + int32_t argc = be_top(vm); // Get the number of arguments + if (argc >= 1 && be_isstring(vm, 1)) { + const char * regex_str = be_tostring(vm, 1); + int sz = re1_5_sizecode(regex_str); + if (sz < 0) { + be_raise(vm, "internal_error", "error in regex"); + } + + ByteProg *code = be_os_malloc(sizeof(ByteProg) + sz); + int ret = re1_5_compilecode(code, regex_str); + if (ret != 0) { + be_raise(vm, "internal_error", "error in regex"); + } + be_pushntvclass(vm, &be_class_re_pattern); + be_call(vm, 0); + be_newcomobj(vm, code, &be_free_comobj); + be_setmember(vm, -2, "_p"); + be_pop(vm, 1); + be_return(vm); + } + be_raise(vm, "type_error", NULL); +} + + +int be_re_match_search_run(bvm *vm, ByteProg *code, const char *hay, bbool is_anchored) { + Subject subj = {hay, hay + strlen(hay)}; + + int sub_els = (code->sub + 1) * 2; + const char *sub[sub_els]; + + if (!re1_5_recursiveloopprog(code, &subj, sub, sub_els, is_anchored)) { + be_return_nil(vm); // no match + } + + be_newobject(vm, "list"); + int k; + for(k = sub_els; k > 0; k--) + if(sub[k-1]) + break; + for (int i = 0; i < k; i += 2) { + be_pushnstring(vm, sub[i], sub[i+1] - sub[i]); + be_data_push(vm, -2); + be_pop(vm, 1); + } + be_pop(vm, 1); // remove list + be_return(vm); // return list object +} + +int be_re_match_search(bvm *vm, bbool is_anchored) { + int32_t argc = be_top(vm); // Get the number of arguments + if (argc >= 2 && be_isstring(vm, 1) && be_isstring(vm, 2)) { + const char * regex_str = be_tostring(vm, 1); + const char * hay = be_tostring(vm, 2); + int sz = re1_5_sizecode(regex_str); + if (sz < 0) { + be_raise(vm, "internal_error", "error in regex"); + } + + ByteProg *code = be_os_malloc(sizeof(ByteProg) + sz); + int ret = re1_5_compilecode(code, regex_str); + if (ret != 0) { + be_raise(vm, "internal_error", "error in regex"); + } + return be_re_match_search_run(vm, code, hay, is_anchored); + } + be_raise(vm, "type_error", NULL); +} + +// Berry: `re.match(value:int | s:string) -> nil` +int be_re_match(bvm *vm) { + return be_re_match_search(vm, btrue); +} +// Berry: `re.search(value:int | s:string) -> nil` +int be_re_search(bvm *vm) { + return be_re_match_search(vm, bfalse); +} + +// Berry: `re_pattern.search(s:string) -> list(string)` +int re_pattern_search(bvm *vm) { + int32_t argc = be_top(vm); // Get the number of arguments + if (argc >= 2 && be_isstring(vm, 2)) { + const char * hay = be_tostring(vm, 2); + be_getmember(vm, 1, "_p"); + ByteProg * code = (ByteProg*) be_tocomptr(vm, -1); + return be_re_match_search_run(vm, code, hay, bfalse); + } + be_raise(vm, "type_error", NULL); +} + +// Berry: `re_pattern.match(s:string) -> list(string)` +int re_pattern_match(bvm *vm) { + int32_t argc = be_top(vm); // Get the number of arguments + if (argc >= 2 && be_isstring(vm, 2)) { + const char * hay = be_tostring(vm, 2); + be_getmember(vm, 1, "_p"); + ByteProg * code = (ByteProg*) be_tocomptr(vm, -1); + return be_re_match_search_run(vm, code, hay, btrue); + } + be_raise(vm, "type_error", NULL); +} + + +int re_pattern_split_run(bvm *vm, ByteProg *code, const char *hay, int split_limit) { + Subject subj = {hay, hay + strlen(hay)}; + + int sub_els = (code->sub + 1) * 2; + const char *sub[sub_els]; + + be_newobject(vm, "list"); + while (1) { + if (split_limit == 0 || !re1_5_recursiveloopprog(code, &subj, sub, sub_els, bfalse)) { + be_pushnstring(vm, subj.begin, subj.end - subj.begin); + be_data_push(vm, -2); + be_pop(vm, 1); + break; + } + + if (sub[0] == NULL || sub[1] == NULL || sub[0] == sub[1]) { + be_raise(vm, "internal_error", "can't match"); + } + be_pushnstring(vm, subj.begin, sub[0] - subj.begin); + be_data_push(vm, -2); + be_pop(vm, 1); + subj.begin = sub[1]; + split_limit--; + } + be_pop(vm, 1); // remove list + be_return(vm); // return list object +} + +// Berry: `re_pattern.split(s:string [, split_limit:int]) -> list(string)` +int re_pattern_split(bvm *vm) { + int32_t argc = be_top(vm); // Get the number of arguments + if (argc >= 2 && be_isstring(vm, 2)) { + int split_limit = -1; + if (argc >= 3) { + split_limit = be_toint(vm, 3); + } + const char * hay = be_tostring(vm, 2); + be_getmember(vm, 1, "_p"); + ByteProg * code = (ByteProg*) be_tocomptr(vm, -1); + + return re_pattern_split_run(vm, code, hay, split_limit); + } + be_raise(vm, "type_error", NULL); +} + +// Berry: `re.split(pattern:string, s:string [, split_limit:int]) -> list(string)` +int be_re_split(bvm *vm) { + int32_t argc = be_top(vm); // Get the number of arguments + if (argc >= 2 && be_isstring(vm, 1) && be_isstring(vm, 2)) { + const char * regex_str = be_tostring(vm, 1); + const char * hay = be_tostring(vm, 2); + int split_limit = -1; + if (argc >= 3) { + split_limit = be_toint(vm, 3); + } + int sz = re1_5_sizecode(regex_str); + if (sz < 0) { + be_raise(vm, "internal_error", "error in regex"); + } + + ByteProg *code = be_os_malloc(sizeof(ByteProg) + sz); + int ret = re1_5_compilecode(code, regex_str); + if (ret != 0) { + be_raise(vm, "internal_error", "error in regex"); + } + return re_pattern_split_run(vm, code, hay, split_limit); + } + be_raise(vm, "type_error", NULL); +} + +/******************************************************************** +** Solidified module: re +********************************************************************/ +be_local_module(re, + "re", + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("compile", 1000265118, 7, -1), be_const_func(be_re_compile) }, + { be_nested_key("search", -2144130903, 6, -1), be_const_func(be_re_search) }, + { be_nested_key("match", 2116038550, 5, 0), be_const_func(be_re_match) }, + { be_nested_key("split", -2017972765, 5, -1), be_const_func(be_re_split) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(re); +/********************************************************************/ + +// =================================================================== + +/******************************************************************** +** Solidified class: re_pattern +********************************************************************/ +be_local_class(re_pattern, + 1, + NULL, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("_p", 1594591802, 2, -1), be_const_var(0) }, + { be_nested_key("search", -2144130903, 6, -1), be_const_func(re_pattern_search) }, + { be_nested_key("match", 2116038550, 5, 0), be_const_func(re_pattern_match) }, + { be_nested_key("split", -2017972765, 5, -1), be_const_func(re_pattern_split) }, + })), + (be_nested_const_str("re_pattern", 2041968961, 10)) +); +/*******************************************************************/ + diff --git a/lib/libesp32/berry/default/be_serial_lib.c b/lib/libesp32/berry/default/be_serial_lib.c new file mode 100644 index 000000000..4f1c4b577 --- /dev/null +++ b/lib/libesp32/berry/default/be_serial_lib.c @@ -0,0 +1,66 @@ +/******************************************************************** + * Tasmota lib + * + * To use: `import wire` + * + * 2 wire communication - I2C + *******************************************************************/ +#include "be_constobj.h" + +#include "esp32-hal.h" + +extern int b_serial_init(bvm *vm); +extern int b_serial_deinit(bvm *vm); + +extern int b_serial_write(bvm *vm); +extern int b_serial_read(bvm *vm); +extern int b_serial_available(bvm *vm); +extern int b_serial_flush(bvm *vm); + +#include "../generate/be_fixed_be_class_tasmota_serial.h" + +void be_load_serial_lib(bvm *vm) { + be_pushntvclass(vm, &be_class_tasmota_serial); + be_setglobal(vm, "serial"); + be_pop(vm, 1); +} + +/* @const_object_info_begin + +class be_class_tasmota_serial (scope: global, name: serial) { + .p, var + + SERIAL_5N1, int(SERIAL_5N1) + SERIAL_6N1, int(SERIAL_6N1) + SERIAL_7N1, int(SERIAL_7N1) + SERIAL_8N1, int(SERIAL_8N1) + SERIAL_5N2, int(SERIAL_5N2) + SERIAL_6N2, int(SERIAL_6N2) + SERIAL_7N2, int(SERIAL_7N2) + SERIAL_8N2, int(SERIAL_8N2) + SERIAL_5E1, int(SERIAL_5E1) + SERIAL_6E1, int(SERIAL_6E1) + SERIAL_7E1, int(SERIAL_7E1) + SERIAL_8E1, int(SERIAL_8E1) + SERIAL_5E2, int(SERIAL_5E2) + SERIAL_6E2, int(SERIAL_6E2) + SERIAL_7E2, int(SERIAL_7E2) + SERIAL_8E2, int(SERIAL_8E2) + SERIAL_5O1, int(SERIAL_5O1) + SERIAL_6O1, int(SERIAL_6O1) + SERIAL_7O1, int(SERIAL_7O1) + SERIAL_8O1, int(SERIAL_8O1) + SERIAL_5O2, int(SERIAL_5O2) + SERIAL_6O2, int(SERIAL_6O2) + SERIAL_7O2, int(SERIAL_7O2) + SERIAL_8O2, int(SERIAL_8O2) + + init, func(b_serial_init) + deinit, func(b_serial_deinit) + + write, func(b_serial_write) + read, func(b_serial_read) + available, func(b_serial_available) + flush, func(b_serial_flush) +} +@const_object_info_end */ diff --git a/lib/libesp32/berry/default/be_tapp_lib.c b/lib/libesp32/berry/default/be_tapp_lib.c new file mode 100644 index 000000000..1a312d110 --- /dev/null +++ b/lib/libesp32/berry/default/be_tapp_lib.c @@ -0,0 +1,168 @@ +/******************************************************************** + * Tasmota App manager + * + * To use: `import tapp` + * + *******************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Tapp_init, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(add_driver), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C040400, // 0003 CALL R1 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: autoexec +********************************************************************/ +be_local_closure(Tapp_autoexec, /* name */ + be_nested_proto( + 12, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[15]) { /* constants */ + /* K0 */ be_nested_str(path), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(listdir), + /* K3 */ be_nested_str(_X2F), + /* K4 */ be_nested_str(find), + /* K5 */ be_nested_str(_X2Etapp), + /* K6 */ be_const_int(0), + /* K7 */ be_nested_str(tasmota), + /* K8 */ be_nested_str(log), + /* K9 */ be_nested_str(format), + /* K10 */ be_nested_str(TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27), + /* K11 */ be_const_int(2), + /* K12 */ be_nested_str(load), + /* K13 */ be_nested_str(_X23autoexec_X2Ebe), + /* K14 */ be_nested_str(stop_iteration), + }), + &be_const_str_autoexec, + &be_const_str_solidified, + ( &(const binstruction[34]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x8C0C0302, // 0002 GETMET R3 R1 K2 + 0x58140003, // 0003 LDCONST R5 K3 + 0x7C0C0400, // 0004 CALL R3 2 + 0x60100010, // 0005 GETGBL R4 G16 + 0x5C140600, // 0006 MOVE R5 R3 + 0x7C100200, // 0007 CALL R4 1 + 0xA8020014, // 0008 EXBLK 0 #001E + 0x5C140800, // 0009 MOVE R5 R4 + 0x7C140000, // 000A CALL R5 0 + 0x8C180504, // 000B GETMET R6 R2 K4 + 0x5C200A00, // 000C MOVE R8 R5 + 0x58240005, // 000D LDCONST R9 K5 + 0x7C180600, // 000E CALL R6 3 + 0x24180D06, // 000F GT R6 R6 K6 + 0x781A000B, // 0010 JMPF R6 #001D + 0xB81A0E00, // 0011 GETNGBL R6 K7 + 0x8C180D08, // 0012 GETMET R6 R6 K8 + 0x8C200509, // 0013 GETMET R8 R2 K9 + 0x5828000A, // 0014 LDCONST R10 K10 + 0x5C2C0A00, // 0015 MOVE R11 R5 + 0x7C200600, // 0016 CALL R8 3 + 0x5824000B, // 0017 LDCONST R9 K11 + 0x7C180600, // 0018 CALL R6 3 + 0xB81A0E00, // 0019 GETNGBL R6 K7 + 0x8C180D0C, // 001A GETMET R6 R6 K12 + 0x00200B0D, // 001B ADD R8 R5 K13 + 0x7C180400, // 001C CALL R6 2 + 0x7001FFEA, // 001D JMP #0009 + 0x5810000E, // 001E LDCONST R4 K14 + 0xAC100200, // 001F CATCH R4 1 0 + 0xB0080000, // 0020 RAISE 2 R0 R0 + 0x80000000, // 0021 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Tapp +********************************************************************/ +be_local_class(Tapp, + 0, + NULL, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(autoexec, -1), be_const_closure(Tapp_autoexec_closure) }, + { be_const_key(init, 0), be_const_closure(Tapp_init_closure) }, + })), + be_str_literal("Tapp") +); + +/******************************************************************** +** Solidified function: _anonymous_ +********************************************************************/ +be_local_closure(tapp__anonymous_, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_const_class(be_class_Tapp), + }), + &be_const_str__anonymous_, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x58040000, // 0000 LDCONST R1 K0 + 0xB4000000, // 0001 CLASS K0 + 0x5C080200, // 0002 MOVE R2 R1 + 0x7C080000, // 0003 CALL R2 0 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified module: tapp +********************************************************************/ +be_local_module(tapp, + "tapp", + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(tapp__anonymous__closure) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(tapp); +/********************************************************************/ diff --git a/lib/libesp32/berry/default/be_tasmotalib.c b/lib/libesp32/berry/default/be_tasmotalib.c new file mode 100644 index 000000000..6539b0de3 --- /dev/null +++ b/lib/libesp32/berry/default/be_tasmotalib.c @@ -0,0 +1,2079 @@ +/******************************************************************** + * Tasmota lib + * + * To use: `import tasmota` + *******************************************************************/ +#include "be_constobj.h" + +struct dummy_struct {}; // we need a struct name but don't need any meaningful content, we just take the address +extern struct TasmotaGlobal_t TasmotaGlobal; +extern struct TSettings * Settings; +extern struct dummy_struct be_tasmota_global_struct; +extern struct dummy_struct be_tasmota_settings_struct; + +extern int l_getFreeHeap(bvm *vm); +extern int l_arch(bvm *vm); +extern int l_publish(bvm *vm); +extern int l_publish_result(bvm *vm); +extern int l_cmd(bvm *vm); +extern int l_getoption(bvm *vm); +extern int l_millis(bvm *vm); +extern int l_timereached(bvm *vm); +extern int l_rtc(bvm *vm); +extern int l_time_dump(bvm *vm); +extern int l_strftime(bvm *vm); +extern int l_strptime(bvm *vm); +extern int l_memory(bvm *vm); +extern int l_wifi(bvm *vm); +extern int l_eth(bvm *vm); +extern int l_yield(bvm *vm); +extern int l_delay(bvm *vm); +extern int l_scaleuint(bvm *vm); +extern int l_logInfo(bvm *vm); +extern int l_save(bvm *vm); + +extern int l_read_sensors(bvm *vm); + +extern int l_respCmnd(bvm *vm); +extern int l_respCmndStr(bvm *vm); +extern int l_respCmndDone(bvm *vm); +extern int l_respCmndError(bvm *vm); +extern int l_respCmndFailed(bvm *vm); +extern int l_resolveCmnd(bvm *vm); + +extern int l_respAppend(bvm *vm); +extern int l_webSend(bvm *vm); +extern int l_webSendDecimal(bvm *vm); + +extern int l_getlight(bvm *vm); +extern int l_setlight(bvm *vm); +extern int l_getpower(bvm *vm); +extern int l_setpower(bvm *vm); +extern int l_getswitch(bvm *vm); + +extern int l_i2cenabled(bvm *vm); + + +/******************************************************************** +** Solidified function: add_driver +********************************************************************/ +be_local_closure(Tasmota_add_driver, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(_drivers), + /* K1 */ be_nested_str(push), + }), + &be_const_str_add_driver, + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A0004, // 0001 JMPF R2 #0007 + 0x88080100, // 0002 GETMBR R2 R0 K0 + 0x8C080501, // 0003 GETMET R2 R2 K1 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x70020003, // 0006 JMP #000B + 0x60080012, // 0007 GETGBL R2 G18 + 0x7C080000, // 0008 CALL R2 0 + 0x400C0401, // 0009 CONNECT R3 R2 R1 + 0x90020002, // 000A SETMBR R0 K0 R2 + 0x80000000, // 000B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: gc +********************************************************************/ +be_local_closure(Tasmota_gc, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(gc), + /* K1 */ be_nested_str(collect), + /* K2 */ be_nested_str(allocated), + }), + &be_const_str_gc, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080302, // 0003 GETMET R2 R1 K2 + 0x7C080200, // 0004 CALL R2 1 + 0x80040400, // 0005 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: find_op +********************************************************************/ +be_local_closure(Tasmota_find_op, /* name */ + be_nested_proto( + 13, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(_X3D_X3C_X3E_X21), + /* K2 */ be_nested_str(chars_in_string), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str(split), + /* K5 */ be_const_int(1), + }), + &be_const_str_find_op, + &be_const_str_solidified, + ( &(const binstruction[42]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x580C0001, // 0001 LDCONST R3 K1 + 0x8C100102, // 0002 GETMET R4 R0 K2 + 0x5C180200, // 0003 MOVE R6 R1 + 0x5C1C0600, // 0004 MOVE R7 R3 + 0x7C100600, // 0005 CALL R4 3 + 0x28140903, // 0006 GE R5 R4 K3 + 0x78160019, // 0007 JMPF R5 #0022 + 0x8C140504, // 0008 GETMET R5 R2 K4 + 0x5C1C0200, // 0009 MOVE R7 R1 + 0x5C200800, // 000A MOVE R8 R4 + 0x7C140600, // 000B CALL R5 3 + 0x94180B03, // 000C GETIDX R6 R5 K3 + 0x941C0B05, // 000D GETIDX R7 R5 K5 + 0x8C200102, // 000E GETMET R8 R0 K2 + 0x5C280E00, // 000F MOVE R10 R7 + 0x5C2C0600, // 0010 MOVE R11 R3 + 0x50300200, // 0011 LDBOOL R12 1 0 + 0x7C200800, // 0012 CALL R8 4 + 0x5C101000, // 0013 MOVE R4 R8 + 0x28200903, // 0014 GE R8 R4 K3 + 0x7822000B, // 0015 JMPF R8 #0022 + 0x8C200504, // 0016 GETMET R8 R2 K4 + 0x5C280E00, // 0017 MOVE R10 R7 + 0x5C2C0800, // 0018 MOVE R11 R4 + 0x7C200600, // 0019 CALL R8 3 + 0x94241103, // 001A GETIDX R9 R8 K3 + 0x94281105, // 001B GETIDX R10 R8 K5 + 0x602C0012, // 001C GETGBL R11 G18 + 0x7C2C0000, // 001D CALL R11 0 + 0x40301606, // 001E CONNECT R12 R11 R6 + 0x40301609, // 001F CONNECT R12 R11 R9 + 0x4030160A, // 0020 CONNECT R12 R11 R10 + 0x80041600, // 0021 RET 1 R11 + 0x60140012, // 0022 GETGBL R5 G18 + 0x7C140000, // 0023 CALL R5 0 + 0x40180A01, // 0024 CONNECT R6 R5 R1 + 0x4C180000, // 0025 LDNIL R6 + 0x40180A06, // 0026 CONNECT R6 R5 R6 + 0x4C180000, // 0027 LDNIL R6 + 0x40180A06, // 0028 CONNECT R6 R5 R6 + 0x80040A00, // 0029 RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: try_rule +********************************************************************/ +be_local_closure(Tasmota_try_rule, /* name */ + be_nested_proto( + 15, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[16]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(find_op), + /* K2 */ be_nested_str(split), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str(_X23), + /* K5 */ be_nested_str(find_key_i), + /* K6 */ be_const_int(1), + /* K7 */ be_const_int(2), + /* K8 */ be_nested_str(_X3D_X3D), + /* K9 */ be_nested_str(_X21_X3D_X3D), + /* K10 */ be_nested_str(_X3D), + /* K11 */ be_nested_str(_X21_X3D), + /* K12 */ be_nested_str(_X3E), + /* K13 */ be_nested_str(_X3E_X3D), + /* K14 */ be_nested_str(_X3C), + /* K15 */ be_nested_str(_X3C_X3D), + }), + &be_const_str_try_rule, + &be_const_str_solidified, + ( &(const binstruction[141]) { /* code */ + 0xA4120000, // 0000 IMPORT R4 K0 + 0x8C140101, // 0001 GETMET R5 R0 K1 + 0x5C1C0400, // 0002 MOVE R7 R2 + 0x7C140400, // 0003 CALL R5 2 + 0x5C180200, // 0004 MOVE R6 R1 + 0x8C1C0902, // 0005 GETMET R7 R4 K2 + 0x94240B03, // 0006 GETIDX R9 R5 K3 + 0x58280004, // 0007 LDCONST R10 K4 + 0x7C1C0600, // 0008 CALL R7 3 + 0x58200003, // 0009 LDCONST R8 K3 + 0x6024000C, // 000A GETGBL R9 G12 + 0x5C280E00, // 000B MOVE R10 R7 + 0x7C240200, // 000C CALL R9 1 + 0x14241009, // 000D LT R9 R8 R9 + 0x7826000C, // 000E JMPF R9 #001C + 0x94240E08, // 000F GETIDX R9 R7 R8 + 0x8C280105, // 0010 GETMET R10 R0 K5 + 0x5C300C00, // 0011 MOVE R12 R6 + 0x5C341200, // 0012 MOVE R13 R9 + 0x7C280600, // 0013 CALL R10 3 + 0x4C2C0000, // 0014 LDNIL R11 + 0x1C2C140B, // 0015 EQ R11 R10 R11 + 0x782E0001, // 0016 JMPF R11 #0019 + 0x502C0000, // 0017 LDBOOL R11 0 0 + 0x80041600, // 0018 RET 1 R11 + 0x94180C0A, // 0019 GETIDX R6 R6 R10 + 0x00201106, // 001A ADD R8 R8 K6 + 0x7001FFED, // 001B JMP #000A + 0x94240B06, // 001C GETIDX R9 R5 K6 + 0x94280B07, // 001D GETIDX R10 R5 K7 + 0x78260066, // 001E JMPF R9 #0086 + 0x1C2C1308, // 001F EQ R11 R9 K8 + 0x782E000A, // 0020 JMPF R11 #002C + 0x602C0008, // 0021 GETGBL R11 G8 + 0x5C300C00, // 0022 MOVE R12 R6 + 0x7C2C0200, // 0023 CALL R11 1 + 0x60300008, // 0024 GETGBL R12 G8 + 0x5C341400, // 0025 MOVE R13 R10 + 0x7C300200, // 0026 CALL R12 1 + 0x202C160C, // 0027 NE R11 R11 R12 + 0x782E0001, // 0028 JMPF R11 #002B + 0x502C0000, // 0029 LDBOOL R11 0 0 + 0x80041600, // 002A RET 1 R11 + 0x70020059, // 002B JMP #0086 + 0x1C2C1309, // 002C EQ R11 R9 K9 + 0x782E000A, // 002D JMPF R11 #0039 + 0x602C0008, // 002E GETGBL R11 G8 + 0x5C300C00, // 002F MOVE R12 R6 + 0x7C2C0200, // 0030 CALL R11 1 + 0x60300008, // 0031 GETGBL R12 G8 + 0x5C341400, // 0032 MOVE R13 R10 + 0x7C300200, // 0033 CALL R12 1 + 0x1C2C160C, // 0034 EQ R11 R11 R12 + 0x782E0001, // 0035 JMPF R11 #0038 + 0x502C0000, // 0036 LDBOOL R11 0 0 + 0x80041600, // 0037 RET 1 R11 + 0x7002004C, // 0038 JMP #0086 + 0x1C2C130A, // 0039 EQ R11 R9 K10 + 0x782E000A, // 003A JMPF R11 #0046 + 0x602C000A, // 003B GETGBL R11 G10 + 0x5C300C00, // 003C MOVE R12 R6 + 0x7C2C0200, // 003D CALL R11 1 + 0x6030000A, // 003E GETGBL R12 G10 + 0x5C341400, // 003F MOVE R13 R10 + 0x7C300200, // 0040 CALL R12 1 + 0x202C160C, // 0041 NE R11 R11 R12 + 0x782E0001, // 0042 JMPF R11 #0045 + 0x502C0000, // 0043 LDBOOL R11 0 0 + 0x80041600, // 0044 RET 1 R11 + 0x7002003F, // 0045 JMP #0086 + 0x1C2C130B, // 0046 EQ R11 R9 K11 + 0x782E000A, // 0047 JMPF R11 #0053 + 0x602C000A, // 0048 GETGBL R11 G10 + 0x5C300C00, // 0049 MOVE R12 R6 + 0x7C2C0200, // 004A CALL R11 1 + 0x6030000A, // 004B GETGBL R12 G10 + 0x5C341400, // 004C MOVE R13 R10 + 0x7C300200, // 004D CALL R12 1 + 0x1C2C160C, // 004E EQ R11 R11 R12 + 0x782E0001, // 004F JMPF R11 #0052 + 0x502C0000, // 0050 LDBOOL R11 0 0 + 0x80041600, // 0051 RET 1 R11 + 0x70020032, // 0052 JMP #0086 + 0x1C2C130C, // 0053 EQ R11 R9 K12 + 0x782E000A, // 0054 JMPF R11 #0060 + 0x602C000A, // 0055 GETGBL R11 G10 + 0x5C300C00, // 0056 MOVE R12 R6 + 0x7C2C0200, // 0057 CALL R11 1 + 0x6030000A, // 0058 GETGBL R12 G10 + 0x5C341400, // 0059 MOVE R13 R10 + 0x7C300200, // 005A CALL R12 1 + 0x182C160C, // 005B LE R11 R11 R12 + 0x782E0001, // 005C JMPF R11 #005F + 0x502C0000, // 005D LDBOOL R11 0 0 + 0x80041600, // 005E RET 1 R11 + 0x70020025, // 005F JMP #0086 + 0x1C2C130D, // 0060 EQ R11 R9 K13 + 0x782E000A, // 0061 JMPF R11 #006D + 0x602C000A, // 0062 GETGBL R11 G10 + 0x5C300C00, // 0063 MOVE R12 R6 + 0x7C2C0200, // 0064 CALL R11 1 + 0x6030000A, // 0065 GETGBL R12 G10 + 0x5C341400, // 0066 MOVE R13 R10 + 0x7C300200, // 0067 CALL R12 1 + 0x142C160C, // 0068 LT R11 R11 R12 + 0x782E0001, // 0069 JMPF R11 #006C + 0x502C0000, // 006A LDBOOL R11 0 0 + 0x80041600, // 006B RET 1 R11 + 0x70020018, // 006C JMP #0086 + 0x1C2C130E, // 006D EQ R11 R9 K14 + 0x782E000A, // 006E JMPF R11 #007A + 0x602C000A, // 006F GETGBL R11 G10 + 0x5C300C00, // 0070 MOVE R12 R6 + 0x7C2C0200, // 0071 CALL R11 1 + 0x6030000A, // 0072 GETGBL R12 G10 + 0x5C341400, // 0073 MOVE R13 R10 + 0x7C300200, // 0074 CALL R12 1 + 0x282C160C, // 0075 GE R11 R11 R12 + 0x782E0001, // 0076 JMPF R11 #0079 + 0x502C0000, // 0077 LDBOOL R11 0 0 + 0x80041600, // 0078 RET 1 R11 + 0x7002000B, // 0079 JMP #0086 + 0x1C2C130F, // 007A EQ R11 R9 K15 + 0x782E0009, // 007B JMPF R11 #0086 + 0x602C000A, // 007C GETGBL R11 G10 + 0x5C300C00, // 007D MOVE R12 R6 + 0x7C2C0200, // 007E CALL R11 1 + 0x6030000A, // 007F GETGBL R12 G10 + 0x5C341400, // 0080 MOVE R13 R10 + 0x7C300200, // 0081 CALL R12 1 + 0x242C160C, // 0082 GT R11 R11 R12 + 0x782E0001, // 0083 JMPF R11 #0086 + 0x502C0000, // 0084 LDBOOL R11 0 0 + 0x80041600, // 0085 RET 1 R11 + 0x5C2C0600, // 0086 MOVE R11 R3 + 0x5C300C00, // 0087 MOVE R12 R6 + 0x94340B03, // 0088 GETIDX R13 R5 K3 + 0x5C380200, // 0089 MOVE R14 R1 + 0x7C2C0600, // 008A CALL R11 3 + 0x502C0200, // 008B LDBOOL R11 1 0 + 0x80041600, // 008C RET 1 R11 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: gen_cb +********************************************************************/ +be_local_closure(Tasmota_gen_cb, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(cb), + /* K1 */ be_nested_str(gen_cb), + }), + &be_const_str_gen_cb, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x8C0C0501, // 0001 GETMET R3 R2 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x80040600, // 0004 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_light +********************************************************************/ +be_local_closure(Tasmota_set_light, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29), + /* K1 */ be_nested_str(light), + /* K2 */ be_nested_str(set), + }), + &be_const_str_set_light, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x600C0001, // 0000 GETGBL R3 G1 + 0x58100000, // 0001 LDCONST R4 K0 + 0x7C0C0200, // 0002 CALL R3 1 + 0xA40E0200, // 0003 IMPORT R3 K1 + 0x4C100000, // 0004 LDNIL R4 + 0x20100404, // 0005 NE R4 R2 R4 + 0x78120005, // 0006 JMPF R4 #000D + 0x8C100702, // 0007 GETMET R4 R3 K2 + 0x5C180200, // 0008 MOVE R6 R1 + 0x5C1C0400, // 0009 MOVE R7 R2 + 0x7C100600, // 000A CALL R4 3 + 0x80040800, // 000B RET 1 R4 + 0x70020003, // 000C JMP #0011 + 0x8C100702, // 000D GETMET R4 R3 K2 + 0x5C180200, // 000E MOVE R6 R1 + 0x7C100400, // 000F CALL R4 2 + 0x80040800, // 0010 RET 1 R4 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: exec_tele +********************************************************************/ +be_local_closure(Tasmota_exec_tele, /* name */ + be_nested_proto( + 12, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str(_rules), + /* K1 */ be_nested_str(json), + /* K2 */ be_nested_str(load), + /* K3 */ be_nested_str(log), + /* K4 */ be_nested_str(BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20), + /* K5 */ be_const_int(3), + /* K6 */ be_nested_str(Tele), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str(try_rule), + /* K9 */ be_nested_str(k), + /* K10 */ be_nested_str(v), + /* K11 */ be_const_int(1), + }), + &be_const_str_exec_tele, + &be_const_str_solidified, + ( &(const binstruction[41]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A0024, // 0001 JMPF R2 #0027 + 0xA40A0200, // 0002 IMPORT R2 K1 + 0x8C0C0502, // 0003 GETMET R3 R2 K2 + 0x5C140200, // 0004 MOVE R5 R1 + 0x7C0C0400, // 0005 CALL R3 2 + 0x50100000, // 0006 LDBOOL R4 0 0 + 0x4C140000, // 0007 LDNIL R5 + 0x1C140605, // 0008 EQ R5 R3 R5 + 0x78160004, // 0009 JMPF R5 #000F + 0x8C140103, // 000A GETMET R5 R0 K3 + 0x001E0801, // 000B ADD R7 K4 R1 + 0x58200005, // 000C LDCONST R8 K5 + 0x7C140600, // 000D CALL R5 3 + 0x5C0C0200, // 000E MOVE R3 R1 + 0x60140013, // 000F GETGBL R5 G19 + 0x7C140000, // 0010 CALL R5 0 + 0x98160C03, // 0011 SETIDX R5 K6 R3 + 0x5C0C0A00, // 0012 MOVE R3 R5 + 0x58140007, // 0013 LDCONST R5 K7 + 0x6018000C, // 0014 GETGBL R6 G12 + 0x881C0100, // 0015 GETMBR R7 R0 K0 + 0x7C180200, // 0016 CALL R6 1 + 0x14180A06, // 0017 LT R6 R5 R6 + 0x781A000C, // 0018 JMPF R6 #0026 + 0x88180100, // 0019 GETMBR R6 R0 K0 + 0x94180C05, // 001A GETIDX R6 R6 R5 + 0x8C1C0108, // 001B GETMET R7 R0 K8 + 0x5C240600, // 001C MOVE R9 R3 + 0x88280D09, // 001D GETMBR R10 R6 K9 + 0x882C0D0A, // 001E GETMBR R11 R6 K10 + 0x7C1C0800, // 001F CALL R7 4 + 0x741E0001, // 0020 JMPT R7 #0023 + 0x74120000, // 0021 JMPT R4 #0023 + 0x50100001, // 0022 LDBOOL R4 0 1 + 0x50100200, // 0023 LDBOOL R4 1 0 + 0x00140B0B, // 0024 ADD R5 R5 K11 + 0x7001FFED, // 0025 JMP #0014 + 0x80040800, // 0026 RET 1 R4 + 0x50080000, // 0027 LDBOOL R2 0 0 + 0x80040400, // 0028 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: run_deferred +********************************************************************/ +be_local_closure(Tasmota_run_deferred, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str(_timers), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(size), + /* K3 */ be_nested_str(time_reached), + /* K4 */ be_nested_str(due), + /* K5 */ be_nested_str(f), + /* K6 */ be_nested_str(remove), + /* K7 */ be_const_int(1), + }), + &be_const_str_run_deferred, + &be_const_str_solidified, + ( &(const binstruction[27]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x78060017, // 0001 JMPF R1 #001A + 0x58040001, // 0002 LDCONST R1 K1 + 0x88080100, // 0003 GETMBR R2 R0 K0 + 0x8C080502, // 0004 GETMET R2 R2 K2 + 0x7C080200, // 0005 CALL R2 1 + 0x14080202, // 0006 LT R2 R1 R2 + 0x780A0011, // 0007 JMPF R2 #001A + 0x8C080103, // 0008 GETMET R2 R0 K3 + 0x88100100, // 0009 GETMBR R4 R0 K0 + 0x94100801, // 000A GETIDX R4 R4 R1 + 0x88100904, // 000B GETMBR R4 R4 K4 + 0x7C080400, // 000C CALL R2 2 + 0x780A0009, // 000D JMPF R2 #0018 + 0x88080100, // 000E GETMBR R2 R0 K0 + 0x94080401, // 000F GETIDX R2 R2 R1 + 0x88080505, // 0010 GETMBR R2 R2 K5 + 0x880C0100, // 0011 GETMBR R3 R0 K0 + 0x8C0C0706, // 0012 GETMET R3 R3 K6 + 0x5C140200, // 0013 MOVE R5 R1 + 0x7C0C0400, // 0014 CALL R3 2 + 0x5C0C0400, // 0015 MOVE R3 R2 + 0x7C0C0000, // 0016 CALL R3 0 + 0x70020000, // 0017 JMP #0019 + 0x00040307, // 0018 ADD R1 R1 K7 + 0x7001FFE8, // 0019 JMP #0003 + 0x80000000, // 001A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_driver +********************************************************************/ +be_local_closure(Tasmota_remove_driver, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(_drivers), + /* K1 */ be_nested_str(find), + /* K2 */ be_nested_str(pop), + }), + &be_const_str_remove_driver, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A000A, // 0001 JMPF R2 #000D + 0x88080100, // 0002 GETMBR R2 R0 K0 + 0x8C080501, // 0003 GETMET R2 R2 K1 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x4C0C0000, // 0006 LDNIL R3 + 0x200C0403, // 0007 NE R3 R2 R3 + 0x780E0003, // 0008 JMPF R3 #000D + 0x880C0100, // 0009 GETMBR R3 R0 K0 + 0x8C0C0702, // 000A GETMET R3 R3 K2 + 0x5C140400, // 000B MOVE R5 R2 + 0x7C0C0400, // 000C CALL R3 2 + 0x80000000, // 000D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: event +********************************************************************/ +be_local_closure(Tasmota_event, /* name */ + be_nested_proto( + 20, /* nstack */ + 6, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[23]) { /* constants */ + /* K0 */ be_nested_str(introspect), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(every_50ms), + /* K3 */ be_nested_str(run_deferred), + /* K4 */ be_nested_str(cmd), + /* K5 */ be_nested_str(exec_cmd), + /* K6 */ be_nested_str(tele), + /* K7 */ be_nested_str(exec_tele), + /* K8 */ be_nested_str(rule), + /* K9 */ be_nested_str(exec_rules), + /* K10 */ be_nested_str(gc), + /* K11 */ be_nested_str(_drivers), + /* K12 */ be_const_int(0), + /* K13 */ be_nested_str(get), + /* K14 */ be_nested_str(function), + /* K15 */ be_nested_str(format), + /* K16 */ be_nested_str(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s), + /* K17 */ be_nested_str(debug), + /* K18 */ be_nested_str(traceback), + /* K19 */ be_const_int(1), + /* K20 */ be_nested_str(save_before_restart), + /* K21 */ be_nested_str(persist), + /* K22 */ be_nested_str(save), + }), + &be_const_str_event, + &be_const_str_solidified, + ( &(const binstruction[91]) { /* code */ + 0xA41A0000, // 0000 IMPORT R6 K0 + 0xA41E0200, // 0001 IMPORT R7 K1 + 0x1C200302, // 0002 EQ R8 R1 K2 + 0x78220001, // 0003 JMPF R8 #0006 + 0x8C200103, // 0004 GETMET R8 R0 K3 + 0x7C200200, // 0005 CALL R8 1 + 0x50200000, // 0006 LDBOOL R8 0 0 + 0x1C240304, // 0007 EQ R9 R1 K4 + 0x78260006, // 0008 JMPF R9 #0010 + 0x8C240105, // 0009 GETMET R9 R0 K5 + 0x5C2C0400, // 000A MOVE R11 R2 + 0x5C300600, // 000B MOVE R12 R3 + 0x5C340800, // 000C MOVE R13 R4 + 0x7C240800, // 000D CALL R9 4 + 0x80041200, // 000E RET 1 R9 + 0x70020044, // 000F JMP #0055 + 0x1C240306, // 0010 EQ R9 R1 K6 + 0x78260004, // 0011 JMPF R9 #0017 + 0x8C240107, // 0012 GETMET R9 R0 K7 + 0x5C2C0800, // 0013 MOVE R11 R4 + 0x7C240400, // 0014 CALL R9 2 + 0x80041200, // 0015 RET 1 R9 + 0x7002003D, // 0016 JMP #0055 + 0x1C240308, // 0017 EQ R9 R1 K8 + 0x78260004, // 0018 JMPF R9 #001E + 0x8C240109, // 0019 GETMET R9 R0 K9 + 0x5C2C0800, // 001A MOVE R11 R4 + 0x7C240400, // 001B CALL R9 2 + 0x80041200, // 001C RET 1 R9 + 0x70020036, // 001D JMP #0055 + 0x1C24030A, // 001E EQ R9 R1 K10 + 0x78260003, // 001F JMPF R9 #0024 + 0x8C24010A, // 0020 GETMET R9 R0 K10 + 0x7C240200, // 0021 CALL R9 1 + 0x80041200, // 0022 RET 1 R9 + 0x70020030, // 0023 JMP #0055 + 0x8824010B, // 0024 GETMBR R9 R0 K11 + 0x7826002E, // 0025 JMPF R9 #0055 + 0x5824000C, // 0026 LDCONST R9 K12 + 0x6028000C, // 0027 GETGBL R10 G12 + 0x882C010B, // 0028 GETMBR R11 R0 K11 + 0x7C280200, // 0029 CALL R10 1 + 0x1428120A, // 002A LT R10 R9 R10 + 0x782A0028, // 002B JMPF R10 #0055 + 0x8828010B, // 002C GETMBR R10 R0 K11 + 0x94281409, // 002D GETIDX R10 R10 R9 + 0x8C2C0D0D, // 002E GETMET R11 R6 K13 + 0x5C341400, // 002F MOVE R13 R10 + 0x5C380200, // 0030 MOVE R14 R1 + 0x7C2C0600, // 0031 CALL R11 3 + 0x60300004, // 0032 GETGBL R12 G4 + 0x5C341600, // 0033 MOVE R13 R11 + 0x7C300200, // 0034 CALL R12 1 + 0x1C30190E, // 0035 EQ R12 R12 K14 + 0x7832001B, // 0036 JMPF R12 #0053 + 0xA802000C, // 0037 EXBLK 0 #0045 + 0x5C301600, // 0038 MOVE R12 R11 + 0x5C341400, // 0039 MOVE R13 R10 + 0x5C380400, // 003A MOVE R14 R2 + 0x5C3C0600, // 003B MOVE R15 R3 + 0x5C400800, // 003C MOVE R16 R4 + 0x5C440A00, // 003D MOVE R17 R5 + 0x7C300A00, // 003E CALL R12 5 + 0x5C201800, // 003F MOVE R8 R12 + 0x78220001, // 0040 JMPF R8 #0043 + 0xA8040001, // 0041 EXBLK 1 1 + 0x70020011, // 0042 JMP #0055 + 0xA8040001, // 0043 EXBLK 1 1 + 0x7002000D, // 0044 JMP #0053 + 0xAC300002, // 0045 CATCH R12 0 2 + 0x7002000A, // 0046 JMP #0052 + 0x60380001, // 0047 GETGBL R14 G1 + 0x8C3C0F0F, // 0048 GETMET R15 R7 K15 + 0x58440010, // 0049 LDCONST R17 K16 + 0x5C481800, // 004A MOVE R18 R12 + 0x5C4C1A00, // 004B MOVE R19 R13 + 0x7C3C0800, // 004C CALL R15 4 + 0x7C380200, // 004D CALL R14 1 + 0xA43A2200, // 004E IMPORT R14 K17 + 0x8C3C1D12, // 004F GETMET R15 R14 K18 + 0x7C3C0200, // 0050 CALL R15 1 + 0x70020000, // 0051 JMP #0053 + 0xB0080000, // 0052 RAISE 2 R0 R0 + 0x00241313, // 0053 ADD R9 R9 K19 + 0x7001FFD1, // 0054 JMP #0027 + 0x1C240314, // 0055 EQ R9 R1 K20 + 0x78260002, // 0056 JMPF R9 #005A + 0xA4262A00, // 0057 IMPORT R9 K21 + 0x8C281316, // 0058 GETMET R10 R9 K22 + 0x7C280200, // 0059 CALL R10 1 + 0x80041000, // 005A RET 1 R8 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: find_key_i +********************************************************************/ +be_local_closure(Tasmota_find_key_i, /* name */ + be_nested_proto( + 10, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(toupper), + /* K2 */ be_nested_str(keys), + /* K3 */ be_nested_str(_X3F), + /* K4 */ be_nested_str(stop_iteration), + }), + &be_const_str_find_key_i, + &be_const_str_solidified, + ( &(const binstruction[30]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0x8C100701, // 0001 GETMET R4 R3 K1 + 0x5C180400, // 0002 MOVE R6 R2 + 0x7C100400, // 0003 CALL R4 2 + 0x6014000F, // 0004 GETGBL R5 G15 + 0x5C180200, // 0005 MOVE R6 R1 + 0x601C0013, // 0006 GETGBL R7 G19 + 0x7C140400, // 0007 CALL R5 2 + 0x78160013, // 0008 JMPF R5 #001D + 0x60140010, // 0009 GETGBL R5 G16 + 0x8C180302, // 000A GETMET R6 R1 K2 + 0x7C180200, // 000B CALL R6 1 + 0x7C140200, // 000C CALL R5 1 + 0xA802000B, // 000D EXBLK 0 #001A + 0x5C180A00, // 000E MOVE R6 R5 + 0x7C180000, // 000F CALL R6 0 + 0x8C1C0701, // 0010 GETMET R7 R3 K1 + 0x5C240C00, // 0011 MOVE R9 R6 + 0x7C1C0400, // 0012 CALL R7 2 + 0x1C1C0E04, // 0013 EQ R7 R7 R4 + 0x741E0001, // 0014 JMPT R7 #0017 + 0x1C1C0503, // 0015 EQ R7 R2 K3 + 0x781E0001, // 0016 JMPF R7 #0019 + 0xA8040001, // 0017 EXBLK 1 1 + 0x80040C00, // 0018 RET 1 R6 + 0x7001FFF3, // 0019 JMP #000E + 0x58140004, // 001A LDCONST R5 K4 + 0xAC140200, // 001B CATCH R5 1 0 + 0xB0080000, // 001C RAISE 2 R0 R0 + 0x80000000, // 001D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: wire_scan +********************************************************************/ +be_local_closure(Tasmota_wire_scan, /* name */ + be_nested_proto( + 6, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(i2c_enabled), + /* K1 */ be_nested_str(wire1), + /* K2 */ be_nested_str(enabled), + /* K3 */ be_nested_str(detect), + /* K4 */ be_nested_str(wire2), + }), + &be_const_str_wire_scan, + &be_const_str_solidified, + ( &(const binstruction[33]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x200C0403, // 0001 NE R3 R2 R3 + 0x780E0005, // 0002 JMPF R3 #0009 + 0x8C0C0100, // 0003 GETMET R3 R0 K0 + 0x5C140400, // 0004 MOVE R5 R2 + 0x7C0C0400, // 0005 CALL R3 2 + 0x740E0001, // 0006 JMPT R3 #0009 + 0x4C0C0000, // 0007 LDNIL R3 + 0x80040600, // 0008 RET 1 R3 + 0x880C0101, // 0009 GETMBR R3 R0 K1 + 0x8C0C0702, // 000A GETMET R3 R3 K2 + 0x7C0C0200, // 000B CALL R3 1 + 0x780E0006, // 000C JMPF R3 #0014 + 0x880C0101, // 000D GETMBR R3 R0 K1 + 0x8C0C0703, // 000E GETMET R3 R3 K3 + 0x5C140200, // 000F MOVE R5 R1 + 0x7C0C0400, // 0010 CALL R3 2 + 0x780E0001, // 0011 JMPF R3 #0014 + 0x880C0101, // 0012 GETMBR R3 R0 K1 + 0x80040600, // 0013 RET 1 R3 + 0x880C0104, // 0014 GETMBR R3 R0 K4 + 0x8C0C0702, // 0015 GETMET R3 R3 K2 + 0x7C0C0200, // 0016 CALL R3 1 + 0x780E0006, // 0017 JMPF R3 #001F + 0x880C0104, // 0018 GETMBR R3 R0 K4 + 0x8C0C0703, // 0019 GETMET R3 R3 K3 + 0x5C140200, // 001A MOVE R5 R1 + 0x7C0C0400, // 001B CALL R3 2 + 0x780E0001, // 001C JMPF R3 #001F + 0x880C0104, // 001D GETMBR R3 R0 K4 + 0x80040600, // 001E RET 1 R3 + 0x4C0C0000, // 001F LDNIL R3 + 0x80040600, // 0020 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Tasmota_init, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[15]) { /* constants */ + /* K0 */ be_nested_str(global), + /* K1 */ be_nested_str(ctypes_bytes_dyn), + /* K2 */ be_nested_str(_global_addr), + /* K3 */ be_nested_str(_global_def), + /* K4 */ be_nested_str(introspect), + /* K5 */ be_nested_str(_settings_ptr), + /* K6 */ be_nested_str(get), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str(settings), + /* K9 */ be_nested_str(toptr), + /* K10 */ be_nested_str(_settings_def), + /* K11 */ be_nested_str(wd), + /* K12 */ be_nested_str(), + /* K13 */ be_nested_str(_debug_present), + /* K14 */ be_nested_str(debug), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[36]) { /* code */ + 0xB8060200, // 0000 GETNGBL R1 K1 + 0x88080102, // 0001 GETMBR R2 R0 K2 + 0x880C0103, // 0002 GETMBR R3 R0 K3 + 0x7C040400, // 0003 CALL R1 2 + 0x90020001, // 0004 SETMBR R0 K0 R1 + 0xA4060800, // 0005 IMPORT R1 K4 + 0x60080015, // 0006 GETGBL R2 G21 + 0x880C0105, // 0007 GETMBR R3 R0 K5 + 0x54120003, // 0008 LDINT R4 4 + 0x7C080400, // 0009 CALL R2 2 + 0x8C080506, // 000A GETMET R2 R2 K6 + 0x58100007, // 000B LDCONST R4 K7 + 0x54160003, // 000C LDINT R5 4 + 0x7C080600, // 000D CALL R2 3 + 0x780A0006, // 000E JMPF R2 #0016 + 0xB80E0200, // 000F GETNGBL R3 K1 + 0x8C100309, // 0010 GETMET R4 R1 K9 + 0x5C180400, // 0011 MOVE R6 R2 + 0x7C100400, // 0012 CALL R4 2 + 0x8814010A, // 0013 GETMBR R5 R0 K10 + 0x7C0C0400, // 0014 CALL R3 2 + 0x90021003, // 0015 SETMBR R0 K8 R3 + 0x9002170C, // 0016 SETMBR R0 K11 K12 + 0x500C0000, // 0017 LDBOOL R3 0 0 + 0x90021A03, // 0018 SETMBR R0 K13 R3 + 0xA8020004, // 0019 EXBLK 0 #001F + 0xA40E1C00, // 001A IMPORT R3 K14 + 0x50100200, // 001B LDBOOL R4 1 0 + 0x90021A04, // 001C SETMBR R0 K13 R4 + 0xA8040001, // 001D EXBLK 1 1 + 0x70020003, // 001E JMP #0023 + 0xAC0C0000, // 001F CATCH R3 0 0 + 0x70020000, // 0020 JMP #0022 + 0x70020000, // 0021 JMP #0023 + 0xB0080000, // 0022 RAISE 2 R0 R0 + 0x80000000, // 0023 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: time_str +********************************************************************/ +be_local_closure(Tasmota_time_str, /* name */ + be_nested_proto( + 13, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(time_dump), + /* K2 */ be_nested_str(format), + /* K3 */ be_nested_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d), + /* K4 */ be_nested_str(year), + /* K5 */ be_nested_str(month), + /* K6 */ be_nested_str(day), + /* K7 */ be_nested_str(hour), + /* K8 */ be_nested_str(min), + /* K9 */ be_nested_str(sec), + }), + &be_const_str_time_str, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x8C0C0101, // 0001 GETMET R3 R0 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x8C100502, // 0004 GETMET R4 R2 K2 + 0x58180003, // 0005 LDCONST R6 K3 + 0x941C0704, // 0006 GETIDX R7 R3 K4 + 0x94200705, // 0007 GETIDX R8 R3 K5 + 0x94240706, // 0008 GETIDX R9 R3 K6 + 0x94280707, // 0009 GETIDX R10 R3 K7 + 0x942C0708, // 000A GETIDX R11 R3 K8 + 0x94300709, // 000B GETIDX R12 R3 K9 + 0x7C101000, // 000C CALL R4 8 + 0x80040800, // 000D RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_rule +********************************************************************/ +be_local_closure(Tasmota_remove_rule, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(_rules), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(k), + /* K3 */ be_nested_str(remove), + /* K4 */ be_const_int(1), + }), + &be_const_str_remove_rule, + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A0011, // 0001 JMPF R2 #0014 + 0x58080001, // 0002 LDCONST R2 K1 + 0x600C000C, // 0003 GETGBL R3 G12 + 0x88100100, // 0004 GETMBR R4 R0 K0 + 0x7C0C0200, // 0005 CALL R3 1 + 0x140C0403, // 0006 LT R3 R2 R3 + 0x780E000B, // 0007 JMPF R3 #0014 + 0x880C0100, // 0008 GETMBR R3 R0 K0 + 0x940C0602, // 0009 GETIDX R3 R3 R2 + 0x880C0702, // 000A GETMBR R3 R3 K2 + 0x1C0C0601, // 000B EQ R3 R3 R1 + 0x780E0004, // 000C JMPF R3 #0012 + 0x880C0100, // 000D GETMBR R3 R0 K0 + 0x8C0C0703, // 000E GETMET R3 R3 K3 + 0x5C140400, // 000F MOVE R5 R2 + 0x7C0C0400, // 0010 CALL R3 2 + 0x70020000, // 0011 JMP #0013 + 0x00080504, // 0012 ADD R2 R2 K4 + 0x7001FFEE, // 0013 JMP #0003 + 0x80000000, // 0014 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: load +********************************************************************/ +be_local_closure(Tasmota_load, /* name */ + be_nested_proto( + 21, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 2]) { + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(sys), + /* K1 */ be_nested_str(path), + /* K2 */ be_nested_str(find), + /* K3 */ be_nested_str(push), + }), + &be_const_str_push_path, + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x7C080200, // 0002 CALL R2 1 + 0x8C0C0502, // 0003 GETMET R3 R2 K2 + 0x5C140000, // 0004 MOVE R5 R0 + 0x7C0C0400, // 0005 CALL R3 2 + 0x4C100000, // 0006 LDNIL R4 + 0x1C0C0604, // 0007 EQ R3 R3 R4 + 0x780E0002, // 0008 JMPF R3 #000C + 0x8C0C0503, // 0009 GETMET R3 R2 K3 + 0x5C140000, // 000A MOVE R5 R0 + 0x7C0C0400, // 000B CALL R3 2 + 0x80000000, // 000C RET 0 + }) + ), + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(sys), + /* K1 */ be_nested_str(path), + /* K2 */ be_nested_str(find), + /* K3 */ be_nested_str(remove), + }), + &be_const_str_pop_path, + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x7C080200, // 0002 CALL R2 1 + 0x8C0C0502, // 0003 GETMET R3 R2 K2 + 0x5C140000, // 0004 MOVE R5 R0 + 0x7C0C0400, // 0005 CALL R3 2 + 0x4C100000, // 0006 LDNIL R4 + 0x20100604, // 0007 NE R4 R3 R4 + 0x78120002, // 0008 JMPF R4 #000C + 0x8C100503, // 0009 GETMET R4 R2 K3 + 0x5C180600, // 000A MOVE R6 R3 + 0x7C100400, // 000B CALL R4 2 + 0x80000000, // 000C RET 0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[21]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(path), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str(_X2F), + /* K4 */ be_nested_str(split), + /* K5 */ be_nested_str(_X23), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str(find), + /* K8 */ be_nested_str(_X2E), + /* K9 */ be_nested_str(_X2Ebe), + /* K10 */ be_nested_str(_X2Ebec), + /* K11 */ be_nested_str(io_error), + /* K12 */ be_nested_str(file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27), + /* K13 */ be_nested_str(last_modified), + /* K14 */ be_nested_str(c), + /* K15 */ be_nested_str(wd), + /* K16 */ be_nested_str(), + /* K17 */ be_nested_str(file), + /* K18 */ be_nested_str(save), + /* K19 */ be_nested_str(format), + /* K20 */ be_nested_str(BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29), + }), + &be_const_str_load, + &be_const_str_solidified, + ( &(const binstruction[121]) { /* code */ + 0x84080000, // 0000 CLOSURE R2 P0 + 0x840C0001, // 0001 CLOSURE R3 P1 + 0xA4120000, // 0002 IMPORT R4 K0 + 0xA4160200, // 0003 IMPORT R5 K1 + 0x6018000C, // 0004 GETGBL R6 G12 + 0x5C1C0200, // 0005 MOVE R7 R1 + 0x7C180200, // 0006 CALL R6 1 + 0x1C180D02, // 0007 EQ R6 R6 K2 + 0x781A0001, // 0008 JMPF R6 #000B + 0x50180000, // 0009 LDBOOL R6 0 0 + 0x80040C00, // 000A RET 1 R6 + 0x94180302, // 000B GETIDX R6 R1 K2 + 0x20180D03, // 000C NE R6 R6 K3 + 0x781A0000, // 000D JMPF R6 #000F + 0x00060601, // 000E ADD R1 K3 R1 + 0x8C180904, // 000F GETMET R6 R4 K4 + 0x5C200200, // 0010 MOVE R8 R1 + 0x58240005, // 0011 LDCONST R9 K5 + 0x7C180600, // 0012 CALL R6 3 + 0x941C0D02, // 0013 GETIDX R7 R6 K2 + 0x5421FFFE, // 0014 LDINT R8 -1 + 0x94200C08, // 0015 GETIDX R8 R6 R8 + 0x6024000C, // 0016 GETGBL R9 G12 + 0x5C280C00, // 0017 MOVE R10 R6 + 0x7C240200, // 0018 CALL R9 1 + 0x24241306, // 0019 GT R9 R9 K6 + 0x8C280907, // 001A GETMET R10 R4 K7 + 0x5C301000, // 001B MOVE R12 R8 + 0x58340008, // 001C LDCONST R13 K8 + 0x7C280600, // 001D CALL R10 3 + 0x14281502, // 001E LT R10 R10 K2 + 0x782A0001, // 001F JMPF R10 #0022 + 0x00040309, // 0020 ADD R1 R1 K9 + 0x00201109, // 0021 ADD R8 R8 K9 + 0x5429FFFC, // 0022 LDINT R10 -3 + 0x542DFFFE, // 0023 LDINT R11 -1 + 0x4028140B, // 0024 CONNECT R10 R10 R11 + 0x9428100A, // 0025 GETIDX R10 R8 R10 + 0x1C281509, // 0026 EQ R10 R10 K9 + 0x542DFFFB, // 0027 LDINT R11 -4 + 0x5431FFFE, // 0028 LDINT R12 -1 + 0x402C160C, // 0029 CONNECT R11 R11 R12 + 0x942C100B, // 002A GETIDX R11 R8 R11 + 0x1C2C170A, // 002B EQ R11 R11 K10 + 0x5C301400, // 002C MOVE R12 R10 + 0x74320002, // 002D JMPT R12 #0031 + 0x5C301600, // 002E MOVE R12 R11 + 0x74320000, // 002F JMPT R12 #0031 + 0xB006170C, // 0030 RAISE 1 K11 K12 + 0x8C300B0D, // 0031 GETMET R12 R5 K13 + 0x5C380E00, // 0032 MOVE R14 R7 + 0x7C300400, // 0033 CALL R12 2 + 0x782E0005, // 0034 JMPF R11 #003B + 0x4C340000, // 0035 LDNIL R13 + 0x1C34180D, // 0036 EQ R13 R12 R13 + 0x78360001, // 0037 JMPF R13 #003A + 0x50340000, // 0038 LDBOOL R13 0 0 + 0x80041A00, // 0039 RET 1 R13 + 0x70020013, // 003A JMP #004F + 0x8C340B0D, // 003B GETMET R13 R5 K13 + 0x003C030E, // 003C ADD R15 R1 K14 + 0x7C340400, // 003D CALL R13 2 + 0x4C380000, // 003E LDNIL R14 + 0x1C38180E, // 003F EQ R14 R12 R14 + 0x783A0004, // 0040 JMPF R14 #0046 + 0x4C380000, // 0041 LDNIL R14 + 0x1C381A0E, // 0042 EQ R14 R13 R14 + 0x783A0001, // 0043 JMPF R14 #0046 + 0x50380000, // 0044 LDBOOL R14 0 0 + 0x80041C00, // 0045 RET 1 R14 + 0x4C380000, // 0046 LDNIL R14 + 0x20381A0E, // 0047 NE R14 R13 R14 + 0x783A0005, // 0048 JMPF R14 #004F + 0x4C380000, // 0049 LDNIL R14 + 0x1C38180E, // 004A EQ R14 R12 R14 + 0x743A0001, // 004B JMPT R14 #004E + 0x28381A0C, // 004C GE R14 R13 R12 + 0x783A0000, // 004D JMPF R14 #004F + 0x502C0200, // 004E LDBOOL R11 1 0 + 0x78260005, // 004F JMPF R9 #0056 + 0x00340F05, // 0050 ADD R13 R7 K5 + 0x90021E0D, // 0051 SETMBR R0 K15 R13 + 0x5C340400, // 0052 MOVE R13 R2 + 0x8838010F, // 0053 GETMBR R14 R0 K15 + 0x7C340200, // 0054 CALL R13 1 + 0x70020000, // 0055 JMP #0057 + 0x90021F10, // 0056 SETMBR R0 K15 K16 + 0x6034000D, // 0057 GETGBL R13 G13 + 0x5C380200, // 0058 MOVE R14 R1 + 0x583C0011, // 0059 LDCONST R15 K17 + 0x7C340400, // 005A CALL R13 2 + 0x5C381600, // 005B MOVE R14 R11 + 0x743A0013, // 005C JMPT R14 #0071 + 0x5C381200, // 005D MOVE R14 R9 + 0x743A0011, // 005E JMPT R14 #0071 + 0xA8020005, // 005F EXBLK 0 #0066 + 0x8C380112, // 0060 GETMET R14 R0 K18 + 0x0040030E, // 0061 ADD R16 R1 K14 + 0x5C441A00, // 0062 MOVE R17 R13 + 0x7C380600, // 0063 CALL R14 3 + 0xA8040001, // 0064 EXBLK 1 1 + 0x7002000A, // 0065 JMP #0071 + 0xAC380001, // 0066 CATCH R14 0 1 + 0x70020007, // 0067 JMP #0070 + 0x603C0001, // 0068 GETGBL R15 G1 + 0x8C400913, // 0069 GETMET R16 R4 K19 + 0x58480014, // 006A LDCONST R18 K20 + 0x004C030E, // 006B ADD R19 R1 K14 + 0x5C501C00, // 006C MOVE R20 R14 + 0x7C400800, // 006D CALL R16 4 + 0x7C3C0200, // 006E CALL R15 1 + 0x70020000, // 006F JMP #0071 + 0xB0080000, // 0070 RAISE 2 R0 R0 + 0x5C381A00, // 0071 MOVE R14 R13 + 0x7C380000, // 0072 CALL R14 0 + 0x78260002, // 0073 JMPF R9 #0077 + 0x5C380600, // 0074 MOVE R14 R3 + 0x003C0F05, // 0075 ADD R15 R7 K5 + 0x7C380200, // 0076 CALL R14 1 + 0x50380200, // 0077 LDBOOL R14 1 0 + 0x80041C00, // 0078 RET 1 R14 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: chars_in_string +********************************************************************/ +be_local_closure(Tasmota_chars_in_string, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_const_int(1), + }), + &be_const_str_chars_in_string, + &be_const_str_solidified, + ( &(const binstruction[31]) { /* code */ + 0x780E0001, // 0000 JMPF R3 #0003 + 0x50100200, // 0001 LDBOOL R4 1 0 + 0x70020000, // 0002 JMP #0004 + 0x50100000, // 0003 LDBOOL R4 0 0 + 0x58140000, // 0004 LDCONST R5 K0 + 0x6018000C, // 0005 GETGBL R6 G12 + 0x5C1C0200, // 0006 MOVE R7 R1 + 0x7C180200, // 0007 CALL R6 1 + 0x14180A06, // 0008 LT R6 R5 R6 + 0x781A0012, // 0009 JMPF R6 #001D + 0x50180000, // 000A LDBOOL R6 0 0 + 0x581C0000, // 000B LDCONST R7 K0 + 0x6020000C, // 000C GETGBL R8 G12 + 0x5C240400, // 000D MOVE R9 R2 + 0x7C200200, // 000E CALL R8 1 + 0x14200E08, // 000F LT R8 R7 R8 + 0x78220006, // 0010 JMPF R8 #0018 + 0x94200205, // 0011 GETIDX R8 R1 R5 + 0x94240407, // 0012 GETIDX R9 R2 R7 + 0x1C201009, // 0013 EQ R8 R8 R9 + 0x78220000, // 0014 JMPF R8 #0016 + 0x50180200, // 0015 LDBOOL R6 1 0 + 0x001C0F01, // 0016 ADD R7 R7 K1 + 0x7001FFF3, // 0017 JMP #000C + 0x20200806, // 0018 NE R8 R4 R6 + 0x78220000, // 0019 JMPF R8 #001B + 0x80040A00, // 001A RET 1 R5 + 0x00140B01, // 001B ADD R5 R5 K1 + 0x7001FFE7, // 001C JMP #0005 + 0x5419FFFE, // 001D LDINT R6 -1 + 0x80040C00, // 001E RET 1 R6 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: cmd +********************************************************************/ +be_local_closure(Tasmota_cmd, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(cmd_res), + /* K1 */ be_nested_str(_cmd), + }), + &be_const_str_cmd, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x50080200, // 0000 LDBOOL R2 1 0 + 0x90020002, // 0001 SETMBR R0 K0 R2 + 0x8C080101, // 0002 GETMET R2 R0 K1 + 0x5C100200, // 0003 MOVE R4 R1 + 0x7C080400, // 0004 CALL R2 2 + 0x4C080000, // 0005 LDNIL R2 + 0x880C0100, // 0006 GETMBR R3 R0 K0 + 0x50100200, // 0007 LDBOOL R4 1 0 + 0x200C0604, // 0008 NE R3 R3 R4 + 0x780E0000, // 0009 JMPF R3 #000B + 0x88080100, // 000A GETMBR R2 R0 K0 + 0x4C0C0000, // 000B LDNIL R3 + 0x90020003, // 000C SETMBR R0 K0 R3 + 0x80040400, // 000D RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_cmd +********************************************************************/ +be_local_closure(Tasmota_add_cmd, /* name */ + be_nested_proto( + 5, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(_ccmd), + /* K1 */ be_nested_str(function), + /* K2 */ be_nested_str(value_error), + /* K3 */ be_nested_str(the_X20second_X20argument_X20is_X20not_X20a_X20function), + }), + &be_const_str_add_cmd, + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x740E0002, // 0001 JMPT R3 #0005 + 0x600C0013, // 0002 GETGBL R3 G19 + 0x7C0C0000, // 0003 CALL R3 0 + 0x90020003, // 0004 SETMBR R0 K0 R3 + 0x600C0004, // 0005 GETGBL R3 G4 + 0x5C100400, // 0006 MOVE R4 R2 + 0x7C0C0200, // 0007 CALL R3 1 + 0x1C0C0701, // 0008 EQ R3 R3 K1 + 0x780E0002, // 0009 JMPF R3 #000D + 0x880C0100, // 000A GETMBR R3 R0 K0 + 0x980C0202, // 000B SETIDX R3 R1 R2 + 0x70020000, // 000C JMP #000E + 0xB0060503, // 000D RAISE 1 K2 K3 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_rule +********************************************************************/ +be_local_closure(Tasmota_add_rule, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str(_rules), + /* K1 */ be_nested_str(function), + /* K2 */ be_nested_str(push), + /* K3 */ be_nested_str(kv), + /* K4 */ be_nested_str(value_error), + /* K5 */ be_nested_str(the_X20second_X20argument_X20is_X20not_X20a_X20function), + }), + &be_const_str_add_rule, + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x740E0002, // 0001 JMPT R3 #0005 + 0x600C0012, // 0002 GETGBL R3 G18 + 0x7C0C0000, // 0003 CALL R3 0 + 0x90020003, // 0004 SETMBR R0 K0 R3 + 0x600C0004, // 0005 GETGBL R3 G4 + 0x5C100400, // 0006 MOVE R4 R2 + 0x7C0C0200, // 0007 CALL R3 1 + 0x1C0C0701, // 0008 EQ R3 R3 K1 + 0x780E0007, // 0009 JMPF R3 #0012 + 0x880C0100, // 000A GETMBR R3 R0 K0 + 0x8C0C0702, // 000B GETMET R3 R3 K2 + 0x8C140103, // 000C GETMET R5 R0 K3 + 0x5C1C0200, // 000D MOVE R7 R1 + 0x5C200400, // 000E MOVE R8 R2 + 0x7C140600, // 000F CALL R5 3 + 0x7C0C0400, // 0010 CALL R3 2 + 0x70020000, // 0011 JMP #0013 + 0xB0060905, // 0012 RAISE 1 K4 K5 + 0x80000000, // 0013 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: exec_rules +********************************************************************/ +be_local_closure(Tasmota_exec_rules, /* name */ + be_nested_proto( + 12, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str(_rules), + /* K1 */ be_nested_str(cmd_res), + /* K2 */ be_nested_str(json), + /* K3 */ be_nested_str(load), + /* K4 */ be_nested_str(log), + /* K5 */ be_nested_str(BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20), + /* K6 */ be_const_int(3), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str(try_rule), + /* K9 */ be_nested_str(k), + /* K10 */ be_nested_str(v), + /* K11 */ be_const_int(1), + }), + &be_const_str_exec_rules, + &be_const_str_solidified, + ( &(const binstruction[48]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x740A0003, // 0001 JMPT R2 #0006 + 0x88080101, // 0002 GETMBR R2 R0 K1 + 0x4C0C0000, // 0003 LDNIL R3 + 0x20080403, // 0004 NE R2 R2 R3 + 0x780A0027, // 0005 JMPF R2 #002E + 0xA40A0400, // 0006 IMPORT R2 K2 + 0x8C0C0503, // 0007 GETMET R3 R2 K3 + 0x5C140200, // 0008 MOVE R5 R1 + 0x7C0C0400, // 0009 CALL R3 2 + 0x50100000, // 000A LDBOOL R4 0 0 + 0x4C140000, // 000B LDNIL R5 + 0x1C140605, // 000C EQ R5 R3 R5 + 0x78160004, // 000D JMPF R5 #0013 + 0x8C140104, // 000E GETMET R5 R0 K4 + 0x001E0A01, // 000F ADD R7 K5 R1 + 0x58200006, // 0010 LDCONST R8 K6 + 0x7C140600, // 0011 CALL R5 3 + 0x5C0C0200, // 0012 MOVE R3 R1 + 0x88140101, // 0013 GETMBR R5 R0 K1 + 0x4C180000, // 0014 LDNIL R6 + 0x20140A06, // 0015 NE R5 R5 R6 + 0x78160000, // 0016 JMPF R5 #0018 + 0x90020203, // 0017 SETMBR R0 K1 R3 + 0x88140100, // 0018 GETMBR R5 R0 K0 + 0x78160012, // 0019 JMPF R5 #002D + 0x58140007, // 001A LDCONST R5 K7 + 0x6018000C, // 001B GETGBL R6 G12 + 0x881C0100, // 001C GETMBR R7 R0 K0 + 0x7C180200, // 001D CALL R6 1 + 0x14180A06, // 001E LT R6 R5 R6 + 0x781A000C, // 001F JMPF R6 #002D + 0x88180100, // 0020 GETMBR R6 R0 K0 + 0x94180C05, // 0021 GETIDX R6 R6 R5 + 0x8C1C0108, // 0022 GETMET R7 R0 K8 + 0x5C240600, // 0023 MOVE R9 R3 + 0x88280D09, // 0024 GETMBR R10 R6 K9 + 0x882C0D0A, // 0025 GETMBR R11 R6 K10 + 0x7C1C0800, // 0026 CALL R7 4 + 0x741E0001, // 0027 JMPT R7 #002A + 0x74120000, // 0028 JMPT R4 #002A + 0x50100001, // 0029 LDBOOL R4 0 1 + 0x50100200, // 002A LDBOOL R4 1 0 + 0x00140B0B, // 002B ADD R5 R5 K11 + 0x7001FFED, // 002C JMP #001B + 0x80040800, // 002D RET 1 R4 + 0x50080000, // 002E LDBOOL R2 0 0 + 0x80040400, // 002F RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: hs2rgb +********************************************************************/ +be_local_closure(Tasmota_hs2rgb, /* name */ + be_nested_proto( + 17, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(scale_uint), + /* K3 */ be_const_int(1), + /* K4 */ be_const_int(2), + /* K5 */ be_const_int(3), + }), + &be_const_str_hs2rgb, + &be_const_str_solidified, + ( &(const binstruction[68]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x1C0C0403, // 0001 EQ R3 R2 R3 + 0x780E0000, // 0002 JMPF R3 #0004 + 0x540A00FE, // 0003 LDINT R2 255 + 0x540E00FE, // 0004 LDINT R3 255 + 0x541200FE, // 0005 LDINT R4 255 + 0x541600FE, // 0006 LDINT R5 255 + 0x541A0167, // 0007 LDINT R6 360 + 0x10040206, // 0008 MOD R1 R1 R6 + 0x24180500, // 0009 GT R6 R2 K0 + 0x781A0031, // 000A JMPF R6 #003D + 0x541A003B, // 000B LDINT R6 60 + 0x0C180206, // 000C DIV R6 R1 R6 + 0x541E003B, // 000D LDINT R7 60 + 0x101C0207, // 000E MOD R7 R1 R7 + 0x542200FE, // 000F LDINT R8 255 + 0x04201002, // 0010 SUB R8 R8 R2 + 0xB8260200, // 0011 GETNGBL R9 K1 + 0x8C241302, // 0012 GETMET R9 R9 K2 + 0x5C2C0E00, // 0013 MOVE R11 R7 + 0x58300000, // 0014 LDCONST R12 K0 + 0x5436003B, // 0015 LDINT R13 60 + 0x543A00FE, // 0016 LDINT R14 255 + 0x5C3C1000, // 0017 MOVE R15 R8 + 0x7C240C00, // 0018 CALL R9 6 + 0xB82A0200, // 0019 GETNGBL R10 K1 + 0x8C281502, // 001A GETMET R10 R10 K2 + 0x5C300E00, // 001B MOVE R12 R7 + 0x58340000, // 001C LDCONST R13 K0 + 0x543A003B, // 001D LDINT R14 60 + 0x5C3C1000, // 001E MOVE R15 R8 + 0x544200FE, // 001F LDINT R16 255 + 0x7C280C00, // 0020 CALL R10 6 + 0x1C2C0D00, // 0021 EQ R11 R6 K0 + 0x782E0002, // 0022 JMPF R11 #0026 + 0x5C141400, // 0023 MOVE R5 R10 + 0x5C101000, // 0024 MOVE R4 R8 + 0x70020016, // 0025 JMP #003D + 0x1C2C0D03, // 0026 EQ R11 R6 K3 + 0x782E0002, // 0027 JMPF R11 #002B + 0x5C0C1200, // 0028 MOVE R3 R9 + 0x5C101000, // 0029 MOVE R4 R8 + 0x70020011, // 002A JMP #003D + 0x1C2C0D04, // 002B EQ R11 R6 K4 + 0x782E0002, // 002C JMPF R11 #0030 + 0x5C0C1000, // 002D MOVE R3 R8 + 0x5C101400, // 002E MOVE R4 R10 + 0x7002000C, // 002F JMP #003D + 0x1C2C0D05, // 0030 EQ R11 R6 K5 + 0x782E0002, // 0031 JMPF R11 #0035 + 0x5C0C1000, // 0032 MOVE R3 R8 + 0x5C141200, // 0033 MOVE R5 R9 + 0x70020007, // 0034 JMP #003D + 0x542E0003, // 0035 LDINT R11 4 + 0x1C2C0C0B, // 0036 EQ R11 R6 R11 + 0x782E0002, // 0037 JMPF R11 #003B + 0x5C0C1400, // 0038 MOVE R3 R10 + 0x5C141000, // 0039 MOVE R5 R8 + 0x70020001, // 003A JMP #003D + 0x5C141000, // 003B MOVE R5 R8 + 0x5C101200, // 003C MOVE R4 R9 + 0x541A000F, // 003D LDINT R6 16 + 0x38180606, // 003E SHL R6 R3 R6 + 0x541E0007, // 003F LDINT R7 8 + 0x381C0A07, // 0040 SHL R7 R5 R7 + 0x30180C07, // 0041 OR R6 R6 R7 + 0x30180C04, // 0042 OR R6 R6 R4 + 0x80040C00, // 0043 RET 1 R6 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(KV_init, /* name */ + be_nested_proto( + 3, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(k), + /* K1 */ be_nested_str(v), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: KV +********************************************************************/ +be_local_class(KV, + 2, + NULL, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(k, 2), be_const_var(0) }, + { be_const_key(v, -1), be_const_var(1) }, + { be_const_key(init, -1), be_const_closure(KV_init_closure) }, + })), + be_str_literal("KV") +); + +/******************************************************************** +** Solidified function: kv +********************************************************************/ +be_local_closure(Tasmota_kv, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_const_class(be_class_KV), + }), + &be_const_str_kv, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x580C0000, // 0000 LDCONST R3 K0 + 0xB4000000, // 0001 CLASS K0 + 0x5C100600, // 0002 MOVE R4 R3 + 0x5C140200, // 0003 MOVE R5 R1 + 0x5C180400, // 0004 MOVE R6 R2 + 0x7C100400, // 0005 CALL R4 2 + 0x80040800, // 0006 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_cmd +********************************************************************/ +be_local_closure(Tasmota_remove_cmd, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(_ccmd), + /* K1 */ be_nested_str(remove), + }), + &be_const_str_remove_cmd, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A0003, // 0001 JMPF R2 #0006 + 0x88080100, // 0002 GETMBR R2 R0 K0 + 0x8C080501, // 0003 GETMET R2 R2 K1 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_timer +********************************************************************/ +be_local_closure(Tasmota_set_timer, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(_timers), + /* K1 */ be_nested_str(push), + /* K2 */ be_nested_str(Timer), + /* K3 */ be_nested_str(millis), + }), + &be_const_str_set_timer, + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x88100100, // 0000 GETMBR R4 R0 K0 + 0x74120002, // 0001 JMPT R4 #0005 + 0x60100012, // 0002 GETGBL R4 G18 + 0x7C100000, // 0003 CALL R4 0 + 0x90020004, // 0004 SETMBR R0 K0 R4 + 0x88100100, // 0005 GETMBR R4 R0 K0 + 0x8C100901, // 0006 GETMET R4 R4 K1 + 0xB81A0400, // 0007 GETNGBL R6 K2 + 0x8C1C0103, // 0008 GETMET R7 R0 K3 + 0x5C240200, // 0009 MOVE R9 R1 + 0x7C1C0400, // 000A CALL R7 2 + 0x5C200400, // 000B MOVE R8 R2 + 0x5C240600, // 000C MOVE R9 R3 + 0x7C180600, // 000D CALL R6 3 + 0x7C100400, // 000E CALL R4 2 + 0x80000000, // 000F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_timer +********************************************************************/ +be_local_closure(Tasmota_remove_timer, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(_timers), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str(size), + /* K4 */ be_nested_str(id), + /* K5 */ be_nested_str(remove), + /* K6 */ be_const_int(1), + }), + &be_const_str_remove_timer, + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x88080501, // 0001 GETMBR R2 R2 K1 + 0x780A0012, // 0002 JMPF R2 #0016 + 0x58080002, // 0003 LDCONST R2 K2 + 0xB80E0000, // 0004 GETNGBL R3 K0 + 0x880C0701, // 0005 GETMBR R3 R3 K1 + 0x8C0C0703, // 0006 GETMET R3 R3 K3 + 0x7C0C0200, // 0007 CALL R3 1 + 0x140C0403, // 0008 LT R3 R2 R3 + 0x780E000B, // 0009 JMPF R3 #0016 + 0x880C0101, // 000A GETMBR R3 R0 K1 + 0x940C0602, // 000B GETIDX R3 R3 R2 + 0x880C0704, // 000C GETMBR R3 R3 K4 + 0x1C0C0601, // 000D EQ R3 R3 R1 + 0x780E0004, // 000E JMPF R3 #0014 + 0x880C0101, // 000F GETMBR R3 R0 K1 + 0x8C0C0705, // 0010 GETMET R3 R3 K5 + 0x5C140400, // 0011 MOVE R5 R2 + 0x7C0C0400, // 0012 CALL R3 2 + 0x70020000, // 0013 JMP #0015 + 0x00080506, // 0014 ADD R2 R2 K6 + 0x7001FFED, // 0015 JMP #0004 + 0x80000000, // 0016 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: exec_cmd +********************************************************************/ +be_local_closure(Tasmota_exec_cmd, /* name */ + be_nested_proto( + 12, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(_ccmd), + /* K1 */ be_nested_str(json), + /* K2 */ be_nested_str(load), + /* K3 */ be_nested_str(find_key_i), + /* K4 */ be_nested_str(resolvecmnd), + }), + &be_const_str_exec_cmd, + &be_const_str_solidified, + ( &(const binstruction[27]) { /* code */ + 0x88100100, // 0000 GETMBR R4 R0 K0 + 0x78120016, // 0001 JMPF R4 #0019 + 0xA4120200, // 0002 IMPORT R4 K1 + 0x8C140902, // 0003 GETMET R5 R4 K2 + 0x5C1C0600, // 0004 MOVE R7 R3 + 0x7C140400, // 0005 CALL R5 2 + 0x8C180103, // 0006 GETMET R6 R0 K3 + 0x88200100, // 0007 GETMBR R8 R0 K0 + 0x5C240200, // 0008 MOVE R9 R1 + 0x7C180600, // 0009 CALL R6 3 + 0x4C1C0000, // 000A LDNIL R7 + 0x201C0C07, // 000B NE R7 R6 R7 + 0x781E000B, // 000C JMPF R7 #0019 + 0x8C1C0104, // 000D GETMET R7 R0 K4 + 0x5C240C00, // 000E MOVE R9 R6 + 0x7C1C0400, // 000F CALL R7 2 + 0x881C0100, // 0010 GETMBR R7 R0 K0 + 0x941C0E06, // 0011 GETIDX R7 R7 R6 + 0x5C200C00, // 0012 MOVE R8 R6 + 0x5C240400, // 0013 MOVE R9 R2 + 0x5C280600, // 0014 MOVE R10 R3 + 0x5C2C0A00, // 0015 MOVE R11 R5 + 0x7C1C0800, // 0016 CALL R7 4 + 0x501C0200, // 0017 LDBOOL R7 1 0 + 0x80040E00, // 0018 RET 1 R7 + 0x50100000, // 0019 LDBOOL R4 0 0 + 0x80040800, // 001A RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_light +********************************************************************/ +be_local_closure(Tasmota_get_light, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29), + /* K1 */ be_nested_str(light), + /* K2 */ be_nested_str(get), + }), + &be_const_str_get_light, + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x60080001, // 0000 GETGBL R2 G1 + 0x580C0000, // 0001 LDCONST R3 K0 + 0x7C080200, // 0002 CALL R2 1 + 0xA40A0200, // 0003 IMPORT R2 K1 + 0x4C0C0000, // 0004 LDNIL R3 + 0x200C0203, // 0005 NE R3 R1 R3 + 0x780E0004, // 0006 JMPF R3 #000C + 0x8C0C0502, // 0007 GETMET R3 R2 K2 + 0x5C140200, // 0008 MOVE R5 R1 + 0x7C0C0400, // 0009 CALL R3 2 + 0x80040600, // 000A RET 1 R3 + 0x70020002, // 000B JMP #000F + 0x8C0C0502, // 000C GETMET R3 R2 K2 + 0x7C0C0200, // 000D CALL R3 1 + 0x80040600, // 000E RET 1 R3 + 0x80000000, // 000F RET 0 + }) + ) +); +/*******************************************************************/ + +#include "../generate/be_fixed_be_class_tasmota.h" + + +// Class definition +void be_load_tasmota_ntvlib(bvm *vm) +{ + be_pushntvclass(vm, &be_class_tasmota); + be_setglobal(vm, "Tasmota"); + be_pop(vm, 1); +} + +/* @const_object_info_begin +class be_class_tasmota (scope: global, name: Tasmota) { + _rules, var + _timers, var + _ccmd, var + _drivers, var + wire1, var + wire2, var + global, var + settings, var + cmd_res, var + wd, var + _debug_present, var + + _global_def, comptr(&be_tasmota_global_struct) + _settings_def, comptr(&be_tasmota_settings_struct) + _global_addr, comptr(&TasmotaGlobal) + _settings_ptr, comptr(&Settings) + + init, closure(Tasmota_init_closure) + kv, closure(Tasmota_kv_closure) + + get_free_heap, func(l_getFreeHeap) + arch, func(l_arch) + publish, func(l_publish) + publish_result, func(l_publish_result) + _cmd, func(l_cmd) + get_option, func(l_getoption) + millis, func(l_millis) + time_reached, func(l_timereached) + rtc, func(l_rtc) + time_dump, func(l_time_dump) + strftime, func(l_strftime) + strptime, func(l_strptime) + memory, func(l_memory) + wifi, func(l_wifi) + eth, func(l_eth) + yield, func(l_yield) + delay, func(l_delay) + scale_uint, func(l_scaleuint) + log, func(l_logInfo) + save, func(l_save) + + read_sensors, func(l_read_sensors) + + resp_cmnd, func(l_respCmnd) + resp_cmnd_str, func(l_respCmndStr) + resp_cmnd_done, func(l_respCmndDone) + resp_cmnd_error, func(l_respCmndError) + resp_cmnd_failed, func(l_respCmndFailed) + resolvecmnd, func(l_resolveCmnd) + + response_append, func(l_respAppend) + web_send, func(l_webSend) + web_send_decimal, func(l_webSendDecimal) + + get_power, func(l_getpower) + set_power, func(l_setpower) + get_switch, func(l_getswitch) + + i2c_enabled, func(l_i2cenabled) + + cmd, closure(Tasmota_cmd_closure) + chars_in_string, closure(Tasmota_chars_in_string_closure) + find_key_i, closure(Tasmota_find_key_i_closure) + find_op, closure(Tasmota_find_op_closure) + add_rule, closure(Tasmota_add_rule_closure) + remove_rule, closure(Tasmota_remove_rule_closure) + try_rule, closure(Tasmota_try_rule_closure) + exec_rules, closure(Tasmota_exec_rules_closure) + exec_tele, closure(Tasmota_exec_tele_closure) + set_timer, closure(Tasmota_set_timer_closure) + run_deferred, closure(Tasmota_run_deferred_closure) + remove_timer, closure(Tasmota_remove_timer_closure) + add_cmd, closure(Tasmota_add_cmd_closure) + remove_cmd, closure(Tasmota_remove_cmd_closure) + exec_cmd, closure(Tasmota_exec_cmd_closure) + gc, closure(Tasmota_gc_closure) + event, closure(Tasmota_event_closure) + add_driver, closure(Tasmota_add_driver_closure) + remove_driver, closure(Tasmota_remove_driver_closure) + load, closure(Tasmota_load_closure) + wire_scan, closure(Tasmota_wire_scan_closure) + time_str, closure(Tasmota_time_str_closure) + + hs2rgb, closure(Tasmota_hs2rgb_closure) + + gen_cb, closure(Tasmota_gen_cb_closure) + + get_light, closure(Tasmota_get_light_closure) + set_light, closure(Tasmota_set_light_closure) +} +@const_object_info_end */ diff --git a/lib/libesp32/berry/default/be_tcpclient_lib.c b/lib/libesp32/berry/default/be_tcpclient_lib.c new file mode 100644 index 000000000..b39db458e --- /dev/null +++ b/lib/libesp32/berry/default/be_tcpclient_lib.c @@ -0,0 +1,48 @@ +/******************************************************************** + * Webclient mapped to Arduino framework + * + * To use: `d = webclient()` + * + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_WEBCLIENT + +extern int wc_tcp_init(bvm *vm); +extern int wc_tcp_deinit(bvm *vm); + +extern int wc_tcp_connect(bvm *vm); +extern int wc_tcp_connected(bvm *vm); +extern int wc_tcp_close(bvm *vm); +extern int wc_tcp_available(bvm *vm); + +extern int wc_tcp_write(bvm *vm); +extern int wc_tcp_read(bvm *vm); +extern int wc_tcp_readbytes(bvm *vm); + +#include "../generate/be_fixed_be_class_tcpclient.h" + +void be_load_tcpclient_lib(bvm *vm) { + be_pushntvclass(vm, &be_class_tcpclient); + be_setglobal(vm, "tcpclient"); + be_pop(vm, 1); +} +/* @const_object_info_begin + +class be_class_tcpclient (scope: global, name: tcpclient) { + .w, var + init, func(wc_tcp_init) + deinit, func(wc_tcp_deinit) + + connect, func(wc_tcp_connect) + connected, func(wc_tcp_connected) + close, func(wc_tcp_close) + available, func(wc_tcp_available) + + write, func(wc_tcp_write) + read, func(wc_tcp_read) + readbytes, func(wc_tcp_readbytes) +} +@const_object_info_end */ + +#endif // USE_WEBCLIENT diff --git a/lib/libesp32/berry/default/be_timer_class.c b/lib/libesp32/berry/default/be_timer_class.c new file mode 100644 index 000000000..6664e408e --- /dev/null +++ b/lib/libesp32/berry/default/be_timer_class.c @@ -0,0 +1,110 @@ +/******************************************************************** + * Tasmota lib + * + * class Timer + *******************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: tostring +********************************************************************/ +be_local_closure(Timer_tostring, /* name */ + be_nested_proto( + 10, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(format), + /* K2 */ be_nested_str(_X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29), + /* K3 */ be_nested_str(due), + /* K4 */ be_nested_str(f), + /* K5 */ be_nested_str(id), + }), + &be_const_str_tostring, + &be_const_str_solidified, + ( &(const binstruction[19]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x58100002, // 0002 LDCONST R4 K2 + 0x60140008, // 0003 GETGBL R5 G8 + 0x60180006, // 0004 GETGBL R6 G6 + 0x5C1C0000, // 0005 MOVE R7 R0 + 0x7C180200, // 0006 CALL R6 1 + 0x7C140200, // 0007 CALL R5 1 + 0x60180008, // 0008 GETGBL R6 G8 + 0x881C0103, // 0009 GETMBR R7 R0 K3 + 0x7C180200, // 000A CALL R6 1 + 0x601C0008, // 000B GETGBL R7 G8 + 0x88200104, // 000C GETMBR R8 R0 K4 + 0x7C1C0200, // 000D CALL R7 1 + 0x60200008, // 000E GETGBL R8 G8 + 0x88240105, // 000F GETMBR R9 R0 K5 + 0x7C200200, // 0010 CALL R8 1 + 0x7C080C00, // 0011 CALL R2 6 + 0x80040400, // 0012 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Timer_init, /* name */ + be_nested_proto( + 4, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(due), + /* K1 */ be_nested_str(f), + /* K2 */ be_nested_str(id), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x90020403, // 0002 SETMBR R0 K2 R3 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Timer +********************************************************************/ +be_local_class(Timer, + 3, + NULL, + be_nested_map(5, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(tostring, 4), be_const_closure(Timer_tostring_closure) }, + { be_const_key(id, 2), be_const_var(2) }, + { be_const_key(f, -1), be_const_var(1) }, + { be_const_key(due, -1), be_const_var(0) }, + { be_const_key(init, -1), be_const_closure(Timer_init_closure) }, + })), + be_str_literal("Timer") +); +/*******************************************************************/ + +void be_load_Timer_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Timer); + be_setglobal(vm, "Timer"); + be_pop(vm, 1); +} diff --git a/lib/libesp32/berry/default/be_unishox_lib.c b/lib/libesp32/berry/default/be_unishox_lib.c new file mode 100644 index 000000000..971f4c9e0 --- /dev/null +++ b/lib/libesp32/berry/default/be_unishox_lib.c @@ -0,0 +1,28 @@ +/******************************************************************** + * Berry module `unishox` + * + * To use: `import unishox` + * + * Allows to respond to HTTP request + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_UNISHOX_COMPRESSION + +extern int be_ntv_unishox_decompress(bvm *vm); +extern int be_ntv_unishox_compress(bvm *vm); + +/******************************************************************** +** Solidified module: unishox +********************************************************************/ +be_local_module(unishox, + "unishox", + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(decompress, -1), be_const_func(be_ntv_unishox_decompress) }, + { be_const_key(compress, -1), be_const_func(be_ntv_unishox_compress) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(unishox); + +#endif // USE_UNISHOX_COMPRESSION diff --git a/lib/libesp32/berry/default/be_webclient_lib.c b/lib/libesp32/berry/default/be_webclient_lib.c new file mode 100644 index 000000000..0e4b66e90 --- /dev/null +++ b/lib/libesp32/berry/default/be_webclient_lib.c @@ -0,0 +1,57 @@ +/******************************************************************** + * Webclient mapped to Arduino framework + * + * To use: `d = webclient()` + * + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_WEBCLIENT + +extern int wc_init(bvm *vm); +extern int wc_deinit(bvm *vm); +extern int wc_urlencode(bvm *vm); +extern int wc_begin(bvm *vm); +extern int wc_set_timeouts(bvm *vm); +extern int wc_set_useragent(bvm *vm); +extern int wc_set_auth(bvm *vm); +extern int wc_connected(bvm *vm); +extern int wc_close(bvm *vm); +extern int wc_addheader(bvm *vm); +extern int wc_GET(bvm *vm); +extern int wc_POST(bvm *vm); +extern int wc_getstring(bvm *vm); +extern int wc_writefile(bvm *vm); +extern int wc_getsize(bvm *vm); + +#include "../generate/be_fixed_be_class_webclient.h" + +void be_load_webclient_lib(bvm *vm) { + be_pushntvclass(vm, &be_class_webclient); + be_setglobal(vm, "webclient"); + be_pop(vm, 1); +} +/* @const_object_info_begin + +class be_class_webclient (scope: global, name: webclient) { + .p, var + .w, var + init, func(wc_init) + deinit, func(wc_deinit) + url_encode, func(wc_urlencode) + + begin, func(wc_begin) + set_timeouts, func(wc_set_timeouts) + set_useragent, func(wc_set_useragent) + set_auth, func(wc_set_auth) + close, func(wc_close) + add_header, func(wc_addheader) + GET, func(wc_GET) + POST, func(wc_POST) + get_string, func(wc_getstring) + write_file, func(wc_writefile) + get_size, func(wc_getsize) +} +@const_object_info_end */ + +#endif // USE_WEBCLIENT diff --git a/lib/libesp32/berry/default/be_webserver_lib.c b/lib/libesp32/berry/default/be_webserver_lib.c new file mode 100644 index 000000000..0f3e45d05 --- /dev/null +++ b/lib/libesp32/berry/default/be_webserver_lib.c @@ -0,0 +1,55 @@ +/******************************************************************** + * Berry module `webserver` + * + * To use: `import webserver` + * + * Allows to respond to HTTP request + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_WEBSERVER + +extern int w_webserver_member(bvm *vm); +extern int w_webserver_on(bvm *vm); +extern int w_webserver_state(bvm *vm); + +extern int w_webserver_check_privileged_access(bvm *vm); +extern int w_webserver_redirect(bvm *vm); +extern int w_webserver_content_start(bvm *vm); +extern int w_webserver_content_send(bvm *vm); +extern int w_webserver_content_send_style(bvm *vm); +extern int w_webserver_content_flush(bvm *vm); +extern int w_webserver_content_stop(bvm *vm); +extern int w_webserver_content_button(bvm *vm); + +extern int w_webserver_argsize(bvm *vm); +extern int w_webserver_arg(bvm *vm); +extern int w_webserver_arg_name(bvm *vm); +extern int w_webserver_has_arg(bvm *vm); + + +/* @const_object_info_begin +module webserver (scope: global) { + member, func(w_webserver_member) + + on, func(w_webserver_on) + state, func(w_webserver_state) + + check_privileged_access, func(w_webserver_check_privileged_access) + redirect, func(w_webserver_redirect) + content_send, func(w_webserver_content_send) + content_send_style, func(w_webserver_content_send_style) + content_flush, func(w_webserver_content_flush) + content_start, func(w_webserver_content_start) + content_stop, func(w_webserver_content_stop) + content_button, func(w_webserver_content_button) + + arg_size, func(w_webserver_argsize) + arg, func(w_webserver_arg) + arg_name, func(w_webserver_arg_name) + has_arg, func(w_webserver_has_arg) +} +@const_object_info_end */ +#include "../generate/be_fixed_webserver.h" + +#endif // USE_WEBSERVER diff --git a/lib/libesp32/berry/default/be_wirelib.c b/lib/libesp32/berry/default/be_wirelib.c new file mode 100644 index 000000000..38f345553 --- /dev/null +++ b/lib/libesp32/berry/default/be_wirelib.c @@ -0,0 +1,151 @@ +/******************************************************************** + * Tasmota lib + * + * To use: `import wire` + * + * 2 wire communication - I2C + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_I2C + +extern int b_wire_init(bvm *vm); + +extern int b_wire_begintransmission(bvm *vm); +extern int b_wire_endtransmission(bvm *vm); +extern int b_wire_requestfrom(bvm *vm); +extern int b_wire_available(bvm *vm); +extern int b_wire_write(bvm *vm); +extern int b_wire_read(bvm *vm); + +extern int b_wire_scan(bvm *vm); + +extern int b_wire_validwrite(bvm *vm); +extern int b_wire_validread(bvm *vm); +extern int b_wire_detect(bvm *vm); +extern int b_wire_enabled(bvm *vm); + +/******************************************************************** +** Solidified function: write_bytes +********************************************************************/ +be_local_closure(write_bytes, /* name */ + be_nested_proto( + 7, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str(_begin_transmission), + /* K1 */ be_nested_str(_write), + /* K2 */ be_nested_str(_end_transmission), + }), + &be_const_str_write_bytes, + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x8C100100, // 0000 GETMET R4 R0 K0 + 0x5C180200, // 0001 MOVE R6 R1 + 0x7C100400, // 0002 CALL R4 2 + 0x8C100101, // 0003 GETMET R4 R0 K1 + 0x5C180400, // 0004 MOVE R6 R2 + 0x7C100400, // 0005 CALL R4 2 + 0x8C100101, // 0006 GETMET R4 R0 K1 + 0x5C180600, // 0007 MOVE R6 R3 + 0x7C100400, // 0008 CALL R4 2 + 0x8C100102, // 0009 GETMET R4 R0 K2 + 0x7C100200, // 000A CALL R4 1 + 0x80000000, // 000B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read_bytes +********************************************************************/ +be_local_closure(read_bytes, /* name */ + be_nested_proto( + 8, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str(_begin_transmission), + /* K1 */ be_nested_str(_write), + /* K2 */ be_nested_str(_end_transmission), + /* K3 */ be_nested_str(_request_from), + /* K4 */ be_nested_str(_available), + /* K5 */ be_nested_str(_read), + }), + &be_const_str_read_bytes, + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0x8C100100, // 0000 GETMET R4 R0 K0 + 0x5C180200, // 0001 MOVE R6 R1 + 0x7C100400, // 0002 CALL R4 2 + 0x8C100101, // 0003 GETMET R4 R0 K1 + 0x5C180400, // 0004 MOVE R6 R2 + 0x7C100400, // 0005 CALL R4 2 + 0x8C100102, // 0006 GETMET R4 R0 K2 + 0x50180000, // 0007 LDBOOL R6 0 0 + 0x7C100400, // 0008 CALL R4 2 + 0x8C100103, // 0009 GETMET R4 R0 K3 + 0x5C180200, // 000A MOVE R6 R1 + 0x5C1C0600, // 000B MOVE R7 R3 + 0x7C100600, // 000C CALL R4 3 + 0x60100015, // 000D GETGBL R4 G21 + 0x5C140600, // 000E MOVE R5 R3 + 0x7C100200, // 000F CALL R4 1 + 0x8C140104, // 0010 GETMET R5 R0 K4 + 0x7C140200, // 0011 CALL R5 1 + 0x78160003, // 0012 JMPF R5 #0017 + 0x8C140105, // 0013 GETMET R5 R0 K5 + 0x7C140200, // 0014 CALL R5 1 + 0x40140805, // 0015 CONNECT R5 R4 R5 + 0x7001FFF8, // 0016 JMP #0010 + 0x80040800, // 0017 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +#include "../generate/be_fixed_be_class_tasmota_wire.h" + +void be_load_wirelib(bvm *vm) { + be_pushntvclass(vm, &be_class_tasmota_wire); + be_setglobal(vm, "Wire"); + be_pop(vm, 1); +} +/* @const_object_info_begin + +class be_class_tasmota_wire (scope: global, name: Wire) { + bus, var + + init, func(b_wire_init) + _begin_transmission, func(b_wire_begintransmission) + _end_transmission, func(b_wire_endtransmission) + _request_from, func(b_wire_requestfrom) + _available, func(b_wire_available) + _write, func(b_wire_write) + _read, func(b_wire_read) + scan, func(b_wire_scan) + write, func(b_wire_validwrite) + read, func(b_wire_validread) + detect, func(b_wire_detect) + enabled, func(b_wire_enabled) + + read_bytes, closure(read_bytes_closure) + write_bytes, closure(write_bytes_closure) +} +@const_object_info_end */ + +#endif // USE_I2C \ No newline at end of file diff --git a/lib/libesp32/berry/default/berry_conf.h b/lib/libesp32/berry/default/berry_conf.h new file mode 100644 index 000000000..607a9c612 --- /dev/null +++ b/lib/libesp32/berry/default/berry_conf.h @@ -0,0 +1,247 @@ +/******************************************************************** +** Copyright (c) 2018-2020 Guan Wenliang +** This file is part of the Berry default interpreter. +** skiars@qq.com, https://github.com/Skiars/berry +** See Copyright Notice in the LICENSE file or at +** https://github.com/Skiars/berry/blob/master/LICENSE +********************************************************************/ +#ifndef BERRY_CONF_H +#define BERRY_CONF_H + +#include + +#ifdef COMPILE_BERRY_LIB + #include "my_user_config.h" + #include "tasmota_configurations.h" +#endif + +/* Macro: BE_DEBUG + * Berry interpreter debug switch. + * Default: 0 + **/ +#ifndef BE_DEBUG +#define BE_DEBUG 0 +#endif + +/* Macro: BE_LONGLONG_INT + * Select integer length. + * If the value is 0, use an integer of type int, use a long + * integer type when the value is 1, and use a long long integer + * type when the value is 2. + * Default: 2 + */ +#define BE_INTGER_TYPE 1 // use long int = uint32_t + +/* Macro: BE_USE_SINGLE_FLOAT + * Select floating point precision. + * Use double-precision floating-point numbers when the value + * is 0 (default), otherwise use single-precision floating-point + * numbers. + * Default: 0 + **/ +#define BE_USE_SINGLE_FLOAT 1 // use `float` not `double` + +/* Macro: BE_USE_PRECOMPILED_OBJECT + * Use precompiled objects to avoid creating these objects at + * runtime. Enable this macro can greatly optimize RAM usage. + * Default: 1 + **/ +#define BE_USE_PRECOMPILED_OBJECT 1 + +/* Macro: BE_DEBUG_RUNTIME_INFO + * Set runtime error debugging information. + * 0: unable to output source file and line number at runtime. + * 1: output source file and line number information at runtime. + * 2: the information use uint16_t type (save space). + * Default: 1 + **/ +#define BE_DEBUG_RUNTIME_INFO 0 + +/* Macro: BE_DEBUG_VAR_INFO + * Set variable debugging tracking information. + * 0: disable variable debugging tracking information at runtime. + * 1: enable variable debugging tracking information at runtime. + * Default: 1 + **/ +#define BE_DEBUG_VAR_INFO 0 + +/* Macro: BE_USE_PERF_COUNTERS + * Use the obshook function to report low-level actions. + * Default: 0 + **/ +#define BE_USE_PERF_COUNTERS 1 + +/* Macro: BE_VM_OBSERVABILITY_SAMPLING + * If BE_USE_PERF_COUNTERS == 1 + * then the observability hook is called regularly in the VM loop + * allowing to stop infinite loops or too-long running code. + * The value is a power of 2. + * Default: 20 - which translates to 2^20 or ~1 million instructions + **/ +#define BE_VM_OBSERVABILITY_SAMPLING 20 + +/* Macro: BE_STACK_TOTAL_MAX + * Set the maximum total stack size. + * Default: 20000 + **/ +#define BE_STACK_TOTAL_MAX 8000 + +/* Macro: BE_STACK_FREE_MIN + * Set the minimum free count of the stack. The stack idles will + * be checked when a function is called, and the stack will be + * expanded if the number of free is less than BE_STACK_FREE_MIN. + * Default: 10 + **/ +#define BE_STACK_FREE_MIN 20 + +/* Macro: BE_STACK_START + * Set the starting size of the stack at VM creation. + * Default: 50 + **/ +#define BE_STACK_START 100 + +/* Macro: BE_CONST_SEARCH_SIZE + * Constants in function are limited to 255. However the compiler + * will look for a maximum of pre-existing constants to avoid + * performance degradation. This may cause the number of constants + * to be higher than required. + * Increase is you need to solidify functions. + * Default: 50 + **/ +#define BE_CONST_SEARCH_SIZE 150 + +/* Macro: BE_STACK_FREE_MIN + * The short string will hold the hash value when the value is + * true. It may be faster but requires more RAM. + * Default: 0 + **/ +#define BE_USE_STR_HASH_CACHE 0 + +/* Macro: BE_USE_FILE_SYSTEM + * The file system interface will be used when this macro is true + * or when using the OS module. Otherwise the file system interface + * will not be used. + * Default: 0 + **/ +#define BE_USE_FILE_SYSTEM 0 + +/* Macro: BE_USE_SCRIPT_COMPILER + * Enable compiler when BE_USE_SCRIPT_COMPILER is not 0, otherwise + * disable the compiler. + * Default: 1 + **/ +#define BE_USE_SCRIPT_COMPILER 1 + +/* Macro: BE_USE_BYTECODE_SAVER + * Enable save bytecode to file when BE_USE_BYTECODE_SAVER is not 0, + * otherwise disable the feature. + * Default: 1 + **/ +#define BE_USE_BYTECODE_SAVER 1 + +/* Macro: BE_USE_BYTECODE_LOADER + * Enable load bytecode from file when BE_USE_BYTECODE_LOADER is not 0, + * otherwise disable the feature. + * Default: 1 + **/ +#define BE_USE_BYTECODE_LOADER 1 + +/* Macro: BE_USE_SHARED_LIB + * Enable shared library when BE_USE_SHARED_LIB is not 0, + * otherwise disable the feature. + * Default: 1 + **/ +#define BE_USE_SHARED_LIB 0 + +/* Macro: BE_USE_OVERLOAD_HASH + * Allows instances to overload hash methods for use in the + * built-in Map class. Disable this feature to crop the code + * size. + * Default: 1 + **/ +#define BE_USE_OVERLOAD_HASH 1 + +/* Macro: BE_USE_DEBUG_HOOK + * Berry debug hook switch. + * Default: 0 + **/ +#define BE_USE_DEBUG_HOOK 0 + +/* Macro: BE_USE_DEBUG_GC + * Enable GC debug mode. This causes an actual gc after each + * allocation. It's much slower and should not be used + * in production code. + * Default: 0 + **/ +#define BE_USE_DEBUG_GC 0 + +/* Macro: BE_USE_XXX_MODULE + * These macros control whether the related module is compiled. + * When they are true, they will enable related modules. At this + * point you can use the import statement to import the module. + * They will not compile related modules when they are false. + **/ +#define BE_USE_STRING_MODULE 1 +#define BE_USE_JSON_MODULE 1 +#define BE_USE_MATH_MODULE 1 +#define BE_USE_TIME_MODULE 0 +#define BE_USE_OS_MODULE 0 +#define BE_USE_GLOBAL_MODULE 1 +#define BE_USE_SYS_MODULE 1 +#define BE_USE_DEBUG_MODULE 0 +#define BE_USE_GC_MODULE 1 +#define BE_USE_SOLIDIFY_MODULE 0 +#define BE_USE_INTROSPECT_MODULE 1 +#define BE_USE_STRICT_MODULE 1 + +#ifdef USE_BERRY_DEBUG + #undef BE_USE_DEBUG_MODULE + #undef BE_USE_SOLIDIFY_MODULE + #define BE_USE_DEBUG_MODULE 1 + #define BE_USE_SOLIDIFY_MODULE 1 +#endif // USE_BERRY_DEBUG + +/* Macro: BE_EXPLICIT_XXX + * If these macros are defined, the corresponding function will + * use the version defined by these macros. These macro definitions + * are not required. + * The default is to use the functions in the standard library. + **/ +#ifdef USE_BERRY_PSRAM +#ifdef __cplusplus +extern "C" { +#endif + extern void *berry_malloc(size_t size); + extern void berry_free(void *ptr); + extern void *berry_realloc(void *ptr, size_t size); +#ifdef __cplusplus +} +#endif + #define BE_EXPLICIT_MALLOC berry_malloc + #define BE_EXPLICIT_FREE berry_free + #define BE_EXPLICIT_REALLOC berry_realloc +#else + #define BE_EXPLICIT_MALLOC malloc + #define BE_EXPLICIT_FREE free + #define BE_EXPLICIT_REALLOC realloc +#endif // USE_BERRY_PSRAM + +#define BE_EXPLICIT_ABORT abort +#define BE_EXPLICIT_EXIT exit +// #define BE_EXPLICIT_MALLOC malloc +// #define BE_EXPLICIT_FREE free +// #define BE_EXPLICIT_REALLOC realloc + +/* Macro: be_assert + * Berry debug assertion. Only enabled when BE_DEBUG is active. + * Default: use the assert() function of the standard library. + **/ +#define be_assert(expr) assert(expr) + +/* Tasmota debug specific */ +#ifdef USE_BERRY_DEBUG + #undef BE_DEBUG_RUNTIME_INFO + #define BE_DEBUG_RUNTIME_INFO 2 /* record line information in 16 bits */ +#endif // USE_BERRY_DEBUG + +#endif diff --git a/lib/libesp32/berry/default/embedded/Animate.be b/lib/libesp32/berry/default/embedded/Animate.be new file mode 100644 index 000000000..279fd39ed --- /dev/null +++ b/lib/libesp32/berry/default/embedded/Animate.be @@ -0,0 +1,189 @@ +# +# class Animate +# +# Animation framework +# + +animate = module("animate") + +# state-machine: from val a to b +class Animate_ins_ramp + var a # starting value + var b # end value + var duration # duration in milliseconds + + def init(a,b,duration) + self.a = a + self.b = b + self.duration = duration + end +end +animate.ins_ramp = Animate_ins_ramp + +# state-machine: pause and goto +class Animate_ins_goto + var pc_rel # relative PC, -1 previous instruction, 1 next instruction, 0 means see pc_abs + var pc_abs # absolute PC, only if pc_rel == 0, address if next instruction + var duration # pause in milliseconds before goto, -1 means infinite (state-machine can be changed externally) + + def init(pc_rel, pc_abs, duration) + self.pc_rel = pc_rel + self.pc_abs = pc_abs + self.duration = duration + end +end +animate.ins_goto = Animate_ins_goto + +class Animate_engine + var code # array of state-machine instructions + var closure # closure to call with the new value + var pc # program-counter + var ins_time # absolute time when the current instruction started + var running # is the animation running? allows fast return + var value # current value + + def init() + self.code = [] + self.pc = 0 # start at instruction 0 + self.ins_time = 0 + self.running = false # not running by default + # + end + + # run but needs external calls to `animate()` + # cur_time:int (opt) current timestamp in ms, defaults to `tasmota.millis()` + # val:int (opt) starting value, default to `nil` + def run(cur_time, val) + if cur_time == nil cur_time = tasmota.millis() end + if (val != nil) self.value = val end + self.ins_time = cur_time + + self.running = true + tasmota.add_driver(self) + end + + # runs autonomously in the Tasmota event loop + def autorun(cur_time, val) + self.run(cur_time, val) + tasmota.add_driver(self) + end + + def stop() + self.running = false + tasmota.remove_driver(self) + end + + def is_running() + return self.running + end + + def every_50ms() + self.animate() + end + + def animate(cur_time) # time in milliseconds, optional, defaults to `tasmota.millis()` + if !self.running return end + if cur_time == nil cur_time = tasmota.millis() end + # run through instructions + while true + var sub_index = cur_time - self.ins_time # time since the beginning of current instruction + # + # make sure PC is valid + if self.pc >= size(self.code) + self.running = false + break + end + # + if self.pc < 0 raise "internal_error", "Animate pc is out of range" end + var ins = self.code[self.pc] + + # Instruction Ramp + if isinstance(ins, animate.ins_ramp) + var f = self.closure # assign to a local variable to not call a method + if sub_index < ins.duration + # we're still in the ramp + self.value = tasmota.scale_uint(sub_index, 0, ins.duration, ins.a, ins.b) + # call closure + if f f(self.value) end # call closure, need try? TODO + break + else + self.value = ins.b + if f f(self.value) end # set to last value + self.pc += 1 # next instruction + self.ins_time = cur_time - (sub_index - ins.duration) + end + + # Instruction Goto + elif isinstance(ins, animate.ins_goto) + if sub_index < ins.duration + break + else + if ins.pc_rel != 0 + self.pc += ins.pc_rel + else + self.pc = ins.pc_abs + end + self.ins_time = cur_time - (sub_index - ins.duration) + end + + # Invalid + else + raise "internal_error", "unknown instruction" + end + end + return self.value + + end +end +animate.engine = Animate_engine + +class Animate_from_to : Animate_engine + + def init(closure, from, to, duration) + super(self).init() + self.closure = closure + self.code.push(animate.ins_ramp(from, to, duration)) + end + +end +animate.from_to = Animate_from_to + +#- +a=Animate_from_to(nil, 0, 100, 5000) +a.autorun() +-# + +class Animate_rotate : Animate_engine + + def init(closure, from, to, duration) + super(self).init() + self.closure = closure + self.code.push(animate.ins_ramp(from, to, duration)) + self.code.push(animate.ins_goto(0, 0, 0)) # goto abs pc = 0 without any pause + end + +end +animate.rotate = Animate_rotate + +#- +a=Animate_rotate(nil, 0, 100, 5000) +a.autorun() +-# + +class Animate_back_forth : Animate_engine + + def init(closure, from, to, duration) + super(self).init() + self.closure = closure + self.code.push(animate.ins_ramp(from, to, duration / 2)) + self.code.push(animate.ins_ramp(to, from, duration / 2)) + self.code.push(animate.ins_goto(0, 0, 0)) # goto abs pc = 0 without any pause + end + +end +animate.back_forth = Animate_back_forth + +#- +a=Animate_back_forth(nil, 0, 100, 5000) +a.autorun() +-# diff --git a/lib/libesp32/berry/default/embedded/Driver.be b/lib/libesp32/berry/default/embedded/Driver.be new file mode 100644 index 000000000..d0782f024 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/Driver.be @@ -0,0 +1,29 @@ +#- Native code used for testing and code solidification -# +#- Do not use it -# + +class Driver + var every_second + var every_100ms + var web_add_handler + var web_add_button + var web_add_main_button + var web_add_management_button + var web_add_config_button + var web_add_console_button + var save_before_restart + var web_sensor + var json_append + var button_pressed + var display + + def init() + end + + def get_tasmota() + return tasmota + end + + def add_cmd(c, f) + tasmota.add_cmd(c, / cmd, idx, payload, payload_json -> f(self, cmd, idx, payload, payload_json)) + end +end diff --git a/lib/libesp32/berry/default/embedded/Tasmota.be b/lib/libesp32/berry/default/embedded/Tasmota.be new file mode 100644 index 000000000..22752a47d --- /dev/null +++ b/lib/libesp32/berry/default/embedded/Tasmota.be @@ -0,0 +1,577 @@ +#- Native code used for testing and code solidification -# +#- Do not use it -# + +class Timer + var due, f, id + def init(due, f, id) + self.due = due + self.f = f + self.id = id + end + def tostring() + import string + return string.format(" closure + # Classs KV has two members k and v + def kv(k, v) + class KV + var k, v + def init(k,v) + self.k = k + self.v = v + end + end + + return KV(k, v) + end + + # add `chars_in_string(s:string,c:string) -> int`` + # looks for any char in c, and return the position of the first char + # or -1 if not found + # inv is optional and inverses the behavior, i.e. look for chars not in the list + def chars_in_string(s,c,inv) + var inverted = inv ? true : false + var i = 0 + while i < size(s) + # for i:0..size(s)-1 + var found = false + var j = 0 + while j < size(c) + # for j:0..size(c)-1 + if s[i] == c[j] found = true end + j += 1 + end + if inverted != found return i end + i += 1 + end + return -1 + end + + # find a key in map, case insensitive, return actual key or nil if not found + def find_key_i(m,keyi) + import string + var keyu = string.toupper(keyi) + if isinstance(m, map) + for k:m.keys() + if string.toupper(k)==keyu || keyi=='?' + return k + end + end + end + end + + + # split the item when there is an operator, returns a list of (left,op,right) + # ex: "Dimmer>50" -> ["Dimmer",tasmota_gt,"50"] + def find_op(item) + import string + var op_chars = '=<>!' + var pos = self.chars_in_string(item, op_chars) + if pos >= 0 + var op_split = string.split(item,pos) + var op_left = op_split[0] + var op_rest = op_split[1] + pos = self.chars_in_string(op_rest, op_chars, true) + if pos >= 0 + var op_split2 = string.split(op_rest,pos) + var op_middle = op_split2[0] + var op_right = op_split2[1] + return [op_left,op_middle,op_right] + end + end + return [item, nil, nil] + end + + # Rules + def add_rule(pat,f) + if !self._rules + self._rules=[] + end + if type(f) == 'function' + self._rules.push(self.kv(pat, f)) + else + raise 'value_error', 'the second argument is not a function' + end + end + + def remove_rule(pat) + if self._rules + var i = 0 + while i < size(self._rules) + if self._rules[i].k == pat + self._rules.remove(i) #- don't increment i since we removed the object -# + else + i += 1 + end + end + end + end + + # Rules trigger if match. return true if match, false if not + def try_rule(event, rule, f) + import string + var rl_list = self.find_op(rule) + var sub_event = event + var rl = string.split(rl_list[0],'#') + var i = 0 + while i < size(rl) + # for it:rl + var it = rl[i] + var found=self.find_key_i(sub_event,it) + if found == nil return false end + sub_event = sub_event[found] + i += 1 + end + var op=rl_list[1] + var op2=rl_list[2] + if op + if op=='==' + if str(sub_event) != str(op2) return false end + elif op=='!==' + if str(sub_event) == str(op2) return false end + elif op=='=' + if real(sub_event) != real(op2) return false end + elif op=='!=' + if real(sub_event) == real(op2) return false end + elif op=='>' + if real(sub_event) <= real(op2) return false end + elif op=='>=' + if real(sub_event) < real(op2) return false end + elif op=='<' + if real(sub_event) >= real(op2) return false end + elif op=='<=' + if real(sub_event) > real(op2) return false end + end + end + f(sub_event, rl_list[0], event) + return true + end + + # Run rules, i.e. check each individual rule + # Returns true if at least one rule matched, false if none + def exec_rules(ev_json) + if self._rules || self.cmd_res != nil # if there is a rule handler, or we record rule results + import json + var ev = json.load(ev_json) # returns nil if invalid JSON + var ret = false + if ev == nil + self.log('BRY: ERROR, bad json: '+ev_json, 3) + ev = ev_json # revert to string + end + # record the rule payload for tasmota.cmd() + if self.cmd_res != nil + self.cmd_res = ev + end + # try all rule handlers + if self._rules + var i = 0 + while i < size(self._rules) + var kv = self._rules[i] + ret = self.try_rule(ev,kv.k,kv.v) || ret #- call should be first to avoid evaluation shortcut if ret is already true -# + i += 1 + end + end + return ret + end + return false + end + + # Run tele rules + def exec_tele(ev_json) + if self._rules + import json + var ev = json.load(ev_json) # returns nil if invalid JSON + var ret = false + if ev == nil + self.log('BRY: ERROR, bad json: '+ev_json, 3) + ev = ev_json # revert to string + end + # insert tele prefix + ev = { "Tele": ev } + + var i = 0 + while i < size(self._rules) + var kv = self._rules[i] + ret = self.try_rule(ev,kv.k,kv.v) || ret #- call should be first to avoid evaluation shortcut -# + i += 1 + end + return ret + end + return false + end + + def set_timer(delay,f,id) + if !self._timers self._timers=[] end + self._timers.push(Timer(self.millis(delay),f,id)) + end + + # run every 50ms tick + def run_deferred() + if self._timers + var i=0 + while i wire1 or wire2 or nil + # scan for the first occurrence of the addr, starting with bus1 then bus2 + # optional: skip if index is disabled via I2CEnable + def wire_scan(addr,idx) + # skip if the I2C index is disabled + if idx != nil && !self.i2c_enabled(idx) return nil end + if self.wire1.enabled() && self.wire1.detect(addr) return self.wire1 end + if self.wire2.enabled() && self.wire2.detect(addr) return self.wire2 end + return nil + end + + def time_str(time) + import string + var tm = self.time_dump(time) + return string.format("%04d-%02d-%02dT%02d:%02d:%02d", tm['year'], tm['month'], tm['day'], tm['hour'], tm['min'], tm['sec']) + end + + def load(f) + # embedded functions + # puth_path: adds the current archive to sys.path + def push_path(p) + import sys + var path = sys.path() + if path.find(p) == nil # append only if it's not already there + path.push(p) + end + end + # pop_path: removes the path + def pop_path(p) + import sys + var path = sys.path() + var idx = path.find(p) + if idx != nil + path.remove(idx) + end + end + + import string + import path + + # fail if empty string + if size(f) == 0 return false end + # Ex: f = 'app.zip#autoexec' + + # add leading '/' if absent + if f[0] != '/' f = '/' + f end + # Ex: f = '/app.zip#autoexec' + + var f_items = string.split(f, '#') + var f_prefix = f_items[0] + var f_suffix = f_items[-1] # last token + var f_archive = size(f_items) > 1 # is the file in an archive + + # if no dot, add the default '.be' extension + if string.find(f_suffix, '.') < 0 # does the final file has a '.' + f += ".be" + f_suffix += ".be" + end + # Ex: f = '/app.zip#autoexec.be' + + # if the filename has no '.' append '.be' + var suffix_be = f_suffix[-3..-1] == '.be' + var suffix_bec = f_suffix[-4..-1] == '.bec' + # Ex: f = '/app.zip#autoexec.be', f_suffix = 'autoexec.be', suffix_be = true, suffix_bec = false + + # check that the file ends with '.be' of '.bec' + if !suffix_be && !suffix_bec + raise "io_error", "file extension is not '.be' or '.bec'" + end + + var f_time = path.last_modified(f_prefix) + + if suffix_bec + if f_time == nil return false end # file does not exist + # f is the right file, continue + else + var f_time_bc = path.last_modified(f + "c") # timestamp for bytecode + if f_time == nil && f_time_bc == nil return false end + if f_time_bc != nil && (f_time == nil || f_time_bc >= f_time) + # bytecode exists and is more recent than berry source, use bytecode + ##### temporarily disable loading from bec file + # f = f + "c" # use bytecode name + suffix_bec = true + end + end + + # recall the working directory + if f_archive + self.wd = f_prefix + "#" + push_path(self.wd) + else + self.wd = "" + end + + var c = compile(f, 'file') + # save the compiled bytecode + if !suffix_bec && !f_archive + try + self.save(f + 'c', c) + except .. as e + print(string.format('BRY: could not save compiled file %s (%s)',f+'c',e)) + end + end + # call the compiled code + c() + # call successfuls + + # remove path prefix + if f_archive + pop_path(f_prefix + "#") + end + + return true + end + + def event(event_type, cmd, idx, payload, raw) + import introspect + import string + if event_type=='every_50ms' self.run_deferred() end #- first run deferred events -# + + var done = false + if event_type=='cmd' return self.exec_cmd(cmd, idx, payload) + elif event_type=='tele' return self.exec_tele(payload) + elif event_type=='rule' return self.exec_rules(payload) + elif event_type=='gc' return self.gc() + elif self._drivers + var i = 0 + while i < size(self._drivers) + #for d:self._drivers + var d = self._drivers[i] + var f = introspect.get(d, event_type) # try to match a function or method with the same name + if type(f) == 'function' + try + done = f(d, cmd, idx, payload, raw) + if done break end + except .. as e,m + print(string.format("BRY: Exception> '%s' - %s", e, m)) + if self._debug_present + import debug + debug.traceback() + end + end + end + i += 1 + end + end + + # save persist + if event_type=='save_before_restart' + import persist + persist.save() + end + + return done + end + + def add_driver(d) + if self._drivers + self._drivers.push(d) + else + self._drivers = [d] + end + end + + def remove_driver(d) + if self._drivers + var idx = self._drivers.find(d) + if idx != nil + self._drivers.pop(idx) + end + end + end + + # cmd high-level function + def cmd(command) + self.cmd_res = true # signal buffer capture + + self._cmd(command) + + var ret = nil + if self.cmd_res != true # unchanged + ret = self.cmd_res + end + self.cmd_res = nil # clear buffer + + return ret + end + + # set_light and get_light deprecetaion + def get_light(l) + print('tasmota.get_light() is deprecated, use light.get()') + import light + if l != nil + return light.get(l) + else + return light.get() + end + end + def set_light(v,l) + print('tasmota.set_light() is deprecated, use light.set()') + import light + if l != nil + return light.set(v,l) + else + return light.set(v) + end + end + + #- generate a new C callback and record the associated Berry closure -# + def gen_cb(f) + # DEPRECATED + import cb + return cb.gen_cb(f) + end + + #- convert hue/sat to rgb -# + #- hue:int in range 0..359 -# + #- sat:int (optional) in range 0..255 -# + #- returns int: 0xRRGGBB -# + def hs2rgb(hue,sat) + if sat == nil sat = 255 end + var r = 255 # default to white + var b = 255 + var g = 255 + # we take brightness at 100%, brightness should be set separately + hue = hue % 360 # normalize to 0..359 + + if sat > 0 + var i = hue / 60 # quadrant 0..5 + var f = hue % 60 # 0..59 + var p = 255 - sat + var q = tasmota.scale_uint(f, 0, 60, 255, p) # 0..59 + var t = tasmota.scale_uint(f, 0, 60, p, 255) + + if i == 0 + # r = 255 + g = t + b = p + elif i == 1 + r = q + # g = 255 + b = p + elif i == 2 + r = p + #g = 255 + b = t + elif i == 3 + r = p + g = q + #b = 255 + elif i == 4 + r = t + g = p + #b = 255 + else + #r = 255 + g = p + b = q + end + end + + return (r << 16) | (g << 8) | b + end +end diff --git a/lib/libesp32/berry/default/embedded/Wire.be b/lib/libesp32/berry/default/embedded/Wire.be new file mode 100644 index 000000000..a5e28ddd8 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/Wire.be @@ -0,0 +1,25 @@ +#- Native code used for testing and code solidification -# +#- Do not use it -# + +class Wire + var bus + + def read_bytes(addr,reg,size) + self._begin_transmission(addr) + self._write(reg) + self._end_transmission(false) + self._request_from(addr,size) + var ret=bytes(size) + while (self._available()) + ret..self._read() + end + return ret + end + + def write_bytes(addr,reg,b) + self._begin_transmission(addr) + self._write(reg) + self._write(b) + self._end_transmission() + end +end diff --git a/lib/libesp32/berry/default/embedded/autoconf.be b/lib/libesp32/berry/default/embedded/autoconf.be new file mode 100644 index 000000000..8489c7447 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/autoconf.be @@ -0,0 +1,389 @@ +#- autocong module for Berry -# +#- -# +#- To solidify: -# +#- + # load only persis_module and persist_module.init + import autoconf + solidify.dump(autoconf_module) + # copy and paste into `be_autoconf_lib.c` +-# +#- + +# For external compile: + +display = module("display") +self = nil +tasmota = nil +def load() end + +-# + +var autoconf_module = module("autoconf") + +autoconf_module.init = def (m) + + class Autoconf + var _archive + var _error + + def init() + import path + import string + + var dir = path.listdir("/") + var entry + tasmota.add_driver(self) + + var i = 0 + while i < size(dir) + if string.find(dir[i], ".autoconf") > 0 # does the file contain '*.autoconf', >0 to skip `.autoconf` + if entry != nil + # we have multiple configuration files, not allowed + print(string.format("CFG: multiple autoconf files found, aborting ('%s' + '%s')", entry, dir[i])) + self._error = true + return nil + end + entry = dir[i] + end + i += 1 + end + + if entry == nil + tasmota.log("CFG: no '*.autoconf' file found", 2) + return nil + end + + self._archive = entry + end + + + # #################################################################################################### + # Manage first time marker + # #################################################################################################### + def is_first_time() + import path + return !path.exists("/.autoconf") + end + def set_first_time() + var f = open("/.autoconf", "w") + f.close() + end + def clear_first_time() + import path + path.remove("/.autoconf") + end + + # #################################################################################################### + # Delete all autoconfig files present + # #################################################################################################### + def delete_all_configs() + import path + import string + var dir = path.listdir("/") + + for d:dir + if string.find(d, ".autoconf") > 0 # does the file contain '*.autoconf' + path.remove(d) + end + end + end + + # #################################################################################################### + # Get current module + # contains the name of the archive without leading `/`, ex: `M5Stack_Fire.autoconf` + # or `nil` if none + # #################################################################################################### + def get_current_module_path() + return self._archive + end + def get_current_module_name() + return self._archive[0..-10] + end + + # #################################################################################################### + # Load templates from Github + # #################################################################################################### + def load_templates() + import string + import json + try + var url = string.format("https://raw.githubusercontent.com/tasmota/autoconf/main/%s_manifest.json", tasmota.arch()) + tasmota.log(string.format("CFG: loading '%s'", url), 3) + # load the template + var cl = webclient() + cl.begin(url) + var r = cl.GET() + if r != 200 + tasmota.log(string.format("CFG: return_code=%i", r), 2) + return nil + end + var s = cl.get_string() + cl.close() + # convert to json + var j = json.load(s) + tasmota.log(string.format("CFG: loaded '%s'", str(j)), 3) + + var t = j.find("files") + if isinstance(t, list) + return t + end + + return nil + except .. as e, m + tasmota.log(string.format("CFG: exception '%s' - '%s'", e, m), 2) + return nil + end + end + + # #################################################################################################### + # Init web handlers + # #################################################################################################### + # Displays a "Autocong" button on the configuration page + def web_add_config_button() + import webserver + webserver.content_send("

") + end + + + # This HTTP GET manager controls which web controls are displayed + def page_autoconf_mgr() + import webserver + import string + if !webserver.check_privileged_access() return nil end + + webserver.content_start('Auto-configuration') + webserver.content_send_style() + webserver.content_send("

 (This feature requires an internet connection)

") + + var cur_module = self.get_current_module_path() + var cur_module_display = cur_module ? string.tr(self.get_current_module_name(), "_", " ") : self._error ? "<Error: apply new or remove>" : "<None>" + + webserver.content_send("
") + webserver.content_send(string.format(" Current auto-configuration")) + webserver.content_send(string.format("

Current configuration:

%s

", cur_module_display)) + + if cur_module + # add button to reapply template + webserver.content_send("

") + webserver.content_send("") + webserver.content_send("

") + end + webserver.content_send("

") + + webserver.content_send("
") + webserver.content_send(string.format(" Select new auto-configuration")) + + webserver.content_send("

") + webserver.content_send("
") + webserver.content_send("

") + + webserver.content_send("") + # webserver.content_send(string.format("", ota_num)) + webserver.content_send("

") + + + webserver.content_send("

") + webserver.content_button(webserver.BUTTON_CONFIGURATION) + webserver.content_stop() + end + + # #################################################################################################### + # Web controller + # + # Applies the changes and restart + # #################################################################################################### + # This HTTP POST manager handles the submitted web form data + def page_autoconf_ctl() + import webserver + import string + import path + if !webserver.check_privileged_access() return nil end + + try + if webserver.has_arg("reapply") + tasmota.log("CFG: removing first time marker", 2); + # print("CFG: removing first time marker") + self.clear_first_time() + #- and force restart -# + webserver.redirect("/?rst=") + + elif webserver.has_arg("zip") + # remove any remaining autoconf file + tasmota.log("CFG: removing autoconf files", 2); + # print("CFG: removing autoconf files") + self.delete_all_configs() + + # get the name of the configuration file + var arch_name = webserver.arg("zip") + + if arch_name != "reset" + var url = string.format("https://raw.githubusercontent.com/tasmota/autoconf/main/%s/%s.autoconf", tasmota.arch(), arch_name) + tasmota.log(string.format("CFG: downloading '%s'", url), 2); + + var local_file = string.format("%s.autoconf", arch_name) + + # download file and write directly to file system + var cl = webclient() + cl.begin(url) + var r = cl.GET() + if r != 200 raise "connection_error", string.format("return code=%i", r) end + cl.write_file(local_file) + cl.close() + end + + # remove marker to reapply template + self.clear_first_time() + + #- and force restart -# + webserver.redirect("/?rst=") + else + raise "value_error", "Unknown command" + end + except .. as e, m + print(string.format("CFG: Exception> '%s' - %s", e, m)) + #- display error page -# + webserver.content_start("Parameter error") #- title of the web page -# + webserver.content_send_style() #- send standard Tasmota styles -# + + webserver.content_send(string.format("

Exception:
'%s'
%s

", e, m)) + + webserver.content_button(webserver.BUTTON_CONFIGURATION) #- button back to management page -# + webserver.content_stop() #- end of web page -# + end + end + + # Add HTTP POST and GET handlers + def web_add_handler() + import webserver + webserver.on('/ac', / -> self.page_autoconf_mgr(), webserver.HTTP_GET) + webserver.on('/ac', / -> self.page_autoconf_ctl(), webserver.HTTP_POST) + end + + + # reset the configuration information (but don't restart) + # i.e. remove any autoconf file + def reset() + import path + import string + + var dir = path.listdir("/") + var entry + + var i = 0 + while i < size(dir) + var fname = dir[i] + if string.find(fname, ".autoconf") > 0 # does the file contain '*.autoconf' + path.remove(fname) + print(string.format("CFG: removed file '%s'", fname)) + end + i += 1 + end + + self._archive = nil + self._error = nil + end + + # called by the synthetic event `preinit` + def preinit() + if self._archive == nil return end + # try to launch `preinit.be` + import path + + var fname = self._archive + '#preinit.be' + if path.exists(fname) + tasmota.log("CFG: loading "+fname, 3) + load(fname) + tasmota.log("CFG: loaded "+fname, 3) + end + end + + def run_bat(fname) # read a '*.bat' file and run each command + import string + var f + try + f = open(fname, "r") # open file in read-only mode, it is expected to exist + while true + var line = f.readline() # read each line, can contain a terminal '\n', empty if end of file + if size(line) == 0 break end # end of file + + if line[-1] == "\n" line = line[0..-2] end # remove any trailing '\n' + if size(line) > 0 + tasmota.cmd(line) # run the command + end + end + f.close() # close, we don't expect exception with read-only, could be added later though + except .. as e, m + print(string.format('CFG: could not run %s (%s - %s)', fname, e, m)) + f.close() + end + end + + # called by the synthetic event `autoexec` + def autoexec() + if self._archive == nil return end + # try to launch `preinit.be` + import path + + # Step 1. if first run, only apply `init.bat` + var fname = self._archive + '#init.bat' + if self.is_first_time() && path.exists(fname) + # create the '.autoconf' file to avoid running it again, even if it crashed + self.set_first_time() + + # if path.exists(fname) # we know it exists from initial test + self.run_bat(fname) + tasmota.log("CFG: 'init.bat' done, restarting", 2) + tasmota.cmd("Restart 1") + return # if init was run, force a restart anyways and don't run the remaining code + # end + end + + # Step 2. if 'display.ini' is present, launch Universal Display + fname = self._archive + '#display.ini' + if gpio.pin_used(gpio.OPTION_A, 2) && path.exists(fname) + if path.exists("display.ini") + tasmota.log("CFG: skipping 'display.ini' because already present in file-system", 2) + else + import display + var f = open(fname,"r") + var desc = f.read() + f.close() + display.start(desc) + end + end + + # Step 3. if 'autoexec.bat' is present, run it + fname = self._archive + '#autoexec.bat' + if path.exists(fname) + tasmota.log("CFG: running "+fname, 3) + self.run_bat(fname) + tasmota.log("CFG: ran "+fname, 3) + end + + # Step 4. if 'autoexec.be' is present, load it + fname = self._archive + '#autoexec.be' + if path.exists(fname) + tasmota.log("CFG: loading "+fname, 3) + load(fname) + tasmota.log("CFG: loaded "+fname, 3) + end + end + end + + return Autoconf() # return an instance of this class +end + +aa = autoconf_module.init(autoconf_module) +import webserver +webserver.on('/ac2', / -> aa.page_autoconf_mgr(), webserver.HTTP_GET) +return autoconf_module diff --git a/lib/libesp32/berry/default/embedded/i2c_axp192.be b/lib/libesp32/berry/default/embedded/i2c_axp192.be new file mode 100644 index 000000000..3d958334f --- /dev/null +++ b/lib/libesp32/berry/default/embedded/i2c_axp192.be @@ -0,0 +1,176 @@ +#------------------------------------------------------------- + - Generic driver for AXP192 - solidified + -------------------------------------------------------------# +class AXP192 : I2C_Driver + def init() + super(self, I2C_Driver).init("AXP192", 0x34) + end + + # Return True = Battery Exist + def battery_present() + if self.wire.read(self.addr, 0x01, 1) & 0x20 return true + else return false + end + end + + # Input Power Status ??? + def get_input_power_status() + return self.wire.read(self.addr, 0x00, 1) + end + + # Battery Charging Status + def get_battery_chargin_status() + return self.wire.read(self.addr, 0x01, 1) + end + + # AXP chip temperature in °C + def get_temp() + return self.read12(0x5E) * 0.1 - 144.7 + end + + def get_bat_power() + return self.read24(0x70) * 0.00055 + end + + def get_bat_voltage() + return self.read12(0x78) * 0.0011 + end + def get_bat_current() + return (self.read13(0x7A) - self.read13(0x7C)) * 0.5 + end + def get_bat_charge_current() + return self.read13(0x7A) * 0.5 + end + def get_aps_voltage() + return self.read12(0x7E) * 0.0014 + end + def get_vbus_voltage() + return self.read12(0x5A) * 0.0017 + end + def get_vbus_current() + return self.read12(0x5C) * 0.375 + end + + # set LDO voltage + # ldo: 2/3 + # voltage: (mV) 1800mV - 3300mV in 100mV steps + def set_ldo_voltage(ldo, voltage) + if voltage > 3300 voltage = 15 + else voltage = (voltage / 100) - 18 + end + + if ldo == 2 + self.write8(0x28, self.read8(0x28) & 0x0F | ((voltage & 0x0F) << 4)) + end + if ldo == 3 + self.write8(0x28, self.read8(0x28) & 0xF0 | (voltage & 0x0F)) + end + end + + # set DCDC enable, 1/2/3 + def set_dcdc_enable(dcdc, state) + if dcdc == 1 self.write_bit(0x12, 0, state) end + if dcdc == 2 self.write_bit(0x12, 4, state) end + if dcdc == 3 self.write_bit(0x12, 1, state) end + end + + # set LDO enable, 2/3 (LDO 1 is always on) + def set_ldo_enable(ldo, state) + if ldo == 2 self.write_bit(0x12, 2, state) end + if ldo == 3 self.write_bit(0x12, 3, state) end + end + + # set GPIO output state 0/1/2 and 3/4 + def write_gpio(gpio, state) + if gpio >= 0 && gpio <= 2 + self.write_bit(0x94, gpio, state) + elif gpio >= 3 && gpio <= 4 + self.write_bit(0x96, gpio - 3, state) + end + end + + # Set voltage on DC-DC1/2/3 + # dcdc: 1/2/3 (warning some C libs start at 0) + # voltage: + def set_dc_voltage(dcdc, voltage) + if dcdc < 1 || dcdc > 3 return end + var v + if voltage < 700 v = 0 + elif voltage > 3500 v = 112 + elif dcdc == 2 && voltage > 2275 v = 63 # dcdc2 is limited to 2.275V + else v = (voltage - 700) / 25 + end + + var addr = 0x26 + if dcdc == 3 addr = 0x27 + elif dcdc == 2 addr = 0x23 + end + + self.write8(addr, self.read8(addr) & 0x80 | (v & 0x7F)) + end + + # Set charging current + # 100mA = 0 + # 190mA = 1 + # 280mA = 2 + # 360mA = 3 + # 450mA = 4 + # 550mA = 5 + # 630mA = 6 + # 700mA = 7 + # 780mA = 8 + # 880mA = 9 + # 960mA = 10 + # 1000mA = 11 + # 1080mA = 12 + # 1160mA = 13 + # 1240mA = 14 + # 1320mA = 15 + def set_chg_current(current_code) + self.write8(0x33, self.read8(0x33) & 0xF0 | (current_code & 0x0F)) + end + + # // Low Volt Level 1, when APS Volt Output < 3.4496 V + # // Low Volt Level 2, when APS Volt Output < 3.3992 V, then this flag is SET (0x01) + # // Flag will reset once battery volt is charged above Low Volt Level 1 + # // Note: now AXP192 have the Shutdown Voltage of 3.0V (B100) Def in REG 31H + def get_warning_level() + return self.read12(0x47) & 1 + end + + #- trigger a read every second -# + # def every_second() + # if !self.wire return nil end #- exit if not initialized -# + # end + + #- display sensor value in the web UI -# + def web_sensor() + if !self.wire return nil end #- exit if not initialized -# + import string + var msg = string.format( + "{s}VBus Voltage{m}%.3f V{e}".. + "{s}VBus Current{m}%.1f mA{e}".. + "{s}Batt Voltage{m}%.3f V{e}".. + "{s}Batt Current{m}%.1f mA{e}".. + #"{s}Batt Power{m}%.3f{e}".. + "{s}Temp AXP{m}%.1f °C{e}", + self.get_vbus_voltage(), self.get_vbus_voltage(), + self.get_bat_voltage(), self.get_bat_current(), + #self.get_bat_power(), + self.get_temp() + ) + tasmota.web_send_decimal(msg) + end + + #- add sensor value to teleperiod -# + def json_append() + if !self.wire return nil end #- exit if not initialized -# + # import string + # var ax = int(self.accel[0] * 1000) + # var ay = int(self.accel[1] * 1000) + # var az = int(self.accel[2] * 1000) + # var msg = string.format(",\"MPU6886\":{\"AX\":%i,\"AY\":%i,\"AZ\":%i,\"GX\":%i,\"GY\":%i,\"GZ\":%i}", + # ax, ay, az, self.gyro[0], self.gyro[1], self.gyro[2]) + # tasmota.response_append(msg) + end +end diff --git a/lib/libesp32/berry/default/embedded/i2c_driver.be b/lib/libesp32/berry/default/embedded/i2c_driver.be new file mode 100644 index 000000000..a66afa5ad --- /dev/null +++ b/lib/libesp32/berry/default/embedded/i2c_driver.be @@ -0,0 +1,104 @@ +#------------------------------------------------------------- + - IMPORTANT + - THIS CLASS IS ALREADY BAKED IN TASMOTA + - + - It is here for debugging and documentation purpose only + -------------------------------------------------------------# + +#------------------------------------------------------------- + - I2C_Driver class to simplify development of I2C drivers + - + - I2C_Driver(name, addr [, i2c_index]) -> nil + - name: name of I2C device for logging, or function to detect the model + - addr: I2C address of device, will probe all I2C buses for it + - i2c_index: (optional) check is the device is not disabled + -------------------------------------------------------------# + +class I2C_Driver + var wire #- wire object to reach the device, if nil then the module is not initialized -# + var addr #- I2C address of the device -# + var name #- model namme of the device, cannot be nil -# + + #- Init and look for device + - Input: + - name_or_detect : name of the device (if string) + or function to detect the precise model(if function) + the function is passed a single argument `self` + and must return a string, or `nil` if the device is invalid + - addr : I2C address of device (int 0..255) + - i2c_index : Tasmota I2C index, see `I2CDEVICES.md` (int) + --# + def init(name_or_detect, addr, i2c_index) + var tasmota = self.get_tasmota() #- retrieve the 'tasmota' singleton -# + + #- check if the i2c index is disabled by Tasmota configuration -# + if i2c_index != nil && !tasmota.i2c_enabled(i2c_index) return end + + self.addr = addr #- address for AXP192 -# + self.wire = tasmota.wire_scan(self.addr) #- get the right I2C bus -# + + if self.wire + #- find name of device, can be a string or a method -# + if type(name_or_detect) == 'function' + self.name = name_or_detect(self) + else + self.name = name_or_detect + end + #- if name is invalid, it means we can't detect device, abort -# + if self.name == nil self.wire = nil end + + if self.wire + print("I2C:", self.name, "detected on bus", self.wire.bus) + end + end + end + + #- write register with 8 bits value -# + def write8(reg, val) + return self.wire.write(self.addr, reg, val, 1) + end + + # Set or clear a specific bit in a register + # write_bit(reg:int, bit:int, state:bool) -> nil + # reg: I2C register number (0..255) + # bit: bit of I2C register to change (0..7) + # state: boolean value to write to specified bit + def write_bit(reg, bit, state) + if bit < 0 || bit > 7 return end + var mark = 1 << bit + if state self.write8(reg, self.read8(reg) | mark) + else self.write8(reg, self.read8(reg) & (0xFF - mark)) + end + end + + # read 8 bits + def read8(reg) + return self.wire.read(self.addr, reg, 1) + end + # read 12 bits + def read12(reg) + var buf = self.wire.read_bytes(self.addr, reg, 2) + return (buf[0] << 4) + buf[1] + end + # read 13 bits + def read13(reg) + var buf = self.wire.read_bytes(self.addr, reg, 2) + return (buf[0] << 5) + buf[1] + end + # read 24 bits + def read24(reg) + var buf = self.wire.read_bytes(self.addr, reg, 3) + return (buf[0] << 16) + (buf[1] << 8) + buf[2] + end + # read 32 bits + def read32(reg) + var buf = self.wire.read_bytes(self.addr, reg, 4) + return (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3] + end +end + +#- Example + +d = I2C_Driver("MPU", 0x68, 58) + +-# \ No newline at end of file diff --git a/lib/libesp32/berry/default/embedded/leds.be b/lib/libesp32/berry/default/embedded/leds.be new file mode 100644 index 000000000..11a0489af --- /dev/null +++ b/lib/libesp32/berry/default/embedded/leds.be @@ -0,0 +1,338 @@ +# class Leds +# +# for adressable leds like NoePixel + + +# Native commands +# 00 : ctor (leds:int, gpio:int) -> void +# 01 : begin void -> void +# 02 : show void -> void +# 03 : CanShow void -> bool +# 04 : IsDirty void -> bool +# 05 : Dirty void -> void +# 06 : Pixels void -> bytes() (mapped to the buffer) +# 07 : PixelSize void -> int +# 08 : PixelCount void -> int +# 09 : ClearTo (color:??) -> void +# 10 : SetPixelColor (idx:int, color:??) -> void +# 11 : GetPixelColor (idx:int) -> color:?? +# 20 : RotateLeft (rot:int [, first:int, last:int]) -> void +# 21 : RotateRight (rot:int [, first:int, last:int]) -> void +# 22 : ShiftLeft (rot:int [, first:int, last:int]) -> void +# 23 : ShiftRight (rot:int [, first:int, last:int]) -> void + + +class Leds : Leds_ntv + var gamma # if true, apply gamma (true is default) + var leds # number of leds + # leds:int = number of leds of the strip + # gpio:int (optional) = GPIO for NeoPixel. If not specified, takes the WS2812 gpio + # type:int (optional) = Type of LED, defaults to WS2812 RGB + # rmt:int (optional) = RMT hardware channel to use, leave default unless you have a good reason + def init(leds, gpio, type, rmt) # rmt is optional + self.gamma = true # gamma is enabled by default, it should be disabled explicitly if needed + self.leds = int(leds) + + if gpio == nil && gpio.pin(gpio.WS2812) >= 0 + gpio = gpio.pin(gpio.WS2812) + end + + # if no GPIO, abort + if gpio == nil + raise "valuer_error", "no GPIO specified for neopixelbus" + end + + # initialize the structure + self.ctor(self.leds, gpio, type, rmt) + + if self._p == nil raise "internal_error", "couldn't not initialize noepixelbus" end + + # call begin + self.begin() + + end + + def clear() + self.clear_to(0x000000) + self.show() + end + + def ctor(leds, gpio, rmt) + if rmt == nil + self.call_native(0, leds, gpio) + else + self.call_native(0, leds, gpio, rmt) + end + end + def begin() + self.call_native(1) + end + def show() + self.call_native(2) + end + def can_show() + return self.call_native(3) + end + def is_dirty() + return self.call_native(4) + end + def dirty() + self.call_native(5) + end + def pixels_buffer() + return self.call_native(6) + end + def pixel_size() + return self.call_native(7) + end + def pixel_count() + return self.call_native(8) + end + def clear_to(col, bri) + self.call_native(9, self.to_gamma(col, bri)) + end + def set_pixel_color(idx, col, bri) + self.call_native(10, idx, self.to_gamma(col, bri)) + end + def get_pixel_color(idx) + return self.call_native(11, idx) + end + # def rotate_left(rot, first, last) + # self.call_native(20, rot, first, last) + # end + # def rotate_right(rot, first, last) + # self.call_native(21, rot, first, last) + # end + # def shift_left(rot, first, last) + # self.call_native(22, rot, first, last) + # end + # def shift_right(rot, first, last) + # self.call_native(22, rot, first, last) + # end + + # apply gamma and bri + def to_gamma(rgbw, bri) + bri = (bri != nil) ? bri : 100 + var r = tasmota.scale_uint(bri, 0, 100, 0, (rgbw & 0xFF0000) >> 16) + var g = tasmota.scale_uint(bri, 0, 100, 0, (rgbw & 0x00FF00) >> 8) + var b = tasmota.scale_uint(bri, 0, 100, 0, (rgbw & 0x0000FF)) + if self.gamma + return light.gamma8(r) << 16 | + light.gamma8(g) << 8 | + light.gamma8(b) + else + return r << 16 | + g << 8 | + b + end + end + + # `segment` + # create a new `strip` object that maps a part of the current strip + def create_segment(offset, leds) + if int(offset) + int(leds) > self.leds || offset < 0 || leds < 0 + raise "value_error", "out of range" + end + + # inner class + class Leds_segment + var strip + var offset, leds + + def init(strip, offset, leds) + self.strip = strip + self.offset = int(offset) + self.leds = int(leds) + end + + def clear() + self.clear_to(0x000000) + self.show() + end + + def begin() + # do nothing, already being handled by physical strip + end + def show(force) + # don't trigger on segment, you will need to trigger on full strip instead + if bool(force) || (self.offset == 0 && self.leds == self.strip.leds) + self.strip.show() + end + end + def can_show() + return self.strip.can_show() + end + def is_dirty() + return self.strip.is_dirty() + end + def dirty() + self.strip.dirty() + end + def pixels_buffer() + return nil + end + def pixel_size() + return self.strip.pixel_size() + end + def pixel_count() + return self.leds + end + def clear_to(col, bri) + var i = 0 + while i < self.leds + self.strip.set_pixel_color(i + self.offset, col, bri) + i += 1 + end + end + def set_pixel_color(idx, col, bri) + self.strip.set_pixel_color(idx + self.offset, col, bri) + end + def get_pixel_color(idx) + return self.strip.get_pixel_color(idx + self.offseta) + end + end + + return Leds_segment(self, offset, leds) + + end + + def create_matrix(w, h, offset) + offset = int(offset) + w = int(w) + h = int(h) + if offset == nil offset = 0 end + if w * h + offset > self.leds || h < 0 || w < 0 || offset < 0 + raise "value_error", "out of range" + end + + # inner class + class Leds_matrix + var strip + var offset + var h, w + var alternate # are rows in alternate mode (even/odd are reversed) + + def init(strip, w, h, offset) + self.strip = strip + self.offset = offset + self.h = h + self.w = w + self.alternate = false + end + + def clear() + self.clear_to(0x000000) + self.show() + end + + def begin() + # do nothing, already being handled by physical strip + end + def show(force) + # don't trigger on segment, you will need to trigger on full strip instead + if bool(force) || (self.offset == 0 && self.w * self.h == self.strip.leds) + self.strip.show() + end + end + def can_show() + return self.strip.can_show() + end + def is_dirty() + return self.strip.is_dirty() + end + def dirty() + self.strip.dirty() + end + def pixels_buffer() + return nil + end + def pixel_size() + return self.strip.pixel_size() + end + def pixel_count() + return self.w * self.h + end + def clear_to(col, bri) + var i = 0 + while i < self.w * self.h + self.strip.set_pixel_color(i + self.offset, col, bri) + i += 1 + end + end + def set_pixel_color(idx, col, bri) + self.strip.set_pixel_color(idx + self.offset, col, bri) + end + def get_pixel_color(idx) + return self.strip.get_pixel_color(idx + self.offseta) + end + + # Leds_matrix specific + def set_alternate(alt) + self.alternate = alt + end + def get_alternate() + return self.alternate + end + + def set_matrix_pixel_color(x, y, col, bri) + if self.alternate && x % 2 + # reversed line + self.strip.set_pixel_color(x * self.w + self.h - y - 1 + self.offset, col, bri) + else + self.strip.set_pixel_color(x * self.w + y + self.offset, col, bri) + end + end + end + + return Leds_matrix(self, w, h, offset) + + end + + static def matrix(w, h, gpio, rmt) + var strip = Leds(w * h, gpio, rmt) + var matrix = strip.create_matrix(w, h, 0) + return matrix + end +end + + +#- + +var s = Leds(25, gpio.pin(gpio.WS2812, 1)) +s.clear_to(0x300000) +s.show() +i = 0 + +def anim() + s.clear_to(0x300000) + s.set_pixel_color(i, 0x004000) + s.show() + i = (i + 1) % 25 + tasmota.set_timer(200, anim) +end +anim() + +-# + +#- + +var s = Leds_matrix(5, 5, gpio.pin(gpio.WS2812, 1)) +s.set_alternate(true) +s.clear_to(0x300000) +s.show() +x = 0 +y = 0 + +def anim() + s.clear_to(0x300000) + s.set_matrix_pixel_color(x, y, 0x004000) + s.show() + y = (y + 1) % 5 + if y == 0 + x = (x + 1) % 5 + end + tasmota.set_timer(200, anim) +end +anim() + +-# diff --git a/lib/libesp32/berry/default/embedded/leds_animator.be b/lib/libesp32/berry/default/embedded/leds_animator.be new file mode 100644 index 000000000..1ed25b491 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/leds_animator.be @@ -0,0 +1,70 @@ +# class Leds_animator + +class Leds_animator + var strip # neopixelbus object + var pixel_count # number of pixels in the strip + var bri # brightness of the animation, 0..100, default 50 + var running # is the animation running + var animators # animators list + + def init(strip) + self.strip = strip + self.bri = 50 # percentage of brightness 0..100 + self.running = false + self.pixel_count = strip.pixel_count() + self.animators = [] + # + self.clear() # clear all leds first + # + tasmota.add_driver(self) + end + + def add_anim(anim) + self.animators.push(anim) + anim.run() # start the animator + end + + def clear() + self.stop() + self.strip.clear() + end + def start() + self.running = true + end + def stop() + self.running = false + end + + def set_bri(bri) + self.bri = bri + end + def get_bri(bri) + return self.bri + end + + def every_50ms() + if self.running + # run animators first + var i = 0 + while i < size(self.animators) + var anim = self.animators[i] + if anim.is_running() + anim.animate() + i += 1 + else + self.animators.remove(i) # remove any finished animator + end + end + # tirgger animate and display + self.animate() + end + end + + def animate() + # placeholder - do nothing by default + end + + def remove() + tasmota.remove_driver(self) + end +end diff --git a/lib/libesp32/berry/default/embedded/lv_clock_icon.be b/lib/libesp32/berry/default/embedded/lv_clock_icon.be new file mode 100644 index 000000000..f5d19ca11 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/lv_clock_icon.be @@ -0,0 +1,54 @@ +#- LVGL lv_clock_icon + - +--# + +class lv_clock_icon: lv.label + var hour, minute, sec + + def init(parent) + super(self).init(parent) + var f_s7_16 = lv.seg7_font(16) + if f_s7_16 != nil self.set_style_text_font(f_s7_16, lv.PART_MAIN | lv.STATE_DEFAULT) end + + if parent != nil + var parent_height = parent.get_height() + + self.set_text("--:--") + self.refr_size() + var w = self.get_width() + self.set_y((parent.get_height() - self.get_height()) / 2) # center vertically + + var pad_right = parent.get_style_pad_right(lv.PART_MAIN | lv.STATE_DEFAULT) + self.set_x(parent.get_width() - w - pad_right - 3) + parent.set_style_pad_right(pad_right + w + 6, lv.PART_MAIN | lv.STATE_DEFAULT) + + self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT) + end + + tasmota.add_driver(self) + end + + def set_time(hour, minute, sec) + import string + if hour != self.hour || minute != self.minute || sec != self.sec + var txt = string.format("%02d%s%02d", hour, sec % 2 ? ":" : " ", minute) + self.hour = hour + self.minute = minute + self.sec = sec + #if txt[0] == '0' txt = '!' .. string.split(txt,1)[1] end # replace first char with '!' + self.set_text(txt) + end + end + + def every_second() + var now = tasmota.time_dump(tasmota.rtc()['local']) + if now['year'] != 1970 + self.set_time(now['hour'], now['min'], now['sec']) + end + end + + def del() + super(self).del() + tasmota.remove_driver(self) + end +end \ No newline at end of file diff --git a/lib/libesp32/berry/default/embedded/lv_signal_arcs.be b/lib/libesp32/berry/default/embedded/lv_signal_arcs.be new file mode 100644 index 000000000..7dd924e90 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/lv_signal_arcs.be @@ -0,0 +1,133 @@ +#- LVGL lv_signal_bars and lv_wifi_bars + - +--# + +class lv_signal_arcs : lv.obj + var percentage # value to display, range 0..100 + var p1, p2, area, line_dsc # instances of objects kept to avoid re-instanciating at each call + + def init(parent) + # init custom widget (don't call super constructor) + _lvgl.create_custom_widget(self, parent) + # own values + self.percentage = 100 + # pre-allocate buffers + self.p1 = lv.point() + self.p2 = lv.point() + self.area = lv.area() + self.line_dsc = lv.draw_line_dsc() + end + + def widget_event(cl, event) + # Call the ancestor's event handler + if lv.obj_event_base(cl, event) != lv.RES_OK return end + var code = event.code + + import math + def atleast1(x) if x >= 1 return x else return 1 end end + # the model is that we have 4 bars and inter-bar (1/4 of width) + var height = self.get_height() + var width = self.get_width() + + var inter_bar = atleast1(height / 8) + var bar = atleast1((height - inter_bar * 2) / 3) + var bar_offset = bar / 2 + #print("inter_bar", inter_bar, "bar", bar, "bar_offset", bar_offset) + + if code == lv.EVENT_DRAW_MAIN + var clip_area = lv.area(event.param) + + # get coordinates of object + self.get_coords(self.area) + var x_ofs = self.area.x1 + var y_ofs = self.area.y1 + + lv.draw_line_dsc_init(self.line_dsc) # initialize lv.draw_line_dsc structure + self.init_draw_line_dsc(lv.PART_MAIN, self.line_dsc) # copy the current values + + self.line_dsc.round_start = 1 + self.line_dsc.round_end = 1 + self.line_dsc.width = (bar * 3 + 1) / 4 + var on_color = self.get_style_line_color(lv.PART_MAIN | lv.STATE_DEFAULT) + var off_color = self.get_style_bg_color(lv.PART_MAIN | lv.STATE_DEFAULT) + + # initial calculation, but does not take into account bounding box + # var angle = int(math.deg(math.atan2(width / 2, height))) + + # better calculation + var hypotenuse = height - bar # center if at bar/2 from bottom and circle stops at bar/2 from top + var adjacent = width / 2 - bar_offset # stop at bar_offset from side + var angle = int(90 - math.deg(math.acos(real(adjacent) / real(hypotenuse)))) + if (angle > 45) angle = 45 end + + # print("hypotenuse",hypotenuse,"adjacent",adjacent,"angle",angle) + self.p1.x = x_ofs + width / 2 + self.p1.y = y_ofs + height - 1 - bar_offset + + self.line_dsc.color = self.percentage >= 25 ? on_color : off_color + lv.draw_arc(self.p1.x, self.p1.y, 0 * (bar + inter_bar) + bar_offset, 0, 360, clip_area, self.line_dsc) + self.line_dsc.color = self.percentage >= 50 ? on_color : off_color + lv.draw_arc(self.p1.x, self.p1.y, 1 * (bar + inter_bar) + bar_offset - 1, 270 - angle, 270 + angle, clip_area, self.line_dsc) + self.line_dsc.color = self.percentage >= 75 ? on_color : off_color + lv.draw_arc(self.p1.x, self.p1.y, 2 * (bar + inter_bar) + bar_offset - 2, 270 - angle, 270 + angle, clip_area, self.line_dsc) + + #elif mode == lv.DESIGN_DRAW_POST # commented since we don't want a frame around this object + # self.ancestor_design.call(self, clip_area, mode) + end + end + + def set_percentage(v) + var old_bars = self.percentage / 25 + if v > 100 v = 100 end + if v < 0 v = 0 end + self.percentage = v + if old_bars != v / 25 + self.invalidate() # be frugal and avoid updating the widget if it's not needed + end + end + + def get_percentage() + return self.percentage + end +end + +class lv_wifi_arcs: lv_signal_arcs + def init(parent) + super(self).init(parent) + tasmota.add_driver(self) + self.set_percentage(0) # we generally start with 0, meaning not connected + end + + def every_second() + var wifi = tasmota.wifi() + var quality = wifi.find("quality") + var ip = wifi.find("ip") + if ip == nil + self.set_percentage(0) + elif quality != nil + self.set_percentage(quality) + end + end + + def del() + super(self).del() + tasmota.remove_driver(self) + end +end + +class lv_wifi_arcs_icon: lv_wifi_arcs + def init(parent) + super(self).init(parent) + self.set_style_line_color(lv.color(lv.COLOR_WHITE), lv.PART_MAIN | lv.STATE_DEFAULT) + self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT) + if parent != nil + var parent_height = parent.get_height() + var pad_right = parent.get_style_pad_right(lv.PART_MAIN | lv.STATE_DEFAULT) + self.set_height(parent_height) + var w = (parent_height*4)/3 + self.set_width(w) # 130% + self.set_x(parent.get_width() - w - pad_right) + parent.set_style_pad_right(pad_right + w + 1, lv.PART_MAIN | lv.STATE_DEFAULT) + end + end +end \ No newline at end of file diff --git a/lib/libesp32/berry/default/embedded/lv_signal_bars.be b/lib/libesp32/berry/default/embedded/lv_signal_bars.be new file mode 100644 index 000000000..f548457b9 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/lv_signal_bars.be @@ -0,0 +1,118 @@ +#- LVGL lv_signal_bars and lv_wifi_bars + - +--# + +class lv_signal_bars : lv.obj + var percentage # value to display, range 0..100 + var p1, p2, area, line_dsc # instances of objects kept to avoid re-instanciating at each call + + def init(parent) + # init custom widget (don't call super constructor) + _lvgl.create_custom_widget(self, parent) + # own values + self.percentage = 100 + # pre-allocate buffers + self.p1 = lv.point() + self.p2 = lv.point() + self.area = lv.area() + self.line_dsc = lv.draw_line_dsc() + end + + def widget_event(cl, event) + # Call the ancestor's event handler + if lv.obj_event_base(cl, event) != lv.RES_OK return end + var code = event.code + + def atleast1(x) if x >= 1 return x else return 1 end end + # the model is that we have 4 bars and inter-bar (1/4 of width) + var height = self.get_height() + var width = self.get_width() + + var inter_bar = atleast1(width / 15) + var bar = atleast1((width - inter_bar * 3) / 4) + var bar_offset = bar / 2 + + if code == lv.EVENT_DRAW_MAIN + var clip_area = lv.area(event.param) + + # get coordinates of object + self.get_coords(self.area) + var x_ofs = self.area.x1 + var y_ofs = self.area.y1 + + lv.draw_line_dsc_init(self.line_dsc) # initialize lv_draw_line_dsc structure + self.init_draw_line_dsc(lv.PART_MAIN, self.line_dsc) # copy the current values + + self.line_dsc.round_start = 1 + self.line_dsc.round_end = 1 + self.line_dsc.width = bar + var on_color = self.get_style_line_color(lv.PART_MAIN | lv.STATE_DEFAULT) + var off_color = self.get_style_bg_color(lv.PART_MAIN | lv.STATE_DEFAULT) + + lv.event_send(self, lv.EVENT_DRAW_PART_BEGIN, self.line_dsc) + for i:0..3 # 4 bars + self.line_dsc.color = self.percentage >= (i+1)*20 ? on_color : off_color + self.p1.y = y_ofs + height - 1 - bar_offset + self.p1.x = x_ofs + i * (bar + inter_bar) + bar_offset + self.p2.y = y_ofs + ((3 - i) * (height - bar)) / 4 + bar_offset + self.p2.x = self.p1.x + lv.draw_line(self.p1, self.p2, clip_area, self.line_dsc) + end + lv.event_send(self, lv.EVENT_DRAW_PART_END, self.line_dsc) + end + end + + def set_percentage(v) + var old_bars = self.percentage / 20 + if v > 100 v = 100 end + if v < 0 v = 0 end + self.percentage = v + if old_bars != v / 20 + self.invalidate() # be frugal and avoid updating the widget if it's not needed + end + end + + def get_percentage() + return self.percentage + end +end + +class lv_wifi_bars: lv_signal_bars + def init(parent) + super(self).init(parent) + tasmota.add_driver(self) + self.set_percentage(0) # we generally start with 0, meaning not connected + end + + def every_second() + var wifi = tasmota.wifi() + var quality = wifi.find("quality") + var ip = wifi.find("ip") + if ip == nil + self.set_percentage(0) + elif quality != nil + self.set_percentage(quality) + end + end + + def del() + super(self).del() + tasmota.remove_driver(self) + end +end + +class lv_wifi_bars_icon: lv_wifi_bars + def init(parent) + super(self).init(parent) + self.set_style_line_color(lv.color(lv.COLOR_WHITE), lv.PART_MAIN | lv.STATE_DEFAULT) + self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT) + if parent != nil + var parent_height = parent.get_height() + var pad_right = parent.get_style_pad_right(lv.PART_MAIN | lv.STATE_DEFAULT) + self.set_height(parent_height) + self.set_width(parent_height) + self.set_x(parent.get_width() - parent_height - pad_right) + parent.set_style_pad_right(pad_right + parent_height + 1, lv.PART_MAIN | lv.STATE_DEFAULT) + end + end +end diff --git a/lib/libesp32/berry/default/embedded/lvgl_glob.be b/lib/libesp32/berry/default/embedded/lvgl_glob.be new file mode 100644 index 000000000..04250ff54 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/lvgl_glob.be @@ -0,0 +1,256 @@ +#- embedded class for LVGL globals -# + +#- This class stores all globals used by LVGL and cannot be stored in the solidified module -# +#- this limits the globals to a single value '_lvgl' -# +class LVGL_glob + # all variables are lazily initialized to reduce the memory pressure. Until they are used, they consume zero memory + var cb_obj # map between a native C pointer (as int) and the corresponding lv.lv_* berry object, also helps marking the objects as non-gc-able + var cb_event_closure # mapping for event closures per LVGL native pointer (int) + var event_cb # native callback for lv.lv_event + + #- below are native callbacks mapped to a closure to a method of this instance -# + var null_cb # cb called if type is not supported + var widget_ctor_cb + var widget_dtor_cb + var widget_event_cb + + var widget_struct_default + var widget_struct_by_class + + #- this is the fallback callback, if the event is unknown or unsupported -# + static cb_do_nothing = def() print("LVG: call to unsupported callback") end + + #- register an lv.lv_* object in the mapping -# + def register_obj(obj) + if self.cb_obj == nil self.cb_obj = {} end + self.cb_obj[obj._p] = obj + end + + def get_object_from_ptr(ptr) + if self.cb_obj != nil + return self.cb_obj.find(ptr) # raise an exception if something is wrong + end + end + + def lvgl_event_dispatch(event_ptr) + import introspect + + var event = lv.lv_event(introspect.toptr(event_ptr)) + + var target = event.target + var f = self.cb_event_closure[target] + var obj = self.get_object_from_ptr(target) + #print('>> lvgl_event_dispatch', f, obj, event) + f(obj, event) + end + + def gen_cb(name, f, obj, ptr) + #print('>> gen_cb', name, obj, ptr) + # record the object, whatever the callback + + if name == "lv_event_cb" + if self.cb_event_closure == nil self.cb_event_closure = {} end + if self.event_cb == nil self.event_cb = tasmota.gen_cb(/ event_ptr -> self.lvgl_event_dispatch(event_ptr)) end # encapsulate 'self' in closure + + self.register_obj(obj) + self.cb_event_closure[ptr] = f + return self.event_cb + # elif name == "" + else + if self.null_cb == nil self.null_cb = tasmota.gen_cb(self.cb_do_nothing) end + return self.null_cb + end + end + + def widget_ctor_impl(cl_ptr, obj_ptr) + import introspect + var cl = lv.lv_obj_class(cl_ptr) + var obj = self.get_object_from_ptr(obj_ptr) + if self.cb_obj.find(obj) obj = self.cb_obj[obj] end + # print("widget_ctor_impl", cl, obj) + if type(obj) == 'instance' && introspect.get(obj, 'widget_constructor') + obj.widget_constructor(cl) + end + end + def widget_dtor_impl(cl_ptr, obj_ptr) + import introspect + var cl = lv.lv_obj_class(cl_ptr) + var obj = self.get_object_from_ptr(obj_ptr) + # print("widget_dtor_impl", cl, obj) + if type(obj) == 'instance' && introspect.get(obj, 'widget_destructor') + obj.widget_destructor(cl) + end + end + def widget_event_impl(cl_ptr, e_ptr) + import introspect + var cl = lv.lv_obj_class(cl_ptr) + var event = lv.lv_event(e_ptr) + var obj_ptr = event.target + var obj = self.get_object_from_ptr(obj_ptr) + if type(obj) == 'instance' && introspect.get(obj, 'widget_event') + obj.widget_event(cl, event) + end + # print("widget_event_impl", cl, obj_ptr, obj, event) + end + + + def widget_cb() + if self.widget_ctor_cb == nil self.widget_ctor_cb = tasmota.gen_cb(/ cl, obj -> self.widget_ctor_impl(cl, obj)) end + if self.widget_dtor_cb == nil self.widget_dtor_cb = tasmota.gen_cb(/ cl, obj -> self.widget_dtor_impl(cl, obj)) end + if self.widget_event_cb == nil self.widget_event_cb = tasmota.gen_cb(/ cl, e -> self.widget_event_impl(cl, e)) end + + if self.widget_struct_default == nil + self.widget_struct_default = lv.lv_obj_class(lv.lv_obj._class).copy() + self.widget_struct_default.base_class = lv.lv_obj._class # by default, inherit from base class `lv_obj`, this can be overriden + self.widget_struct_default.constructor_cb = self.widget_ctor_cb # set the berry cb dispatchers + self.widget_struct_default.destructor_cb = self.widget_dtor_cb + self.widget_struct_default.event_cb = self.widget_event_cb + end + end + + #- deregister_obj all information linked to a specific LVGL native object (int) -# + def deregister_obj(obj) + if self.cb_obj != nil self.cb_obj.remove(obj) end + if self.cb_event_closure != nil self.cb_event_closure.remove(obj) end + end + + #- initialize a custom widget -# + #- arg must be a subclass of lv.lv_obj -# + def create_custom_widget(obj, parent) + import introspect + + if !isinstance(obj, lv.lv_obj) raise "value_error", "arg must be a subclass of lv_obj" end + if self.widget_struct_by_class == nil self.widget_struct_by_class = {} end + + var obj_classname = classname(obj) + var obj_class_struct = self.widget_struct_by_class.find(obj_classname) + # print("classname=",obj_classname,"_class",super(obj)._class) + #- not already built, create a new one for this class -# + if obj_class_struct == nil + self.widget_cb() # set up all structures + obj_class_struct = self.widget_struct_default.copy() # get a copy of the structure with pre-defined callbacks + obj_class_struct.base_class = super(obj)._class + if introspect.get(obj, 'widget_width_def') obj_class_struct.width_def = obj.widget_width_def end + if introspect.get(obj, 'widget_height_def') obj_class_struct.height_def = obj.widget_height_def end + if introspect.get(obj, 'widget_editable') obj_class_struct.editable = obj.widget_editable end + if introspect.get(obj, 'widget_group_def') obj_class_struct.group_def = obj.widget_group_def end + if introspect.get(obj, 'widget_instance_size') obj_class_struct.instance_size = obj.widget_instance_size end + + #- keep a copy of the structure to avoid GC and reuse if needed -# + self.widget_struct_by_class[obj_classname] = obj_class_struct + end + + var lv_obj_ptr = lv.obj_class_create_obj(obj_class_struct, parent) + obj._p = lv_obj_ptr._p + self.register_obj(obj) + obj.class_init_obj() + end +end + +_lvgl = LVGL_glob() + +# class lv_custom_widget : lv.lv_obj +# # static widget_width_def +# # static widget_height_def +# # static widget_editable +# # static widget_group_def +# # static widget_instance_size +# # +# var percentage # value to display, range 0..100 +# var p1, p2, area, line_dsc # instances of objects kept to avoid re-instanciating at each call + +# def init(parent) +# _lvgl.create_custom_widget(self, parent) +# # own values +# self.percentage = 100 +# # pre-allocate buffers +# self.p1 = lv.lv_point() +# self.p2 = lv.lv_point() +# self.area = lv.lv_area() +# self.line_dsc = lv.lv_draw_line_dsc() +# end + +# # def widget_constructor(cl) +# # print("widget_constructor", cl) +# # end + +# # def widget_destructor(cl) +# # print("widget_destructor", cl) +# # end + +# def widget_event(cl, event) +# var res = lv.obj_event_base(cl, event) +# if res != lv.RES_OK return end + +# def atleast1(x) if x >= 1 return x else return 1 end end +# # the model is that we have 4 bars and inter-bar (1/4 of width) +# var height = self.get_height() +# var width = self.get_width() + +# var inter_bar = atleast1(width / 15) +# var bar = atleast1((width - inter_bar * 3) / 4) +# var bar_offset = bar / 2 + +# var code = event.code +# if code == lv.EVENT_DRAW_MAIN +# var clip_area = lv.lv_area(event.param) +# print("widget_event DRAW", clip_area.tomap()) +# # lv.event_send(self, lv.EVENT_DRAW_MAIN, clip_area) + +# # get coordinates of object +# self.get_coords(self.area) +# var x_ofs = self.area.x1 +# var y_ofs = self.area.y1 + +# lv.draw_line_dsc_init(self.line_dsc) # initialize lv.lv_draw_line_dsc structure +# self.init_draw_line_dsc(lv.PART_MAIN, self.line_dsc) + +# self.line_dsc.round_start = 1 +# self.line_dsc.round_end = 1 +# self.line_dsc.width = bar + +# var on_color = self.get_style_line_color(lv.PART_MAIN | lv.STATE_DEFAULT) +# var off_color = self.get_style_bg_color(lv.PART_MAIN | lv.STATE_DEFAULT) + +# lv.event_send(self, lv.EVENT_DRAW_PART_BEGIN, self.line_dsc) +# for i:0..3 # 4 bars +# self.line_dsc.color = self.percentage >= (i+1)*20 ? on_color : off_color +# self.p1.y = y_ofs + height - 1 - bar_offset +# self.p1.x = x_ofs + i * (bar + inter_bar) + bar_offset +# self.p2.y = y_ofs + ((3 - i) * (height - bar)) / 4 + bar_offset +# self.p2.x = self.p1.x +# lv.draw_line(self.p1, self.p2, clip_area, self.line_dsc) +# end +# lv.event_send(self, lv.EVENT_DRAW_PART_END, self.line_dsc) + +# end +# end + +# def set_percentage(v) +# var old_bars = self.percentage / 5 +# if v > 100 v = 100 end +# if v < 0 v = 0 end +# self.percentage = v +# if old_bars != v / 5 +# self.invalidate() # be frugal and avoid updating the widget if it's not needed +# end +# end + +# def get_percentage() +# return self.percentage +# end +# end + +# ########## ########## ########## ########## ########## ########## ########## ########## + +# lv.start() + +# hres = lv.get_hor_res() # should be 320 +# vres = lv.get_ver_res() # should be 240 + +# scr = lv.scr_act() # default screean object +# f20 = lv.montserrat_font(20) # load embedded Montserrat 20 + +# scr.set_style_bg_color(lv.lv_color(0x0000A0), lv.PART_MAIN | lv.STATE_DEFAULT) + +# w = lv_custom_widget(scr) \ No newline at end of file diff --git a/lib/libesp32/berry/default/embedded/openhasp.be b/lib/libesp32/berry/default/embedded/openhasp.be new file mode 100644 index 000000000..4232a605b --- /dev/null +++ b/lib/libesp32/berry/default/embedded/openhasp.be @@ -0,0 +1,764 @@ +import string +import json + +# lv.start() +# scr = lv.scr_act() # default screean object +# scr.set_style_bg_color(lv.color(0x0000A0), lv.PART_MAIN | lv.STATE_DEFAULT) + +lv.start() + +hres = lv.get_hor_res() # should be 320 +vres = lv.get_ver_res() # should be 240 + +scr = lv.scr_act() # default screean object +#f20 = lv.montserrat_font(20) # load embedded Montserrat 20 +r20 = lv.font_robotocondensed_latin1(20) +r16 = lv.font_robotocondensed_latin1(16) + +th2 = lv.theme_openhasp_init(0, lv.color(0xFF00FF), lv.color(0x303030), false, r16) +scr.get_disp().set_theme(th2) +# TODO +scr.set_style_bg_color(lv.color(lv.COLOR_WHITE),0) + +# apply theme to layer_top, but keep it transparent +lv.theme_apply(lv.layer_top()) +lv.layer_top().set_style_bg_opa(0,0) + + +# takes an attribute name and responds if it needs color conversion +def is_color_attribute(t) + import string + t = str(t) + # contains `color` but does not contain `color_` + return (string.find(t, "color") >= 0) && (string.find(t, "color_") < 0) +end + +# parse hex string +def parse_hex(s) + import string + s = string.toupper(s) # turn to uppercase + var val = 0 + for i:0..size(s)-1 + var c = s[i] + # var c_int = string.byte(c) + if c == "#" continue end # skip '#' prefix if any + if c == "x" || c == "X" continue end # skip 'x' or 'X' + + if c >= "A" && c <= "F" + val = (val << 4) | string.byte(c) - 55 + elif c >= "0" && c <= "9" + val = (val << 4) | string.byte(c) - 48 + end + end + return val +end + +def parse_color(s) + s = str(s) + if s[0] == '#' + return lv.color(parse_hex(s)) + else + import string + import introspect + var col_name = "COLOR_" + string.toupper(s) + var col_try = introspect.get(lv, col_name) + if col_try != nil + return lv.color(col_try) + end + end + # fail safe with black color + return lv.color(0x000000) +end + +#- ------------------------------------------------------------ + Class `lvh_obj` encapsulating `lv_obj`` + + Provide a mapping for virtual members + Stores the associated page and object id + + Adds specific virtual members used by OpenHASP +- ------------------------------------------------------------ -# +class lvh_obj + # _lv_class refers to the lvgl class encapsulated, and is overriden by subclasses + static _lv_class = lv.obj + static _lv_part2_selector # selector for secondary part (like knob of arc) + + # attributes to ignore when set at object level (they are managed by page) + static _attr_ignore = [ + "id", + "obj", + "page", + "comment", + "parentid", + "auto_size", # TODO not sure it's still needed in LVGL8 + ] + #- mapping from OpenHASP attribute to LVGL attribute -# + #- if mapping is null, we use set_X and get_X from our own class -# + static _attr_map = { + "x": "x", + "y": "y", + "w": "width", + "h": "height", + # arc + "asjustable": nil, + "mode": nil, + "start_angle": "bg_start_angle", + "start_angle1": "start_angle", + "end_angle": "bg_end_angle", + "end_angle1": "end_angle", + "radius": "style_radius", + "border_side": "style_border_side", + "bg_opa": "style_bg_opa", + "border_width": "style_border_width", + "line_width": nil, # depebds on class + "line_width1": nil, # depebds on class + "action": nil, # store the action in self._action + "hidden": nil, # apply to self + "enabled": nil, # apply to self + "click": nil, # synonym to enabled + "toggle": nil, + "bg_color": "style_bg_color", + "bg_grad_color": "style_bg_grad_color", + "type": nil, + # below automatically create a sub-label + "text": nil, # apply to self + "value_str": nil, # synonym to 'text' + "align": nil, + "text_font": nil, + "value_font": nil, # synonym to text_font + "text_color": nil, + "value_color": nil, # synonym to text_color + "value_ofs_x": nil, + "value_ofs_y": nil, + # + "min": nil, + "max": nil, + "val": "value", + "rotation": "rotation", + # img + "src": "src", + "image_recolor": "style_img_recolor", + "image_recolor_opa": "style_img_recolor_opa", + # spinner + "angle": nil, + "speed": nil, + # padding of knob + "pad_top2": nil, + "pad_bottom2": nil, + "pad_left2": nil, + "pad_right2": nil, + "pad_all2": nil, + "radius2": nil, + } + + var _lv_obj # native lvgl object + var _lv_label # sub-label if exists + var _action # action for OpenHASP + + # init + # - create the LVGL encapsulated object + # arg1: parent object + # arg2: json line object + def init(parent, jline) + var obj_class = self._lv_class # need to assign to a var to distinguish from method call + self._lv_obj = obj_class(parent) # instanciate LVGL object + self.post_init() + end + + # post-init, to be overriden + def post_init() + end + + # get LVGL encapsulated object + def get_obj() + return self._lv_obj + end + + def set_action(t) + self._action = str(t) + end + def get_action() + return self._action() + end + + def set_line_width(t) + self._lv_obj.set_style_line_width(int(t), lv.PART_MAIN | lv.STATE_DEFAULT) + end + def get_line_width() + return self._lv_obj.get_style_line_width(lv.PART_MAIN | lv.STATE_DEFAULT) + end + + #- ------------------------------------------------------------ + Mapping of synthetic attributes + - text + - hidden + - enabled + - ------------------------------------------------------------ -# + #- `hidden` attributes mapped to OBJ_FLAG_HIDDEN -# + def set_hidden(h) + if h + self._lv_obj.add_flag(lv.OBJ_FLAG_HIDDEN) + else + self._lv_obj.clear_flag(lv.OBJ_FLAG_HIDDEN) + end + end + + def get_hidden() + return self._lv_obj.has_flag(lv.OBJ_FLAG_HIDDEN) + end + + #- `enabled` attributes mapped to OBJ_FLAG_CLICKABLE -# + def set_enabled(h) + if h + self._lv_obj.add_flag(lv.OBJ_FLAG_CLICKABLE) + else + self._lv_obj.clear_flag(lv.OBJ_FLAG_CLICKABLE) + end + end + + def get_enabled() + return self._lv_obj.has_flag(lv.OBJ_FLAG_CLICKABLE) + end + # click is synonym to enabled + def set_click(t) self.set_enabled(t) end + def get_click() return self.get_enabled() end + + #- `toggle` attributes mapped to STATE_CHECKED -# + def set_toggle(t) + if t == "TRUE" t = true end + if t == "FALSE" t = false end + if t + self._lv_obj.add_state(lv.STATE_CHECKED) + else + self._lv_obj.clear_state(lv.STATE_CHECKED) + end + end + + def get_toggle() + return self._lv_obj.has_state(lv.STATE_CHECKED) + end + + def set_adjustable(t) + if t + self._lv_obj.add_flag(lv.OBJ_FLAG_CLICKABLE) + else + self._lv_obj.clear_flag(lv.OBJ_FLAG_CLICKABLE) + end + end + def get_adjustable() + return self._lv_obj.has_flag(lv.OBJ_FLAG_CLICKABLE) + end + + #- set_text: create a `lv_label` sub object to the current object -# + #- (default case, may be overriden by object that directly take text) -# + def check_label() + if self._lv_label == nil + self._lv_label = lv.label(self.get_obj()) + self._lv_label.set_align(lv.ALIGN_CENTER); + end + end + + def set_text(t) + self.check_label() + self._lv_label.set_text(str(t)) + end + def set_value_str(t) self.set_text(t) end + + def get_text() + if self._lv_label == nil return nil end + return self._lv_label.get_text() + end + def get_value_str() return self.get_text() end + + def set_align(t) + var align + self.check_label() + if t == 0 || t == "left" + align = lv.TEXT_ALIGN_LEFT + elif t == 1 || t == "center" + align = lv.TEXT_ALIGN_CENTER + elif t == 2 || t == "right" + align = lv.TEXT_ALIGN_RIGHT + end + self._lv_label.set_style_text_align(align, lv.PART_MAIN | lv.STATE_DEFAULT) + end + + def get_align() + if self._lv_label == nil return nil end + var align self._lv_label.get_style_text_align(lv.PART_MAIN | lv.STATE_DEFAULT) + if align == lv.TEXT_ALIGN_LEFT + return "left" + elif align == lv.TEXT_ALIGN_CENTER + return "center" + elif align == lv.TEXT_ALIGN_RIGHT + return "right" + else + return nil + end + end + + def set_text_font(t) + self.check_label() + var f = lv.font_robotocondensed_latin1(int(t)) + if f != nil + self._lv_label.set_style_text_font(f, lv.PART_MAIN | lv.STATE_DEFAULT) + else + print("HSP: Unsupported font size: robotocondensed-latin1", t) + end + end + def get_text_font() + end + def set_value_font(t) self.set_text_font(t) end + def get_value_font() return self.get_text_font() end + + def set_text_color(t) + self.check_label() + self._lv_label.set_style_text_color(parse_color(t), lv.PART_MAIN | lv.STATE_DEFAULT) + end + def get_text_color() + return self._text_color + end + def set_value_color(t) self.set_text_color(t) end + def get_value_color() return self.get_value_color() end + + def set_value_ofs_x(t) + self.check_label() + self._lv_label.set_x(int(t)) + end + def get_value_ofs_x() + return self._lv_label.get_x() + end + def set_value_ofs_y(t) + self.check_label() + self._lv_label.set_y(int(t)) + end + def get_value_ofs_y() + return self._lv_label.get_y() + end + + # secondary element + def set_pad_top2(t) + if self._lv_part2_selector != nil + self._lv_obj.set_style_pad_top(int(t), self._lv_part2_selector | lv.STATE_DEFAULT) + end + end + def set_pad_bottom2(t) + if self._lv_part2_selector != nil + self._lv_obj.set_style_pad_bottom(int(t), self._lv_part2_selector | lv.STATE_DEFAULT) + end + end + def set_pad_left2(t) + if self._lv_part2_selector != nil + self._lv_obj.set_style_pad_left(int(t), self._lv_part2_selector | lv.STATE_DEFAULT) + end + end + def set_pad_right2(t) + if self._lv_part2_selector != nil + self._lv_obj.set_style_pad_right(int(t), self._lv_part2_selector | lv.STATE_DEFAULT) + end + end + def set_pad_all2(t) + if self._lv_part2_selector != nil + self._lv_obj.set_style_pad_all(int(t), self._lv_part2_selector | lv.STATE_DEFAULT) + end + end + + def get_pad_top() + if self._lv_part2_selector != nil + return self._lv_obj.get_style_pad_top(self._lv_part2_selector | lv.STATE_DEFAULT) + end + end + def get_pad_bottomo() + if self._lv_part2_selector != nil + return self._lv_obj.get_style_pad_bottom(self._lv_part2_selector | lv.STATE_DEFAULT) + end + end + def get_pad_left() + if self._lv_part2_selector != nil + return self._lv_obj.get_style_pad_left(self._lv_part2_selector | lv.STATE_DEFAULT) + end + end + def get_pad_right() + if self._lv_part2_selector != nil + return self._lv_obj.get_style_pad_right(self._lv_part2_selector | lv.STATE_DEFAULT) + end + end + def get_pad_all() + end + + def set_radius2(t) + if self._lv_part2_selector != nil + self._lv_obj.set_style_radius(int(t), self._lv_part2_selector | lv.STATE_DEFAULT) + end + end + def get_radius2() + if self._lv_part2_selector != nil + return self._lv_obj.get_style_radius(self._lv_part2_selector | lv.STATE_DEFAULT) + end + end + + #- ------------------------------------------------------------ + Mapping of virtual attributes + - ------------------------------------------------------------ -# + def member(k) + # tostring is a special case, we shouldn't raise an exception for it + if k == 'tostring' return nil end + # + if self._attr_map.has(k) + import introspect + var kv = self._attr_map[k] + if kv + var f = introspect.get(self._lv_obj, "get_" + kv) + if type(f) == 'function' + return f(self._lv_obj) + end + else + # call self method + var f = introspect.get(self, "get_" + k) + if type(f) == 'function' + return f(self, k) + end + end + end + raise "value_error", "unknown attribute " + str(k) + end + + def setmember(k, v) + import string + # print(">> setmember", k, v) + # print(">>", classname(self), self._attr_map) + if self._attr_ignore.find(k) != nil + return + elif self._attr_map.has(k) + import introspect + var kv = self._attr_map[k] + if kv + var f = introspect.get(self._lv_obj, "set_" + kv) + # if the attribute contains 'color', convert to lv_color + if type(kv) == 'string' && is_color_attribute(kv) + v = parse_color(v) + end + # print("f=", f, v, kv, self._lv_obj, self) + if type(f) == 'function' + if string.find(kv, "style_") == 0 + # style function need a selector as second parameter + f(self._lv_obj, v, lv.PART_MAIN | lv.STATE_DEFAULT) + else + f(self._lv_obj, v) + end + return + else + print("HSP: Could not find function set_"+kv) + end + else + # call self method + var f = introspect.get(self, "set_" + k) + # print("f==",f) + if type(f) == 'function' + f(self, v) + return + end + end + + else + print("HSP: unknown attribute:", k) + end + # silently ignore if the attribute name is not supported + end +end + +#- ------------------------------------------------------------ + Other widgets +- ------------------------------------------------------------ -# + +#- ------------------------------------------------------------ + label +#- ------------------------------------------------------------# +class lvh_label : lvh_obj + static _lv_class = lv.label + # label do not need a sub-label + def post_init() + self._lv_label = self._lv_obj + end +end + +#- ------------------------------------------------------------ + arc +#- ------------------------------------------------------------# +class lvh_arc : lvh_obj + static _lv_class = lv.arc + static _lv_part2_selector = lv.PART_KNOB + + # line_width converts to arc_width + def set_line_width(t) + self._lv_obj.set_style_arc_width(int(t), lv.PART_MAIN | lv.STATE_DEFAULT) + end + def get_line_width() + return self._lv_obj.get_arc_line_width(lv.PART_MAIN | lv.STATE_DEFAULT) + end + def set_line_width1(t) + self._lv_obj.set_style_arc_width(int(t), lv.PART_INDICATOR | lv.STATE_DEFAULT) + end + def get_line_width1() + return self._lv_obj.get_arc_line_width(lv.PART_INDICATOR | lv.STATE_DEFAULT) + end + + def set_min(t) + self._lv_obj.set_range(int(t), self.get_max()) + end + def set_max(t) + self._lv_obj.set_range(self.get_min(), int(t)) + end + def get_min() + return self._lv_obj.get_min_value() + end + def get_max() + return self._lv_obj.get_max_value() + end + def set_type(t) + var mode + if t == 0 mode = lv.ARC_MODE_NORMAL + elif t == 1 mode = lv.ARC_MODE_REVERSE + elif t == 2 mode = lv.ARC_MODE_SYMMETRICAL + end + if mode != nil + self._lv_obj.set_mode(mode) + end + end + def get_type() + return self._lv_obj.get_mode() + end + # mode + def set_mode(t) + var mode + if mode == "expand" self._lv_obj.set_width(lv.SIZE_CONTENT) + elif mode == "break" mode = lv.LABEL_LONG_WRAP + elif mode == "dots" mode = lv.LABEL_LONG_DOT + elif mode == "scroll" mode = lv.LABEL_LONG_SCROLL + elif mode == "loop" mode = lv.LABEL_LONG_SCROLL_CIRCULAR + elif mode == "crop" mode = lv.LABEL_LONG_CLIP + end + if mode != nil + self._lv_obj.lv_label_set_long_mode(mode) + end + end + def get_mode() + end + +end + +#- ------------------------------------------------------------ + switch +#- ------------------------------------------------------------# +class lvh_switch : lvh_obj + static _lv_class = lv.switch + static _lv_part2_selector = lv.PART_KNOB +end + +#- ------------------------------------------------------------ + spinner +#- ------------------------------------------------------------# +class lvh_spinner : lvh_arc + static _lv_class = lv.spinner + + # init + # - create the LVGL encapsulated object + # arg1: parent object + # arg2: json line object + def init(parent, jline) + var angle = jline.find("angle", 60) + var speed = jline.find("speed", 1000) + self._lv_obj = lv.spinner(parent, speed, angle) + self.post_init() + end + + # ignore attributes, spinner can't be changed once created + def set_angle(t) end + def get_angle() end + def set_speed(t) end + def get_speed() end +end + +#- creat sub-classes of lvh_obj and map the LVGL class in static '_lv_class' attribute -# +class lvh_bar : lvh_obj static _lv_class = lv.bar end +class lvh_btn : lvh_obj static _lv_class = lv.btn end +class lvh_btnmatrix : lvh_obj static _lv_class = lv.btnmatrix end +class lvh_checkbox : lvh_obj static _lv_class = lv.checkbox end +class lvh_dropdown : lvh_obj static _lv_class = lv.dropdown end +class lvh_img : lvh_obj static _lv_class = lv.img end +class lvh_line : lvh_obj static _lv_class = lv.line end +class lvh_roller : lvh_obj static _lv_class = lv.roller end +class lvh_slider : lvh_obj static _lv_class = lv.slider end +class lvh_textarea : lvh_obj static _lv_class = lv.textarea end + +#- ---------------------------------------------------------------------------- + Class `lvh_page` encapsulating `lv_obj` as screen (created with lv.obj(0)) +- ----------------------------------------------------------------------------- -# +# ex of transition: lv.scr_load_anim(scr, lv.SCR_LOAD_ANIM_MOVE_RIGHT, 500, 0, false) +class lvh_page + var _obj_id # (map) of objects by id numbers + var _page_id # (int) id number of the page + var _lv_scr # (lv_obj) lvgl screen object + + #- init(page_number) -# + def init(page_number) + import global + + # if no parameter, default to page #1 + if page_number == nil page_number = 1 end + + self._page_id = page_number # remember our page_number + self._obj_id = {} # init list of objects + if page_number == 1 + self._lv_scr = lv.scr_act() # default screen + elif page_number == 0 + self._lv_scr = lv.layer_top() # top layer, visible over all screens + else + self._lv_scr = lv.obj(0) # allocate a new screen + # self._lv_scr.set_style_bg_color(lv.color(0x000000), lv.PART_MAIN | lv.STATE_DEFAULT) # set black background + self._lv_scr.set_style_bg_color(lv.color(0xFFFFFF), lv.PART_MAIN | lv.STATE_DEFAULT) # set white background + end + + # create a global for this page of form p, ex p1 + var glob_name = string.format("p%i", self._page_id) + global.(glob_name) = self + end + + #- retrieve lvgl screen object for this page -# + def get_scr() + return self._lv_scr + end + + #- add an object to this page -# + def set_obj(id, o) + self._obj_id[id] = o + end + def get_obj(id) + return self._obj_id.find(id) + end + + #- return id of this page -# + def id() + return self._page_id + end + + #- show this page, with animation -# + def show(anim, duration) + # ignore if there is no screen, like for id 0 + if self._lv_scr == nil return nil end + # ignore if the screen is already active + if self._lv_scr._p == lv.scr_act()._p return end # do nothing + + # default animation is lv.SCR_LOAD_ANIM_MOVE_RIGHT + if anim == nil anim = lv.SCR_LOAD_ANIM_MOVE_RIGHT end + # default duration of 500ms + if duration == nil duration = 500 end + + # load new screen with anumation, no delay, 500ms transition time, no auto-delete + lv.scr_load_anim(self._lv_scr, lv.SCR_LOAD_ANIM_MOVE_RIGHT, duration, 0, false) + end +end + +#- pages -# +var lvh_page_cur = lvh_page(1) +var lvh_pages = { 1: lvh_page_cur } # always create page #1 + +f = open("pages.jsonl","r") +var jsonl = string.split(f.read(), "\n") +f.close() + +#- ------------------------------------------------------------ + Parse page information + + Create a new page object if required + Change the active page +- ------------------------------------------------------------ -# +def parse_page(jline) + if jline.has("page") && type(jline["page"]) == 'int' + var page = int(jline["page"]) + # does the page already exist? + if lvh_pages.has(page) + # yes, just change the current page + lvh_page_cur = lvh_pages[page] + else + # no, create a new page + lvh_page_cur = lvh_page(page) + lvh_pages[page] = lvh_page_cur + end + end +end + +#- ------------------------------------------------------------ + Parse single object + +- ------------------------------------------------------------ -# +def parse_obj(jline, page) + import global + import introspect + + # line must contain 'obj' and 'id', otherwise it is ignored + if jline.has("obj") && jline.has("id") && type(jline["id"]) == 'int' + # 'obj_id' must be between 1 and 254 + var obj_id = int(jline["id"]) + if obj_id < 1 || obj_id > 254 + raise "value error", "invalid id " + str(obj_id) + end + + # extract openhasp class, prefix with `lvh_`. Ex: `btn` becomes `lvh_btn` + var obj_type = jline["obj"] + + # extract parent + var parent + var parent_id = int(jline.find("parentid")) + if parent_id != nil + var parent_obj = lvh_page_cur.get_obj(parent_id) + if parent_obj != nil + parent = parent_obj._lv_obj + end + end + if parent == nil + parent = page.get_scr() + end + + # check if a class with the requested name exists + var obj_class = introspect.get(global, "lvh_" + obj_type) + if obj_class == nil + raise "value error", "cannot find object of type " + str(obj_type) + end + + # instanciate the object, passing the lvgl screen as paren object + var obj = obj_class(parent, jline) + + # add object to page object + lvh_page_cur.set_obj(obj_id, obj) + # set attributes + # try every attribute, if not supported it is silently ignored + for k:jline.keys() + # introspect.set(obj, k, jline[k]) + obj.(k) = jline[k] + end + + # create a global variable for this object of form pb, ex p1b2 + var glob_name = string.format("p%ib%i", lvh_page_cur.id(), obj_id) + global.(glob_name) = obj + end +end + +# ex: +# {'page': 1, 'h': 50, 'obj': 'label', 'hidden': false, 'text': 'Hello', 'x': 5, 'id': 1, 'enabled': true, 'y': 5, 'w': 50} +# {"page":1,"id":2,"obj":"btn","x":5,"y":90,"h":90,"w":50,"text":"World","enabled":false,"hidden":false} + +#- ------------------------------------------------------------ + Parse jsonl file line by line + +- ------------------------------------------------------------ -# +tasmota.yield() +for j:jsonl + var jline = json.load(j) + + # parse page first + if type(jline) == 'instance' + parse_page(jline) + parse_obj(jline, lvh_page_cur) + end +end diff --git a/lib/libesp32/berry/default/embedded/openhasp/demo-all.jsonl b/lib/libesp32/berry/default/embedded/openhasp/demo-all.jsonl new file mode 100644 index 000000000..76d3ed810 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/openhasp/demo-all.jsonl @@ -0,0 +1,61 @@ +{"page":1,"comment":"---------- Page 1 ----------"} +{"page":1,"id":0,"bg_color":"#FFFFFF","bg_grad_color":"#FFFFFF","text_color":"#000000","radius":0,"border_side":0} +{"page":1,"id":1,"obj":"btn","x":0,"y":0,"w":240,"h":30,"text":"LIVING ROOM","value_font":24,"bg_color":"#2C3E50","bg_grad_color":"#2C3E50","text_color":"#FFFFFF","radius":0,"border_side":0} + +{"page":1,"id":2,"obj":"arc","x":20,"y":65,"w":80,"h":100,"max":40,"border_side":0,"type":0,"rotation":0,"start_angle":180,"end_angle":0,"start_angle1":180,"value_font":12,"value_ofs_x":0,"value_ofs_y":-14,"bg_opa":0,"text":"21.2°C","min":-20,"max":50,"val":21} + +{"page":1,"id":3,"obj":"arc","x":140,"y":65,"w":80,"h":100,"max":100,"border_side":0,"type":0,"start_angle":180,"end_angle":0,"start_angle1":180,"value_font":12,"value_color":"#000000","value_ofs_x":0,"value_ofs_y":-14,"bg_opa":0,"text":"44%","val":44} + +{"page":1,"id":4,"obj":"label","x":0,"y":120,"w":240,"h":20,"text":"CO2 levels: 1483 ppm","radius":0,"border_side":0,"align":1} +{"page":1,"id":5,"obj":"label","x":2,"y":35,"w":140,"text":"Temperature","align":1} +{"page":1,"id":6,"obj":"label","x":140,"y":35,"w":95,"text":"Humidity","align":1} +{"page":1,"id":7,"obj":"btn","x":0,"y":160,"w":240,"h":20,"text":"LIGHTS","bg_color":"#F1C40F","text_color":"#FFFFFF","radius":0,"border_side":0} +{"page":1,"id":8,"obj":"label","x":20,"y":190,"w":140,"h":20,"text":"Ceiling Light"} +{"page":1,"id":9,"obj":"switch","x":160,"y":190,"w":40,"h":20,"toggle":"TRUE"} +{"page":1,"id":10,"obj":"label","x":20,"y":215,"w":140,"h":20,"text":"Wall Light"} +{"page":1,"id":11,"obj":"switch","x":160,"y":215,"w":40,"h":20,"toggle":"TRUE"} +{"page":1,"id":12,"obj":"label","x":20,"y":240,"w":200,"h":20,"text":"Ambient Light"} +{"page":1,"id":13,"obj":"slider","x":30,"y":265,"w":200,"h":10} + +{"page":2,"comment":"---------- Page 2 ----------"} +{"page":2,"id":1,"obj":"btn","x":0,"y":0,"w":240,"h":30,"text":"ENTITIES","value_font":24,"bg_color":"#2C3E50","text_color":"#FFFFFF","radius":0,"border_side":0,"click":0} +{"page":2,"id":2,"obj":"obj","x":5,"y":35,"w":230,"h":250,"click":0} + +{"page":2,"id":11,"obj":"label","x":8,"y":33,"w":35,"h":35,"text":"\uE004","align":1,"text_font":32,"text_color":"black"} +{"page":2,"id":12,"obj":"label","x":48,"y":43,"w":130,"h":30,"text":"Presence override","align":0,"text_font":16,"text_color":"black"} +{"page":2,"id":13,"obj":"switch","x":177,"y":40,"w":50,"h":25,"radius":25,"radius2":15} + +{"page":2,"id":21,"obj":"label","x":8,"y":69,"w":35,"h":35,"text":"\uF020","align":1,"text_font":32,"text_color":"black"} +{"page":2,"id":22,"obj":"label","x":48,"y":79,"w":130,"h":30,"text":"Front door light","align":0,"text_font":16,"text_color":"black"} +{"page":2,"id":23,"obj":"switch","x":177,"y":74,"w":50,"h":25,"radius":25,"radius2":15} + +{"page":2,"id":31,"obj":"label","x":8,"y":103,"w":35,"h":35,"text":"\uF054","align":1,"text_font":32,"text_color":"black"} +{"page":2,"id":32,"obj":"label","x":48,"y":113,"w":130,"h":30,"text":"Back yard lights","align":0,"text_font":16,"text_color":"black"} +{"page":2,"id":33,"obj":"switch","x":177,"y":110,"w":50,"h":25,"radius":25,"radius2":15} + +{"page":2,"id":41,"obj":"label","x":8,"y":138,"w":35,"h":35,"text":"\uEA7A","align":1,"text_font":32,"text_color":"black"} +{"page":2,"id":42,"obj":"label","x":48,"y":148,"w":130,"h":30,"text":"Trash service","align":0,"text_font":16,"text_color":"black"} +{"page":2,"id":43,"obj":"label","x":97,"y":148,"w":130,"h":30,"text":"in 6 days","align":2,"text_color":"black"} + +{"page":2,"id":51,"obj":"label","x":8,"y":173,"w":35,"h":35,"text":"\uF39D","align":1,"text_font":32,"text_color":"black"} +{"page":2,"id":52,"obj":"label","x":48,"y":183,"w":130,"h":30,"text":"Selective trash","align":0,"text_font":16,"text_color":"black"} +{"page":2,"id":53,"obj":"label","x":97,"y":183,"w":130,"h":30,"text":"in 10 days","align":2,"text_color":"black"} + +{"page":2,"id":61,"obj":"label","x":8,"y":208,"w":35,"h":35,"text":"\uE32A","align":1,"text_font":32,"text_color":"black"} +{"page":2,"id":62,"obj":"label","x":48,"y":218,"w":130,"h":30,"text":"Green energy active","align":0,"text_font":16,"text_color":"black"} +{"page":2,"id":63,"obj":"label","x":97,"y":218,"w":130,"h":30,"text":"Yes :)","align":2,"text_color":"black"} + +{"page":2,"id":71,"obj":"label","x":8,"y":243,"w":35,"h":35,"text":"\uE957","align":1,"text_font":32,"text_color":"black"} +{"page":2,"id":72,"obj":"label","x":48,"y":253,"w":130,"h":30,"text":"Air quality","align":0,"text_font":16,"text_color":"black"} +{"page":2,"id":73,"obj":"label","x":97,"y":253,"w":130,"h":30,"text":"OK (29.58 µg/m³)","align":2,"text_color":"black"} + +{"page":3,"comment":"---------- Page 3 ----------"} +{"page":3,"id":1,"obj":"btn","x":0,"y":0,"w":240,"h":30,"text":"FAN STATUS","text_font":16,"bg_color":"#2C3E50","text_color":"#FFFFFF","radius":0,"border_side":0,"click":0} + +{"page":3,"id":11,"obj":"img","src":"A:/noun_Fan_35097_140.png","auto_size":1,"w":140,"h":140,"x":50,"y":75,"image_recolor":"lime","image_recolor_opa":150} +{"page":3,"id":12,"obj":"spinner","parentid":11,"x":7,"y":6,"w":126,"h":126,"bg_opa":0,"border_width":0,"line_width":7,"line_width1":7,"type":2,"angle":120,"speed":1000,"value_str":3,"value_font":24} + +{"page":0,"comment":"---------- All pages ----------"} +{"page":0,"id":11,"obj":"btn","action":"prev","x":0,"y":290,"w":79,"h":32,"bg_color":"#34495E","text":"\uE141","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":32} +{"page":0,"id":12,"obj":"btn","action":"back","x":80,"y":290,"w":80,"h":32,"bg_color":"#34495E","text":"\uE2DC","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":24} +{"page":0,"id":13,"obj":"btn","action":"next","x":161,"y":290,"w":79,"h":32,"bg_color":"#34495E","text":"\uE142","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":32} diff --git a/lib/libesp32/berry/default/embedded/openhasp/demo1.jsonl b/lib/libesp32/berry/default/embedded/openhasp/demo1.jsonl new file mode 100644 index 000000000..684e0d324 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/openhasp/demo1.jsonl @@ -0,0 +1,23 @@ +{"page":1,"comment":"---------- Page 1 ----------"} +{"page":1,"id":0,"bg_color":"#FFFFFF","bg_grad_color":"#FFFFFF","text_color":"#000000","radius":0,"border_side":0} +{"page":1,"id":1,"obj":"btn","x":0,"y":0,"w":240,"h":30,"text":"LIVING ROOM","value_font":22,"bg_color":"#2C3E50","bg_grad_color":"#2C3E50","text_color":"#FFFFFF","radius":0,"border_side":0} + +{"page":1,"id":2,"obj":"arc","x":20,"y":65,"w":80,"h":100,"max":40,"border_side":0,"type":0,"rotation":0,"start_angle":180,"end_angle":0,"start_angle1":180,"value_font":12,"value_ofs_x":0,"value_ofs_y":-14,"bg_opa":0,"text":"21.2°C","min":-20,"max":50,"val":21} + +{"page":1,"id":3,"obj":"arc","x":140,"y":65,"w":80,"h":100,"max":100,"border_side":0,"type":0,"start_angle":180,"end_angle":0,"start_angle1":180,"value_font":12,"value_color":"#000000","value_ofs_x":0,"value_ofs_y":-14,"bg_opa":0,"text":"44%","val":44} + +{"page":1,"id":4,"obj":"label","x":0,"y":120,"w":240,"h":20,"text":"CO2 levels: 1483 ppm","radius":0,"border_side":0,"align":1} +{"page":1,"id":5,"obj":"label","x":2,"y":35,"w":140,"text":"Temperature","align":1} +{"page":1,"id":6,"obj":"label","x":140,"y":35,"w":95,"text":"Humidity","align":1} +{"page":1,"id":7,"obj":"btn","x":0,"y":160,"w":240,"h":20,"text":"LIGHTS","bg_color":"#F1C40F","text_color":"#FFFFFF","radius":0,"border_side":0} +{"page":1,"id":8,"obj":"label","x":20,"y":190,"w":140,"h":20,"text":"Ceiling Light"} +{"page":1,"id":9,"obj":"switch","x":160,"y":190,"w":40,"h":20,"toggle":"TRUE"} +{"page":1,"id":10,"obj":"label","x":20,"y":215,"w":140,"h":20,"text":"Wall Light"} +{"page":1,"id":11,"obj":"switch","x":160,"y":215,"w":40,"h":20,"toggle":"TRUE"} +{"page":1,"id":12,"obj":"label","x":20,"y":240,"w":200,"h":20,"text":"Ambient Light"} +{"page":1,"id":13,"obj":"slider","x":30,"y":265,"w":200,"h":10} + +{"page":0,"comment":"---------- All pages ----------"} +{"page":0,"id":11,"obj":"btn","action":"prev","x":0,"y":290,"w":79,"h":32,"bg_color":"#34495E","text":"\uE141","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":32} +{"page":0,"id":12,"obj":"btn","action":"back","x":80,"y":290,"w":80,"h":32,"bg_color":"#34495E","text":"\uE2DC","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":24} +{"page":0,"id":13,"obj":"btn","action":"next","x":161,"y":290,"w":79,"h":32,"bg_color":"#34495E","text":"\uE142","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":32} diff --git a/lib/libesp32/berry/default/embedded/openhasp/demo2.jsonl b/lib/libesp32/berry/default/embedded/openhasp/demo2.jsonl new file mode 100644 index 000000000..b1d6efc34 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/openhasp/demo2.jsonl @@ -0,0 +1,35 @@ +{"page":1,"id":1,"obj":"btn","x":0,"y":0,"w":240,"h":30,"text":"ENTITIES","value_font":22,"bg_color":"#2C3E50","text_color":"#FFFFFF","radius":0,"border_side":0,"click":0} +{"page":1,"id":2,"obj":"obj","x":5,"y":35,"w":230,"h":250,"click":0} + +{"page":1,"id":11,"obj":"label","x":8,"y":33,"w":35,"h":35,"text":"\uE004","align":1,"text_font":32,"text_color":"black"} +{"page":1,"id":12,"obj":"label","x":48,"y":43,"w":130,"h":30,"text":"Presence override","align":0,"text_font":16,"text_color":"black"} +{"page":1,"id":13,"obj":"switch","x":177,"y":40,"w":50,"h":25,"radius":25,"radius2":15} + +{"page":1,"id":21,"obj":"label","x":8,"y":69,"w":35,"h":35,"text":"\uF020","align":1,"text_font":32,"text_color":"black"} +{"page":1,"id":22,"obj":"label","x":48,"y":79,"w":130,"h":30,"text":"Front door light","align":0,"text_font":16,"text_color":"black"} +{"page":1,"id":23,"obj":"switch","x":177,"y":74,"w":50,"h":25,"radius":25,"radius2":15} + +{"page":1,"id":31,"obj":"label","x":8,"y":103,"w":35,"h":35,"text":"\uF054","align":1,"text_font":32,"text_color":"black"} +{"page":1,"id":32,"obj":"label","x":48,"y":113,"w":130,"h":30,"text":"Back yard lights","align":0,"text_font":16,"text_color":"black"} +{"page":1,"id":33,"obj":"switch","x":177,"y":110,"w":50,"h":25,"radius":25,"radius2":15} + +{"page":1,"id":41,"obj":"label","x":8,"y":138,"w":35,"h":35,"text":"\uEA7A","align":1,"text_font":32,"text_color":"black"} +{"page":1,"id":42,"obj":"label","x":48,"y":148,"w":130,"h":30,"text":"Trash service","align":0,"text_font":16,"text_color":"black"} +{"page":1,"id":43,"obj":"label","x":97,"y":148,"w":130,"h":30,"text":"in 6 days","align":2,"text_color":"black"} + +{"page":1,"id":51,"obj":"label","x":8,"y":173,"w":35,"h":35,"text":"\uF39D","align":1,"text_font":32,"text_color":"black"} +{"page":1,"id":52,"obj":"label","x":48,"y":183,"w":130,"h":30,"text":"Selective trash","align":0,"text_font":16,"text_color":"black"} +{"page":1,"id":53,"obj":"label","x":97,"y":183,"w":130,"h":30,"text":"in 10 days","align":2,"text_color":"black"} + +{"page":1,"id":61,"obj":"label","x":8,"y":208,"w":35,"h":35,"text":"\uE32A","align":1,"text_font":32,"text_color":"black"} +{"page":1,"id":62,"obj":"label","x":48,"y":218,"w":130,"h":30,"text":"Green energy active","align":0,"text_font":16,"text_color":"black"} +{"page":1,"id":63,"obj":"label","x":97,"y":218,"w":130,"h":30,"text":"Yes :)","align":2,"text_color":"black"} + +{"page":1,"id":71,"obj":"label","x":8,"y":243,"w":35,"h":35,"text":"\uE957","align":1,"text_font":32,"text_color":"black"} +{"page":1,"id":72,"obj":"label","x":48,"y":253,"w":130,"h":30,"text":"Air quality","align":0,"text_font":16,"text_color":"black"} +{"page":1,"id":73,"obj":"label","x":97,"y":253,"w":130,"h":30,"text":"OK (29.58 µg/m³)","align":2,"text_color":"black"} + +{"page":0,"comment":"---------- All pages ----------"} +{"page":0,"id":11,"obj":"btn","action":"prev","x":0,"y":290,"w":79,"h":32,"bg_color":"#34495E","text":"\uE141","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":32} +{"page":0,"id":12,"obj":"btn","action":"back","x":80,"y":290,"w":80,"h":32,"bg_color":"#34495E","text":"\uE2DC","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":24} +{"page":0,"id":13,"obj":"btn","action":"next","x":161,"y":290,"w":79,"h":32,"bg_color":"#34495E","text":"\uE142","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":32} diff --git a/lib/libesp32/berry/default/embedded/openhasp/demo3.jsonl b/lib/libesp32/berry/default/embedded/openhasp/demo3.jsonl new file mode 100644 index 000000000..f8b952f81 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/openhasp/demo3.jsonl @@ -0,0 +1,4 @@ +{"page":1,"id":1,"obj":"btn","x":0,"y":0,"w":240,"h":30,"text":"FAN STATUS","text_font":16,"bg_color":"#2C3E50","text_color":"#FFFFFF","radius":0,"border_side":0,"click":0} + +{"page":1,"id":11,"obj":"img","src":"A:/noun_Fan_35097_140.png","auto_size":1,"w":140,"h":140,"x":50,"y":75,"image_recolor":"lime","image_recolor_opa":150} +{"page":1,"id":12,"obj":"spinner","parentid":11,"x":7,"y":6,"w":126,"h":126,"bg_opa":0,"border_width":0,"line_width":7,"line_width1":7,"type":2,"angle":120,"speed":1000,"value_str":3,"value_font":24} \ No newline at end of file diff --git a/lib/libesp32/berry/default/embedded/persist.be b/lib/libesp32/berry/default/embedded/persist.be new file mode 100644 index 000000000..164a1dd7b --- /dev/null +++ b/lib/libesp32/berry/default/embedded/persist.be @@ -0,0 +1,161 @@ +#- persistance module for Berry -# +#- -# +#- To solidify: -# +#- + # load only persis_module and persist_module.init + import solidify + solidify.dump(persist_module.init) + # copy and paste into `be_persist_lib.c` +-# +var persist_module = module("persist") + +persist_module.init = def (m) + + class Persist + var _filename + var _p + var _dirty + + #- persist can be initialized with pre-existing values. The map is not copied so any change will be reflected -# + def init(m) + # print("Persist init") + self._filename = '_persist.json' + if isinstance(m,map) + self._p = m.copy() # need to copy instead? + else + self._p = {} + end + self.load(self._p, self._filename) + self._dirty = false + # print("Persist init") + end + + #- virtual member getter, if a key does not exists return `nil`-# + def member(key) + return self._p.find(key) + end + + #- virtual member setter -# + def setmember(key, value) + self._p[key] = value + self._dirty = true + end + + #- clear all entries -# + def zero() + self._p = {} + self._dirty = true + end + + def remove(k) + self._p.remove(k) + self._dirty = true + end + + def has(k) + return self._p.has(k) + end + + def find(k, d) + return self._p.find(k, d) + end + + def load() + import json + import path + var f # file object + var val # values loaded from json + + if path.exists(self._filename) + try + f = open(self._filename, "r") + val = json.load(f.read()) + f.close() + except .. as e, m + if f != nil f.close() end + raise e, m + end + if isinstance(val, map) + self._p = val # sucess + else + print("BRY: failed to load _persist.json") + end + self._dirty = false + else + self.save() + end + + # print("Loading") + end + + def save() + var f # file object + try + f = open(self._filename, "w") + self.json_fdump(f) + f.close() + except .. as e, m + if f != nil f.close() end + f = open(self._filename, "w") + f.write('{}') # fallback write empty map + f.close() + raise e, m + end + self._dirty = false + # print("Saving") + end + + def json_fdump_any(f, v) + import json + if isinstance(v, map) + self.json_fdump_map(f, v) + elif isinstance(v, list)v + self.json_fdump_list(f, v) + else + f.write(json.dump(v)) + end + end + + def json_fdump_map(f, v) + import json + f.write('{') + var sep = nil + for k:v.keys() + if sep != nil f.write(sep) end + + f.write(json.dump(str(k))) + f.write(':') + self.json_fdump_any(f, v[k]) + + sep = "," + end + f.write('}') + end + + def json_fdump_list(f, v) + import json + f.write('[') + var i = 0 + while i < size(v) + if i > 0 f.write(',') end + self.json_fdump_any(f, v[i]) + i += 1 + end + f.write(']') + end + + def json_fdump(f) + import json + if isinstance(self._p, map) + self.json_fdump_map(f, self._p) + else + raise "internal_error", "persist._p is not a map" + end + end + end + + + return Persist() # return an instance of this class +end + +return persist_module diff --git a/lib/libesp32/berry/default/embedded/tapp.be b/lib/libesp32/berry/default/embedded/tapp.be new file mode 100644 index 000000000..30aa1f740 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/tapp.be @@ -0,0 +1,35 @@ +#- Tasmota apps module for Berry -# +#- -# + +var tapp_module = module("tapp") + +tapp_module.init = def (m) + + class Tapp + + def init() + tasmota.add_driver(self) + end + + def autoexec() + import path + import string + + var dir = path.listdir("/") + + for d: dir + if string.find(d, ".tapp") > 0 + tasmota.log(string.format("TAP: found Tasmota App '%s'", d), 2) + tasmota.load(d + "#autoexec.be") + end + end + end + end + + return Tapp() # return an instance of this class +end + +# aa = autoconf_module.init(autoconf_module) +# import webserver +# webserver.on('/ac2', / -> aa.page_autoconf_mgr(), webserver.HTTP_GET) +return tapp_module diff --git a/lib/libesp32/berry/default/embedded/test_crypto.be b/lib/libesp32/berry/default/embedded/test_crypto.be new file mode 100644 index 000000000..f2edbfee5 --- /dev/null +++ b/lib/libesp32/berry/default/embedded/test_crypto.be @@ -0,0 +1,30 @@ +ec = crypto.EC_C25519() + +# Alice +sk_A = bytes('77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a') +pk_A = ec.public_key(sk_A) +assert(pk_A == bytes('8520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98eaa9b4e6a')) + +# Bob +sk_B = bytes('5dab087e624a8a4b79e17f8b83800ee66f3bb1292618b6fd1c2f8b27ff88e0eb') +pk_B = ec.public_key(sk_B) +assert(pk_B == bytes('de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f')) + +psk = ec.shared_key(sk_A, pk_B) +assert(psk == bytes('4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742')) +psk2 = ec.shared_key(sk_B, pk_A) +assert(psk2 == bytes('4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742')) + +#- test vectors from RFC77748 + + Alice's private key, a: + 77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a + Alice's public key, X25519(a, 9): + 8520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98eaa9b4e6a + Bob's private key, b: + 5dab087e624a8a4b79e17f8b83800ee66f3bb1292618b6fd1c2f8b27ff88e0eb + Bob's public key, X25519(b, 9): + de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f + Their shared secret, K: + 4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742 +-# diff --git a/lib/libesp32/berry/default/static_block.hpp b/lib/libesp32/berry/default/static_block.hpp new file mode 100644 index 000000000..152dda130 --- /dev/null +++ b/lib/libesp32/berry/default/static_block.hpp @@ -0,0 +1,80 @@ +/** + * static_block.hpp + * + * An implementation of a Java-style static block, in C++ (and potentially a + * GCC/clang extension to avoid warnings). Almost, but not quite, valid C. + * Partially inspired by Andrei Alexandrescu's Scope Guard and + * discussions on stackoverflow.com + * + * By Eyal Rozenberg + * + * Licensed under the Apache License v2.0: + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ +#pragma once +#ifndef STATIC_BLOCK_HPP_ +#define STATIC_BLOCK_HPP_ + +#ifndef CONCATENATE +#define CONCATENATE(s1, s2) s1##s2 +#define EXPAND_THEN_CONCATENATE(s1, s2) CONCATENATE(s1, s2) +#endif /* CONCATENATE */ + +#ifndef UNIQUE_IDENTIFIER +/** + * This macro expands into a different identifier in every expansion. + * Note that you _can_ clash with an invocation of UNIQUE_IDENTIFIER + * by manually using the same identifier elsewhere; or by carefully + * choosing another prefix etc. + */ +#ifdef __COUNTER__ +#define UNIQUE_IDENTIFIER(prefix) EXPAND_THEN_CONCATENATE(prefix, __COUNTER__) +#else +#define UNIQUE_IDENTIFIER(prefix) EXPAND_THEN_CONCATENATE(prefix, __LINE__) +#endif /* COUNTER */ +#else +#endif /* UNIQUE_IDENTIFIER */ + +/** + * Following is a mechanism for executing code statically. + * + * @note Caveats: + * - Your static block must be surround by curly braces. + * - No need for a semicolon after the block (but it won't hurt). + * - Do not put static blocks in files, as it might get compiled multiple + * times ane execute multiple times. + * - A static_block can only be used in file scope - not within any other block etc. + * - Templated static blocks will probably not work. Avoid them. + * - No other funny business, this is fragile. + * - This does not having any threading issues (AFAICT) - as it has no static + * initialization order issue. Of course, you have to _keep_ it safe with + * your static code. + * - Execution of the code is guaranteed to occur before main() executes, + * but the relative order of statics being initialized is unknown/unclear. So, + * do not call any method of an instance of a class which you expect to have been + * constructed; it may not have been. Instead, you can use a static getInstance() method + * (look this idiom up on the web, it's safe). + * - Variables defined within the static block are not global; they will + * go out of scope as soon as its execution concludes. + * + * Usage example: + * + * static_block { + * do_stuff(); + * std::cout << "in the static block!\n"; + * } + * + */ +#define static_block STATIC_BLOCK_IMPL1(UNIQUE_IDENTIFIER(_static_block_)) + +#define STATIC_BLOCK_IMPL1(prefix) \ + STATIC_BLOCK_IMPL2(CONCATENATE(prefix,_fn),CONCATENATE(prefix,_var)) + +#define STATIC_BLOCK_IMPL2(function_name,var_name) \ +static void function_name(); \ +static int var_name __attribute((unused)) = (function_name(), 0) ; \ +static void function_name() + + +#endif // STATIC_BLOCK_HPP_ diff --git a/lib/libesp32/berry/examples/anon_func.be b/lib/libesp32/berry/examples/anon_func.be new file mode 100644 index 000000000..78854ce64 --- /dev/null +++ b/lib/libesp32/berry/examples/anon_func.be @@ -0,0 +1,20 @@ +# anonymous function and closure +def count(x) + var arr = [] + for i : 0 .. x + arr.push( + def (n) # loop variable cannot be used directly as free variable + return def () + return n * n + end + end (i) # define and call anonymous function + ) + end + return arr +end + +for xx : count(6) + print(xx()) # 0, 1, 4 ... n * n +end + +return count diff --git a/lib/libesp32/berry/examples/bigloop.be b/lib/libesp32/berry/examples/bigloop.be new file mode 100644 index 000000000..a3a77768b --- /dev/null +++ b/lib/libesp32/berry/examples/bigloop.be @@ -0,0 +1,15 @@ +import time + +c = time.clock() +do + i = 0 + while i < 100000000 + i += 1 + end +end +print('while iteration 100000000 times', time.clock() - c, 's') + +c = time.clock() +for i : 1 .. 100000000 +end +print('for iteration 100000000 times', time.clock() - c, 's') diff --git a/lib/libesp32/berry/examples/bintree.be b/lib/libesp32/berry/examples/bintree.be new file mode 100644 index 000000000..81936f8a0 --- /dev/null +++ b/lib/libesp32/berry/examples/bintree.be @@ -0,0 +1,60 @@ +# Reference from https://github.com/BerryMathDevelopmentTeam/BerryMath/blob/master/testscript/BinaryTree.bm + +class node + var v, l, r + def init(v, l, r) + self.v = v + self.l = l + self.r = r + end + def insert(v) + if v < self.v + if self.l + self.l.insert(v) + else + self.l = node(v) + end + else + if self.r + self.r.insert(v) + else + self.r = node (v) + end + end + end + def sort(l) + if (self.l) self.l.sort(l) end + l.push(self.v) + if (self.r) self.r.sort(l) end + end +end + +class btree + var root + def insert(v) + if self.root + self.root.insert(v) + else + self.root = node(v) + end + end + def sort() + var l = [] + if self.root + self.root.sort(l) + end + return l + end +end + +var tree = btree() +tree.insert(-100) +tree.insert(5); +tree.insert(3); +tree.insert(9); +tree.insert(10); +tree.insert(10000000); +tree.insert(1); +tree.insert(-1); +tree.insert(-10); +print(tree.sort()); diff --git a/lib/libesp32/berry/examples/calcpi.be b/lib/libesp32/berry/examples/calcpi.be new file mode 100644 index 000000000..053f87875 --- /dev/null +++ b/lib/libesp32/berry/examples/calcpi.be @@ -0,0 +1,16 @@ +def cpi(n) + i = 2 + pi = 3 + while i <= n + term = 4.0 / (i * (i + 1) * (i + 2)) + if i % 4 + pi = pi + term + else + pi = pi - term + end + i = i + 2 + end + return pi +end + +print("pi =", cpi(100)) diff --git a/lib/libesp32/berry/examples/exception.be b/lib/libesp32/berry/examples/exception.be new file mode 100644 index 000000000..3a3098dce --- /dev/null +++ b/lib/libesp32/berry/examples/exception.be @@ -0,0 +1,12 @@ +import debug + +def test_func() + try + compile('def +() end')() + except .. as e, v + print('catch execption:', str(e) + ' >>>\n ' + str(v)) + debug.traceback() + end +end + +test_func() diff --git a/lib/libesp32/berry/examples/fib_rec.be b/lib/libesp32/berry/examples/fib_rec.be new file mode 100644 index 000000000..31ed3817b --- /dev/null +++ b/lib/libesp32/berry/examples/fib_rec.be @@ -0,0 +1,12 @@ +import time + +def fib(x) + if x <= 2 + return 1 + end + return fib(x - 1) + fib(x - 2) +end + +c = time.clock() +print("fib:", fib(38)) # minimum stack size: 78!! +print("time:", time.clock() - c, 's') diff --git a/lib/libesp32/berry/examples/guess_number.be b/lib/libesp32/berry/examples/guess_number.be new file mode 100644 index 000000000..6cbd07e7c --- /dev/null +++ b/lib/libesp32/berry/examples/guess_number.be @@ -0,0 +1,26 @@ +import time +import math + +math.srand(time.time()) +res = math.rand() % 100 +max_test = 7 +test = -1 +idx = 1 +print('Guess a number between 0 and 99. You have', max_test, 'chances.') +while test != res && idx <= max_test + test = number(input(str(idx) + ': enter the number you guessed: ')) + if type(test) != 'int' + print('This is not an integer. Continue!') + continue + elif test > res + print('This number is too large.') + elif test < res + print('This number is too small.') + end + idx = idx + 1 +end +if test == res + print('You win!') +else + print('You failed, the correct answer is', res) +end diff --git a/lib/libesp32/berry/examples/json.be b/lib/libesp32/berry/examples/json.be new file mode 100644 index 000000000..d98dff8bb --- /dev/null +++ b/lib/libesp32/berry/examples/json.be @@ -0,0 +1,4 @@ +import json +print(json.load('{"key": "value"}')) +print(json.dump({'test key': nil})) +print(json.dump({'key1': nil, 45: true}, 'format')) diff --git a/lib/libesp32/berry/examples/lambda.be b/lib/libesp32/berry/examples/lambda.be new file mode 100644 index 000000000..1d0b709bb --- /dev/null +++ b/lib/libesp32/berry/examples/lambda.be @@ -0,0 +1,8 @@ +# simple lambda example +print((/a b c-> a * b + c)(2, 3, 4)) + +# Y-Combinator and factorial functions +Y = /f-> (/x-> f(/n-> x(x)(n)))(/x-> f(/n-> x(x)(n))) +F = /f-> /x-> x ? f(x - 1) * x : 1 +fact = Y(F) +print('fact(10) == ' .. fact(10)) diff --git a/lib/libesp32/berry/examples/listdir.be b/lib/libesp32/berry/examples/listdir.be new file mode 100644 index 000000000..2dd880118 --- /dev/null +++ b/lib/libesp32/berry/examples/listdir.be @@ -0,0 +1,16 @@ +import os + +def scandir(path) + print('path: ' + path) + for name : os.listdir(path) + var fullname = os.path.join(path, name) + if os.path.isfile(fullname) + print('file: ' + fullname) + else + print('path: ' + fullname) + scandir(fullname) + end + end +end + +scandir('.') diff --git a/lib/libesp32/berry/examples/qsort.be b/lib/libesp32/berry/examples/qsort.be new file mode 100644 index 000000000..b09b65672 --- /dev/null +++ b/lib/libesp32/berry/examples/qsort.be @@ -0,0 +1,42 @@ +def qsort(data) + # do once sort + def once(left, right) + var pivot = data[left] # use the 0th value as the pivot + while left < right # check if sort is complete + # put the value less than the pivot to the left + while left < right && data[right] >= pivot + right -= 1 # skip values greater than pivot + end + data[left] = data[right] + # put the value greater than the pivot on the right + while left < right && data[left] <= pivot + left += 1 # skip values less than pivot + end + data[right] = data[left] + end + # now we have the index of the pivot, store it + data[left] = pivot + return left # return the index of the pivot + end + # recursive quick sort algorithm + def _sort(left, right) + if left < right # executed when the array is not empty + var index = once(left, right) # get index of pivot for divide and conquer + _sort(left, index - 1) # sort the data on the left + _sort(index + 1, right) # sort the data on the right + end + end + # start quick sort + _sort(0, data.size() - 1) + return data +end + +import time, math +math.srand(time.time()) # sse system time as a random seed +data = [] +# put 20 random numbers into the array +for i : 1 .. 20 + data.push(math.rand() % 100) +end +# sort and print +print(qsort(data)) diff --git a/lib/libesp32/berry/examples/repl.be b/lib/libesp32/berry/examples/repl.be new file mode 100644 index 000000000..aac26b0a1 --- /dev/null +++ b/lib/libesp32/berry/examples/repl.be @@ -0,0 +1,61 @@ +do + def ismult(msg) + import string + return string.split(msg, -5)[1] == '\'EOS\'' + end + + def multline(src, msg) + if !ismult(msg) + print('syntax_error: ' + msg) + return + end + while true + try + src += '\n' + input('>> ') + return compile(src) + except 'syntax_error' as e, m + if !ismult(m) + print('syntax_error: ' + m) + return + end + end + end + end + + def parse() + var fun, src = input('> ') + try + fun = compile('return (' + src + ')') + except 'syntax_error' as e, m + try + fun = compile(src) + except 'syntax_error' as e, m + fun = multline(src, m) + end + end + return fun + end + + def run(fun) + try + var res = fun() + if res print(res) end + except .. as e, m + import debug + print(e .. ': ' .. m) + debug.traceback() + end + end + + def repl() + while true + var fun = parse() + if fun != nil + run(fun) + end + end + end + + print("Berry Berry REPL!") + repl() +end diff --git a/lib/libesp32/berry/examples/string.be b/lib/libesp32/berry/examples/string.be new file mode 100644 index 000000000..299834e21 --- /dev/null +++ b/lib/libesp32/berry/examples/string.be @@ -0,0 +1,32 @@ +s = "This is a long string test. 0123456789 abcdefg ABCDEFG" +print(s) + +a = .5 +print(a) + +import string as s + +print(s.hex(0x45678ABCD, 16)) + +def bin(x, num) + assert(type(x) == 'int', 'the type of \'x\' must be integer') + # test the 'x' bits + var bits = 1 + for i : 0 .. 62 + if x & (1 << 63 - i) + bits = 64 - i + break + end + end + if type(num) == 'int' && num > 0 && num <= 64 + bits = bits < num ? num : bits + end + var result = '' + bits -= 1 + for i : 0 .. bits + result += x & (1 << (bits - i)) ? '1' : '0' + end + return result +end + +print(bin(33)) diff --git a/lib/libesp32/berry/examples/strmod.be b/lib/libesp32/berry/examples/strmod.be new file mode 100644 index 000000000..8660f5b4e --- /dev/null +++ b/lib/libesp32/berry/examples/strmod.be @@ -0,0 +1,7 @@ +import string + +print(string.format('%.3d', 12)) +print(string.format('%.3f', 12)) +print(string.format('%20.7f', 14.5)) +print(string.format('-- %-40s ---', 'this is a string format test')) +print(string.format('-- %40s ---', 'this is a string format test')) diff --git a/lib/libesp32/berry/gen.sh b/lib/libesp32/berry/gen.sh new file mode 100755 index 000000000..303a62c95 --- /dev/null +++ b/lib/libesp32/berry/gen.sh @@ -0,0 +1,2 @@ +#!/bin/bash +python3 tools/pycoc/main.py -o generate src default ../berry_mapping/src -c default/berry_conf.h diff --git a/lib/libesp32/berry/generate/be_const_strtab.h b/lib/libesp32/berry/generate/be_const_strtab.h new file mode 100644 index 000000000..50198eb8f --- /dev/null +++ b/lib/libesp32/berry/generate/be_const_strtab.h @@ -0,0 +1,741 @@ +extern const bcstring be_const_str_; +extern const bcstring be_const_str_AES_GCM; +extern const bcstring be_const_str_AXP192; +extern const bcstring be_const_str_Animate_X20pc_X20is_X20out_X20of_X20range; +extern const bcstring be_const_str_AudioFileSource; +extern const bcstring be_const_str_AudioFileSourceFS; +extern const bcstring be_const_str_AudioGenerator; +extern const bcstring be_const_str_AudioGeneratorMP3; +extern const bcstring be_const_str_AudioGeneratorWAV; +extern const bcstring be_const_str_AudioOutput; +extern const bcstring be_const_str_AudioOutputI2S; +extern const bcstring be_const_str_Auto_X2Dconfiguration; +extern const bcstring be_const_str_BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20; +extern const bcstring be_const_str_BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s; +extern const bcstring be_const_str_BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29; +extern const bcstring be_const_str_BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson; +extern const bcstring be_const_str_BUTTON_CONFIGURATION; +extern const bcstring be_const_str_CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s; +extern const bcstring be_const_str_CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting; +extern const bcstring be_const_str_CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29; +extern const bcstring be_const_str_CFG_X3A_X20downloading_X20_X27_X25s_X27; +extern const bcstring be_const_str_CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27; +extern const bcstring be_const_str_CFG_X3A_X20loaded_X20_X20; +extern const bcstring be_const_str_CFG_X3A_X20loaded_X20_X27_X25s_X27; +extern const bcstring be_const_str_CFG_X3A_X20loading_X20; +extern const bcstring be_const_str_CFG_X3A_X20loading_X20_X27_X25s_X27; +extern const bcstring be_const_str_CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29; +extern const bcstring be_const_str_CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found; +extern const bcstring be_const_str_CFG_X3A_X20ran_X20_X20; +extern const bcstring be_const_str_CFG_X3A_X20removed_X20file_X20_X27_X25s_X27; +extern const bcstring be_const_str_CFG_X3A_X20removing_X20autoconf_X20files; +extern const bcstring be_const_str_CFG_X3A_X20removing_X20first_X20time_X20marker; +extern const bcstring be_const_str_CFG_X3A_X20return_code_X3D_X25i; +extern const bcstring be_const_str_CFG_X3A_X20running_X20; +extern const bcstring be_const_str_CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem; +extern const bcstring be_const_str_COLOR_BLACK; +extern const bcstring be_const_str_COLOR_WHITE; +extern const bcstring be_const_str_EC_C25519; +extern const bcstring be_const_str_EVENT_DRAW_MAIN; +extern const bcstring be_const_str_EVENT_DRAW_PART_BEGIN; +extern const bcstring be_const_str_EVENT_DRAW_PART_END; +extern const bcstring be_const_str_False; +extern const bcstring be_const_str_GET; +extern const bcstring be_const_str_HTTP_GET; +extern const bcstring be_const_str_HTTP_POST; +extern const bcstring be_const_str_I2C_Driver; +extern const bcstring be_const_str_I2C_X3A; +extern const bcstring be_const_str_LVG_X3A_X20call_X20to_X20unsupported_X20callback; +extern const bcstring be_const_str_Leds; +extern const bcstring be_const_str_MD5; +extern const bcstring be_const_str_None; +extern const bcstring be_const_str_OPTION_A; +extern const bcstring be_const_str_OneWire; +extern const bcstring be_const_str_PART_MAIN; +extern const bcstring be_const_str_POST; +extern const bcstring be_const_str_Parameter_X20error; +extern const bcstring be_const_str_RES_OK; +extern const bcstring be_const_str_Restart_X201; +extern const bcstring be_const_str_SERIAL_5E1; +extern const bcstring be_const_str_SERIAL_5E2; +extern const bcstring be_const_str_SERIAL_5N1; +extern const bcstring be_const_str_SERIAL_5N2; +extern const bcstring be_const_str_SERIAL_5O1; +extern const bcstring be_const_str_SERIAL_5O2; +extern const bcstring be_const_str_SERIAL_6E1; +extern const bcstring be_const_str_SERIAL_6E2; +extern const bcstring be_const_str_SERIAL_6N1; +extern const bcstring be_const_str_SERIAL_6N2; +extern const bcstring be_const_str_SERIAL_6O1; +extern const bcstring be_const_str_SERIAL_6O2; +extern const bcstring be_const_str_SERIAL_7E1; +extern const bcstring be_const_str_SERIAL_7E2; +extern const bcstring be_const_str_SERIAL_7N1; +extern const bcstring be_const_str_SERIAL_7N2; +extern const bcstring be_const_str_SERIAL_7O1; +extern const bcstring be_const_str_SERIAL_7O2; +extern const bcstring be_const_str_SERIAL_8E1; +extern const bcstring be_const_str_SERIAL_8E2; +extern const bcstring be_const_str_SERIAL_8N1; +extern const bcstring be_const_str_SERIAL_8N2; +extern const bcstring be_const_str_SERIAL_8O1; +extern const bcstring be_const_str_SERIAL_8O2; +extern const bcstring be_const_str_SK6812_GRBW; +extern const bcstring be_const_str_STATE_DEFAULT; +extern const bcstring be_const_str_TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27; +extern const bcstring be_const_str_Tasmota; +extern const bcstring be_const_str_Tele; +extern const bcstring be_const_str_Timer; +extern const bcstring be_const_str_True; +extern const bcstring be_const_str_Unknown_X20command; +extern const bcstring be_const_str_WS2812; +extern const bcstring be_const_str_WS2812_GRB; +extern const bcstring be_const_str_Wire; +extern const bcstring be_const_str__; +extern const bcstring be_const_str__X0A; +extern const bcstring be_const_str__X20; +extern const bcstring be_const_str__X21_X3D; +extern const bcstring be_const_str__X21_X3D_X3D; +extern const bcstring be_const_str__X23; +extern const bcstring be_const_str__X23autoexec_X2Ebat; +extern const bcstring be_const_str__X23autoexec_X2Ebe; +extern const bcstring be_const_str__X23display_X2Eini; +extern const bcstring be_const_str__X23init_X2Ebat; +extern const bcstring be_const_str__X23preinit_X2Ebe; +extern const bcstring be_const_str__X2502d_X25s_X2502d; +extern const bcstring be_const_str__X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d; +extern const bcstring be_const_str__X25s_X2Eautoconf; +extern const bcstring be_const_str__X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B; +extern const bcstring be_const_str__X26lt_X3BNone_X26gt_X3B; +extern const bcstring be_const_str__X28_X29; +extern const bcstring be_const_str__X2B; +extern const bcstring be_const_str__X2C; +extern const bcstring be_const_str__X2D_X2D_X3A_X2D_X2D; +extern const bcstring be_const_str__X2E; +extern const bcstring be_const_str__X2E_X2E; +extern const bcstring be_const_str__X2Eautoconf; +extern const bcstring be_const_str__X2Ebe; +extern const bcstring be_const_str__X2Ebec; +extern const bcstring be_const_str__X2Elen; +extern const bcstring be_const_str__X2Ep; +extern const bcstring be_const_str__X2Ep1; +extern const bcstring be_const_str__X2Ep2; +extern const bcstring be_const_str__X2Esize; +extern const bcstring be_const_str__X2Etapp; +extern const bcstring be_const_str__X2Ew; +extern const bcstring be_const_str__X2F; +extern const bcstring be_const_str__X2F_X2Eautoconf; +extern const bcstring be_const_str__X2F_X3Frst_X3D; +extern const bcstring be_const_str__X2Fac; +extern const bcstring be_const_str__X3A; +extern const bcstring be_const_str__X3C; +extern const bcstring be_const_str__X3C_X2Fform_X3E_X3C_X2Fp_X3E; +extern const bcstring be_const_str__X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E; +extern const bcstring be_const_str__X3C_X3D; +extern const bcstring be_const_str__X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E; +extern const bcstring be_const_str__X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E; +extern const bcstring be_const_str__X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E; +extern const bcstring be_const_str__X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29; +extern const bcstring be_const_str__X3Clabel_X3EChoose_X20a_X20device_X20configuration_X3A_X3C_X2Flabel_X3E_X3Cbr_X3E; +extern const bcstring be_const_str__X3Clambda_X3E; +extern const bcstring be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E; +extern const bcstring be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E; +extern const bcstring be_const_str__X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E; +extern const bcstring be_const_str__X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E; +extern const bcstring be_const_str__X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E; +extern const bcstring be_const_str__X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E; +extern const bcstring be_const_str__X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E; +extern const bcstring be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E; +extern const bcstring be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20; +extern const bcstring be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dzip_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20; +extern const bcstring be_const_str__X3Cp_X3E_X3Csmall_X3E_X26nbsp_X3B_X28This_X20feature_X20requires_X20an_X20internet_X20connection_X29_X3C_X2Fsmall_X3E_X3C_X2Fp_X3E; +extern const bcstring be_const_str__X3Cselect_X20name_X3D_X27zip_X27_X3E; +extern const bcstring be_const_str__X3D; +extern const bcstring be_const_str__X3D_X3C_X3E_X21; +extern const bcstring be_const_str__X3D_X3D; +extern const bcstring be_const_str__X3E; +extern const bcstring be_const_str__X3E_X3D; +extern const bcstring be_const_str__X3F; +extern const bcstring be_const_str__X5B; +extern const bcstring be_const_str__X5D; +extern const bcstring be_const_str__X7B; +extern const bcstring be_const_str__X7B_X7D; +extern const bcstring be_const_str__X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D; +extern const bcstring be_const_str__X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D; +extern const bcstring be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D; +extern const bcstring be_const_str__X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D; +extern const bcstring be_const_str__X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D; +extern const bcstring be_const_str__X7D; +extern const bcstring be_const_str___iterator__; +extern const bcstring be_const_str___lower__; +extern const bcstring be_const_str___upper__; +extern const bcstring be_const_str__anonymous_; +extern const bcstring be_const_str__archive; +extern const bcstring be_const_str__available; +extern const bcstring be_const_str__begin_transmission; +extern const bcstring be_const_str__buffer; +extern const bcstring be_const_str__ccmd; +extern const bcstring be_const_str__class; +extern const bcstring be_const_str__cmd; +extern const bcstring be_const_str__debug_present; +extern const bcstring be_const_str__def; +extern const bcstring be_const_str__dirty; +extern const bcstring be_const_str__drivers; +extern const bcstring be_const_str__end_transmission; +extern const bcstring be_const_str__energy; +extern const bcstring be_const_str__error; +extern const bcstring be_const_str__filename; +extern const bcstring be_const_str__global_addr; +extern const bcstring be_const_str__global_def; +extern const bcstring be_const_str__lvgl; +extern const bcstring be_const_str__p; +extern const bcstring be_const_str__persist_X2Ejson; +extern const bcstring be_const_str__ptr; +extern const bcstring be_const_str__read; +extern const bcstring be_const_str__request_from; +extern const bcstring be_const_str__rules; +extern const bcstring be_const_str__settings_def; +extern const bcstring be_const_str__settings_ptr; +extern const bcstring be_const_str__t; +extern const bcstring be_const_str__timers; +extern const bcstring be_const_str__write; +extern const bcstring be_const_str_a; +extern const bcstring be_const_str_abs; +extern const bcstring be_const_str_acos; +extern const bcstring be_const_str_add; +extern const bcstring be_const_str_add_anim; +extern const bcstring be_const_str_add_cmd; +extern const bcstring be_const_str_add_driver; +extern const bcstring be_const_str_add_header; +extern const bcstring be_const_str_add_rule; +extern const bcstring be_const_str_addr; +extern const bcstring be_const_str_allocated; +extern const bcstring be_const_str_alternate; +extern const bcstring be_const_str_animate; +extern const bcstring be_const_str_animators; +extern const bcstring be_const_str_arch; +extern const bcstring be_const_str_area; +extern const bcstring be_const_str_arg; +extern const bcstring be_const_str_arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj; +extern const bcstring be_const_str_arg_name; +extern const bcstring be_const_str_arg_size; +extern const bcstring be_const_str_as; +extern const bcstring be_const_str_asin; +extern const bcstring be_const_str_assert; +extern const bcstring be_const_str_asstring; +extern const bcstring be_const_str_atan; +extern const bcstring be_const_str_atan2; +extern const bcstring be_const_str_atleast1; +extern const bcstring be_const_str_attrdump; +extern const bcstring be_const_str_autoexec; +extern const bcstring be_const_str_autorun; +extern const bcstring be_const_str_available; +extern const bcstring be_const_str_b; +extern const bcstring be_const_str_back_forth; +extern const bcstring be_const_str_base_class; +extern const bcstring be_const_str_battery_present; +extern const bcstring be_const_str_begin; +extern const bcstring be_const_str_bool; +extern const bcstring be_const_str_break; +extern const bcstring be_const_str_bri; +extern const bcstring be_const_str_bus; +extern const bcstring be_const_str_button_pressed; +extern const bcstring be_const_str_byte; +extern const bcstring be_const_str_bytes; +extern const bcstring be_const_str_c; +extern const bcstring be_const_str_call; +extern const bcstring be_const_str_call_native; +extern const bcstring be_const_str_calldepth; +extern const bcstring be_const_str_can_show; +extern const bcstring be_const_str_cb; +extern const bcstring be_const_str_cb_do_nothing; +extern const bcstring be_const_str_cb_event_closure; +extern const bcstring be_const_str_cb_obj; +extern const bcstring be_const_str_ceil; +extern const bcstring be_const_str_char; +extern const bcstring be_const_str_chars_in_string; +extern const bcstring be_const_str_check_privileged_access; +extern const bcstring be_const_str_class; +extern const bcstring be_const_str_class_init_obj; +extern const bcstring be_const_str_classname; +extern const bcstring be_const_str_classof; +extern const bcstring be_const_str_clear; +extern const bcstring be_const_str_clear_first_time; +extern const bcstring be_const_str_clear_to; +extern const bcstring be_const_str_close; +extern const bcstring be_const_str_closure; +extern const bcstring be_const_str_cmd; +extern const bcstring be_const_str_cmd_res; +extern const bcstring be_const_str_code; +extern const bcstring be_const_str_codedump; +extern const bcstring be_const_str_collect; +extern const bcstring be_const_str_color; +extern const bcstring be_const_str_compile; +extern const bcstring be_const_str_compress; +extern const bcstring be_const_str_concat; +extern const bcstring be_const_str_connect; +extern const bcstring be_const_str_connected; +extern const bcstring be_const_str_connection_error; +extern const bcstring be_const_str_constructor_cb; +extern const bcstring be_const_str_contains; +extern const bcstring be_const_str_content_button; +extern const bcstring be_const_str_content_flush; +extern const bcstring be_const_str_content_send; +extern const bcstring be_const_str_content_send_style; +extern const bcstring be_const_str_content_start; +extern const bcstring be_const_str_content_stop; +extern const bcstring be_const_str_continue; +extern const bcstring be_const_str_copy; +extern const bcstring be_const_str_cos; +extern const bcstring be_const_str_cosh; +extern const bcstring be_const_str_couldn_X27t_X20not_X20initialize_X20noepixelbus; +extern const bcstring be_const_str_count; +extern const bcstring be_const_str_counters; +extern const bcstring be_const_str_create_custom_widget; +extern const bcstring be_const_str_create_matrix; +extern const bcstring be_const_str_create_segment; +extern const bcstring be_const_str_ctor; +extern const bcstring be_const_str_ctypes_bytes; +extern const bcstring be_const_str_ctypes_bytes_dyn; +extern const bcstring be_const_str_dac_voltage; +extern const bcstring be_const_str_day; +extern const bcstring be_const_str_debug; +extern const bcstring be_const_str_decompress; +extern const bcstring be_const_str_decrypt; +extern const bcstring be_const_str_def; +extern const bcstring be_const_str_deg; +extern const bcstring be_const_str_deinit; +extern const bcstring be_const_str_del; +extern const bcstring be_const_str_delay; +extern const bcstring be_const_str_delete_all_configs; +extern const bcstring be_const_str_depower; +extern const bcstring be_const_str_deregister_obj; +extern const bcstring be_const_str_destructor_cb; +extern const bcstring be_const_str_detect; +extern const bcstring be_const_str_detected_X20on_X20bus; +extern const bcstring be_const_str_digital_read; +extern const bcstring be_const_str_digital_write; +extern const bcstring be_const_str_dirty; +extern const bcstring be_const_str_display; +extern const bcstring be_const_str_display_X2Eini; +extern const bcstring be_const_str_do; +extern const bcstring be_const_str_draw_arc; +extern const bcstring be_const_str_draw_line; +extern const bcstring be_const_str_draw_line_dsc; +extern const bcstring be_const_str_draw_line_dsc_init; +extern const bcstring be_const_str_due; +extern const bcstring be_const_str_dump; +extern const bcstring be_const_str_duration; +extern const bcstring be_const_str_editable; +extern const bcstring be_const_str_elif; +extern const bcstring be_const_str_else; +extern const bcstring be_const_str_enabled; +extern const bcstring be_const_str_encrypt; +extern const bcstring be_const_str_end; +extern const bcstring be_const_str_energy_struct; +extern const bcstring be_const_str_engine; +extern const bcstring be_const_str_erase; +extern const bcstring be_const_str_escape; +extern const bcstring be_const_str_eth; +extern const bcstring be_const_str_event; +extern const bcstring be_const_str_event_cb; +extern const bcstring be_const_str_event_send; +extern const bcstring be_const_str_every_100ms; +extern const bcstring be_const_str_every_50ms; +extern const bcstring be_const_str_every_second; +extern const bcstring be_const_str_except; +extern const bcstring be_const_str_exec_cmd; +extern const bcstring be_const_str_exec_rules; +extern const bcstring be_const_str_exec_tele; +extern const bcstring be_const_str_exists; +extern const bcstring be_const_str_exp; +extern const bcstring be_const_str_f; +extern const bcstring be_const_str_false; +extern const bcstring be_const_str_file; +extern const bcstring be_const_str_file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27; +extern const bcstring be_const_str_files; +extern const bcstring be_const_str_find; +extern const bcstring be_const_str_find_key_i; +extern const bcstring be_const_str_find_op; +extern const bcstring be_const_str_finish; +extern const bcstring be_const_str_floor; +extern const bcstring be_const_str_flush; +extern const bcstring be_const_str_for; +extern const bcstring be_const_str_format; +extern const bcstring be_const_str_from_to; +extern const bcstring be_const_str_fromb64; +extern const bcstring be_const_str_fromptr; +extern const bcstring be_const_str_fromstring; +extern const bcstring be_const_str_function; +extern const bcstring be_const_str_gamma; +extern const bcstring be_const_str_gamma10; +extern const bcstring be_const_str_gamma8; +extern const bcstring be_const_str_gc; +extern const bcstring be_const_str_gen_cb; +extern const bcstring be_const_str_get; +extern const bcstring be_const_str_get_alternate; +extern const bcstring be_const_str_get_aps_voltage; +extern const bcstring be_const_str_get_bat_charge_current; +extern const bcstring be_const_str_get_bat_current; +extern const bcstring be_const_str_get_bat_power; +extern const bcstring be_const_str_get_bat_voltage; +extern const bcstring be_const_str_get_battery_chargin_status; +extern const bcstring be_const_str_get_bri; +extern const bcstring be_const_str_get_cb_list; +extern const bcstring be_const_str_get_coords; +extern const bcstring be_const_str_get_current_module_name; +extern const bcstring be_const_str_get_current_module_path; +extern const bcstring be_const_str_get_free_heap; +extern const bcstring be_const_str_get_height; +extern const bcstring be_const_str_get_input_power_status; +extern const bcstring be_const_str_get_light; +extern const bcstring be_const_str_get_object_from_ptr; +extern const bcstring be_const_str_get_option; +extern const bcstring be_const_str_get_percentage; +extern const bcstring be_const_str_get_pixel_color; +extern const bcstring be_const_str_get_power; +extern const bcstring be_const_str_get_size; +extern const bcstring be_const_str_get_string; +extern const bcstring be_const_str_get_style_bg_color; +extern const bcstring be_const_str_get_style_line_color; +extern const bcstring be_const_str_get_style_pad_right; +extern const bcstring be_const_str_get_switch; +extern const bcstring be_const_str_get_tasmota; +extern const bcstring be_const_str_get_temp; +extern const bcstring be_const_str_get_vbus_current; +extern const bcstring be_const_str_get_vbus_voltage; +extern const bcstring be_const_str_get_warning_level; +extern const bcstring be_const_str_get_width; +extern const bcstring be_const_str_getbits; +extern const bcstring be_const_str_geti; +extern const bcstring be_const_str_global; +extern const bcstring be_const_str_gpio; +extern const bcstring be_const_str_group_def; +extern const bcstring be_const_str_h; +extern const bcstring be_const_str_has; +extern const bcstring be_const_str_has_arg; +extern const bcstring be_const_str_height_def; +extern const bcstring be_const_str_hex; +extern const bcstring be_const_str_hour; +extern const bcstring be_const_str_hs2rgb; +extern const bcstring be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf; +extern const bcstring be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson; +extern const bcstring be_const_str_i2c_enabled; +extern const bcstring be_const_str_id; +extern const bcstring be_const_str_if; +extern const bcstring be_const_str_imax; +extern const bcstring be_const_str_imin; +extern const bcstring be_const_str_import; +extern const bcstring be_const_str_init; +extern const bcstring be_const_str_init_draw_line_dsc; +extern const bcstring be_const_str_input; +extern const bcstring be_const_str_ins_goto; +extern const bcstring be_const_str_ins_ramp; +extern const bcstring be_const_str_ins_time; +extern const bcstring be_const_str_insert; +extern const bcstring be_const_str_instance; +extern const bcstring be_const_str_instance_size; +extern const bcstring be_const_str_int; +extern const bcstring be_const_str_internal_error; +extern const bcstring be_const_str_introspect; +extern const bcstring be_const_str_invalidate; +extern const bcstring be_const_str_io_error; +extern const bcstring be_const_str_ip; +extern const bcstring be_const_str_is_dirty; +extern const bcstring be_const_str_is_first_time; +extern const bcstring be_const_str_is_running; +extern const bcstring be_const_str_isinstance; +extern const bcstring be_const_str_isnan; +extern const bcstring be_const_str_isrunning; +extern const bcstring be_const_str_issubclass; +extern const bcstring be_const_str_item; +extern const bcstring be_const_str_iter; +extern const bcstring be_const_str_json; +extern const bcstring be_const_str_json_append; +extern const bcstring be_const_str_json_fdump; +extern const bcstring be_const_str_json_fdump_any; +extern const bcstring be_const_str_json_fdump_list; +extern const bcstring be_const_str_json_fdump_map; +extern const bcstring be_const_str_k; +extern const bcstring be_const_str_keys; +extern const bcstring be_const_str_kv; +extern const bcstring be_const_str_last_modified; +extern const bcstring be_const_str_leds; +extern const bcstring be_const_str_length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032; +extern const bcstring be_const_str_light; +extern const bcstring be_const_str_line_dsc; +extern const bcstring be_const_str_list; +extern const bcstring be_const_str_listdir; +extern const bcstring be_const_str_load; +extern const bcstring be_const_str_load_templates; +extern const bcstring be_const_str_local; +extern const bcstring be_const_str_log; +extern const bcstring be_const_str_log10; +extern const bcstring be_const_str_loop; +extern const bcstring be_const_str_lower; +extern const bcstring be_const_str_lv; +extern const bcstring be_const_str_lv_event; +extern const bcstring be_const_str_lv_event_cb; +extern const bcstring be_const_str_lv_obj; +extern const bcstring be_const_str_lv_obj_class; +extern const bcstring be_const_str_lvgl_event_dispatch; +extern const bcstring be_const_str_map; +extern const bcstring be_const_str_math; +extern const bcstring be_const_str_matrix; +extern const bcstring be_const_str_member; +extern const bcstring be_const_str_members; +extern const bcstring be_const_str_memory; +extern const bcstring be_const_str_millis; +extern const bcstring be_const_str_min; +extern const bcstring be_const_str_minute; +extern const bcstring be_const_str_module; +extern const bcstring be_const_str_month; +extern const bcstring be_const_str_name; +extern const bcstring be_const_str_nan; +extern const bcstring be_const_str_nil; +extern const bcstring be_const_str_no_X20GPIO_X20specified_X20for_X20neopixelbus; +extern const bcstring be_const_str_null_cb; +extern const bcstring be_const_str_number; +extern const bcstring be_const_str_obj_class_create_obj; +extern const bcstring be_const_str_obj_event_base; +extern const bcstring be_const_str_offset; +extern const bcstring be_const_str_offseta; +extern const bcstring be_const_str_on; +extern const bcstring be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E; +extern const bcstring be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E; +extern const bcstring be_const_str_open; +extern const bcstring be_const_str_out_X20of_X20range; +extern const bcstring be_const_str_p1; +extern const bcstring be_const_str_p2; +extern const bcstring be_const_str_page_autoconf_ctl; +extern const bcstring be_const_str_page_autoconf_mgr; +extern const bcstring be_const_str_param; +extern const bcstring be_const_str_path; +extern const bcstring be_const_str_pc; +extern const bcstring be_const_str_pc_abs; +extern const bcstring be_const_str_pc_rel; +extern const bcstring be_const_str_percentage; +extern const bcstring be_const_str_persist; +extern const bcstring be_const_str_persist_X2E_p_X20is_X20not_X20a_X20map; +extern const bcstring be_const_str_pi; +extern const bcstring be_const_str_pin; +extern const bcstring be_const_str_pin_mode; +extern const bcstring be_const_str_pin_used; +extern const bcstring be_const_str_pixel_count; +extern const bcstring be_const_str_pixel_size; +extern const bcstring be_const_str_pixels_buffer; +extern const bcstring be_const_str_point; +extern const bcstring be_const_str_pop; +extern const bcstring be_const_str_pop_path; +extern const bcstring be_const_str_pow; +extern const bcstring be_const_str_preinit; +extern const bcstring be_const_str_print; +extern const bcstring be_const_str_public_key; +extern const bcstring be_const_str_publish; +extern const bcstring be_const_str_publish_result; +extern const bcstring be_const_str_push; +extern const bcstring be_const_str_push_path; +extern const bcstring be_const_str_quality; +extern const bcstring be_const_str_r; +extern const bcstring be_const_str_rad; +extern const bcstring be_const_str_raise; +extern const bcstring be_const_str_rand; +extern const bcstring be_const_str_range; +extern const bcstring be_const_str_read; +extern const bcstring be_const_str_read12; +extern const bcstring be_const_str_read13; +extern const bcstring be_const_str_read24; +extern const bcstring be_const_str_read32; +extern const bcstring be_const_str_read8; +extern const bcstring be_const_str_read_bytes; +extern const bcstring be_const_str_read_sensors; +extern const bcstring be_const_str_readbytes; +extern const bcstring be_const_str_readline; +extern const bcstring be_const_str_real; +extern const bcstring be_const_str_reapply; +extern const bcstring be_const_str_redirect; +extern const bcstring be_const_str_reduce; +extern const bcstring be_const_str_refr_size; +extern const bcstring be_const_str_register_obj; +extern const bcstring be_const_str_remove; +extern const bcstring be_const_str_remove_cmd; +extern const bcstring be_const_str_remove_driver; +extern const bcstring be_const_str_remove_rule; +extern const bcstring be_const_str_remove_timer; +extern const bcstring be_const_str_reset; +extern const bcstring be_const_str_reset_search; +extern const bcstring be_const_str_resize; +extern const bcstring be_const_str_resolvecmnd; +extern const bcstring be_const_str_resp_cmnd; +extern const bcstring be_const_str_resp_cmnd_done; +extern const bcstring be_const_str_resp_cmnd_error; +extern const bcstring be_const_str_resp_cmnd_failed; +extern const bcstring be_const_str_resp_cmnd_str; +extern const bcstring be_const_str_response_append; +extern const bcstring be_const_str_return; +extern const bcstring be_const_str_return_X20code_X3D_X25i; +extern const bcstring be_const_str_reverse; +extern const bcstring be_const_str_reverse_gamma10; +extern const bcstring be_const_str_rotate; +extern const bcstring be_const_str_round_end; +extern const bcstring be_const_str_round_start; +extern const bcstring be_const_str_rtc; +extern const bcstring be_const_str_rule; +extern const bcstring be_const_str_run; +extern const bcstring be_const_str_run_bat; +extern const bcstring be_const_str_run_deferred; +extern const bcstring be_const_str_running; +extern const bcstring be_const_str_save; +extern const bcstring be_const_str_save_before_restart; +extern const bcstring be_const_str_scale_uint; +extern const bcstring be_const_str_scan; +extern const bcstring be_const_str_search; +extern const bcstring be_const_str_sec; +extern const bcstring be_const_str_seg7_font; +extern const bcstring be_const_str_select; +extern const bcstring be_const_str_serial; +extern const bcstring be_const_str_set; +extern const bcstring be_const_str_set_alternate; +extern const bcstring be_const_str_set_auth; +extern const bcstring be_const_str_set_bri; +extern const bcstring be_const_str_set_chg_current; +extern const bcstring be_const_str_set_dc_voltage; +extern const bcstring be_const_str_set_dcdc_enable; +extern const bcstring be_const_str_set_first_time; +extern const bcstring be_const_str_set_height; +extern const bcstring be_const_str_set_ldo_enable; +extern const bcstring be_const_str_set_ldo_voltage; +extern const bcstring be_const_str_set_light; +extern const bcstring be_const_str_set_matrix_pixel_color; +extern const bcstring be_const_str_set_percentage; +extern const bcstring be_const_str_set_pixel_color; +extern const bcstring be_const_str_set_power; +extern const bcstring be_const_str_set_style_bg_color; +extern const bcstring be_const_str_set_style_line_color; +extern const bcstring be_const_str_set_style_pad_right; +extern const bcstring be_const_str_set_style_text_font; +extern const bcstring be_const_str_set_text; +extern const bcstring be_const_str_set_time; +extern const bcstring be_const_str_set_timeouts; +extern const bcstring be_const_str_set_timer; +extern const bcstring be_const_str_set_useragent; +extern const bcstring be_const_str_set_width; +extern const bcstring be_const_str_set_x; +extern const bcstring be_const_str_set_y; +extern const bcstring be_const_str_setbits; +extern const bcstring be_const_str_seti; +extern const bcstring be_const_str_setitem; +extern const bcstring be_const_str_setmember; +extern const bcstring be_const_str_setrange; +extern const bcstring be_const_str_settings; +extern const bcstring be_const_str_shared_key; +extern const bcstring be_const_str_show; +extern const bcstring be_const_str_sin; +extern const bcstring be_const_str_sinh; +extern const bcstring be_const_str_size; +extern const bcstring be_const_str_skip; +extern const bcstring be_const_str_solidified; +extern const bcstring be_const_str_split; +extern const bcstring be_const_str_sqrt; +extern const bcstring be_const_str_srand; +extern const bcstring be_const_str_start; +extern const bcstring be_const_str_state; +extern const bcstring be_const_str_static; +extern const bcstring be_const_str_stop; +extern const bcstring be_const_str_stop_iteration; +extern const bcstring be_const_str_str; +extern const bcstring be_const_str_strftime; +extern const bcstring be_const_str_string; +extern const bcstring be_const_str_strip; +extern const bcstring be_const_str_strptime; +extern const bcstring be_const_str_super; +extern const bcstring be_const_str_sys; +extern const bcstring be_const_str_tag; +extern const bcstring be_const_str_tan; +extern const bcstring be_const_str_tanh; +extern const bcstring be_const_str_target; +extern const bcstring be_const_str_target_search; +extern const bcstring be_const_str_tasmota; +extern const bcstring be_const_str_tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29; +extern const bcstring be_const_str_tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29; +extern const bcstring be_const_str_tcpclient; +extern const bcstring be_const_str_tele; +extern const bcstring be_const_str_the_X20second_X20argument_X20is_X20not_X20a_X20function; +extern const bcstring be_const_str_time_dump; +extern const bcstring be_const_str_time_reached; +extern const bcstring be_const_str_time_str; +extern const bcstring be_const_str_to_gamma; +extern const bcstring be_const_str_tob64; +extern const bcstring be_const_str_tolower; +extern const bcstring be_const_str_tomap; +extern const bcstring be_const_str_top; +extern const bcstring be_const_str_toptr; +extern const bcstring be_const_str_tostring; +extern const bcstring be_const_str_toupper; +extern const bcstring be_const_str_tr; +extern const bcstring be_const_str_traceback; +extern const bcstring be_const_str_true; +extern const bcstring be_const_str_try; +extern const bcstring be_const_str_try_rule; +extern const bcstring be_const_str_type; +extern const bcstring be_const_str_unknown_X20instruction; +extern const bcstring be_const_str_update; +extern const bcstring be_const_str_upper; +extern const bcstring be_const_str_url_encode; +extern const bcstring be_const_str_v; +extern const bcstring be_const_str_value; +extern const bcstring be_const_str_value_error; +extern const bcstring be_const_str_valuer_error; +extern const bcstring be_const_str_var; +extern const bcstring be_const_str_w; +extern const bcstring be_const_str_wd; +extern const bcstring be_const_str_web_add_button; +extern const bcstring be_const_str_web_add_config_button; +extern const bcstring be_const_str_web_add_console_button; +extern const bcstring be_const_str_web_add_handler; +extern const bcstring be_const_str_web_add_main_button; +extern const bcstring be_const_str_web_add_management_button; +extern const bcstring be_const_str_web_send; +extern const bcstring be_const_str_web_send_decimal; +extern const bcstring be_const_str_web_sensor; +extern const bcstring be_const_str_webclient; +extern const bcstring be_const_str_webserver; +extern const bcstring be_const_str_while; +extern const bcstring be_const_str_widget_cb; +extern const bcstring be_const_str_widget_constructor; +extern const bcstring be_const_str_widget_ctor_cb; +extern const bcstring be_const_str_widget_ctor_impl; +extern const bcstring be_const_str_widget_destructor; +extern const bcstring be_const_str_widget_dtor_cb; +extern const bcstring be_const_str_widget_dtor_impl; +extern const bcstring be_const_str_widget_editable; +extern const bcstring be_const_str_widget_event; +extern const bcstring be_const_str_widget_event_cb; +extern const bcstring be_const_str_widget_event_impl; +extern const bcstring be_const_str_widget_group_def; +extern const bcstring be_const_str_widget_height_def; +extern const bcstring be_const_str_widget_instance_size; +extern const bcstring be_const_str_widget_struct_by_class; +extern const bcstring be_const_str_widget_struct_default; +extern const bcstring be_const_str_widget_width_def; +extern const bcstring be_const_str_width; +extern const bcstring be_const_str_width_def; +extern const bcstring be_const_str_wifi; +extern const bcstring be_const_str_wire; +extern const bcstring be_const_str_wire1; +extern const bcstring be_const_str_wire2; +extern const bcstring be_const_str_wire_scan; +extern const bcstring be_const_str_write; +extern const bcstring be_const_str_write8; +extern const bcstring be_const_str_write_bit; +extern const bcstring be_const_str_write_bytes; +extern const bcstring be_const_str_write_file; +extern const bcstring be_const_str_write_gpio; +extern const bcstring be_const_str_x; +extern const bcstring be_const_str_x1; +extern const bcstring be_const_str_y; +extern const bcstring be_const_str_y1; +extern const bcstring be_const_str_year; +extern const bcstring be_const_str_yield; +extern const bcstring be_const_str_zero; +extern const bcstring be_const_str_zip; diff --git a/lib/libesp32/berry/generate/be_const_strtab_def.h b/lib/libesp32/berry/generate/be_const_strtab_def.h new file mode 100644 index 000000000..4c195c96b --- /dev/null +++ b/lib/libesp32/berry/generate/be_const_strtab_def.h @@ -0,0 +1,1109 @@ +be_define_const_str(, "", 2166136261u, 0, 0, NULL); +be_define_const_str(_X0A, "\n", 252472541u, 0, 1, &be_const_str_Unknown_X20command); +be_define_const_str(_X20, " ", 621580159u, 0, 1, &be_const_str_geti); +be_define_const_str(_X21_X3D, "!=", 2428715011u, 0, 2, &be_const_str_asstring); +be_define_const_str(_X21_X3D_X3D, "!==", 559817114u, 0, 3, &be_const_str_type); +be_define_const_str(_X23, "#", 638357778u, 0, 1, &be_const_str_CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found); +be_define_const_str(_X23autoexec_X2Ebat, "#autoexec.bat", 3382890497u, 0, 13, &be_const_str_arg_size); +be_define_const_str(_X23autoexec_X2Ebe, "#autoexec.be", 1181757091u, 0, 12, &be_const_str_file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27); +be_define_const_str(_X23display_X2Eini, "#display.ini", 182218220u, 0, 12, &be_const_str___lower__); +be_define_const_str(_X23init_X2Ebat, "#init.bat", 3297595077u, 0, 9, &be_const_str_SERIAL_7O2); +be_define_const_str(_X23preinit_X2Ebe, "#preinit.be", 687035716u, 0, 11, &be_const_str_SERIAL_8O2); +be_define_const_str(_X2502d_X25s_X2502d, "%02d%s%02d", 1587999717u, 0, 10, &be_const_str_yield); +be_define_const_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, "%04d-%02d-%02dT%02d:%02d:%02d", 3425528601u, 0, 29, &be_const_str__global_def); +be_define_const_str(_X25s_X2Eautoconf, "%s.autoconf", 3560383524u, 0, 11, &be_const_str_every_second); +be_define_const_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, "<Error: apply new or remove>", 2855507949u, 0, 34, &be_const_str_add_driver); +be_define_const_str(_X26lt_X3BNone_X26gt_X3B, "<None>", 2602165498u, 0, 12, &be_const_str_rand); +be_define_const_str(_X28_X29, "()", 685372826u, 0, 2, &be_const_str__X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29); +be_define_const_str(_X2B, "+", 772578730u, 0, 1, &be_const_str_gpio); +be_define_const_str(_X2C, ",", 688690635u, 0, 1, &be_const_str_add_cmd); +be_define_const_str(_X2D_X2D_X3A_X2D_X2D, "--:--", 1370615441u, 0, 5, &be_const_str_AudioOutputI2S); +be_define_const_str(_X2E, ".", 722245873u, 0, 1, NULL); +be_define_const_str(_X2E_X2E, "..", 2748622605u, 0, 2, &be_const_str__X2Ep2); +be_define_const_str(_X2Eautoconf, ".autoconf", 2524679088u, 0, 9, NULL); +be_define_const_str(_X2Ebe, ".be", 1325797348u, 0, 3, &be_const_str_sinh); +be_define_const_str(_X2Ebec, ".bec", 3985273221u, 0, 4, &be_const_str__debug_present); +be_define_const_str(_X2Elen, ".len", 850842136u, 0, 4, NULL); +be_define_const_str(_X2Ep, ".p", 1171526419u, 0, 2, &be_const_str_COLOR_WHITE); +be_define_const_str(_X2Ep1, ".p1", 249175686u, 0, 3, &be_const_str_sin); +be_define_const_str(_X2Ep2, ".p2", 232398067u, 0, 3, &be_const_str_json_fdump_map); +be_define_const_str(_X2Esize, ".size", 1965188224u, 0, 5, &be_const_str__X2Fac); +be_define_const_str(_X2Etapp, ".tapp", 1363391594u, 0, 5, NULL); +be_define_const_str(_X2Ew, ".w", 1255414514u, 0, 2, &be_const_str_member); +be_define_const_str(_X2F, "/", 705468254u, 0, 1, &be_const_str_None); +be_define_const_str(_X2F_X2Eautoconf, "/.autoconf", 2212074393u, 0, 10, &be_const_str_set_dc_voltage); +be_define_const_str(_X2F_X3Frst_X3D, "/?rst=", 580074707u, 0, 6, &be_const_str_AES_GCM); +be_define_const_str(_X2Fac, "/ac", 3904651978u, 0, 3, &be_const_str_get_current_module_path); +be_define_const_str(_X3A, ":", 1057798253u, 0, 1, &be_const_str_json_fdump); +be_define_const_str(_X3C, "<", 957132539u, 0, 1, NULL); +be_define_const_str(_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 3546571739u, 0, 11, &be_const_str_atan); +be_define_const_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 1863865923u, 0, 16, NULL); +be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, &be_const_str_HTTP_POST); +be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str_Wire); +be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, &be_const_str_color); +be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "
", 842307168u, 0, 77, &be_const_str_set_power); +be_define_const_str(_X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, "Choose a device configuration:
", 1336654704u, 0, 49, &be_const_str_bus); +be_define_const_str(_X3Clambda_X3E, "", 607256038u, 0, 8, &be_const_str_point); +be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Current auto-configuration", 4212500780u, 0, 82, &be_const_str_get_warning_level); +be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Select new auto-configuration", 1926223891u, 0, 80, &be_const_str_get_vbus_current); +be_define_const_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, "", 510303524u, 0, 30, &be_const_str_cb_event_closure); +be_define_const_str(_X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, "", 3994619755u, 0, 54, NULL); +be_define_const_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, "

Exception:
'%s'
%s

", 4252565082u, 0, 59, &be_const_str_arg); +be_define_const_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 2052843416u, 0, 25, &be_const_str_area); +be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 452285201u, 0, 120, NULL); +be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, "

 (This feature requires an internet connection)

", 2719266486u, 0, 74, &be_const_str_register_obj); +be_define_const_str(_X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, "

Current configuration:

%s

", 4115655761u, 0, 46, &be_const_str_get_cb_list); +be_define_const_str(_X3Cselect_X20name_X3D_X27zip_X27_X3E, "") - - var templates = self.load_templates() - webserver.content_send("") - for t:templates - webserver.content_send(string.format("", t, string.tr(t, "_", " "))) - end - - webserver.content_send("

") - - webserver.content_send("") - # webserver.content_send(string.format("", ota_num)) - webserver.content_send("

") - - - webserver.content_send("

") - webserver.content_button(webserver.BUTTON_CONFIGURATION) - webserver.content_stop() - end - - # #################################################################################################### - # Web controller - # - # Applies the changes and restart - # #################################################################################################### - # This HTTP POST manager handles the submitted web form data - def page_autoconf_ctl() - import webserver - import string - import path - if !webserver.check_privileged_access() return nil end - - try - if webserver.has_arg("reapply") - tasmota.log("CFG: removing first time marker", 2); - # print("CFG: removing first time marker") - self.clear_first_time() - #- and force restart -# - webserver.redirect("/?rst=") - - elif webserver.has_arg("zip") - # remove any remaining autoconf file - tasmota.log("CFG: removing autoconf files", 2); - # print("CFG: removing autoconf files") - self.delete_all_configs() - - # get the name of the configuration file - var arch_name = webserver.arg("zip") - - if arch_name != "reset" - var url = string.format("https://raw.githubusercontent.com/tasmota/autoconf/main/%s/%s.autoconf", tasmota.arch(), arch_name) - tasmota.log(string.format("CFG: downloading '%s'", url), 2); - - var local_file = string.format("%s.autoconf", arch_name) - - # download file and write directly to file system - var cl = webclient() - cl.begin(url) - var r = cl.GET() - if r != 200 raise "connection_error", string.format("return code=%i", r) end - cl.write_file(local_file) - cl.close() - end - - # remove marker to reapply template - self.clear_first_time() - - #- and force restart -# - webserver.redirect("/?rst=") - else - raise "value_error", "Unknown command" - end - except .. as e, m - print(string.format("CFG: Exception> '%s' - %s", e, m)) - #- display error page -# - webserver.content_start("Parameter error") #- title of the web page -# - webserver.content_send_style() #- send standard Tasmota styles -# - - webserver.content_send(string.format("

Exception:
'%s'
%s

", e, m)) - - webserver.content_button(webserver.BUTTON_CONFIGURATION) #- button back to management page -# - webserver.content_stop() #- end of web page -# - end - end - - # Add HTTP POST and GET handlers - def web_add_handler() - import webserver - webserver.on('/ac', / -> self.page_autoconf_mgr(), webserver.HTTP_GET) - webserver.on('/ac', / -> self.page_autoconf_ctl(), webserver.HTTP_POST) - end - - - # reset the configuration information (but don't restart) - # i.e. remove any autoconf file - def reset() - import path - import string - - var dir = path.listdir("/") - var entry - - var i = 0 - while i < size(dir) - var fname = dir[i] - if string.find(fname, ".autoconf") > 0 # does the file contain '*.autoconf' - path.remove(fname) - print(string.format("CFG: removed file '%s'", fname)) - end - i += 1 - end - - self._archive = nil - self._error = nil - end - - # called by the synthetic event `preinit` - def preinit() - if self._archive == nil return end - # try to launch `preinit.be` - import path - - var fname = self._archive + '#preinit.be' - if path.exists(fname) - tasmota.log("CFG: loading "+fname, 3) - load(fname) - tasmota.log("CFG: loaded "+fname, 3) - end - end - - def run_bat(fname) # read a '*.bat' file and run each command - import string - var f - try - f = open(fname, "r") # open file in read-only mode, it is expected to exist - while true - var line = f.readline() # read each line, can contain a terminal '\n', empty if end of file - if size(line) == 0 break end # end of file - - if line[-1] == "\n" line = line[0..-2] end # remove any trailing '\n' - if size(line) > 0 - tasmota.cmd(line) # run the command - end - end - f.close() # close, we don't expect exception with read-only, could be added later though - except .. as e, m - print(string.format('CFG: could not run %s (%s - %s)', fname, e, m)) - f.close() - end - end - - # called by the synthetic event `autoexec` - def autoexec() - if self._archive == nil return end - # try to launch `preinit.be` - import path - - # Step 1. if first run, only apply `init.bat` - var fname = self._archive + '#init.bat' - if self.is_first_time() && path.exists(fname) - # create the '.autoconf' file to avoid running it again, even if it crashed - self.set_first_time() - - # if path.exists(fname) # we know it exists from initial test - self.run_bat(fname) - tasmota.log("CFG: 'init.bat' done, restarting", 2) - tasmota.cmd("Restart 1") - return # if init was run, force a restart anyways and don't run the remaining code - # end - end - - # Step 2. if 'display.ini' is present, launch Universal Display - fname = self._archive + '#display.ini' - if gpio.pin_used(gpio.OPTION_A, 2) && path.exists(fname) - if path.exists("display.ini") - tasmota.log("CFG: skipping 'display.ini' because already present in file-system", 2) - else - import display - var f = open(fname,"r") - var desc = f.read() - f.close() - display.start(desc) - end - end - - # Step 3. if 'autoexec.bat' is present, run it - fname = self._archive + '#autoexec.bat' - if path.exists(fname) - tasmota.log("CFG: running "+fname, 3) - self.run_bat(fname) - tasmota.log("CFG: ran "+fname, 3) - end - - # Step 4. if 'autoexec.be' is present, load it - fname = self._archive + '#autoexec.be' - if path.exists(fname) - tasmota.log("CFG: loading "+fname, 3) - load(fname) - tasmota.log("CFG: loaded "+fname, 3) - end - end - end - - return Autoconf() # return an instance of this class -end - -aa = autoconf_module.init(autoconf_module) -import webserver -webserver.on('/ac2', / -> aa.page_autoconf_mgr(), webserver.HTTP_GET) -return autoconf_module diff --git a/lib/libesp32/berry/default/embedded/i2c_axp192.be b/lib/libesp32/berry/default/embedded/i2c_axp192.be deleted file mode 100644 index 3d958334f..000000000 --- a/lib/libesp32/berry/default/embedded/i2c_axp192.be +++ /dev/null @@ -1,176 +0,0 @@ -#------------------------------------------------------------- - - Generic driver for AXP192 - solidified - -------------------------------------------------------------# -class AXP192 : I2C_Driver - def init() - super(self, I2C_Driver).init("AXP192", 0x34) - end - - # Return True = Battery Exist - def battery_present() - if self.wire.read(self.addr, 0x01, 1) & 0x20 return true - else return false - end - end - - # Input Power Status ??? - def get_input_power_status() - return self.wire.read(self.addr, 0x00, 1) - end - - # Battery Charging Status - def get_battery_chargin_status() - return self.wire.read(self.addr, 0x01, 1) - end - - # AXP chip temperature in °C - def get_temp() - return self.read12(0x5E) * 0.1 - 144.7 - end - - def get_bat_power() - return self.read24(0x70) * 0.00055 - end - - def get_bat_voltage() - return self.read12(0x78) * 0.0011 - end - def get_bat_current() - return (self.read13(0x7A) - self.read13(0x7C)) * 0.5 - end - def get_bat_charge_current() - return self.read13(0x7A) * 0.5 - end - def get_aps_voltage() - return self.read12(0x7E) * 0.0014 - end - def get_vbus_voltage() - return self.read12(0x5A) * 0.0017 - end - def get_vbus_current() - return self.read12(0x5C) * 0.375 - end - - # set LDO voltage - # ldo: 2/3 - # voltage: (mV) 1800mV - 3300mV in 100mV steps - def set_ldo_voltage(ldo, voltage) - if voltage > 3300 voltage = 15 - else voltage = (voltage / 100) - 18 - end - - if ldo == 2 - self.write8(0x28, self.read8(0x28) & 0x0F | ((voltage & 0x0F) << 4)) - end - if ldo == 3 - self.write8(0x28, self.read8(0x28) & 0xF0 | (voltage & 0x0F)) - end - end - - # set DCDC enable, 1/2/3 - def set_dcdc_enable(dcdc, state) - if dcdc == 1 self.write_bit(0x12, 0, state) end - if dcdc == 2 self.write_bit(0x12, 4, state) end - if dcdc == 3 self.write_bit(0x12, 1, state) end - end - - # set LDO enable, 2/3 (LDO 1 is always on) - def set_ldo_enable(ldo, state) - if ldo == 2 self.write_bit(0x12, 2, state) end - if ldo == 3 self.write_bit(0x12, 3, state) end - end - - # set GPIO output state 0/1/2 and 3/4 - def write_gpio(gpio, state) - if gpio >= 0 && gpio <= 2 - self.write_bit(0x94, gpio, state) - elif gpio >= 3 && gpio <= 4 - self.write_bit(0x96, gpio - 3, state) - end - end - - # Set voltage on DC-DC1/2/3 - # dcdc: 1/2/3 (warning some C libs start at 0) - # voltage: - def set_dc_voltage(dcdc, voltage) - if dcdc < 1 || dcdc > 3 return end - var v - if voltage < 700 v = 0 - elif voltage > 3500 v = 112 - elif dcdc == 2 && voltage > 2275 v = 63 # dcdc2 is limited to 2.275V - else v = (voltage - 700) / 25 - end - - var addr = 0x26 - if dcdc == 3 addr = 0x27 - elif dcdc == 2 addr = 0x23 - end - - self.write8(addr, self.read8(addr) & 0x80 | (v & 0x7F)) - end - - # Set charging current - # 100mA = 0 - # 190mA = 1 - # 280mA = 2 - # 360mA = 3 - # 450mA = 4 - # 550mA = 5 - # 630mA = 6 - # 700mA = 7 - # 780mA = 8 - # 880mA = 9 - # 960mA = 10 - # 1000mA = 11 - # 1080mA = 12 - # 1160mA = 13 - # 1240mA = 14 - # 1320mA = 15 - def set_chg_current(current_code) - self.write8(0x33, self.read8(0x33) & 0xF0 | (current_code & 0x0F)) - end - - # // Low Volt Level 1, when APS Volt Output < 3.4496 V - # // Low Volt Level 2, when APS Volt Output < 3.3992 V, then this flag is SET (0x01) - # // Flag will reset once battery volt is charged above Low Volt Level 1 - # // Note: now AXP192 have the Shutdown Voltage of 3.0V (B100) Def in REG 31H - def get_warning_level() - return self.read12(0x47) & 1 - end - - #- trigger a read every second -# - # def every_second() - # if !self.wire return nil end #- exit if not initialized -# - # end - - #- display sensor value in the web UI -# - def web_sensor() - if !self.wire return nil end #- exit if not initialized -# - import string - var msg = string.format( - "{s}VBus Voltage{m}%.3f V{e}".. - "{s}VBus Current{m}%.1f mA{e}".. - "{s}Batt Voltage{m}%.3f V{e}".. - "{s}Batt Current{m}%.1f mA{e}".. - #"{s}Batt Power{m}%.3f{e}".. - "{s}Temp AXP{m}%.1f °C{e}", - self.get_vbus_voltage(), self.get_vbus_voltage(), - self.get_bat_voltage(), self.get_bat_current(), - #self.get_bat_power(), - self.get_temp() - ) - tasmota.web_send_decimal(msg) - end - - #- add sensor value to teleperiod -# - def json_append() - if !self.wire return nil end #- exit if not initialized -# - # import string - # var ax = int(self.accel[0] * 1000) - # var ay = int(self.accel[1] * 1000) - # var az = int(self.accel[2] * 1000) - # var msg = string.format(",\"MPU6886\":{\"AX\":%i,\"AY\":%i,\"AZ\":%i,\"GX\":%i,\"GY\":%i,\"GZ\":%i}", - # ax, ay, az, self.gyro[0], self.gyro[1], self.gyro[2]) - # tasmota.response_append(msg) - end -end diff --git a/lib/libesp32/berry/default/embedded/i2c_driver.be b/lib/libesp32/berry/default/embedded/i2c_driver.be deleted file mode 100644 index a66afa5ad..000000000 --- a/lib/libesp32/berry/default/embedded/i2c_driver.be +++ /dev/null @@ -1,104 +0,0 @@ -#------------------------------------------------------------- - - IMPORTANT - - THIS CLASS IS ALREADY BAKED IN TASMOTA - - - - It is here for debugging and documentation purpose only - -------------------------------------------------------------# - -#------------------------------------------------------------- - - I2C_Driver class to simplify development of I2C drivers - - - - I2C_Driver(name, addr [, i2c_index]) -> nil - - name: name of I2C device for logging, or function to detect the model - - addr: I2C address of device, will probe all I2C buses for it - - i2c_index: (optional) check is the device is not disabled - -------------------------------------------------------------# - -class I2C_Driver - var wire #- wire object to reach the device, if nil then the module is not initialized -# - var addr #- I2C address of the device -# - var name #- model namme of the device, cannot be nil -# - - #- Init and look for device - - Input: - - name_or_detect : name of the device (if string) - or function to detect the precise model(if function) - the function is passed a single argument `self` - and must return a string, or `nil` if the device is invalid - - addr : I2C address of device (int 0..255) - - i2c_index : Tasmota I2C index, see `I2CDEVICES.md` (int) - --# - def init(name_or_detect, addr, i2c_index) - var tasmota = self.get_tasmota() #- retrieve the 'tasmota' singleton -# - - #- check if the i2c index is disabled by Tasmota configuration -# - if i2c_index != nil && !tasmota.i2c_enabled(i2c_index) return end - - self.addr = addr #- address for AXP192 -# - self.wire = tasmota.wire_scan(self.addr) #- get the right I2C bus -# - - if self.wire - #- find name of device, can be a string or a method -# - if type(name_or_detect) == 'function' - self.name = name_or_detect(self) - else - self.name = name_or_detect - end - #- if name is invalid, it means we can't detect device, abort -# - if self.name == nil self.wire = nil end - - if self.wire - print("I2C:", self.name, "detected on bus", self.wire.bus) - end - end - end - - #- write register with 8 bits value -# - def write8(reg, val) - return self.wire.write(self.addr, reg, val, 1) - end - - # Set or clear a specific bit in a register - # write_bit(reg:int, bit:int, state:bool) -> nil - # reg: I2C register number (0..255) - # bit: bit of I2C register to change (0..7) - # state: boolean value to write to specified bit - def write_bit(reg, bit, state) - if bit < 0 || bit > 7 return end - var mark = 1 << bit - if state self.write8(reg, self.read8(reg) | mark) - else self.write8(reg, self.read8(reg) & (0xFF - mark)) - end - end - - # read 8 bits - def read8(reg) - return self.wire.read(self.addr, reg, 1) - end - # read 12 bits - def read12(reg) - var buf = self.wire.read_bytes(self.addr, reg, 2) - return (buf[0] << 4) + buf[1] - end - # read 13 bits - def read13(reg) - var buf = self.wire.read_bytes(self.addr, reg, 2) - return (buf[0] << 5) + buf[1] - end - # read 24 bits - def read24(reg) - var buf = self.wire.read_bytes(self.addr, reg, 3) - return (buf[0] << 16) + (buf[1] << 8) + buf[2] - end - # read 32 bits - def read32(reg) - var buf = self.wire.read_bytes(self.addr, reg, 4) - return (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3] - end -end - -#- Example - -d = I2C_Driver("MPU", 0x68, 58) - --# \ No newline at end of file diff --git a/lib/libesp32/berry/default/embedded/leds.be b/lib/libesp32/berry/default/embedded/leds.be deleted file mode 100644 index 11a0489af..000000000 --- a/lib/libesp32/berry/default/embedded/leds.be +++ /dev/null @@ -1,338 +0,0 @@ -# class Leds -# -# for adressable leds like NoePixel - - -# Native commands -# 00 : ctor (leds:int, gpio:int) -> void -# 01 : begin void -> void -# 02 : show void -> void -# 03 : CanShow void -> bool -# 04 : IsDirty void -> bool -# 05 : Dirty void -> void -# 06 : Pixels void -> bytes() (mapped to the buffer) -# 07 : PixelSize void -> int -# 08 : PixelCount void -> int -# 09 : ClearTo (color:??) -> void -# 10 : SetPixelColor (idx:int, color:??) -> void -# 11 : GetPixelColor (idx:int) -> color:?? -# 20 : RotateLeft (rot:int [, first:int, last:int]) -> void -# 21 : RotateRight (rot:int [, first:int, last:int]) -> void -# 22 : ShiftLeft (rot:int [, first:int, last:int]) -> void -# 23 : ShiftRight (rot:int [, first:int, last:int]) -> void - - -class Leds : Leds_ntv - var gamma # if true, apply gamma (true is default) - var leds # number of leds - # leds:int = number of leds of the strip - # gpio:int (optional) = GPIO for NeoPixel. If not specified, takes the WS2812 gpio - # type:int (optional) = Type of LED, defaults to WS2812 RGB - # rmt:int (optional) = RMT hardware channel to use, leave default unless you have a good reason - def init(leds, gpio, type, rmt) # rmt is optional - self.gamma = true # gamma is enabled by default, it should be disabled explicitly if needed - self.leds = int(leds) - - if gpio == nil && gpio.pin(gpio.WS2812) >= 0 - gpio = gpio.pin(gpio.WS2812) - end - - # if no GPIO, abort - if gpio == nil - raise "valuer_error", "no GPIO specified for neopixelbus" - end - - # initialize the structure - self.ctor(self.leds, gpio, type, rmt) - - if self._p == nil raise "internal_error", "couldn't not initialize noepixelbus" end - - # call begin - self.begin() - - end - - def clear() - self.clear_to(0x000000) - self.show() - end - - def ctor(leds, gpio, rmt) - if rmt == nil - self.call_native(0, leds, gpio) - else - self.call_native(0, leds, gpio, rmt) - end - end - def begin() - self.call_native(1) - end - def show() - self.call_native(2) - end - def can_show() - return self.call_native(3) - end - def is_dirty() - return self.call_native(4) - end - def dirty() - self.call_native(5) - end - def pixels_buffer() - return self.call_native(6) - end - def pixel_size() - return self.call_native(7) - end - def pixel_count() - return self.call_native(8) - end - def clear_to(col, bri) - self.call_native(9, self.to_gamma(col, bri)) - end - def set_pixel_color(idx, col, bri) - self.call_native(10, idx, self.to_gamma(col, bri)) - end - def get_pixel_color(idx) - return self.call_native(11, idx) - end - # def rotate_left(rot, first, last) - # self.call_native(20, rot, first, last) - # end - # def rotate_right(rot, first, last) - # self.call_native(21, rot, first, last) - # end - # def shift_left(rot, first, last) - # self.call_native(22, rot, first, last) - # end - # def shift_right(rot, first, last) - # self.call_native(22, rot, first, last) - # end - - # apply gamma and bri - def to_gamma(rgbw, bri) - bri = (bri != nil) ? bri : 100 - var r = tasmota.scale_uint(bri, 0, 100, 0, (rgbw & 0xFF0000) >> 16) - var g = tasmota.scale_uint(bri, 0, 100, 0, (rgbw & 0x00FF00) >> 8) - var b = tasmota.scale_uint(bri, 0, 100, 0, (rgbw & 0x0000FF)) - if self.gamma - return light.gamma8(r) << 16 | - light.gamma8(g) << 8 | - light.gamma8(b) - else - return r << 16 | - g << 8 | - b - end - end - - # `segment` - # create a new `strip` object that maps a part of the current strip - def create_segment(offset, leds) - if int(offset) + int(leds) > self.leds || offset < 0 || leds < 0 - raise "value_error", "out of range" - end - - # inner class - class Leds_segment - var strip - var offset, leds - - def init(strip, offset, leds) - self.strip = strip - self.offset = int(offset) - self.leds = int(leds) - end - - def clear() - self.clear_to(0x000000) - self.show() - end - - def begin() - # do nothing, already being handled by physical strip - end - def show(force) - # don't trigger on segment, you will need to trigger on full strip instead - if bool(force) || (self.offset == 0 && self.leds == self.strip.leds) - self.strip.show() - end - end - def can_show() - return self.strip.can_show() - end - def is_dirty() - return self.strip.is_dirty() - end - def dirty() - self.strip.dirty() - end - def pixels_buffer() - return nil - end - def pixel_size() - return self.strip.pixel_size() - end - def pixel_count() - return self.leds - end - def clear_to(col, bri) - var i = 0 - while i < self.leds - self.strip.set_pixel_color(i + self.offset, col, bri) - i += 1 - end - end - def set_pixel_color(idx, col, bri) - self.strip.set_pixel_color(idx + self.offset, col, bri) - end - def get_pixel_color(idx) - return self.strip.get_pixel_color(idx + self.offseta) - end - end - - return Leds_segment(self, offset, leds) - - end - - def create_matrix(w, h, offset) - offset = int(offset) - w = int(w) - h = int(h) - if offset == nil offset = 0 end - if w * h + offset > self.leds || h < 0 || w < 0 || offset < 0 - raise "value_error", "out of range" - end - - # inner class - class Leds_matrix - var strip - var offset - var h, w - var alternate # are rows in alternate mode (even/odd are reversed) - - def init(strip, w, h, offset) - self.strip = strip - self.offset = offset - self.h = h - self.w = w - self.alternate = false - end - - def clear() - self.clear_to(0x000000) - self.show() - end - - def begin() - # do nothing, already being handled by physical strip - end - def show(force) - # don't trigger on segment, you will need to trigger on full strip instead - if bool(force) || (self.offset == 0 && self.w * self.h == self.strip.leds) - self.strip.show() - end - end - def can_show() - return self.strip.can_show() - end - def is_dirty() - return self.strip.is_dirty() - end - def dirty() - self.strip.dirty() - end - def pixels_buffer() - return nil - end - def pixel_size() - return self.strip.pixel_size() - end - def pixel_count() - return self.w * self.h - end - def clear_to(col, bri) - var i = 0 - while i < self.w * self.h - self.strip.set_pixel_color(i + self.offset, col, bri) - i += 1 - end - end - def set_pixel_color(idx, col, bri) - self.strip.set_pixel_color(idx + self.offset, col, bri) - end - def get_pixel_color(idx) - return self.strip.get_pixel_color(idx + self.offseta) - end - - # Leds_matrix specific - def set_alternate(alt) - self.alternate = alt - end - def get_alternate() - return self.alternate - end - - def set_matrix_pixel_color(x, y, col, bri) - if self.alternate && x % 2 - # reversed line - self.strip.set_pixel_color(x * self.w + self.h - y - 1 + self.offset, col, bri) - else - self.strip.set_pixel_color(x * self.w + y + self.offset, col, bri) - end - end - end - - return Leds_matrix(self, w, h, offset) - - end - - static def matrix(w, h, gpio, rmt) - var strip = Leds(w * h, gpio, rmt) - var matrix = strip.create_matrix(w, h, 0) - return matrix - end -end - - -#- - -var s = Leds(25, gpio.pin(gpio.WS2812, 1)) -s.clear_to(0x300000) -s.show() -i = 0 - -def anim() - s.clear_to(0x300000) - s.set_pixel_color(i, 0x004000) - s.show() - i = (i + 1) % 25 - tasmota.set_timer(200, anim) -end -anim() - --# - -#- - -var s = Leds_matrix(5, 5, gpio.pin(gpio.WS2812, 1)) -s.set_alternate(true) -s.clear_to(0x300000) -s.show() -x = 0 -y = 0 - -def anim() - s.clear_to(0x300000) - s.set_matrix_pixel_color(x, y, 0x004000) - s.show() - y = (y + 1) % 5 - if y == 0 - x = (x + 1) % 5 - end - tasmota.set_timer(200, anim) -end -anim() - --# diff --git a/lib/libesp32/berry/default/embedded/leds_animator.be b/lib/libesp32/berry/default/embedded/leds_animator.be deleted file mode 100644 index 1ed25b491..000000000 --- a/lib/libesp32/berry/default/embedded/leds_animator.be +++ /dev/null @@ -1,70 +0,0 @@ -# class Leds_animator - -class Leds_animator - var strip # neopixelbus object - var pixel_count # number of pixels in the strip - var bri # brightness of the animation, 0..100, default 50 - var running # is the animation running - var animators # animators list - - def init(strip) - self.strip = strip - self.bri = 50 # percentage of brightness 0..100 - self.running = false - self.pixel_count = strip.pixel_count() - self.animators = [] - # - self.clear() # clear all leds first - # - tasmota.add_driver(self) - end - - def add_anim(anim) - self.animators.push(anim) - anim.run() # start the animator - end - - def clear() - self.stop() - self.strip.clear() - end - def start() - self.running = true - end - def stop() - self.running = false - end - - def set_bri(bri) - self.bri = bri - end - def get_bri(bri) - return self.bri - end - - def every_50ms() - if self.running - # run animators first - var i = 0 - while i < size(self.animators) - var anim = self.animators[i] - if anim.is_running() - anim.animate() - i += 1 - else - self.animators.remove(i) # remove any finished animator - end - end - # tirgger animate and display - self.animate() - end - end - - def animate() - # placeholder - do nothing by default - end - - def remove() - tasmota.remove_driver(self) - end -end diff --git a/lib/libesp32/berry/default/embedded/lv_clock_icon.be b/lib/libesp32/berry/default/embedded/lv_clock_icon.be deleted file mode 100644 index f5d19ca11..000000000 --- a/lib/libesp32/berry/default/embedded/lv_clock_icon.be +++ /dev/null @@ -1,54 +0,0 @@ -#- LVGL lv_clock_icon - - ---# - -class lv_clock_icon: lv.label - var hour, minute, sec - - def init(parent) - super(self).init(parent) - var f_s7_16 = lv.seg7_font(16) - if f_s7_16 != nil self.set_style_text_font(f_s7_16, lv.PART_MAIN | lv.STATE_DEFAULT) end - - if parent != nil - var parent_height = parent.get_height() - - self.set_text("--:--") - self.refr_size() - var w = self.get_width() - self.set_y((parent.get_height() - self.get_height()) / 2) # center vertically - - var pad_right = parent.get_style_pad_right(lv.PART_MAIN | lv.STATE_DEFAULT) - self.set_x(parent.get_width() - w - pad_right - 3) - parent.set_style_pad_right(pad_right + w + 6, lv.PART_MAIN | lv.STATE_DEFAULT) - - self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT) - end - - tasmota.add_driver(self) - end - - def set_time(hour, minute, sec) - import string - if hour != self.hour || minute != self.minute || sec != self.sec - var txt = string.format("%02d%s%02d", hour, sec % 2 ? ":" : " ", minute) - self.hour = hour - self.minute = minute - self.sec = sec - #if txt[0] == '0' txt = '!' .. string.split(txt,1)[1] end # replace first char with '!' - self.set_text(txt) - end - end - - def every_second() - var now = tasmota.time_dump(tasmota.rtc()['local']) - if now['year'] != 1970 - self.set_time(now['hour'], now['min'], now['sec']) - end - end - - def del() - super(self).del() - tasmota.remove_driver(self) - end -end \ No newline at end of file diff --git a/lib/libesp32/berry/default/embedded/lv_signal_arcs.be b/lib/libesp32/berry/default/embedded/lv_signal_arcs.be deleted file mode 100644 index 7dd924e90..000000000 --- a/lib/libesp32/berry/default/embedded/lv_signal_arcs.be +++ /dev/null @@ -1,133 +0,0 @@ -#- LVGL lv_signal_bars and lv_wifi_bars - - ---# - -class lv_signal_arcs : lv.obj - var percentage # value to display, range 0..100 - var p1, p2, area, line_dsc # instances of objects kept to avoid re-instanciating at each call - - def init(parent) - # init custom widget (don't call super constructor) - _lvgl.create_custom_widget(self, parent) - # own values - self.percentage = 100 - # pre-allocate buffers - self.p1 = lv.point() - self.p2 = lv.point() - self.area = lv.area() - self.line_dsc = lv.draw_line_dsc() - end - - def widget_event(cl, event) - # Call the ancestor's event handler - if lv.obj_event_base(cl, event) != lv.RES_OK return end - var code = event.code - - import math - def atleast1(x) if x >= 1 return x else return 1 end end - # the model is that we have 4 bars and inter-bar (1/4 of width) - var height = self.get_height() - var width = self.get_width() - - var inter_bar = atleast1(height / 8) - var bar = atleast1((height - inter_bar * 2) / 3) - var bar_offset = bar / 2 - #print("inter_bar", inter_bar, "bar", bar, "bar_offset", bar_offset) - - if code == lv.EVENT_DRAW_MAIN - var clip_area = lv.area(event.param) - - # get coordinates of object - self.get_coords(self.area) - var x_ofs = self.area.x1 - var y_ofs = self.area.y1 - - lv.draw_line_dsc_init(self.line_dsc) # initialize lv.draw_line_dsc structure - self.init_draw_line_dsc(lv.PART_MAIN, self.line_dsc) # copy the current values - - self.line_dsc.round_start = 1 - self.line_dsc.round_end = 1 - self.line_dsc.width = (bar * 3 + 1) / 4 - var on_color = self.get_style_line_color(lv.PART_MAIN | lv.STATE_DEFAULT) - var off_color = self.get_style_bg_color(lv.PART_MAIN | lv.STATE_DEFAULT) - - # initial calculation, but does not take into account bounding box - # var angle = int(math.deg(math.atan2(width / 2, height))) - - # better calculation - var hypotenuse = height - bar # center if at bar/2 from bottom and circle stops at bar/2 from top - var adjacent = width / 2 - bar_offset # stop at bar_offset from side - var angle = int(90 - math.deg(math.acos(real(adjacent) / real(hypotenuse)))) - if (angle > 45) angle = 45 end - - # print("hypotenuse",hypotenuse,"adjacent",adjacent,"angle",angle) - self.p1.x = x_ofs + width / 2 - self.p1.y = y_ofs + height - 1 - bar_offset - - self.line_dsc.color = self.percentage >= 25 ? on_color : off_color - lv.draw_arc(self.p1.x, self.p1.y, 0 * (bar + inter_bar) + bar_offset, 0, 360, clip_area, self.line_dsc) - self.line_dsc.color = self.percentage >= 50 ? on_color : off_color - lv.draw_arc(self.p1.x, self.p1.y, 1 * (bar + inter_bar) + bar_offset - 1, 270 - angle, 270 + angle, clip_area, self.line_dsc) - self.line_dsc.color = self.percentage >= 75 ? on_color : off_color - lv.draw_arc(self.p1.x, self.p1.y, 2 * (bar + inter_bar) + bar_offset - 2, 270 - angle, 270 + angle, clip_area, self.line_dsc) - - #elif mode == lv.DESIGN_DRAW_POST # commented since we don't want a frame around this object - # self.ancestor_design.call(self, clip_area, mode) - end - end - - def set_percentage(v) - var old_bars = self.percentage / 25 - if v > 100 v = 100 end - if v < 0 v = 0 end - self.percentage = v - if old_bars != v / 25 - self.invalidate() # be frugal and avoid updating the widget if it's not needed - end - end - - def get_percentage() - return self.percentage - end -end - -class lv_wifi_arcs: lv_signal_arcs - def init(parent) - super(self).init(parent) - tasmota.add_driver(self) - self.set_percentage(0) # we generally start with 0, meaning not connected - end - - def every_second() - var wifi = tasmota.wifi() - var quality = wifi.find("quality") - var ip = wifi.find("ip") - if ip == nil - self.set_percentage(0) - elif quality != nil - self.set_percentage(quality) - end - end - - def del() - super(self).del() - tasmota.remove_driver(self) - end -end - -class lv_wifi_arcs_icon: lv_wifi_arcs - def init(parent) - super(self).init(parent) - self.set_style_line_color(lv.color(lv.COLOR_WHITE), lv.PART_MAIN | lv.STATE_DEFAULT) - self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT) - if parent != nil - var parent_height = parent.get_height() - var pad_right = parent.get_style_pad_right(lv.PART_MAIN | lv.STATE_DEFAULT) - self.set_height(parent_height) - var w = (parent_height*4)/3 - self.set_width(w) # 130% - self.set_x(parent.get_width() - w - pad_right) - parent.set_style_pad_right(pad_right + w + 1, lv.PART_MAIN | lv.STATE_DEFAULT) - end - end -end \ No newline at end of file diff --git a/lib/libesp32/berry/default/embedded/lv_signal_bars.be b/lib/libesp32/berry/default/embedded/lv_signal_bars.be deleted file mode 100644 index f548457b9..000000000 --- a/lib/libesp32/berry/default/embedded/lv_signal_bars.be +++ /dev/null @@ -1,118 +0,0 @@ -#- LVGL lv_signal_bars and lv_wifi_bars - - ---# - -class lv_signal_bars : lv.obj - var percentage # value to display, range 0..100 - var p1, p2, area, line_dsc # instances of objects kept to avoid re-instanciating at each call - - def init(parent) - # init custom widget (don't call super constructor) - _lvgl.create_custom_widget(self, parent) - # own values - self.percentage = 100 - # pre-allocate buffers - self.p1 = lv.point() - self.p2 = lv.point() - self.area = lv.area() - self.line_dsc = lv.draw_line_dsc() - end - - def widget_event(cl, event) - # Call the ancestor's event handler - if lv.obj_event_base(cl, event) != lv.RES_OK return end - var code = event.code - - def atleast1(x) if x >= 1 return x else return 1 end end - # the model is that we have 4 bars and inter-bar (1/4 of width) - var height = self.get_height() - var width = self.get_width() - - var inter_bar = atleast1(width / 15) - var bar = atleast1((width - inter_bar * 3) / 4) - var bar_offset = bar / 2 - - if code == lv.EVENT_DRAW_MAIN - var clip_area = lv.area(event.param) - - # get coordinates of object - self.get_coords(self.area) - var x_ofs = self.area.x1 - var y_ofs = self.area.y1 - - lv.draw_line_dsc_init(self.line_dsc) # initialize lv_draw_line_dsc structure - self.init_draw_line_dsc(lv.PART_MAIN, self.line_dsc) # copy the current values - - self.line_dsc.round_start = 1 - self.line_dsc.round_end = 1 - self.line_dsc.width = bar - var on_color = self.get_style_line_color(lv.PART_MAIN | lv.STATE_DEFAULT) - var off_color = self.get_style_bg_color(lv.PART_MAIN | lv.STATE_DEFAULT) - - lv.event_send(self, lv.EVENT_DRAW_PART_BEGIN, self.line_dsc) - for i:0..3 # 4 bars - self.line_dsc.color = self.percentage >= (i+1)*20 ? on_color : off_color - self.p1.y = y_ofs + height - 1 - bar_offset - self.p1.x = x_ofs + i * (bar + inter_bar) + bar_offset - self.p2.y = y_ofs + ((3 - i) * (height - bar)) / 4 + bar_offset - self.p2.x = self.p1.x - lv.draw_line(self.p1, self.p2, clip_area, self.line_dsc) - end - lv.event_send(self, lv.EVENT_DRAW_PART_END, self.line_dsc) - end - end - - def set_percentage(v) - var old_bars = self.percentage / 20 - if v > 100 v = 100 end - if v < 0 v = 0 end - self.percentage = v - if old_bars != v / 20 - self.invalidate() # be frugal and avoid updating the widget if it's not needed - end - end - - def get_percentage() - return self.percentage - end -end - -class lv_wifi_bars: lv_signal_bars - def init(parent) - super(self).init(parent) - tasmota.add_driver(self) - self.set_percentage(0) # we generally start with 0, meaning not connected - end - - def every_second() - var wifi = tasmota.wifi() - var quality = wifi.find("quality") - var ip = wifi.find("ip") - if ip == nil - self.set_percentage(0) - elif quality != nil - self.set_percentage(quality) - end - end - - def del() - super(self).del() - tasmota.remove_driver(self) - end -end - -class lv_wifi_bars_icon: lv_wifi_bars - def init(parent) - super(self).init(parent) - self.set_style_line_color(lv.color(lv.COLOR_WHITE), lv.PART_MAIN | lv.STATE_DEFAULT) - self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT) - if parent != nil - var parent_height = parent.get_height() - var pad_right = parent.get_style_pad_right(lv.PART_MAIN | lv.STATE_DEFAULT) - self.set_height(parent_height) - self.set_width(parent_height) - self.set_x(parent.get_width() - parent_height - pad_right) - parent.set_style_pad_right(pad_right + parent_height + 1, lv.PART_MAIN | lv.STATE_DEFAULT) - end - end -end diff --git a/lib/libesp32/berry/default/embedded/lvgl_glob.be b/lib/libesp32/berry/default/embedded/lvgl_glob.be deleted file mode 100644 index 04250ff54..000000000 --- a/lib/libesp32/berry/default/embedded/lvgl_glob.be +++ /dev/null @@ -1,256 +0,0 @@ -#- embedded class for LVGL globals -# - -#- This class stores all globals used by LVGL and cannot be stored in the solidified module -# -#- this limits the globals to a single value '_lvgl' -# -class LVGL_glob - # all variables are lazily initialized to reduce the memory pressure. Until they are used, they consume zero memory - var cb_obj # map between a native C pointer (as int) and the corresponding lv.lv_* berry object, also helps marking the objects as non-gc-able - var cb_event_closure # mapping for event closures per LVGL native pointer (int) - var event_cb # native callback for lv.lv_event - - #- below are native callbacks mapped to a closure to a method of this instance -# - var null_cb # cb called if type is not supported - var widget_ctor_cb - var widget_dtor_cb - var widget_event_cb - - var widget_struct_default - var widget_struct_by_class - - #- this is the fallback callback, if the event is unknown or unsupported -# - static cb_do_nothing = def() print("LVG: call to unsupported callback") end - - #- register an lv.lv_* object in the mapping -# - def register_obj(obj) - if self.cb_obj == nil self.cb_obj = {} end - self.cb_obj[obj._p] = obj - end - - def get_object_from_ptr(ptr) - if self.cb_obj != nil - return self.cb_obj.find(ptr) # raise an exception if something is wrong - end - end - - def lvgl_event_dispatch(event_ptr) - import introspect - - var event = lv.lv_event(introspect.toptr(event_ptr)) - - var target = event.target - var f = self.cb_event_closure[target] - var obj = self.get_object_from_ptr(target) - #print('>> lvgl_event_dispatch', f, obj, event) - f(obj, event) - end - - def gen_cb(name, f, obj, ptr) - #print('>> gen_cb', name, obj, ptr) - # record the object, whatever the callback - - if name == "lv_event_cb" - if self.cb_event_closure == nil self.cb_event_closure = {} end - if self.event_cb == nil self.event_cb = tasmota.gen_cb(/ event_ptr -> self.lvgl_event_dispatch(event_ptr)) end # encapsulate 'self' in closure - - self.register_obj(obj) - self.cb_event_closure[ptr] = f - return self.event_cb - # elif name == "" - else - if self.null_cb == nil self.null_cb = tasmota.gen_cb(self.cb_do_nothing) end - return self.null_cb - end - end - - def widget_ctor_impl(cl_ptr, obj_ptr) - import introspect - var cl = lv.lv_obj_class(cl_ptr) - var obj = self.get_object_from_ptr(obj_ptr) - if self.cb_obj.find(obj) obj = self.cb_obj[obj] end - # print("widget_ctor_impl", cl, obj) - if type(obj) == 'instance' && introspect.get(obj, 'widget_constructor') - obj.widget_constructor(cl) - end - end - def widget_dtor_impl(cl_ptr, obj_ptr) - import introspect - var cl = lv.lv_obj_class(cl_ptr) - var obj = self.get_object_from_ptr(obj_ptr) - # print("widget_dtor_impl", cl, obj) - if type(obj) == 'instance' && introspect.get(obj, 'widget_destructor') - obj.widget_destructor(cl) - end - end - def widget_event_impl(cl_ptr, e_ptr) - import introspect - var cl = lv.lv_obj_class(cl_ptr) - var event = lv.lv_event(e_ptr) - var obj_ptr = event.target - var obj = self.get_object_from_ptr(obj_ptr) - if type(obj) == 'instance' && introspect.get(obj, 'widget_event') - obj.widget_event(cl, event) - end - # print("widget_event_impl", cl, obj_ptr, obj, event) - end - - - def widget_cb() - if self.widget_ctor_cb == nil self.widget_ctor_cb = tasmota.gen_cb(/ cl, obj -> self.widget_ctor_impl(cl, obj)) end - if self.widget_dtor_cb == nil self.widget_dtor_cb = tasmota.gen_cb(/ cl, obj -> self.widget_dtor_impl(cl, obj)) end - if self.widget_event_cb == nil self.widget_event_cb = tasmota.gen_cb(/ cl, e -> self.widget_event_impl(cl, e)) end - - if self.widget_struct_default == nil - self.widget_struct_default = lv.lv_obj_class(lv.lv_obj._class).copy() - self.widget_struct_default.base_class = lv.lv_obj._class # by default, inherit from base class `lv_obj`, this can be overriden - self.widget_struct_default.constructor_cb = self.widget_ctor_cb # set the berry cb dispatchers - self.widget_struct_default.destructor_cb = self.widget_dtor_cb - self.widget_struct_default.event_cb = self.widget_event_cb - end - end - - #- deregister_obj all information linked to a specific LVGL native object (int) -# - def deregister_obj(obj) - if self.cb_obj != nil self.cb_obj.remove(obj) end - if self.cb_event_closure != nil self.cb_event_closure.remove(obj) end - end - - #- initialize a custom widget -# - #- arg must be a subclass of lv.lv_obj -# - def create_custom_widget(obj, parent) - import introspect - - if !isinstance(obj, lv.lv_obj) raise "value_error", "arg must be a subclass of lv_obj" end - if self.widget_struct_by_class == nil self.widget_struct_by_class = {} end - - var obj_classname = classname(obj) - var obj_class_struct = self.widget_struct_by_class.find(obj_classname) - # print("classname=",obj_classname,"_class",super(obj)._class) - #- not already built, create a new one for this class -# - if obj_class_struct == nil - self.widget_cb() # set up all structures - obj_class_struct = self.widget_struct_default.copy() # get a copy of the structure with pre-defined callbacks - obj_class_struct.base_class = super(obj)._class - if introspect.get(obj, 'widget_width_def') obj_class_struct.width_def = obj.widget_width_def end - if introspect.get(obj, 'widget_height_def') obj_class_struct.height_def = obj.widget_height_def end - if introspect.get(obj, 'widget_editable') obj_class_struct.editable = obj.widget_editable end - if introspect.get(obj, 'widget_group_def') obj_class_struct.group_def = obj.widget_group_def end - if introspect.get(obj, 'widget_instance_size') obj_class_struct.instance_size = obj.widget_instance_size end - - #- keep a copy of the structure to avoid GC and reuse if needed -# - self.widget_struct_by_class[obj_classname] = obj_class_struct - end - - var lv_obj_ptr = lv.obj_class_create_obj(obj_class_struct, parent) - obj._p = lv_obj_ptr._p - self.register_obj(obj) - obj.class_init_obj() - end -end - -_lvgl = LVGL_glob() - -# class lv_custom_widget : lv.lv_obj -# # static widget_width_def -# # static widget_height_def -# # static widget_editable -# # static widget_group_def -# # static widget_instance_size -# # -# var percentage # value to display, range 0..100 -# var p1, p2, area, line_dsc # instances of objects kept to avoid re-instanciating at each call - -# def init(parent) -# _lvgl.create_custom_widget(self, parent) -# # own values -# self.percentage = 100 -# # pre-allocate buffers -# self.p1 = lv.lv_point() -# self.p2 = lv.lv_point() -# self.area = lv.lv_area() -# self.line_dsc = lv.lv_draw_line_dsc() -# end - -# # def widget_constructor(cl) -# # print("widget_constructor", cl) -# # end - -# # def widget_destructor(cl) -# # print("widget_destructor", cl) -# # end - -# def widget_event(cl, event) -# var res = lv.obj_event_base(cl, event) -# if res != lv.RES_OK return end - -# def atleast1(x) if x >= 1 return x else return 1 end end -# # the model is that we have 4 bars and inter-bar (1/4 of width) -# var height = self.get_height() -# var width = self.get_width() - -# var inter_bar = atleast1(width / 15) -# var bar = atleast1((width - inter_bar * 3) / 4) -# var bar_offset = bar / 2 - -# var code = event.code -# if code == lv.EVENT_DRAW_MAIN -# var clip_area = lv.lv_area(event.param) -# print("widget_event DRAW", clip_area.tomap()) -# # lv.event_send(self, lv.EVENT_DRAW_MAIN, clip_area) - -# # get coordinates of object -# self.get_coords(self.area) -# var x_ofs = self.area.x1 -# var y_ofs = self.area.y1 - -# lv.draw_line_dsc_init(self.line_dsc) # initialize lv.lv_draw_line_dsc structure -# self.init_draw_line_dsc(lv.PART_MAIN, self.line_dsc) - -# self.line_dsc.round_start = 1 -# self.line_dsc.round_end = 1 -# self.line_dsc.width = bar - -# var on_color = self.get_style_line_color(lv.PART_MAIN | lv.STATE_DEFAULT) -# var off_color = self.get_style_bg_color(lv.PART_MAIN | lv.STATE_DEFAULT) - -# lv.event_send(self, lv.EVENT_DRAW_PART_BEGIN, self.line_dsc) -# for i:0..3 # 4 bars -# self.line_dsc.color = self.percentage >= (i+1)*20 ? on_color : off_color -# self.p1.y = y_ofs + height - 1 - bar_offset -# self.p1.x = x_ofs + i * (bar + inter_bar) + bar_offset -# self.p2.y = y_ofs + ((3 - i) * (height - bar)) / 4 + bar_offset -# self.p2.x = self.p1.x -# lv.draw_line(self.p1, self.p2, clip_area, self.line_dsc) -# end -# lv.event_send(self, lv.EVENT_DRAW_PART_END, self.line_dsc) - -# end -# end - -# def set_percentage(v) -# var old_bars = self.percentage / 5 -# if v > 100 v = 100 end -# if v < 0 v = 0 end -# self.percentage = v -# if old_bars != v / 5 -# self.invalidate() # be frugal and avoid updating the widget if it's not needed -# end -# end - -# def get_percentage() -# return self.percentage -# end -# end - -# ########## ########## ########## ########## ########## ########## ########## ########## - -# lv.start() - -# hres = lv.get_hor_res() # should be 320 -# vres = lv.get_ver_res() # should be 240 - -# scr = lv.scr_act() # default screean object -# f20 = lv.montserrat_font(20) # load embedded Montserrat 20 - -# scr.set_style_bg_color(lv.lv_color(0x0000A0), lv.PART_MAIN | lv.STATE_DEFAULT) - -# w = lv_custom_widget(scr) \ No newline at end of file diff --git a/lib/libesp32/berry/default/embedded/openhasp.be b/lib/libesp32/berry/default/embedded/openhasp.be deleted file mode 100644 index 4232a605b..000000000 --- a/lib/libesp32/berry/default/embedded/openhasp.be +++ /dev/null @@ -1,764 +0,0 @@ -import string -import json - -# lv.start() -# scr = lv.scr_act() # default screean object -# scr.set_style_bg_color(lv.color(0x0000A0), lv.PART_MAIN | lv.STATE_DEFAULT) - -lv.start() - -hres = lv.get_hor_res() # should be 320 -vres = lv.get_ver_res() # should be 240 - -scr = lv.scr_act() # default screean object -#f20 = lv.montserrat_font(20) # load embedded Montserrat 20 -r20 = lv.font_robotocondensed_latin1(20) -r16 = lv.font_robotocondensed_latin1(16) - -th2 = lv.theme_openhasp_init(0, lv.color(0xFF00FF), lv.color(0x303030), false, r16) -scr.get_disp().set_theme(th2) -# TODO -scr.set_style_bg_color(lv.color(lv.COLOR_WHITE),0) - -# apply theme to layer_top, but keep it transparent -lv.theme_apply(lv.layer_top()) -lv.layer_top().set_style_bg_opa(0,0) - - -# takes an attribute name and responds if it needs color conversion -def is_color_attribute(t) - import string - t = str(t) - # contains `color` but does not contain `color_` - return (string.find(t, "color") >= 0) && (string.find(t, "color_") < 0) -end - -# parse hex string -def parse_hex(s) - import string - s = string.toupper(s) # turn to uppercase - var val = 0 - for i:0..size(s)-1 - var c = s[i] - # var c_int = string.byte(c) - if c == "#" continue end # skip '#' prefix if any - if c == "x" || c == "X" continue end # skip 'x' or 'X' - - if c >= "A" && c <= "F" - val = (val << 4) | string.byte(c) - 55 - elif c >= "0" && c <= "9" - val = (val << 4) | string.byte(c) - 48 - end - end - return val -end - -def parse_color(s) - s = str(s) - if s[0] == '#' - return lv.color(parse_hex(s)) - else - import string - import introspect - var col_name = "COLOR_" + string.toupper(s) - var col_try = introspect.get(lv, col_name) - if col_try != nil - return lv.color(col_try) - end - end - # fail safe with black color - return lv.color(0x000000) -end - -#- ------------------------------------------------------------ - Class `lvh_obj` encapsulating `lv_obj`` - - Provide a mapping for virtual members - Stores the associated page and object id - - Adds specific virtual members used by OpenHASP -- ------------------------------------------------------------ -# -class lvh_obj - # _lv_class refers to the lvgl class encapsulated, and is overriden by subclasses - static _lv_class = lv.obj - static _lv_part2_selector # selector for secondary part (like knob of arc) - - # attributes to ignore when set at object level (they are managed by page) - static _attr_ignore = [ - "id", - "obj", - "page", - "comment", - "parentid", - "auto_size", # TODO not sure it's still needed in LVGL8 - ] - #- mapping from OpenHASP attribute to LVGL attribute -# - #- if mapping is null, we use set_X and get_X from our own class -# - static _attr_map = { - "x": "x", - "y": "y", - "w": "width", - "h": "height", - # arc - "asjustable": nil, - "mode": nil, - "start_angle": "bg_start_angle", - "start_angle1": "start_angle", - "end_angle": "bg_end_angle", - "end_angle1": "end_angle", - "radius": "style_radius", - "border_side": "style_border_side", - "bg_opa": "style_bg_opa", - "border_width": "style_border_width", - "line_width": nil, # depebds on class - "line_width1": nil, # depebds on class - "action": nil, # store the action in self._action - "hidden": nil, # apply to self - "enabled": nil, # apply to self - "click": nil, # synonym to enabled - "toggle": nil, - "bg_color": "style_bg_color", - "bg_grad_color": "style_bg_grad_color", - "type": nil, - # below automatically create a sub-label - "text": nil, # apply to self - "value_str": nil, # synonym to 'text' - "align": nil, - "text_font": nil, - "value_font": nil, # synonym to text_font - "text_color": nil, - "value_color": nil, # synonym to text_color - "value_ofs_x": nil, - "value_ofs_y": nil, - # - "min": nil, - "max": nil, - "val": "value", - "rotation": "rotation", - # img - "src": "src", - "image_recolor": "style_img_recolor", - "image_recolor_opa": "style_img_recolor_opa", - # spinner - "angle": nil, - "speed": nil, - # padding of knob - "pad_top2": nil, - "pad_bottom2": nil, - "pad_left2": nil, - "pad_right2": nil, - "pad_all2": nil, - "radius2": nil, - } - - var _lv_obj # native lvgl object - var _lv_label # sub-label if exists - var _action # action for OpenHASP - - # init - # - create the LVGL encapsulated object - # arg1: parent object - # arg2: json line object - def init(parent, jline) - var obj_class = self._lv_class # need to assign to a var to distinguish from method call - self._lv_obj = obj_class(parent) # instanciate LVGL object - self.post_init() - end - - # post-init, to be overriden - def post_init() - end - - # get LVGL encapsulated object - def get_obj() - return self._lv_obj - end - - def set_action(t) - self._action = str(t) - end - def get_action() - return self._action() - end - - def set_line_width(t) - self._lv_obj.set_style_line_width(int(t), lv.PART_MAIN | lv.STATE_DEFAULT) - end - def get_line_width() - return self._lv_obj.get_style_line_width(lv.PART_MAIN | lv.STATE_DEFAULT) - end - - #- ------------------------------------------------------------ - Mapping of synthetic attributes - - text - - hidden - - enabled - - ------------------------------------------------------------ -# - #- `hidden` attributes mapped to OBJ_FLAG_HIDDEN -# - def set_hidden(h) - if h - self._lv_obj.add_flag(lv.OBJ_FLAG_HIDDEN) - else - self._lv_obj.clear_flag(lv.OBJ_FLAG_HIDDEN) - end - end - - def get_hidden() - return self._lv_obj.has_flag(lv.OBJ_FLAG_HIDDEN) - end - - #- `enabled` attributes mapped to OBJ_FLAG_CLICKABLE -# - def set_enabled(h) - if h - self._lv_obj.add_flag(lv.OBJ_FLAG_CLICKABLE) - else - self._lv_obj.clear_flag(lv.OBJ_FLAG_CLICKABLE) - end - end - - def get_enabled() - return self._lv_obj.has_flag(lv.OBJ_FLAG_CLICKABLE) - end - # click is synonym to enabled - def set_click(t) self.set_enabled(t) end - def get_click() return self.get_enabled() end - - #- `toggle` attributes mapped to STATE_CHECKED -# - def set_toggle(t) - if t == "TRUE" t = true end - if t == "FALSE" t = false end - if t - self._lv_obj.add_state(lv.STATE_CHECKED) - else - self._lv_obj.clear_state(lv.STATE_CHECKED) - end - end - - def get_toggle() - return self._lv_obj.has_state(lv.STATE_CHECKED) - end - - def set_adjustable(t) - if t - self._lv_obj.add_flag(lv.OBJ_FLAG_CLICKABLE) - else - self._lv_obj.clear_flag(lv.OBJ_FLAG_CLICKABLE) - end - end - def get_adjustable() - return self._lv_obj.has_flag(lv.OBJ_FLAG_CLICKABLE) - end - - #- set_text: create a `lv_label` sub object to the current object -# - #- (default case, may be overriden by object that directly take text) -# - def check_label() - if self._lv_label == nil - self._lv_label = lv.label(self.get_obj()) - self._lv_label.set_align(lv.ALIGN_CENTER); - end - end - - def set_text(t) - self.check_label() - self._lv_label.set_text(str(t)) - end - def set_value_str(t) self.set_text(t) end - - def get_text() - if self._lv_label == nil return nil end - return self._lv_label.get_text() - end - def get_value_str() return self.get_text() end - - def set_align(t) - var align - self.check_label() - if t == 0 || t == "left" - align = lv.TEXT_ALIGN_LEFT - elif t == 1 || t == "center" - align = lv.TEXT_ALIGN_CENTER - elif t == 2 || t == "right" - align = lv.TEXT_ALIGN_RIGHT - end - self._lv_label.set_style_text_align(align, lv.PART_MAIN | lv.STATE_DEFAULT) - end - - def get_align() - if self._lv_label == nil return nil end - var align self._lv_label.get_style_text_align(lv.PART_MAIN | lv.STATE_DEFAULT) - if align == lv.TEXT_ALIGN_LEFT - return "left" - elif align == lv.TEXT_ALIGN_CENTER - return "center" - elif align == lv.TEXT_ALIGN_RIGHT - return "right" - else - return nil - end - end - - def set_text_font(t) - self.check_label() - var f = lv.font_robotocondensed_latin1(int(t)) - if f != nil - self._lv_label.set_style_text_font(f, lv.PART_MAIN | lv.STATE_DEFAULT) - else - print("HSP: Unsupported font size: robotocondensed-latin1", t) - end - end - def get_text_font() - end - def set_value_font(t) self.set_text_font(t) end - def get_value_font() return self.get_text_font() end - - def set_text_color(t) - self.check_label() - self._lv_label.set_style_text_color(parse_color(t), lv.PART_MAIN | lv.STATE_DEFAULT) - end - def get_text_color() - return self._text_color - end - def set_value_color(t) self.set_text_color(t) end - def get_value_color() return self.get_value_color() end - - def set_value_ofs_x(t) - self.check_label() - self._lv_label.set_x(int(t)) - end - def get_value_ofs_x() - return self._lv_label.get_x() - end - def set_value_ofs_y(t) - self.check_label() - self._lv_label.set_y(int(t)) - end - def get_value_ofs_y() - return self._lv_label.get_y() - end - - # secondary element - def set_pad_top2(t) - if self._lv_part2_selector != nil - self._lv_obj.set_style_pad_top(int(t), self._lv_part2_selector | lv.STATE_DEFAULT) - end - end - def set_pad_bottom2(t) - if self._lv_part2_selector != nil - self._lv_obj.set_style_pad_bottom(int(t), self._lv_part2_selector | lv.STATE_DEFAULT) - end - end - def set_pad_left2(t) - if self._lv_part2_selector != nil - self._lv_obj.set_style_pad_left(int(t), self._lv_part2_selector | lv.STATE_DEFAULT) - end - end - def set_pad_right2(t) - if self._lv_part2_selector != nil - self._lv_obj.set_style_pad_right(int(t), self._lv_part2_selector | lv.STATE_DEFAULT) - end - end - def set_pad_all2(t) - if self._lv_part2_selector != nil - self._lv_obj.set_style_pad_all(int(t), self._lv_part2_selector | lv.STATE_DEFAULT) - end - end - - def get_pad_top() - if self._lv_part2_selector != nil - return self._lv_obj.get_style_pad_top(self._lv_part2_selector | lv.STATE_DEFAULT) - end - end - def get_pad_bottomo() - if self._lv_part2_selector != nil - return self._lv_obj.get_style_pad_bottom(self._lv_part2_selector | lv.STATE_DEFAULT) - end - end - def get_pad_left() - if self._lv_part2_selector != nil - return self._lv_obj.get_style_pad_left(self._lv_part2_selector | lv.STATE_DEFAULT) - end - end - def get_pad_right() - if self._lv_part2_selector != nil - return self._lv_obj.get_style_pad_right(self._lv_part2_selector | lv.STATE_DEFAULT) - end - end - def get_pad_all() - end - - def set_radius2(t) - if self._lv_part2_selector != nil - self._lv_obj.set_style_radius(int(t), self._lv_part2_selector | lv.STATE_DEFAULT) - end - end - def get_radius2() - if self._lv_part2_selector != nil - return self._lv_obj.get_style_radius(self._lv_part2_selector | lv.STATE_DEFAULT) - end - end - - #- ------------------------------------------------------------ - Mapping of virtual attributes - - ------------------------------------------------------------ -# - def member(k) - # tostring is a special case, we shouldn't raise an exception for it - if k == 'tostring' return nil end - # - if self._attr_map.has(k) - import introspect - var kv = self._attr_map[k] - if kv - var f = introspect.get(self._lv_obj, "get_" + kv) - if type(f) == 'function' - return f(self._lv_obj) - end - else - # call self method - var f = introspect.get(self, "get_" + k) - if type(f) == 'function' - return f(self, k) - end - end - end - raise "value_error", "unknown attribute " + str(k) - end - - def setmember(k, v) - import string - # print(">> setmember", k, v) - # print(">>", classname(self), self._attr_map) - if self._attr_ignore.find(k) != nil - return - elif self._attr_map.has(k) - import introspect - var kv = self._attr_map[k] - if kv - var f = introspect.get(self._lv_obj, "set_" + kv) - # if the attribute contains 'color', convert to lv_color - if type(kv) == 'string' && is_color_attribute(kv) - v = parse_color(v) - end - # print("f=", f, v, kv, self._lv_obj, self) - if type(f) == 'function' - if string.find(kv, "style_") == 0 - # style function need a selector as second parameter - f(self._lv_obj, v, lv.PART_MAIN | lv.STATE_DEFAULT) - else - f(self._lv_obj, v) - end - return - else - print("HSP: Could not find function set_"+kv) - end - else - # call self method - var f = introspect.get(self, "set_" + k) - # print("f==",f) - if type(f) == 'function' - f(self, v) - return - end - end - - else - print("HSP: unknown attribute:", k) - end - # silently ignore if the attribute name is not supported - end -end - -#- ------------------------------------------------------------ - Other widgets -- ------------------------------------------------------------ -# - -#- ------------------------------------------------------------ - label -#- ------------------------------------------------------------# -class lvh_label : lvh_obj - static _lv_class = lv.label - # label do not need a sub-label - def post_init() - self._lv_label = self._lv_obj - end -end - -#- ------------------------------------------------------------ - arc -#- ------------------------------------------------------------# -class lvh_arc : lvh_obj - static _lv_class = lv.arc - static _lv_part2_selector = lv.PART_KNOB - - # line_width converts to arc_width - def set_line_width(t) - self._lv_obj.set_style_arc_width(int(t), lv.PART_MAIN | lv.STATE_DEFAULT) - end - def get_line_width() - return self._lv_obj.get_arc_line_width(lv.PART_MAIN | lv.STATE_DEFAULT) - end - def set_line_width1(t) - self._lv_obj.set_style_arc_width(int(t), lv.PART_INDICATOR | lv.STATE_DEFAULT) - end - def get_line_width1() - return self._lv_obj.get_arc_line_width(lv.PART_INDICATOR | lv.STATE_DEFAULT) - end - - def set_min(t) - self._lv_obj.set_range(int(t), self.get_max()) - end - def set_max(t) - self._lv_obj.set_range(self.get_min(), int(t)) - end - def get_min() - return self._lv_obj.get_min_value() - end - def get_max() - return self._lv_obj.get_max_value() - end - def set_type(t) - var mode - if t == 0 mode = lv.ARC_MODE_NORMAL - elif t == 1 mode = lv.ARC_MODE_REVERSE - elif t == 2 mode = lv.ARC_MODE_SYMMETRICAL - end - if mode != nil - self._lv_obj.set_mode(mode) - end - end - def get_type() - return self._lv_obj.get_mode() - end - # mode - def set_mode(t) - var mode - if mode == "expand" self._lv_obj.set_width(lv.SIZE_CONTENT) - elif mode == "break" mode = lv.LABEL_LONG_WRAP - elif mode == "dots" mode = lv.LABEL_LONG_DOT - elif mode == "scroll" mode = lv.LABEL_LONG_SCROLL - elif mode == "loop" mode = lv.LABEL_LONG_SCROLL_CIRCULAR - elif mode == "crop" mode = lv.LABEL_LONG_CLIP - end - if mode != nil - self._lv_obj.lv_label_set_long_mode(mode) - end - end - def get_mode() - end - -end - -#- ------------------------------------------------------------ - switch -#- ------------------------------------------------------------# -class lvh_switch : lvh_obj - static _lv_class = lv.switch - static _lv_part2_selector = lv.PART_KNOB -end - -#- ------------------------------------------------------------ - spinner -#- ------------------------------------------------------------# -class lvh_spinner : lvh_arc - static _lv_class = lv.spinner - - # init - # - create the LVGL encapsulated object - # arg1: parent object - # arg2: json line object - def init(parent, jline) - var angle = jline.find("angle", 60) - var speed = jline.find("speed", 1000) - self._lv_obj = lv.spinner(parent, speed, angle) - self.post_init() - end - - # ignore attributes, spinner can't be changed once created - def set_angle(t) end - def get_angle() end - def set_speed(t) end - def get_speed() end -end - -#- creat sub-classes of lvh_obj and map the LVGL class in static '_lv_class' attribute -# -class lvh_bar : lvh_obj static _lv_class = lv.bar end -class lvh_btn : lvh_obj static _lv_class = lv.btn end -class lvh_btnmatrix : lvh_obj static _lv_class = lv.btnmatrix end -class lvh_checkbox : lvh_obj static _lv_class = lv.checkbox end -class lvh_dropdown : lvh_obj static _lv_class = lv.dropdown end -class lvh_img : lvh_obj static _lv_class = lv.img end -class lvh_line : lvh_obj static _lv_class = lv.line end -class lvh_roller : lvh_obj static _lv_class = lv.roller end -class lvh_slider : lvh_obj static _lv_class = lv.slider end -class lvh_textarea : lvh_obj static _lv_class = lv.textarea end - -#- ---------------------------------------------------------------------------- - Class `lvh_page` encapsulating `lv_obj` as screen (created with lv.obj(0)) -- ----------------------------------------------------------------------------- -# -# ex of transition: lv.scr_load_anim(scr, lv.SCR_LOAD_ANIM_MOVE_RIGHT, 500, 0, false) -class lvh_page - var _obj_id # (map) of objects by id numbers - var _page_id # (int) id number of the page - var _lv_scr # (lv_obj) lvgl screen object - - #- init(page_number) -# - def init(page_number) - import global - - # if no parameter, default to page #1 - if page_number == nil page_number = 1 end - - self._page_id = page_number # remember our page_number - self._obj_id = {} # init list of objects - if page_number == 1 - self._lv_scr = lv.scr_act() # default screen - elif page_number == 0 - self._lv_scr = lv.layer_top() # top layer, visible over all screens - else - self._lv_scr = lv.obj(0) # allocate a new screen - # self._lv_scr.set_style_bg_color(lv.color(0x000000), lv.PART_MAIN | lv.STATE_DEFAULT) # set black background - self._lv_scr.set_style_bg_color(lv.color(0xFFFFFF), lv.PART_MAIN | lv.STATE_DEFAULT) # set white background - end - - # create a global for this page of form p, ex p1 - var glob_name = string.format("p%i", self._page_id) - global.(glob_name) = self - end - - #- retrieve lvgl screen object for this page -# - def get_scr() - return self._lv_scr - end - - #- add an object to this page -# - def set_obj(id, o) - self._obj_id[id] = o - end - def get_obj(id) - return self._obj_id.find(id) - end - - #- return id of this page -# - def id() - return self._page_id - end - - #- show this page, with animation -# - def show(anim, duration) - # ignore if there is no screen, like for id 0 - if self._lv_scr == nil return nil end - # ignore if the screen is already active - if self._lv_scr._p == lv.scr_act()._p return end # do nothing - - # default animation is lv.SCR_LOAD_ANIM_MOVE_RIGHT - if anim == nil anim = lv.SCR_LOAD_ANIM_MOVE_RIGHT end - # default duration of 500ms - if duration == nil duration = 500 end - - # load new screen with anumation, no delay, 500ms transition time, no auto-delete - lv.scr_load_anim(self._lv_scr, lv.SCR_LOAD_ANIM_MOVE_RIGHT, duration, 0, false) - end -end - -#- pages -# -var lvh_page_cur = lvh_page(1) -var lvh_pages = { 1: lvh_page_cur } # always create page #1 - -f = open("pages.jsonl","r") -var jsonl = string.split(f.read(), "\n") -f.close() - -#- ------------------------------------------------------------ - Parse page information - - Create a new page object if required - Change the active page -- ------------------------------------------------------------ -# -def parse_page(jline) - if jline.has("page") && type(jline["page"]) == 'int' - var page = int(jline["page"]) - # does the page already exist? - if lvh_pages.has(page) - # yes, just change the current page - lvh_page_cur = lvh_pages[page] - else - # no, create a new page - lvh_page_cur = lvh_page(page) - lvh_pages[page] = lvh_page_cur - end - end -end - -#- ------------------------------------------------------------ - Parse single object - -- ------------------------------------------------------------ -# -def parse_obj(jline, page) - import global - import introspect - - # line must contain 'obj' and 'id', otherwise it is ignored - if jline.has("obj") && jline.has("id") && type(jline["id"]) == 'int' - # 'obj_id' must be between 1 and 254 - var obj_id = int(jline["id"]) - if obj_id < 1 || obj_id > 254 - raise "value error", "invalid id " + str(obj_id) - end - - # extract openhasp class, prefix with `lvh_`. Ex: `btn` becomes `lvh_btn` - var obj_type = jline["obj"] - - # extract parent - var parent - var parent_id = int(jline.find("parentid")) - if parent_id != nil - var parent_obj = lvh_page_cur.get_obj(parent_id) - if parent_obj != nil - parent = parent_obj._lv_obj - end - end - if parent == nil - parent = page.get_scr() - end - - # check if a class with the requested name exists - var obj_class = introspect.get(global, "lvh_" + obj_type) - if obj_class == nil - raise "value error", "cannot find object of type " + str(obj_type) - end - - # instanciate the object, passing the lvgl screen as paren object - var obj = obj_class(parent, jline) - - # add object to page object - lvh_page_cur.set_obj(obj_id, obj) - # set attributes - # try every attribute, if not supported it is silently ignored - for k:jline.keys() - # introspect.set(obj, k, jline[k]) - obj.(k) = jline[k] - end - - # create a global variable for this object of form pb, ex p1b2 - var glob_name = string.format("p%ib%i", lvh_page_cur.id(), obj_id) - global.(glob_name) = obj - end -end - -# ex: -# {'page': 1, 'h': 50, 'obj': 'label', 'hidden': false, 'text': 'Hello', 'x': 5, 'id': 1, 'enabled': true, 'y': 5, 'w': 50} -# {"page":1,"id":2,"obj":"btn","x":5,"y":90,"h":90,"w":50,"text":"World","enabled":false,"hidden":false} - -#- ------------------------------------------------------------ - Parse jsonl file line by line - -- ------------------------------------------------------------ -# -tasmota.yield() -for j:jsonl - var jline = json.load(j) - - # parse page first - if type(jline) == 'instance' - parse_page(jline) - parse_obj(jline, lvh_page_cur) - end -end diff --git a/lib/libesp32/berry/default/embedded/openhasp/demo-all.jsonl b/lib/libesp32/berry/default/embedded/openhasp/demo-all.jsonl deleted file mode 100644 index 76d3ed810..000000000 --- a/lib/libesp32/berry/default/embedded/openhasp/demo-all.jsonl +++ /dev/null @@ -1,61 +0,0 @@ -{"page":1,"comment":"---------- Page 1 ----------"} -{"page":1,"id":0,"bg_color":"#FFFFFF","bg_grad_color":"#FFFFFF","text_color":"#000000","radius":0,"border_side":0} -{"page":1,"id":1,"obj":"btn","x":0,"y":0,"w":240,"h":30,"text":"LIVING ROOM","value_font":24,"bg_color":"#2C3E50","bg_grad_color":"#2C3E50","text_color":"#FFFFFF","radius":0,"border_side":0} - -{"page":1,"id":2,"obj":"arc","x":20,"y":65,"w":80,"h":100,"max":40,"border_side":0,"type":0,"rotation":0,"start_angle":180,"end_angle":0,"start_angle1":180,"value_font":12,"value_ofs_x":0,"value_ofs_y":-14,"bg_opa":0,"text":"21.2°C","min":-20,"max":50,"val":21} - -{"page":1,"id":3,"obj":"arc","x":140,"y":65,"w":80,"h":100,"max":100,"border_side":0,"type":0,"start_angle":180,"end_angle":0,"start_angle1":180,"value_font":12,"value_color":"#000000","value_ofs_x":0,"value_ofs_y":-14,"bg_opa":0,"text":"44%","val":44} - -{"page":1,"id":4,"obj":"label","x":0,"y":120,"w":240,"h":20,"text":"CO2 levels: 1483 ppm","radius":0,"border_side":0,"align":1} -{"page":1,"id":5,"obj":"label","x":2,"y":35,"w":140,"text":"Temperature","align":1} -{"page":1,"id":6,"obj":"label","x":140,"y":35,"w":95,"text":"Humidity","align":1} -{"page":1,"id":7,"obj":"btn","x":0,"y":160,"w":240,"h":20,"text":"LIGHTS","bg_color":"#F1C40F","text_color":"#FFFFFF","radius":0,"border_side":0} -{"page":1,"id":8,"obj":"label","x":20,"y":190,"w":140,"h":20,"text":"Ceiling Light"} -{"page":1,"id":9,"obj":"switch","x":160,"y":190,"w":40,"h":20,"toggle":"TRUE"} -{"page":1,"id":10,"obj":"label","x":20,"y":215,"w":140,"h":20,"text":"Wall Light"} -{"page":1,"id":11,"obj":"switch","x":160,"y":215,"w":40,"h":20,"toggle":"TRUE"} -{"page":1,"id":12,"obj":"label","x":20,"y":240,"w":200,"h":20,"text":"Ambient Light"} -{"page":1,"id":13,"obj":"slider","x":30,"y":265,"w":200,"h":10} - -{"page":2,"comment":"---------- Page 2 ----------"} -{"page":2,"id":1,"obj":"btn","x":0,"y":0,"w":240,"h":30,"text":"ENTITIES","value_font":24,"bg_color":"#2C3E50","text_color":"#FFFFFF","radius":0,"border_side":0,"click":0} -{"page":2,"id":2,"obj":"obj","x":5,"y":35,"w":230,"h":250,"click":0} - -{"page":2,"id":11,"obj":"label","x":8,"y":33,"w":35,"h":35,"text":"\uE004","align":1,"text_font":32,"text_color":"black"} -{"page":2,"id":12,"obj":"label","x":48,"y":43,"w":130,"h":30,"text":"Presence override","align":0,"text_font":16,"text_color":"black"} -{"page":2,"id":13,"obj":"switch","x":177,"y":40,"w":50,"h":25,"radius":25,"radius2":15} - -{"page":2,"id":21,"obj":"label","x":8,"y":69,"w":35,"h":35,"text":"\uF020","align":1,"text_font":32,"text_color":"black"} -{"page":2,"id":22,"obj":"label","x":48,"y":79,"w":130,"h":30,"text":"Front door light","align":0,"text_font":16,"text_color":"black"} -{"page":2,"id":23,"obj":"switch","x":177,"y":74,"w":50,"h":25,"radius":25,"radius2":15} - -{"page":2,"id":31,"obj":"label","x":8,"y":103,"w":35,"h":35,"text":"\uF054","align":1,"text_font":32,"text_color":"black"} -{"page":2,"id":32,"obj":"label","x":48,"y":113,"w":130,"h":30,"text":"Back yard lights","align":0,"text_font":16,"text_color":"black"} -{"page":2,"id":33,"obj":"switch","x":177,"y":110,"w":50,"h":25,"radius":25,"radius2":15} - -{"page":2,"id":41,"obj":"label","x":8,"y":138,"w":35,"h":35,"text":"\uEA7A","align":1,"text_font":32,"text_color":"black"} -{"page":2,"id":42,"obj":"label","x":48,"y":148,"w":130,"h":30,"text":"Trash service","align":0,"text_font":16,"text_color":"black"} -{"page":2,"id":43,"obj":"label","x":97,"y":148,"w":130,"h":30,"text":"in 6 days","align":2,"text_color":"black"} - -{"page":2,"id":51,"obj":"label","x":8,"y":173,"w":35,"h":35,"text":"\uF39D","align":1,"text_font":32,"text_color":"black"} -{"page":2,"id":52,"obj":"label","x":48,"y":183,"w":130,"h":30,"text":"Selective trash","align":0,"text_font":16,"text_color":"black"} -{"page":2,"id":53,"obj":"label","x":97,"y":183,"w":130,"h":30,"text":"in 10 days","align":2,"text_color":"black"} - -{"page":2,"id":61,"obj":"label","x":8,"y":208,"w":35,"h":35,"text":"\uE32A","align":1,"text_font":32,"text_color":"black"} -{"page":2,"id":62,"obj":"label","x":48,"y":218,"w":130,"h":30,"text":"Green energy active","align":0,"text_font":16,"text_color":"black"} -{"page":2,"id":63,"obj":"label","x":97,"y":218,"w":130,"h":30,"text":"Yes :)","align":2,"text_color":"black"} - -{"page":2,"id":71,"obj":"label","x":8,"y":243,"w":35,"h":35,"text":"\uE957","align":1,"text_font":32,"text_color":"black"} -{"page":2,"id":72,"obj":"label","x":48,"y":253,"w":130,"h":30,"text":"Air quality","align":0,"text_font":16,"text_color":"black"} -{"page":2,"id":73,"obj":"label","x":97,"y":253,"w":130,"h":30,"text":"OK (29.58 µg/m³)","align":2,"text_color":"black"} - -{"page":3,"comment":"---------- Page 3 ----------"} -{"page":3,"id":1,"obj":"btn","x":0,"y":0,"w":240,"h":30,"text":"FAN STATUS","text_font":16,"bg_color":"#2C3E50","text_color":"#FFFFFF","radius":0,"border_side":0,"click":0} - -{"page":3,"id":11,"obj":"img","src":"A:/noun_Fan_35097_140.png","auto_size":1,"w":140,"h":140,"x":50,"y":75,"image_recolor":"lime","image_recolor_opa":150} -{"page":3,"id":12,"obj":"spinner","parentid":11,"x":7,"y":6,"w":126,"h":126,"bg_opa":0,"border_width":0,"line_width":7,"line_width1":7,"type":2,"angle":120,"speed":1000,"value_str":3,"value_font":24} - -{"page":0,"comment":"---------- All pages ----------"} -{"page":0,"id":11,"obj":"btn","action":"prev","x":0,"y":290,"w":79,"h":32,"bg_color":"#34495E","text":"\uE141","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":32} -{"page":0,"id":12,"obj":"btn","action":"back","x":80,"y":290,"w":80,"h":32,"bg_color":"#34495E","text":"\uE2DC","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":24} -{"page":0,"id":13,"obj":"btn","action":"next","x":161,"y":290,"w":79,"h":32,"bg_color":"#34495E","text":"\uE142","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":32} diff --git a/lib/libesp32/berry/default/embedded/openhasp/demo1.jsonl b/lib/libesp32/berry/default/embedded/openhasp/demo1.jsonl deleted file mode 100644 index 684e0d324..000000000 --- a/lib/libesp32/berry/default/embedded/openhasp/demo1.jsonl +++ /dev/null @@ -1,23 +0,0 @@ -{"page":1,"comment":"---------- Page 1 ----------"} -{"page":1,"id":0,"bg_color":"#FFFFFF","bg_grad_color":"#FFFFFF","text_color":"#000000","radius":0,"border_side":0} -{"page":1,"id":1,"obj":"btn","x":0,"y":0,"w":240,"h":30,"text":"LIVING ROOM","value_font":22,"bg_color":"#2C3E50","bg_grad_color":"#2C3E50","text_color":"#FFFFFF","radius":0,"border_side":0} - -{"page":1,"id":2,"obj":"arc","x":20,"y":65,"w":80,"h":100,"max":40,"border_side":0,"type":0,"rotation":0,"start_angle":180,"end_angle":0,"start_angle1":180,"value_font":12,"value_ofs_x":0,"value_ofs_y":-14,"bg_opa":0,"text":"21.2°C","min":-20,"max":50,"val":21} - -{"page":1,"id":3,"obj":"arc","x":140,"y":65,"w":80,"h":100,"max":100,"border_side":0,"type":0,"start_angle":180,"end_angle":0,"start_angle1":180,"value_font":12,"value_color":"#000000","value_ofs_x":0,"value_ofs_y":-14,"bg_opa":0,"text":"44%","val":44} - -{"page":1,"id":4,"obj":"label","x":0,"y":120,"w":240,"h":20,"text":"CO2 levels: 1483 ppm","radius":0,"border_side":0,"align":1} -{"page":1,"id":5,"obj":"label","x":2,"y":35,"w":140,"text":"Temperature","align":1} -{"page":1,"id":6,"obj":"label","x":140,"y":35,"w":95,"text":"Humidity","align":1} -{"page":1,"id":7,"obj":"btn","x":0,"y":160,"w":240,"h":20,"text":"LIGHTS","bg_color":"#F1C40F","text_color":"#FFFFFF","radius":0,"border_side":0} -{"page":1,"id":8,"obj":"label","x":20,"y":190,"w":140,"h":20,"text":"Ceiling Light"} -{"page":1,"id":9,"obj":"switch","x":160,"y":190,"w":40,"h":20,"toggle":"TRUE"} -{"page":1,"id":10,"obj":"label","x":20,"y":215,"w":140,"h":20,"text":"Wall Light"} -{"page":1,"id":11,"obj":"switch","x":160,"y":215,"w":40,"h":20,"toggle":"TRUE"} -{"page":1,"id":12,"obj":"label","x":20,"y":240,"w":200,"h":20,"text":"Ambient Light"} -{"page":1,"id":13,"obj":"slider","x":30,"y":265,"w":200,"h":10} - -{"page":0,"comment":"---------- All pages ----------"} -{"page":0,"id":11,"obj":"btn","action":"prev","x":0,"y":290,"w":79,"h":32,"bg_color":"#34495E","text":"\uE141","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":32} -{"page":0,"id":12,"obj":"btn","action":"back","x":80,"y":290,"w":80,"h":32,"bg_color":"#34495E","text":"\uE2DC","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":24} -{"page":0,"id":13,"obj":"btn","action":"next","x":161,"y":290,"w":79,"h":32,"bg_color":"#34495E","text":"\uE142","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":32} diff --git a/lib/libesp32/berry/default/embedded/openhasp/demo2.jsonl b/lib/libesp32/berry/default/embedded/openhasp/demo2.jsonl deleted file mode 100644 index b1d6efc34..000000000 --- a/lib/libesp32/berry/default/embedded/openhasp/demo2.jsonl +++ /dev/null @@ -1,35 +0,0 @@ -{"page":1,"id":1,"obj":"btn","x":0,"y":0,"w":240,"h":30,"text":"ENTITIES","value_font":22,"bg_color":"#2C3E50","text_color":"#FFFFFF","radius":0,"border_side":0,"click":0} -{"page":1,"id":2,"obj":"obj","x":5,"y":35,"w":230,"h":250,"click":0} - -{"page":1,"id":11,"obj":"label","x":8,"y":33,"w":35,"h":35,"text":"\uE004","align":1,"text_font":32,"text_color":"black"} -{"page":1,"id":12,"obj":"label","x":48,"y":43,"w":130,"h":30,"text":"Presence override","align":0,"text_font":16,"text_color":"black"} -{"page":1,"id":13,"obj":"switch","x":177,"y":40,"w":50,"h":25,"radius":25,"radius2":15} - -{"page":1,"id":21,"obj":"label","x":8,"y":69,"w":35,"h":35,"text":"\uF020","align":1,"text_font":32,"text_color":"black"} -{"page":1,"id":22,"obj":"label","x":48,"y":79,"w":130,"h":30,"text":"Front door light","align":0,"text_font":16,"text_color":"black"} -{"page":1,"id":23,"obj":"switch","x":177,"y":74,"w":50,"h":25,"radius":25,"radius2":15} - -{"page":1,"id":31,"obj":"label","x":8,"y":103,"w":35,"h":35,"text":"\uF054","align":1,"text_font":32,"text_color":"black"} -{"page":1,"id":32,"obj":"label","x":48,"y":113,"w":130,"h":30,"text":"Back yard lights","align":0,"text_font":16,"text_color":"black"} -{"page":1,"id":33,"obj":"switch","x":177,"y":110,"w":50,"h":25,"radius":25,"radius2":15} - -{"page":1,"id":41,"obj":"label","x":8,"y":138,"w":35,"h":35,"text":"\uEA7A","align":1,"text_font":32,"text_color":"black"} -{"page":1,"id":42,"obj":"label","x":48,"y":148,"w":130,"h":30,"text":"Trash service","align":0,"text_font":16,"text_color":"black"} -{"page":1,"id":43,"obj":"label","x":97,"y":148,"w":130,"h":30,"text":"in 6 days","align":2,"text_color":"black"} - -{"page":1,"id":51,"obj":"label","x":8,"y":173,"w":35,"h":35,"text":"\uF39D","align":1,"text_font":32,"text_color":"black"} -{"page":1,"id":52,"obj":"label","x":48,"y":183,"w":130,"h":30,"text":"Selective trash","align":0,"text_font":16,"text_color":"black"} -{"page":1,"id":53,"obj":"label","x":97,"y":183,"w":130,"h":30,"text":"in 10 days","align":2,"text_color":"black"} - -{"page":1,"id":61,"obj":"label","x":8,"y":208,"w":35,"h":35,"text":"\uE32A","align":1,"text_font":32,"text_color":"black"} -{"page":1,"id":62,"obj":"label","x":48,"y":218,"w":130,"h":30,"text":"Green energy active","align":0,"text_font":16,"text_color":"black"} -{"page":1,"id":63,"obj":"label","x":97,"y":218,"w":130,"h":30,"text":"Yes :)","align":2,"text_color":"black"} - -{"page":1,"id":71,"obj":"label","x":8,"y":243,"w":35,"h":35,"text":"\uE957","align":1,"text_font":32,"text_color":"black"} -{"page":1,"id":72,"obj":"label","x":48,"y":253,"w":130,"h":30,"text":"Air quality","align":0,"text_font":16,"text_color":"black"} -{"page":1,"id":73,"obj":"label","x":97,"y":253,"w":130,"h":30,"text":"OK (29.58 µg/m³)","align":2,"text_color":"black"} - -{"page":0,"comment":"---------- All pages ----------"} -{"page":0,"id":11,"obj":"btn","action":"prev","x":0,"y":290,"w":79,"h":32,"bg_color":"#34495E","text":"\uE141","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":32} -{"page":0,"id":12,"obj":"btn","action":"back","x":80,"y":290,"w":80,"h":32,"bg_color":"#34495E","text":"\uE2DC","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":24} -{"page":0,"id":13,"obj":"btn","action":"next","x":161,"y":290,"w":79,"h":32,"bg_color":"#34495E","text":"\uE142","text_color":"#CCCCCC","radius":0,"border_side":0,"text_font":32} diff --git a/lib/libesp32/berry/default/embedded/openhasp/demo3.jsonl b/lib/libesp32/berry/default/embedded/openhasp/demo3.jsonl deleted file mode 100644 index f8b952f81..000000000 --- a/lib/libesp32/berry/default/embedded/openhasp/demo3.jsonl +++ /dev/null @@ -1,4 +0,0 @@ -{"page":1,"id":1,"obj":"btn","x":0,"y":0,"w":240,"h":30,"text":"FAN STATUS","text_font":16,"bg_color":"#2C3E50","text_color":"#FFFFFF","radius":0,"border_side":0,"click":0} - -{"page":1,"id":11,"obj":"img","src":"A:/noun_Fan_35097_140.png","auto_size":1,"w":140,"h":140,"x":50,"y":75,"image_recolor":"lime","image_recolor_opa":150} -{"page":1,"id":12,"obj":"spinner","parentid":11,"x":7,"y":6,"w":126,"h":126,"bg_opa":0,"border_width":0,"line_width":7,"line_width1":7,"type":2,"angle":120,"speed":1000,"value_str":3,"value_font":24} \ No newline at end of file diff --git a/lib/libesp32/berry/default/embedded/persist.be b/lib/libesp32/berry/default/embedded/persist.be deleted file mode 100644 index 164a1dd7b..000000000 --- a/lib/libesp32/berry/default/embedded/persist.be +++ /dev/null @@ -1,161 +0,0 @@ -#- persistance module for Berry -# -#- -# -#- To solidify: -# -#- - # load only persis_module and persist_module.init - import solidify - solidify.dump(persist_module.init) - # copy and paste into `be_persist_lib.c` --# -var persist_module = module("persist") - -persist_module.init = def (m) - - class Persist - var _filename - var _p - var _dirty - - #- persist can be initialized with pre-existing values. The map is not copied so any change will be reflected -# - def init(m) - # print("Persist init") - self._filename = '_persist.json' - if isinstance(m,map) - self._p = m.copy() # need to copy instead? - else - self._p = {} - end - self.load(self._p, self._filename) - self._dirty = false - # print("Persist init") - end - - #- virtual member getter, if a key does not exists return `nil`-# - def member(key) - return self._p.find(key) - end - - #- virtual member setter -# - def setmember(key, value) - self._p[key] = value - self._dirty = true - end - - #- clear all entries -# - def zero() - self._p = {} - self._dirty = true - end - - def remove(k) - self._p.remove(k) - self._dirty = true - end - - def has(k) - return self._p.has(k) - end - - def find(k, d) - return self._p.find(k, d) - end - - def load() - import json - import path - var f # file object - var val # values loaded from json - - if path.exists(self._filename) - try - f = open(self._filename, "r") - val = json.load(f.read()) - f.close() - except .. as e, m - if f != nil f.close() end - raise e, m - end - if isinstance(val, map) - self._p = val # sucess - else - print("BRY: failed to load _persist.json") - end - self._dirty = false - else - self.save() - end - - # print("Loading") - end - - def save() - var f # file object - try - f = open(self._filename, "w") - self.json_fdump(f) - f.close() - except .. as e, m - if f != nil f.close() end - f = open(self._filename, "w") - f.write('{}') # fallback write empty map - f.close() - raise e, m - end - self._dirty = false - # print("Saving") - end - - def json_fdump_any(f, v) - import json - if isinstance(v, map) - self.json_fdump_map(f, v) - elif isinstance(v, list)v - self.json_fdump_list(f, v) - else - f.write(json.dump(v)) - end - end - - def json_fdump_map(f, v) - import json - f.write('{') - var sep = nil - for k:v.keys() - if sep != nil f.write(sep) end - - f.write(json.dump(str(k))) - f.write(':') - self.json_fdump_any(f, v[k]) - - sep = "," - end - f.write('}') - end - - def json_fdump_list(f, v) - import json - f.write('[') - var i = 0 - while i < size(v) - if i > 0 f.write(',') end - self.json_fdump_any(f, v[i]) - i += 1 - end - f.write(']') - end - - def json_fdump(f) - import json - if isinstance(self._p, map) - self.json_fdump_map(f, self._p) - else - raise "internal_error", "persist._p is not a map" - end - end - end - - - return Persist() # return an instance of this class -end - -return persist_module diff --git a/lib/libesp32/berry/default/embedded/tapp.be b/lib/libesp32/berry/default/embedded/tapp.be deleted file mode 100644 index 30aa1f740..000000000 --- a/lib/libesp32/berry/default/embedded/tapp.be +++ /dev/null @@ -1,35 +0,0 @@ -#- Tasmota apps module for Berry -# -#- -# - -var tapp_module = module("tapp") - -tapp_module.init = def (m) - - class Tapp - - def init() - tasmota.add_driver(self) - end - - def autoexec() - import path - import string - - var dir = path.listdir("/") - - for d: dir - if string.find(d, ".tapp") > 0 - tasmota.log(string.format("TAP: found Tasmota App '%s'", d), 2) - tasmota.load(d + "#autoexec.be") - end - end - end - end - - return Tapp() # return an instance of this class -end - -# aa = autoconf_module.init(autoconf_module) -# import webserver -# webserver.on('/ac2', / -> aa.page_autoconf_mgr(), webserver.HTTP_GET) -return tapp_module diff --git a/lib/libesp32/berry/default/embedded/test_crypto.be b/lib/libesp32/berry/default/embedded/test_crypto.be deleted file mode 100644 index f2edbfee5..000000000 --- a/lib/libesp32/berry/default/embedded/test_crypto.be +++ /dev/null @@ -1,30 +0,0 @@ -ec = crypto.EC_C25519() - -# Alice -sk_A = bytes('77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a') -pk_A = ec.public_key(sk_A) -assert(pk_A == bytes('8520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98eaa9b4e6a')) - -# Bob -sk_B = bytes('5dab087e624a8a4b79e17f8b83800ee66f3bb1292618b6fd1c2f8b27ff88e0eb') -pk_B = ec.public_key(sk_B) -assert(pk_B == bytes('de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f')) - -psk = ec.shared_key(sk_A, pk_B) -assert(psk == bytes('4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742')) -psk2 = ec.shared_key(sk_B, pk_A) -assert(psk2 == bytes('4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742')) - -#- test vectors from RFC77748 - - Alice's private key, a: - 77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a - Alice's public key, X25519(a, 9): - 8520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98eaa9b4e6a - Bob's private key, b: - 5dab087e624a8a4b79e17f8b83800ee66f3bb1292618b6fd1c2f8b27ff88e0eb - Bob's public key, X25519(b, 9): - de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f - Their shared secret, K: - 4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742 --# diff --git a/lib/libesp32/berry/default/static_block.hpp b/lib/libesp32/berry/default/static_block.hpp deleted file mode 100644 index 152dda130..000000000 --- a/lib/libesp32/berry/default/static_block.hpp +++ /dev/null @@ -1,80 +0,0 @@ -/** - * static_block.hpp - * - * An implementation of a Java-style static block, in C++ (and potentially a - * GCC/clang extension to avoid warnings). Almost, but not quite, valid C. - * Partially inspired by Andrei Alexandrescu's Scope Guard and - * discussions on stackoverflow.com - * - * By Eyal Rozenberg - * - * Licensed under the Apache License v2.0: - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -#pragma once -#ifndef STATIC_BLOCK_HPP_ -#define STATIC_BLOCK_HPP_ - -#ifndef CONCATENATE -#define CONCATENATE(s1, s2) s1##s2 -#define EXPAND_THEN_CONCATENATE(s1, s2) CONCATENATE(s1, s2) -#endif /* CONCATENATE */ - -#ifndef UNIQUE_IDENTIFIER -/** - * This macro expands into a different identifier in every expansion. - * Note that you _can_ clash with an invocation of UNIQUE_IDENTIFIER - * by manually using the same identifier elsewhere; or by carefully - * choosing another prefix etc. - */ -#ifdef __COUNTER__ -#define UNIQUE_IDENTIFIER(prefix) EXPAND_THEN_CONCATENATE(prefix, __COUNTER__) -#else -#define UNIQUE_IDENTIFIER(prefix) EXPAND_THEN_CONCATENATE(prefix, __LINE__) -#endif /* COUNTER */ -#else -#endif /* UNIQUE_IDENTIFIER */ - -/** - * Following is a mechanism for executing code statically. - * - * @note Caveats: - * - Your static block must be surround by curly braces. - * - No need for a semicolon after the block (but it won't hurt). - * - Do not put static blocks in files, as it might get compiled multiple - * times ane execute multiple times. - * - A static_block can only be used in file scope - not within any other block etc. - * - Templated static blocks will probably not work. Avoid them. - * - No other funny business, this is fragile. - * - This does not having any threading issues (AFAICT) - as it has no static - * initialization order issue. Of course, you have to _keep_ it safe with - * your static code. - * - Execution of the code is guaranteed to occur before main() executes, - * but the relative order of statics being initialized is unknown/unclear. So, - * do not call any method of an instance of a class which you expect to have been - * constructed; it may not have been. Instead, you can use a static getInstance() method - * (look this idiom up on the web, it's safe). - * - Variables defined within the static block are not global; they will - * go out of scope as soon as its execution concludes. - * - * Usage example: - * - * static_block { - * do_stuff(); - * std::cout << "in the static block!\n"; - * } - * - */ -#define static_block STATIC_BLOCK_IMPL1(UNIQUE_IDENTIFIER(_static_block_)) - -#define STATIC_BLOCK_IMPL1(prefix) \ - STATIC_BLOCK_IMPL2(CONCATENATE(prefix,_fn),CONCATENATE(prefix,_var)) - -#define STATIC_BLOCK_IMPL2(function_name,var_name) \ -static void function_name(); \ -static int var_name __attribute((unused)) = (function_name(), 0) ; \ -static void function_name() - - -#endif // STATIC_BLOCK_HPP_ diff --git a/lib/libesp32/berry/examples/anon_func.be b/lib/libesp32/berry/examples/anon_func.be deleted file mode 100644 index 78854ce64..000000000 --- a/lib/libesp32/berry/examples/anon_func.be +++ /dev/null @@ -1,20 +0,0 @@ -# anonymous function and closure -def count(x) - var arr = [] - for i : 0 .. x - arr.push( - def (n) # loop variable cannot be used directly as free variable - return def () - return n * n - end - end (i) # define and call anonymous function - ) - end - return arr -end - -for xx : count(6) - print(xx()) # 0, 1, 4 ... n * n -end - -return count diff --git a/lib/libesp32/berry/examples/bigloop.be b/lib/libesp32/berry/examples/bigloop.be deleted file mode 100644 index a3a77768b..000000000 --- a/lib/libesp32/berry/examples/bigloop.be +++ /dev/null @@ -1,15 +0,0 @@ -import time - -c = time.clock() -do - i = 0 - while i < 100000000 - i += 1 - end -end -print('while iteration 100000000 times', time.clock() - c, 's') - -c = time.clock() -for i : 1 .. 100000000 -end -print('for iteration 100000000 times', time.clock() - c, 's') diff --git a/lib/libesp32/berry/examples/bintree.be b/lib/libesp32/berry/examples/bintree.be deleted file mode 100644 index 81936f8a0..000000000 --- a/lib/libesp32/berry/examples/bintree.be +++ /dev/null @@ -1,60 +0,0 @@ -# Reference from https://github.com/BerryMathDevelopmentTeam/BerryMath/blob/master/testscript/BinaryTree.bm - -class node - var v, l, r - def init(v, l, r) - self.v = v - self.l = l - self.r = r - end - def insert(v) - if v < self.v - if self.l - self.l.insert(v) - else - self.l = node(v) - end - else - if self.r - self.r.insert(v) - else - self.r = node (v) - end - end - end - def sort(l) - if (self.l) self.l.sort(l) end - l.push(self.v) - if (self.r) self.r.sort(l) end - end -end - -class btree - var root - def insert(v) - if self.root - self.root.insert(v) - else - self.root = node(v) - end - end - def sort() - var l = [] - if self.root - self.root.sort(l) - end - return l - end -end - -var tree = btree() -tree.insert(-100) -tree.insert(5); -tree.insert(3); -tree.insert(9); -tree.insert(10); -tree.insert(10000000); -tree.insert(1); -tree.insert(-1); -tree.insert(-10); -print(tree.sort()); diff --git a/lib/libesp32/berry/examples/calcpi.be b/lib/libesp32/berry/examples/calcpi.be deleted file mode 100644 index 053f87875..000000000 --- a/lib/libesp32/berry/examples/calcpi.be +++ /dev/null @@ -1,16 +0,0 @@ -def cpi(n) - i = 2 - pi = 3 - while i <= n - term = 4.0 / (i * (i + 1) * (i + 2)) - if i % 4 - pi = pi + term - else - pi = pi - term - end - i = i + 2 - end - return pi -end - -print("pi =", cpi(100)) diff --git a/lib/libesp32/berry/examples/exception.be b/lib/libesp32/berry/examples/exception.be deleted file mode 100644 index 3a3098dce..000000000 --- a/lib/libesp32/berry/examples/exception.be +++ /dev/null @@ -1,12 +0,0 @@ -import debug - -def test_func() - try - compile('def +() end')() - except .. as e, v - print('catch execption:', str(e) + ' >>>\n ' + str(v)) - debug.traceback() - end -end - -test_func() diff --git a/lib/libesp32/berry/examples/fib_rec.be b/lib/libesp32/berry/examples/fib_rec.be deleted file mode 100644 index 31ed3817b..000000000 --- a/lib/libesp32/berry/examples/fib_rec.be +++ /dev/null @@ -1,12 +0,0 @@ -import time - -def fib(x) - if x <= 2 - return 1 - end - return fib(x - 1) + fib(x - 2) -end - -c = time.clock() -print("fib:", fib(38)) # minimum stack size: 78!! -print("time:", time.clock() - c, 's') diff --git a/lib/libesp32/berry/examples/guess_number.be b/lib/libesp32/berry/examples/guess_number.be deleted file mode 100644 index 6cbd07e7c..000000000 --- a/lib/libesp32/berry/examples/guess_number.be +++ /dev/null @@ -1,26 +0,0 @@ -import time -import math - -math.srand(time.time()) -res = math.rand() % 100 -max_test = 7 -test = -1 -idx = 1 -print('Guess a number between 0 and 99. You have', max_test, 'chances.') -while test != res && idx <= max_test - test = number(input(str(idx) + ': enter the number you guessed: ')) - if type(test) != 'int' - print('This is not an integer. Continue!') - continue - elif test > res - print('This number is too large.') - elif test < res - print('This number is too small.') - end - idx = idx + 1 -end -if test == res - print('You win!') -else - print('You failed, the correct answer is', res) -end diff --git a/lib/libesp32/berry/examples/json.be b/lib/libesp32/berry/examples/json.be deleted file mode 100644 index d98dff8bb..000000000 --- a/lib/libesp32/berry/examples/json.be +++ /dev/null @@ -1,4 +0,0 @@ -import json -print(json.load('{"key": "value"}')) -print(json.dump({'test key': nil})) -print(json.dump({'key1': nil, 45: true}, 'format')) diff --git a/lib/libesp32/berry/examples/lambda.be b/lib/libesp32/berry/examples/lambda.be deleted file mode 100644 index 1d0b709bb..000000000 --- a/lib/libesp32/berry/examples/lambda.be +++ /dev/null @@ -1,8 +0,0 @@ -# simple lambda example -print((/a b c-> a * b + c)(2, 3, 4)) - -# Y-Combinator and factorial functions -Y = /f-> (/x-> f(/n-> x(x)(n)))(/x-> f(/n-> x(x)(n))) -F = /f-> /x-> x ? f(x - 1) * x : 1 -fact = Y(F) -print('fact(10) == ' .. fact(10)) diff --git a/lib/libesp32/berry/examples/listdir.be b/lib/libesp32/berry/examples/listdir.be deleted file mode 100644 index 2dd880118..000000000 --- a/lib/libesp32/berry/examples/listdir.be +++ /dev/null @@ -1,16 +0,0 @@ -import os - -def scandir(path) - print('path: ' + path) - for name : os.listdir(path) - var fullname = os.path.join(path, name) - if os.path.isfile(fullname) - print('file: ' + fullname) - else - print('path: ' + fullname) - scandir(fullname) - end - end -end - -scandir('.') diff --git a/lib/libesp32/berry/examples/qsort.be b/lib/libesp32/berry/examples/qsort.be deleted file mode 100644 index b09b65672..000000000 --- a/lib/libesp32/berry/examples/qsort.be +++ /dev/null @@ -1,42 +0,0 @@ -def qsort(data) - # do once sort - def once(left, right) - var pivot = data[left] # use the 0th value as the pivot - while left < right # check if sort is complete - # put the value less than the pivot to the left - while left < right && data[right] >= pivot - right -= 1 # skip values greater than pivot - end - data[left] = data[right] - # put the value greater than the pivot on the right - while left < right && data[left] <= pivot - left += 1 # skip values less than pivot - end - data[right] = data[left] - end - # now we have the index of the pivot, store it - data[left] = pivot - return left # return the index of the pivot - end - # recursive quick sort algorithm - def _sort(left, right) - if left < right # executed when the array is not empty - var index = once(left, right) # get index of pivot for divide and conquer - _sort(left, index - 1) # sort the data on the left - _sort(index + 1, right) # sort the data on the right - end - end - # start quick sort - _sort(0, data.size() - 1) - return data -end - -import time, math -math.srand(time.time()) # sse system time as a random seed -data = [] -# put 20 random numbers into the array -for i : 1 .. 20 - data.push(math.rand() % 100) -end -# sort and print -print(qsort(data)) diff --git a/lib/libesp32/berry/examples/repl.be b/lib/libesp32/berry/examples/repl.be deleted file mode 100644 index aac26b0a1..000000000 --- a/lib/libesp32/berry/examples/repl.be +++ /dev/null @@ -1,61 +0,0 @@ -do - def ismult(msg) - import string - return string.split(msg, -5)[1] == '\'EOS\'' - end - - def multline(src, msg) - if !ismult(msg) - print('syntax_error: ' + msg) - return - end - while true - try - src += '\n' + input('>> ') - return compile(src) - except 'syntax_error' as e, m - if !ismult(m) - print('syntax_error: ' + m) - return - end - end - end - end - - def parse() - var fun, src = input('> ') - try - fun = compile('return (' + src + ')') - except 'syntax_error' as e, m - try - fun = compile(src) - except 'syntax_error' as e, m - fun = multline(src, m) - end - end - return fun - end - - def run(fun) - try - var res = fun() - if res print(res) end - except .. as e, m - import debug - print(e .. ': ' .. m) - debug.traceback() - end - end - - def repl() - while true - var fun = parse() - if fun != nil - run(fun) - end - end - end - - print("Berry Berry REPL!") - repl() -end diff --git a/lib/libesp32/berry/examples/string.be b/lib/libesp32/berry/examples/string.be deleted file mode 100644 index 299834e21..000000000 --- a/lib/libesp32/berry/examples/string.be +++ /dev/null @@ -1,32 +0,0 @@ -s = "This is a long string test. 0123456789 abcdefg ABCDEFG" -print(s) - -a = .5 -print(a) - -import string as s - -print(s.hex(0x45678ABCD, 16)) - -def bin(x, num) - assert(type(x) == 'int', 'the type of \'x\' must be integer') - # test the 'x' bits - var bits = 1 - for i : 0 .. 62 - if x & (1 << 63 - i) - bits = 64 - i - break - end - end - if type(num) == 'int' && num > 0 && num <= 64 - bits = bits < num ? num : bits - end - var result = '' - bits -= 1 - for i : 0 .. bits - result += x & (1 << (bits - i)) ? '1' : '0' - end - return result -end - -print(bin(33)) diff --git a/lib/libesp32/berry/examples/strmod.be b/lib/libesp32/berry/examples/strmod.be deleted file mode 100644 index 8660f5b4e..000000000 --- a/lib/libesp32/berry/examples/strmod.be +++ /dev/null @@ -1,7 +0,0 @@ -import string - -print(string.format('%.3d', 12)) -print(string.format('%.3f', 12)) -print(string.format('%20.7f', 14.5)) -print(string.format('-- %-40s ---', 'this is a string format test')) -print(string.format('-- %40s ---', 'this is a string format test')) diff --git a/lib/libesp32/berry/gen.sh b/lib/libesp32/berry/gen.sh deleted file mode 100755 index 303a62c95..000000000 --- a/lib/libesp32/berry/gen.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -python3 tools/pycoc/main.py -o generate src default ../berry_mapping/src -c default/berry_conf.h diff --git a/lib/libesp32/berry/generate/be_const_strtab.h b/lib/libesp32/berry/generate/be_const_strtab.h deleted file mode 100644 index 50198eb8f..000000000 --- a/lib/libesp32/berry/generate/be_const_strtab.h +++ /dev/null @@ -1,741 +0,0 @@ -extern const bcstring be_const_str_; -extern const bcstring be_const_str_AES_GCM; -extern const bcstring be_const_str_AXP192; -extern const bcstring be_const_str_Animate_X20pc_X20is_X20out_X20of_X20range; -extern const bcstring be_const_str_AudioFileSource; -extern const bcstring be_const_str_AudioFileSourceFS; -extern const bcstring be_const_str_AudioGenerator; -extern const bcstring be_const_str_AudioGeneratorMP3; -extern const bcstring be_const_str_AudioGeneratorWAV; -extern const bcstring be_const_str_AudioOutput; -extern const bcstring be_const_str_AudioOutputI2S; -extern const bcstring be_const_str_Auto_X2Dconfiguration; -extern const bcstring be_const_str_BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20; -extern const bcstring be_const_str_BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s; -extern const bcstring be_const_str_BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29; -extern const bcstring be_const_str_BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson; -extern const bcstring be_const_str_BUTTON_CONFIGURATION; -extern const bcstring be_const_str_CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s; -extern const bcstring be_const_str_CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting; -extern const bcstring be_const_str_CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29; -extern const bcstring be_const_str_CFG_X3A_X20downloading_X20_X27_X25s_X27; -extern const bcstring be_const_str_CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27; -extern const bcstring be_const_str_CFG_X3A_X20loaded_X20_X20; -extern const bcstring be_const_str_CFG_X3A_X20loaded_X20_X27_X25s_X27; -extern const bcstring be_const_str_CFG_X3A_X20loading_X20; -extern const bcstring be_const_str_CFG_X3A_X20loading_X20_X27_X25s_X27; -extern const bcstring be_const_str_CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29; -extern const bcstring be_const_str_CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found; -extern const bcstring be_const_str_CFG_X3A_X20ran_X20_X20; -extern const bcstring be_const_str_CFG_X3A_X20removed_X20file_X20_X27_X25s_X27; -extern const bcstring be_const_str_CFG_X3A_X20removing_X20autoconf_X20files; -extern const bcstring be_const_str_CFG_X3A_X20removing_X20first_X20time_X20marker; -extern const bcstring be_const_str_CFG_X3A_X20return_code_X3D_X25i; -extern const bcstring be_const_str_CFG_X3A_X20running_X20; -extern const bcstring be_const_str_CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem; -extern const bcstring be_const_str_COLOR_BLACK; -extern const bcstring be_const_str_COLOR_WHITE; -extern const bcstring be_const_str_EC_C25519; -extern const bcstring be_const_str_EVENT_DRAW_MAIN; -extern const bcstring be_const_str_EVENT_DRAW_PART_BEGIN; -extern const bcstring be_const_str_EVENT_DRAW_PART_END; -extern const bcstring be_const_str_False; -extern const bcstring be_const_str_GET; -extern const bcstring be_const_str_HTTP_GET; -extern const bcstring be_const_str_HTTP_POST; -extern const bcstring be_const_str_I2C_Driver; -extern const bcstring be_const_str_I2C_X3A; -extern const bcstring be_const_str_LVG_X3A_X20call_X20to_X20unsupported_X20callback; -extern const bcstring be_const_str_Leds; -extern const bcstring be_const_str_MD5; -extern const bcstring be_const_str_None; -extern const bcstring be_const_str_OPTION_A; -extern const bcstring be_const_str_OneWire; -extern const bcstring be_const_str_PART_MAIN; -extern const bcstring be_const_str_POST; -extern const bcstring be_const_str_Parameter_X20error; -extern const bcstring be_const_str_RES_OK; -extern const bcstring be_const_str_Restart_X201; -extern const bcstring be_const_str_SERIAL_5E1; -extern const bcstring be_const_str_SERIAL_5E2; -extern const bcstring be_const_str_SERIAL_5N1; -extern const bcstring be_const_str_SERIAL_5N2; -extern const bcstring be_const_str_SERIAL_5O1; -extern const bcstring be_const_str_SERIAL_5O2; -extern const bcstring be_const_str_SERIAL_6E1; -extern const bcstring be_const_str_SERIAL_6E2; -extern const bcstring be_const_str_SERIAL_6N1; -extern const bcstring be_const_str_SERIAL_6N2; -extern const bcstring be_const_str_SERIAL_6O1; -extern const bcstring be_const_str_SERIAL_6O2; -extern const bcstring be_const_str_SERIAL_7E1; -extern const bcstring be_const_str_SERIAL_7E2; -extern const bcstring be_const_str_SERIAL_7N1; -extern const bcstring be_const_str_SERIAL_7N2; -extern const bcstring be_const_str_SERIAL_7O1; -extern const bcstring be_const_str_SERIAL_7O2; -extern const bcstring be_const_str_SERIAL_8E1; -extern const bcstring be_const_str_SERIAL_8E2; -extern const bcstring be_const_str_SERIAL_8N1; -extern const bcstring be_const_str_SERIAL_8N2; -extern const bcstring be_const_str_SERIAL_8O1; -extern const bcstring be_const_str_SERIAL_8O2; -extern const bcstring be_const_str_SK6812_GRBW; -extern const bcstring be_const_str_STATE_DEFAULT; -extern const bcstring be_const_str_TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27; -extern const bcstring be_const_str_Tasmota; -extern const bcstring be_const_str_Tele; -extern const bcstring be_const_str_Timer; -extern const bcstring be_const_str_True; -extern const bcstring be_const_str_Unknown_X20command; -extern const bcstring be_const_str_WS2812; -extern const bcstring be_const_str_WS2812_GRB; -extern const bcstring be_const_str_Wire; -extern const bcstring be_const_str__; -extern const bcstring be_const_str__X0A; -extern const bcstring be_const_str__X20; -extern const bcstring be_const_str__X21_X3D; -extern const bcstring be_const_str__X21_X3D_X3D; -extern const bcstring be_const_str__X23; -extern const bcstring be_const_str__X23autoexec_X2Ebat; -extern const bcstring be_const_str__X23autoexec_X2Ebe; -extern const bcstring be_const_str__X23display_X2Eini; -extern const bcstring be_const_str__X23init_X2Ebat; -extern const bcstring be_const_str__X23preinit_X2Ebe; -extern const bcstring be_const_str__X2502d_X25s_X2502d; -extern const bcstring be_const_str__X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d; -extern const bcstring be_const_str__X25s_X2Eautoconf; -extern const bcstring be_const_str__X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B; -extern const bcstring be_const_str__X26lt_X3BNone_X26gt_X3B; -extern const bcstring be_const_str__X28_X29; -extern const bcstring be_const_str__X2B; -extern const bcstring be_const_str__X2C; -extern const bcstring be_const_str__X2D_X2D_X3A_X2D_X2D; -extern const bcstring be_const_str__X2E; -extern const bcstring be_const_str__X2E_X2E; -extern const bcstring be_const_str__X2Eautoconf; -extern const bcstring be_const_str__X2Ebe; -extern const bcstring be_const_str__X2Ebec; -extern const bcstring be_const_str__X2Elen; -extern const bcstring be_const_str__X2Ep; -extern const bcstring be_const_str__X2Ep1; -extern const bcstring be_const_str__X2Ep2; -extern const bcstring be_const_str__X2Esize; -extern const bcstring be_const_str__X2Etapp; -extern const bcstring be_const_str__X2Ew; -extern const bcstring be_const_str__X2F; -extern const bcstring be_const_str__X2F_X2Eautoconf; -extern const bcstring be_const_str__X2F_X3Frst_X3D; -extern const bcstring be_const_str__X2Fac; -extern const bcstring be_const_str__X3A; -extern const bcstring be_const_str__X3C; -extern const bcstring be_const_str__X3C_X2Fform_X3E_X3C_X2Fp_X3E; -extern const bcstring be_const_str__X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E; -extern const bcstring be_const_str__X3C_X3D; -extern const bcstring be_const_str__X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E; -extern const bcstring be_const_str__X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E; -extern const bcstring be_const_str__X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E; -extern const bcstring be_const_str__X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29; -extern const bcstring be_const_str__X3Clabel_X3EChoose_X20a_X20device_X20configuration_X3A_X3C_X2Flabel_X3E_X3Cbr_X3E; -extern const bcstring be_const_str__X3Clambda_X3E; -extern const bcstring be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E; -extern const bcstring be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E; -extern const bcstring be_const_str__X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E; -extern const bcstring be_const_str__X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E; -extern const bcstring be_const_str__X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E; -extern const bcstring be_const_str__X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E; -extern const bcstring be_const_str__X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E; -extern const bcstring be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E; -extern const bcstring be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20; -extern const bcstring be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dzip_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20; -extern const bcstring be_const_str__X3Cp_X3E_X3Csmall_X3E_X26nbsp_X3B_X28This_X20feature_X20requires_X20an_X20internet_X20connection_X29_X3C_X2Fsmall_X3E_X3C_X2Fp_X3E; -extern const bcstring be_const_str__X3Cselect_X20name_X3D_X27zip_X27_X3E; -extern const bcstring be_const_str__X3D; -extern const bcstring be_const_str__X3D_X3C_X3E_X21; -extern const bcstring be_const_str__X3D_X3D; -extern const bcstring be_const_str__X3E; -extern const bcstring be_const_str__X3E_X3D; -extern const bcstring be_const_str__X3F; -extern const bcstring be_const_str__X5B; -extern const bcstring be_const_str__X5D; -extern const bcstring be_const_str__X7B; -extern const bcstring be_const_str__X7B_X7D; -extern const bcstring be_const_str__X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D; -extern const bcstring be_const_str__X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D; -extern const bcstring be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D; -extern const bcstring be_const_str__X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D; -extern const bcstring be_const_str__X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D; -extern const bcstring be_const_str__X7D; -extern const bcstring be_const_str___iterator__; -extern const bcstring be_const_str___lower__; -extern const bcstring be_const_str___upper__; -extern const bcstring be_const_str__anonymous_; -extern const bcstring be_const_str__archive; -extern const bcstring be_const_str__available; -extern const bcstring be_const_str__begin_transmission; -extern const bcstring be_const_str__buffer; -extern const bcstring be_const_str__ccmd; -extern const bcstring be_const_str__class; -extern const bcstring be_const_str__cmd; -extern const bcstring be_const_str__debug_present; -extern const bcstring be_const_str__def; -extern const bcstring be_const_str__dirty; -extern const bcstring be_const_str__drivers; -extern const bcstring be_const_str__end_transmission; -extern const bcstring be_const_str__energy; -extern const bcstring be_const_str__error; -extern const bcstring be_const_str__filename; -extern const bcstring be_const_str__global_addr; -extern const bcstring be_const_str__global_def; -extern const bcstring be_const_str__lvgl; -extern const bcstring be_const_str__p; -extern const bcstring be_const_str__persist_X2Ejson; -extern const bcstring be_const_str__ptr; -extern const bcstring be_const_str__read; -extern const bcstring be_const_str__request_from; -extern const bcstring be_const_str__rules; -extern const bcstring be_const_str__settings_def; -extern const bcstring be_const_str__settings_ptr; -extern const bcstring be_const_str__t; -extern const bcstring be_const_str__timers; -extern const bcstring be_const_str__write; -extern const bcstring be_const_str_a; -extern const bcstring be_const_str_abs; -extern const bcstring be_const_str_acos; -extern const bcstring be_const_str_add; -extern const bcstring be_const_str_add_anim; -extern const bcstring be_const_str_add_cmd; -extern const bcstring be_const_str_add_driver; -extern const bcstring be_const_str_add_header; -extern const bcstring be_const_str_add_rule; -extern const bcstring be_const_str_addr; -extern const bcstring be_const_str_allocated; -extern const bcstring be_const_str_alternate; -extern const bcstring be_const_str_animate; -extern const bcstring be_const_str_animators; -extern const bcstring be_const_str_arch; -extern const bcstring be_const_str_area; -extern const bcstring be_const_str_arg; -extern const bcstring be_const_str_arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj; -extern const bcstring be_const_str_arg_name; -extern const bcstring be_const_str_arg_size; -extern const bcstring be_const_str_as; -extern const bcstring be_const_str_asin; -extern const bcstring be_const_str_assert; -extern const bcstring be_const_str_asstring; -extern const bcstring be_const_str_atan; -extern const bcstring be_const_str_atan2; -extern const bcstring be_const_str_atleast1; -extern const bcstring be_const_str_attrdump; -extern const bcstring be_const_str_autoexec; -extern const bcstring be_const_str_autorun; -extern const bcstring be_const_str_available; -extern const bcstring be_const_str_b; -extern const bcstring be_const_str_back_forth; -extern const bcstring be_const_str_base_class; -extern const bcstring be_const_str_battery_present; -extern const bcstring be_const_str_begin; -extern const bcstring be_const_str_bool; -extern const bcstring be_const_str_break; -extern const bcstring be_const_str_bri; -extern const bcstring be_const_str_bus; -extern const bcstring be_const_str_button_pressed; -extern const bcstring be_const_str_byte; -extern const bcstring be_const_str_bytes; -extern const bcstring be_const_str_c; -extern const bcstring be_const_str_call; -extern const bcstring be_const_str_call_native; -extern const bcstring be_const_str_calldepth; -extern const bcstring be_const_str_can_show; -extern const bcstring be_const_str_cb; -extern const bcstring be_const_str_cb_do_nothing; -extern const bcstring be_const_str_cb_event_closure; -extern const bcstring be_const_str_cb_obj; -extern const bcstring be_const_str_ceil; -extern const bcstring be_const_str_char; -extern const bcstring be_const_str_chars_in_string; -extern const bcstring be_const_str_check_privileged_access; -extern const bcstring be_const_str_class; -extern const bcstring be_const_str_class_init_obj; -extern const bcstring be_const_str_classname; -extern const bcstring be_const_str_classof; -extern const bcstring be_const_str_clear; -extern const bcstring be_const_str_clear_first_time; -extern const bcstring be_const_str_clear_to; -extern const bcstring be_const_str_close; -extern const bcstring be_const_str_closure; -extern const bcstring be_const_str_cmd; -extern const bcstring be_const_str_cmd_res; -extern const bcstring be_const_str_code; -extern const bcstring be_const_str_codedump; -extern const bcstring be_const_str_collect; -extern const bcstring be_const_str_color; -extern const bcstring be_const_str_compile; -extern const bcstring be_const_str_compress; -extern const bcstring be_const_str_concat; -extern const bcstring be_const_str_connect; -extern const bcstring be_const_str_connected; -extern const bcstring be_const_str_connection_error; -extern const bcstring be_const_str_constructor_cb; -extern const bcstring be_const_str_contains; -extern const bcstring be_const_str_content_button; -extern const bcstring be_const_str_content_flush; -extern const bcstring be_const_str_content_send; -extern const bcstring be_const_str_content_send_style; -extern const bcstring be_const_str_content_start; -extern const bcstring be_const_str_content_stop; -extern const bcstring be_const_str_continue; -extern const bcstring be_const_str_copy; -extern const bcstring be_const_str_cos; -extern const bcstring be_const_str_cosh; -extern const bcstring be_const_str_couldn_X27t_X20not_X20initialize_X20noepixelbus; -extern const bcstring be_const_str_count; -extern const bcstring be_const_str_counters; -extern const bcstring be_const_str_create_custom_widget; -extern const bcstring be_const_str_create_matrix; -extern const bcstring be_const_str_create_segment; -extern const bcstring be_const_str_ctor; -extern const bcstring be_const_str_ctypes_bytes; -extern const bcstring be_const_str_ctypes_bytes_dyn; -extern const bcstring be_const_str_dac_voltage; -extern const bcstring be_const_str_day; -extern const bcstring be_const_str_debug; -extern const bcstring be_const_str_decompress; -extern const bcstring be_const_str_decrypt; -extern const bcstring be_const_str_def; -extern const bcstring be_const_str_deg; -extern const bcstring be_const_str_deinit; -extern const bcstring be_const_str_del; -extern const bcstring be_const_str_delay; -extern const bcstring be_const_str_delete_all_configs; -extern const bcstring be_const_str_depower; -extern const bcstring be_const_str_deregister_obj; -extern const bcstring be_const_str_destructor_cb; -extern const bcstring be_const_str_detect; -extern const bcstring be_const_str_detected_X20on_X20bus; -extern const bcstring be_const_str_digital_read; -extern const bcstring be_const_str_digital_write; -extern const bcstring be_const_str_dirty; -extern const bcstring be_const_str_display; -extern const bcstring be_const_str_display_X2Eini; -extern const bcstring be_const_str_do; -extern const bcstring be_const_str_draw_arc; -extern const bcstring be_const_str_draw_line; -extern const bcstring be_const_str_draw_line_dsc; -extern const bcstring be_const_str_draw_line_dsc_init; -extern const bcstring be_const_str_due; -extern const bcstring be_const_str_dump; -extern const bcstring be_const_str_duration; -extern const bcstring be_const_str_editable; -extern const bcstring be_const_str_elif; -extern const bcstring be_const_str_else; -extern const bcstring be_const_str_enabled; -extern const bcstring be_const_str_encrypt; -extern const bcstring be_const_str_end; -extern const bcstring be_const_str_energy_struct; -extern const bcstring be_const_str_engine; -extern const bcstring be_const_str_erase; -extern const bcstring be_const_str_escape; -extern const bcstring be_const_str_eth; -extern const bcstring be_const_str_event; -extern const bcstring be_const_str_event_cb; -extern const bcstring be_const_str_event_send; -extern const bcstring be_const_str_every_100ms; -extern const bcstring be_const_str_every_50ms; -extern const bcstring be_const_str_every_second; -extern const bcstring be_const_str_except; -extern const bcstring be_const_str_exec_cmd; -extern const bcstring be_const_str_exec_rules; -extern const bcstring be_const_str_exec_tele; -extern const bcstring be_const_str_exists; -extern const bcstring be_const_str_exp; -extern const bcstring be_const_str_f; -extern const bcstring be_const_str_false; -extern const bcstring be_const_str_file; -extern const bcstring be_const_str_file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27; -extern const bcstring be_const_str_files; -extern const bcstring be_const_str_find; -extern const bcstring be_const_str_find_key_i; -extern const bcstring be_const_str_find_op; -extern const bcstring be_const_str_finish; -extern const bcstring be_const_str_floor; -extern const bcstring be_const_str_flush; -extern const bcstring be_const_str_for; -extern const bcstring be_const_str_format; -extern const bcstring be_const_str_from_to; -extern const bcstring be_const_str_fromb64; -extern const bcstring be_const_str_fromptr; -extern const bcstring be_const_str_fromstring; -extern const bcstring be_const_str_function; -extern const bcstring be_const_str_gamma; -extern const bcstring be_const_str_gamma10; -extern const bcstring be_const_str_gamma8; -extern const bcstring be_const_str_gc; -extern const bcstring be_const_str_gen_cb; -extern const bcstring be_const_str_get; -extern const bcstring be_const_str_get_alternate; -extern const bcstring be_const_str_get_aps_voltage; -extern const bcstring be_const_str_get_bat_charge_current; -extern const bcstring be_const_str_get_bat_current; -extern const bcstring be_const_str_get_bat_power; -extern const bcstring be_const_str_get_bat_voltage; -extern const bcstring be_const_str_get_battery_chargin_status; -extern const bcstring be_const_str_get_bri; -extern const bcstring be_const_str_get_cb_list; -extern const bcstring be_const_str_get_coords; -extern const bcstring be_const_str_get_current_module_name; -extern const bcstring be_const_str_get_current_module_path; -extern const bcstring be_const_str_get_free_heap; -extern const bcstring be_const_str_get_height; -extern const bcstring be_const_str_get_input_power_status; -extern const bcstring be_const_str_get_light; -extern const bcstring be_const_str_get_object_from_ptr; -extern const bcstring be_const_str_get_option; -extern const bcstring be_const_str_get_percentage; -extern const bcstring be_const_str_get_pixel_color; -extern const bcstring be_const_str_get_power; -extern const bcstring be_const_str_get_size; -extern const bcstring be_const_str_get_string; -extern const bcstring be_const_str_get_style_bg_color; -extern const bcstring be_const_str_get_style_line_color; -extern const bcstring be_const_str_get_style_pad_right; -extern const bcstring be_const_str_get_switch; -extern const bcstring be_const_str_get_tasmota; -extern const bcstring be_const_str_get_temp; -extern const bcstring be_const_str_get_vbus_current; -extern const bcstring be_const_str_get_vbus_voltage; -extern const bcstring be_const_str_get_warning_level; -extern const bcstring be_const_str_get_width; -extern const bcstring be_const_str_getbits; -extern const bcstring be_const_str_geti; -extern const bcstring be_const_str_global; -extern const bcstring be_const_str_gpio; -extern const bcstring be_const_str_group_def; -extern const bcstring be_const_str_h; -extern const bcstring be_const_str_has; -extern const bcstring be_const_str_has_arg; -extern const bcstring be_const_str_height_def; -extern const bcstring be_const_str_hex; -extern const bcstring be_const_str_hour; -extern const bcstring be_const_str_hs2rgb; -extern const bcstring be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf; -extern const bcstring be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson; -extern const bcstring be_const_str_i2c_enabled; -extern const bcstring be_const_str_id; -extern const bcstring be_const_str_if; -extern const bcstring be_const_str_imax; -extern const bcstring be_const_str_imin; -extern const bcstring be_const_str_import; -extern const bcstring be_const_str_init; -extern const bcstring be_const_str_init_draw_line_dsc; -extern const bcstring be_const_str_input; -extern const bcstring be_const_str_ins_goto; -extern const bcstring be_const_str_ins_ramp; -extern const bcstring be_const_str_ins_time; -extern const bcstring be_const_str_insert; -extern const bcstring be_const_str_instance; -extern const bcstring be_const_str_instance_size; -extern const bcstring be_const_str_int; -extern const bcstring be_const_str_internal_error; -extern const bcstring be_const_str_introspect; -extern const bcstring be_const_str_invalidate; -extern const bcstring be_const_str_io_error; -extern const bcstring be_const_str_ip; -extern const bcstring be_const_str_is_dirty; -extern const bcstring be_const_str_is_first_time; -extern const bcstring be_const_str_is_running; -extern const bcstring be_const_str_isinstance; -extern const bcstring be_const_str_isnan; -extern const bcstring be_const_str_isrunning; -extern const bcstring be_const_str_issubclass; -extern const bcstring be_const_str_item; -extern const bcstring be_const_str_iter; -extern const bcstring be_const_str_json; -extern const bcstring be_const_str_json_append; -extern const bcstring be_const_str_json_fdump; -extern const bcstring be_const_str_json_fdump_any; -extern const bcstring be_const_str_json_fdump_list; -extern const bcstring be_const_str_json_fdump_map; -extern const bcstring be_const_str_k; -extern const bcstring be_const_str_keys; -extern const bcstring be_const_str_kv; -extern const bcstring be_const_str_last_modified; -extern const bcstring be_const_str_leds; -extern const bcstring be_const_str_length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032; -extern const bcstring be_const_str_light; -extern const bcstring be_const_str_line_dsc; -extern const bcstring be_const_str_list; -extern const bcstring be_const_str_listdir; -extern const bcstring be_const_str_load; -extern const bcstring be_const_str_load_templates; -extern const bcstring be_const_str_local; -extern const bcstring be_const_str_log; -extern const bcstring be_const_str_log10; -extern const bcstring be_const_str_loop; -extern const bcstring be_const_str_lower; -extern const bcstring be_const_str_lv; -extern const bcstring be_const_str_lv_event; -extern const bcstring be_const_str_lv_event_cb; -extern const bcstring be_const_str_lv_obj; -extern const bcstring be_const_str_lv_obj_class; -extern const bcstring be_const_str_lvgl_event_dispatch; -extern const bcstring be_const_str_map; -extern const bcstring be_const_str_math; -extern const bcstring be_const_str_matrix; -extern const bcstring be_const_str_member; -extern const bcstring be_const_str_members; -extern const bcstring be_const_str_memory; -extern const bcstring be_const_str_millis; -extern const bcstring be_const_str_min; -extern const bcstring be_const_str_minute; -extern const bcstring be_const_str_module; -extern const bcstring be_const_str_month; -extern const bcstring be_const_str_name; -extern const bcstring be_const_str_nan; -extern const bcstring be_const_str_nil; -extern const bcstring be_const_str_no_X20GPIO_X20specified_X20for_X20neopixelbus; -extern const bcstring be_const_str_null_cb; -extern const bcstring be_const_str_number; -extern const bcstring be_const_str_obj_class_create_obj; -extern const bcstring be_const_str_obj_event_base; -extern const bcstring be_const_str_offset; -extern const bcstring be_const_str_offseta; -extern const bcstring be_const_str_on; -extern const bcstring be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E; -extern const bcstring be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E; -extern const bcstring be_const_str_open; -extern const bcstring be_const_str_out_X20of_X20range; -extern const bcstring be_const_str_p1; -extern const bcstring be_const_str_p2; -extern const bcstring be_const_str_page_autoconf_ctl; -extern const bcstring be_const_str_page_autoconf_mgr; -extern const bcstring be_const_str_param; -extern const bcstring be_const_str_path; -extern const bcstring be_const_str_pc; -extern const bcstring be_const_str_pc_abs; -extern const bcstring be_const_str_pc_rel; -extern const bcstring be_const_str_percentage; -extern const bcstring be_const_str_persist; -extern const bcstring be_const_str_persist_X2E_p_X20is_X20not_X20a_X20map; -extern const bcstring be_const_str_pi; -extern const bcstring be_const_str_pin; -extern const bcstring be_const_str_pin_mode; -extern const bcstring be_const_str_pin_used; -extern const bcstring be_const_str_pixel_count; -extern const bcstring be_const_str_pixel_size; -extern const bcstring be_const_str_pixels_buffer; -extern const bcstring be_const_str_point; -extern const bcstring be_const_str_pop; -extern const bcstring be_const_str_pop_path; -extern const bcstring be_const_str_pow; -extern const bcstring be_const_str_preinit; -extern const bcstring be_const_str_print; -extern const bcstring be_const_str_public_key; -extern const bcstring be_const_str_publish; -extern const bcstring be_const_str_publish_result; -extern const bcstring be_const_str_push; -extern const bcstring be_const_str_push_path; -extern const bcstring be_const_str_quality; -extern const bcstring be_const_str_r; -extern const bcstring be_const_str_rad; -extern const bcstring be_const_str_raise; -extern const bcstring be_const_str_rand; -extern const bcstring be_const_str_range; -extern const bcstring be_const_str_read; -extern const bcstring be_const_str_read12; -extern const bcstring be_const_str_read13; -extern const bcstring be_const_str_read24; -extern const bcstring be_const_str_read32; -extern const bcstring be_const_str_read8; -extern const bcstring be_const_str_read_bytes; -extern const bcstring be_const_str_read_sensors; -extern const bcstring be_const_str_readbytes; -extern const bcstring be_const_str_readline; -extern const bcstring be_const_str_real; -extern const bcstring be_const_str_reapply; -extern const bcstring be_const_str_redirect; -extern const bcstring be_const_str_reduce; -extern const bcstring be_const_str_refr_size; -extern const bcstring be_const_str_register_obj; -extern const bcstring be_const_str_remove; -extern const bcstring be_const_str_remove_cmd; -extern const bcstring be_const_str_remove_driver; -extern const bcstring be_const_str_remove_rule; -extern const bcstring be_const_str_remove_timer; -extern const bcstring be_const_str_reset; -extern const bcstring be_const_str_reset_search; -extern const bcstring be_const_str_resize; -extern const bcstring be_const_str_resolvecmnd; -extern const bcstring be_const_str_resp_cmnd; -extern const bcstring be_const_str_resp_cmnd_done; -extern const bcstring be_const_str_resp_cmnd_error; -extern const bcstring be_const_str_resp_cmnd_failed; -extern const bcstring be_const_str_resp_cmnd_str; -extern const bcstring be_const_str_response_append; -extern const bcstring be_const_str_return; -extern const bcstring be_const_str_return_X20code_X3D_X25i; -extern const bcstring be_const_str_reverse; -extern const bcstring be_const_str_reverse_gamma10; -extern const bcstring be_const_str_rotate; -extern const bcstring be_const_str_round_end; -extern const bcstring be_const_str_round_start; -extern const bcstring be_const_str_rtc; -extern const bcstring be_const_str_rule; -extern const bcstring be_const_str_run; -extern const bcstring be_const_str_run_bat; -extern const bcstring be_const_str_run_deferred; -extern const bcstring be_const_str_running; -extern const bcstring be_const_str_save; -extern const bcstring be_const_str_save_before_restart; -extern const bcstring be_const_str_scale_uint; -extern const bcstring be_const_str_scan; -extern const bcstring be_const_str_search; -extern const bcstring be_const_str_sec; -extern const bcstring be_const_str_seg7_font; -extern const bcstring be_const_str_select; -extern const bcstring be_const_str_serial; -extern const bcstring be_const_str_set; -extern const bcstring be_const_str_set_alternate; -extern const bcstring be_const_str_set_auth; -extern const bcstring be_const_str_set_bri; -extern const bcstring be_const_str_set_chg_current; -extern const bcstring be_const_str_set_dc_voltage; -extern const bcstring be_const_str_set_dcdc_enable; -extern const bcstring be_const_str_set_first_time; -extern const bcstring be_const_str_set_height; -extern const bcstring be_const_str_set_ldo_enable; -extern const bcstring be_const_str_set_ldo_voltage; -extern const bcstring be_const_str_set_light; -extern const bcstring be_const_str_set_matrix_pixel_color; -extern const bcstring be_const_str_set_percentage; -extern const bcstring be_const_str_set_pixel_color; -extern const bcstring be_const_str_set_power; -extern const bcstring be_const_str_set_style_bg_color; -extern const bcstring be_const_str_set_style_line_color; -extern const bcstring be_const_str_set_style_pad_right; -extern const bcstring be_const_str_set_style_text_font; -extern const bcstring be_const_str_set_text; -extern const bcstring be_const_str_set_time; -extern const bcstring be_const_str_set_timeouts; -extern const bcstring be_const_str_set_timer; -extern const bcstring be_const_str_set_useragent; -extern const bcstring be_const_str_set_width; -extern const bcstring be_const_str_set_x; -extern const bcstring be_const_str_set_y; -extern const bcstring be_const_str_setbits; -extern const bcstring be_const_str_seti; -extern const bcstring be_const_str_setitem; -extern const bcstring be_const_str_setmember; -extern const bcstring be_const_str_setrange; -extern const bcstring be_const_str_settings; -extern const bcstring be_const_str_shared_key; -extern const bcstring be_const_str_show; -extern const bcstring be_const_str_sin; -extern const bcstring be_const_str_sinh; -extern const bcstring be_const_str_size; -extern const bcstring be_const_str_skip; -extern const bcstring be_const_str_solidified; -extern const bcstring be_const_str_split; -extern const bcstring be_const_str_sqrt; -extern const bcstring be_const_str_srand; -extern const bcstring be_const_str_start; -extern const bcstring be_const_str_state; -extern const bcstring be_const_str_static; -extern const bcstring be_const_str_stop; -extern const bcstring be_const_str_stop_iteration; -extern const bcstring be_const_str_str; -extern const bcstring be_const_str_strftime; -extern const bcstring be_const_str_string; -extern const bcstring be_const_str_strip; -extern const bcstring be_const_str_strptime; -extern const bcstring be_const_str_super; -extern const bcstring be_const_str_sys; -extern const bcstring be_const_str_tag; -extern const bcstring be_const_str_tan; -extern const bcstring be_const_str_tanh; -extern const bcstring be_const_str_target; -extern const bcstring be_const_str_target_search; -extern const bcstring be_const_str_tasmota; -extern const bcstring be_const_str_tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29; -extern const bcstring be_const_str_tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29; -extern const bcstring be_const_str_tcpclient; -extern const bcstring be_const_str_tele; -extern const bcstring be_const_str_the_X20second_X20argument_X20is_X20not_X20a_X20function; -extern const bcstring be_const_str_time_dump; -extern const bcstring be_const_str_time_reached; -extern const bcstring be_const_str_time_str; -extern const bcstring be_const_str_to_gamma; -extern const bcstring be_const_str_tob64; -extern const bcstring be_const_str_tolower; -extern const bcstring be_const_str_tomap; -extern const bcstring be_const_str_top; -extern const bcstring be_const_str_toptr; -extern const bcstring be_const_str_tostring; -extern const bcstring be_const_str_toupper; -extern const bcstring be_const_str_tr; -extern const bcstring be_const_str_traceback; -extern const bcstring be_const_str_true; -extern const bcstring be_const_str_try; -extern const bcstring be_const_str_try_rule; -extern const bcstring be_const_str_type; -extern const bcstring be_const_str_unknown_X20instruction; -extern const bcstring be_const_str_update; -extern const bcstring be_const_str_upper; -extern const bcstring be_const_str_url_encode; -extern const bcstring be_const_str_v; -extern const bcstring be_const_str_value; -extern const bcstring be_const_str_value_error; -extern const bcstring be_const_str_valuer_error; -extern const bcstring be_const_str_var; -extern const bcstring be_const_str_w; -extern const bcstring be_const_str_wd; -extern const bcstring be_const_str_web_add_button; -extern const bcstring be_const_str_web_add_config_button; -extern const bcstring be_const_str_web_add_console_button; -extern const bcstring be_const_str_web_add_handler; -extern const bcstring be_const_str_web_add_main_button; -extern const bcstring be_const_str_web_add_management_button; -extern const bcstring be_const_str_web_send; -extern const bcstring be_const_str_web_send_decimal; -extern const bcstring be_const_str_web_sensor; -extern const bcstring be_const_str_webclient; -extern const bcstring be_const_str_webserver; -extern const bcstring be_const_str_while; -extern const bcstring be_const_str_widget_cb; -extern const bcstring be_const_str_widget_constructor; -extern const bcstring be_const_str_widget_ctor_cb; -extern const bcstring be_const_str_widget_ctor_impl; -extern const bcstring be_const_str_widget_destructor; -extern const bcstring be_const_str_widget_dtor_cb; -extern const bcstring be_const_str_widget_dtor_impl; -extern const bcstring be_const_str_widget_editable; -extern const bcstring be_const_str_widget_event; -extern const bcstring be_const_str_widget_event_cb; -extern const bcstring be_const_str_widget_event_impl; -extern const bcstring be_const_str_widget_group_def; -extern const bcstring be_const_str_widget_height_def; -extern const bcstring be_const_str_widget_instance_size; -extern const bcstring be_const_str_widget_struct_by_class; -extern const bcstring be_const_str_widget_struct_default; -extern const bcstring be_const_str_widget_width_def; -extern const bcstring be_const_str_width; -extern const bcstring be_const_str_width_def; -extern const bcstring be_const_str_wifi; -extern const bcstring be_const_str_wire; -extern const bcstring be_const_str_wire1; -extern const bcstring be_const_str_wire2; -extern const bcstring be_const_str_wire_scan; -extern const bcstring be_const_str_write; -extern const bcstring be_const_str_write8; -extern const bcstring be_const_str_write_bit; -extern const bcstring be_const_str_write_bytes; -extern const bcstring be_const_str_write_file; -extern const bcstring be_const_str_write_gpio; -extern const bcstring be_const_str_x; -extern const bcstring be_const_str_x1; -extern const bcstring be_const_str_y; -extern const bcstring be_const_str_y1; -extern const bcstring be_const_str_year; -extern const bcstring be_const_str_yield; -extern const bcstring be_const_str_zero; -extern const bcstring be_const_str_zip; diff --git a/lib/libesp32/berry/generate/be_const_strtab_def.h b/lib/libesp32/berry/generate/be_const_strtab_def.h deleted file mode 100644 index 4c195c96b..000000000 --- a/lib/libesp32/berry/generate/be_const_strtab_def.h +++ /dev/null @@ -1,1109 +0,0 @@ -be_define_const_str(, "", 2166136261u, 0, 0, NULL); -be_define_const_str(_X0A, "\n", 252472541u, 0, 1, &be_const_str_Unknown_X20command); -be_define_const_str(_X20, " ", 621580159u, 0, 1, &be_const_str_geti); -be_define_const_str(_X21_X3D, "!=", 2428715011u, 0, 2, &be_const_str_asstring); -be_define_const_str(_X21_X3D_X3D, "!==", 559817114u, 0, 3, &be_const_str_type); -be_define_const_str(_X23, "#", 638357778u, 0, 1, &be_const_str_CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found); -be_define_const_str(_X23autoexec_X2Ebat, "#autoexec.bat", 3382890497u, 0, 13, &be_const_str_arg_size); -be_define_const_str(_X23autoexec_X2Ebe, "#autoexec.be", 1181757091u, 0, 12, &be_const_str_file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27); -be_define_const_str(_X23display_X2Eini, "#display.ini", 182218220u, 0, 12, &be_const_str___lower__); -be_define_const_str(_X23init_X2Ebat, "#init.bat", 3297595077u, 0, 9, &be_const_str_SERIAL_7O2); -be_define_const_str(_X23preinit_X2Ebe, "#preinit.be", 687035716u, 0, 11, &be_const_str_SERIAL_8O2); -be_define_const_str(_X2502d_X25s_X2502d, "%02d%s%02d", 1587999717u, 0, 10, &be_const_str_yield); -be_define_const_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, "%04d-%02d-%02dT%02d:%02d:%02d", 3425528601u, 0, 29, &be_const_str__global_def); -be_define_const_str(_X25s_X2Eautoconf, "%s.autoconf", 3560383524u, 0, 11, &be_const_str_every_second); -be_define_const_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, "<Error: apply new or remove>", 2855507949u, 0, 34, &be_const_str_add_driver); -be_define_const_str(_X26lt_X3BNone_X26gt_X3B, "<None>", 2602165498u, 0, 12, &be_const_str_rand); -be_define_const_str(_X28_X29, "()", 685372826u, 0, 2, &be_const_str__X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29); -be_define_const_str(_X2B, "+", 772578730u, 0, 1, &be_const_str_gpio); -be_define_const_str(_X2C, ",", 688690635u, 0, 1, &be_const_str_add_cmd); -be_define_const_str(_X2D_X2D_X3A_X2D_X2D, "--:--", 1370615441u, 0, 5, &be_const_str_AudioOutputI2S); -be_define_const_str(_X2E, ".", 722245873u, 0, 1, NULL); -be_define_const_str(_X2E_X2E, "..", 2748622605u, 0, 2, &be_const_str__X2Ep2); -be_define_const_str(_X2Eautoconf, ".autoconf", 2524679088u, 0, 9, NULL); -be_define_const_str(_X2Ebe, ".be", 1325797348u, 0, 3, &be_const_str_sinh); -be_define_const_str(_X2Ebec, ".bec", 3985273221u, 0, 4, &be_const_str__debug_present); -be_define_const_str(_X2Elen, ".len", 850842136u, 0, 4, NULL); -be_define_const_str(_X2Ep, ".p", 1171526419u, 0, 2, &be_const_str_COLOR_WHITE); -be_define_const_str(_X2Ep1, ".p1", 249175686u, 0, 3, &be_const_str_sin); -be_define_const_str(_X2Ep2, ".p2", 232398067u, 0, 3, &be_const_str_json_fdump_map); -be_define_const_str(_X2Esize, ".size", 1965188224u, 0, 5, &be_const_str__X2Fac); -be_define_const_str(_X2Etapp, ".tapp", 1363391594u, 0, 5, NULL); -be_define_const_str(_X2Ew, ".w", 1255414514u, 0, 2, &be_const_str_member); -be_define_const_str(_X2F, "/", 705468254u, 0, 1, &be_const_str_None); -be_define_const_str(_X2F_X2Eautoconf, "/.autoconf", 2212074393u, 0, 10, &be_const_str_set_dc_voltage); -be_define_const_str(_X2F_X3Frst_X3D, "/?rst=", 580074707u, 0, 6, &be_const_str_AES_GCM); -be_define_const_str(_X2Fac, "/ac", 3904651978u, 0, 3, &be_const_str_get_current_module_path); -be_define_const_str(_X3A, ":", 1057798253u, 0, 1, &be_const_str_json_fdump); -be_define_const_str(_X3C, "<", 957132539u, 0, 1, NULL); -be_define_const_str(_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 3546571739u, 0, 11, &be_const_str_atan); -be_define_const_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 1863865923u, 0, 16, NULL); -be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, &be_const_str_HTTP_POST); -be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str_Wire); -be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, &be_const_str_color); -be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "
", 842307168u, 0, 77, &be_const_str_set_power); -be_define_const_str(_X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, "Choose a device configuration:
", 1336654704u, 0, 49, &be_const_str_bus); -be_define_const_str(_X3Clambda_X3E, "", 607256038u, 0, 8, &be_const_str_point); -be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Current auto-configuration", 4212500780u, 0, 82, &be_const_str_get_warning_level); -be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Select new auto-configuration", 1926223891u, 0, 80, &be_const_str_get_vbus_current); -be_define_const_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, "", 510303524u, 0, 30, &be_const_str_cb_event_closure); -be_define_const_str(_X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, "", 3994619755u, 0, 54, NULL); -be_define_const_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, "

Exception:
'%s'
%s

", 4252565082u, 0, 59, &be_const_str_arg); -be_define_const_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 2052843416u, 0, 25, &be_const_str_area); -be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 452285201u, 0, 120, NULL); -be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, "

 (This feature requires an internet connection)

", 2719266486u, 0, 74, &be_const_str_register_obj); -be_define_const_str(_X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, "

Current configuration:

%s

", 4115655761u, 0, 46, &be_const_str_get_cb_list); -be_define_const_str(_X3Cselect_X20name_X3D_X27zip_X27_X3E, "
")); + uint32_t idx = 0; + for (uint32_t i = 0; i < rows; i++) { + if (idx > 0) { WSContentSend_P(PSTR("")); } + for (uint32_t j = 0; j < cols; j++) { + idx++; + WSContentSend_P(PSTR(""), // &lsc is related to WebGetArg("lsc", tmp, sizeof(tmp)); + 100 / cols, + idx -1, + (strlen(SettingsText(SET_BUTTON1 + idx))) ? SettingsText(SET_BUTTON1 + idx) : itoa(idx, number, 10)); + } + } + WSContentSend_P(PSTR("
")); +} + +void LscMcWebGetArg(void) { + char tmp[8]; // WebGetArg numbers only + char command[20]; + WebGetArg(PSTR("lsc"), tmp, sizeof(tmp)); // 0 - 7 functions + if (strlen(tmp)) { + uint32_t function = atoi(tmp); + snprintf_P(command, sizeof(command), PSTR(D_CMND_DIMMER " %d"), (function * (100 / 8)) + ((100 / 8) / 2)); + ExecuteWebCommand(command); + } +} + +#endif // USE_LSC_MCSL_GUI +#endif // USE_WEBSERVER + + /*********************************************************************************************\ * Interface \*********************************************************************************************/ @@ -247,6 +306,16 @@ bool Xlgt07(uint8_t function) case FUNC_BUTTON_MULTI_PRESSED: result = LscMcMultiButtonPressed(); break; +#ifdef USE_WEBSERVER +#ifdef USE_LSC_MCSL_GUI + case FUNC_WEB_ADD_MAIN_BUTTON: + LscMcAddFuctionButtons(); + break; + case FUNC_WEB_GET_ARG: + LscMcWebGetArg(); + break; +#endif // USE_LSC_MCSL_GUI +#endif // USE_WEBSERVER case FUNC_MODULE_INIT: LscMcModuleSelected(); break; From 4f20e4f698b503fd5cfee4a3c8bbd64e88d97400 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 15 Dec 2021 12:14:52 +0100 Subject: [PATCH 85/97] Refactor SonoffRfBridge Webcode --- tasmota/xdrv_01_webserver.ino | 25 ----------------------- tasmota/xdrv_06_snfbridge.ino | 38 +++++++++++++++++++++++++++++++++++ tasmota/xlgt_07_lsc_mcsl.ino | 7 +++---- 3 files changed, 41 insertions(+), 29 deletions(-) diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index 1f76a66f6..833ed38b1 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -1252,24 +1252,6 @@ void HandleRoot(void) } } #endif // USE_TUYA_MCU -#ifdef USE_SONOFF_RF - if (SONOFF_BRIDGE == TasmotaGlobal.module_type) { - WSContentSend_P(HTTP_TABLE100); - WSContentSend_P(PSTR("")); - uint32_t idx = 0; - for (uint32_t i = 0; i < 4; i++) { - if (idx > 0) { WSContentSend_P(PSTR("")); } - for (uint32_t j = 0; j < 4; j++) { - idx++; - snprintf_P(stemp, sizeof(stemp), PSTR("%d"), idx); - WSContentSend_P(PSTR(""), idx, // &k is related to WebGetArg("k", tmp, sizeof(tmp)); - (strlen(SettingsText(SET_BUTTON1 + idx -1))) ? SettingsText(SET_BUTTON1 + idx -1) : stemp); - } - } - WSContentSend_P(PSTR("")); - } -#endif // USE_SONOFF_RF - #ifndef FIRMWARE_MINIMAL XdrvCall(FUNC_WEB_ADD_MAIN_BUTTON); XsnsCall(FUNC_WEB_ADD_MAIN_BUTTON); @@ -1405,13 +1387,6 @@ bool HandleRootStatusRefresh(void) } } #endif // USE_SHUTTER -#ifdef USE_SONOFF_RF - WebGetArg(PSTR("k"), tmp, sizeof(tmp)); // 1 - 16 Pre defined RF keys - if (strlen(tmp)) { - snprintf_P(svalue, sizeof(svalue), PSTR(D_CMND_RFKEY "%s"), tmp); - ExecuteWebCommand(svalue); - } -#endif // USE_SONOFF_RF #ifdef USE_ZIGBEE WebGetArg(PSTR("zbj"), tmp, sizeof(tmp)); if (strlen(tmp)) { diff --git a/tasmota/xdrv_06_snfbridge.ino b/tasmota/xdrv_06_snfbridge.ino index bd3f99b34..62a7db8c1 100644 --- a/tasmota/xdrv_06_snfbridge.ino +++ b/tasmota/xdrv_06_snfbridge.ino @@ -501,6 +501,36 @@ void CmndRfRaw(void) ResponseCmndStateText(SnfBridge.receive_raw_flag); } +#ifdef USE_WEBSERVER + +void SonoffBridgeAddFuctionButtons(void) { + WSContentSend_P(HTTP_TABLE100); + WSContentSend_P(PSTR("")); + char number[4]; + uint32_t idx = 0; + for (uint32_t i = 0; i < 4; i++) { + if (idx > 0) { WSContentSend_P(PSTR("")); } + for (uint32_t j = 0; j < 4; j++) { + idx++; + WSContentSend_P(PSTR(""), idx, // &k is related to WebGetArg("k", tmp, sizeof(tmp)); + (strlen(SettingsText(SET_BUTTON1 + idx -1))) ? SettingsText(SET_BUTTON1 + idx -1) : itoa(idx, number, 10)); + } + } + WSContentSend_P(PSTR("")); +} + +void SonoffBridgeWebGetArg(void) { + char tmp[8]; // WebGetArg numbers only + WebGetArg(PSTR("k"), tmp, sizeof(tmp)); // 1 - 16 Pre defined RF keys + if (strlen(tmp)) { + char command[20]; + snprintf_P(command, sizeof(command), PSTR(D_CMND_RFKEY "%s"), tmp); + ExecuteWebCommand(command); + } +} + +#endif // USE_WEBSERVER + /*********************************************************************************************\ * Interface \*********************************************************************************************/ @@ -518,6 +548,14 @@ bool Xdrv06(uint8_t function) case FUNC_COMMAND: result = DecodeCommand(kSonoffBridgeCommands, SonoffBridgeCommand); break; +#ifdef USE_WEBSERVER + case FUNC_WEB_ADD_MAIN_BUTTON: + SonoffBridgeAddFuctionButtons(); + break; + case FUNC_WEB_GET_ARG: + SonoffBridgeWebGetArg(); + break; +#endif // USE_WEBSERVER case FUNC_INIT: SnfBridge.receive_raw_flag = 0; SonoffBridgeSendCommand(0xA7); // Stop reading RF signals enabling iTead default RF handling diff --git a/tasmota/xlgt_07_lsc_mcsl.ino b/tasmota/xlgt_07_lsc_mcsl.ino index 4b9abb6c0..d7c9bbfd2 100644 --- a/tasmota/xlgt_07_lsc_mcsl.ino +++ b/tasmota/xlgt_07_lsc_mcsl.ino @@ -249,8 +249,6 @@ void LscMcModuleSelected(void) { #ifdef USE_LSC_MCSL_GUI void LscMcAddFuctionButtons(void) { - char number[4]; - uint32_t rows = 1; uint32_t cols = 8; for (uint32_t i = 0; i < 8; i++) { @@ -262,6 +260,7 @@ void LscMcAddFuctionButtons(void) { } WSContentSend_P(HTTP_TABLE100); WSContentSend_P(PSTR("")); + char number[4]; uint32_t idx = 0; for (uint32_t i = 0; i < rows; i++) { if (idx > 0) { WSContentSend_P(PSTR("")); } @@ -277,11 +276,11 @@ void LscMcAddFuctionButtons(void) { } void LscMcWebGetArg(void) { - char tmp[8]; // WebGetArg numbers only - char command[20]; + char tmp[8]; // WebGetArg numbers only WebGetArg(PSTR("lsc"), tmp, sizeof(tmp)); // 0 - 7 functions if (strlen(tmp)) { uint32_t function = atoi(tmp); + char command[20]; snprintf_P(command, sizeof(command), PSTR(D_CMND_DIMMER " %d"), (function * (100 / 8)) + ((100 / 8) / 2)); ExecuteWebCommand(command); } From a92f2cb941236c3a8bbabc0ec410278107efe744 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 15 Dec 2021 12:30:48 +0100 Subject: [PATCH 86/97] Refactor Tuya webbutton --- tasmota/xdrv_01_webserver.ino | 13 +------------ tasmota/xdrv_06_snfbridge.ino | 4 ++-- tasmota/xdrv_16_tuyamcu.ino | 23 +++++++++++++++++++++-- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index 833ed38b1..1e8647ccf 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -1240,18 +1240,7 @@ void HandleRoot(void) #endif // USE_SONOFF_IFAN WSContentSend_P(PSTR("")); } -#ifdef USE_TUYA_MCU - if (IsModuleTuya()) { - if (AsModuleTuyaMS()) { - WSContentSend_P(HTTP_TABLE100); - WSContentSend_P(PSTR("
")); - snprintf_P(stemp, sizeof(stemp), PSTR("" D_JSON_IRHVAC_MODE "")); - WSContentSend_P(HTTP_DEVICE_CONTROL, 26, TasmotaGlobal.devices_present + 1, - (strlen(SettingsText(SET_BUTTON1 + TasmotaGlobal.devices_present))) ? SettingsText(SET_BUTTON1 + TasmotaGlobal.devices_present) : stemp, ""); - WSContentSend_P(PSTR("")); - } - } -#endif // USE_TUYA_MCU + #ifndef FIRMWARE_MINIMAL XdrvCall(FUNC_WEB_ADD_MAIN_BUTTON); XsnsCall(FUNC_WEB_ADD_MAIN_BUTTON); diff --git a/tasmota/xdrv_06_snfbridge.ino b/tasmota/xdrv_06_snfbridge.ino index 62a7db8c1..c3aa42bd8 100644 --- a/tasmota/xdrv_06_snfbridge.ino +++ b/tasmota/xdrv_06_snfbridge.ino @@ -503,7 +503,7 @@ void CmndRfRaw(void) #ifdef USE_WEBSERVER -void SonoffBridgeAddFuctionButtons(void) { +void SonoffBridgeAddButton(void) { WSContentSend_P(HTTP_TABLE100); WSContentSend_P(PSTR("")); char number[4]; @@ -550,7 +550,7 @@ bool Xdrv06(uint8_t function) break; #ifdef USE_WEBSERVER case FUNC_WEB_ADD_MAIN_BUTTON: - SonoffBridgeAddFuctionButtons(); + SonoffBridgeAddButton(); break; case FUNC_WEB_GET_ARG: SonoffBridgeWebGetArg(); diff --git a/tasmota/xdrv_16_tuyamcu.ino b/tasmota/xdrv_16_tuyamcu.ino index 250c28b21..5750839c5 100644 --- a/tasmota/xdrv_16_tuyamcu.ino +++ b/tasmota/xdrv_16_tuyamcu.ino @@ -1442,15 +1442,31 @@ void TuyaSensorsShow(bool json) #endif // USE_WEBSERVER } } - #ifdef USE_WEBSERVER +#ifdef USE_WEBSERVER if (AsModuleTuyaMS()) { WSContentSend_P(PSTR("{s}" D_JSON_IRHVAC_MODE "{m}%d{e}"), Tuya.ModeSet); } - #endif // USE_WEBSERVER +#endif // USE_WEBSERVER if (RootName) { ResponseJsonEnd();} } +#ifdef USE_WEBSERVER + +void TuyaAddButton(void) { + if (AsModuleTuyaMS()) { + WSContentSend_P(HTTP_TABLE100); + WSContentSend_P(PSTR("
")); + char stemp[33]; + snprintf_P(stemp, sizeof(stemp), PSTR("" D_JSON_IRHVAC_MODE "")); + WSContentSend_P(HTTP_DEVICE_CONTROL, 26, TasmotaGlobal.devices_present + 1, + (strlen(SettingsText(SET_BUTTON1 + TasmotaGlobal.devices_present))) ? SettingsText(SET_BUTTON1 + TasmotaGlobal.devices_present) : stemp, ""); + WSContentSend_P(PSTR("")); + } +} + +#endif // USE_WEBSERVER + /*********************************************************************************************\ * Interface \*********************************************************************************************/ @@ -1507,6 +1523,9 @@ bool Xdrv16(uint8_t function) TuyaSensorsShow(1); break; #ifdef USE_WEBSERVER + case FUNC_WEB_ADD_MAIN_BUTTON: + TuyaAddButton(); + break; case FUNC_WEB_SENSOR: TuyaSensorsShow(0); break; From 94844b4707e87bd2359da4a2388af714c7e1ef67 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Wed, 15 Dec 2021 14:46:05 +0100 Subject: [PATCH 87/97] software serial for eps32 --- tasmota/xsns_53_sml.ino | 275 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 254 insertions(+), 21 deletions(-) diff --git a/tasmota/xsns_53_sml.ino b/tasmota/xsns_53_sml.ino index d001af112..7a184a4bb 100755 --- a/tasmota/xsns_53_sml.ino +++ b/tasmota/xsns_53_sml.ino @@ -79,7 +79,7 @@ #define DJ_COUNTER "Count" struct METER_DESC { - uint8_t srcpin; + int8_t srcpin; uint8_t type; uint16_t flag; int32_t params; @@ -499,9 +499,7 @@ uint16_t meter_spos[MAX_METERS]; #ifdef ESP8266 TasmotaSerial *meter_ss[MAX_METERS]; #endif // ESP8266 -#ifdef ESP32 -HardwareSerial *meter_ss[MAX_METERS]; -#endif // ESP32 + // serial buffers, may be made larger depending on telegram lenght #ifndef SML_BSIZ @@ -592,6 +590,229 @@ double sml_median(struct SML_MEDIAN_FILTER* mf, double in) { } #endif + +// ESP32 software serial read only +#ifdef ESP32 +#ifdef USE_ESP32_SW_SERIAL + +#ifndef ESP32_SWS_BUFFER_SIZE +#define ESP32_SWS_BUFFER_SIZE 256 +#endif + + +class SML_ESP32_SERIAL : public Stream { +public: + SML_ESP32_SERIAL(uint32_t uart_index); + virtual ~SML_ESP32_SERIAL(); + bool begin(uint32_t speed, uint32_t smode, int32_t recpin, int32_t trxpin); + int32_t peek(void); + int32_t read(void) override; + size_t write(uint8_t byte) override; + int32_t available(void) override; + void flush(void) override; + void setRxBufferSize(uint32_t size); + void updateBaudRate(uint32_t baud); + void rxRead(void); + using Print::write; +private: + // Member variables + void setbaud(uint32_t speed); + uint32_t uart_index; + int8_t m_rx_pin; + int8_t m_tx_pin; + uint32_t cfgmode; + uint32_t ss_byte; + uint32_t ss_bstart; + uint32_t ss_index; + uint32_t m_bit_time; + uint32_t m_in_pos; + uint32_t m_out_pos; + uint16_t serial_buffer_size; + bool m_valid; + uint8_t *m_buffer; + HardwareSerial *hws; +}; + + +void IRAM_ATTR sml_callRxRead(void *self) { ((SML_ESP32_SERIAL*)self)->rxRead(); }; + +SML_ESP32_SERIAL::SML_ESP32_SERIAL(uint32_t index) { + uart_index = index; + m_valid = true; +} + +SML_ESP32_SERIAL::~SML_ESP32_SERIAL(void) { + if (hws) { + hws->end(); + } else { + detachInterrupt(m_rx_pin); + if (m_buffer) { + free(m_buffer); + } + } +} + +void SML_ESP32_SERIAL::setbaud(uint32_t speed) { + m_bit_time = ESP.getCpuFreqMHz() * 1000000 / speed; +} + + +bool SML_ESP32_SERIAL::begin(uint32_t speed, uint32_t smode, int32_t recpin, int32_t trxpin) { + if (!m_valid) { return false; } + + m_buffer = 0; + if (recpin < 0) { + setbaud(speed); + m_rx_pin = -recpin; + serial_buffer_size = ESP32_SWS_BUFFER_SIZE; + m_buffer = (uint8_t*)malloc(serial_buffer_size); + if (m_buffer == NULL) return false; + pinMode(m_rx_pin, INPUT); + attachInterruptArg(m_rx_pin, sml_callRxRead, this, CHANGE); + m_in_pos = m_out_pos = 0; + hws = nullptr; + } else { + cfgmode = smode; + m_rx_pin = recpin; + m_tx_pin = trxpin; + hws = new HardwareSerial(uart_index); + if (hws) { + hws->begin(speed, cfgmode, m_rx_pin, m_tx_pin); + } + } + return true; +} + +void SML_ESP32_SERIAL::flush(void) { + if (hws) { + hws->flush(); + } else { + m_in_pos = m_out_pos = 0; + } +} + +int32_t SML_ESP32_SERIAL::peek(void) { + if (hws) { + return hws->peek(); + } else { + if (m_in_pos == m_out_pos) return -1; + return m_buffer[m_out_pos]; + } +} + +int32_t SML_ESP32_SERIAL::read(void) { + if (hws) { + return hws->read(); + } else { + if (m_in_pos == m_out_pos) return -1; + uint32_t ch = m_buffer[m_out_pos]; + m_out_pos = (m_out_pos +1) % serial_buffer_size; + return ch; + } +} + +int32_t SML_ESP32_SERIAL::available(void) { + if (hws) { + return hws->available(); + } else { + int avail = m_in_pos - m_out_pos; + if (avail < 0) avail += serial_buffer_size; + return avail; + } +} + +size_t SML_ESP32_SERIAL::write(uint8_t byte) { + if (hws) { + return hws->write(byte); + } + return 0; +} + +void SML_ESP32_SERIAL::setRxBufferSize(uint32_t size) { + if (hws) { + hws->setRxBufferSize(size); + } else { + if (m_buffer) { + free(m_buffer); + } + serial_buffer_size = size; + m_buffer = (uint8_t*)malloc(size); + } +} +void SML_ESP32_SERIAL::updateBaudRate(uint32_t baud) { + if (hws) { + hws->updateBaudRate(baud); + } else { + setbaud(baud); + } +} + +// no wait mode only 8N1 (or 7X1, obis only, ignoring parity) +void IRAM_ATTR SML_ESP32_SERIAL::rxRead(void) { + uint32_t diff; + uint32_t level; + +#define SML_LASTBIT 9 + + level = digitalRead(m_rx_pin); + + if (!level && !ss_index) { + // start condition + ss_bstart = ESP.getCycleCount() - (m_bit_time / 4); + ss_byte = 0; + ss_index++; + } else { + // now any bit changes go here + // calc bit number + diff = (ESP.getCycleCount() - ss_bstart) / m_bit_time; + + if (!level && diff > SML_LASTBIT) { + // start bit of next byte, store and restart + // leave irq at change + for (uint32_t i = ss_index; i <= SML_LASTBIT; i++) { + ss_byte |= (1 << i); + } + uint32_t next = (m_in_pos + 1) % serial_buffer_size; + if (next != (uint32_t)m_out_pos) { + m_buffer[m_in_pos] = ss_byte >> 1; + m_in_pos = next; + } + + ss_bstart = ESP.getCycleCount() - (m_bit_time / 4); + ss_byte = 0; + ss_index = 1; + return; + } + if (diff >= SML_LASTBIT) { + // bit zero was 0, + uint32_t next = (m_in_pos + 1) % serial_buffer_size; + if (next != (uint32_t)m_out_pos) { + m_buffer[m_in_pos] = ss_byte >> 1; + m_in_pos = next; + } + ss_byte = 0; + ss_index = 0; + } else { + // shift in + for (uint32_t i = ss_index; i < diff; i++) { + if (!level) ss_byte |= (1 << i); + } + ss_index = diff; + } + } +} +#endif // USE_ESP32_SW_SERIAL +#endif // ESP32 + +#ifdef ESP32 +#ifndef USE_ESP32_SW_SERIAL +HardwareSerial *meter_ss[MAX_METERS]; +#else +SML_ESP32_SERIAL *meter_ss[MAX_METERS]; +#endif +#endif // ESP32 + + #ifdef ANALOG_OPTO_SENSOR // sensor over ADS1115 with i2c Bus uint8_t ads1115_up; @@ -1398,12 +1619,12 @@ void sml_shift_in(uint32_t meters,uint32_t shard) { void SML_Poll(void) { uint32_t meters; - for (meters=0; metersavailable()) { - sml_shift_in(meters,0); + sml_shift_in(meters, 0); } } } @@ -2311,7 +2532,7 @@ void SML_Init(void) { uint8_t *tp = 0; uint16_t index = 0; uint8_t section = 0; - uint8_t srcpin = 0; + int8_t srcpin = 0; uint8_t dec_line = 0; char *lp = glob_script_mem.scriptptr; sml_send_blocks = 0; @@ -2348,7 +2569,7 @@ void SML_Init(void) { } index--; srcpin = strtol(lp,&lp,10); - if (Gpio_used(srcpin)) { + if (Gpio_used(abs(srcpin))) { AddLog(LOG_LEVEL_INFO, PSTR("gpio rx double define!")); dddef_exit: if (script_meter) free(script_meter); @@ -2481,7 +2702,6 @@ dddef_exit: if (*lp == SCRIPT_EOL) lp--; goto next_line; } - #ifdef SML_REPLACE_VARS char dstbuf[SML_SRCBSIZE*2]; Replace_Cmd_Vars(lp, 1, dstbuf,sizeof(dstbuf)); @@ -2570,13 +2790,13 @@ init10: uint8_t cindex=0; // preloud counters for (byte i = 0; i < MAX_COUNTERS; i++) { - RtcSettings.pulse_counter[i]=Settings->pulse_counter[i]; + RtcSettings.pulse_counter[i] = Settings->pulse_counter[i]; sml_counters[i].sml_cnt_last_ts=millis(); } - uint32_t uart_index=2; - for (uint8_t meters=0; meters= 0) { + if (uart_index == 0) { ClaimSerial(); } + uart_index--; + if (uart_index < 0) uart_index = 0; + } +#else meter_ss[meters] = new HardwareSerial(uart_index); - if (uart_index==0) { ClaimSerial(); } + if (uart_index == 0) { ClaimSerial(); } uart_index--; - if (uart_index<0) uart_index=0; + if (uart_index < 0) uart_index = 0; meter_ss[meters]->setRxBufferSize(TMSBSIZ); +#endif // USE_ESP32_SW_SERIAL + #endif // ESP32 -#endif +#endif // SPECIAL_SS SerialConfig smode = SERIAL_8N1; @@ -2664,10 +2895,10 @@ init10: #endif // ESP8266 #ifdef ESP32 meter_ss[meters]->begin(meter_desc_p[meters].params, smode, meter_desc_p[meters].srcpin, meter_desc_p[meters].trxpin); + //meter_ss[meters]->setRxBufferSize(TMSBSIZ); #endif // ESP32 } } - } @@ -2685,7 +2916,7 @@ uint32_t sml_getv(uint32_t sel) { return sel; } uint32_t SML_SetBaud(uint32_t meter, uint32_t br) { - if (meter<1 || meter>meters_used) return 0; + if (meter < 1 || meter > meters_used) return 0; meter--; if (!meter_ss[meter]) return 0; #ifdef ESP8266 @@ -3095,7 +3326,9 @@ bool Xsns53(byte function) { case FUNC_LOOP: SML_Counter_Poll(); if (dump2log) Dump2log(); - else SML_Poll(); + else { + SML_Poll(); + } break; // case FUNC_EVERY_50_MSECOND: // if (dump2log) Dump2log(); From eec2e50a4652a635e1770bb23a80d0702d54cc14 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Wed, 15 Dec 2021 15:07:36 +0100 Subject: [PATCH 88/97] database extraction update, housekeeping --- tasmota/xdrv_10_scripter.ino | 574 +++++++++++++++++++++++++---------- 1 file changed, 406 insertions(+), 168 deletions(-) diff --git a/tasmota/xdrv_10_scripter.ino b/tasmota/xdrv_10_scripter.ino index f744d850b..b567864c1 100755 --- a/tasmota/xdrv_10_scripter.ino +++ b/tasmota/xdrv_10_scripter.ino @@ -1302,69 +1302,170 @@ float DoMedian5(uint8_t index, float in) { #ifdef USE_FEXTRACT -// convert tasmota time stamp to ul seconds -uint32_t tstamp2l(char *ts) { -uint16_t year; -uint8_t month; -uint8_t day; -uint8_t hour; -uint8_t mins; -uint8_t secs; +struct FE_TM { + uint16_t year; + uint8_t month; + uint8_t day; + uint8_t hour; + uint8_t mins; + uint8_t secs; +}; + +// timestamp math add days +int32_t tso(char *src, int32_t days, int32_t flg) { +struct tm tmx; +struct tm *tmp; +struct FE_TM tm; + uint8_t mode = ts2ts(&tm, src); + + tmx.tm_sec = tm.secs; + tmx.tm_min = tm.mins; + tmx.tm_hour = tm.hour; + tmx.tm_mon = tm.month - 1; + tmx.tm_year = tm.year + 100; + tmx.tm_mday = tm.day; + time_t tmd = mktime(&tmx); + tmd += days * (24 * 3600); + tmp = gmtime(&tmd); + if (!flg) { + tm.secs = tmp->tm_sec; + tm.mins = tmp->tm_min; + tm.hour = tmp->tm_hour; + } else { + tm.secs = 0; + tm.mins = 0; + tm.hour = 0; + } + tm.month = tmp->tm_mon + 1; + tm.year = tmp->tm_year - 100; + tm.day = tmp->tm_mday; + tss2ts(&tm, src, mode); + return 0; +} + +uint32_t ts2ts(struct FE_TM *tm, char *ts) { if (strchr(ts, 'T')) { // 2020-12-16T15:36:41 - year = strtol(ts, &ts, 10); - if (year < 2020 || year > 2040) { - year = 2020; + tm->year = strtol(ts, &ts, 10); + if (tm->year < 2020 || tm->year > 2040) { + tm->year = 2020; } - year -= 2000; + tm->year -= 2000; ts++; - month = strtol(ts, &ts, 10); + tm->month = strtol(ts, &ts, 10); ts++; - day = strtol(ts, &ts, 10); + tm->day = strtol(ts, &ts, 10); ts++; - hour = strtol(ts, &ts, 10); + tm->hour = strtol(ts, &ts, 10); ts++; - mins = strtol(ts, &ts, 10); + tm->mins = strtol(ts, &ts, 10); ts++; - secs = strtol(ts, &ts, 10); + tm->secs = strtol(ts, &ts, 10); + return 0; } else { // german excel fromat 16.12.20 15:36 - day = strtol(ts, &ts, 10); + tm->day = strtol(ts, &ts, 10); ts++; - month = strtol(ts, &ts, 10); + tm->month = strtol(ts, &ts, 10); ts++; - year = strtol(ts, &ts, 10); + tm->year = strtol(ts, &ts, 10); ts++; - hour = strtol(ts, &ts, 10); + tm->hour = strtol(ts, &ts, 10); ts++; - mins = strtol(ts, &ts, 10); - secs = 0; + tm->mins = strtol(ts, &ts, 10); + tm->secs = 0; + return 1; } - return (year*365*86400)+(month*31*86400)+(day*86400)+(hour*3600)+(mins*60)+secs; + return 0; +} + +void tss2ts(struct FE_TM *tm, char *dst, uint8_t mode) { + if (mode == 1) { + // was tsm format go to 16.12.20 15:36 + sprintf(dst, "%01d.%01d.%01d %01d:%02d", tm->day, tm->month, tm->year, tm->hour, tm->mins); + } else { + // 2020-12-16T15:36:41 + sprintf(dst, "%04d-%02d-%02dT%02d:%02d:%02d", tm->year + 2000, tm->month, tm->day, tm->hour, tm->mins, tm->secs); + } +} + +// convert time stamp format +void cnvts(char *dst, char *src, uint8_t flg ) { +struct FE_TM tm; + uint8_t mode = ts2ts(&tm, src); + tss2ts(&tm, dst, flg); +} + +// convert tasmota time stamp to ul seconds +uint32_t tstamp2l(char *ts) { +struct FE_TM tm; + + ts2ts(&tm, ts); + + return (tm.year*365*86400)+(tm.month*31*86400)+(tm.day*86400)+(tm.hour*3600)+(tm.mins*60)+tm.secs; } // assume 1. entry is timestamp, others are tab delimited values until LF // file refernece, from timestamp, to timestampm, column offset, array pointers, array lenght, number of arrays -int32_t extract_from_file(uint8_t fref, char *ts_from, char *ts_to, uint8_t coffs, float **a_ptr, uint16_t *a_len, uint8_t numa, int16_t accum) { +int32_t extract_from_file(uint8_t fref, char *ts_from, char *ts_to, int8_t coffs, float **a_ptr, uint16_t *a_len, uint8_t numa, int16_t accum) { if (!glob_script_mem.file_flags[fref].is_open) return -1; char rstr[32]; uint8_t sindex = 0; uint8_t colpos = 0; uint8_t range = 0; + if (coffs < 0) { + uint32_t cpos = glob_script_mem.files[fref].size(); + if (coffs == -1) { + // seek to last entry + if (cpos > 1) cpos -= 2; + // now seek back to last line + uint8_t lbuff[256]; + uint8_t iob; + uint16_t index = sizeof(lbuff) -1; + glob_script_mem.files[fref].seek(cpos - sizeof(lbuff), SeekSet); + glob_script_mem.files[fref].read(lbuff, sizeof(lbuff)); + while (cpos) { + iob = lbuff[index]; + if (iob == '\n' || iob == '\r') { + break; + } + cpos--; + index--; + } + glob_script_mem.files[fref].seek(cpos, SeekSet); + } else { + // seek to line 2 + for (uint32_t cp = 0; cp < cpos; cp++) { + uint8_t buff[2], iob; + glob_script_mem.files[fref].read(buff, 1); + iob = buff[0]; + if (iob == '\n' || iob == '\r') { + cpos = cp + 1; + break; + } + } + } + return cpos; + } uint32_t tsfrom = tstamp2l(ts_from); uint32_t tsto = tstamp2l(ts_to); uint16_t lines = 0; uint16_t rlines = 0; float summs[numa]; + float lastv[numa]; uint16_t accnt[numa]; + uint8_t mflg[numa]; + uint32_t lastpos = 0; for (uint8_t cnt = 0; cnt < numa; cnt++) { summs[cnt] = 0; accnt[cnt] = 0; + mflg[cnt] = 0; + lastv[cnt] = 0; } - uint8_t dflg = 1; + uint8_t dflg = 0; if (accum < 0) { - dflg = 0; + dflg = 1; accum = -accum; } if (accum == 0) accum = 1; @@ -1373,14 +1474,32 @@ int32_t extract_from_file(uint8_t fref, char *ts_from, char *ts_to, uint8_t cof uint8_t buff[2], iob; glob_script_mem.files[fref].read(buff, 1); iob = buff[0]; - if (iob == '\t' || iob == ',' || iob == '\n') { + if (iob == '\t' || iob == ',' || iob == '\n' || iob == '\r') { rstr[sindex] = 0; sindex = 0; - if (colpos == 0) { + if (lines == 0) { + // header line, analye column names + if (colpos >= 1 && colpos >= coffs) { + uint8_t curpos = colpos - coffs; + if (curpos < numa) { + mflg[curpos] = dflg; + char *tp = strstr(rstr, "_a"); + if (tp) { + // mark average values + mflg[curpos] |= 2; + } + } + } + } else { + if (colpos == 0) { // timestamp 2020-12-16T15:36:41 // decompose timestamps uint32_t cts = tstamp2l(rstr); - if (cts > tsto) break; + if (cts > tsto) { + // end of range must seek back to last LF, for next scan + glob_script_mem.files[fref].seek(lastpos, SeekSet); + break; + } if (cts >= tsfrom && cts <= tsto) { // we want this range range = 1; @@ -1388,22 +1507,25 @@ int32_t extract_from_file(uint8_t fref, char *ts_from, char *ts_to, uint8_t cof } else { range = 0; } - } else { + } else { // data columns if (range) { uint8_t curpos = colpos - coffs; if (colpos >= coffs && curpos < numa) { if (a_len[curpos]) { float fval = CharToFloat(rstr); + if (mflg[curpos] == 3) { + // absolute values, build diffs + float tmp = fval; + fval -= lastv[curpos]; + lastv[curpos] = tmp; + } + // average values //AddLog(LOG_LEVEL_INFO, PSTR("cpos %d colp %d numa %d - %s %d"),curpos, colpos, a_len[curpos], rstr, (uint32_t)fval); summs[curpos] += fval; accnt[curpos] += 1; if (accnt[curpos] == accum) { - if (dflg) { - *a_ptr[curpos]++ = summs[curpos] / accum; - } else { - *a_ptr[curpos]++ = summs[curpos]; - } + *a_ptr[curpos]++ = summs[curpos] / accum; summs[curpos] = 0; accnt[curpos] = 0; a_len[curpos]--; @@ -1413,11 +1535,13 @@ int32_t extract_from_file(uint8_t fref, char *ts_from, char *ts_to, uint8_t cof } } } + } } colpos++; - if (iob == '\n') { - colpos = 0; - lines ++; + if (iob == '\n' || iob == '\r') { + lastpos = glob_script_mem.files[fref].position(); + colpos = 0; + lines ++; } } rstr[sindex] = iob; @@ -1925,25 +2049,25 @@ chknext: switch (vname[0]) { case 'a': #ifdef USE_ANGLE_FUNC - if (!strncmp(vname, "acos(", 5)) { + if (!strncmp(lp, "acos(", 5)) { lp=GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); fvar = acosf(fvar); goto nfuncexit; } #endif - if (!strncmp(vname, "abs(", 4)) { + if (!strncmp(lp, "abs(", 4)) { lp=GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); fvar = fabs(fvar); goto nfuncexit; } - if (!strncmp(vname, "asc(", 4)) { + if (!strncmp(lp, "asc(", 4)) { char str[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 4, OPER_EQU, str, gv); fvar = str[0]; goto nfuncexit; } - if (!strncmp(vname, "adc(", 4)) { + if (!strncmp(lp, "adc(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); while (*lp==' ') lp++; float fvar1 = 1; @@ -1971,7 +2095,7 @@ chknext: len = 0; goto exit; } - if (!strncmp(vname, "acp(", 4)) { + if (!strncmp(lp, "acp(", 4)) { lp += 4; SCRIPT_SKIP_SPACES uint16_t alend; @@ -2002,9 +2126,9 @@ chknext: goto exit; } #ifdef USE_BUTTON_EVENT - if (!strncmp(vname, "bt[", 3)) { + if (!strncmp(lp, "bt[", 3)) { // tasmota button state - GetNumericArgument(vname+3, OPER_EQU, &fvar, gv); + GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); uint32_t index = fvar; if (index<1 || index>MAX_KEYS) index = 1; fvar = glob_script_mem.script_button[index - 1]; @@ -2015,11 +2139,11 @@ chknext: #endif //USE_BUTTON_EVENT break; case 'c': - if (!strncmp(vname, "chg[", 4)) { + if (!strncmp(lp, "chg[", 4)) { // var changed struct T_INDEX ind; uint8_t vtype; - isvar(vname + 4, &vtype, &ind, 0, 0, gv); + isvar(lp + 4, &vtype, &ind, 0, 0, gv); if (!ind.bits.constant) { uint8_t index = glob_script_mem.type[ind.index].index; if (glob_script_mem.fvars[index] != glob_script_mem.s_fvars[index]) { @@ -2041,7 +2165,7 @@ chknext: goto exit; } #ifdef USE_M5STACK_CORE2 - if (!strncmp(vname, "c2ps(", 5)) { + if (!strncmp(lp, "c2ps(", 5)) { lp = GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); while (*lp==' ') lp++; float fvar1; @@ -2052,7 +2176,7 @@ chknext: #endif // USE_M5STACK_CORE2 #ifdef USE_SCRIPT_TASK - if (!strncmp(vname, "ct(", 3)) { + if (!strncmp(lp, "ct(", 3)) { lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); while (*lp==' ') lp++; float fvar1; @@ -2070,12 +2194,31 @@ chknext: #endif //USE_SCRIPT_TASK #endif //ESP32 #ifdef USE_ANGLE_FUNC - if (!strncmp(vname, "cos(", 4)) { + if (!strncmp(lp, "cos(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); fvar = cosf(fvar); goto nfuncexit; } #endif +#ifdef USE_FEXTRACT + if (!strncmp(lp, "cts(", 4)) { + char tsin[SCRIPT_MAXSSIZE]; + lp = GetStringArgument(lp + 4, OPER_EQU, tsin, 0); + SCRIPT_SKIP_SPACES + int8_t flg = -1; + if (*lp != ')') { + lp = GetNumericArgument(lp, OPER_EQU, &fvar, gv); + flg = fvar; + } + char tsout[SCRIPT_MAXSSIZE]; + cnvts(tsout, tsin, flg); + if (sp) strlcpy(sp, tsout, glob_script_mem.max_ssize); + lp++; + len = 0; + goto strexit; + } +#endif // USE_FEXTRACT + break; case 'd': if (!strncmp(vname, "day", 3)) { @@ -2086,6 +2229,16 @@ chknext: if (sp) strlcpy(sp, SettingsText(SET_DEVICENAME), glob_script_mem.max_ssize); goto strexit; } + if (!strncmp(lp, "dp(", 3)) { + lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); + while (*lp==' ') lp++; + glob_script_mem.script_lzero = fvar; + lp = GetNumericArgument(lp , OPER_EQU, &fvar, gv); + while (*lp==' ') lp++; + glob_script_mem.script_dprec = fvar; + fvar = 0; + goto nfuncexit; + } break; case 'e': if (!strncmp(vname, "epoch", 5)) { @@ -2103,7 +2256,7 @@ chknext: goto exit_settable; } #ifdef USE_ENERGY_SENSOR - if (!strncmp(vname, "enrg[", 5)) { + if (!strncmp(lp, "enrg[", 5)) { lp=GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); while (*lp==' ') lp++; switch ((uint32_t)fvar) { @@ -2158,7 +2311,7 @@ chknext: case 'f': //#define DEBUG_FS #ifdef USE_SCRIPT_FATFS - if (!strncmp(vname, "fo(", 3)) { + if (!strncmp(lp, "fo(", 3)) { char str[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); while (*lp==' ') lp++; @@ -2219,7 +2372,7 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "fc(", 3)) { + if (!strncmp(lp, "fc(", 3)) { lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); if (fvar>=0) { uint8_t ind = fvar; @@ -2233,7 +2386,7 @@ chknext: fvar = 0; goto nfuncexit; } - if (!strncmp(vname, "ff(", 3)) { + if (!strncmp(lp, "ff(", 3)) { lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); uint8_t ind = fvar; if (ind>=SFS_MAX) ind = SFS_MAX - 1; @@ -2241,7 +2394,7 @@ chknext: fvar = 0; goto nfuncexit; } - if (!strncmp(vname, "fw(", 3)) { + if (!strncmp(lp, "fw(", 3)) { char str[SCRIPT_MAXSSIZE]; lp = ForceStringVar(lp + 3, str); while (*lp==' ') lp++; @@ -2255,7 +2408,7 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "fwb(", 4)) { + if (!strncmp(lp, "fwb(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); uint8_t buf[2]; buf[0] = fvar; @@ -2271,7 +2424,7 @@ chknext: goto nfuncexit; } - if (!strncmp(vname, "fr(", 3)) { + if (!strncmp(lp, "fr(", 3)) { struct T_INDEX ind; uint8_t vtype; uint8_t sindex = 0; @@ -2344,7 +2497,7 @@ chknext: len = 0; goto exit; } - if (!strncmp(vname, "frb(", 4)) { + if (!strncmp(lp, "frb(", 4)) { lp = GetNumericArgument(lp, OPER_EQU, &fvar, gv); uint8_t ind = fvar; if (ind>=SFS_MAX) ind = SFS_MAX - 1; @@ -2358,7 +2511,7 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "fa(", 3)) { + if (!strncmp(lp, "fa(", 3)) { lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); uint8_t ind = fvar; if (ind>=SFS_MAX) ind = SFS_MAX - 1; @@ -2369,7 +2522,7 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "fs(", 3)) { + if (!strncmp(lp, "fs(", 3)) { lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); uint8_t ind = fvar; SCRIPT_SKIP_SPACES @@ -2377,13 +2530,13 @@ chknext: SCRIPT_SKIP_SPACES if (ind>=SFS_MAX) ind = SFS_MAX - 1; if (glob_script_mem.file_flags[ind].is_open) { - fvar = glob_script_mem.files[ind].seek(fvar, fs::SeekMode::SeekCur); + fvar = glob_script_mem.files[ind].seek(fvar, SeekSet); } else { fvar = -1; } goto nfuncexit; } - if (!strncmp(vname, "fz(", 3)) { + if (!strncmp(lp, "fz(", 3)) { lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); SCRIPT_SKIP_SPACES uint8_t ind = fvar; @@ -2395,14 +2548,14 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "fd(", 3)) { + if (!strncmp(lp, "fd(", 3)) { char str[glob_script_mem.max_ssize + 1]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); ufsp->remove(str); goto nfuncexit; } #ifdef USE_UFILESYS - if (!strncmp(vname, "frw(", 4)) { + if (!strncmp(lp, "frw(", 4)) { // read file from web lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); SCRIPT_SKIP_SPACES @@ -2414,7 +2567,7 @@ chknext: } #endif #if defined(ESP32) && defined(USE_WEBCAM) - if (!strncmp(vname, "fwp(", 4)) { + if (!strncmp(lp, "fwp(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); while (*lp==' ') lp++; float fvar1; @@ -2440,7 +2593,7 @@ chknext: } #endif //ESP32 && USE_WEBCAM #ifdef USE_SCRIPT_FATFS_EXT - if (!strncmp(vname, "fe(", 3)) { + if (!strncmp(lp, "fe(", 3)) { char str[glob_script_mem.max_ssize + 1]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); // execute script @@ -2461,13 +2614,13 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "fmd(", 4)) { + if (!strncmp(lp, "fmd(", 4)) { char str[glob_script_mem.max_ssize + 1]; lp = GetStringArgument(lp + 4, OPER_EQU, str, 0); fvar = ufsp->mkdir(str); goto nfuncexit; } - if (!strncmp(vname, "fmt(", 4)) { + if (!strncmp(lp, "fmt(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); if (!fvar) { LittleFS.format(); @@ -2476,13 +2629,13 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "frd(", 4)) { + if (!strncmp(lp, "frd(", 4)) { char str[glob_script_mem.max_ssize + 1]; lp = GetStringArgument(lp + 4, OPER_EQU, str, 0); fvar = ufsp->rmdir(str); goto nfuncexit; } - if (!strncmp(vname, "fx(", 3)) { + if (!strncmp(lp, "fx(", 3)) { char str[glob_script_mem.max_ssize + 1]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); if (ufsp->exists(str)) fvar = 1; @@ -2490,14 +2643,14 @@ chknext: goto nfuncexit; } - if (!strncmp(vname, "fsi(", 4)) { + if (!strncmp(lp, "fsi(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); fvar = UfsInfo(fvar, 0); goto nfuncexit; } #ifdef USE_FEXTRACT - if (!strncmp(vname, "fxt(", 4)) { + if (!strncmp(lp, "fxt(", 4)) { // extract from file lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); SCRIPT_SKIP_SPACES @@ -2536,7 +2689,7 @@ chknext: goto nfuncexit; } #endif // USE_FEXTRACT - if (!strncmp(vname, "fwa(", 4)) { + if (!strncmp(lp, "fwa(", 4)) { uint16_t alen; float *fa; lp = get_array_by_name(lp + 4, &fa, &alen); @@ -2576,7 +2729,7 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "fra(", 4)) { + if (!strncmp(lp, "fra(", 4)) { uint16_t alen; float *fa; lp = get_array_by_name(lp + 4, &fa, &alen); @@ -2622,7 +2775,7 @@ chknext: } #endif // USE_SCRIPT_FATFS_EXT - if (!strncmp(vname, "fl1(", 4) || !strncmp(vname, "fl2(", 4) ) { + if (!strncmp(lp, "fl1(", 4) || !strncmp(lp, "fl2(", 4) ) { uint8_t lknum = *(lp+2)&3; char str[glob_script_mem.max_ssize + 1]; lp = GetStringArgument(lp + 4, OPER_EQU, str, 0); @@ -2631,13 +2784,13 @@ chknext: fvar = 0; goto nfuncexit; } - if (!strncmp(vname, "fsm", 3)) { + if (!strncmp(lp, "fsm", 3)) { fvar=(uint32_t)ufsp; //card_init(); goto exit; } #endif //USE_SCRIPT_FATFS - if (!strncmp(vname, "freq", 4)) { + if (!strncmp(lp, "freq", 4)) { #ifdef ESP32 fvar = getCpuFrequencyMhz(); #else @@ -2645,7 +2798,7 @@ chknext: #endif goto exit; } - if (!strncmp(vname, "frnm", 4)) { + if (!strncmp(lp, "frnm", 4)) { if (sp) strlcpy(sp, SettingsText(SET_FRIENDLYNAME1), glob_script_mem.max_ssize); goto strexit; } @@ -2669,7 +2822,7 @@ chknext: goto strexit; } #ifdef USE_WEBSEND_RESPONSE - if (!strncmp(vname, "gwr(", 4)) { + if (!strncmp(lp, "gwr(", 4)) { char delim[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 4, OPER_EQU, delim, 0); SCRIPT_SKIP_SPACES @@ -2738,7 +2891,7 @@ chknext: #endif #ifdef SCRIPT_GET_HTTPS_JP - if (!strncmp(vname, "gjp(", 4)) { + if (!strncmp(lp, "gjp(", 4)) { char host[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 4, OPER_EQU, host, 0); SCRIPT_SKIP_SPACES @@ -2758,7 +2911,7 @@ chknext: fvar = ESP_getFreeHeap(); goto exit; } - if (!strncmp(vname, "hn(", 3)) { + if (!strncmp(lp, "hn(", 3)) { lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); if (fvar<0 || fvar>255) fvar = 0; lp++; @@ -2768,7 +2921,7 @@ chknext: } goto strexit; } - if (!strncmp(vname, "hx(", 3)) { + if (!strncmp(lp, "hx(", 3)) { lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); lp++; len = 0; @@ -2777,13 +2930,13 @@ chknext: } goto strexit; } - if (!strncmp(vname, "hd(", 3)) { + if (!strncmp(lp, "hd(", 3)) { char str[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); fvar = strtol(str, NULL, 16); goto nfuncexit; } - if (!strncmp(vname, "hf(", 3)) { + if (!strncmp(lp, "hf(", 3)) { char str[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); SCRIPT_SKIP_SPACES @@ -2812,7 +2965,7 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "http(", 5)) { + if (!strncmp(lp, "http(", 5)) { char host[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 5, OPER_EQU, host, 0); SCRIPT_SKIP_SPACES @@ -2823,7 +2976,7 @@ chknext: goto nfuncexit; } #ifdef USE_LIGHT - if (!strncmp(vname, "hsvrgb(", 7)) { + if (!strncmp(lp, "hsvrgb(", 7)) { lp = GetNumericArgument(lp + 7, OPER_EQU, &fvar, gv); if (fvar<0 || fvar>360) fvar = 0; SCRIPT_SKIP_SPACES @@ -2843,7 +2996,7 @@ chknext: #endif //USE_LIGHT #ifdef USE_HOMEKIT - if (!strncmp(vname, "hki(", 4)) { + if (!strncmp(lp, "hki(", 4)) { if (!TasmotaGlobal.global_state.wifi_down) { // erase nvs lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); @@ -2858,7 +3011,7 @@ chknext: #endif break; case 'i': - if (!strncmp(vname, "ins(", 4)) { + if (!strncmp(lp, "ins(", 4)) { char s1[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 4, OPER_EQU, s1, 0); SCRIPT_SKIP_SPACES @@ -2873,46 +3026,46 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "int(", 4)) { + if (!strncmp(lp, "int(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); fvar = floor(fvar); goto nfuncexit; } - if (!strncmp(vname, "is(", 3)) { + if (!strncmp(lp, "is(", 3)) { lp = isargs(lp + 3, 0); fvar = 0; len = 0; goto exit; } - if (!strncmp(vname, "is1(", 4)) { + if (!strncmp(lp, "is1(", 4)) { lp = isargs(lp + 4, 1); fvar = 0; len = 0; goto exit; } - if (!strncmp(vname, "is2(", 4)) { + if (!strncmp(lp, "is2(", 4)) { lp = isargs(lp + 4, 2); fvar = 0; len = 0; goto exit; } - if (!strncmp(vname, "is[", 3)) { + if (!strncmp(lp, "is[", 3)) { lp = isget(lp + 3, sp, 0, gv); len = 0; goto strexit; } - if (!strncmp(vname, "is1[", 4)) { + if (!strncmp(lp, "is1[", 4)) { lp = isget(lp + 4, sp, 1, gv); len = 0; goto strexit; } - if (!strncmp(vname, "is2[", 4)) { + if (!strncmp(lp, "is2[", 4)) { lp = isget(lp + 4, sp, 2, gv); len = 0; goto strexit; } #ifdef USE_SCRIPT_I2C - if (!strncmp(vname, "ia", 2)) { + if (!strncmp(lp, "ia", 2)) { uint8_t bus = 0; lp += 2; if (*lp == '2') { @@ -2923,7 +3076,7 @@ chknext: fvar = script_i2c(0, fvar, bus); goto nfuncexit; } - if (!strncmp(vname, "iw", 2)) { + if (!strncmp(lp, "iw", 2)) { uint8_t bytes = 1; lp += 2; if (*lp != '(') { @@ -2940,7 +3093,7 @@ chknext: fvar = script_i2c(9 + bytes, fvar, fvar2); goto nfuncexit; } - if (!strncmp(vname, "ir", 2)) { + if (!strncmp(lp, "ir", 2)) { uint8_t bytes = 1; lp += 2; if (*lp != '(') { @@ -2956,7 +3109,7 @@ chknext: #endif // USE_SCRIPT_I2C break; case 'l': - if (!strncmp(vname, "lip", 3)) { + if (!strncmp(lp, "lip", 3)) { if (sp) strlcpy(sp, (const char*)WiFi.localIP().toString().c_str(), glob_script_mem.max_ssize); goto strexit; } @@ -2977,7 +3130,7 @@ chknext: return lp + len; } #ifdef USE_LVGL - if (!strncmp(vname, "lvgl(", 5)) { + if (!strncmp(lp, "lvgl(", 5)) { lp = GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); SCRIPT_SKIP_SPACES fvar = lvgl_test(&lp, fvar); @@ -2986,7 +3139,7 @@ chknext: #endif // USE_LVGL break; case 'm': - if (!strncmp(vname, "med(", 4)) { + if (!strncmp(lp, "med(", 4)) { float fvar1; lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar1, gv); SCRIPT_SKIP_SPACES @@ -2997,7 +3150,7 @@ chknext: goto nfuncexit; } #ifdef USE_ANGLE_FUNC - if (!strncmp(vname, "mpt(", 4)) { + if (!strncmp(lp, "mpt(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); fvar = MeasurePulseTime(fvar); goto nfuncexit; @@ -3037,7 +3190,7 @@ chknext: fvar = !TasmotaGlobal.global_state.mqtt_down; goto exit; } - if (!strncmp(vname, "mp(", 3)) { + if (!strncmp(lp, "mp(", 3)) { float fvar1; lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar1, gv); SCRIPT_SKIP_SPACES @@ -3067,7 +3220,7 @@ chknext: goto exit; } #ifdef USE_MORITZ - if (!strncmp(vname, "mo(", 3)) { + if (!strncmp(lp, "mo(", 3)) { float fvar1; lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar1, gv); SCRIPT_SKIP_SPACES @@ -3084,23 +3237,23 @@ chknext: #endif //USE_MORITZ break; case 'p': - if (!strncmp(vname, "pin[", 4)) { + if (!strncmp(lp, "pin[", 4)) { // raw pin level - GetNumericArgument(vname + 4, OPER_EQU, &fvar, gv); + GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); fvar = digitalRead((uint8_t)fvar); // skip ] bracket len++; goto exit; } - if (!strncmp(vname, "pn[", 3)) { - GetNumericArgument(vname + 3, OPER_EQU, &fvar, gv); + if (!strncmp(lp, "pn[", 3)) { + GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); fvar = Pin(fvar); // skip ] bracket len++; goto exit; } #if defined(ESP32) && (defined(USE_I2S_AUDIO) || defined(USE_TTGO_WATCH) || defined(USE_M5STACK_CORE2)) - if (!strncmp(vname, "pl(", 3)) { + if (!strncmp(lp, "pl(", 3)) { char path[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 3, OPER_EQU, path, 0); Play_mp3(path); @@ -3109,8 +3262,8 @@ chknext: goto exit; } #endif // USE_I2S_AUDIO - if (!strncmp(vname, "pd[", 3)) { - GetNumericArgument(vname + 3, OPER_EQU, &fvar, gv); + if (!strncmp(lp, "pd[", 3)) { + GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); uint8_t gpiopin = fvar; /* for (uint8_t i=0;iMAX_COUNTERS) index = 1; fvar = RtcSettings.pulse_counter[index - 1]; @@ -3188,9 +3341,9 @@ chknext: fvar = glob_script_mem.script_mem_size + (glob_script_mem.script_size) + (PMEM_SIZE); goto exit; } - if (!strncmp(vname, "rnd(", 4)) { + if (!strncmp(lp, "rnd(", 4)) { // tasmota switch state - GetNumericArgument(vname + 4, OPER_EQU, &fvar, gv); + GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); if (fvar<0) { randomSeed(-fvar); fvar = 0; @@ -3202,7 +3355,7 @@ chknext: goto exit; } #if defined(ESP32) && (defined(USE_M5STACK_CORE2)) - if (!strncmp(vname, "rec(", 4)) { + if (!strncmp(lp, "rec(", 4)) { char str[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 4, OPER_EQU, str, 0); SCRIPT_SKIP_SPACES @@ -3218,9 +3371,9 @@ chknext: fvar = RtcTime.second; goto exit; } - if (!strncmp(vname, "sw[", 3)) { + if (!strncmp(lp, "sw[", 3)) { // tasmota switch state - GetNumericArgument(vname + 3, OPER_EQU, &fvar, gv); + GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); fvar = SwitchLastState((uint32_t)fvar); // skip ] bracket len++; @@ -3240,13 +3393,13 @@ chknext: fvar = strlen(glob_script_mem.script_ram); goto exit; } - if (!strncmp(vname, "sl(", 3)) { + if (!strncmp(lp, "sl(", 3)) { char str[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); fvar = strlen(str); goto nfuncexit; } - if (!strncmp(vname, "sb(", 3)) { + if (!strncmp(lp, "sb(", 3)) { char str[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); SCRIPT_SKIP_SPACES @@ -3264,7 +3417,7 @@ chknext: sp[(uint8_t)fvar2] = '\0'; goto strexit; } - if (!strncmp(vname, "st(", 3)) { + if (!strncmp(lp, "st(", 3)) { char str[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); while (*lp==' ') lp++; @@ -3297,7 +3450,7 @@ chknext: } goto strexit; } - if (!strncmp(vname, "s(", 2)) { + if (!strncmp(lp, "s(", 2)) { lp = GetNumericArgument(lp + 2, OPER_EQU, &fvar, gv); char str[glob_script_mem.max_ssize + 1]; f2char(fvar, glob_script_mem.script_dprec, glob_script_mem.script_lzero, str); @@ -3307,7 +3460,7 @@ chknext: goto strexit; } #if defined(ESP32) && (defined(USE_I2S_AUDIO) || defined(USE_TTGO_WATCH) || defined(USE_M5STACK_CORE2)) - if (!strncmp(vname, "say(", 4)) { + if (!strncmp(lp, "say(", 4)) { char text[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 4, OPER_EQU, text, 0); Say(text); @@ -3318,7 +3471,7 @@ chknext: #endif // USE_I2S_AUDIO #ifdef ESP32 - if (!strncmp(vname, "sf(", 3)) { + if (!strncmp(lp, "sf(", 3)) { lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar, gv); if (fvar<80) fvar = 80; if (fvar>240) fvar = 240; @@ -3328,7 +3481,7 @@ chknext: } #endif //ESP32 #ifdef USE_TTGO_WATCH - if (!strncmp(vname, "slp(", 4)) { + if (!strncmp(lp, "slp(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); SCRIPT_SKIP_SPACES TTGO_Sleep(fvar); @@ -3347,8 +3500,8 @@ chknext: #endif //USE_TIMERS #ifdef USE_SHUTTER - if (!strncmp(vname, "sht[", 4)) { - GetNumericArgument(vname + 4, OPER_EQU, &fvar, gv); + if (!strncmp(lp, "sht[", 4)) { + GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); uint8_t index = fvar; if (index<=TasmotaGlobal.shutters_present) { fvar = Settings->shutter_position[index - 1]; @@ -3360,12 +3513,12 @@ chknext: } #endif //USE_SHUTTER #ifdef USE_ANGLE_FUNC - if (!strncmp(vname, "sin(", 4)) { + if (!strncmp(lp, "sin(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); fvar = sinf(fvar); goto nfuncexit; } - if (!strncmp(vname, "sqrt(", 5)) { + if (!strncmp(lp, "sqrt(", 5)) { lp = GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); fvar = sqrtf(fvar); goto nfuncexit; @@ -3373,13 +3526,13 @@ chknext: #endif //USE_ANGLE_FUNC #if defined(USE_SML_M) && defined (USE_SML_SCRIPT_CMD) - if (!strncmp(vname, "sml[", 4)) { + if (!strncmp(lp, "sml[", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); SCRIPT_SKIP_SPACES fvar = SML_GetVal(fvar); goto nfuncexit; } - if (!strncmp(vname, "sml(", 4)) { + if (!strncmp(lp, "sml(", 4)) { float fvar1; lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar1, gv); SCRIPT_SKIP_SPACES @@ -3417,13 +3570,13 @@ chknext: tind->index = SML_JSON_ENABLE; goto exit_settable; } - if (!strncmp(vname, "smld(", 5)) { + if (!strncmp(lp, "smld(", 5)) { lp = GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); if (fvar < 1) fvar = 1; SML_Decode(fvar - 1); goto nfuncexit; } - if (!strncmp(vname, "smlv[", 5)) { + if (!strncmp(lp, "smlv[", 5)) { lp = GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); fvar = sml_getv(fvar); goto nfuncexit; @@ -3431,7 +3584,7 @@ chknext: #endif //USE_SML_M #ifdef USE_SCRIPT_SERIAL - if (!strncmp(vname, "so(", 3)) { + if (!strncmp(lp, "so(", 3)) { float rxpin, txpin, br; lp = GetNumericArgument(lp + 3, OPER_EQU, &rxpin, gv); SCRIPT_SKIP_SPACES @@ -3490,7 +3643,7 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "sw(", 3)) { + if (!strncmp(lp, "sw(", 3)) { char str[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp + 3, OPER_EQU, str, 0); fvar = -1; @@ -3500,7 +3653,7 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "swb(", 4)) { + if (!strncmp(lp, "swb(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, 0); fvar = -1; if (glob_script_mem.sp) { @@ -3509,14 +3662,14 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "sa(", 3)) { + if (!strncmp(lp, "sa(", 3)) { fvar = -1; if (glob_script_mem.sp) { fvar = glob_script_mem.sp->available(); } goto nfuncexit; } - if (!strncmp(vname, "srb(", 3)) { + if (!strncmp(lp, "srb(", 3)) { fvar = -1; if (glob_script_mem.sp) { fvar = glob_script_mem.sp->available(); @@ -3526,7 +3679,7 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "sp(", 3)) { + if (!strncmp(lp, "sp(", 3)) { fvar = -1; if (glob_script_mem.sp) { fvar = glob_script_mem.sp->available(); @@ -3536,7 +3689,7 @@ chknext: } goto nfuncexit; } - if (!strncmp(vname, "sr(", 3)) { + if (!strncmp(lp, "sr(", 3)) { uint16_t size = glob_script_mem.max_ssize; char str[size]; memset(str, 0, size); @@ -3569,7 +3722,7 @@ chknext: if (sp) strlcpy(sp, str, size); goto strexit;; } - if (!strncmp(vname, "sc(", 3)) { + if (!strncmp(lp, "sc(", 3)) { fvar = -1; if (Script_Close_Serial()) { fvar = 0; @@ -3607,25 +3760,25 @@ chknext: goto strexit; } #ifdef USE_SCRIPT_TIMER - if (!strncmp(vname, "ts1(", 4)) { + if (!strncmp(lp, "ts1(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); if (fvar<10) fvar = 10; Script_ticker1.attach_ms(fvar, Script_ticker1_end); goto nfuncexit; } - if (!strncmp(vname, "ts2(", 4)) { + if (!strncmp(lp, "ts2(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); if (fvar<10) fvar = 10; Script_ticker2.attach_ms(fvar, Script_ticker2_end); goto nfuncexit; } - if (!strncmp(vname, "ts3(", 4)) { + if (!strncmp(lp, "ts3(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); if (fvar<10) fvar = 10; Script_ticker3.attach_ms(fvar, Script_ticker3_end); goto nfuncexit; } - if (!strncmp(vname, "ts4(", 4)) { + if (!strncmp(lp, "ts4(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); if (fvar<10) fvar = 10; Script_ticker4.attach_ms(fvar, Script_ticker4_end); @@ -3635,8 +3788,8 @@ chknext: #ifdef USE_DISPLAY #ifdef USE_TOUCH_BUTTONS - if (!strncmp(vname, "tbut[", 5)) { - GetNumericArgument(vname + 5, OPER_EQU, &fvar, gv); + if (!strncmp(lp, "tbut[", 5)) { + GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); uint8_t index = fvar; if (index<1 || index>MAX_TOUCH_BUTTONS) index = 1; index--; @@ -3652,7 +3805,7 @@ chknext: #endif //USE_TOUCH_BUTTONS #endif //USE_DISPLAY #if 0 - if (!strncmp(vname, "test(", 5)) { + if (!strncmp(lp, "test(", 5)) { lp = GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); uint32_t cycles; uint64_t accu=0; @@ -3675,7 +3828,7 @@ chknext: #endif #ifdef USE_TIMERS - if (!strncmp(vname, "ttget(", 6)) { + if (!strncmp(lp, "ttget(", 6)) { lp = GetNumericArgument(lp + 6, OPER_EQU, &fvar, gv); SCRIPT_SKIP_SPACES uint8_t index = fvar; @@ -3686,6 +3839,27 @@ chknext: goto nfuncexit; } #endif + +#ifdef USE_FEXTRACT + if (!strncmp(lp, "tso(", 4)) { + char str[SCRIPT_MAXSSIZE]; + lp = GetStringArgument(lp + 4, OPER_EQU, str, 0); + fvar = -1; + SCRIPT_SKIP_SPACES + lp = GetNumericArgument(lp, OPER_EQU, &fvar, gv); + SCRIPT_SKIP_SPACES + uint8_t flg = 0; + if (*lp =='0') { + lp++; + flg = 1; + } + tso(str, fvar, flg); + if (sp) strlcpy(sp, str, glob_script_mem.max_ssize); + lp++; + len = 0; + goto strexit; + } +#endif break; case 'u': if (!strncmp(vname, "uptime", 6)) { @@ -3696,11 +3870,11 @@ chknext: fvar = TasmotaGlobal.uptime; goto exit; } - if (!strncmp(vname, "upd[", 4)) { + if (!strncmp(lp, "upd[", 4)) { // var was updated struct T_INDEX ind; uint8_t vtype; - isvar(vname + 4, &vtype, &ind, 0, 0, gv); + isvar(lp + 4, &vtype, &ind, 0, 0, gv); if (!ind.bits.constant) { if (!ind.bits.changed) { fvar = 0; @@ -3719,7 +3893,7 @@ chknext: case 'w': #if defined(ESP32) && defined(USE_WEBCAM) - if (!strncmp(vname, "wc(", 3)) { + if (!strncmp(lp, "wc(", 3)) { float fvar1; lp = GetNumericArgument(lp + 3, OPER_EQU, &fvar1, gv); SCRIPT_SKIP_SPACES @@ -3787,7 +3961,7 @@ chknext: } #endif // USE_TTGO_WATCH #if defined(USE_FT5206) || defined(USE_XPT2046) || defined(USE_LILYGO47) || defined(USE_M5EPD47) - if (!strncmp(vname, "wtch(", 5)) { + if (!strncmp(lp, "wtch(", 5)) { lp = GetNumericArgument(lp + 5, OPER_EQU, &fvar, gv); fvar = Touch_Status(fvar); goto nfuncexit; @@ -4012,9 +4186,10 @@ char *GetStringArgument(char *lp, uint8_t lastop, char *cp, struct GVARS *gv) { char *slp; struct T_INDEX ind; char str[SCRIPT_MAXSSIZE],str1[SCRIPT_MAXSSIZE]; + while (*lp == ' ') { lp++; } // skip leading spaces while (1) { - lp=isvar(lp, &vtype, &ind, 0, str1, gv); - if (vtype!=STR_RES && !(vtype & STYPE)) { + lp = isvar(lp, &vtype, &ind, 0, str1, gv); + if (vtype != STR_RES && !(vtype & STYPE)) { // numeric type glob_script_mem.glob_error = 1; return lp; @@ -4057,6 +4232,7 @@ uint8_t operand = 0; float fvar1,fvar; char *slp; uint8_t vtype; +while (*lp == ' ') { lp++; } // skip leading spaces struct T_INDEX ind; while (1) { // get 1. value @@ -7246,7 +7422,7 @@ const char SCRIPT_MSG_CHKBOX[] PROGMEM = "
"; const char SCRIPT_MSG_PULLDOWNa[] PROGMEM = - "
"; const char SCRIPT_MSG_PULLDOWNb[] PROGMEM = ""; const char SCRIPT_MSG_PULLDOWNc[] PROGMEM = @@ -7255,6 +7431,10 @@ const char SCRIPT_MSG_PULLDOWNc[] PROGMEM = const char SCRIPT_MSG_TEXTINP[] PROGMEM = "
"; +const char SCRIPT_MSG_TEXTINP_U[] PROGMEM = + "
"; + + const char SCRIPT_MSG_NUMINP[] PROGMEM = "
"; @@ -7502,6 +7682,21 @@ void ScriptWebShow(char mc) { optflg = 0; } // check for input elements + // prescan for html tags + /* + restart: + //if (*lp == 0 || *lp == SCRIPT_EOL) + if (*lin == '<') { + char *cp = strchr(lin, '>'); + if (cp) { + char svd = *(cp + 1); + *(cp + 1) = 0; + WSContentSend_PD("%s", lin); + *(cp + 1) = svd; + lin = cp + 1; + } + }*/ + if (!strncmp(lin, "sl(", 3)) { // insert slider sl(min max var left mid right) char *lp = lin; @@ -7576,6 +7771,28 @@ void ScriptWebShow(char mc) { while (*lp) { SCRIPT_SKIP_SPACES lp = GetStringArgument(lp, OPER_EQU, pulabel, 0); + if (index == 1 && pulabel[0] == '#') { + // number range + char *cp = &pulabel[1]; + uint8_t from = strtol(cp, &cp, 10); + uint8_t to = from; + if (*cp == '-') { + cp++; + to = strtol(cp, &cp, 10); + } + for (uint32_t cnt = from; cnt <= to; cnt++) { + sprintf(pulabel, "%d", cnt); + if (val == index) { + cp = (char*)"selected"; + } else { + cp = (char*)""; + } + WSContentSend_PD(SCRIPT_MSG_PULLDOWNb, cp, index, pulabel); + index++; + } + break; + } + char *cp; if (val == index) { cp = (char*)"selected"; @@ -7654,11 +7871,26 @@ void ScriptWebShow(char mc) { SCRIPT_SKIP_SPACES char label[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp, OPER_EQU, label, 0); - char vname[16]; ScriptGetVarname(vname, slp, sizeof(vname)); - - WSContentSend_PD(SCRIPT_MSG_TEXTINP, label, str, vname); + SCRIPT_SKIP_SPACES + if (*lp != ')') { + char type[SCRIPT_MAXSSIZE]; + lp = GetStringArgument(lp, OPER_EQU, type, 0); + SCRIPT_SKIP_SPACES + // also requires min max values + char min[SCRIPT_MAXSSIZE]; + lp = GetStringArgument(lp, OPER_EQU, min, 0); + SCRIPT_SKIP_SPACES + char max[SCRIPT_MAXSSIZE]; + lp = GetStringArgument(lp, OPER_EQU, max, 0); + SCRIPT_SKIP_SPACES + WSContentSend_PD(SCRIPT_MSG_TEXTINP_U, label, type, str, min, max, vname); + } else { + WSContentSend_PD(SCRIPT_MSG_TEXTINP, label, str, vname); + } + lp++; + //goto restart; } else if (!strncmp(lin, "nm(", 3)) { char *lp = lin; @@ -8210,11 +8442,17 @@ int32_t url2file(uint8_t fref, char *url) { WiFiClient http_client; HTTPClient http; int32_t httpCode = 0; - char hbuff[128]; - strcpy(hbuff, "http://"); - strcat(hbuff, url); - http.begin(http_client, UrlEncode(hbuff)); - httpCode = http.GET(); + String weburl = "http://"+UrlEncode(url); + for (uint32_t retry = 0; retry < 15; retry++) { + http.begin(http_client, weburl); + httpCode = http.GET(); + if (httpCode > 0) { + break; + } + } + if (httpCode < 0) { + AddLog(LOG_LEVEL_INFO,PSTR("HTTP error %d = %s"), httpCode, http.errorToString(httpCode).c_str()); + } if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) { WiFiClient *stream = http.getStreamPtr(); int32_t len = http.getSize(); From c152838e25e7535ac0baf14fbef601308738d7ca Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Wed, 15 Dec 2021 23:32:49 +0100 Subject: [PATCH 89/97] Berry yet another fix 2 --- lib/libesp32/berry/generate/be_const_strtab.h | 1 - .../berry/generate/be_const_strtab_def.h | 1804 ++++++++--------- .../berry/generate/be_fixed_be_class_map.h | 24 +- lib/libesp32/berry/src/be_byteslib.c | 138 +- lib/libesp32/berry/src/be_constobj.h | 16 - lib/libesp32/berry/src/be_gc.c | 4 + lib/libesp32/berry/src/be_maplib.c | 60 - lib/libesp32/berry/src/be_solidifylib.c | 30 +- 8 files changed, 1005 insertions(+), 1072 deletions(-) diff --git a/lib/libesp32/berry/generate/be_const_strtab.h b/lib/libesp32/berry/generate/be_const_strtab.h index 50198eb8f..0635eefc5 100644 --- a/lib/libesp32/berry/generate/be_const_strtab.h +++ b/lib/libesp32/berry/generate/be_const_strtab.h @@ -554,7 +554,6 @@ extern const bcstring be_const_str_readline; extern const bcstring be_const_str_real; extern const bcstring be_const_str_reapply; extern const bcstring be_const_str_redirect; -extern const bcstring be_const_str_reduce; extern const bcstring be_const_str_refr_size; extern const bcstring be_const_str_register_obj; extern const bcstring be_const_str_remove; diff --git a/lib/libesp32/berry/generate/be_const_strtab_def.h b/lib/libesp32/berry/generate/be_const_strtab_def.h index 4c195c96b..9cfcd09bc 100644 --- a/lib/libesp32/berry/generate/be_const_strtab_def.h +++ b/lib/libesp32/berry/generate/be_const_strtab_def.h @@ -1,696 +1,695 @@ -be_define_const_str(, "", 2166136261u, 0, 0, NULL); -be_define_const_str(_X0A, "\n", 252472541u, 0, 1, &be_const_str_Unknown_X20command); -be_define_const_str(_X20, " ", 621580159u, 0, 1, &be_const_str_geti); -be_define_const_str(_X21_X3D, "!=", 2428715011u, 0, 2, &be_const_str_asstring); -be_define_const_str(_X21_X3D_X3D, "!==", 559817114u, 0, 3, &be_const_str_type); -be_define_const_str(_X23, "#", 638357778u, 0, 1, &be_const_str_CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found); -be_define_const_str(_X23autoexec_X2Ebat, "#autoexec.bat", 3382890497u, 0, 13, &be_const_str_arg_size); -be_define_const_str(_X23autoexec_X2Ebe, "#autoexec.be", 1181757091u, 0, 12, &be_const_str_file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27); -be_define_const_str(_X23display_X2Eini, "#display.ini", 182218220u, 0, 12, &be_const_str___lower__); -be_define_const_str(_X23init_X2Ebat, "#init.bat", 3297595077u, 0, 9, &be_const_str_SERIAL_7O2); -be_define_const_str(_X23preinit_X2Ebe, "#preinit.be", 687035716u, 0, 11, &be_const_str_SERIAL_8O2); -be_define_const_str(_X2502d_X25s_X2502d, "%02d%s%02d", 1587999717u, 0, 10, &be_const_str_yield); -be_define_const_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, "%04d-%02d-%02dT%02d:%02d:%02d", 3425528601u, 0, 29, &be_const_str__global_def); -be_define_const_str(_X25s_X2Eautoconf, "%s.autoconf", 3560383524u, 0, 11, &be_const_str_every_second); -be_define_const_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, "<Error: apply new or remove>", 2855507949u, 0, 34, &be_const_str_add_driver); -be_define_const_str(_X26lt_X3BNone_X26gt_X3B, "<None>", 2602165498u, 0, 12, &be_const_str_rand); -be_define_const_str(_X28_X29, "()", 685372826u, 0, 2, &be_const_str__X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29); -be_define_const_str(_X2B, "+", 772578730u, 0, 1, &be_const_str_gpio); -be_define_const_str(_X2C, ",", 688690635u, 0, 1, &be_const_str_add_cmd); -be_define_const_str(_X2D_X2D_X3A_X2D_X2D, "--:--", 1370615441u, 0, 5, &be_const_str_AudioOutputI2S); -be_define_const_str(_X2E, ".", 722245873u, 0, 1, NULL); -be_define_const_str(_X2E_X2E, "..", 2748622605u, 0, 2, &be_const_str__X2Ep2); +be_define_const_str(, "", 2166136261u, 0, 0, &be_const_str_AudioFileSourceFS); +be_define_const_str(_X0A, "\n", 252472541u, 0, 1, &be_const_str_file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27); +be_define_const_str(_X20, " ", 621580159u, 0, 1, &be_const_str_gen_cb); +be_define_const_str(_X21_X3D, "!=", 2428715011u, 0, 2, &be_const_str__X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E); +be_define_const_str(_X21_X3D_X3D, "!==", 559817114u, 0, 3, &be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E); +be_define_const_str(_X23, "#", 638357778u, 0, 1, &be_const_str_refr_size); +be_define_const_str(_X23autoexec_X2Ebat, "#autoexec.bat", 3382890497u, 0, 13, &be_const_str_get_option); +be_define_const_str(_X23autoexec_X2Ebe, "#autoexec.be", 1181757091u, 0, 12, &be_const_str_every_second); +be_define_const_str(_X23display_X2Eini, "#display.ini", 182218220u, 0, 12, &be_const_str__X3Cp_X3E_X3Csmall_X3E_X26nbsp_X3B_X28This_X20feature_X20requires_X20an_X20internet_X20connection_X29_X3C_X2Fsmall_X3E_X3C_X2Fp_X3E); +be_define_const_str(_X23init_X2Ebat, "#init.bat", 3297595077u, 0, 9, &be_const_str_real); +be_define_const_str(_X23preinit_X2Ebe, "#preinit.be", 687035716u, 0, 11, &be_const_str_publish_result); +be_define_const_str(_X2502d_X25s_X2502d, "%02d%s%02d", 1587999717u, 0, 10, &be_const_str_last_modified); +be_define_const_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, "%04d-%02d-%02dT%02d:%02d:%02d", 3425528601u, 0, 29, &be_const_str__write); +be_define_const_str(_X25s_X2Eautoconf, "%s.autoconf", 3560383524u, 0, 11, &be_const_str_format); +be_define_const_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, "<Error: apply new or remove>", 2855507949u, 0, 34, &be_const_str___upper__); +be_define_const_str(_X26lt_X3BNone_X26gt_X3B, "<None>", 2602165498u, 0, 12, &be_const_str_SERIAL_7E2); +be_define_const_str(_X28_X29, "()", 685372826u, 0, 2, &be_const_str_get_alternate); +be_define_const_str(_X2B, "+", 772578730u, 0, 1, &be_const_str_area); +be_define_const_str(_X2C, ",", 688690635u, 0, 1, NULL); +be_define_const_str(_X2D_X2D_X3A_X2D_X2D, "--:--", 1370615441u, 0, 5, &be_const_str__X2F_X2Eautoconf); +be_define_const_str(_X2E, ".", 722245873u, 0, 1, &be_const_str__ccmd); +be_define_const_str(_X2E_X2E, "..", 2748622605u, 0, 2, NULL); be_define_const_str(_X2Eautoconf, ".autoconf", 2524679088u, 0, 9, NULL); -be_define_const_str(_X2Ebe, ".be", 1325797348u, 0, 3, &be_const_str_sinh); -be_define_const_str(_X2Ebec, ".bec", 3985273221u, 0, 4, &be_const_str__debug_present); -be_define_const_str(_X2Elen, ".len", 850842136u, 0, 4, NULL); -be_define_const_str(_X2Ep, ".p", 1171526419u, 0, 2, &be_const_str_COLOR_WHITE); -be_define_const_str(_X2Ep1, ".p1", 249175686u, 0, 3, &be_const_str_sin); -be_define_const_str(_X2Ep2, ".p2", 232398067u, 0, 3, &be_const_str_json_fdump_map); -be_define_const_str(_X2Esize, ".size", 1965188224u, 0, 5, &be_const_str__X2Fac); -be_define_const_str(_X2Etapp, ".tapp", 1363391594u, 0, 5, NULL); -be_define_const_str(_X2Ew, ".w", 1255414514u, 0, 2, &be_const_str_member); -be_define_const_str(_X2F, "/", 705468254u, 0, 1, &be_const_str_None); -be_define_const_str(_X2F_X2Eautoconf, "/.autoconf", 2212074393u, 0, 10, &be_const_str_set_dc_voltage); -be_define_const_str(_X2F_X3Frst_X3D, "/?rst=", 580074707u, 0, 6, &be_const_str_AES_GCM); -be_define_const_str(_X2Fac, "/ac", 3904651978u, 0, 3, &be_const_str_get_current_module_path); -be_define_const_str(_X3A, ":", 1057798253u, 0, 1, &be_const_str_json_fdump); -be_define_const_str(_X3C, "<", 957132539u, 0, 1, NULL); -be_define_const_str(_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 3546571739u, 0, 11, &be_const_str_atan); +be_define_const_str(_X2Ebe, ".be", 1325797348u, 0, 3, &be_const_str_digital_read); +be_define_const_str(_X2Ebec, ".bec", 3985273221u, 0, 4, &be_const_str_CFG_X3A_X20loading_X20); +be_define_const_str(_X2Elen, ".len", 850842136u, 0, 4, &be_const_str_SERIAL_6N2); +be_define_const_str(_X2Ep, ".p", 1171526419u, 0, 2, &be_const_str_arg_name); +be_define_const_str(_X2Ep1, ".p1", 249175686u, 0, 3, &be_const_str_battery_present); +be_define_const_str(_X2Ep2, ".p2", 232398067u, 0, 3, &be_const_str_b); +be_define_const_str(_X2Esize, ".size", 1965188224u, 0, 5, &be_const_str_CFG_X3A_X20loaded_X20_X27_X25s_X27); +be_define_const_str(_X2Etapp, ".tapp", 1363391594u, 0, 5, &be_const_str_Parameter_X20error); +be_define_const_str(_X2Ew, ".w", 1255414514u, 0, 2, &be_const_str_running); +be_define_const_str(_X2F, "/", 705468254u, 0, 1, &be_const_str__class); +be_define_const_str(_X2F_X2Eautoconf, "/.autoconf", 2212074393u, 0, 10, &be_const_str_connect); +be_define_const_str(_X2F_X3Frst_X3D, "/?rst=", 580074707u, 0, 6, &be_const_str_content_stop); +be_define_const_str(_X2Fac, "/ac", 3904651978u, 0, 3, &be_const_str_ins_ramp); +be_define_const_str(_X3A, ":", 1057798253u, 0, 1, &be_const_str_get_string); +be_define_const_str(_X3C, "<", 957132539u, 0, 1, &be_const_str_set_bri); +be_define_const_str(_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 3546571739u, 0, 11, &be_const_str_remove); be_define_const_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 1863865923u, 0, 16, NULL); -be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, &be_const_str_HTTP_POST); -be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str_Wire); -be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, &be_const_str_color); -be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "
", 842307168u, 0, 77, &be_const_str_set_power); -be_define_const_str(_X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, "Choose a device configuration:
", 1336654704u, 0, 49, &be_const_str_bus); -be_define_const_str(_X3Clambda_X3E, "", 607256038u, 0, 8, &be_const_str_point); -be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Current auto-configuration", 4212500780u, 0, 82, &be_const_str_get_warning_level); -be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Select new auto-configuration", 1926223891u, 0, 80, &be_const_str_get_vbus_current); -be_define_const_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, "", 510303524u, 0, 30, &be_const_str_cb_event_closure); -be_define_const_str(_X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, "", 3994619755u, 0, 54, NULL); -be_define_const_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, "

Exception:
'%s'
%s

", 4252565082u, 0, 59, &be_const_str_arg); -be_define_const_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 2052843416u, 0, 25, &be_const_str_area); -be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 452285201u, 0, 120, NULL); -be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, "

 (This feature requires an internet connection)

", 2719266486u, 0, 74, &be_const_str_register_obj); -be_define_const_str(_X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, "

Current configuration:

%s

", 4115655761u, 0, 46, &be_const_str_get_cb_list); -be_define_const_str(_X3Cselect_X20name_X3D_X27zip_X27_X3E, "", 4247924536u, 0, 19, &be_const_str_RES_OK); +be_define_const_str(_X3D, "=", 940354920u, 0, 1, &be_const_str_AudioFileSource); +be_define_const_str(_X3D_X3C_X3E_X21, "=<>!", 2664470277u, 0, 4, &be_const_str_ctypes_bytes_dyn); +be_define_const_str(_X3D_X3D, "==", 2431966415u, 0, 2, &be_const_str_CFG_X3A_X20removed_X20file_X20_X27_X25s_X27); +be_define_const_str(_X3E, ">", 990687777u, 0, 1, NULL); +be_define_const_str(_X3E_X3D, ">=", 284975636u, 0, 2, NULL); +be_define_const_str(_X3F, "?", 973910158u, 0, 1, &be_const_str_SERIAL_5N1); +be_define_const_str(AES_GCM, "AES_GCM", 3832208678u, 0, 7, &be_const_str_cmd_res); +be_define_const_str(AXP192, "AXP192", 757230128u, 0, 6, &be_const_str_shared_key); +be_define_const_str(Animate_X20pc_X20is_X20out_X20of_X20range, "Animate pc is out of range", 1854929421u, 0, 26, &be_const_str_add_driver); +be_define_const_str(AudioFileSource, "AudioFileSource", 2959980058u, 0, 15, &be_const_str__timers); +be_define_const_str(AudioFileSourceFS, "AudioFileSourceFS", 1839147653u, 0, 17, &be_const_str_MD5); +be_define_const_str(AudioGenerator, "AudioGenerator", 1839297342u, 0, 14, &be_const_str_BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s); +be_define_const_str(AudioGeneratorMP3, "AudioGeneratorMP3", 2199818488u, 0, 17, NULL); +be_define_const_str(AudioGeneratorWAV, "AudioGeneratorWAV", 2746509368u, 0, 17, &be_const_str_add); +be_define_const_str(AudioOutput, "AudioOutput", 3257792048u, 0, 11, &be_const_str_no_X20GPIO_X20specified_X20for_X20neopixelbus); +be_define_const_str(AudioOutputI2S, "AudioOutputI2S", 638031784u, 0, 14, &be_const_str_codedump); +be_define_const_str(Auto_X2Dconfiguration, "Auto-configuration", 1665006109u, 0, 18, &be_const_str_fromptr); +be_define_const_str(BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, "BRY: ERROR, bad json: ", 2715135809u, 0, 22, &be_const_str_hs2rgb); +be_define_const_str(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "BRY: Exception> '%s' - %s", 2246990964u, 0, 25, &be_const_str_animate); +be_define_const_str(BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29, "BRY: could not save compiled file %s (%s)", 736659787u, 0, 41, &be_const_str_True); +be_define_const_str(BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, "BRY: failed to load _persist.json", 2991913445u, 0, 33, NULL); +be_define_const_str(BUTTON_CONFIGURATION, "BUTTON_CONFIGURATION", 70820856u, 0, 20, &be_const_str_tob64); +be_define_const_str(CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting, "CFG: 'init.bat' done, restarting", 1569670677u, 0, 32, &be_const_str_get_object_from_ptr); +be_define_const_str(CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, "CFG: Exception> '%s' - %s", 1228874553u, 0, 25, &be_const_str_concat); +be_define_const_str(CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29, "CFG: could not run %s (%s - %s)", 1428829580u, 0, 31, NULL); +be_define_const_str(CFG_X3A_X20downloading_X20_X27_X25s_X27, "CFG: downloading '%s'", 589480701u, 0, 21, &be_const_str_LVG_X3A_X20call_X20to_X20unsupported_X20callback); +be_define_const_str(CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27, "CFG: exception '%s' - '%s'", 4095407913u, 0, 26, &be_const_str_get_free_heap); +be_define_const_str(CFG_X3A_X20loaded_X20_X20, "CFG: loaded ", 3710273538u, 0, 13, &be_const_str_rtc); +be_define_const_str(CFG_X3A_X20loaded_X20_X27_X25s_X27, "CFG: loaded '%s'", 1699028828u, 0, 16, NULL); +be_define_const_str(CFG_X3A_X20loading_X20, "CFG: loading ", 4010361503u, 0, 13, &be_const_str_set_height); +be_define_const_str(CFG_X3A_X20loading_X20_X27_X25s_X27, "CFG: loading '%s'", 2285306097u, 0, 17, &be_const_str_SERIAL_6N1); +be_define_const_str(CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29, "CFG: multiple autoconf files found, aborting ('%s' + '%s')", 197663371u, 0, 58, NULL); +be_define_const_str(CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found, "CFG: no '*.autoconf' file found", 127493957u, 0, 31, &be_const_str_get_style_bg_color); +be_define_const_str(CFG_X3A_X20ran_X20_X20, "CFG: ran ", 3579570472u, 0, 10, &be_const_str_resp_cmnd_str); +be_define_const_str(CFG_X3A_X20removed_X20file_X20_X27_X25s_X27, "CFG: removed file '%s'", 2048602473u, 0, 22, &be_const_str_millis); +be_define_const_str(CFG_X3A_X20removing_X20autoconf_X20files, "CFG: removing autoconf files", 4014704970u, 0, 28, &be_const_str__anonymous_); +be_define_const_str(CFG_X3A_X20removing_X20first_X20time_X20marker, "CFG: removing first time marker", 2125556683u, 0, 31, &be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E); +be_define_const_str(CFG_X3A_X20return_code_X3D_X25i, "CFG: return_code=%i", 2059897320u, 0, 19, &be_const_str_group_def); +be_define_const_str(CFG_X3A_X20running_X20, "CFG: running ", 2478334534u, 0, 13, NULL); +be_define_const_str(CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, "CFG: skipping 'display.ini' because already present in file-system", 3965549264u, 0, 66, NULL); +be_define_const_str(COLOR_BLACK, "COLOR_BLACK", 264427940u, 0, 11, &be_const_str_set_percentage); +be_define_const_str(COLOR_WHITE, "COLOR_WHITE", 2536871270u, 0, 11, NULL); +be_define_const_str(EC_C25519, "EC_C25519", 95492591u, 0, 9, &be_const_str__debug_present); +be_define_const_str(EVENT_DRAW_MAIN, "EVENT_DRAW_MAIN", 1955620614u, 0, 15, NULL); +be_define_const_str(EVENT_DRAW_PART_BEGIN, "EVENT_DRAW_PART_BEGIN", 3391865024u, 0, 21, &be_const_str__ptr); +be_define_const_str(EVENT_DRAW_PART_END, "EVENT_DRAW_PART_END", 3301625292u, 0, 19, NULL); +be_define_const_str(False, "False", 2541049336u, 0, 5, &be_const_str_attrdump); +be_define_const_str(GET, "GET", 2531704439u, 0, 3, &be_const_str_content_flush); +be_define_const_str(HTTP_GET, "HTTP_GET", 1722467738u, 0, 8, &be_const_str_rad); +be_define_const_str(HTTP_POST, "HTTP_POST", 1999554144u, 0, 9, NULL); +be_define_const_str(I2C_X3A, "I2C:", 813483371u, 0, 4, &be_const_str_push_path); +be_define_const_str(I2C_Driver, "I2C_Driver", 1714501658u, 0, 10, NULL); +be_define_const_str(LVG_X3A_X20call_X20to_X20unsupported_X20callback, "LVG: call to unsupported callback", 504176819u, 0, 33, NULL); +be_define_const_str(Leds, "Leds", 2709245275u, 0, 4, &be_const_str_byte); +be_define_const_str(MD5, "MD5", 1935726387u, 0, 3, &be_const_str_atan2); +be_define_const_str(None, "None", 810547195u, 0, 4, &be_const_str_SERIAL_8E2); +be_define_const_str(OPTION_A, "OPTION_A", 1133299440u, 0, 8, &be_const_str_SERIAL_6O1); +be_define_const_str(OneWire, "OneWire", 2298990722u, 0, 7, &be_const_str_get_cb_list); +be_define_const_str(PART_MAIN, "PART_MAIN", 2473491508u, 0, 9, NULL); +be_define_const_str(POST, "POST", 1929554311u, 0, 4, &be_const_str_deregister_obj); +be_define_const_str(Parameter_X20error, "Parameter error", 3840042038u, 0, 15, &be_const_str_connection_error); +be_define_const_str(RES_OK, "RES_OK", 1233817284u, 0, 6, &be_const_str_SERIAL_5O2); +be_define_const_str(Restart_X201, "Restart 1", 3504455855u, 0, 9, NULL); +be_define_const_str(SERIAL_5E1, "SERIAL_5E1", 1163775235u, 0, 10, &be_const_str_get_size); +be_define_const_str(SERIAL_5E2, "SERIAL_5E2", 1180552854u, 0, 10, &be_const_str_available); +be_define_const_str(SERIAL_5N1, "SERIAL_5N1", 3313031680u, 0, 10, &be_const_str_deinit); +be_define_const_str(SERIAL_5N2, "SERIAL_5N2", 3363364537u, 0, 10, &be_const_str_zero); +be_define_const_str(SERIAL_5O1, "SERIAL_5O1", 3782657917u, 0, 10, &be_const_str_SERIAL_8O2); +be_define_const_str(SERIAL_5O2, "SERIAL_5O2", 3732325060u, 0, 10, &be_const_str_calldepth); +be_define_const_str(SERIAL_6E1, "SERIAL_6E1", 334249486u, 0, 10, &be_const_str_public_key); +be_define_const_str(SERIAL_6E2, "SERIAL_6E2", 317471867u, 0, 10, &be_const_str_SK6812_GRBW); +be_define_const_str(SERIAL_6N1, "SERIAL_6N1", 198895701u, 0, 10, &be_const_str_push); +be_define_const_str(SERIAL_6N2, "SERIAL_6N2", 148562844u, 0, 10, &be_const_str_check_privileged_access); +be_define_const_str(SERIAL_6O1, "SERIAL_6O1", 266153272u, 0, 10, &be_const_str__X5B); +be_define_const_str(SERIAL_6O2, "SERIAL_6O2", 316486129u, 0, 10, &be_const_str_widget_instance_size); +be_define_const_str(SERIAL_7E1, "SERIAL_7E1", 147718061u, 0, 10, NULL); +be_define_const_str(SERIAL_7E2, "SERIAL_7E2", 97385204u, 0, 10, &be_const_str__energy); +be_define_const_str(SERIAL_7N1, "SERIAL_7N1", 1891060246u, 0, 10, &be_const_str__X7D); +be_define_const_str(SERIAL_7N2, "SERIAL_7N2", 1874282627u, 0, 10, &be_const_str_draw_line_dsc); be_define_const_str(SERIAL_7O1, "SERIAL_7O1", 1823802675u, 0, 10, NULL); -be_define_const_str(SERIAL_7O2, "SERIAL_7O2", 1840580294u, 0, 10, &be_const_str_arch); -be_define_const_str(SERIAL_8E1, "SERIAL_8E1", 2371121616u, 0, 10, &be_const_str__available); -be_define_const_str(SERIAL_8E2, "SERIAL_8E2", 2421454473u, 0, 10, NULL); -be_define_const_str(SERIAL_8N1, "SERIAL_8N1", 2369297235u, 0, 10, &be_const_str_imin); -be_define_const_str(SERIAL_8N2, "SERIAL_8N2", 2386074854u, 0, 10, &be_const_str_gen_cb); -be_define_const_str(SERIAL_8O1, "SERIAL_8O1", 289122742u, 0, 10, &be_const_str_return_X20code_X3D_X25i); -be_define_const_str(SERIAL_8O2, "SERIAL_8O2", 272345123u, 0, 10, &be_const_str_tag); -be_define_const_str(SK6812_GRBW, "SK6812_GRBW", 81157857u, 0, 11, &be_const_str_item); -be_define_const_str(STATE_DEFAULT, "STATE_DEFAULT", 712406428u, 0, 13, &be_const_str_pop); -be_define_const_str(TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, "TAP: found Tasmota App '%s'", 2643152398u, 0, 27, &be_const_str_closure); -be_define_const_str(Tasmota, "Tasmota", 4047617668u, 0, 7, &be_const_str_dump); -be_define_const_str(Tele, "Tele", 1329980653u, 0, 4, &be_const_str_f); -be_define_const_str(Timer, "Timer", 3948127682u, 0, 5, &be_const_str_check_privileged_access); -be_define_const_str(True, "True", 3453902341u, 0, 4, &be_const_str_hs2rgb); -be_define_const_str(Unknown_X20command, "Unknown command", 1830905432u, 0, 15, &be_const_str_map); -be_define_const_str(WS2812, "WS2812", 3539741218u, 0, 6, NULL); +be_define_const_str(SERIAL_7O2, "SERIAL_7O2", 1840580294u, 0, 10, &be_const_str_SERIAL_8E1); +be_define_const_str(SERIAL_8E1, "SERIAL_8E1", 2371121616u, 0, 10, &be_const_str_files); +be_define_const_str(SERIAL_8E2, "SERIAL_8E2", 2421454473u, 0, 10, &be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf); +be_define_const_str(SERIAL_8N1, "SERIAL_8N1", 2369297235u, 0, 10, &be_const_str_load_templates); +be_define_const_str(SERIAL_8N2, "SERIAL_8N2", 2386074854u, 0, 10, NULL); +be_define_const_str(SERIAL_8O1, "SERIAL_8O1", 289122742u, 0, 10, &be_const_str_exec_rules); +be_define_const_str(SERIAL_8O2, "SERIAL_8O2", 272345123u, 0, 10, &be_const_str_ctypes_bytes); +be_define_const_str(SK6812_GRBW, "SK6812_GRBW", 81157857u, 0, 11, &be_const_str_add_rule); +be_define_const_str(STATE_DEFAULT, "STATE_DEFAULT", 712406428u, 0, 13, &be_const_str__request_from); +be_define_const_str(TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, "TAP: found Tasmota App '%s'", 2643152398u, 0, 27, &be_const_str_draw_arc); +be_define_const_str(Tasmota, "Tasmota", 4047617668u, 0, 7, NULL); +be_define_const_str(Tele, "Tele", 1329980653u, 0, 4, &be_const_str_abs); +be_define_const_str(Timer, "Timer", 3948127682u, 0, 5, &be_const_str__t); +be_define_const_str(True, "True", 3453902341u, 0, 4, &be_const_str__filename); +be_define_const_str(Unknown_X20command, "Unknown command", 1830905432u, 0, 15, &be_const_str_var); +be_define_const_str(WS2812, "WS2812", 3539741218u, 0, 6, &be_const_str_addr); be_define_const_str(WS2812_GRB, "WS2812_GRB", 1736405692u, 0, 10, NULL); -be_define_const_str(Wire, "Wire", 1938276536u, 0, 4, NULL); -be_define_const_str(_X5B, "[", 3725336506u, 0, 1, &be_const_str_get_object_from_ptr); -be_define_const_str(_X5D, "]", 3624670792u, 0, 1, &be_const_str_x1); -be_define_const_str(_, "_", 3658226030u, 0, 1, &be_const_str_widget_struct_by_class); -be_define_const_str(__iterator__, "__iterator__", 3884039703u, 0, 12, &be_const_str_asin); -be_define_const_str(__lower__, "__lower__", 123855590u, 0, 9, &be_const_str_public_key); -be_define_const_str(__upper__, "__upper__", 3612202883u, 0, 9, &be_const_str_class_init_obj); -be_define_const_str(_anonymous_, "_anonymous_", 1957281476u, 0, 11, &be_const_str_matrix); -be_define_const_str(_archive, "_archive", 4004559404u, 0, 8, &be_const_str_isrunning); -be_define_const_str(_available, "_available", 1306196581u, 0, 10, &be_const_str_setitem); -be_define_const_str(_begin_transmission, "_begin_transmission", 2779461176u, 0, 19, NULL); -be_define_const_str(_buffer, "_buffer", 2044888568u, 0, 7, &be_const_str_seti); -be_define_const_str(_ccmd, "_ccmd", 2163421413u, 0, 5, &be_const_str_enabled); -be_define_const_str(_class, "_class", 2732146350u, 0, 6, &be_const_str__dirty); -be_define_const_str(_cmd, "_cmd", 3419822142u, 0, 4, &be_const_str_nan); +be_define_const_str(Wire, "Wire", 1938276536u, 0, 4, &be_const_str_get_style_line_color); +be_define_const_str(_X5B, "[", 3725336506u, 0, 1, &be_const_str_counters); +be_define_const_str(_X5D, "]", 3624670792u, 0, 1, &be_const_str_imin); +be_define_const_str(_, "_", 3658226030u, 0, 1, &be_const_str_add_anim); +be_define_const_str(__iterator__, "__iterator__", 3884039703u, 0, 12, &be_const_str_open); +be_define_const_str(__lower__, "__lower__", 123855590u, 0, 9, &be_const_str__X7B); +be_define_const_str(__upper__, "__upper__", 3612202883u, 0, 9, NULL); +be_define_const_str(_anonymous_, "_anonymous_", 1957281476u, 0, 11, &be_const_str_get_vbus_current); +be_define_const_str(_archive, "_archive", 4004559404u, 0, 8, NULL); +be_define_const_str(_available, "_available", 1306196581u, 0, 10, &be_const_str_persist); +be_define_const_str(_begin_transmission, "_begin_transmission", 2779461176u, 0, 19, &be_const_str_kv); +be_define_const_str(_buffer, "_buffer", 2044888568u, 0, 7, &be_const_str_draw_line_dsc_init); +be_define_const_str(_ccmd, "_ccmd", 2163421413u, 0, 5, &be_const_str_read); +be_define_const_str(_class, "_class", 2732146350u, 0, 6, &be_const_str_webserver); +be_define_const_str(_cmd, "_cmd", 3419822142u, 0, 4, &be_const_str_super); be_define_const_str(_debug_present, "_debug_present", 4063411725u, 0, 14, NULL); -be_define_const_str(_def, "_def", 1985022181u, 0, 4, NULL); -be_define_const_str(_dirty, "_dirty", 283846766u, 0, 6, &be_const_str_content_start); -be_define_const_str(_drivers, "_drivers", 3260328985u, 0, 8, &be_const_str_del); -be_define_const_str(_end_transmission, "_end_transmission", 3237480400u, 0, 17, &be_const_str_math); -be_define_const_str(_energy, "_energy", 535372070u, 0, 7, &be_const_str_reduce); -be_define_const_str(_error, "_error", 1132109656u, 0, 6, NULL); -be_define_const_str(_filename, "_filename", 1430813195u, 0, 9, NULL); -be_define_const_str(_global_addr, "_global_addr", 533766721u, 0, 12, &be_const_str_add_rule); -be_define_const_str(_global_def, "_global_def", 646007001u, 0, 11, &be_const_str_destructor_cb); +be_define_const_str(_def, "_def", 1985022181u, 0, 4, &be_const_str_arch); +be_define_const_str(_dirty, "_dirty", 283846766u, 0, 6, &be_const_str_asstring); +be_define_const_str(_drivers, "_drivers", 3260328985u, 0, 8, NULL); +be_define_const_str(_end_transmission, "_end_transmission", 3237480400u, 0, 17, &be_const_str_begin); +be_define_const_str(_energy, "_energy", 535372070u, 0, 7, &be_const_str_color); +be_define_const_str(_error, "_error", 1132109656u, 0, 6, &be_const_str_is_first_time); +be_define_const_str(_filename, "_filename", 1430813195u, 0, 9, &be_const_str_create_segment); +be_define_const_str(_global_addr, "_global_addr", 533766721u, 0, 12, &be_const_str_list); +be_define_const_str(_global_def, "_global_def", 646007001u, 0, 11, &be_const_str_editable); be_define_const_str(_lvgl, "_lvgl", 2689219483u, 0, 5, NULL); -be_define_const_str(_p, "_p", 1594591802u, 0, 2, &be_const_str_scan); +be_define_const_str(_p, "_p", 1594591802u, 0, 2, &be_const_str_is_dirty); be_define_const_str(_persist_X2Ejson, "_persist.json", 2008425138u, 0, 13, NULL); -be_define_const_str(_ptr, "_ptr", 306235816u, 0, 4, NULL); -be_define_const_str(_read, "_read", 346717030u, 0, 5, &be_const_str_calldepth); -be_define_const_str(_request_from, "_request_from", 3965148604u, 0, 13, &be_const_str_set_x); -be_define_const_str(_rules, "_rules", 4266217105u, 0, 6, NULL); -be_define_const_str(_settings_def, "_settings_def", 3775560307u, 0, 13, &be_const_str_offseta); -be_define_const_str(_settings_ptr, "_settings_ptr", 1825772182u, 0, 13, &be_const_str_event_send); -be_define_const_str(_t, "_t", 1527481326u, 0, 2, &be_const_str_resolvecmnd); -be_define_const_str(_timers, "_timers", 2600100916u, 0, 7, &be_const_str_add); -be_define_const_str(_write, "_write", 2215462825u, 0, 6, &be_const_str_read12); -be_define_const_str(a, "a", 3826002220u, 0, 1, &be_const_str_get_string); -be_define_const_str(abs, "abs", 709362235u, 0, 3, NULL); -be_define_const_str(acos, "acos", 1006755615u, 0, 4, &be_const_str_def); -be_define_const_str(add, "add", 993596020u, 0, 3, &be_const_str_zero); -be_define_const_str(add_anim, "add_anim", 3980662668u, 0, 8, &be_const_str_content_flush); +be_define_const_str(_ptr, "_ptr", 306235816u, 0, 4, &be_const_str_cb_obj); +be_define_const_str(_read, "_read", 346717030u, 0, 5, NULL); +be_define_const_str(_request_from, "_request_from", 3965148604u, 0, 13, NULL); +be_define_const_str(_rules, "_rules", 4266217105u, 0, 6, &be_const_str_map); +be_define_const_str(_settings_def, "_settings_def", 3775560307u, 0, 13, NULL); +be_define_const_str(_settings_ptr, "_settings_ptr", 1825772182u, 0, 13, &be_const_str_insert); +be_define_const_str(_t, "_t", 1527481326u, 0, 2, &be_const_str_k); +be_define_const_str(_timers, "_timers", 2600100916u, 0, 7, &be_const_str_reset); +be_define_const_str(_write, "_write", 2215462825u, 0, 6, &be_const_str_autorun); +be_define_const_str(a, "a", 3826002220u, 0, 1, NULL); +be_define_const_str(abs, "abs", 709362235u, 0, 3, &be_const_str_h); +be_define_const_str(acos, "acos", 1006755615u, 0, 4, &be_const_str_digital_write); +be_define_const_str(add, "add", 993596020u, 0, 3, &be_const_str_every_50ms); +be_define_const_str(add_anim, "add_anim", 3980662668u, 0, 8, &be_const_str_remove_cmd); be_define_const_str(add_cmd, "add_cmd", 3361630879u, 0, 7, NULL); -be_define_const_str(add_driver, "add_driver", 1654458371u, 0, 10, &be_const_str_atan2); -be_define_const_str(add_header, "add_header", 927130612u, 0, 10, &be_const_str_set_percentage); -be_define_const_str(add_rule, "add_rule", 596540743u, 0, 8, &be_const_str_call_native); -be_define_const_str(addr, "addr", 1087856498u, 0, 4, &be_const_str_create_matrix); -be_define_const_str(allocated, "allocated", 429986098u, 0, 9, &be_const_str_toptr); -be_define_const_str(alternate, "alternate", 1140253277u, 0, 9, NULL); -be_define_const_str(animate, "animate", 3885786800u, 0, 7, &be_const_str_function); -be_define_const_str(animators, "animators", 279858213u, 0, 9, &be_const_str_traceback); -be_define_const_str(arch, "arch", 2952804297u, 0, 4, NULL); -be_define_const_str(area, "area", 2601460036u, 0, 4, &be_const_str_find); -be_define_const_str(arg, "arg", 1047474471u, 0, 3, NULL); -be_define_const_str(arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj, "arg must be a subclass of lv_obj", 1641882079u, 0, 32, &be_const_str_as); -be_define_const_str(arg_name, "arg_name", 1345046155u, 0, 8, &be_const_str_widget_height_def); -be_define_const_str(arg_size, "arg_size", 3310243257u, 0, 8, NULL); +be_define_const_str(add_driver, "add_driver", 1654458371u, 0, 10, NULL); +be_define_const_str(add_header, "add_header", 927130612u, 0, 10, &be_const_str_io_error); +be_define_const_str(add_rule, "add_rule", 596540743u, 0, 8, NULL); +be_define_const_str(addr, "addr", 1087856498u, 0, 4, &be_const_str_closure); +be_define_const_str(allocated, "allocated", 429986098u, 0, 9, &be_const_str_classname); +be_define_const_str(alternate, "alternate", 1140253277u, 0, 9, &be_const_str_day); +be_define_const_str(animate, "animate", 3885786800u, 0, 7, &be_const_str_gamma); +be_define_const_str(animators, "animators", 279858213u, 0, 9, NULL); +be_define_const_str(arch, "arch", 2952804297u, 0, 4, &be_const_str_get_input_power_status); +be_define_const_str(area, "area", 2601460036u, 0, 4, &be_const_str_asin); +be_define_const_str(arg, "arg", 1047474471u, 0, 3, &be_const_str_math); +be_define_const_str(arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj, "arg must be a subclass of lv_obj", 1641882079u, 0, 32, &be_const_str_ins_goto); +be_define_const_str(arg_name, "arg_name", 1345046155u, 0, 8, &be_const_str_exists); +be_define_const_str(arg_size, "arg_size", 3310243257u, 0, 8, &be_const_str_has); be_define_const_str(as, "as", 1579491469u, 67, 2, NULL); -be_define_const_str(asin, "asin", 4272848550u, 0, 4, &be_const_str_get_current_module_name); -be_define_const_str(assert, "assert", 2774883451u, 0, 6, &be_const_str_display); -be_define_const_str(asstring, "asstring", 1298225088u, 0, 8, &be_const_str_get_temp); -be_define_const_str(atan, "atan", 108579519u, 0, 4, &be_const_str_publish); -be_define_const_str(atan2, "atan2", 3173440503u, 0, 5, &be_const_str_json_fdump_list); -be_define_const_str(atleast1, "atleast1", 1956331672u, 0, 8, &be_const_str_exp); -be_define_const_str(attrdump, "attrdump", 1521571304u, 0, 8, &be_const_str_cb_do_nothing); -be_define_const_str(autoexec, "autoexec", 3676861891u, 0, 8, &be_const_str_cmd_res); -be_define_const_str(autorun, "autorun", 1447527407u, 0, 7, &be_const_str_log); -be_define_const_str(available, "available", 1727918744u, 0, 9, NULL); -be_define_const_str(b, "b", 3876335077u, 0, 1, &be_const_str_get_bri); -be_define_const_str(back_forth, "back_forth", 2665042062u, 0, 10, &be_const_str_debug); -be_define_const_str(base_class, "base_class", 1107737279u, 0, 10, &be_const_str_is_running); -be_define_const_str(battery_present, "battery_present", 3588397058u, 0, 15, NULL); -be_define_const_str(begin, "begin", 1748273790u, 0, 5, &be_const_str_char); -be_define_const_str(bool, "bool", 3365180733u, 0, 4, &be_const_str_log10); +be_define_const_str(asin, "asin", 4272848550u, 0, 4, NULL); +be_define_const_str(assert, "assert", 2774883451u, 0, 6, &be_const_str_constructor_cb); +be_define_const_str(asstring, "asstring", 1298225088u, 0, 8, &be_const_str_pop_path); +be_define_const_str(atan, "atan", 108579519u, 0, 4, &be_const_str_is_running); +be_define_const_str(atan2, "atan2", 3173440503u, 0, 5, &be_const_str_get_battery_chargin_status); +be_define_const_str(atleast1, "atleast1", 1956331672u, 0, 8, &be_const_str_draw_line); +be_define_const_str(attrdump, "attrdump", 1521571304u, 0, 8, NULL); +be_define_const_str(autoexec, "autoexec", 3676861891u, 0, 8, &be_const_str_create_matrix); +be_define_const_str(autorun, "autorun", 1447527407u, 0, 7, &be_const_str_tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29); +be_define_const_str(available, "available", 1727918744u, 0, 9, &be_const_str_get_percentage); +be_define_const_str(b, "b", 3876335077u, 0, 1, NULL); +be_define_const_str(back_forth, "back_forth", 2665042062u, 0, 10, NULL); +be_define_const_str(base_class, "base_class", 1107737279u, 0, 10, &be_const_str_loop); +be_define_const_str(battery_present, "battery_present", 3588397058u, 0, 15, &be_const_str_wire_scan); +be_define_const_str(begin, "begin", 1748273790u, 0, 5, &be_const_str_write); +be_define_const_str(bool, "bool", 3365180733u, 0, 4, &be_const_str_duration); be_define_const_str(break, "break", 3378807160u, 58, 5, NULL); -be_define_const_str(bri, "bri", 2112284244u, 0, 3, &be_const_str_set_style_pad_right); -be_define_const_str(bus, "bus", 1607822841u, 0, 3, &be_const_str_minute); -be_define_const_str(button_pressed, "button_pressed", 1694209616u, 0, 14, &be_const_str_editable); -be_define_const_str(byte, "byte", 1683620383u, 0, 4, &be_const_str_set_timeouts); -be_define_const_str(bytes, "bytes", 1706151940u, 0, 5, &be_const_str_read); -be_define_const_str(c, "c", 3859557458u, 0, 1, &be_const_str_state); -be_define_const_str(call, "call", 3018949801u, 0, 4, &be_const_str_get_coords); -be_define_const_str(call_native, "call_native", 1389147405u, 0, 11, &be_const_str_read8); -be_define_const_str(calldepth, "calldepth", 3122364302u, 0, 9, &be_const_str__X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); -be_define_const_str(can_show, "can_show", 960091187u, 0, 8, &be_const_str_month); -be_define_const_str(cb, "cb", 1428787088u, 0, 2, &be_const_str_get_bat_voltage); -be_define_const_str(cb_do_nothing, "cb_do_nothing", 1488730702u, 0, 13, &be_const_str_contains); -be_define_const_str(cb_event_closure, "cb_event_closure", 3828267325u, 0, 16, &be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E); -be_define_const_str(cb_obj, "cb_obj", 1195696482u, 0, 6, NULL); -be_define_const_str(ceil, "ceil", 1659167240u, 0, 4, NULL); -be_define_const_str(char, "char", 2823553821u, 0, 4, &be_const_str_every_50ms); -be_define_const_str(chars_in_string, "chars_in_string", 3148785132u, 0, 15, &be_const_str_draw_line_dsc); -be_define_const_str(check_privileged_access, "check_privileged_access", 3692933968u, 0, 23, &be_const_str_solidified); +be_define_const_str(bri, "bri", 2112284244u, 0, 3, NULL); +be_define_const_str(bus, "bus", 1607822841u, 0, 3, &be_const_str_issubclass); +be_define_const_str(button_pressed, "button_pressed", 1694209616u, 0, 14, &be_const_str_set_light); +be_define_const_str(byte, "byte", 1683620383u, 0, 4, &be_const_str_log); +be_define_const_str(bytes, "bytes", 1706151940u, 0, 5, &be_const_str_pc_rel); +be_define_const_str(c, "c", 3859557458u, 0, 1, &be_const_str_log10); +be_define_const_str(call, "call", 3018949801u, 0, 4, &be_const_str_energy_struct); +be_define_const_str(call_native, "call_native", 1389147405u, 0, 11, &be_const_str_strptime); +be_define_const_str(calldepth, "calldepth", 3122364302u, 0, 9, NULL); +be_define_const_str(can_show, "can_show", 960091187u, 0, 8, &be_const_str_out_X20of_X20range); +be_define_const_str(cb, "cb", 1428787088u, 0, 2, NULL); +be_define_const_str(cb_do_nothing, "cb_do_nothing", 1488730702u, 0, 13, &be_const_str_range); +be_define_const_str(cb_event_closure, "cb_event_closure", 3828267325u, 0, 16, &be_const_str_get_warning_level); +be_define_const_str(cb_obj, "cb_obj", 1195696482u, 0, 6, &be_const_str_count); +be_define_const_str(ceil, "ceil", 1659167240u, 0, 4, &be_const_str_height_def); +be_define_const_str(char, "char", 2823553821u, 0, 4, NULL); +be_define_const_str(chars_in_string, "chars_in_string", 3148785132u, 0, 15, &be_const_str_listdir); +be_define_const_str(check_privileged_access, "check_privileged_access", 3692933968u, 0, 23, &be_const_str_run_deferred); be_define_const_str(class, "class", 2872970239u, 57, 5, NULL); -be_define_const_str(class_init_obj, "class_init_obj", 178410604u, 0, 14, NULL); -be_define_const_str(classname, "classname", 1998589948u, 0, 9, NULL); -be_define_const_str(classof, "classof", 1796577762u, 0, 7, &be_const_str_gamma); +be_define_const_str(class_init_obj, "class_init_obj", 178410604u, 0, 14, &be_const_str_compile); +be_define_const_str(classname, "classname", 1998589948u, 0, 9, &be_const_str_destructor_cb); +be_define_const_str(classof, "classof", 1796577762u, 0, 7, &be_const_str_line_dsc); be_define_const_str(clear, "clear", 1550717474u, 0, 5, NULL); -be_define_const_str(clear_first_time, "clear_first_time", 632769909u, 0, 16, &be_const_str_get_power); -be_define_const_str(clear_to, "clear_to", 3528002130u, 0, 8, &be_const_str_tanh); -be_define_const_str(close, "close", 667630371u, 0, 5, &be_const_str_write_bit); -be_define_const_str(closure, "closure", 1548407746u, 0, 7, &be_const_str_cmd); -be_define_const_str(cmd, "cmd", 4136785899u, 0, 3, &be_const_str_get_switch); +be_define_const_str(clear_first_time, "clear_first_time", 632769909u, 0, 16, &be_const_str_url_encode); +be_define_const_str(clear_to, "clear_to", 3528002130u, 0, 8, &be_const_str_try); +be_define_const_str(close, "close", 667630371u, 0, 5, &be_const_str_set_style_bg_color); +be_define_const_str(closure, "closure", 1548407746u, 0, 7, &be_const_str_eth); +be_define_const_str(cmd, "cmd", 4136785899u, 0, 3, &be_const_str_get); be_define_const_str(cmd_res, "cmd_res", 921166762u, 0, 7, NULL); -be_define_const_str(code, "code", 4180765940u, 0, 4, &be_const_str_group_def); -be_define_const_str(codedump, "codedump", 1786337906u, 0, 8, &be_const_str_members); -be_define_const_str(collect, "collect", 2399039025u, 0, 7, &be_const_str_file); -be_define_const_str(color, "color", 1031692888u, 0, 5, &be_const_str_get_width); -be_define_const_str(compile, "compile", 1000265118u, 0, 7, &be_const_str_ctypes_bytes); -be_define_const_str(compress, "compress", 2818084237u, 0, 8, &be_const_str_find_op); -be_define_const_str(concat, "concat", 4124019837u, 0, 6, &be_const_str_widget_dtor_impl); -be_define_const_str(connect, "connect", 2866859257u, 0, 7, &be_const_str_stop); -be_define_const_str(connected, "connected", 1424938192u, 0, 9, &be_const_str_obj_event_base); -be_define_const_str(connection_error, "connection_error", 1358926260u, 0, 16, &be_const_str_wifi); -be_define_const_str(constructor_cb, "constructor_cb", 2489105297u, 0, 14, &be_const_str_round_start); -be_define_const_str(contains, "contains", 1825239352u, 0, 8, &be_const_str_deinit); -be_define_const_str(content_button, "content_button", 1956476087u, 0, 14, &be_const_str_write); -be_define_const_str(content_flush, "content_flush", 214922475u, 0, 13, NULL); +be_define_const_str(code, "code", 4180765940u, 0, 4, &be_const_str_fromstring); +be_define_const_str(codedump, "codedump", 1786337906u, 0, 8, &be_const_str_top); +be_define_const_str(collect, "collect", 2399039025u, 0, 7, &be_const_str_json_fdump_list); +be_define_const_str(color, "color", 1031692888u, 0, 5, &be_const_str_del); +be_define_const_str(compile, "compile", 1000265118u, 0, 7, &be_const_str_skip); +be_define_const_str(compress, "compress", 2818084237u, 0, 8, &be_const_str_width_def); +be_define_const_str(concat, "concat", 4124019837u, 0, 6, &be_const_str_get_tasmota); +be_define_const_str(connect, "connect", 2866859257u, 0, 7, &be_const_str_resolvecmnd); +be_define_const_str(connected, "connected", 1424938192u, 0, 9, &be_const_str_exp); +be_define_const_str(connection_error, "connection_error", 1358926260u, 0, 16, &be_const_str_tanh); +be_define_const_str(constructor_cb, "constructor_cb", 2489105297u, 0, 14, NULL); +be_define_const_str(contains, "contains", 1825239352u, 0, 8, &be_const_str_set_x); +be_define_const_str(content_button, "content_button", 1956476087u, 0, 14, NULL); +be_define_const_str(content_flush, "content_flush", 214922475u, 0, 13, &be_const_str_engine); be_define_const_str(content_send, "content_send", 1673733649u, 0, 12, NULL); -be_define_const_str(content_send_style, "content_send_style", 1087907647u, 0, 18, &be_const_str_is_dirty); -be_define_const_str(content_start, "content_start", 2937509069u, 0, 13, NULL); -be_define_const_str(content_stop, "content_stop", 658554751u, 0, 12, &be_const_str_line_dsc); -be_define_const_str(continue, "continue", 2977070660u, 59, 8, NULL); -be_define_const_str(copy, "copy", 3848464964u, 0, 4, &be_const_str_rad); -be_define_const_str(cos, "cos", 4220379804u, 0, 3, &be_const_str_start); -be_define_const_str(cosh, "cosh", 4099687964u, 0, 4, &be_const_str_h); -be_define_const_str(couldn_X27t_X20not_X20initialize_X20noepixelbus, "couldn't not initialize noepixelbus", 2536490812u, 0, 35, NULL); -be_define_const_str(count, "count", 967958004u, 0, 5, &be_const_str_web_add_console_button); -be_define_const_str(counters, "counters", 4095866864u, 0, 8, &be_const_str_save); -be_define_const_str(create_custom_widget, "create_custom_widget", 1140594778u, 0, 20, &be_const_str_quality); -be_define_const_str(create_matrix, "create_matrix", 3528185923u, 0, 13, &be_const_str_y1); -be_define_const_str(create_segment, "create_segment", 3863522719u, 0, 14, &be_const_str_open); -be_define_const_str(ctor, "ctor", 375399343u, 0, 4, &be_const_str_push); -be_define_const_str(ctypes_bytes, "ctypes_bytes", 3879019703u, 0, 12, NULL); -be_define_const_str(ctypes_bytes_dyn, "ctypes_bytes_dyn", 915205307u, 0, 16, &be_const_str_reapply); -be_define_const_str(dac_voltage, "dac_voltage", 1552257222u, 0, 11, &be_const_str_time_reached); -be_define_const_str(day, "day", 3830391293u, 0, 3, &be_const_str_every_100ms); -be_define_const_str(debug, "debug", 1483009432u, 0, 5, &be_const_str_exec_rules); -be_define_const_str(decompress, "decompress", 2887031650u, 0, 10, NULL); -be_define_const_str(decrypt, "decrypt", 2886974618u, 0, 7, NULL); +be_define_const_str(content_send_style, "content_send_style", 1087907647u, 0, 18, &be_const_str_tolower); +be_define_const_str(content_start, "content_start", 2937509069u, 0, 13, &be_const_str_get_bri); +be_define_const_str(content_stop, "content_stop", 658554751u, 0, 12, &be_const_str_widget_destructor); +be_define_const_str(continue, "continue", 2977070660u, 59, 8, &be_const_str_if); +be_define_const_str(copy, "copy", 3848464964u, 0, 4, &be_const_str_def); +be_define_const_str(cos, "cos", 4220379804u, 0, 3, &be_const_str_detected_X20on_X20bus); +be_define_const_str(cosh, "cosh", 4099687964u, 0, 4, NULL); +be_define_const_str(couldn_X27t_X20not_X20initialize_X20noepixelbus, "couldn't not initialize noepixelbus", 2536490812u, 0, 35, &be_const_str_delay); +be_define_const_str(count, "count", 967958004u, 0, 5, NULL); +be_define_const_str(counters, "counters", 4095866864u, 0, 8, &be_const_str_set_ldo_voltage); +be_define_const_str(create_custom_widget, "create_custom_widget", 1140594778u, 0, 20, &be_const_str_get_switch); +be_define_const_str(create_matrix, "create_matrix", 3528185923u, 0, 13, NULL); +be_define_const_str(create_segment, "create_segment", 3863522719u, 0, 14, &be_const_str_v); +be_define_const_str(ctor, "ctor", 375399343u, 0, 4, &be_const_str_floor); +be_define_const_str(ctypes_bytes, "ctypes_bytes", 3879019703u, 0, 12, &be_const_str_widget_event_impl); +be_define_const_str(ctypes_bytes_dyn, "ctypes_bytes_dyn", 915205307u, 0, 16, &be_const_str_set_text); +be_define_const_str(dac_voltage, "dac_voltage", 1552257222u, 0, 11, &be_const_str_set_alternate); +be_define_const_str(day, "day", 3830391293u, 0, 3, &be_const_str_event); +be_define_const_str(debug, "debug", 1483009432u, 0, 5, &be_const_str_number); +be_define_const_str(decompress, "decompress", 2887031650u, 0, 10, &be_const_str_get_temp); +be_define_const_str(decrypt, "decrypt", 2886974618u, 0, 7, &be_const_str_set_matrix_pixel_color); be_define_const_str(def, "def", 3310976652u, 55, 3, NULL); -be_define_const_str(deg, "deg", 3327754271u, 0, 3, NULL); -be_define_const_str(deinit, "deinit", 2345559592u, 0, 6, NULL); +be_define_const_str(deg, "deg", 3327754271u, 0, 3, &be_const_str_dump); +be_define_const_str(deinit, "deinit", 2345559592u, 0, 6, &be_const_str_tomap); be_define_const_str(del, "del", 3478752842u, 0, 3, NULL); -be_define_const_str(delay, "delay", 1322381784u, 0, 5, &be_const_str_run_deferred); -be_define_const_str(delete_all_configs, "delete_all_configs", 2382067578u, 0, 18, &be_const_str_wire1); -be_define_const_str(depower, "depower", 3563819571u, 0, 7, &be_const_str_get_bat_charge_current); -be_define_const_str(deregister_obj, "deregister_obj", 3909966993u, 0, 14, &be_const_str_get_alternate); -be_define_const_str(destructor_cb, "destructor_cb", 1930283190u, 0, 13, &be_const_str_p2); -be_define_const_str(detect, "detect", 8884370u, 0, 6, NULL); -be_define_const_str(detected_X20on_X20bus, "detected on bus", 1432002650u, 0, 15, &be_const_str_run); -be_define_const_str(digital_read, "digital_read", 3585496928u, 0, 12, NULL); -be_define_const_str(digital_write, "digital_write", 3435877979u, 0, 13, &be_const_str_gamma8); -be_define_const_str(dirty, "dirty", 2667581083u, 0, 5, &be_const_str_pop_path); -be_define_const_str(display, "display", 1164572437u, 0, 7, &be_const_str_finish); +be_define_const_str(delay, "delay", 1322381784u, 0, 5, &be_const_str_instance); +be_define_const_str(delete_all_configs, "delete_all_configs", 2382067578u, 0, 18, NULL); +be_define_const_str(depower, "depower", 3563819571u, 0, 7, &be_const_str_flush); +be_define_const_str(deregister_obj, "deregister_obj", 3909966993u, 0, 14, NULL); +be_define_const_str(destructor_cb, "destructor_cb", 1930283190u, 0, 13, &be_const_str_event_send); +be_define_const_str(detect, "detect", 8884370u, 0, 6, &be_const_str_run); +be_define_const_str(detected_X20on_X20bus, "detected on bus", 1432002650u, 0, 15, NULL); +be_define_const_str(digital_read, "digital_read", 3585496928u, 0, 12, &be_const_str_json_fdump); +be_define_const_str(digital_write, "digital_write", 3435877979u, 0, 13, NULL); +be_define_const_str(dirty, "dirty", 2667581083u, 0, 5, NULL); +be_define_const_str(display, "display", 1164572437u, 0, 7, &be_const_str_obj_event_base); be_define_const_str(display_X2Eini, "display.ini", 2646174001u, 0, 11, NULL); be_define_const_str(do, "do", 1646057492u, 65, 2, NULL); -be_define_const_str(draw_arc, "draw_arc", 1828251676u, 0, 8, &be_const_str_hour); -be_define_const_str(draw_line, "draw_line", 1634465686u, 0, 9, NULL); -be_define_const_str(draw_line_dsc, "draw_line_dsc", 4220676203u, 0, 13, &be_const_str_widget_instance_size); -be_define_const_str(draw_line_dsc_init, "draw_line_dsc_init", 3866693646u, 0, 18, NULL); -be_define_const_str(due, "due", 3895530293u, 0, 3, NULL); +be_define_const_str(draw_arc, "draw_arc", 1828251676u, 0, 8, &be_const_str_p1); +be_define_const_str(draw_line, "draw_line", 1634465686u, 0, 9, &be_const_str_set_dc_voltage); +be_define_const_str(draw_line_dsc, "draw_line_dsc", 4220676203u, 0, 13, &be_const_str_fromb64); +be_define_const_str(draw_line_dsc_init, "draw_line_dsc_init", 3866693646u, 0, 18, &be_const_str_length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032); +be_define_const_str(due, "due", 3895530293u, 0, 3, &be_const_str_erase); be_define_const_str(dump, "dump", 3663001223u, 0, 4, NULL); -be_define_const_str(duration, "duration", 799079693u, 0, 8, &be_const_str_rotate); -be_define_const_str(editable, "editable", 60532369u, 0, 8, &be_const_str_kv); +be_define_const_str(duration, "duration", 799079693u, 0, 8, &be_const_str_f); +be_define_const_str(editable, "editable", 60532369u, 0, 8, &be_const_str_get_power); be_define_const_str(elif, "elif", 3232090307u, 51, 4, NULL); be_define_const_str(else, "else", 3183434736u, 52, 4, NULL); -be_define_const_str(enabled, "enabled", 49525662u, 0, 7, &be_const_str_write_file); -be_define_const_str(encrypt, "encrypt", 2194327650u, 0, 7, &be_const_str_static); -be_define_const_str(end, "end", 1787721130u, 56, 3, &be_const_str_try); +be_define_const_str(enabled, "enabled", 49525662u, 0, 7, &be_const_str_pin_mode); +be_define_const_str(encrypt, "encrypt", 2194327650u, 0, 7, &be_const_str_finish); +be_define_const_str(end, "end", 1787721130u, 56, 3, NULL); be_define_const_str(energy_struct, "energy_struct", 1655792843u, 0, 13, NULL); -be_define_const_str(engine, "engine", 3993360443u, 0, 6, &be_const_str_widget_destructor); -be_define_const_str(erase, "erase", 1010949589u, 0, 5, &be_const_str_tolower); -be_define_const_str(escape, "escape", 2652972038u, 0, 6, &be_const_str_hex); -be_define_const_str(eth, "eth", 2191266556u, 0, 3, NULL); -be_define_const_str(event, "event", 4264611999u, 0, 5, &be_const_str_set_width); -be_define_const_str(event_cb, "event_cb", 3128698017u, 0, 8, &be_const_str_height_def); -be_define_const_str(event_send, "event_send", 598925582u, 0, 10, &be_const_str_gamma10); -be_define_const_str(every_100ms, "every_100ms", 1546407804u, 0, 11, NULL); -be_define_const_str(every_50ms, "every_50ms", 2383884008u, 0, 10, &be_const_str_page_autoconf_mgr); -be_define_const_str(every_second, "every_second", 2075451465u, 0, 12, &be_const_str_list); +be_define_const_str(engine, "engine", 3993360443u, 0, 6, &be_const_str_getbits); +be_define_const_str(erase, "erase", 1010949589u, 0, 5, &be_const_str_class); +be_define_const_str(escape, "escape", 2652972038u, 0, 6, NULL); +be_define_const_str(eth, "eth", 2191266556u, 0, 3, &be_const_str_widget_constructor); +be_define_const_str(event, "event", 4264611999u, 0, 5, &be_const_str_resp_cmnd_error); +be_define_const_str(event_cb, "event_cb", 3128698017u, 0, 8, NULL); +be_define_const_str(event_send, "event_send", 598925582u, 0, 10, &be_const_str_name); +be_define_const_str(every_100ms, "every_100ms", 1546407804u, 0, 11, &be_const_str_zip); +be_define_const_str(every_50ms, "every_50ms", 2383884008u, 0, 10, &be_const_str_size); +be_define_const_str(every_second, "every_second", 2075451465u, 0, 12, NULL); be_define_const_str(except, "except", 950914032u, 69, 6, NULL); -be_define_const_str(exec_cmd, "exec_cmd", 493567399u, 0, 8, &be_const_str_light); -be_define_const_str(exec_rules, "exec_rules", 1445221092u, 0, 10, &be_const_str_reverse); -be_define_const_str(exec_tele, "exec_tele", 1020751601u, 0, 9, &be_const_str_has); -be_define_const_str(exists, "exists", 1002329533u, 0, 6, &be_const_str_setbits); -be_define_const_str(exp, "exp", 1923516200u, 0, 3, &be_const_str_tasmota); -be_define_const_str(f, "f", 3809224601u, 0, 1, &be_const_str_input); +be_define_const_str(exec_cmd, "exec_cmd", 493567399u, 0, 8, &be_const_str_hour); +be_define_const_str(exec_rules, "exec_rules", 1445221092u, 0, 10, &be_const_str_find); +be_define_const_str(exec_tele, "exec_tele", 1020751601u, 0, 9, &be_const_str_widget_height_def); +be_define_const_str(exists, "exists", 1002329533u, 0, 6, &be_const_str_tostring); +be_define_const_str(exp, "exp", 1923516200u, 0, 3, NULL); +be_define_const_str(f, "f", 3809224601u, 0, 1, &be_const_str_function); be_define_const_str(false, "false", 184981848u, 62, 5, NULL); be_define_const_str(file, "file", 2867484483u, 0, 4, NULL); -be_define_const_str(file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27, "file extension is not '.be' or '.bec'", 3095719639u, 0, 37, NULL); -be_define_const_str(files, "files", 1055342736u, 0, 5, &be_const_str_param); -be_define_const_str(find, "find", 3186656602u, 0, 4, NULL); -be_define_const_str(find_key_i, "find_key_i", 850136726u, 0, 10, &be_const_str_pin); -be_define_const_str(find_op, "find_op", 3766713376u, 0, 7, NULL); +be_define_const_str(file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20or_X20_X27_X2Ebec_X27, "file extension is not '.be' or '.bec'", 3095719639u, 0, 37, &be_const_str_strip); +be_define_const_str(files, "files", 1055342736u, 0, 5, &be_const_str_get_coords); +be_define_const_str(find, "find", 3186656602u, 0, 4, &be_const_str_hex); +be_define_const_str(find_key_i, "find_key_i", 850136726u, 0, 10, NULL); +be_define_const_str(find_op, "find_op", 3766713376u, 0, 7, &be_const_str_memory); be_define_const_str(finish, "finish", 1494643858u, 0, 6, NULL); -be_define_const_str(floor, "floor", 3102149661u, 0, 5, &be_const_str_local); +be_define_const_str(floor, "floor", 3102149661u, 0, 5, NULL); be_define_const_str(flush, "flush", 3002334877u, 0, 5, NULL); be_define_const_str(for, "for", 2901640080u, 54, 3, NULL); -be_define_const_str(format, "format", 3114108242u, 0, 6, &be_const_str_memory); -be_define_const_str(from_to, "from_to", 21625507u, 0, 7, &be_const_str_load); -be_define_const_str(fromb64, "fromb64", 2717019639u, 0, 7, NULL); +be_define_const_str(format, "format", 3114108242u, 0, 6, &be_const_str_offset); +be_define_const_str(from_to, "from_to", 21625507u, 0, 7, &be_const_str_json); +be_define_const_str(fromb64, "fromb64", 2717019639u, 0, 7, &be_const_str_r); be_define_const_str(fromptr, "fromptr", 666189689u, 0, 7, NULL); -be_define_const_str(fromstring, "fromstring", 610302344u, 0, 10, &be_const_str_get_input_power_status); -be_define_const_str(function, "function", 2664841801u, 0, 8, &be_const_str_tostring); -be_define_const_str(gamma, "gamma", 3492353034u, 0, 5, &be_const_str_widget_struct_default); -be_define_const_str(gamma10, "gamma10", 3472052483u, 0, 7, &be_const_str_get_free_heap); -be_define_const_str(gamma8, "gamma8", 3802843830u, 0, 6, &be_const_str_resp_cmnd); -be_define_const_str(gc, "gc", 1042313471u, 0, 2, NULL); -be_define_const_str(gen_cb, "gen_cb", 3245227551u, 0, 6, NULL); -be_define_const_str(get, "get", 1410115415u, 0, 3, &be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D); -be_define_const_str(get_alternate, "get_alternate", 1450148894u, 0, 13, NULL); -be_define_const_str(get_aps_voltage, "get_aps_voltage", 2293036435u, 0, 15, NULL); -be_define_const_str(get_bat_charge_current, "get_bat_charge_current", 1385293050u, 0, 22, &be_const_str_pi); -be_define_const_str(get_bat_current, "get_bat_current", 1912106073u, 0, 15, NULL); -be_define_const_str(get_bat_power, "get_bat_power", 3067374853u, 0, 13, &be_const_str_ins_time); +be_define_const_str(fromstring, "fromstring", 610302344u, 0, 10, NULL); +be_define_const_str(function, "function", 2664841801u, 0, 8, &be_const_str_get_bat_power); +be_define_const_str(gamma, "gamma", 3492353034u, 0, 5, &be_const_str_string); +be_define_const_str(gamma10, "gamma10", 3472052483u, 0, 7, NULL); +be_define_const_str(gamma8, "gamma8", 3802843830u, 0, 6, &be_const_str_else); +be_define_const_str(gc, "gc", 1042313471u, 0, 2, &be_const_str_remove_timer); +be_define_const_str(gen_cb, "gen_cb", 3245227551u, 0, 6, &be_const_str_pixels_buffer); +be_define_const_str(get, "get", 1410115415u, 0, 3, &be_const_str_sqrt); +be_define_const_str(get_alternate, "get_alternate", 1450148894u, 0, 13, &be_const_str_readbytes); +be_define_const_str(get_aps_voltage, "get_aps_voltage", 2293036435u, 0, 15, &be_const_str_traceback); +be_define_const_str(get_bat_charge_current, "get_bat_charge_current", 1385293050u, 0, 22, &be_const_str_get_style_pad_right); +be_define_const_str(get_bat_current, "get_bat_current", 1912106073u, 0, 15, &be_const_str_leds); +be_define_const_str(get_bat_power, "get_bat_power", 3067374853u, 0, 13, &be_const_str_init); be_define_const_str(get_bat_voltage, "get_bat_voltage", 706676538u, 0, 15, NULL); be_define_const_str(get_battery_chargin_status, "get_battery_chargin_status", 2233241571u, 0, 26, NULL); -be_define_const_str(get_bri, "get_bri", 2041809895u, 0, 7, &be_const_str_page_autoconf_ctl); -be_define_const_str(get_cb_list, "get_cb_list", 1605319182u, 0, 11, &be_const_str_offset); -be_define_const_str(get_coords, "get_coords", 1044089006u, 0, 10, &be_const_str_upper); -be_define_const_str(get_current_module_name, "get_current_module_name", 2379270740u, 0, 23, NULL); -be_define_const_str(get_current_module_path, "get_current_module_path", 3206673408u, 0, 23, NULL); -be_define_const_str(get_free_heap, "get_free_heap", 625069757u, 0, 13, &be_const_str_no_X20GPIO_X20specified_X20for_X20neopixelbus); -be_define_const_str(get_height, "get_height", 3571755523u, 0, 10, &be_const_str_obj_class_create_obj); -be_define_const_str(get_input_power_status, "get_input_power_status", 4102829177u, 0, 22, &be_const_str_get_style_bg_color); -be_define_const_str(get_light, "get_light", 381930476u, 0, 9, &be_const_str_unknown_X20instruction); -be_define_const_str(get_object_from_ptr, "get_object_from_ptr", 2345019201u, 0, 19, NULL); +be_define_const_str(get_bri, "get_bri", 2041809895u, 0, 7, NULL); +be_define_const_str(get_cb_list, "get_cb_list", 1605319182u, 0, 11, &be_const_str_pi); +be_define_const_str(get_coords, "get_coords", 1044089006u, 0, 10, NULL); +be_define_const_str(get_current_module_name, "get_current_module_name", 2379270740u, 0, 23, &be_const_str_isinstance); +be_define_const_str(get_current_module_path, "get_current_module_path", 3206673408u, 0, 23, &be_const_str_matrix); +be_define_const_str(get_free_heap, "get_free_heap", 625069757u, 0, 13, NULL); +be_define_const_str(get_height, "get_height", 3571755523u, 0, 10, &be_const_str_get_vbus_voltage); +be_define_const_str(get_input_power_status, "get_input_power_status", 4102829177u, 0, 22, &be_const_str_value_error); +be_define_const_str(get_light, "get_light", 381930476u, 0, 9, NULL); +be_define_const_str(get_object_from_ptr, "get_object_from_ptr", 2345019201u, 0, 19, &be_const_str__X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); be_define_const_str(get_option, "get_option", 2123730033u, 0, 10, NULL); -be_define_const_str(get_percentage, "get_percentage", 2880483992u, 0, 14, NULL); +be_define_const_str(get_percentage, "get_percentage", 2880483992u, 0, 14, &be_const_str_global); be_define_const_str(get_pixel_color, "get_pixel_color", 337490048u, 0, 15, NULL); -be_define_const_str(get_power, "get_power", 3009799377u, 0, 9, NULL); -be_define_const_str(get_size, "get_size", 2803644713u, 0, 8, &be_const_str_tomap); -be_define_const_str(get_string, "get_string", 4195847969u, 0, 10, &be_const_str_remove_driver); -be_define_const_str(get_style_bg_color, "get_style_bg_color", 964794381u, 0, 18, &be_const_str_number); -be_define_const_str(get_style_line_color, "get_style_line_color", 805371932u, 0, 20, &be_const_str_ins_ramp); +be_define_const_str(get_power, "get_power", 3009799377u, 0, 9, &be_const_str_set_time); +be_define_const_str(get_size, "get_size", 2803644713u, 0, 8, NULL); +be_define_const_str(get_string, "get_string", 4195847969u, 0, 10, NULL); +be_define_const_str(get_style_bg_color, "get_style_bg_color", 964794381u, 0, 18, NULL); +be_define_const_str(get_style_line_color, "get_style_line_color", 805371932u, 0, 20, &be_const_str_ip); be_define_const_str(get_style_pad_right, "get_style_pad_right", 3150287466u, 0, 19, NULL); -be_define_const_str(get_switch, "get_switch", 164821028u, 0, 10, &be_const_str_set_y); -be_define_const_str(get_tasmota, "get_tasmota", 334356779u, 0, 11, &be_const_str_imax); +be_define_const_str(get_switch, "get_switch", 164821028u, 0, 10, &be_const_str_init_draw_line_dsc); +be_define_const_str(get_tasmota, "get_tasmota", 334356779u, 0, 11, NULL); be_define_const_str(get_temp, "get_temp", 3370919486u, 0, 8, NULL); -be_define_const_str(get_vbus_current, "get_vbus_current", 1205347942u, 0, 16, &be_const_str_tele); -be_define_const_str(get_vbus_voltage, "get_vbus_voltage", 2398210401u, 0, 16, &be_const_str_toupper); +be_define_const_str(get_vbus_current, "get_vbus_current", 1205347942u, 0, 16, &be_const_str_rotate); +be_define_const_str(get_vbus_voltage, "get_vbus_voltage", 2398210401u, 0, 16, NULL); be_define_const_str(get_warning_level, "get_warning_level", 1737834441u, 0, 17, NULL); -be_define_const_str(get_width, "get_width", 3293417300u, 0, 9, &be_const_str_readbytes); -be_define_const_str(getbits, "getbits", 3094168979u, 0, 7, &be_const_str_has_arg); -be_define_const_str(geti, "geti", 2381006490u, 0, 4, NULL); -be_define_const_str(global, "global", 503252654u, 0, 6, NULL); -be_define_const_str(gpio, "gpio", 2638155258u, 0, 4, &be_const_str_strptime); -be_define_const_str(group_def, "group_def", 1524213328u, 0, 9, NULL); -be_define_const_str(h, "h", 3977000791u, 0, 1, &be_const_str_init); -be_define_const_str(has, "has", 3988721635u, 0, 3, &be_const_str_pow); -be_define_const_str(has_arg, "has_arg", 424878688u, 0, 7, &be_const_str__X7D); -be_define_const_str(height_def, "height_def", 2348238838u, 0, 10, &be_const_str_set_height); -be_define_const_str(hex, "hex", 4273249610u, 0, 3, &be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson); -be_define_const_str(hour, "hour", 3053661199u, 0, 4, &be_const_str_pixel_count); -be_define_const_str(hs2rgb, "hs2rgb", 1040816349u, 0, 6, &be_const_str_path); -be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s/%s.autoconf", 2743526309u, 0, 70, &be_const_str_pc_abs); -be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s_manifest.json", 3657552045u, 0, 72, &be_const_str_int); -be_define_const_str(i2c_enabled, "i2c_enabled", 218388101u, 0, 11, NULL); -be_define_const_str(id, "id", 926444256u, 0, 2, &be_const_str_x); +be_define_const_str(get_width, "get_width", 3293417300u, 0, 9, &be_const_str_scan); +be_define_const_str(getbits, "getbits", 3094168979u, 0, 7, NULL); +be_define_const_str(geti, "geti", 2381006490u, 0, 4, &be_const_str_id); +be_define_const_str(global, "global", 503252654u, 0, 6, &be_const_str_members); +be_define_const_str(gpio, "gpio", 2638155258u, 0, 4, NULL); +be_define_const_str(group_def, "group_def", 1524213328u, 0, 9, &be_const_str_isnan); +be_define_const_str(h, "h", 3977000791u, 0, 1, &be_const_str_response_append); +be_define_const_str(has, "has", 3988721635u, 0, 3, NULL); +be_define_const_str(has_arg, "has_arg", 424878688u, 0, 7, NULL); +be_define_const_str(height_def, "height_def", 2348238838u, 0, 10, NULL); +be_define_const_str(hex, "hex", 4273249610u, 0, 3, &be_const_str_set_auth); +be_define_const_str(hour, "hour", 3053661199u, 0, 4, &be_const_str_search); +be_define_const_str(hs2rgb, "hs2rgb", 1040816349u, 0, 6, NULL); +be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s/%s.autoconf", 2743526309u, 0, 70, &be_const_str_reverse); +be_define_const_str(https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson, "https://raw.githubusercontent.com/tasmota/autoconf/main/%s_manifest.json", 3657552045u, 0, 72, &be_const_str_return); +be_define_const_str(i2c_enabled, "i2c_enabled", 218388101u, 0, 11, &be_const_str_light); +be_define_const_str(id, "id", 926444256u, 0, 2, &be_const_str_web_add_handler); be_define_const_str(if, "if", 959999494u, 50, 2, NULL); -be_define_const_str(imax, "imax", 3084515410u, 0, 4, &be_const_str_resize); +be_define_const_str(imax, "imax", 3084515410u, 0, 4, &be_const_str_continue); be_define_const_str(imin, "imin", 2714127864u, 0, 4, NULL); be_define_const_str(import, "import", 288002260u, 66, 6, NULL); -be_define_const_str(init, "init", 380752755u, 0, 4, &be_const_str_pc_rel); -be_define_const_str(init_draw_line_dsc, "init_draw_line_dsc", 2507936040u, 0, 18, NULL); -be_define_const_str(input, "input", 4191711099u, 0, 5, &be_const_str_reset); -be_define_const_str(ins_goto, "ins_goto", 1342843963u, 0, 8, NULL); -be_define_const_str(ins_ramp, "ins_ramp", 1068049360u, 0, 8, &be_const_str_stop_iteration); -be_define_const_str(ins_time, "ins_time", 2980245553u, 0, 8, NULL); -be_define_const_str(insert, "insert", 3332609576u, 0, 6, &be_const_str_lvgl_event_dispatch); -be_define_const_str(instance, "instance", 193386898u, 0, 8, &be_const_str_set_matrix_pixel_color); -be_define_const_str(instance_size, "instance_size", 4280269518u, 0, 13, NULL); -be_define_const_str(int, "int", 2515107422u, 0, 3, &be_const_str_set_style_text_font); -be_define_const_str(internal_error, "internal_error", 2519158169u, 0, 14, &be_const_str_width_def); -be_define_const_str(introspect, "introspect", 164638290u, 0, 10, &be_const_str_preinit); -be_define_const_str(invalidate, "invalidate", 2649734928u, 0, 10, NULL); -be_define_const_str(io_error, "io_error", 1970281036u, 0, 8, NULL); -be_define_const_str(ip, "ip", 1261996636u, 0, 2, NULL); -be_define_const_str(is_dirty, "is_dirty", 418034110u, 0, 8, &be_const_str_on); -be_define_const_str(is_first_time, "is_first_time", 275242384u, 0, 13, &be_const_str_persist); -be_define_const_str(is_running, "is_running", 2226847261u, 0, 10, &be_const_str__X7B_X7D); -be_define_const_str(isinstance, "isinstance", 3669352738u, 0, 10, &be_const_str_last_modified); -be_define_const_str(isnan, "isnan", 2981347434u, 0, 5, &be_const_str_iter); -be_define_const_str(isrunning, "isrunning", 1688182268u, 0, 9, NULL); -be_define_const_str(issubclass, "issubclass", 4078395519u, 0, 10, &be_const_str_setmember); -be_define_const_str(item, "item", 2671260646u, 0, 4, &be_const_str_json_fdump_any); -be_define_const_str(iter, "iter", 3124256359u, 0, 4, &be_const_str_name); -be_define_const_str(json, "json", 916562499u, 0, 4, NULL); -be_define_const_str(json_append, "json_append", 3002019284u, 0, 11, &be_const_str_import); +be_define_const_str(init, "init", 380752755u, 0, 4, &be_const_str_stop_iteration); +be_define_const_str(init_draw_line_dsc, "init_draw_line_dsc", 2507936040u, 0, 18, &be_const_str_pin); +be_define_const_str(input, "input", 4191711099u, 0, 5, NULL); +be_define_const_str(ins_goto, "ins_goto", 1342843963u, 0, 8, &be_const_str_web_add_config_button); +be_define_const_str(ins_ramp, "ins_ramp", 1068049360u, 0, 8, &be_const_str_web_add_console_button); +be_define_const_str(ins_time, "ins_time", 2980245553u, 0, 8, &be_const_str_member); +be_define_const_str(insert, "insert", 3332609576u, 0, 6, NULL); +be_define_const_str(instance, "instance", 193386898u, 0, 8, &be_const_str_write_gpio); +be_define_const_str(instance_size, "instance_size", 4280269518u, 0, 13, &be_const_str_persist_X2E_p_X20is_X20not_X20a_X20map); +be_define_const_str(int, "int", 2515107422u, 0, 3, &be_const_str_json_append); +be_define_const_str(internal_error, "internal_error", 2519158169u, 0, 14, NULL); +be_define_const_str(introspect, "introspect", 164638290u, 0, 10, &be_const_str_widget_ctor_cb); +be_define_const_str(invalidate, "invalidate", 2649734928u, 0, 10, &be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E); +be_define_const_str(io_error, "io_error", 1970281036u, 0, 8, &be_const_str_pin_used); +be_define_const_str(ip, "ip", 1261996636u, 0, 2, &be_const_str_null_cb); +be_define_const_str(is_dirty, "is_dirty", 418034110u, 0, 8, &be_const_str_w); +be_define_const_str(is_first_time, "is_first_time", 275242384u, 0, 13, NULL); +be_define_const_str(is_running, "is_running", 2226847261u, 0, 10, &be_const_str_round_end); +be_define_const_str(isinstance, "isinstance", 3669352738u, 0, 10, NULL); +be_define_const_str(isnan, "isnan", 2981347434u, 0, 5, &be_const_str_lv_obj_class); +be_define_const_str(isrunning, "isrunning", 1688182268u, 0, 9, &be_const_str_pop); +be_define_const_str(issubclass, "issubclass", 4078395519u, 0, 10, &be_const_str_read_sensors); +be_define_const_str(item, "item", 2671260646u, 0, 4, &be_const_str_seti); +be_define_const_str(iter, "iter", 3124256359u, 0, 4, &be_const_str_keys); +be_define_const_str(json, "json", 916562499u, 0, 4, &be_const_str_y1); +be_define_const_str(json_append, "json_append", 3002019284u, 0, 11, &be_const_str_set_chg_current); be_define_const_str(json_fdump, "json_fdump", 1694216580u, 0, 10, NULL); -be_define_const_str(json_fdump_any, "json_fdump_any", 3348629385u, 0, 14, NULL); -be_define_const_str(json_fdump_list, "json_fdump_list", 3903879853u, 0, 15, &be_const_str_millis); -be_define_const_str(json_fdump_map, "json_fdump_map", 4091954653u, 0, 14, &be_const_str_save_before_restart); -be_define_const_str(k, "k", 3993778410u, 0, 1, &be_const_str_keys); -be_define_const_str(keys, "keys", 4182378701u, 0, 4, &be_const_str_min); -be_define_const_str(kv, "kv", 1497177492u, 0, 2, NULL); -be_define_const_str(last_modified, "last_modified", 772177145u, 0, 13, NULL); -be_define_const_str(leds, "leds", 558858555u, 0, 4, &be_const_str_elif); -be_define_const_str(length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032, "length in bits must be between 0 and 32", 2584509128u, 0, 39, &be_const_str_false); +be_define_const_str(json_fdump_any, "json_fdump_any", 3348629385u, 0, 14, &be_const_str_pixel_count); +be_define_const_str(json_fdump_list, "json_fdump_list", 3903879853u, 0, 15, NULL); +be_define_const_str(json_fdump_map, "json_fdump_map", 4091954653u, 0, 14, &be_const_str_pow); +be_define_const_str(k, "k", 3993778410u, 0, 1, &be_const_str_set_first_time); +be_define_const_str(keys, "keys", 4182378701u, 0, 4, NULL); +be_define_const_str(kv, "kv", 1497177492u, 0, 2, &be_const_str_wire2); +be_define_const_str(last_modified, "last_modified", 772177145u, 0, 13, &be_const_str_p2); +be_define_const_str(leds, "leds", 558858555u, 0, 4, &be_const_str_month); +be_define_const_str(length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032, "length in bits must be between 0 and 32", 2584509128u, 0, 39, &be_const_str_widget_editable); be_define_const_str(light, "light", 3801947695u, 0, 5, NULL); -be_define_const_str(line_dsc, "line_dsc", 4094490978u, 0, 8, &be_const_str_print); +be_define_const_str(line_dsc, "line_dsc", 4094490978u, 0, 8, NULL); be_define_const_str(list, "list", 217798785u, 0, 4, NULL); -be_define_const_str(listdir, "listdir", 2005220720u, 0, 7, NULL); +be_define_const_str(listdir, "listdir", 2005220720u, 0, 7, &be_const_str_round_start); be_define_const_str(load, "load", 3859241449u, 0, 4, NULL); -be_define_const_str(load_templates, "load_templates", 3513870133u, 0, 14, &be_const_str_set_bri); -be_define_const_str(local, "local", 2621662984u, 0, 5, NULL); -be_define_const_str(log, "log", 1062293841u, 0, 3, &be_const_str_the_X20second_X20argument_X20is_X20not_X20a_X20function); -be_define_const_str(log10, "log10", 2346846000u, 0, 5, &be_const_str_web_add_handler); -be_define_const_str(loop, "loop", 3723446379u, 0, 4, &be_const_str_continue); -be_define_const_str(lower, "lower", 3038577850u, 0, 5, &be_const_str_push_path); -be_define_const_str(lv, "lv", 1529997255u, 0, 2, NULL); -be_define_const_str(lv_event, "lv_event", 2434089968u, 0, 8, &be_const_str_set_timer); -be_define_const_str(lv_event_cb, "lv_event_cb", 2480731016u, 0, 11, &be_const_str_try_rule); -be_define_const_str(lv_obj, "lv_obj", 4257833149u, 0, 6, NULL); -be_define_const_str(lv_obj_class, "lv_obj_class", 4039656294u, 0, 12, NULL); -be_define_const_str(lvgl_event_dispatch, "lvgl_event_dispatch", 2104396622u, 0, 19, &be_const_str_rule); +be_define_const_str(load_templates, "load_templates", 3513870133u, 0, 14, NULL); +be_define_const_str(local, "local", 2621662984u, 0, 5, &be_const_str_publish); +be_define_const_str(log, "log", 1062293841u, 0, 3, NULL); +be_define_const_str(log10, "log10", 2346846000u, 0, 5, &be_const_str_web_send); +be_define_const_str(loop, "loop", 3723446379u, 0, 4, NULL); +be_define_const_str(lower, "lower", 3038577850u, 0, 5, &be_const_str_wire); +be_define_const_str(lv, "lv", 1529997255u, 0, 2, &be_const_str_pixel_size); +be_define_const_str(lv_event, "lv_event", 2434089968u, 0, 8, NULL); +be_define_const_str(lv_event_cb, "lv_event_cb", 2480731016u, 0, 11, &be_const_str_set_pixel_color); +be_define_const_str(lv_obj, "lv_obj", 4257833149u, 0, 6, &be_const_str_widget_dtor_cb); +be_define_const_str(lv_obj_class, "lv_obj_class", 4039656294u, 0, 12, &be_const_str_set_style_pad_right); +be_define_const_str(lvgl_event_dispatch, "lvgl_event_dispatch", 2104396622u, 0, 19, &be_const_str_widget_event); be_define_const_str(map, "map", 3751997361u, 0, 3, NULL); -be_define_const_str(math, "math", 4001929615u, 0, 4, &be_const_str_widget_event_cb); -be_define_const_str(matrix, "matrix", 365099244u, 0, 6, &be_const_str_pixels_buffer); -be_define_const_str(member, "member", 719708611u, 0, 6, &be_const_str_web_add_management_button); -be_define_const_str(members, "members", 937576464u, 0, 7, &be_const_str_remove_rule); +be_define_const_str(math, "math", 4001929615u, 0, 4, &be_const_str_as); +be_define_const_str(matrix, "matrix", 365099244u, 0, 6, &be_const_str_nan); +be_define_const_str(member, "member", 719708611u, 0, 6, NULL); +be_define_const_str(members, "members", 937576464u, 0, 7, NULL); be_define_const_str(memory, "memory", 2229924270u, 0, 6, NULL); -be_define_const_str(millis, "millis", 1214679063u, 0, 6, &be_const_str_module); +be_define_const_str(millis, "millis", 1214679063u, 0, 6, NULL); be_define_const_str(min, "min", 3381609815u, 0, 3, NULL); -be_define_const_str(minute, "minute", 954666857u, 0, 6, NULL); -be_define_const_str(module, "module", 3617558685u, 0, 6, &be_const_str_setrange); -be_define_const_str(month, "month", 3598321157u, 0, 5, &be_const_str_web_send); +be_define_const_str(minute, "minute", 954666857u, 0, 6, &be_const_str_strftime); +be_define_const_str(module, "module", 3617558685u, 0, 6, NULL); +be_define_const_str(month, "month", 3598321157u, 0, 5, &be_const_str_solidified); be_define_const_str(name, "name", 2369371622u, 0, 4, NULL); -be_define_const_str(nan, "nan", 797905850u, 0, 3, &be_const_str_size); +be_define_const_str(nan, "nan", 797905850u, 0, 3, &be_const_str_wifi); be_define_const_str(nil, "nil", 228849900u, 63, 3, NULL); -be_define_const_str(no_X20GPIO_X20specified_X20for_X20neopixelbus, "no GPIO specified for neopixelbus", 42078528u, 0, 33, NULL); -be_define_const_str(null_cb, "null_cb", 2333536460u, 0, 7, NULL); -be_define_const_str(number, "number", 467038368u, 0, 6, &be_const_str_range); +be_define_const_str(no_X20GPIO_X20specified_X20for_X20neopixelbus, "no GPIO specified for neopixelbus", 42078528u, 0, 33, &be_const_str_preinit); +be_define_const_str(null_cb, "null_cb", 2333536460u, 0, 7, &be_const_str_save); +be_define_const_str(number, "number", 467038368u, 0, 6, &be_const_str_time_str); be_define_const_str(obj_class_create_obj, "obj_class_create_obj", 3304390632u, 0, 20, NULL); be_define_const_str(obj_event_base, "obj_event_base", 1624064363u, 0, 14, NULL); -be_define_const_str(offset, "offset", 348705738u, 0, 6, &be_const_str_web_add_button); -be_define_const_str(offseta, "offseta", 1663383089u, 0, 7, NULL); -be_define_const_str(on, "on", 1630810064u, 0, 2, &be_const_str_webclient); -be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will cause a restart.\");'>", 232646018u, 0, 57, &be_const_str_wire2); -be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will change the current configuration and cause a restart.\");'>", 3792412559u, 0, 94, &be_const_str_srand); -be_define_const_str(open, "open", 3546203337u, 0, 4, &be_const_str_search); +be_define_const_str(offset, "offset", 348705738u, 0, 6, &be_const_str_on); +be_define_const_str(offseta, "offseta", 1663383089u, 0, 7, &be_const_str_set_style_text_font); +be_define_const_str(on, "on", 1630810064u, 0, 2, NULL); +be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will cause a restart.\");'>", 232646018u, 0, 57, NULL); +be_define_const_str(onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20change_X20the_X20current_X20configuration_X20and_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, "onsubmit='return confirm(\"This will change the current configuration and cause a restart.\");'>", 3792412559u, 0, 94, NULL); +be_define_const_str(open, "open", 3546203337u, 0, 4, &be_const_str_resp_cmnd_done); be_define_const_str(out_X20of_X20range, "out of range", 2236631477u, 0, 12, NULL); be_define_const_str(p1, "p1", 2689521274u, 0, 2, NULL); -be_define_const_str(p2, "p2", 2672743655u, 0, 2, &be_const_str_set_alternate); -be_define_const_str(page_autoconf_ctl, "page_autoconf_ctl", 2453381496u, 0, 17, NULL); -be_define_const_str(page_autoconf_mgr, "page_autoconf_mgr", 3643937031u, 0, 17, &be_const_str_write8); -be_define_const_str(param, "param", 1309554226u, 0, 5, &be_const_str_resp_cmnd_error); -be_define_const_str(path, "path", 2223459638u, 0, 4, &be_const_str_real); -be_define_const_str(pc, "pc", 1313756516u, 0, 2, &be_const_str_nil); -be_define_const_str(pc_abs, "pc_abs", 920256495u, 0, 6, &be_const_str_set); -be_define_const_str(pc_rel, "pc_rel", 991921176u, 0, 6, &be_const_str_web_add_config_button); -be_define_const_str(percentage, "percentage", 2538831285u, 0, 10, &be_const_str_tcpclient); -be_define_const_str(persist, "persist", 3917083779u, 0, 7, NULL); -be_define_const_str(persist_X2E_p_X20is_X20not_X20a_X20map, "persist._p is not a map", 1176528732u, 0, 23, NULL); -be_define_const_str(pi, "pi", 1213090802u, 0, 2, NULL); -be_define_const_str(pin, "pin", 1866532500u, 0, 3, NULL); -be_define_const_str(pin_mode, "pin_mode", 3258314030u, 0, 8, &be_const_str_set_ldo_voltage); -be_define_const_str(pin_used, "pin_used", 4033854612u, 0, 8, &be_const_str_set_auth); +be_define_const_str(p2, "p2", 2672743655u, 0, 2, &be_const_str_the_X20second_X20argument_X20is_X20not_X20a_X20function); +be_define_const_str(page_autoconf_ctl, "page_autoconf_ctl", 2453381496u, 0, 17, &be_const_str_pc); +be_define_const_str(page_autoconf_mgr, "page_autoconf_mgr", 3643937031u, 0, 17, &be_const_str_return_X20code_X3D_X25i); +be_define_const_str(param, "param", 1309554226u, 0, 5, &be_const_str_set_style_line_color); +be_define_const_str(path, "path", 2223459638u, 0, 4, &be_const_str_read32); +be_define_const_str(pc, "pc", 1313756516u, 0, 2, NULL); +be_define_const_str(pc_abs, "pc_abs", 920256495u, 0, 6, NULL); +be_define_const_str(pc_rel, "pc_rel", 991921176u, 0, 6, &be_const_str_print); +be_define_const_str(percentage, "percentage", 2538831285u, 0, 10, NULL); +be_define_const_str(persist, "persist", 3917083779u, 0, 7, &be_const_str_serial); +be_define_const_str(persist_X2E_p_X20is_X20not_X20a_X20map, "persist._p is not a map", 1176528732u, 0, 23, &be_const_str_quality); +be_define_const_str(pi, "pi", 1213090802u, 0, 2, &be_const_str_yield); +be_define_const_str(pin, "pin", 1866532500u, 0, 3, &be_const_str_resp_cmnd_failed); +be_define_const_str(pin_mode, "pin_mode", 3258314030u, 0, 8, NULL); +be_define_const_str(pin_used, "pin_used", 4033854612u, 0, 8, NULL); be_define_const_str(pixel_count, "pixel_count", 2439130743u, 0, 11, NULL); be_define_const_str(pixel_size, "pixel_size", 2209135785u, 0, 10, NULL); -be_define_const_str(pixels_buffer, "pixels_buffer", 1229555807u, 0, 13, NULL); +be_define_const_str(pixels_buffer, "pixels_buffer", 1229555807u, 0, 13, &be_const_str_select); be_define_const_str(point, "point", 414084241u, 0, 5, NULL); -be_define_const_str(pop, "pop", 1362321360u, 0, 3, &be_const_str_resp_cmnd_failed); -be_define_const_str(pop_path, "pop_path", 2403243998u, 0, 8, NULL); -be_define_const_str(pow, "pow", 1479764693u, 0, 3, &be_const_str_seg7_font); -be_define_const_str(preinit, "preinit", 2722007100u, 0, 7, &be_const_str_widget_ctor_cb); -be_define_const_str(print, "print", 372738696u, 0, 5, NULL); -be_define_const_str(public_key, "public_key", 4169142980u, 0, 10, &be_const_str_read32); +be_define_const_str(pop, "pop", 1362321360u, 0, 3, NULL); +be_define_const_str(pop_path, "pop_path", 2403243998u, 0, 8, &be_const_str_rand); +be_define_const_str(pow, "pow", 1479764693u, 0, 3, &be_const_str_setbits); +be_define_const_str(preinit, "preinit", 2722007100u, 0, 7, &be_const_str_widget_dtor_impl); +be_define_const_str(print, "print", 372738696u, 0, 5, &be_const_str_save_before_restart); +be_define_const_str(public_key, "public_key", 4169142980u, 0, 10, NULL); be_define_const_str(publish, "publish", 264247304u, 0, 7, NULL); -be_define_const_str(publish_result, "publish_result", 2013351252u, 0, 14, &be_const_str_skip); -be_define_const_str(push, "push", 2272264157u, 0, 4, &be_const_str_width); -be_define_const_str(push_path, "push_path", 1155254157u, 0, 9, NULL); -be_define_const_str(quality, "quality", 2597670950u, 0, 7, &be_const_str_else); -be_define_const_str(r, "r", 4144776981u, 0, 1, &be_const_str_set_light); -be_define_const_str(rad, "rad", 1358899048u, 0, 3, &be_const_str_set_ldo_enable); +be_define_const_str(publish_result, "publish_result", 2013351252u, 0, 14, &be_const_str_set_width); +be_define_const_str(push, "push", 2272264157u, 0, 4, NULL); +be_define_const_str(push_path, "push_path", 1155254157u, 0, 9, &be_const_str_split); +be_define_const_str(quality, "quality", 2597670950u, 0, 7, NULL); +be_define_const_str(r, "r", 4144776981u, 0, 1, NULL); +be_define_const_str(rad, "rad", 1358899048u, 0, 3, &be_const_str_setitem); be_define_const_str(raise, "raise", 1593437475u, 70, 5, NULL); -be_define_const_str(rand, "rand", 2711325910u, 0, 4, NULL); -be_define_const_str(range, "range", 4208725202u, 0, 5, &be_const_str_reverse_gamma10); +be_define_const_str(rand, "rand", 2711325910u, 0, 4, &be_const_str_run_bat); +be_define_const_str(range, "range", 4208725202u, 0, 5, NULL); be_define_const_str(read, "read", 3470762949u, 0, 4, NULL); be_define_const_str(read12, "read12", 4291076970u, 0, 6, NULL); be_define_const_str(read13, "read13", 12887293u, 0, 6, NULL); be_define_const_str(read24, "read24", 1808533811u, 0, 6, NULL); be_define_const_str(read32, "read32", 1741276240u, 0, 6, NULL); -be_define_const_str(read8, "read8", 2802788167u, 0, 5, NULL); +be_define_const_str(read8, "read8", 2802788167u, 0, 5, &be_const_str_type); be_define_const_str(read_bytes, "read_bytes", 3576733173u, 0, 10, NULL); -be_define_const_str(read_sensors, "read_sensors", 892689201u, 0, 12, &be_const_str_round_end); +be_define_const_str(read_sensors, "read_sensors", 892689201u, 0, 12, NULL); be_define_const_str(readbytes, "readbytes", 2716426756u, 0, 9, NULL); be_define_const_str(readline, "readline", 1212709927u, 0, 8, NULL); -be_define_const_str(real, "real", 3604983901u, 0, 4, NULL); -be_define_const_str(reapply, "reapply", 3778939332u, 0, 7, NULL); -be_define_const_str(redirect, "redirect", 389758641u, 0, 8, &be_const_str_rtc); -be_define_const_str(reduce, "reduce", 2002030311u, 0, 6, &be_const_str_sec); -be_define_const_str(refr_size, "refr_size", 1958144468u, 0, 9, &be_const_str_target_search); -be_define_const_str(register_obj, "register_obj", 3982614770u, 0, 12, &be_const_str_sys); -be_define_const_str(remove, "remove", 3683784189u, 0, 6, NULL); +be_define_const_str(real, "real", 3604983901u, 0, 4, &be_const_str_tcpclient); +be_define_const_str(reapply, "reapply", 3778939332u, 0, 7, &be_const_str_settings); +be_define_const_str(redirect, "redirect", 389758641u, 0, 8, NULL); +be_define_const_str(refr_size, "refr_size", 1958144468u, 0, 9, &be_const_str_toupper); +be_define_const_str(register_obj, "register_obj", 3982614770u, 0, 12, NULL); +be_define_const_str(remove, "remove", 3683784189u, 0, 6, &be_const_str_seg7_font); be_define_const_str(remove_cmd, "remove_cmd", 3832315702u, 0, 10, NULL); -be_define_const_str(remove_driver, "remove_driver", 1030243768u, 0, 13, &be_const_str_tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29); -be_define_const_str(remove_rule, "remove_rule", 3456211328u, 0, 11, &be_const_str_except); +be_define_const_str(remove_driver, "remove_driver", 1030243768u, 0, 13, &be_const_str_for); +be_define_const_str(remove_rule, "remove_rule", 3456211328u, 0, 11, &be_const_str_import); be_define_const_str(remove_timer, "remove_timer", 4141472215u, 0, 12, NULL); be_define_const_str(reset, "reset", 1695364032u, 0, 5, NULL); be_define_const_str(reset_search, "reset_search", 1350414305u, 0, 12, NULL); -be_define_const_str(resize, "resize", 3514612129u, 0, 6, NULL); +be_define_const_str(resize, "resize", 3514612129u, 0, 6, &be_const_str_set); be_define_const_str(resolvecmnd, "resolvecmnd", 993361485u, 0, 11, NULL); -be_define_const_str(resp_cmnd, "resp_cmnd", 2869459626u, 0, 9, &be_const_str_widget_editable); +be_define_const_str(resp_cmnd, "resp_cmnd", 2869459626u, 0, 9, &be_const_str_update); be_define_const_str(resp_cmnd_done, "resp_cmnd_done", 2601874875u, 0, 14, NULL); be_define_const_str(resp_cmnd_error, "resp_cmnd_error", 2404088863u, 0, 15, NULL); -be_define_const_str(resp_cmnd_failed, "resp_cmnd_failed", 2136281562u, 0, 16, &be_const_str_set_chg_current); +be_define_const_str(resp_cmnd_failed, "resp_cmnd_failed", 2136281562u, 0, 16, &be_const_str_web_add_management_button); be_define_const_str(resp_cmnd_str, "resp_cmnd_str", 737845590u, 0, 13, NULL); -be_define_const_str(response_append, "response_append", 450346371u, 0, 15, &be_const_str_set_first_time); +be_define_const_str(response_append, "response_append", 450346371u, 0, 15, NULL); be_define_const_str(return, "return", 2246981567u, 60, 6, NULL); be_define_const_str(return_X20code_X3D_X25i, "return code=%i", 2127454401u, 0, 14, NULL); be_define_const_str(reverse, "reverse", 558918661u, 0, 7, NULL); be_define_const_str(reverse_gamma10, "reverse_gamma10", 739112262u, 0, 15, NULL); be_define_const_str(rotate, "rotate", 2784296202u, 0, 6, NULL); -be_define_const_str(round_end, "round_end", 985288225u, 0, 9, &be_const_str_strftime); -be_define_const_str(round_start, "round_start", 2949484384u, 0, 11, &be_const_str_sqrt); -be_define_const_str(rtc, "rtc", 1070575216u, 0, 3, NULL); -be_define_const_str(rule, "rule", 4230889683u, 0, 4, &be_const_str_settings); -be_define_const_str(run, "run", 718098122u, 0, 3, &be_const_str_set_style_line_color); -be_define_const_str(run_bat, "run_bat", 2536903298u, 0, 7, &be_const_str_valuer_error); +be_define_const_str(round_end, "round_end", 985288225u, 0, 9, &be_const_str_set_ldo_enable); +be_define_const_str(round_start, "round_start", 2949484384u, 0, 11, NULL); +be_define_const_str(rtc, "rtc", 1070575216u, 0, 3, &be_const_str_web_add_button); +be_define_const_str(rule, "rule", 4230889683u, 0, 4, &be_const_str_valuer_error); +be_define_const_str(run, "run", 718098122u, 0, 3, &be_const_str_toptr); +be_define_const_str(run_bat, "run_bat", 2536903298u, 0, 7, NULL); be_define_const_str(run_deferred, "run_deferred", 371594696u, 0, 12, NULL); -be_define_const_str(running, "running", 343848780u, 0, 7, &be_const_str_string); +be_define_const_str(running, "running", 343848780u, 0, 7, NULL); be_define_const_str(save, "save", 3439296072u, 0, 4, NULL); -be_define_const_str(save_before_restart, "save_before_restart", 1253239338u, 0, 19, NULL); -be_define_const_str(scale_uint, "scale_uint", 3090811094u, 0, 10, &be_const_str_widget_group_def); +be_define_const_str(save_before_restart, "save_before_restart", 1253239338u, 0, 19, &be_const_str_scale_uint); +be_define_const_str(scale_uint, "scale_uint", 3090811094u, 0, 10, &be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D); be_define_const_str(scan, "scan", 3974641896u, 0, 4, NULL); be_define_const_str(search, "search", 2150836393u, 0, 6, NULL); be_define_const_str(sec, "sec", 3139892658u, 0, 3, NULL); -be_define_const_str(seg7_font, "seg7_font", 4099690689u, 0, 9, &be_const_str_set_useragent); -be_define_const_str(select, "select", 297952813u, 0, 6, NULL); -be_define_const_str(serial, "serial", 3687697785u, 0, 6, NULL); -be_define_const_str(set, "set", 3324446467u, 0, 3, NULL); -be_define_const_str(set_alternate, "set_alternate", 1709680562u, 0, 13, &be_const_str_widget_event); -be_define_const_str(set_auth, "set_auth", 1057170930u, 0, 8, &be_const_str_update); -be_define_const_str(set_bri, "set_bri", 2789118779u, 0, 7, &be_const_str_str); +be_define_const_str(seg7_font, "seg7_font", 4099690689u, 0, 9, NULL); +be_define_const_str(select, "select", 297952813u, 0, 6, &be_const_str_static); +be_define_const_str(serial, "serial", 3687697785u, 0, 6, &be_const_str_set_y); +be_define_const_str(set, "set", 3324446467u, 0, 3, &be_const_str_time_dump); +be_define_const_str(set_alternate, "set_alternate", 1709680562u, 0, 13, NULL); +be_define_const_str(set_auth, "set_auth", 1057170930u, 0, 8, NULL); +be_define_const_str(set_bri, "set_bri", 2789118779u, 0, 7, NULL); be_define_const_str(set_chg_current, "set_chg_current", 336304386u, 0, 15, NULL); be_define_const_str(set_dc_voltage, "set_dc_voltage", 2181981936u, 0, 14, NULL); -be_define_const_str(set_dcdc_enable, "set_dcdc_enable", 1594690786u, 0, 15, &be_const_str_class); -be_define_const_str(set_first_time, "set_first_time", 3111247550u, 0, 14, &be_const_str_tan); +be_define_const_str(set_dcdc_enable, "set_dcdc_enable", 1594690786u, 0, 15, NULL); +be_define_const_str(set_first_time, "set_first_time", 3111247550u, 0, 14, NULL); be_define_const_str(set_height, "set_height", 1080207399u, 0, 10, NULL); be_define_const_str(set_ldo_enable, "set_ldo_enable", 2916502041u, 0, 14, NULL); be_define_const_str(set_ldo_voltage, "set_ldo_voltage", 4090501160u, 0, 15, NULL); be_define_const_str(set_light, "set_light", 3176076152u, 0, 9, NULL); be_define_const_str(set_matrix_pixel_color, "set_matrix_pixel_color", 1197149462u, 0, 22, NULL); -be_define_const_str(set_percentage, "set_percentage", 2952022724u, 0, 14, &be_const_str__X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D); +be_define_const_str(set_percentage, "set_percentage", 2952022724u, 0, 14, &be_const_str_to_gamma); be_define_const_str(set_pixel_color, "set_pixel_color", 1275248356u, 0, 15, NULL); -be_define_const_str(set_power, "set_power", 549820893u, 0, 9, &be_const_str_v); +be_define_const_str(set_power, "set_power", 549820893u, 0, 9, NULL); be_define_const_str(set_style_bg_color, "set_style_bg_color", 1689513089u, 0, 18, NULL); be_define_const_str(set_style_line_color, "set_style_line_color", 3665238976u, 0, 20, NULL); be_define_const_str(set_style_pad_right, "set_style_pad_right", 3314069054u, 0, 19, NULL); -be_define_const_str(set_style_text_font, "set_style_text_font", 1028590019u, 0, 19, &be_const_str_widget_ctor_impl); +be_define_const_str(set_style_text_font, "set_style_text_font", 1028590019u, 0, 19, &be_const_str_x); be_define_const_str(set_text, "set_text", 1849641155u, 0, 8, NULL); -be_define_const_str(set_time, "set_time", 900236405u, 0, 8, &be_const_str_if); -be_define_const_str(set_timeouts, "set_timeouts", 3732850900u, 0, 12, NULL); -be_define_const_str(set_timer, "set_timer", 2135414533u, 0, 9, &be_const_str_for); -be_define_const_str(set_useragent, "set_useragent", 612237244u, 0, 13, NULL); -be_define_const_str(set_width, "set_width", 484671920u, 0, 9, NULL); -be_define_const_str(set_x, "set_x", 1849400772u, 0, 5, &be_const_str_var); -be_define_const_str(set_y, "set_y", 1866178391u, 0, 5, &be_const_str_raise); -be_define_const_str(setbits, "setbits", 2762408167u, 0, 7, &be_const_str_super); +be_define_const_str(set_time, "set_time", 900236405u, 0, 8, NULL); +be_define_const_str(set_timeouts, "set_timeouts", 3732850900u, 0, 12, &be_const_str_show); +be_define_const_str(set_timer, "set_timer", 2135414533u, 0, 9, NULL); +be_define_const_str(set_useragent, "set_useragent", 612237244u, 0, 13, &be_const_str_tasmota); +be_define_const_str(set_width, "set_width", 484671920u, 0, 9, &be_const_str_write_bit); +be_define_const_str(set_x, "set_x", 1849400772u, 0, 5, &be_const_str_target); +be_define_const_str(set_y, "set_y", 1866178391u, 0, 5, NULL); +be_define_const_str(setbits, "setbits", 2762408167u, 0, 7, NULL); be_define_const_str(seti, "seti", 1500556254u, 0, 4, NULL); be_define_const_str(setitem, "setitem", 1554834596u, 0, 7, NULL); -be_define_const_str(setmember, "setmember", 1432909441u, 0, 9, NULL); -be_define_const_str(setrange, "setrange", 3794019032u, 0, 8, NULL); +be_define_const_str(setmember, "setmember", 1432909441u, 0, 9, &be_const_str_stop); +be_define_const_str(setrange, "setrange", 3794019032u, 0, 8, &be_const_str_value); be_define_const_str(settings, "settings", 1745255176u, 0, 8, NULL); -be_define_const_str(shared_key, "shared_key", 2200833624u, 0, 10, NULL); +be_define_const_str(shared_key, "shared_key", 2200833624u, 0, 10, &be_const_str_tan); be_define_const_str(show, "show", 2840060476u, 0, 4, NULL); -be_define_const_str(sin, "sin", 3761252941u, 0, 3, &be_const_str_widget_constructor); +be_define_const_str(sin, "sin", 3761252941u, 0, 3, NULL); be_define_const_str(sinh, "sinh", 282220607u, 0, 4, NULL); -be_define_const_str(size, "size", 597743964u, 0, 4, &be_const_str_top); -be_define_const_str(skip, "skip", 1097563074u, 0, 4, &be_const_str_tr); -be_define_const_str(solidified, "solidified", 3257553487u, 0, 10, NULL); -be_define_const_str(split, "split", 2276994531u, 0, 5, &be_const_str__X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); -be_define_const_str(sqrt, "sqrt", 2112764879u, 0, 4, &be_const_str_widget_cb); +be_define_const_str(size, "size", 597743964u, 0, 4, &be_const_str_sys); +be_define_const_str(skip, "skip", 1097563074u, 0, 4, NULL); +be_define_const_str(solidified, "solidified", 3257553487u, 0, 10, &be_const_str_tr); +be_define_const_str(split, "split", 2276994531u, 0, 5, &be_const_str_upper); +be_define_const_str(sqrt, "sqrt", 2112764879u, 0, 4, &be_const_str_tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29); be_define_const_str(srand, "srand", 465518633u, 0, 5, NULL); be_define_const_str(start, "start", 1697318111u, 0, 5, NULL); -be_define_const_str(state, "state", 2016490230u, 0, 5, NULL); +be_define_const_str(state, "state", 2016490230u, 0, 5, &be_const_str_write_bytes); be_define_const_str(static, "static", 3532702267u, 71, 6, NULL); be_define_const_str(stop, "stop", 3411225317u, 0, 4, NULL); be_define_const_str(stop_iteration, "stop_iteration", 4173793901u, 0, 14, NULL); -be_define_const_str(str, "str", 3259748752u, 0, 3, NULL); +be_define_const_str(str, "str", 3259748752u, 0, 3, &be_const_str_end); be_define_const_str(strftime, "strftime", 187738851u, 0, 8, NULL); -be_define_const_str(string, "string", 398550328u, 0, 6, NULL); +be_define_const_str(string, "string", 398550328u, 0, 6, &be_const_str_false); be_define_const_str(strip, "strip", 4246411473u, 0, 5, NULL); -be_define_const_str(strptime, "strptime", 1277910361u, 0, 8, &be_const_str_wire_scan); +be_define_const_str(strptime, "strptime", 1277910361u, 0, 8, NULL); be_define_const_str(super, "super", 4152230356u, 0, 5, NULL); be_define_const_str(sys, "sys", 3277365014u, 0, 3, NULL); be_define_const_str(tag, "tag", 2516003219u, 0, 3, NULL); -be_define_const_str(tan, "tan", 2633446552u, 0, 3, NULL); -be_define_const_str(tanh, "tanh", 153638352u, 0, 4, &be_const_str__X7B); -be_define_const_str(target, "target", 845187144u, 0, 6, &be_const_str_widget_width_def); -be_define_const_str(target_search, "target_search", 1947846553u, 0, 13, &be_const_str_url_encode); -be_define_const_str(tasmota, "tasmota", 424643812u, 0, 7, &be_const_str_value_error); -be_define_const_str(tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29, "tasmota.get_light() is deprecated, use light.get()", 3525753647u, 0, 50, &be_const_str_while); +be_define_const_str(tan, "tan", 2633446552u, 0, 3, &be_const_str_do); +be_define_const_str(tanh, "tanh", 153638352u, 0, 4, NULL); +be_define_const_str(target, "target", 845187144u, 0, 6, NULL); +be_define_const_str(target_search, "target_search", 1947846553u, 0, 13, NULL); +be_define_const_str(tasmota, "tasmota", 424643812u, 0, 7, NULL); +be_define_const_str(tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29, "tasmota.get_light() is deprecated, use light.get()", 3525753647u, 0, 50, NULL); be_define_const_str(tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29, "tasmota.set_light() is deprecated, use light.set()", 2124937871u, 0, 50, NULL); -be_define_const_str(tcpclient, "tcpclient", 3828797983u, 0, 9, NULL); -be_define_const_str(tele, "tele", 3474458061u, 0, 4, &be_const_str_time_dump); +be_define_const_str(tcpclient, "tcpclient", 3828797983u, 0, 9, &be_const_str_time_reached); +be_define_const_str(tele, "tele", 3474458061u, 0, 4, NULL); be_define_const_str(the_X20second_X20argument_X20is_X20not_X20a_X20function, "the second argument is not a function", 3954574469u, 0, 37, NULL); be_define_const_str(time_dump, "time_dump", 3330410747u, 0, 9, NULL); -be_define_const_str(time_reached, "time_reached", 2075136773u, 0, 12, &be_const_str__X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); -be_define_const_str(time_str, "time_str", 2613827612u, 0, 8, NULL); -be_define_const_str(to_gamma, "to_gamma", 1597139862u, 0, 8, &be_const_str_value); -be_define_const_str(tob64, "tob64", 373777640u, 0, 5, NULL); -be_define_const_str(tolower, "tolower", 1042520049u, 0, 7, NULL); +be_define_const_str(time_reached, "time_reached", 2075136773u, 0, 12, NULL); +be_define_const_str(time_str, "time_str", 2613827612u, 0, 8, &be_const_str_wd); +be_define_const_str(to_gamma, "to_gamma", 1597139862u, 0, 8, &be_const_str_web_sensor); +be_define_const_str(tob64, "tob64", 373777640u, 0, 5, &be_const_str_y); +be_define_const_str(tolower, "tolower", 1042520049u, 0, 7, &be_const_str_wire1); be_define_const_str(tomap, "tomap", 612167626u, 0, 5, NULL); be_define_const_str(top, "top", 2802900028u, 0, 3, NULL); be_define_const_str(toptr, "toptr", 3379847454u, 0, 5, NULL); be_define_const_str(tostring, "tostring", 2299708645u, 0, 8, NULL); -be_define_const_str(toupper, "toupper", 3691983576u, 0, 7, &be_const_str_webserver); +be_define_const_str(toupper, "toupper", 3691983576u, 0, 7, &be_const_str_widget_event_cb); be_define_const_str(tr, "tr", 1195724803u, 0, 2, NULL); be_define_const_str(traceback, "traceback", 3385188109u, 0, 9, NULL); be_define_const_str(true, "true", 1303515621u, 61, 4, NULL); be_define_const_str(try, "try", 2887626766u, 68, 3, NULL); be_define_const_str(try_rule, "try_rule", 1986449405u, 0, 8, NULL); be_define_const_str(type, "type", 1361572173u, 0, 4, NULL); -be_define_const_str(unknown_X20instruction, "unknown instruction", 1093911841u, 0, 19, NULL); +be_define_const_str(unknown_X20instruction, "unknown instruction", 1093911841u, 0, 19, &be_const_str_raise); be_define_const_str(update, "update", 672109684u, 0, 6, NULL); be_define_const_str(upper, "upper", 176974407u, 0, 5, NULL); be_define_const_str(url_encode, "url_encode", 528392145u, 0, 10, NULL); -be_define_const_str(v, "v", 4077666505u, 0, 1, NULL); +be_define_const_str(v, "v", 4077666505u, 0, 1, &be_const_str_widget_struct_default); be_define_const_str(value, "value", 1113510858u, 0, 5, NULL); be_define_const_str(value_error, "value_error", 773297791u, 0, 11, NULL); be_define_const_str(valuer_error, "valuer_error", 2567947105u, 0, 12, NULL); be_define_const_str(var, "var", 2317739966u, 64, 3, NULL); -be_define_const_str(w, "w", 4060888886u, 0, 1, NULL); -be_define_const_str(wd, "wd", 1531424278u, 0, 2, NULL); +be_define_const_str(w, "w", 4060888886u, 0, 1, &be_const_str__X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D); +be_define_const_str(wd, "wd", 1531424278u, 0, 2, &be_const_str_except); be_define_const_str(web_add_button, "web_add_button", 3537875058u, 0, 14, NULL); be_define_const_str(web_add_config_button, "web_add_config_button", 639674325u, 0, 21, NULL); be_define_const_str(web_add_console_button, "web_add_console_button", 3481436192u, 0, 22, NULL); be_define_const_str(web_add_handler, "web_add_handler", 3990174962u, 0, 15, NULL); be_define_const_str(web_add_main_button, "web_add_main_button", 3960367664u, 0, 19, NULL); -be_define_const_str(web_add_management_button, "web_add_management_button", 2738877186u, 0, 25, &be_const_str_do); +be_define_const_str(web_add_management_button, "web_add_management_button", 2738877186u, 0, 25, NULL); be_define_const_str(web_send, "web_send", 2989941448u, 0, 8, NULL); be_define_const_str(web_send_decimal, "web_send_decimal", 1407210204u, 0, 16, NULL); -be_define_const_str(web_sensor, "web_sensor", 2900096972u, 0, 10, &be_const_str_write_gpio); -be_define_const_str(webclient, "webclient", 4076389146u, 0, 9, NULL); +be_define_const_str(web_sensor, "web_sensor", 2900096972u, 0, 10, &be_const_str_nil); +be_define_const_str(webclient, "webclient", 4076389146u, 0, 9, &be_const_str_while); be_define_const_str(webserver, "webserver", 1572454038u, 0, 9, NULL); be_define_const_str(while, "while", 231090382u, 53, 5, NULL); be_define_const_str(widget_cb, "widget_cb", 2763583055u, 0, 9, NULL); @@ -702,19 +701,19 @@ be_define_const_str(widget_dtor_cb, "widget_dtor_cb", 3151545845u, 0, 14, NULL); be_define_const_str(widget_dtor_impl, "widget_dtor_impl", 520430610u, 0, 16, NULL); be_define_const_str(widget_editable, "widget_editable", 3821793286u, 0, 15, NULL); be_define_const_str(widget_event, "widget_event", 1951408186u, 0, 12, NULL); -be_define_const_str(widget_event_cb, "widget_event_cb", 1508466754u, 0, 15, NULL); +be_define_const_str(widget_event_cb, "widget_event_cb", 1508466754u, 0, 15, &be_const_str_year); be_define_const_str(widget_event_impl, "widget_event_impl", 2178430561u, 0, 17, NULL); be_define_const_str(widget_group_def, "widget_group_def", 1246968785u, 0, 16, NULL); be_define_const_str(widget_height_def, "widget_height_def", 3131667813u, 0, 17, NULL); be_define_const_str(widget_instance_size, "widget_instance_size", 2055354779u, 0, 20, NULL); -be_define_const_str(widget_struct_by_class, "widget_struct_by_class", 3806373842u, 0, 22, NULL); +be_define_const_str(widget_struct_by_class, "widget_struct_by_class", 3806373842u, 0, 22, &be_const_str_x1); be_define_const_str(widget_struct_default, "widget_struct_default", 781673633u, 0, 21, NULL); be_define_const_str(widget_width_def, "widget_width_def", 3986078862u, 0, 16, NULL); -be_define_const_str(width, "width", 2508680735u, 0, 5, NULL); +be_define_const_str(width, "width", 2508680735u, 0, 5, &be_const_str_true); be_define_const_str(width_def, "width_def", 1143717879u, 0, 9, NULL); -be_define_const_str(wifi, "wifi", 120087624u, 0, 4, NULL); +be_define_const_str(wifi, "wifi", 120087624u, 0, 4, &be_const_str_write8); be_define_const_str(wire, "wire", 4082753944u, 0, 4, NULL); -be_define_const_str(wire1, "wire1", 3212721419u, 0, 5, &be_const_str_true); +be_define_const_str(wire1, "wire1", 3212721419u, 0, 5, NULL); be_define_const_str(wire2, "wire2", 3229499038u, 0, 5, NULL); be_define_const_str(wire_scan, "wire_scan", 2671275880u, 0, 9, NULL); be_define_const_str(write, "write", 3190202204u, 0, 5, NULL); @@ -741,369 +740,368 @@ be_define_const_str(_X7B_X7D, "{}", 1415952421u, 0, 2, NULL); be_define_const_str(_X7D, "}", 4161554600u, 0, 1, NULL); static const bstring* const m_string_table[] = { - (const bstring *)&be_const_str__X3E_X3D, - (const bstring *)&be_const_str_run_bat, NULL, - NULL, - (const bstring *)&be_const_str_io_error, - (const bstring *)&be_const_str_depower, - (const bstring *)&be_const_str_SERIAL_6O1, - (const bstring *)&be_const_str_STATE_DEFAULT, - (const bstring *)&be_const_str_SERIAL_6N1, - (const bstring *)&be_const_str_Auto_X2Dconfiguration, - (const bstring *)&be_const_str_decrypt, - (const bstring *)&be_const_str_insert, - NULL, - (const bstring *)&be_const_str__X3D, - (const bstring *)&be_const_str_write_bytes, - NULL, - (const bstring *)&be_const_str_running, - (const bstring *)&be_const_str_onsubmit_X3D_X27return_X20confirm_X28_X22This_X20will_X20cause_X20a_X20restart_X2E_X22_X29_X3B_X27_X3E, - (const bstring *)&be_const_str_read_bytes, - (const bstring *)&be_const_str_draw_arc, - (const bstring *)&be_const_str__X20, - (const bstring *)&be_const_str_event, - (const bstring *)&be_const_str_SERIAL_5E2, - (const bstring *)&be_const_str_SERIAL_6E1, - (const bstring *)&be_const_str_leds, - (const bstring *)&be_const_str__lvgl, - (const bstring *)&be_const_str_zip, - (const bstring *)&be_const_str_EC_C25519, - (const bstring *)&be_const_str_COLOR_BLACK, - (const bstring *)&be_const_str_readline, - (const bstring *)&be_const_str__X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, - NULL, - (const bstring *)&be_const_str_load_templates, - (const bstring *)&be_const_str_get, - (const bstring *)&be_const_str_POST, - (const bstring *)&be_const_str___iterator__, - (const bstring *)&be_const_str_AudioGeneratorMP3, - (const bstring *)&be_const_str__energy, - (const bstring *)&be_const_str__rules, - (const bstring *)&be_const_str_break, - (const bstring *)&be_const_str__X2F_X2Eautoconf, (const bstring *)&be_const_str_content_button, - (const bstring *)&be_const_str_copy, - (const bstring *)&be_const_str_get_aps_voltage, - (const bstring *)&be_const_str_AXP192, - (const bstring *)&be_const_str_select, - (const bstring *)&be_const_str_autoexec, - (const bstring *)&be_const_str__X0A, - (const bstring *)&be_const_str_available, - NULL, - (const bstring *)&be_const_str__X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, - (const bstring *)&be_const_str_gc, - (const bstring *)&be_const_str_CFG_X3A_X20loading_X20_X27_X25s_X27, - (const bstring *)&be_const_str__X21_X3D_X3D, - (const bstring *)&be_const_str_split, - (const bstring *)&be_const_str_lower, - (const bstring *)&be_const_str__X3Clabel_X3EChoose_X20a_X20device_X20configuration_X3A_X3C_X2Flabel_X3E_X3Cbr_X3E, - (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, - (const bstring *)&be_const_str_base_class, - (const bstring *)&be_const_str_connected, - (const bstring *)&be_const_str_instance, - NULL, - (const bstring *)&be_const_str__X2Etapp, - (const bstring *)&be_const_str__X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_attrdump, - (const bstring *)&be_const_str_EVENT_DRAW_MAIN, - (const bstring *)&be_const_str__request_from, - (const bstring *)&be_const_str__X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_acos, - (const bstring *)&be_const_str_get_light, - (const bstring *)&be_const_str_resp_cmnd_str, - NULL, - (const bstring *)&be_const_str_CFG_X3A_X20removing_X20autoconf_X20files, - NULL, - (const bstring *)&be_const_str_w, - (const bstring *)&be_const_str_draw_line, - NULL, - (const bstring *)&be_const_str_strip, - (const bstring *)&be_const_str_format, - (const bstring *)&be_const_str_Leds, - (const bstring *)&be_const_str_exec_tele, - (const bstring *)&be_const_str_chars_in_string, - (const bstring *)&be_const_str_CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, - NULL, - (const bstring *)&be_const_str_widget_dtor_cb, - (const bstring *)&be_const_str_invalidate, - (const bstring *)&be_const_str__X3A, - NULL, - (const bstring *)&be_const_str_out_X20of_X20range, - NULL, - (const bstring *)&be_const_str_lv_event_cb, - (const bstring *)&be_const_str_LVG_X3A_X20call_X20to_X20unsupported_X20callback, - (const bstring *)&be_const_str_escape, - (const bstring *)&be_const_str_event_cb, - (const bstring *)&be_const_str_init_draw_line_dsc, - NULL, - (const bstring *)&be_const_str_isinstance, - (const bstring *)&be_const_str_exists, - (const bstring *)&be_const_str_HTTP_GET, - (const bstring *)&be_const_str_clear_first_time, - (const bstring *)&be_const_str__X2Eautoconf, - (const bstring *)&be_const_str_clear, - (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, - (const bstring *)&be_const_str_SERIAL_7N1, - (const bstring *)&be_const_str_get_percentage, - (const bstring *)&be_const_str_SERIAL_7O1, - (const bstring *)&be_const_str_remove, - (const bstring *)&be_const_str_set_time, - (const bstring *)&be_const_str_get_size, - (const bstring *)&be_const_str_remove_timer, - (const bstring *)&be_const_str__X23autoexec_X2Ebat, - (const bstring *)&be_const_str__X2D_X2D_X3A_X2D_X2D, - (const bstring *)&be_const_str_due, - (const bstring *)&be_const_str__X2C, - (const bstring *)&be_const_str_instance_size, - (const bstring *)&be_const_str_Animate_X20pc_X20is_X20out_X20of_X20range, - (const bstring *)&be_const_str_cb, - (const bstring *)&be_const_str_resp_cmnd_done, - NULL, - (const bstring *)&be_const_str_energy_struct, - NULL, - (const bstring *)&be_const_str__drivers, - (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dzip_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, - (const bstring *)&be_const_str_tob64, - (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, - (const bstring *)&be_const_str_CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29, - (const bstring *)&be_const_str__X3C, - (const bstring *)&be_const_str_y, - (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_files, - (const bstring *)&be_const_str__X2Ew, - (const bstring *)&be_const_str_assert, - (const bstring *)&be_const_str_bytes, - (const bstring *)&be_const_str__X23, - (const bstring *)&be_const_str_abs, - (const bstring *)&be_const_str__X2E_X2E, - (const bstring *)&be_const_str__global_addr, - (const bstring *)&be_const_str_connect, - (const bstring *)&be_const_str__settings_ptr, - NULL, - (const bstring *)&be_const_str_CFG_X3A_X20ran_X20_X20, - (const bstring *)&be_const_str_BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, - NULL, - (const bstring *)&be_const_str__X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, - (const bstring *)&be_const_str_i2c_enabled, - (const bstring *)&be_const_str_ctypes_bytes_dyn, - (const bstring *)&be_const_str_CFG_X3A_X20loading_X20, - NULL, - NULL, - (const bstring *)&be_const_str_refr_size, - (const bstring *)&be_const_str_content_send_style, - NULL, - NULL, - (const bstring *)&be_const_str_begin, - (const bstring *)&be_const_str_c, - (const bstring *)&be_const_str_ins_goto, - (const bstring *)&be_const_str__buffer, - (const bstring *)&be_const_str_concat, - (const bstring *)&be_const_str_percentage, NULL, (const bstring *)&be_const_str_SERIAL_5N2, + (const bstring *)&be_const_str__X2Elen, + (const bstring *)&be_const_str_call_native, + (const bstring *)&be_const_str_EVENT_DRAW_PART_END, + (const bstring *)&be_const_str_alternate, + (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dzip_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, + (const bstring *)&be_const_str_read13, + (const bstring *)&be_const_str_dac_voltage, + (const bstring *)&be_const_str_widget_group_def, + (const bstring *)&be_const_str__begin_transmission, NULL, + (const bstring *)&be_const_str_a, + (const bstring *)&be_const_str_start, + (const bstring *)&be_const_str__p, + (const bstring *)&be_const_str_load, + (const bstring *)&be_const_str_delete_all_configs, + (const bstring *)&be_const_str_Auto_X2Dconfiguration, + (const bstring *)&be_const_str_clear, + (const bstring *)&be_const_str_page_autoconf_mgr, + (const bstring *)&be_const_str__dirty, + (const bstring *)&be_const_str_set_timer, NULL, - (const bstring *)&be_const_str_SK6812_GRBW, - (const bstring *)&be_const_str__X3Cp_X3E_X3Csmall_X3E_X26nbsp_X3B_X28This_X20feature_X20requires_X20an_X20internet_X20connection_X29_X3C_X2Fsmall_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, - NULL, - NULL, - (const bstring *)&be_const_str_lv_obj, - (const bstring *)&be_const_str___upper__, - (const bstring *)&be_const_str_Restart_X201, - NULL, - (const bstring *)&be_const_str_introspect, - (const bstring *)&be_const_str__X23autoexec_X2Ebe, - (const bstring *)&be_const_str_CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27, - (const bstring *)&be_const_str_bool, - (const bstring *)&be_const_str_PART_MAIN, - (const bstring *)&be_const_str_back_forth, - (const bstring *)&be_const_str_lv_obj_class, - (const bstring *)&be_const_str_TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, - (const bstring *)&be_const_str_GET, - (const bstring *)&be_const_str_deg, - (const bstring *)&be_const_str__X28_X29, - NULL, - (const bstring *)&be_const_str__X23preinit_X2Ebe, - (const bstring *)&be_const_str__class, - NULL, - (const bstring *)&be_const_str__X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, - (const bstring *)&be_const_str_CFG_X3A_X20downloading_X20_X27_X25s_X27, - (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, - (const bstring *)&be_const_str_fromstring, - (const bstring *)&be_const_str_SERIAL_8E2, - NULL, - (const bstring *)&be_const_str__anonymous_, - (const bstring *)&be_const_str__X2502d_X25s_X2502d, - (const bstring *)&be_const_str_CFG_X3A_X20return_code_X3D_X25i, - (const bstring *)&be_const_str_web_sensor, - (const bstring *)&be_const_str_detect, - (const bstring *)&be_const_str_exec_cmd, - (const bstring *)&be_const_str_to_gamma, - (const bstring *)&be_const_str__ptr, - (const bstring *)&be_const_str_null_cb, - (const bstring *)&be_const_str_eth, - (const bstring *)&be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_X2F_X25s_X2Eautoconf, - (const bstring *)&be_const_str_erase, - (const bstring *)&be_const_str__archive, - (const bstring *)&be_const_str_CFG_X3A_X20removed_X20file_X20_X27_X25s_X27, - (const bstring *)&be_const_str_code, - (const bstring *)&be_const_str_BUTTON_CONFIGURATION, - (const bstring *)&be_const_str_web_send_decimal, - (const bstring *)&be_const_str_fromptr, - (const bstring *)&be_const_str_SERIAL_8E1, - NULL, - (const bstring *)&be_const_str_set_style_bg_color, - (const bstring *)&be_const_str_end, - (const bstring *)&be_const_str__read, - (const bstring *)&be_const_str_cos, - (const bstring *)&be_const_str_codedump, - (const bstring *)&be_const_str__X23init_X2Ebat, - (const bstring *)&be_const_str_get_battery_chargin_status, - (const bstring *)&be_const_str__X2Ebec, - (const bstring *)&be_const_str_set_dcdc_enable, - NULL, - (const bstring *)&be_const_str_ctor, - (const bstring *)&be_const_str_digital_read, - (const bstring *)&be_const_str_close, - (const bstring *)&be_const_str__X2F, - (const bstring *)&be_const_str_cosh, - (const bstring *)&be_const_str_I2C_Driver, - (const bstring *)&be_const_str_read24, - (const bstring *)&be_const_str__write, - (const bstring *)&be_const_str__X23display_X2Eini, - (const bstring *)&be_const_str_get_bat_power, - (const bstring *)&be_const_str_pin_mode, - (const bstring *)&be_const_str__, - (const bstring *)&be_const_str_scale_uint, - (const bstring *)&be_const_str_WS2812_GRB, - (const bstring *)&be_const_str_AudioOutput, - (const bstring *)&be_const_str_animate, - (const bstring *)&be_const_str__X3F, - (const bstring *)&be_const_str_id, - (const bstring *)&be_const_str_arg_name, - (const bstring *)&be_const_str_internal_error, - (const bstring *)&be_const_str_serial, - NULL, + (const bstring *)&be_const_str_iter, + (const bstring *)&be_const_str_AudioGenerator, NULL, (const bstring *)&be_const_str_CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29, - (const bstring *)&be_const_str__begin_transmission, - (const bstring *)&be_const_str__X2Ep1, - (const bstring *)&be_const_str_engine, - (const bstring *)&be_const_str__def, - (const bstring *)&be_const_str_get_pixel_color, - (const bstring *)&be_const_str__X3C_X3D, - (const bstring *)&be_const_str_CFG_X3A_X20removing_X20first_X20time_X20marker, - (const bstring *)&be_const_str__X3D_X3D, - (const bstring *)&be_const_str_can_show, - (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, - (const bstring *)&be_const_str_response_append, - (const bstring *)&be_const_str_CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting, - (const bstring *)&be_const_str_content_send, - (const bstring *)&be_const_str_create_segment, - (const bstring *)&be_const_str_duration, - (const bstring *)&be_const_str_get_height, - (const bstring *)&be_const_str_delete_all_configs, - (const bstring *)&be_const_str_reset_search, + (const bstring *)&be_const_str_EC_C25519, + (const bstring *)&be_const_str__persist_X2Ejson, + (const bstring *)&be_const_str_width, + (const bstring *)&be_const_str_STATE_DEFAULT, + (const bstring *)&be_const_str_assert, + (const bstring *)&be_const_str_button_pressed, + (const bstring *)&be_const_str_Animate_X20pc_X20is_X20out_X20of_X20range, + (const bstring *)&be_const_str__X2Fac, + (const bstring *)&be_const_str__X2Ebec, + (const bstring *)&be_const_str_instance_size, + (const bstring *)&be_const_str_GET, + (const bstring *)&be_const_str_path, + (const bstring *)&be_const_str_tele, + (const bstring *)&be_const_str_geti, + (const bstring *)&be_const_str_write_file, + (const bstring *)&be_const_str__archive, (const bstring *)&be_const_str_BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson, - (const bstring *)&be_const_str_, - (const bstring *)&be_const_str_b, - (const bstring *)&be_const_str_SERIAL_5E1, - (const bstring *)&be_const_str_SERIAL_6E2, - (const bstring *)&be_const_str_read13, - (const bstring *)&be_const_str_BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, - (const bstring *)&be_const_str_publish_result, - (const bstring *)&be_const_str_get_bat_current, + (const bstring *)&be_const_str_CFG_X3A_X20return_code_X3D_X25i, + (const bstring *)&be_const_str_sin, + (const bstring *)&be_const_str_copy, + (const bstring *)&be_const_str_CFG_X3A_X20downloading_X20_X27_X25s_X27, NULL, - (const bstring *)&be_const_str_ceil, - (const bstring *)&be_const_str_autorun, - (const bstring *)&be_const_str_length_X20in_X20bits_X20must_X20be_X20between_X200_X20and_X2032, - (const bstring *)&be_const_str_set_text, - (const bstring *)&be_const_str__X3D_X3C_X3E_X21, - (const bstring *)&be_const_str_r, - (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X20, - (const bstring *)&be_const_str__X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str__X2Ep, - (const bstring *)&be_const_str__error, - (const bstring *)&be_const_str_lv, - (const bstring *)&be_const_str_flush, - (const bstring *)&be_const_str_AudioFileSource, - (const bstring *)&be_const_str_web_add_main_button, - (const bstring *)&be_const_str__X2Elen, - (const bstring *)&be_const_str_persist_X2E_p_X20is_X20not_X20a_X20map, - (const bstring *)&be_const_str_compile, + (const bstring *)&be_const_str__X21_X3D, + (const bstring *)&be_const_str__X2B, + (const bstring *)&be_const_str_cb_event_closure, + (const bstring *)&be_const_str_code, + NULL, + (const bstring *)&be_const_str_PART_MAIN, + (const bstring *)&be_const_str_target_search, (const bstring *)&be_const_str_CFG_X3A_X20running_X20, + (const bstring *)&be_const_str__X2Ep, + (const bstring *)&be_const_str_widget_struct_by_class, + (const bstring *)&be_const_str_CFG_X3A_X20removing_X20first_X20time_X20marker, + (const bstring *)&be_const_str_False, + (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, + (const bstring *)&be_const_str__X23preinit_X2Ebe, + (const bstring *)&be_const_str_bool, + NULL, + (const bstring *)&be_const_str__X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, + (const bstring *)&be_const_str_SERIAL_7N1, + (const bstring *)&be_const_str_file, + (const bstring *)&be_const_str_chars_in_string, + (const bstring *)&be_const_str_minute, + (const bstring *)&be_const_str_CFG_X3A_X20ran_X20_X20, + (const bstring *)&be_const_str__drivers, + NULL, + (const bstring *)&be_const_str_base_class, + (const bstring *)&be_const_str_invalidate, + (const bstring *)&be_const_str_elif, + (const bstring *)&be_const_str_decompress, + (const bstring *)&be_const_str_input, + (const bstring *)&be_const_str__X2Eautoconf, + (const bstring *)&be_const_str_read8, + (const bstring *)&be_const_str_WS2812_GRB, + (const bstring *)&be_const_str_Leds, + (const bstring *)&be_const_str__X28_X29, + (const bstring *)&be_const_str_BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20, + (const bstring *)&be_const_str__buffer, + NULL, + (const bstring *)&be_const_str_lv_event_cb, + (const bstring *)&be_const_str_ins_time, + (const bstring *)&be_const_str_CFG_X3A_X20skipping_X20_X27display_X2Eini_X27_X20because_X20already_X20present_X20in_X20file_X2Dsystem, + (const bstring *)&be_const_str_bus, + (const bstring *)&be_const_str_TAP_X3A_X20found_X20Tasmota_X20App_X20_X27_X25s_X27, + NULL, + (const bstring *)&be_const_str_register_obj, + (const bstring *)&be_const_str__lvgl, + (const bstring *)&be_const_str_Wire, + (const bstring *)&be_const_str_depower, + (const bstring *)&be_const_str_state, + (const bstring *)&be_const_str__X3D_X3D, + (const bstring *)&be_const_str_connected, + (const bstring *)&be_const_str_SERIAL_7E1, + (const bstring *)&be_const_str__X23, + (const bstring *)&be_const_str_redirect, + (const bstring *)&be_const_str_get_current_module_path, + (const bstring *)&be_const_str__X3E, + (const bstring *)&be_const_str__settings_ptr, + NULL, + (const bstring *)&be_const_str_WS2812, + (const bstring *)&be_const_str_close, + (const bstring *)&be_const_str_EVENT_DRAW_PART_BEGIN, + (const bstring *)&be_const_str_None, + (const bstring *)&be_const_str_add_header, + (const bstring *)&be_const_str_resize, + (const bstring *)&be_const_str__X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, + (const bstring *)&be_const_str_CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29, + (const bstring *)&be_const_str__read, + (const bstring *)&be_const_str_collect, + (const bstring *)&be_const_str__X3E_X3D, + (const bstring *)&be_const_str_SERIAL_7N2, + (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, + (const bstring *)&be_const_str_setmember, + (const bstring *)&be_const_str__end_transmission, + (const bstring *)&be_const_str_arg, + NULL, + (const bstring *)&be_const_str_lv, + (const bstring *)&be_const_str_resp_cmnd, + (const bstring *)&be_const_str_try_rule, + (const bstring *)&be_const_str__X3Clabel_X3EChoose_X20a_X20device_X20configuration_X3A_X3C_X2Flabel_X3E_X3Cbr_X3E, + (const bstring *)&be_const_str__X7B_X7D, + (const bstring *)&be_const_str_ceil, + (const bstring *)&be_const_str_json_fdump_any, + NULL, + (const bstring *)&be_const_str_CFG_X3A_X20no_X20_X27_X2A_X2Eautoconf_X27_X20file_X20found, + (const bstring *)&be_const_str__X25s_X2Eautoconf, + (const bstring *)&be_const_str_srand, + (const bstring *)&be_const_str_AudioGeneratorMP3, + NULL, + (const bstring *)&be_const_str_cb, + (const bstring *)&be_const_str_add_cmd, + (const bstring *)&be_const_str_reverse_gamma10, + (const bstring *)&be_const_str__X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_HTTP_GET, + (const bstring *)&be_const_str__X2502d_X25s_X2502d, + (const bstring *)&be_const_str_cos, + (const bstring *)&be_const_str__X3D_X3C_X3E_X21, + (const bstring *)&be_const_str__X2Etapp, + (const bstring *)&be_const_str__X2F_X3Frst_X3D, + (const bstring *)&be_const_str__X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_get_bat_current, + (const bstring *)&be_const_str_escape, + (const bstring *)&be_const_str_read24, + (const bstring *)&be_const_str_SERIAL_8O1, + (const bstring *)&be_const_str__X20, + (const bstring *)&be_const_str_obj_class_create_obj, + (const bstring *)&be_const_str__X23init_X2Ebat, + (const bstring *)&be_const_str__X3F, + NULL, + (const bstring *)&be_const_str__X23display_X2Eini, + (const bstring *)&be_const_str_from_to, + (const bstring *)&be_const_str_debug, + NULL, + (const bstring *)&be_const_str__X2Ew, + (const bstring *)&be_const_str_exec_tele, + (const bstring *)&be_const_str_reapply, + (const bstring *)&be_const_str__X23autoexec_X2Ebe, + (const bstring *)&be_const_str__, + (const bstring *)&be_const_str_SERIAL_6O2, + (const bstring *)&be_const_str__X2Ep1, + (const bstring *)&be_const_str_min, + (const bstring *)&be_const_str__error, + (const bstring *)&be_const_str_offseta, + NULL, + (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str__X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, + (const bstring *)&be_const_str_display_X2Eini, + (const bstring *)&be_const_str_introspect, + (const bstring *)&be_const_str__global_addr, + (const bstring *)&be_const_str_widget_width_def, + (const bstring *)&be_const_str_percentage, + NULL, + NULL, + (const bstring *)&be_const_str_web_add_main_button, + (const bstring *)&be_const_str_POST, + (const bstring *)&be_const_str_AES_GCM, + (const bstring *)&be_const_str_ctor, + (const bstring *)&be_const_str_read12, + (const bstring *)&be_const_str_acos, + (const bstring *)&be_const_str_setrange, + (const bstring *)&be_const_str_module, + (const bstring *)&be_const_str_COLOR_BLACK, + (const bstring *)&be_const_str_due, + (const bstring *)&be_const_str_set_dcdc_enable, + NULL, + (const bstring *)&be_const_str_bytes, + (const bstring *)&be_const_str_arg_size, + (const bstring *)&be_const_str__X2Ebe, + (const bstring *)&be_const_str_set_power, + (const bstring *)&be_const_str_clear_to, + (const bstring *)&be_const_str__rules, + (const bstring *)&be_const_str_SERIAL_8N2, + (const bstring *)&be_const_str__X0A, + (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X20, + (const bstring *)&be_const_str_SERIAL_5O1, + (const bstring *)&be_const_str_back_forth, + (const bstring *)&be_const_str__X2E, + NULL, + (const bstring *)&be_const_str__X3C, + (const bstring *)&be_const_str__X2Esize, + (const bstring *)&be_const_str_CFG_X3A_X20loading_X20_X27_X25s_X27, + (const bstring *)&be_const_str__X3C_X3D, + NULL, + (const bstring *)&be_const_str_find_key_i, + (const bstring *)&be_const_str_content_start, + (const bstring *)&be_const_str_COLOR_WHITE, + NULL, + (const bstring *)&be_const_str_Tasmota, + (const bstring *)&be_const_str_rule, + (const bstring *)&be_const_str_atleast1, + (const bstring *)&be_const_str__X2Ep2, + (const bstring *)&be_const_str_Timer, + NULL, + (const bstring *)&be_const_str_BUTTON_CONFIGURATION, + (const bstring *)&be_const_str_gamma10, + (const bstring *)&be_const_str_lower, + (const bstring *)&be_const_str_i2c_enabled, + (const bstring *)&be_const_str_get_pixel_color, + (const bstring *)&be_const_str_display, + (const bstring *)&be_const_str_classof, + (const bstring *)&be_const_str__X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D, + (const bstring *)&be_const_str_class_init_obj, + (const bstring *)&be_const_str__X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, + (const bstring *)&be_const_str_cb_do_nothing, + NULL, + (const bstring *)&be_const_str_get_current_module_name, + (const bstring *)&be_const_str_content_send, + (const bstring *)&be_const_str_get_bat_charge_current, + (const bstring *)&be_const_str__X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, + (const bstring *)&be_const_str_get_width, + (const bstring *)&be_const_str_unknown_X20instruction, + (const bstring *)&be_const_str_SERIAL_5E2, + (const bstring *)&be_const_str_call, + (const bstring *)&be_const_str_detect, (const bstring *)&be_const_str_compress, NULL, - (const bstring *)&be_const_str_pin_used, - (const bstring *)&be_const_str__X2Ebe, - (const bstring *)&be_const_str_SERIAL_8O1, - (const bstring *)&be_const_str_CFG_X3A_X20loaded_X20_X27_X25s_X27, - (const bstring *)&be_const_str_EVENT_DRAW_PART_END, + (const bstring *)&be_const_str_lv_obj, + (const bstring *)&be_const_str_AudioOutputI2S, + (const bstring *)&be_const_str_widget_ctor_impl, + (const bstring *)&be_const_str_CFG_X3A_X20removing_X20autoconf_X20files, + (const bstring *)&be_const_str__def, + (const bstring *)&be_const_str_param, + (const bstring *)&be_const_str_SERIAL_8N1, NULL, - NULL, - (const bstring *)&be_const_str_button_pressed, - (const bstring *)&be_const_str_atleast1, - (const bstring *)&be_const_str_add_anim, - (const bstring *)&be_const_str_count, - (const bstring *)&be_const_str__X25s_X2Eautoconf, - (const bstring *)&be_const_str_False, - (const bstring *)&be_const_str_time_str, + (const bstring *)&be_const_str_get_aps_voltage, (const bstring *)&be_const_str__X26lt_X3BNone_X26gt_X3B, - (const bstring *)&be_const_str_allocated, + (const bstring *)&be_const_str_clear_first_time, + (const bstring *)&be_const_str__X2F, + (const bstring *)&be_const_str_sinh, + (const bstring *)&be_const_str__X3D, + (const bstring *)&be_const_str__X3A, + (const bstring *)&be_const_str_int, NULL, - (const bstring *)&be_const_str_cb_obj, - (const bstring *)&be_const_str__X21_X3D, - (const bstring *)&be_const_str__X3Cselect_X20name_X3D_X27zip_X27_X3E, + NULL, + (const bstring *)&be_const_str_get_height, + (const bstring *)&be_const_str_SERIAL_7O2, + (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, + (const bstring *)&be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, + (const bstring *)&be_const_str_atan, + (const bstring *)&be_const_str__X5D, + (const bstring *)&be_const_str__X2D_X2D_X3A_X2D_X2D, + (const bstring *)&be_const_str_c, + (const bstring *)&be_const_str_Tele, + (const bstring *)&be_const_str_web_send_decimal, + NULL, + (const bstring *)&be_const_str_gpio, + NULL, + (const bstring *)&be_const_str_HTTP_POST, + (const bstring *)&be_const_str__X2E_X2E, + (const bstring *)&be_const_str_I2C_Driver, + NULL, + (const bstring *)&be_const_str_SERIAL_6E1, + (const bstring *)&be_const_str_read_bytes, + (const bstring *)&be_const_str_AudioOutput, + (const bstring *)&be_const_str_arg_X20must_X20be_X20a_X20subclass_X20of_X20lv_obj, (const bstring *)&be_const_str_OneWire, - (const bstring *)&be_const_str_classof, - (const bstring *)&be_const_str_json, - (const bstring *)&be_const_str_True, - (const bstring *)&be_const_str__X2B, - (const bstring *)&be_const_str_decompress, - (const bstring *)&be_const_str_CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s, - (const bstring *)&be_const_str_lv_event, - (const bstring *)&be_const_str_counters, - (const bstring *)&be_const_str_pc, - (const bstring *)&be_const_str__X2Esize, + (const bstring *)&be_const_str__X23autoexec_X2Ebat, + (const bstring *)&be_const_str_gamma8, + (const bstring *)&be_const_str__available, NULL, - (const bstring *)&be_const_str__X5B, - (const bstring *)&be_const_str__X3C_X2Fform_X3E_X3C_X2Fp_X3E, - (const bstring *)&be_const_str_connection_error, - (const bstring *)&be_const_str_classname, - (const bstring *)&be_const_str_AudioGeneratorWAV, - (const bstring *)&be_const_str_AudioGenerator, - (const bstring *)&be_const_str_Parameter_X20error, - (const bstring *)&be_const_str_get_tasmota, - (const bstring *)&be_const_str_loop, - (const bstring *)&be_const_str__timers, - (const bstring *)&be_const_str_constructor_cb, - (const bstring *)&be_const_str_addr, - (const bstring *)&be_const_str__X2E, - (const bstring *)&be_const_str_RES_OK, - NULL, - (const bstring *)&be_const_str_OPTION_A, - NULL, - (const bstring *)&be_const_str_collect, - (const bstring *)&be_const_str_SERIAL_6O2, - (const bstring *)&be_const_str_AudioFileSourceFS, - (const bstring *)&be_const_str_show, - (const bstring *)&be_const_str__cmd, - (const bstring *)&be_const_str_SERIAL_7N2, (const bstring *)&be_const_str_dirty, - (const bstring *)&be_const_str_SERIAL_7E2, - (const bstring *)&be_const_str__X3E, - (const bstring *)&be_const_str__X2F_X3Frst_X3D, - (const bstring *)&be_const_str__X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, - (const bstring *)&be_const_str_EVENT_DRAW_PART_BEGIN, - (const bstring *)&be_const_str__persist_X2Ejson, - (const bstring *)&be_const_str_tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29, - (const bstring *)&be_const_str__X3Clambda_X3E + (const bstring *)&be_const_str_get_bat_voltage, + (const bstring *)&be_const_str_SERIAL_5E1, + (const bstring *)&be_const_str__cmd, + NULL, + (const bstring *)&be_const_str_set_timeouts, + (const bstring *)&be_const_str_https_X3A_X2F_X2Fraw_X2Egithubusercontent_X2Ecom_X2Ftasmota_X2Fautoconf_X2Fmain_X2F_X25s_manifest_X2Ejson, + (const bstring *)&be_const_str_break, + (const bstring *)&be_const_str__global_def, + (const bstring *)&be_const_str_imax, + (const bstring *)&be_const_str_Restart_X201, + (const bstring *)&be_const_str__X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, + (const bstring *)&be_const_str__settings_def, + (const bstring *)&be_const_str_encrypt, + (const bstring *)&be_const_str_char, + (const bstring *)&be_const_str__X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D, + (const bstring *)&be_const_str_animators, + (const bstring *)&be_const_str_lvgl_event_dispatch, + (const bstring *)&be_const_str__X2C, + (const bstring *)&be_const_str_webclient, + NULL, + (const bstring *)&be_const_str_couldn_X27t_X20not_X20initialize_X20noepixelbus, + (const bstring *)&be_const_str_pc_abs, + (const bstring *)&be_const_str_every_100ms, + (const bstring *)&be_const_str_cmd, + (const bstring *)&be_const_str_AudioGeneratorWAV, + (const bstring *)&be_const_str_SERIAL_7O1, + (const bstring *)&be_const_str_sec, + (const bstring *)&be_const_str_exec_cmd, + (const bstring *)&be_const_str_remove_driver, + (const bstring *)&be_const_str_point, + (const bstring *)&be_const_str_OPTION_A, + (const bstring *)&be_const_str_readline, + (const bstring *)&be_const_str_set_useragent, + (const bstring *)&be_const_str_BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29, + (const bstring *)&be_const_str_get_light, + (const bstring *)&be_const_str_CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27, + (const bstring *)&be_const_str_decrypt, + (const bstring *)&be_const_str___iterator__, + (const bstring *)&be_const_str__X3Clambda_X3E, + (const bstring *)&be_const_str_I2C_X3A, + NULL, + (const bstring *)&be_const_str_SERIAL_6E2, + (const bstring *)&be_const_str_isrunning, + (const bstring *)&be_const_str_json_fdump_map, + (const bstring *)&be_const_str_create_custom_widget, + (const bstring *)&be_const_str_event_cb, + (const bstring *)&be_const_str_page_autoconf_ctl, + (const bstring *)&be_const_str_autoexec, + (const bstring *)&be_const_str_contains, + (const bstring *)&be_const_str_, + NULL, + (const bstring *)&be_const_str_tag, + (const bstring *)&be_const_str__X21_X3D_X3D, + (const bstring *)&be_const_str_can_show, + (const bstring *)&be_const_str_local, + (const bstring *)&be_const_str_CFG_X3A_X20_X27init_X2Ebat_X27_X20done_X2C_X20restarting, + NULL, + (const bstring *)&be_const_str__X3C_X2Fform_X3E_X3C_X2Fp_X3E, + NULL, + NULL, + (const bstring *)&be_const_str_has_arg, + NULL, + (const bstring *)&be_const_str_Unknown_X20command, + NULL, + (const bstring *)&be_const_str_lv_event, + (const bstring *)&be_const_str__X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, + (const bstring *)&be_const_str__X3Cselect_X20name_X3D_X27zip_X27_X3E, + (const bstring *)&be_const_str_reset_search }; static const struct bconststrtab m_const_string_table = { - .size = 359, - .count = 741, + .size = 358, + .count = 740, .table = m_string_table }; diff --git a/lib/libesp32/berry/generate/be_fixed_be_class_map.h b/lib/libesp32/berry/generate/be_fixed_be_class_map.h index f884630e3..d9ce16027 100644 --- a/lib/libesp32/berry/generate/be_fixed_be_class_map.h +++ b/lib/libesp32/berry/generate/be_fixed_be_class_map.h @@ -1,25 +1,23 @@ #include "be_constobj.h" static be_define_const_map_slots(be_class_map_map) { - { be_const_key(setitem, -1), be_const_func(m_setitem) }, - { be_const_key(remove, 8), be_const_func(m_remove) }, - { be_const_key(insert, -1), be_const_func(m_insert) }, - { be_const_key(tostring, 4), be_const_func(m_tostring) }, - { be_const_key(has, -1), be_const_func(m_contains) }, - { be_const_key(init, -1), be_const_func(m_init) }, - { be_const_key(contains, 9), be_const_func(m_contains) }, - { be_const_key(_X2Ep, 13), be_const_var(0) }, - { be_const_key(reduce, -1), be_const_func(m_reduce) }, { be_const_key(size, -1), be_const_func(m_size) }, - { be_const_key(find, -1), be_const_func(m_find) }, + { be_const_key(tostring, -1), be_const_func(m_tostring) }, + { be_const_key(insert, -1), be_const_func(m_insert) }, + { be_const_key(init, -1), be_const_func(m_init) }, + { be_const_key(contains, -1), be_const_func(m_contains) }, { be_const_key(keys, -1), be_const_func(m_keys) }, - { be_const_key(item, -1), be_const_func(m_item) }, - { be_const_key(iter, -1), be_const_func(m_iter) }, + { be_const_key(_X2Ep, -1), be_const_var(0) }, + { be_const_key(iter, 6), be_const_func(m_iter) }, + { be_const_key(setitem, 2), be_const_func(m_setitem) }, + { be_const_key(remove, -1), be_const_func(m_remove) }, + { be_const_key(item, 11), be_const_func(m_item) }, + { be_const_key(find, -1), be_const_func(m_find) }, }; static be_define_const_map( be_class_map_map, - 14 + 12 ); BE_EXPORT_VARIABLE be_define_const_class( diff --git a/lib/libesp32/berry/src/be_byteslib.c b/lib/libesp32/berry/src/be_byteslib.c index 17a5a7d4c..94c8823ae 100644 --- a/lib/libesp32/berry/src/be_byteslib.c +++ b/lib/libesp32/berry/src/be_byteslib.c @@ -1271,38 +1271,38 @@ be_local_closure(getbits, /* name */ &be_const_str_getbits, &be_const_str_solidified, ( &(const binstruction[32]) { /* code */ - 0x180C0500, // 0000 LE R3 R2 K0 - 0x740E0002, // 0001 JMPT R3 #0005 - 0x540E001F, // 0002 LDINT R3 32 - 0x240C0403, // 0003 GT R3 R2 R3 - 0x780E0000, // 0004 JMPF R3 #0006 - 0xB0060302, // 0005 RAISE 1 K1 K2 - 0x580C0000, // 0006 LDCONST R3 K0 - 0x3C100303, // 0007 SHR R4 R1 K3 - 0x54160007, // 0008 LDINT R5 8 - 0x10040205, // 0009 MOD R1 R1 R5 - 0x58140000, // 000A LDCONST R5 K0 - 0x24180500, // 000B GT R6 R2 K0 - 0x781A0011, // 000C JMPF R6 #001F - 0x541A0007, // 000D LDINT R6 8 - 0x04180C01, // 000E SUB R6 R6 R1 - 0x241C0C02, // 000F GT R7 R6 R2 - 0x781E0000, // 0010 JMPF R7 #0012 - 0x5C180400, // 0011 MOVE R6 R2 - 0x381E0806, // 0012 SHL R7 K4 R6 - 0x041C0F04, // 0013 SUB R7 R7 K4 - 0x381C0E01, // 0014 SHL R7 R7 R1 - 0x94200004, // 0015 GETIDX R8 R0 R4 - 0x2C201007, // 0016 AND R8 R8 R7 - 0x3C201001, // 0017 SHR R8 R8 R1 - 0x38201005, // 0018 SHL R8 R8 R5 - 0x300C0608, // 0019 OR R3 R3 R8 - 0x00140A06, // 001A ADD R5 R5 R6 - 0x04080406, // 001B SUB R2 R2 R6 - 0x58040000, // 001C LDCONST R1 K0 - 0x00100904, // 001D ADD R4 R4 K4 - 0x7001FFEB, // 001E JMP #000B - 0x80040600, // 001F RET 1 R3 + 0x180C0500, // 0000 LE R3 R2 K0 + 0x740E0002, // 0001 JMPT R3 #0005 + 0x540E001F, // 0002 LDINT R3 32 + 0x240C0403, // 0003 GT R3 R2 R3 + 0x780E0000, // 0004 JMPF R3 #0006 + 0xB0060302, // 0005 RAISE 1 K1 K2 + 0x580C0000, // 0006 LDCONST R3 K0 + 0x3C100303, // 0007 SHR R4 R1 K3 + 0x54160007, // 0008 LDINT R5 8 + 0x10040205, // 0009 MOD R1 R1 R5 + 0x58140000, // 000A LDCONST R5 K0 + 0x24180500, // 000B GT R6 R2 K0 + 0x781A0011, // 000C JMPF R6 #001F + 0x541A0007, // 000D LDINT R6 8 + 0x04180C01, // 000E SUB R6 R6 R1 + 0x241C0C02, // 000F GT R7 R6 R2 + 0x781E0000, // 0010 JMPF R7 #0012 + 0x5C180400, // 0011 MOVE R6 R2 + 0x381E0806, // 0012 SHL R7 K4 R6 + 0x041C0F04, // 0013 SUB R7 R7 K4 + 0x381C0E01, // 0014 SHL R7 R7 R1 + 0x94200004, // 0015 GETIDX R8 R0 R4 + 0x2C201007, // 0016 AND R8 R8 R7 + 0x3C201001, // 0017 SHR R8 R8 R1 + 0x38201005, // 0018 SHL R8 R8 R5 + 0x300C0608, // 0019 OR R3 R3 R8 + 0x00140A06, // 001A ADD R5 R5 R6 + 0x04080406, // 001B SUB R2 R2 R6 + 0x58040000, // 001C LDCONST R1 K0 + 0x00100904, // 001D ADD R4 R4 K4 + 0x7001FFEB, // 001E JMP #000B + 0x80040600, // 001F RET 1 R3 }) ) ); @@ -1331,43 +1331,43 @@ be_local_closure(setbits, /* name */ &be_const_str_setbits, &be_const_str_solidified, ( &(const binstruction[37]) { /* code */ - 0x14100500, // 0000 LT R4 R2 K0 - 0x74120002, // 0001 JMPT R4 #0005 - 0x5412001F, // 0002 LDINT R4 32 - 0x24100404, // 0003 GT R4 R2 R4 - 0x78120000, // 0004 JMPF R4 #0006 - 0xB0060302, // 0005 RAISE 1 K1 K2 - 0x60100009, // 0006 GETGBL R4 G9 - 0x5C140600, // 0007 MOVE R5 R3 - 0x7C100200, // 0008 CALL R4 1 - 0x5C0C0800, // 0009 MOVE R3 R4 - 0x3C100303, // 000A SHR R4 R1 K3 - 0x54160007, // 000B LDINT R5 8 - 0x10040205, // 000C MOD R1 R1 R5 - 0x24140500, // 000D GT R5 R2 K0 - 0x78160014, // 000E JMPF R5 #0024 - 0x54160007, // 000F LDINT R5 8 - 0x04140A01, // 0010 SUB R5 R5 R1 - 0x24180A02, // 0011 GT R6 R5 R2 - 0x781A0000, // 0012 JMPF R6 #0014 - 0x5C140400, // 0013 MOVE R5 R2 - 0x381A0805, // 0014 SHL R6 K4 R5 - 0x04180D04, // 0015 SUB R6 R6 K4 - 0x541E00FE, // 0016 LDINT R7 255 - 0x38200C01, // 0017 SHL R8 R6 R1 - 0x041C0E08, // 0018 SUB R7 R7 R8 - 0x94200004, // 0019 GETIDX R8 R0 R4 - 0x2C201007, // 001A AND R8 R8 R7 - 0x2C240606, // 001B AND R9 R3 R6 - 0x38241201, // 001C SHL R9 R9 R1 - 0x30201009, // 001D OR R8 R8 R9 - 0x98000808, // 001E SETIDX R0 R4 R8 - 0x3C0C0605, // 001F SHR R3 R3 R5 - 0x04080405, // 0020 SUB R2 R2 R5 - 0x58040000, // 0021 LDCONST R1 K0 - 0x00100904, // 0022 ADD R4 R4 K4 - 0x7001FFE8, // 0023 JMP #000D - 0x80040000, // 0024 RET 1 R0 + 0x14100500, // 0000 LT R4 R2 K0 + 0x74120002, // 0001 JMPT R4 #0005 + 0x5412001F, // 0002 LDINT R4 32 + 0x24100404, // 0003 GT R4 R2 R4 + 0x78120000, // 0004 JMPF R4 #0006 + 0xB0060302, // 0005 RAISE 1 K1 K2 + 0x60100009, // 0006 GETGBL R4 G9 + 0x5C140600, // 0007 MOVE R5 R3 + 0x7C100200, // 0008 CALL R4 1 + 0x5C0C0800, // 0009 MOVE R3 R4 + 0x3C100303, // 000A SHR R4 R1 K3 + 0x54160007, // 000B LDINT R5 8 + 0x10040205, // 000C MOD R1 R1 R5 + 0x24140500, // 000D GT R5 R2 K0 + 0x78160014, // 000E JMPF R5 #0024 + 0x54160007, // 000F LDINT R5 8 + 0x04140A01, // 0010 SUB R5 R5 R1 + 0x24180A02, // 0011 GT R6 R5 R2 + 0x781A0000, // 0012 JMPF R6 #0014 + 0x5C140400, // 0013 MOVE R5 R2 + 0x381A0805, // 0014 SHL R6 K4 R5 + 0x04180D04, // 0015 SUB R6 R6 K4 + 0x541E00FE, // 0016 LDINT R7 255 + 0x38200C01, // 0017 SHL R8 R6 R1 + 0x041C0E08, // 0018 SUB R7 R7 R8 + 0x94200004, // 0019 GETIDX R8 R0 R4 + 0x2C201007, // 001A AND R8 R8 R7 + 0x2C240606, // 001B AND R9 R3 R6 + 0x38241201, // 001C SHL R9 R9 R1 + 0x30201009, // 001D OR R8 R8 R9 + 0x98000808, // 001E SETIDX R0 R4 R8 + 0x3C0C0605, // 001F SHR R3 R3 R5 + 0x04080405, // 0020 SUB R2 R2 R5 + 0x58040000, // 0021 LDCONST R1 K0 + 0x00100904, // 0022 ADD R4 R4 K4 + 0x7001FFE8, // 0023 JMP #000D + 0x80040000, // 0024 RET 1 R0 }) ) ); diff --git a/lib/libesp32/berry/src/be_constobj.h b/lib/libesp32/berry/src/be_constobj.h index 8716d7fe2..2ffe6a0ce 100644 --- a/lib/libesp32/berry/src/be_constobj.h +++ b/lib/libesp32/berry/src/be_constobj.h @@ -201,15 +201,6 @@ const bntvmodule be_native_module(_module) = { \ .members = _members \ } -// #define be_local_instance(_name, _class_ptr, _members) \ -// static const binstance i_##_name = { \ -// be_const_header(BE_INSTANCE), \ -// .super = NULL, \ -// .sub = NULL, \ -// ._class = (bclass*) _class_ptr, \ -// .members = _members \ -// } - #define be_nested_map(_size, _slots) \ & (const bmap) { \ be_const_header(BE_MAP), \ @@ -233,13 +224,6 @@ const bntvmodule be_native_module(_module) = { \ BE_STRING \ } -#define be_nested_str_literal(_str) \ - { \ - { .s=(be_nested_const_str(_str, 0, sizeof(_str)-1 )) \ - }, \ - BE_STRING \ - } - #define be_str_literal(_str) \ be_nested_const_str(_str, 0, sizeof(_str)-1 ) diff --git a/lib/libesp32/berry/src/be_gc.c b/lib/libesp32/berry/src/be_gc.c index 8d19affb1..19e88cb12 100644 --- a/lib/libesp32/berry/src/be_gc.c +++ b/lib/libesp32/berry/src/be_gc.c @@ -561,5 +561,9 @@ void be_gc_collect(bvm *vm) reset_fixedlist(vm); /* step 5: calculate the next GC threshold */ vm->gc.threshold = next_threshold(vm->gc); +#if BE_USE_PERF_COUNTERS if (vm->obshook != NULL) (*vm->obshook)(vm, BE_OBS_GC_END, vm->gc.usage, vm->counter_gc_kept, vm->counter_gc_freed); +#else + if (vm->obshook != NULL) (*vm->obshook)(vm, BE_OBS_GC_END, vm->gc.usage); +#endif } diff --git a/lib/libesp32/berry/src/be_maplib.c b/lib/libesp32/berry/src/be_maplib.c index a8fc7309e..d1574f280 100644 --- a/lib/libesp32/berry/src/be_maplib.c +++ b/lib/libesp32/berry/src/be_maplib.c @@ -212,62 +212,6 @@ static int m_keys(bvm *vm) be_return(vm); } -/* apply a function/closure to each element of a map */ -/* `map.reduce(f:function [, initializer:any]) -> any` */ -/* Calls for each element `f(key, value, acc) -> any` */ -/* `acc` is initialized with `initilizer` if present or `nil` */ -/* the return value of the function becomes the next value passed in arg `acc` */ -static int m_reduce(bvm *vm) -{ - int argc = be_top(vm); - if (argc > 1 && be_isfunction(vm, 2)) { - bbool has_initializer = (argc > 2); - /* get map internal object */ - be_getmember(vm, 1, ".p"); - bvalue *v = be_indexof(vm, -1); - bmap *map = cast(bmap*, var_toobj(v)); - /* get the number of slots if any */ - int slots_initial = be_map_size(map); - /* place-holder for on-going value and return value */ - if (has_initializer) { - be_pushvalue(vm, 3); - } else { - be_pushnil(vm); /* if no initializer use `nil` */ - } - for (int i = 0; i < slots_initial; i++) { - bmapnode * node = map->slots + i; - if (!var_isnil(&node->key)) { /* is the key present in this slot? */ - be_pushvalue(vm, 2); /* push function */ - - bvalue kv; /* push key on stack */ - kv.type = node->key.type; - kv.v = node->key.v; - bvalue *reg = vm->top; - var_setval(reg, &kv); - be_incrtop(vm); - - reg = vm->top; /* push value on stack */ - var_setval(reg, &node->value); - be_incrtop(vm); - - be_pushvalue(vm, -4); - - be_call(vm, 3); - be_pop(vm, 3); /* pop args, keep return value */ - be_remove(vm, -2); /* remove previous accumulator, keep return value from function */ - } - /* check if the map has been resized during the call */ - if (be_map_size(map) != slots_initial) { - be_raise(vm, "stop_iteration", "map resized within apply"); - break; /* abort */ - } - } - be_return(vm); - } - be_raise(vm, "value_error", "needs function as first argument"); - be_return_nil(vm); -} - #if !BE_USE_PRECOMPILED_OBJECT void be_load_maplib(bvm *vm) { @@ -280,12 +224,10 @@ void be_load_maplib(bvm *vm) { "setitem", m_setitem }, { "find", m_find }, { "contains", m_contains }, - { "has", m_contains }, /* deprecated */ { "size", m_size }, { "insert", m_insert }, { "iter", m_iter }, { "keys", m_keys }, - { "reduce", m_reduce }, { NULL, NULL } }; be_regclass(vm, "map", members); @@ -301,12 +243,10 @@ class be_class_map (scope: global, name: map) { setitem, func(m_setitem) find, func(m_find) contains, func(m_contains) - has, func(m_contains) size, func(m_size) insert, func(m_insert) iter, func(m_iter) keys, func(m_keys) - reduce, func(m_reduce) } @const_object_info_end */ #include "../generate/be_fixed_be_class_map.h" diff --git a/lib/libesp32/berry/src/be_solidifylib.c b/lib/libesp32/berry/src/be_solidifylib.c index 581131b75..4d4e3bcb6 100644 --- a/lib/libesp32/berry/src/be_solidifylib.c +++ b/lib/libesp32/berry/src/be_solidifylib.c @@ -38,11 +38,11 @@ extern const bclass be_class_map; be_writestring(__lbuf); \ } while (0) -/******************************************************************** +/********************************************************************\ * Encode string to identifiers * * `_X` is used as an escape marker -/********************************************************************/ +\********************************************************************/ static unsigned toidentifier_length(const char *s) { unsigned len = 1; @@ -115,7 +115,6 @@ static void m_solidify_map(bvm *vm, bmap * map, const char *class_name) be_raise(vm, "internal_error", error); } int key_next = node->key.next; - size_t len = strlen(str(node->key.v.s)); if (0xFFFFFF == key_next) { key_next = -1; /* more readable */ } @@ -192,10 +191,16 @@ static void m_solidify_bvalue(bvm *vm, bvalue * value, const char *classname, co } break; case BE_CLOSURE: - logfmt("be_const_%sclosure(%s%s%s_closure)", - func_isstatic(value) ? "static_" : "", - classname ? classname : "", classname ? "_" : "", - str(((bclosure*) var_toobj(value))->proto->name)); + { + const char * func_name = str(((bclosure*) var_toobj(value))->proto->name); + size_t id_len = toidentifier_length(func_name); + char func_name_id[id_len]; + toidentifier(func_name_id, func_name); + logfmt("be_const_%sclosure(%s%s%s_closure)", + func_isstatic(value) ? "static_" : "", + classname ? classname : "", classname ? "_" : "", + func_name_id); + } break; case BE_CLASS: logfmt("be_const_class(be_class_%s)", str(((bclass*) var_toobj(value))->name)); @@ -365,9 +370,14 @@ static void m_solidify_closure(bvm *vm, bclosure *cl, const char * classname, in logfmt("** Solidified function: %s\n", func_name); logfmt("********************************************************************/\n"); - logfmt("be_local_closure(%s%s%s, /* name */\n", - classname ? classname : "", classname ? "_" : "", - func_name); + { + size_t id_len = toidentifier_length(func_name); + char func_name_id[id_len]; + toidentifier(func_name_id, func_name); + logfmt("be_local_closure(%s%s%s, /* name */\n", + classname ? classname : "", classname ? "_" : "", + func_name_id); + } m_solidify_proto(vm, pr, func_name, builtins, indent); logfmt("\n"); From ef764fcc70c1650ba2702db6dc6a268c481b61b8 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Thu, 16 Dec 2021 08:50:35 +0100 Subject: [PATCH 90/97] Put back map.has (deprecated) --- .../berry/generate/be_fixed_be_class_map.h | 19 ++++++++++--------- lib/libesp32/berry/src/be_maplib.c | 2 ++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/libesp32/berry/generate/be_fixed_be_class_map.h b/lib/libesp32/berry/generate/be_fixed_be_class_map.h index d9ce16027..db15432d4 100644 --- a/lib/libesp32/berry/generate/be_fixed_be_class_map.h +++ b/lib/libesp32/berry/generate/be_fixed_be_class_map.h @@ -1,23 +1,24 @@ #include "be_constobj.h" static be_define_const_map_slots(be_class_map_map) { - { be_const_key(size, -1), be_const_func(m_size) }, { be_const_key(tostring, -1), be_const_func(m_tostring) }, - { be_const_key(insert, -1), be_const_func(m_insert) }, - { be_const_key(init, -1), be_const_func(m_init) }, { be_const_key(contains, -1), be_const_func(m_contains) }, + { be_const_key(item, 4), be_const_func(m_item) }, + { be_const_key(setitem, 9), be_const_func(m_setitem) }, + { be_const_key(has, -1), be_const_func(m_contains) }, { be_const_key(keys, -1), be_const_func(m_keys) }, + { be_const_key(init, -1), be_const_func(m_init) }, + { be_const_key(remove, 5), be_const_func(m_remove) }, + { be_const_key(size, -1), be_const_func(m_size) }, + { be_const_key(iter, -1), be_const_func(m_iter) }, + { be_const_key(insert, -1), be_const_func(m_insert) }, { be_const_key(_X2Ep, -1), be_const_var(0) }, - { be_const_key(iter, 6), be_const_func(m_iter) }, - { be_const_key(setitem, 2), be_const_func(m_setitem) }, - { be_const_key(remove, -1), be_const_func(m_remove) }, - { be_const_key(item, 11), be_const_func(m_item) }, - { be_const_key(find, -1), be_const_func(m_find) }, + { be_const_key(find, 8), be_const_func(m_find) }, }; static be_define_const_map( be_class_map_map, - 12 + 13 ); BE_EXPORT_VARIABLE be_define_const_class( diff --git a/lib/libesp32/berry/src/be_maplib.c b/lib/libesp32/berry/src/be_maplib.c index d1574f280..fc9f09fe7 100644 --- a/lib/libesp32/berry/src/be_maplib.c +++ b/lib/libesp32/berry/src/be_maplib.c @@ -224,6 +224,7 @@ void be_load_maplib(bvm *vm) { "setitem", m_setitem }, { "find", m_find }, { "contains", m_contains }, + { "has", m_contains }, /* deprecated */ { "size", m_size }, { "insert", m_insert }, { "iter", m_iter }, @@ -243,6 +244,7 @@ class be_class_map (scope: global, name: map) { setitem, func(m_setitem) find, func(m_find) contains, func(m_contains) + has, func(m_contains) size, func(m_size) insert, func(m_insert) iter, func(m_iter) From 6d9e4279709ebdc0cec928b167503f273f1a6212 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Thu, 16 Dec 2021 13:57:12 +0100 Subject: [PATCH 91/97] Fix Berry I2C driver lib with latest changes --- lib/libesp32/berry/default/be_driverlib.c | 81 +++-------------- lib/libesp32/berry/default/be_i2c_driverlib.c | 86 +++++++++---------- lib/libesp32/berry/default/embedded/Driver.be | 7 -- .../berry/default/embedded/i2c_driver.be | 2 - lib/libesp32/berry/generate/be_const_strtab.h | 1 - .../berry/generate/be_const_strtab_def.h | 5 +- .../berry/drivers/i2c_axp192_M5StackCore2.be | 4 +- 7 files changed, 61 insertions(+), 125 deletions(-) diff --git a/lib/libesp32/berry/default/be_driverlib.c b/lib/libesp32/berry/default/be_driverlib.c index 45a611382..0d163f836 100644 --- a/lib/libesp32/berry/default/be_driverlib.c +++ b/lib/libesp32/berry/default/be_driverlib.c @@ -6,57 +6,6 @@ *******************************************************************/ #include "be_constobj.h" -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Driver_init, /* name */ - be_nested_proto( - 1, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 0, /* has constants */ - NULL, /* no const */ - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[ 1]) { /* code */ - 0x80000000, // 0000 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_tasmota -********************************************************************/ -be_local_closure(Driver_get_tasmota, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str(tasmota), - }), - &be_const_str_get_tasmota, - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0xB8060000, // 0000 GETNGBL R1 K0 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: add_cmd ********************************************************************/ @@ -123,24 +72,22 @@ be_local_closure(Driver_add_cmd, /* name */ be_local_class(Driver, 13, NULL, - be_nested_map(16, + be_nested_map(14, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(web_add_main_button, 14), be_const_var(4) }, - { be_const_key(web_add_console_button, -1), be_const_var(7) }, - { be_const_key(web_add_management_button, 8), be_const_var(5) }, - { be_const_key(init, -1), be_const_closure(Driver_init_closure) }, - { be_const_key(json_append, -1), be_const_var(10) }, - { be_const_key(web_add_config_button, 7), be_const_var(6) }, - { be_const_key(every_100ms, -1), be_const_var(1) }, - { be_const_key(display, -1), be_const_var(12) }, - { be_const_key(web_add_button, 13), be_const_var(3) }, - { be_const_key(every_second, -1), be_const_var(0) }, - { be_const_key(save_before_restart, -1), be_const_var(8) }, - { be_const_key(get_tasmota, -1), be_const_closure(Driver_get_tasmota_closure) }, - { be_const_key(web_sensor, 6), be_const_var(9) }, - { be_const_key(web_add_handler, -1), be_const_var(2) }, - { be_const_key(button_pressed, 1), be_const_var(11) }, + { be_const_key(web_add_console_button, 6), be_const_var(7) }, + { be_const_key(web_add_config_button, -1), be_const_var(6) }, + { be_const_key(button_pressed, 9), be_const_var(11) }, + { be_const_key(every_second, 1), be_const_var(0) }, + { be_const_key(web_add_handler, 11), be_const_var(2) }, { be_const_key(add_cmd, -1), be_const_closure(Driver_add_cmd_closure) }, + { be_const_key(web_sensor, -1), be_const_var(9) }, + { be_const_key(display, -1), be_const_var(12) }, + { be_const_key(web_add_main_button, 2), be_const_var(4) }, + { be_const_key(save_before_restart, -1), be_const_var(8) }, + { be_const_key(web_add_management_button, 0), be_const_var(5) }, + { be_const_key(every_100ms, 13), be_const_var(1) }, + { be_const_key(json_append, -1), be_const_var(10) }, + { be_const_key(web_add_button, -1), be_const_var(3) }, })), be_str_literal("Driver") ); diff --git a/lib/libesp32/berry/default/be_i2c_driverlib.c b/lib/libesp32/berry/default/be_i2c_driverlib.c index 45f829e19..a61321c12 100644 --- a/lib/libesp32/berry/default/be_i2c_driverlib.c +++ b/lib/libesp32/berry/default/be_i2c_driverlib.c @@ -279,7 +279,7 @@ be_local_closure(I2C_Driver_read8, /* name */ ********************************************************************/ be_local_closure(I2C_Driver_init, /* name */ be_nested_proto( - 10, /* nstack */ + 9, /* nstack */ 4, /* argc */ 0, /* varg */ 0, /* has upvals */ @@ -288,7 +288,7 @@ be_local_closure(I2C_Driver_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[10]) { /* constants */ - /* K0 */ be_nested_str(get_tasmota), + /* K0 */ be_nested_str(tasmota), /* K1 */ be_nested_str(i2c_enabled), /* K2 */ be_nested_str(addr), /* K3 */ be_nested_str(wire), @@ -302,49 +302,49 @@ be_local_closure(I2C_Driver_init, /* name */ &be_const_str_init, &be_const_str_solidified, ( &(const binstruction[44]) { /* code */ - 0x8C100100, // 0000 GETMET R4 R0 K0 - 0x7C100200, // 0001 CALL R4 1 - 0x4C140000, // 0002 LDNIL R5 - 0x20140605, // 0003 NE R5 R3 R5 - 0x78160004, // 0004 JMPF R5 #000A - 0x8C140901, // 0005 GETMET R5 R4 K1 - 0x5C1C0600, // 0006 MOVE R7 R3 - 0x7C140400, // 0007 CALL R5 2 - 0x74160000, // 0008 JMPT R5 #000A - 0x80000A00, // 0009 RET 0 - 0x90020402, // 000A SETMBR R0 K2 R2 - 0x8C140904, // 000B GETMET R5 R4 K4 - 0x881C0102, // 000C GETMBR R7 R0 K2 - 0x7C140400, // 000D CALL R5 2 - 0x90020605, // 000E SETMBR R0 K3 R5 - 0x88140103, // 000F GETMBR R5 R0 K3 - 0x78160019, // 0010 JMPF R5 #002B - 0x60140004, // 0011 GETGBL R5 G4 - 0x5C180200, // 0012 MOVE R6 R1 - 0x7C140200, // 0013 CALL R5 1 - 0x1C140B05, // 0014 EQ R5 R5 K5 - 0x78160004, // 0015 JMPF R5 #001B - 0x5C140200, // 0016 MOVE R5 R1 - 0x5C180000, // 0017 MOVE R6 R0 - 0x7C140200, // 0018 CALL R5 1 - 0x90020C05, // 0019 SETMBR R0 K6 R5 + 0x4C100000, // 0000 LDNIL R4 + 0x20100604, // 0001 NE R4 R3 R4 + 0x78120005, // 0002 JMPF R4 #0009 + 0xB8120000, // 0003 GETNGBL R4 K0 + 0x8C100901, // 0004 GETMET R4 R4 K1 + 0x5C180600, // 0005 MOVE R6 R3 + 0x7C100400, // 0006 CALL R4 2 + 0x74120000, // 0007 JMPT R4 #0009 + 0x80000800, // 0008 RET 0 + 0x90020402, // 0009 SETMBR R0 K2 R2 + 0xB8120000, // 000A GETNGBL R4 K0 + 0x8C100904, // 000B GETMET R4 R4 K4 + 0x88180102, // 000C GETMBR R6 R0 K2 + 0x7C100400, // 000D CALL R4 2 + 0x90020604, // 000E SETMBR R0 K3 R4 + 0x88100103, // 000F GETMBR R4 R0 K3 + 0x78120019, // 0010 JMPF R4 #002B + 0x60100004, // 0011 GETGBL R4 G4 + 0x5C140200, // 0012 MOVE R5 R1 + 0x7C100200, // 0013 CALL R4 1 + 0x1C100905, // 0014 EQ R4 R4 K5 + 0x78120004, // 0015 JMPF R4 #001B + 0x5C100200, // 0016 MOVE R4 R1 + 0x5C140000, // 0017 MOVE R5 R0 + 0x7C100200, // 0018 CALL R4 1 + 0x90020C04, // 0019 SETMBR R0 K6 R4 0x70020000, // 001A JMP #001C 0x90020C01, // 001B SETMBR R0 K6 R1 - 0x88140106, // 001C GETMBR R5 R0 K6 - 0x4C180000, // 001D LDNIL R6 - 0x1C140A06, // 001E EQ R5 R5 R6 - 0x78160001, // 001F JMPF R5 #0022 - 0x4C140000, // 0020 LDNIL R5 - 0x90020605, // 0021 SETMBR R0 K3 R5 - 0x88140103, // 0022 GETMBR R5 R0 K3 - 0x78160006, // 0023 JMPF R5 #002B - 0x60140001, // 0024 GETGBL R5 G1 - 0x58180007, // 0025 LDCONST R6 K7 - 0x881C0106, // 0026 GETMBR R7 R0 K6 - 0x58200008, // 0027 LDCONST R8 K8 - 0x88240103, // 0028 GETMBR R9 R0 K3 - 0x88241309, // 0029 GETMBR R9 R9 K9 - 0x7C140800, // 002A CALL R5 4 + 0x88100106, // 001C GETMBR R4 R0 K6 + 0x4C140000, // 001D LDNIL R5 + 0x1C100805, // 001E EQ R4 R4 R5 + 0x78120001, // 001F JMPF R4 #0022 + 0x4C100000, // 0020 LDNIL R4 + 0x90020604, // 0021 SETMBR R0 K3 R4 + 0x88100103, // 0022 GETMBR R4 R0 K3 + 0x78120006, // 0023 JMPF R4 #002B + 0x60100001, // 0024 GETGBL R4 G1 + 0x58140007, // 0025 LDCONST R5 K7 + 0x88180106, // 0026 GETMBR R6 R0 K6 + 0x581C0008, // 0027 LDCONST R7 K8 + 0x88200103, // 0028 GETMBR R8 R0 K3 + 0x88201109, // 0029 GETMBR R8 R8 K9 + 0x7C100800, // 002A CALL R4 4 0x80000000, // 002B RET 0 }) ) diff --git a/lib/libesp32/berry/default/embedded/Driver.be b/lib/libesp32/berry/default/embedded/Driver.be index d0782f024..bb365aa29 100644 --- a/lib/libesp32/berry/default/embedded/Driver.be +++ b/lib/libesp32/berry/default/embedded/Driver.be @@ -16,13 +16,6 @@ class Driver var button_pressed var display - def init() - end - - def get_tasmota() - return tasmota - end - def add_cmd(c, f) tasmota.add_cmd(c, / cmd, idx, payload, payload_json -> f(self, cmd, idx, payload, payload_json)) end diff --git a/lib/libesp32/berry/default/embedded/i2c_driver.be b/lib/libesp32/berry/default/embedded/i2c_driver.be index a66afa5ad..816a4d9be 100644 --- a/lib/libesp32/berry/default/embedded/i2c_driver.be +++ b/lib/libesp32/berry/default/embedded/i2c_driver.be @@ -29,8 +29,6 @@ class I2C_Driver - i2c_index : Tasmota I2C index, see `I2CDEVICES.md` (int) --# def init(name_or_detect, addr, i2c_index) - var tasmota = self.get_tasmota() #- retrieve the 'tasmota' singleton -# - #- check if the i2c index is disabled by Tasmota configuration -# if i2c_index != nil && !tasmota.i2c_enabled(i2c_index) return end diff --git a/lib/libesp32/berry/generate/be_const_strtab.h b/lib/libesp32/berry/generate/be_const_strtab.h index 0635eefc5..3c0d37bc8 100644 --- a/lib/libesp32/berry/generate/be_const_strtab.h +++ b/lib/libesp32/berry/generate/be_const_strtab.h @@ -400,7 +400,6 @@ extern const bcstring be_const_str_get_style_bg_color; extern const bcstring be_const_str_get_style_line_color; extern const bcstring be_const_str_get_style_pad_right; extern const bcstring be_const_str_get_switch; -extern const bcstring be_const_str_get_tasmota; extern const bcstring be_const_str_get_temp; extern const bcstring be_const_str_get_vbus_current; extern const bcstring be_const_str_get_vbus_voltage; diff --git a/lib/libesp32/berry/generate/be_const_strtab_def.h b/lib/libesp32/berry/generate/be_const_strtab_def.h index 9cfcd09bc..544cfdd52 100644 --- a/lib/libesp32/berry/generate/be_const_strtab_def.h +++ b/lib/libesp32/berry/generate/be_const_strtab_def.h @@ -264,7 +264,7 @@ be_define_const_str(collect, "collect", 2399039025u, 0, 7, &be_const_str_json_fd be_define_const_str(color, "color", 1031692888u, 0, 5, &be_const_str_del); be_define_const_str(compile, "compile", 1000265118u, 0, 7, &be_const_str_skip); be_define_const_str(compress, "compress", 2818084237u, 0, 8, &be_const_str_width_def); -be_define_const_str(concat, "concat", 4124019837u, 0, 6, &be_const_str_get_tasmota); +be_define_const_str(concat, "concat", 4124019837u, 0, 6, NULL); be_define_const_str(connect, "connect", 2866859257u, 0, 7, &be_const_str_resolvecmnd); be_define_const_str(connected, "connected", 1424938192u, 0, 9, &be_const_str_exp); be_define_const_str(connection_error, "connection_error", 1358926260u, 0, 16, &be_const_str_tanh); @@ -392,7 +392,6 @@ be_define_const_str(get_style_bg_color, "get_style_bg_color", 964794381u, 0, 18, be_define_const_str(get_style_line_color, "get_style_line_color", 805371932u, 0, 20, &be_const_str_ip); be_define_const_str(get_style_pad_right, "get_style_pad_right", 3150287466u, 0, 19, NULL); be_define_const_str(get_switch, "get_switch", 164821028u, 0, 10, &be_const_str_init_draw_line_dsc); -be_define_const_str(get_tasmota, "get_tasmota", 334356779u, 0, 11, NULL); be_define_const_str(get_temp, "get_temp", 3370919486u, 0, 8, NULL); be_define_const_str(get_vbus_current, "get_vbus_current", 1205347942u, 0, 16, &be_const_str_rotate); be_define_const_str(get_vbus_voltage, "get_vbus_voltage", 2398210401u, 0, 16, NULL); @@ -1102,6 +1101,6 @@ static const bstring* const m_string_table[] = { static const struct bconststrtab m_const_string_table = { .size = 358, - .count = 740, + .count = 739, .table = m_string_table }; diff --git a/tasmota/berry/drivers/i2c_axp192_M5StackCore2.be b/tasmota/berry/drivers/i2c_axp192_M5StackCore2.be index 79e6ee7f6..212fc8e32 100644 --- a/tasmota/berry/drivers/i2c_axp192_M5StackCore2.be +++ b/tasmota/berry/drivers/i2c_axp192_M5StackCore2.be @@ -67,9 +67,9 @@ class AXP192_M5Stack_Core2 : AXP192 # Reset LCD Controller self.set_lcd_reset(false) - self.get_tasmota().delay(100) # wait for 100ms + tasmota.delay(100) # wait for 100ms self.set_lcd_reset(true) - self.get_tasmota().delay(100) # wait for 100ms + tasmota.delay(100) # wait for 100ms # bus power mode_output self.set_buf_power_mode(false) From fe682ea97f8136cf85bbbaf1589b914b17a55d34 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Thu, 16 Dec 2021 16:43:13 +0100 Subject: [PATCH 92/97] Berry fix memory corruption due to unicode character --- lib/libesp32/berry/default/be_i2c_axp192_lib.c | 2 +- lib/libesp32/berry/default/embedded/i2c_axp192.be | 2 +- lib/libesp32/berry/generate/be_const_strtab.h | 2 +- lib/libesp32/berry/generate/be_const_strtab_def.h | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libesp32/berry/default/be_i2c_axp192_lib.c b/lib/libesp32/berry/default/be_i2c_axp192_lib.c index 4f9f02307..528ce2f4c 100644 --- a/lib/libesp32/berry/default/be_i2c_axp192_lib.c +++ b/lib/libesp32/berry/default/be_i2c_axp192_lib.c @@ -712,7 +712,7 @@ be_local_closure(AXP192_web_sensor, /* name */ /* K4 */ be_nested_str(_X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D), /* K5 */ be_nested_str(_X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D), /* K6 */ be_nested_str(_X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D), - /* K7 */ be_nested_str(_X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D), + /* K7 */ be_nested_str(_X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20C_X7Be_X7D), /* K8 */ be_nested_str(get_vbus_voltage), /* K9 */ be_nested_str(get_bat_voltage), /* K10 */ be_nested_str(get_bat_current), diff --git a/lib/libesp32/berry/default/embedded/i2c_axp192.be b/lib/libesp32/berry/default/embedded/i2c_axp192.be index 3d958334f..2869b1d38 100644 --- a/lib/libesp32/berry/default/embedded/i2c_axp192.be +++ b/lib/libesp32/berry/default/embedded/i2c_axp192.be @@ -153,7 +153,7 @@ class AXP192 : I2C_Driver "{s}Batt Voltage{m}%.3f V{e}".. "{s}Batt Current{m}%.1f mA{e}".. #"{s}Batt Power{m}%.3f{e}".. - "{s}Temp AXP{m}%.1f °C{e}", + "{s}Temp AXP{m}%.1f C{e}", self.get_vbus_voltage(), self.get_vbus_voltage(), self.get_bat_voltage(), self.get_bat_current(), #self.get_bat_power(), diff --git a/lib/libesp32/berry/generate/be_const_strtab.h b/lib/libesp32/berry/generate/be_const_strtab.h index 3c0d37bc8..977069d28 100644 --- a/lib/libesp32/berry/generate/be_const_strtab.h +++ b/lib/libesp32/berry/generate/be_const_strtab.h @@ -162,7 +162,7 @@ extern const bcstring be_const_str__X7B; extern const bcstring be_const_str__X7B_X7D; extern const bcstring be_const_str__X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D; extern const bcstring be_const_str__X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D; -extern const bcstring be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D; +extern const bcstring be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20C_X7Be_X7D; extern const bcstring be_const_str__X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D; extern const bcstring be_const_str__X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D; extern const bcstring be_const_str__X7D; diff --git a/lib/libesp32/berry/generate/be_const_strtab_def.h b/lib/libesp32/berry/generate/be_const_strtab_def.h index 544cfdd52..3375cece2 100644 --- a/lib/libesp32/berry/generate/be_const_strtab_def.h +++ b/lib/libesp32/berry/generate/be_const_strtab_def.h @@ -577,7 +577,7 @@ be_define_const_str(run_deferred, "run_deferred", 371594696u, 0, 12, NULL); be_define_const_str(running, "running", 343848780u, 0, 7, NULL); be_define_const_str(save, "save", 3439296072u, 0, 4, NULL); be_define_const_str(save_before_restart, "save_before_restart", 1253239338u, 0, 19, &be_const_str_scale_uint); -be_define_const_str(scale_uint, "scale_uint", 3090811094u, 0, 10, &be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D); +be_define_const_str(scale_uint, "scale_uint", 3090811094u, 0, 10, NULL); be_define_const_str(scan, "scan", 3974641896u, 0, 4, NULL); be_define_const_str(search, "search", 2150836393u, 0, 6, NULL); be_define_const_str(sec, "sec", 3139892658u, 0, 3, NULL); @@ -642,7 +642,7 @@ be_define_const_str(super, "super", 4152230356u, 0, 5, NULL); be_define_const_str(sys, "sys", 3277365014u, 0, 3, NULL); be_define_const_str(tag, "tag", 2516003219u, 0, 3, NULL); be_define_const_str(tan, "tan", 2633446552u, 0, 3, &be_const_str_do); -be_define_const_str(tanh, "tanh", 153638352u, 0, 4, NULL); +be_define_const_str(tanh, "tanh", 153638352u, 0, 4, &be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20C_X7Be_X7D); be_define_const_str(target, "target", 845187144u, 0, 6, NULL); be_define_const_str(target_search, "target_search", 1947846553u, 0, 13, NULL); be_define_const_str(tasmota, "tasmota", 424643812u, 0, 7, NULL); @@ -732,7 +732,7 @@ be_define_const_str(zip, "zip", 2877453236u, 0, 3, NULL); be_define_const_str(_X7B, "{", 4262220314u, 0, 1, NULL); be_define_const_str(_X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D, "{s}Batt Current{m}%.1f mA{e}", 866537156u, 0, 28, NULL); be_define_const_str(_X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D, "{s}Batt Voltage{m}%.3f V{e}", 3184308199u, 0, 27, NULL); -be_define_const_str(_X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D, "{s}Temp AXP{m}%.1f \u00b0C{e}", 2304457292u, 0, 24, NULL); +be_define_const_str(_X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20C_X7Be_X7D, "{s}Temp AXP{m}%.1f C{e}", 3211020286u, 0, 23, NULL); be_define_const_str(_X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D, "{s}VBus Current{m}%.1f mA{e}", 1032721155u, 0, 28, NULL); be_define_const_str(_X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D, "{s}VBus Voltage{m}%.3f V{e}", 165651270u, 0, 27, NULL); be_define_const_str(_X7B_X7D, "{}", 1415952421u, 0, 2, NULL); From 5cd2c22730ccb40e946a9977375b2bbd555b56cd Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Thu, 16 Dec 2021 18:40:46 +0100 Subject: [PATCH 93/97] Use htlm `°` entity --- lib/libesp32/berry/default/be_i2c_axp192_lib.c | 2 +- lib/libesp32/berry/default/embedded/i2c_axp192.be | 2 +- lib/libesp32/berry/generate/be_const_strtab.h | 2 +- lib/libesp32/berry/generate/be_const_strtab_def.h | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libesp32/berry/default/be_i2c_axp192_lib.c b/lib/libesp32/berry/default/be_i2c_axp192_lib.c index 528ce2f4c..298e7b3a2 100644 --- a/lib/libesp32/berry/default/be_i2c_axp192_lib.c +++ b/lib/libesp32/berry/default/be_i2c_axp192_lib.c @@ -712,7 +712,7 @@ be_local_closure(AXP192_web_sensor, /* name */ /* K4 */ be_nested_str(_X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D), /* K5 */ be_nested_str(_X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D), /* K6 */ be_nested_str(_X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D), - /* K7 */ be_nested_str(_X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20C_X7Be_X7D), + /* K7 */ be_nested_str(_X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_X26deg_X3BC_X7Be_X7D), /* K8 */ be_nested_str(get_vbus_voltage), /* K9 */ be_nested_str(get_bat_voltage), /* K10 */ be_nested_str(get_bat_current), diff --git a/lib/libesp32/berry/default/embedded/i2c_axp192.be b/lib/libesp32/berry/default/embedded/i2c_axp192.be index 2869b1d38..d762b0363 100644 --- a/lib/libesp32/berry/default/embedded/i2c_axp192.be +++ b/lib/libesp32/berry/default/embedded/i2c_axp192.be @@ -153,7 +153,7 @@ class AXP192 : I2C_Driver "{s}Batt Voltage{m}%.3f V{e}".. "{s}Batt Current{m}%.1f mA{e}".. #"{s}Batt Power{m}%.3f{e}".. - "{s}Temp AXP{m}%.1f C{e}", + "{s}Temp AXP{m}%.1f °C{e}", self.get_vbus_voltage(), self.get_vbus_voltage(), self.get_bat_voltage(), self.get_bat_current(), #self.get_bat_power(), diff --git a/lib/libesp32/berry/generate/be_const_strtab.h b/lib/libesp32/berry/generate/be_const_strtab.h index 977069d28..cdf680ea3 100644 --- a/lib/libesp32/berry/generate/be_const_strtab.h +++ b/lib/libesp32/berry/generate/be_const_strtab.h @@ -162,7 +162,7 @@ extern const bcstring be_const_str__X7B; extern const bcstring be_const_str__X7B_X7D; extern const bcstring be_const_str__X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D; extern const bcstring be_const_str__X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D; -extern const bcstring be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20C_X7Be_X7D; +extern const bcstring be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_X26deg_X3BC_X7Be_X7D; extern const bcstring be_const_str__X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D; extern const bcstring be_const_str__X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D; extern const bcstring be_const_str__X7D; diff --git a/lib/libesp32/berry/generate/be_const_strtab_def.h b/lib/libesp32/berry/generate/be_const_strtab_def.h index 3375cece2..cd2198905 100644 --- a/lib/libesp32/berry/generate/be_const_strtab_def.h +++ b/lib/libesp32/berry/generate/be_const_strtab_def.h @@ -642,7 +642,7 @@ be_define_const_str(super, "super", 4152230356u, 0, 5, NULL); be_define_const_str(sys, "sys", 3277365014u, 0, 3, NULL); be_define_const_str(tag, "tag", 2516003219u, 0, 3, NULL); be_define_const_str(tan, "tan", 2633446552u, 0, 3, &be_const_str_do); -be_define_const_str(tanh, "tanh", 153638352u, 0, 4, &be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20C_X7Be_X7D); +be_define_const_str(tanh, "tanh", 153638352u, 0, 4, NULL); be_define_const_str(target, "target", 845187144u, 0, 6, NULL); be_define_const_str(target_search, "target_search", 1947846553u, 0, 13, NULL); be_define_const_str(tasmota, "tasmota", 424643812u, 0, 7, NULL); @@ -671,7 +671,7 @@ be_define_const_str(type, "type", 1361572173u, 0, 4, NULL); be_define_const_str(unknown_X20instruction, "unknown instruction", 1093911841u, 0, 19, &be_const_str_raise); be_define_const_str(update, "update", 672109684u, 0, 6, NULL); be_define_const_str(upper, "upper", 176974407u, 0, 5, NULL); -be_define_const_str(url_encode, "url_encode", 528392145u, 0, 10, NULL); +be_define_const_str(url_encode, "url_encode", 528392145u, 0, 10, &be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_X26deg_X3BC_X7Be_X7D); be_define_const_str(v, "v", 4077666505u, 0, 1, &be_const_str_widget_struct_default); be_define_const_str(value, "value", 1113510858u, 0, 5, NULL); be_define_const_str(value_error, "value_error", 773297791u, 0, 11, NULL); @@ -732,7 +732,7 @@ be_define_const_str(zip, "zip", 2877453236u, 0, 3, NULL); be_define_const_str(_X7B, "{", 4262220314u, 0, 1, NULL); be_define_const_str(_X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D, "{s}Batt Current{m}%.1f mA{e}", 866537156u, 0, 28, NULL); be_define_const_str(_X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D, "{s}Batt Voltage{m}%.3f V{e}", 3184308199u, 0, 27, NULL); -be_define_const_str(_X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20C_X7Be_X7D, "{s}Temp AXP{m}%.1f C{e}", 3211020286u, 0, 23, NULL); +be_define_const_str(_X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_X26deg_X3BC_X7Be_X7D, "{s}Temp AXP{m}%.1f °C{e}", 2622904081u, 0, 28, NULL); be_define_const_str(_X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D, "{s}VBus Current{m}%.1f mA{e}", 1032721155u, 0, 28, NULL); be_define_const_str(_X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D, "{s}VBus Voltage{m}%.3f V{e}", 165651270u, 0, 27, NULL); be_define_const_str(_X7B_X7D, "{}", 1415952421u, 0, 2, NULL); From 776fa99ee6d4e76354112042a0d9491c377edebd Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 17 Dec 2021 11:31:29 +0100 Subject: [PATCH 94/97] Fix exception 28 on HRG15 Fix exception 28 on HRG15 (#14067) --- tasmota/xsns_90_hrg15.ino | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/tasmota/xsns_90_hrg15.ino b/tasmota/xsns_90_hrg15.ino index f7ba63721..46c17b28a 100644 --- a/tasmota/xsns_90_hrg15.ino +++ b/tasmota/xsns_90_hrg15.ino @@ -53,8 +53,7 @@ struct RG15 { float rate = 0.0f; } Rg15; -void Rg15Init(void) -{ +void Rg15Init(void) { Rg15.ready = 0; if (PinUsed(GPIO_HRG15_RX) && PinUsed(GPIO_HRG15_TX)) { HydreonSerial = new TasmotaSerial(Pin(GPIO_HRG15_RX), Pin(GPIO_HRG15_TX)); @@ -92,8 +91,7 @@ bool Rg15Poll(void) { while (HydreonSerial->available()) { Rg15ReadLine(rg15_buffer); - AddLog(LOG_LEVEL_DEBUG_MORE,PSTR("%s:" D_JSON_SERIALRECEIVED " = %s"),"HRG", rg15_buffer); - + AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("HRG: Received '%s'"), rg15_buffer); Rg15Process(rg15_buffer); } @@ -102,11 +100,11 @@ bool Rg15Poll(void) { return true; } -bool Rg15ReadLine(char* buffer) -{ +bool Rg15ReadLine(char* buffer) { char c; uint8_t i = 0; uint32_t cmillis = millis(); + buffer[0] = '\0'; while (1) { if (HydreonSerial->available()) { @@ -121,8 +119,7 @@ bool Rg15ReadLine(char* buffer) return false; } } - - buffer[i-2] = '\0'; + if (i > 1) { buffer[i-2] = '\0'; } return true; } @@ -163,14 +160,14 @@ bool Rg15Command(void) { HydreonSerial->flush(); if (send[0] == 'k' || send[0] == 'K' || send[0] == 'o' || send[0] == 'O') { - ResponseCmndDone(); - return serviced; + ResponseCmndDone(); + return serviced; } char rg15_buffer[255]; if (Rg15ReadLine(rg15_buffer)) { - Response_P(PSTR("{\"" D_JSON_SERIALRECEIVED "\":%s\"}"), rg15_buffer); - Rg15Process(rg15_buffer); + Response_P(PSTR("{\"" D_JSON_SERIALRECEIVED "\":\"%s\"}"), rg15_buffer); + Rg15Process(rg15_buffer); } } @@ -184,7 +181,7 @@ void Rg15Show(bool json) } if (json) { - ResponseAppend_P(PSTR(",\"" RG15_NAME "\":{\"" D_JSON_ACTIVE "\":%2_f, \"" D_JSON_EVENT "\":%2_f, \"" D_JSON_TOTAL "\":%2_f, \"" D_JSON_FLOWRATE "\":%2_f}"), &Rg15.acc, &Rg15.event, &Rg15.total, &Rg15.rate); + ResponseAppend_P(PSTR(",\"" RG15_NAME "\":{\"" D_JSON_ACTIVE "\":%2_f,\"" D_JSON_EVENT "\":%2_f,\"" D_JSON_TOTAL "\":%2_f,\"" D_JSON_FLOWRATE "\":%2_f}"), &Rg15.acc, &Rg15.event, &Rg15.total, &Rg15.rate); #ifdef USE_WEBSERVER } else { WSContentSend_PD(HTTP_RG15, &Rg15.acc, &Rg15.event, &Rg15.total, &Rg15.rate); From 8bad0115b03ecb51694fec750e7b523f546729bc Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 17 Dec 2021 18:01:27 +0100 Subject: [PATCH 95/97] Fix ESP32 webcam WDT Fix ESP32 webcam WDT (#13882) --- lib/libesp32_div/esp32-camera/CMakeLists.txt | 64 + lib/libesp32_div/esp32-camera/Kconfig | 114 ++ lib/libesp32_div/esp32-camera/LICENSE | 202 +++ lib/libesp32_div/esp32-camera/README.md | 368 ++++++ lib/libesp32_div/esp32-camera/component.mk | 4 + .../esp32-camera/conversions/esp_jpg_decode.c | 132 ++ .../conversions/include/esp_jpg_decode.h | 43 + .../conversions/include/img_converters.h | 130 ++ .../esp32-camera/conversions/jpge.cpp | 723 +++++++++++ .../conversions/private_include/jpge.h | 142 +++ .../conversions/private_include/yuv.h | 29 + .../esp32-camera/conversions/to_bmp.c | 393 ++++++ .../esp32-camera/conversions/to_jpg.cpp | 245 ++++ .../esp32-camera/conversions/yuv.c | 298 +++++ .../esp32-camera/driver/cam_hal.c | 483 +++++++ .../esp32-camera/driver/esp_camera.c | 416 ++++++ .../esp32-camera/driver/include/esp_camera.h | 214 ++++ .../esp32-camera/driver/include/sensor.h | 245 ++++ .../driver/private_include/cam_hal.h | 60 + .../driver/private_include/sccb.h | 19 + .../driver/private_include/xclk.h | 9 + lib/libesp32_div/esp32-camera/driver/sccb.c | 184 +++ lib/libesp32_div/esp32-camera/driver/sensor.c | 52 + .../esp32-camera/examples/CMakeLists.txt | 9 + .../esp32-camera/examples/Makefile | 11 + .../esp32-camera/examples/main/CMakeLists.txt | 3 + .../esp32-camera/examples/main/component.mk | 5 + .../esp32-camera/examples/main/take_picture.c | 155 +++ .../esp32-camera/examples/sdkconfig.defaults | 17 + lib/libesp32_div/esp32-camera/library.json | 26 + .../esp32-camera/sensors/gc0308.c | 465 +++++++ .../esp32-camera/sensors/gc032a.c | 391 ++++++ .../esp32-camera/sensors/gc2145.c | 475 +++++++ .../esp32-camera/sensors/nt99141.c | 1022 +++++++++++++++ .../esp32-camera/sensors/ov2640.c | 612 +++++++++ .../esp32-camera/sensors/ov3660.c | 1053 +++++++++++++++ .../esp32-camera/sensors/ov5640.c | 1130 +++++++++++++++++ .../esp32-camera/sensors/ov7670.c | 457 +++++++ .../esp32-camera/sensors/ov7725.c | 575 +++++++++ .../sensors/private_include/gc0308.h | 31 + .../sensors/private_include/gc0308_regs.h | 25 + .../sensors/private_include/gc0308_settings.h | 245 ++++ .../sensors/private_include/gc032a.h | 31 + .../sensors/private_include/gc032a_regs.h | 82 ++ .../sensors/private_include/gc032a_settings.h | 401 ++++++ .../sensors/private_include/gc2145.h | 27 + .../sensors/private_include/gc2145_regs.h | 85 ++ .../sensors/private_include/gc2145_settings.h | 719 +++++++++++ .../sensors/private_include/nt99141.h | 34 + .../sensors/private_include/nt99141_regs.h | 211 +++ .../private_include/nt99141_settings.h | 825 ++++++++++++ .../sensors/private_include/ov2640.h | 32 + .../sensors/private_include/ov2640_regs.h | 216 ++++ .../sensors/private_include/ov2640_settings.h | 485 +++++++ .../sensors/private_include/ov3660.h | 34 + .../sensors/private_include/ov3660_regs.h | 211 +++ .../sensors/private_include/ov3660_settings.h | 318 +++++ .../sensors/private_include/ov5640.h | 27 + .../sensors/private_include/ov5640_regs.h | 213 ++++ .../sensors/private_include/ov5640_settings.h | 334 +++++ .../sensors/private_include/ov7670.h | 33 + .../sensors/private_include/ov7670_regs.h | 354 ++++++ .../sensors/private_include/ov7725.h | 33 + .../sensors/private_include/ov7725_regs.h | 335 +++++ .../esp32-camera/target/esp32/ll_cam.c | 522 ++++++++ .../esp32-camera/target/esp32s2/ll_cam.c | 402 ++++++ .../target/esp32s2/private_include/tjpgd.h | 99 ++ .../esp32-camera/target/esp32s2/tjpgd.c | 970 ++++++++++++++ .../esp32-camera/target/esp32s3/ll_cam.c | 452 +++++++ .../target/private_include/ll_cam.h | 141 ++ lib/libesp32_div/esp32-camera/target/xclk.c | 64 + .../esp32-camera/test/CMakeLists.txt | 4 + .../esp32-camera/test/component.mk | 8 + .../test/pictures/test_inside.jpeg | Bin 0 -> 18832 bytes .../test/pictures/test_outside.jpeg | Bin 0 -> 81744 bytes .../esp32-camera/test/pictures/testimg.jpeg | Bin 0 -> 5764 bytes .../esp32-camera/test/test_camera.c | 500 ++++++++ platformio_tasmota_env32.ini | 2 +- tasmota/support_esp.ino | 25 +- tasmota/tasmota.ino | 7 +- tasmota/xdrv_50_filesystem.ino | 52 +- tasmota/xdrv_81_esp32_webcam.ino | 34 +- 82 files changed, 19546 insertions(+), 52 deletions(-) create mode 100644 lib/libesp32_div/esp32-camera/CMakeLists.txt create mode 100644 lib/libesp32_div/esp32-camera/Kconfig create mode 100644 lib/libesp32_div/esp32-camera/LICENSE create mode 100644 lib/libesp32_div/esp32-camera/README.md create mode 100644 lib/libesp32_div/esp32-camera/component.mk create mode 100644 lib/libesp32_div/esp32-camera/conversions/esp_jpg_decode.c create mode 100644 lib/libesp32_div/esp32-camera/conversions/include/esp_jpg_decode.h create mode 100644 lib/libesp32_div/esp32-camera/conversions/include/img_converters.h create mode 100644 lib/libesp32_div/esp32-camera/conversions/jpge.cpp create mode 100644 lib/libesp32_div/esp32-camera/conversions/private_include/jpge.h create mode 100644 lib/libesp32_div/esp32-camera/conversions/private_include/yuv.h create mode 100644 lib/libesp32_div/esp32-camera/conversions/to_bmp.c create mode 100644 lib/libesp32_div/esp32-camera/conversions/to_jpg.cpp create mode 100644 lib/libesp32_div/esp32-camera/conversions/yuv.c create mode 100644 lib/libesp32_div/esp32-camera/driver/cam_hal.c create mode 100644 lib/libesp32_div/esp32-camera/driver/esp_camera.c create mode 100644 lib/libesp32_div/esp32-camera/driver/include/esp_camera.h create mode 100644 lib/libesp32_div/esp32-camera/driver/include/sensor.h create mode 100644 lib/libesp32_div/esp32-camera/driver/private_include/cam_hal.h create mode 100644 lib/libesp32_div/esp32-camera/driver/private_include/sccb.h create mode 100644 lib/libesp32_div/esp32-camera/driver/private_include/xclk.h create mode 100644 lib/libesp32_div/esp32-camera/driver/sccb.c create mode 100644 lib/libesp32_div/esp32-camera/driver/sensor.c create mode 100644 lib/libesp32_div/esp32-camera/examples/CMakeLists.txt create mode 100644 lib/libesp32_div/esp32-camera/examples/Makefile create mode 100644 lib/libesp32_div/esp32-camera/examples/main/CMakeLists.txt create mode 100644 lib/libesp32_div/esp32-camera/examples/main/component.mk create mode 100644 lib/libesp32_div/esp32-camera/examples/main/take_picture.c create mode 100644 lib/libesp32_div/esp32-camera/examples/sdkconfig.defaults create mode 100644 lib/libesp32_div/esp32-camera/library.json create mode 100644 lib/libesp32_div/esp32-camera/sensors/gc0308.c create mode 100644 lib/libesp32_div/esp32-camera/sensors/gc032a.c create mode 100644 lib/libesp32_div/esp32-camera/sensors/gc2145.c create mode 100644 lib/libesp32_div/esp32-camera/sensors/nt99141.c create mode 100644 lib/libesp32_div/esp32-camera/sensors/ov2640.c create mode 100644 lib/libesp32_div/esp32-camera/sensors/ov3660.c create mode 100644 lib/libesp32_div/esp32-camera/sensors/ov5640.c create mode 100644 lib/libesp32_div/esp32-camera/sensors/ov7670.c create mode 100644 lib/libesp32_div/esp32-camera/sensors/ov7725.c create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/gc0308.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/gc0308_regs.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/gc0308_settings.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/gc032a.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/gc032a_regs.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/gc032a_settings.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/gc2145.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/gc2145_regs.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/gc2145_settings.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/nt99141.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/nt99141_regs.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/nt99141_settings.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/ov2640.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/ov2640_regs.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/ov2640_settings.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/ov3660.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/ov3660_regs.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/ov3660_settings.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/ov5640.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/ov5640_regs.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/ov5640_settings.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/ov7670.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/ov7670_regs.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/ov7725.h create mode 100644 lib/libesp32_div/esp32-camera/sensors/private_include/ov7725_regs.h create mode 100644 lib/libesp32_div/esp32-camera/target/esp32/ll_cam.c create mode 100644 lib/libesp32_div/esp32-camera/target/esp32s2/ll_cam.c create mode 100644 lib/libesp32_div/esp32-camera/target/esp32s2/private_include/tjpgd.h create mode 100644 lib/libesp32_div/esp32-camera/target/esp32s2/tjpgd.c create mode 100644 lib/libesp32_div/esp32-camera/target/esp32s3/ll_cam.c create mode 100644 lib/libesp32_div/esp32-camera/target/private_include/ll_cam.h create mode 100644 lib/libesp32_div/esp32-camera/target/xclk.c create mode 100644 lib/libesp32_div/esp32-camera/test/CMakeLists.txt create mode 100644 lib/libesp32_div/esp32-camera/test/component.mk create mode 100644 lib/libesp32_div/esp32-camera/test/pictures/test_inside.jpeg create mode 100644 lib/libesp32_div/esp32-camera/test/pictures/test_outside.jpeg create mode 100644 lib/libesp32_div/esp32-camera/test/pictures/testimg.jpeg create mode 100644 lib/libesp32_div/esp32-camera/test/test_camera.c diff --git a/lib/libesp32_div/esp32-camera/CMakeLists.txt b/lib/libesp32_div/esp32-camera/CMakeLists.txt new file mode 100644 index 000000000..5ceec97c0 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/CMakeLists.txt @@ -0,0 +1,64 @@ +if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET STREQUAL "esp32s3") + set(COMPONENT_SRCS + driver/esp_camera.c + driver/cam_hal.c + driver/sccb.c + driver/sensor.c + sensors/ov2640.c + sensors/ov3660.c + sensors/ov5640.c + sensors/ov7725.c + sensors/ov7670.c + sensors/nt99141.c + sensors/gc0308.c + sensors/gc2145.c + sensors/gc032a.c + conversions/yuv.c + conversions/to_jpg.cpp + conversions/to_bmp.c + conversions/jpge.cpp + conversions/esp_jpg_decode.c + ) + + set(COMPONENT_ADD_INCLUDEDIRS + driver/include + conversions/include + ) + + set(COMPONENT_PRIV_INCLUDEDIRS + driver/private_include + sensors/private_include + conversions/private_include + target/private_include + ) + + if(IDF_TARGET STREQUAL "esp32") + list(APPEND COMPONENT_SRCS + target/xclk.c + target/esp32/ll_cam.c + ) + endif() + + if(IDF_TARGET STREQUAL "esp32s2") + list(APPEND COMPONENT_SRCS + target/xclk.c + target/esp32s2/ll_cam.c + target/esp32s2/tjpgd.c + ) + + list(APPEND COMPONENT_PRIV_INCLUDEDIRS + target/esp32s2/private_include + ) + endif() + + if(IDF_TARGET STREQUAL "esp32s3") + list(APPEND COMPONENT_SRCS + target/esp32s3/ll_cam.c + ) + endif() + + set(COMPONENT_REQUIRES driver) + set(COMPONENT_PRIV_REQUIRES freertos nvs_flash) + + register_component() +endif() diff --git a/lib/libesp32_div/esp32-camera/Kconfig b/lib/libesp32_div/esp32-camera/Kconfig new file mode 100644 index 000000000..6fb5aad21 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/Kconfig @@ -0,0 +1,114 @@ +menu "Camera configuration" + + config OV7670_SUPPORT + bool "Support OV7670 VGA" + default y + help + Enable this option if you want to use the OV7670. + Disable this option to save memory. + + config OV7725_SUPPORT + bool "Support OV7725 VGA" + default y + help + Enable this option if you want to use the OV7725. + Disable this option to save memory. + + config NT99141_SUPPORT + bool "Support NT99141 HD" + default y + help + Enable this option if you want to use the NT99141. + Disable this option to save memory. + + config OV2640_SUPPORT + bool "Support OV2640 2MP" + default y + help + Enable this option if you want to use the OV2640. + Disable this option to save memory. + + config OV3660_SUPPORT + bool "Support OV3660 3MP" + default y + help + Enable this option if you want to use the OV3360. + Disable this option to save memory. + + config OV5640_SUPPORT + bool "Support OV5640 5MP" + default y + help + Enable this option if you want to use the OV5640. + Disable this option to save memory. + + config GC2145_SUPPORT + bool "Support GC2145 2MP" + default y + help + Enable this option if you want to use the GC2145. + Disable this option to save memory. + + config GC032A_SUPPORT + bool "Support GC032A VGA" + default y + help + Enable this option if you want to use the GC032A. + Disable this option to save memory. + + config GC0308_SUPPORT + bool "Support GC0308 VGA" + default y + help + Enable this option if you want to use the GC0308. + Disable this option to save memory. + + choice SCCB_HARDWARE_I2C_PORT + bool "I2C peripheral to use for SCCB" + default SCCB_HARDWARE_I2C_PORT1 + + config SCCB_HARDWARE_I2C_PORT0 + bool "I2C0" + config SCCB_HARDWARE_I2C_PORT1 + bool "I2C1" + + endchoice + + choice GC_SENSOR_WINDOW_MODE + bool "GalaxyCore Sensor Window Mode" + depends on (GC2145_SUPPORT || GC032A_SUPPORT || GC0308_SUPPORT) + default GC_SENSOR_SUBSAMPLE_MODE + help + This option determines how to reduce the output size when the resolution you set is less than the maximum resolution. + SUBSAMPLE_MODE has a bigger perspective and WINDOWING_MODE has a higher frame rate. + + config GC_SENSOR_WINDOWING_MODE + bool "Windowing Mode" + config GC_SENSOR_SUBSAMPLE_MODE + bool "Subsample Mode" + endchoice + + choice CAMERA_TASK_PINNED_TO_CORE + bool "Camera task pinned to core" + default CAMERA_CORE0 + help + Pin the camera handle task to a certain core(0/1). It can also be done automatically choosing NO_AFFINITY. + + config CAMERA_CORE0 + bool "CORE0" + config CAMERA_CORE1 + bool "CORE1" + config CAMERA_NO_AFFINITY + bool "NO_AFFINITY" + + endchoice + + config CAMERA_DMA_BUFFER_SIZE_MAX + int "DMA buffer size" + range 8192 32768 + default 32768 + help + Maximum value of DMA buffer + Larger values may fail to allocate due to insufficient contiguous memory blocks, and smaller value may cause DMA interrupt to be too frequent + +endmenu diff --git a/lib/libesp32_div/esp32-camera/LICENSE b/lib/libesp32_div/esp32-camera/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lib/libesp32_div/esp32-camera/README.md b/lib/libesp32_div/esp32-camera/README.md new file mode 100644 index 000000000..e93d5cdba --- /dev/null +++ b/lib/libesp32_div/esp32-camera/README.md @@ -0,0 +1,368 @@ +# ESP32 Camera Driver + +[![Build examples](https://github.com/espressif/esp32-camera/actions/workflows/build.yml/badge.svg)](https://github.com/espressif/esp32-camera/actions/workflows/build.yml) +## General Information + +This repository hosts ESP32 series Soc compatible driver for image sensors. Additionally it provides a few tools, which allow converting the captured frame data to the more common BMP and JPEG formats. + +### Supported Soc + +- ESP32 +- ESP32-S2 +- ESP32-S3 + +### Supported Sensor + +| model | max resolution | color type | output format | Len Size | +| ------- | -------------- | ---------- | ------------------------------------------------------------ | -------- | +| OV2640 | 1600 x 1200 | color | YUV(422/420)/YCbCr422
RGB565/555
8-bit compressed data
8/10-bit Raw RGB data | 1/4" | +| OV3660 | 2048 x 1536 | color | raw RGB data
RGB565/555/444
CCIR656
YCbCr422
compression | 1/5" | +| OV5640 | 2592 x 1944 | color | RAW RGB
RGB565/555/444
CCIR656
YUV422/420
YCbCr422
compression | 1/4" | +| OV7670 | 640 x 480 | color | Raw Bayer RGB
Processed Bayer RGB
YUV/YCbCr422
GRB422
RGB565/555 | 1/6" | +| OV7725 | 640 x 480 | color | Raw RGB
GRB 422
RGB565/555/444
YCbCr 422 | 1/4" | +| NT99141 | 1280 x 720 | color | YCbCr 422
RGB565/555/444
Raw
CCIR656
JPEG compression | 1/4" | +| GC032A | 640 x 480 | color | YUV/YCbCr422
RAW Bayer
RGB565 | 1/10" | +| GC0308 | 640 x 480 | color | YUV/YCbCr422
RAW Bayer
RGB565 | 1/6.5" | +| GC2145 | 1600 x 1200 | color | YUV/YCbCr422
RAW Bayer
RGB565 | 1/5" | + +## Important to Remember + +- Except when using CIF or lower resolution with JPEG, the driver requires PSRAM to be installed and activated. +- Using YUV or RGB puts a lot of strain on the chip because writing to PSRAM is not particularly fast. The result is that image data might be missing. This is particularly true if WiFi is enabled. If you need RGB data, it is recommended that JPEG is captured and then turned into RGB using `fmt2rgb888` or `fmt2bmp`/`frame2bmp`. +- When 1 frame buffer is used, the driver will wait for the current frame to finish (VSYNC) and start I2S DMA. After the frame is acquired, I2S will be stopped and the frame buffer returned to the application. This approach gives more control over the system, but results in longer time to get the frame. +- When 2 or more frame bufers are used, I2S is running in continuous mode and each frame is pushed to a queue that the application can access. This approach puts more strain on the CPU/Memory, but allows for double the frame rate. Please use only with JPEG. + +## Installation Instructions + + +### Using esp-idf + +- Clone or download and extract the repository to the components folder of your ESP-IDF project +- Enable PSRAM in `menuconfig` (also set Flash and PSRAM frequiencies to 80MHz) +- Include `esp_camera.h` in your code + +### Using PlatformIO + +The easy way -- on the `env` section of `platformio.ini`, add the following: + +```ini +[env] +lib_deps = + esp32-camera +``` + +Now the `esp_camera.h` is available to be included: + +```c +#include "esp_camera.h" +``` + +Enable PSRAM on `menuconfig` or type it direclty on `sdkconfig`. Check the [official doc](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig.html#config-esp32-spiram-support) for more info. + +``` +CONFIG_ESP32_SPIRAM_SUPPORT=y +``` + +***Arduino*** The easy-way (content above) only seems to work if you're using `framework=arduino` which seems to take a bunch of the guesswork out (thanks Arduino!) but also suck up a lot more memory and flash, almost crippling the performance. If you plan to use the `framework=espidf` then read the sections below carefully!! + +## Platform.io lib/submodule (for framework=espidf) + +It's probably easier to just skip the platform.io library registry version and link the git repo as a submodule. (i.e. using code outside the platform.io library management). In this example we will install this as a submodule inside the platform.io $project/lib folder: +``` +cd $project\lib +git submodule add -b master https://github.com/espressif/esp32-camera.git +``` + +Then in `platformio.ini` file +``` +build_flags = + -I../lib/esp32-camera +``` +After that `#include "esp_camera.h"` statement will be available. Now the module is included, and you're hopefully back to the same place as the easy-Arduino way. + +**Warning about platform.io/espidf and fresh (not initialized) git repos** +There is a sharp-edge on you'll discover in the platform.io build process (in espidf v3.3 & 4.0.1) where a project which has only had `git init` but nothing committed will crash platform.io build process with highly non-useful output. The cause is due to lack of a version (making you think you did something wrong, when you didn't at all) - the output is horribly non-descript. Solution: the devs want you to create a file called version.txt with a number in it, or simply commit any file to the projects git repo and use git. This happens because platform.io build process tries to be too clever and determine the build version number from the git repo - it's a sharp edge you'll only encounter if you're experimenting on a new project with no commits .. like wtf is my camera not working let's try a 'clean project'?! + +## Platform.io Kconfig +Kconfig is used by the platform.io menuconfig (accessed by running: `pio run -t menuconfig`) to interactively manage the various #ifdef statements throughout the espidf and supporting libraries (i.e. this repo: esp32-camera and arduino-esp32.git). The menuconfig process generates the `sdkconfig` file which is ultimately used behind the scenes by espidf compile+build process. + +**Make sure to append or symlink** [this `Kconfig`](./Kconfig) content into the `Kconfig` of your project. + +You symlink (or copy) the included Kconfig into your platform.io projects src directory. The file should be named `Kconfig.projbuild` in your projects src\ directory or you could also add the library path to a CMakefile.txt and hope the `Kconfig` (or `Kconfig.projbuild`) gets discovered by the menuconfig process, though this unpredictable for me. + +The unpredictable wonky behavior in platform.io build process around Kconfig naming (Kconfig vs. Kconfig.projbuild) occurs between espidf versions 3.3 and 4.0 - but if you don't see "Camera configuration" in your `pio run -t menuconfig` then there is no point trying to test camera code (it may compile, but it probably won't work!) and it seems the platform.io devs (when they built their wrapper around the espidf menuconfig) didn't implement it properly. You've probably already figured out you can't use the espidf build tools since the files are in totally different locations and also different versions with sometimes different syntax. This is one of those times you might consider changing the `platformio.ini` from `platform=espressif32` to `platform=https://github.com/platformio/platform-espressif32.git#develop` to get a more recent version of the espidf 4.0 tools. + +However with a bit of patience and experimenting you'll figure the Kconfig out. Once Kconfig (or Kconfig.projbuild) is working then you will be able to choose the configurations according to your setup or the camera libraries will be compiled. Although you might also need to delete your .pio/build directory before the options appear .. again, the `pio run -t menuconfig` doens't always notice the new Kconfig files! + +If you miss-skip-ignore this critical step the camera module will compile but camera logic inside the library will be 'empty' because the Kconfig sets the proper #ifdef statements during the build process to initialize the selected cameras. It's very not optional! + + +## Examples + +### Initialization + +```c +#include "esp_camera.h" + +//WROVER-KIT PIN Map +#define CAM_PIN_PWDN -1 //power down is not used +#define CAM_PIN_RESET -1 //software reset will be performed +#define CAM_PIN_XCLK 21 +#define CAM_PIN_SIOD 26 +#define CAM_PIN_SIOC 27 + +#define CAM_PIN_D7 35 +#define CAM_PIN_D6 34 +#define CAM_PIN_D5 39 +#define CAM_PIN_D4 36 +#define CAM_PIN_D3 19 +#define CAM_PIN_D2 18 +#define CAM_PIN_D1 5 +#define CAM_PIN_D0 4 +#define CAM_PIN_VSYNC 25 +#define CAM_PIN_HREF 23 +#define CAM_PIN_PCLK 22 + +static camera_config_t camera_config = { + .pin_pwdn = CAM_PIN_PWDN, + .pin_reset = CAM_PIN_RESET, + .pin_xclk = CAM_PIN_XCLK, + .pin_sscb_sda = CAM_PIN_SIOD, + .pin_sscb_scl = CAM_PIN_SIOC, + + .pin_d7 = CAM_PIN_D7, + .pin_d6 = CAM_PIN_D6, + .pin_d5 = CAM_PIN_D5, + .pin_d4 = CAM_PIN_D4, + .pin_d3 = CAM_PIN_D3, + .pin_d2 = CAM_PIN_D2, + .pin_d1 = CAM_PIN_D1, + .pin_d0 = CAM_PIN_D0, + .pin_vsync = CAM_PIN_VSYNC, + .pin_href = CAM_PIN_HREF, + .pin_pclk = CAM_PIN_PCLK, + + .xclk_freq_hz = 20000000,//EXPERIMENTAL: Set to 16MHz on ESP32-S2 or ESP32-S3 to enable EDMA mode + .ledc_timer = LEDC_TIMER_0, + .ledc_channel = LEDC_CHANNEL_0, + + .pixel_format = PIXFORMAT_JPEG,//YUV422,GRAYSCALE,RGB565,JPEG + .frame_size = FRAMESIZE_UXGA,//QQVGA-QXGA Do not use sizes above QVGA when not JPEG + + .jpeg_quality = 12, //0-63 lower number means higher quality + .fb_count = 1, //if more than one, i2s runs in continuous mode. Use only with JPEG + .grab_mode = CAMERA_GRAB_WHEN_EMPTY//CAMERA_GRAB_LATEST. Sets when buffers should be filled +}; + +esp_err_t camera_init(){ + //power up the camera if PWDN pin is defined + if(CAM_PIN_PWDN != -1){ + pinMode(CAM_PIN_PWDN, OUTPUT); + digitalWrite(CAM_PIN_PWDN, LOW); + } + + //initialize the camera + esp_err_t err = esp_camera_init(&camera_config); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Camera Init Failed"); + return err; + } + + return ESP_OK; +} + +esp_err_t camera_capture(){ + //acquire a frame + camera_fb_t * fb = esp_camera_fb_get(); + if (!fb) { + ESP_LOGE(TAG, "Camera Capture Failed"); + return ESP_FAIL; + } + //replace this with your own function + process_image(fb->width, fb->height, fb->format, fb->buf, fb->len); + + //return the frame buffer back to the driver for reuse + esp_camera_fb_return(fb); + return ESP_OK; +} +``` + +### JPEG HTTP Capture + +```c +#include "esp_camera.h" +#include "esp_http_server.h" +#include "esp_timer.h" + +typedef struct { + httpd_req_t *req; + size_t len; +} jpg_chunking_t; + +static size_t jpg_encode_stream(void * arg, size_t index, const void* data, size_t len){ + jpg_chunking_t *j = (jpg_chunking_t *)arg; + if(!index){ + j->len = 0; + } + if(httpd_resp_send_chunk(j->req, (const char *)data, len) != ESP_OK){ + return 0; + } + j->len += len; + return len; +} + +esp_err_t jpg_httpd_handler(httpd_req_t *req){ + camera_fb_t * fb = NULL; + esp_err_t res = ESP_OK; + size_t fb_len = 0; + int64_t fr_start = esp_timer_get_time(); + + fb = esp_camera_fb_get(); + if (!fb) { + ESP_LOGE(TAG, "Camera capture failed"); + httpd_resp_send_500(req); + return ESP_FAIL; + } + res = httpd_resp_set_type(req, "image/jpeg"); + if(res == ESP_OK){ + res = httpd_resp_set_hdr(req, "Content-Disposition", "inline; filename=capture.jpg"); + } + + if(res == ESP_OK){ + if(fb->format == PIXFORMAT_JPEG){ + fb_len = fb->len; + res = httpd_resp_send(req, (const char *)fb->buf, fb->len); + } else { + jpg_chunking_t jchunk = {req, 0}; + res = frame2jpg_cb(fb, 80, jpg_encode_stream, &jchunk)?ESP_OK:ESP_FAIL; + httpd_resp_send_chunk(req, NULL, 0); + fb_len = jchunk.len; + } + } + esp_camera_fb_return(fb); + int64_t fr_end = esp_timer_get_time(); + ESP_LOGI(TAG, "JPG: %uKB %ums", (uint32_t)(fb_len/1024), (uint32_t)((fr_end - fr_start)/1000)); + return res; +} +``` + +### JPEG HTTP Stream + +```c +#include "esp_camera.h" +#include "esp_http_server.h" +#include "esp_timer.h" + +#define PART_BOUNDARY "123456789000000000000987654321" +static const char* _STREAM_CONTENT_TYPE = "multipart/x-mixed-replace;boundary=" PART_BOUNDARY; +static const char* _STREAM_BOUNDARY = "\r\n--" PART_BOUNDARY "\r\n"; +static const char* _STREAM_PART = "Content-Type: image/jpeg\r\nContent-Length: %u\r\n\r\n"; + +esp_err_t jpg_stream_httpd_handler(httpd_req_t *req){ + camera_fb_t * fb = NULL; + esp_err_t res = ESP_OK; + size_t _jpg_buf_len; + uint8_t * _jpg_buf; + char * part_buf[64]; + static int64_t last_frame = 0; + if(!last_frame) { + last_frame = esp_timer_get_time(); + } + + res = httpd_resp_set_type(req, _STREAM_CONTENT_TYPE); + if(res != ESP_OK){ + return res; + } + + while(true){ + fb = esp_camera_fb_get(); + if (!fb) { + ESP_LOGE(TAG, "Camera capture failed"); + res = ESP_FAIL; + break; + } + if(fb->format != PIXFORMAT_JPEG){ + bool jpeg_converted = frame2jpg(fb, 80, &_jpg_buf, &_jpg_buf_len); + if(!jpeg_converted){ + ESP_LOGE(TAG, "JPEG compression failed"); + esp_camera_fb_return(fb); + res = ESP_FAIL; + } + } else { + _jpg_buf_len = fb->len; + _jpg_buf = fb->buf; + } + + if(res == ESP_OK){ + res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY)); + } + if(res == ESP_OK){ + size_t hlen = snprintf((char *)part_buf, 64, _STREAM_PART, _jpg_buf_len); + + res = httpd_resp_send_chunk(req, (const char *)part_buf, hlen); + } + if(res == ESP_OK){ + res = httpd_resp_send_chunk(req, (const char *)_jpg_buf, _jpg_buf_len); + } + if(fb->format != PIXFORMAT_JPEG){ + free(_jpg_buf); + } + esp_camera_fb_return(fb); + if(res != ESP_OK){ + break; + } + int64_t fr_end = esp_timer_get_time(); + int64_t frame_time = fr_end - last_frame; + last_frame = fr_end; + frame_time /= 1000; + ESP_LOGI(TAG, "MJPG: %uKB %ums (%.1ffps)", + (uint32_t)(_jpg_buf_len/1024), + (uint32_t)frame_time, 1000.0 / (uint32_t)frame_time); + } + + last_frame = 0; + return res; +} +``` + +### BMP HTTP Capture + +```c +#include "esp_camera.h" +#include "esp_http_server.h" +#include "esp_timer.h" + +esp_err_t bmp_httpd_handler(httpd_req_t *req){ + camera_fb_t * fb = NULL; + esp_err_t res = ESP_OK; + int64_t fr_start = esp_timer_get_time(); + + fb = esp_camera_fb_get(); + if (!fb) { + ESP_LOGE(TAG, "Camera capture failed"); + httpd_resp_send_500(req); + return ESP_FAIL; + } + + uint8_t * buf = NULL; + size_t buf_len = 0; + bool converted = frame2bmp(fb, &buf, &buf_len); + esp_camera_fb_return(fb); + if(!converted){ + ESP_LOGE(TAG, "BMP conversion failed"); + httpd_resp_send_500(req); + return ESP_FAIL; + } + + res = httpd_resp_set_type(req, "image/x-windows-bmp") + || httpd_resp_set_hdr(req, "Content-Disposition", "inline; filename=capture.bmp") + || httpd_resp_send(req, (const char *)buf, buf_len); + free(buf); + int64_t fr_end = esp_timer_get_time(); + ESP_LOGI(TAG, "BMP: %uKB %ums", (uint32_t)(buf_len/1024), (uint32_t)((fr_end - fr_start)/1000)); + return res; +} +``` + + + diff --git a/lib/libesp32_div/esp32-camera/component.mk b/lib/libesp32_div/esp32-camera/component.mk new file mode 100644 index 000000000..8db15eb88 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/component.mk @@ -0,0 +1,4 @@ +COMPONENT_ADD_INCLUDEDIRS := driver/include conversions/include +COMPONENT_PRIV_INCLUDEDIRS := driver/private_include conversions/private_include sensors/private_include target/private_include +COMPONENT_SRCDIRS := driver conversions sensors target target/esp32 +CXXFLAGS += -fno-rtti diff --git a/lib/libesp32_div/esp32-camera/conversions/esp_jpg_decode.c b/lib/libesp32_div/esp32-camera/conversions/esp_jpg_decode.c new file mode 100644 index 000000000..a9615e36c --- /dev/null +++ b/lib/libesp32_div/esp32-camera/conversions/esp_jpg_decode.c @@ -0,0 +1,132 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#include "esp_jpg_decode.h" + +#include "esp_system.h" +#if ESP_IDF_VERSION_MAJOR >= 4 // IDF 4+ +#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 +#include "esp32/rom/tjpgd.h" +#elif CONFIG_IDF_TARGET_ESP32S2 +#include "tjpgd.h" +#elif CONFIG_IDF_TARGET_ESP32S3 +#include "esp32s3/rom/tjpgd.h" +#else +#error Target CONFIG_IDF_TARGET is not supported +#endif +#else // ESP32 Before IDF 4.0 +#include "rom/tjpgd.h" +#endif + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#define TAG "" +#else +#include "esp_log.h" +static const char* TAG = "esp_jpg_decode"; +#endif + +typedef struct { + jpg_scale_t scale; + jpg_reader_cb reader; + jpg_writer_cb writer; + void * arg; + size_t len; + size_t index; +} esp_jpg_decoder_t; + +static const char * jd_errors[] = { + "Succeeded", + "Interrupted by output function", + "Device error or wrong termination of input stream", + "Insufficient memory pool for the image", + "Insufficient stream input buffer", + "Parameter error", + "Data format error", + "Right format but not supported", + "Not supported JPEG standard" +}; + +static uint32_t _jpg_write(JDEC *decoder, void *bitmap, JRECT *rect) +{ + uint16_t x = rect->left; + uint16_t y = rect->top; + uint16_t w = rect->right + 1 - x; + uint16_t h = rect->bottom + 1 - y; + uint8_t *data = (uint8_t *)bitmap; + + esp_jpg_decoder_t * jpeg = (esp_jpg_decoder_t *)decoder->device; + + if (jpeg->writer) { + return jpeg->writer(jpeg->arg, x, y, w, h, data); + } + return 0; +} + +static uint32_t _jpg_read(JDEC *decoder, uint8_t *buf, uint32_t len) +{ + esp_jpg_decoder_t * jpeg = (esp_jpg_decoder_t *)decoder->device; + if (jpeg->len && len > (jpeg->len - jpeg->index)) { + len = jpeg->len - jpeg->index; + } + if (len) { + len = jpeg->reader(jpeg->arg, jpeg->index, buf, len); + if (!len) { + ESP_LOGE(TAG, "Read Fail at %u/%u", jpeg->index, jpeg->len); + } + jpeg->index += len; + } + return len; +} + +esp_err_t esp_jpg_decode(size_t len, jpg_scale_t scale, jpg_reader_cb reader, jpg_writer_cb writer, void * arg) +{ + static uint8_t work[3100]; + JDEC decoder; + esp_jpg_decoder_t jpeg; + + jpeg.len = len; + jpeg.reader = reader; + jpeg.writer = writer; + jpeg.arg = arg; + jpeg.scale = scale; + jpeg.index = 0; + + JRESULT jres = jd_prepare(&decoder, _jpg_read, work, 3100, &jpeg); + if(jres != JDR_OK){ + ESP_LOGE(TAG, "JPG Header Parse Failed! %s", jd_errors[jres]); + return ESP_FAIL; + } + + uint16_t output_width = decoder.width / (1 << (uint8_t)(jpeg.scale)); + uint16_t output_height = decoder.height / (1 << (uint8_t)(jpeg.scale)); + + //output start + writer(arg, 0, 0, output_width, output_height, NULL); + //output write + jres = jd_decomp(&decoder, _jpg_write, (uint8_t)jpeg.scale); + //output end + writer(arg, output_width, output_height, output_width, output_height, NULL); + + if (jres != JDR_OK) { + ESP_LOGE(TAG, "JPG Decompression Failed! %s", jd_errors[jres]); + return ESP_FAIL; + } + //check if all data has been consumed. + if (len && jpeg.index < len) { + _jpg_read(&decoder, NULL, len - jpeg.index); + } + + return ESP_OK; +} + diff --git a/lib/libesp32_div/esp32-camera/conversions/include/esp_jpg_decode.h b/lib/libesp32_div/esp32-camera/conversions/include/esp_jpg_decode.h new file mode 100644 index 000000000..f13536edf --- /dev/null +++ b/lib/libesp32_div/esp32-camera/conversions/include/esp_jpg_decode.h @@ -0,0 +1,43 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef _ESP_JPG_DECODE_H_ +#define _ESP_JPG_DECODE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include "esp_err.h" + +typedef enum { + JPG_SCALE_NONE, + JPG_SCALE_2X, + JPG_SCALE_4X, + JPG_SCALE_8X, + JPG_SCALE_MAX = JPG_SCALE_8X +} jpg_scale_t; + +typedef size_t (* jpg_reader_cb)(void * arg, size_t index, uint8_t *buf, size_t len); +typedef bool (* jpg_writer_cb)(void * arg, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t *data); + +esp_err_t esp_jpg_decode(size_t len, jpg_scale_t scale, jpg_reader_cb reader, jpg_writer_cb writer, void * arg); + +#ifdef __cplusplus +} +#endif + +#endif /* _ESP_JPG_DECODE_H_ */ diff --git a/lib/libesp32_div/esp32-camera/conversions/include/img_converters.h b/lib/libesp32_div/esp32-camera/conversions/include/img_converters.h new file mode 100644 index 000000000..f736200a9 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/conversions/include/img_converters.h @@ -0,0 +1,130 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef _IMG_CONVERTERS_H_ +#define _IMG_CONVERTERS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include "esp_camera.h" +#include "esp_jpg_decode.h" + +typedef size_t (* jpg_out_cb)(void * arg, size_t index, const void* data, size_t len); + +/** + * @brief Convert image buffer to JPEG + * + * @param src Source buffer in RGB565, RGB888, YUYV or GRAYSCALE format + * @param src_len Length in bytes of the source buffer + * @param width Width in pixels of the source image + * @param height Height in pixels of the source image + * @param format Format of the source image + * @param quality JPEG quality of the resulting image + * @param cp Callback to be called to write the bytes of the output JPEG + * @param arg Pointer to be passed to the callback + * + * @return true on success + */ +bool fmt2jpg_cb(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t quality, jpg_out_cb cb, void * arg); + +/** + * @brief Convert camera frame buffer to JPEG + * + * @param fb Source camera frame buffer + * @param quality JPEG quality of the resulting image + * @param cp Callback to be called to write the bytes of the output JPEG + * @param arg Pointer to be passed to the callback + * + * @return true on success + */ +bool frame2jpg_cb(camera_fb_t * fb, uint8_t quality, jpg_out_cb cb, void * arg); + +/** + * @brief Convert image buffer to JPEG buffer + * + * @param src Source buffer in RGB565, RGB888, YUYV or GRAYSCALE format + * @param src_len Length in bytes of the source buffer + * @param width Width in pixels of the source image + * @param height Height in pixels of the source image + * @param format Format of the source image + * @param quality JPEG quality of the resulting image + * @param out Pointer to be populated with the address of the resulting buffer. + * You MUST free the pointer once you are done with it. + * @param out_len Pointer to be populated with the length of the output buffer + * + * @return true on success + */ +bool fmt2jpg(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t quality, uint8_t ** out, size_t * out_len); + +/** + * @brief Convert camera frame buffer to JPEG buffer + * + * @param fb Source camera frame buffer + * @param quality JPEG quality of the resulting image + * @param out Pointer to be populated with the address of the resulting buffer + * @param out_len Pointer to be populated with the length of the output buffer + * + * @return true on success + */ +bool frame2jpg(camera_fb_t * fb, uint8_t quality, uint8_t ** out, size_t * out_len); + +/** + * @brief Convert image buffer to BMP buffer + * + * @param src Source buffer in JPEG, RGB565, RGB888, YUYV or GRAYSCALE format + * @param src_len Length in bytes of the source buffer + * @param width Width in pixels of the source image + * @param height Height in pixels of the source image + * @param format Format of the source image + * @param out Pointer to be populated with the address of the resulting buffer + * @param out_len Pointer to be populated with the length of the output buffer + * + * @return true on success + */ +bool fmt2bmp(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t ** out, size_t * out_len); + +/** + * @brief Convert camera frame buffer to BMP buffer + * + * @param fb Source camera frame buffer + * @param out Pointer to be populated with the address of the resulting buffer + * @param out_len Pointer to be populated with the length of the output buffer + * + * @return true on success + */ +bool frame2bmp(camera_fb_t * fb, uint8_t ** out, size_t * out_len); + +/** + * @brief Convert image buffer to RGB888 buffer (used for face detection) + * + * @param src Source buffer in JPEG, RGB565, RGB888, YUYV or GRAYSCALE format + * @param src_len Length in bytes of the source buffer + * @param format Format of the source image + * @param rgb_buf Pointer to the output buffer (width * height * 3) + * + * @return true on success + */ +bool fmt2rgb888(const uint8_t *src_buf, size_t src_len, pixformat_t format, uint8_t * rgb_buf); + +bool jpg2rgb565(const uint8_t *src, size_t src_len, uint8_t * out, jpg_scale_t scale); + +#ifdef __cplusplus +} +#endif + +#endif /* _IMG_CONVERTERS_H_ */ diff --git a/lib/libesp32_div/esp32-camera/conversions/jpge.cpp b/lib/libesp32_div/esp32-camera/conversions/jpge.cpp new file mode 100644 index 000000000..a8ab93e02 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/conversions/jpge.cpp @@ -0,0 +1,723 @@ +// jpge.cpp - C++ class for JPEG compression. +// Public domain, Rich Geldreich +// v1.01, Dec. 18, 2010 - Initial release +// v1.02, Apr. 6, 2011 - Removed 2x2 ordered dither in H2V1 chroma subsampling method load_block_16_8_8(). (The rounding factor was 2, when it should have been 1. Either way, it wasn't helping.) +// v1.03, Apr. 16, 2011 - Added support for optimized Huffman code tables, optimized dynamic memory allocation down to only 1 alloc. +// Also from Alex Evans: Added RGBA support, linear memory allocator (no longer needed in v1.03). +// v1.04, May. 19, 2012: Forgot to set m_pFile ptr to NULL in cfile_stream::close(). Thanks to Owen Kaluza for reporting this bug. +// Code tweaks to fix VS2008 static code analysis warnings (all looked harmless). +// Code review revealed method load_block_16_8_8() (used for the non-default H2V1 sampling mode to downsample chroma) somehow didn't get the rounding factor fix from v1.02. + +#include "jpge.h" + +#include +#include +#include +#include +#include +#include +#include +#include "esp_heap_caps.h" + +#define JPGE_MAX(a,b) (((a)>(b))?(a):(b)) +#define JPGE_MIN(a,b) (((a)<(b))?(a):(b)) + +namespace jpge { + + static inline void *jpge_malloc(size_t nSize) { + void * b = malloc(nSize); + if(b){ + return b; + } + return heap_caps_malloc(nSize, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); + } + static inline void jpge_free(void *p) { free(p); } + + // Various JPEG enums and tables. + enum { M_SOF0 = 0xC0, M_DHT = 0xC4, M_SOI = 0xD8, M_EOI = 0xD9, M_SOS = 0xDA, M_DQT = 0xDB, M_APP0 = 0xE0 }; + enum { DC_LUM_CODES = 12, AC_LUM_CODES = 256, DC_CHROMA_CODES = 12, AC_CHROMA_CODES = 256, MAX_HUFF_SYMBOLS = 257, MAX_HUFF_CODESIZE = 32 }; + + static const uint8 s_zag[64] = { 0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63 }; + static const int16 s_std_lum_quant[64] = { 16,11,12,14,12,10,16,14,13,14,18,17,16,19,24,40,26,24,22,22,24,49,35,37,29,40,58,51,61,60,57,51,56,55,64,72,92,78,64,68,87,69,55,56,80,109,81,87,95,98,103,104,103,62,77,113,121,112,100,120,92,101,103,99 }; + static const int16 s_std_croma_quant[64] = { 17,18,18,24,21,24,47,26,26,47,99,66,56,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99 }; + static const uint8 s_dc_lum_bits[17] = { 0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0 }; + static const uint8 s_dc_lum_val[DC_LUM_CODES] = { 0,1,2,3,4,5,6,7,8,9,10,11 }; + static const uint8 s_ac_lum_bits[17] = { 0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,0x7d }; + static const uint8 s_ac_lum_val[AC_LUM_CODES] = { + 0x01,0x02,0x03,0x00,0x04,0x11,0x05,0x12,0x21,0x31,0x41,0x06,0x13,0x51,0x61,0x07,0x22,0x71,0x14,0x32,0x81,0x91,0xa1,0x08,0x23,0x42,0xb1,0xc1,0x15,0x52,0xd1,0xf0, + 0x24,0x33,0x62,0x72,0x82,0x09,0x0a,0x16,0x17,0x18,0x19,0x1a,0x25,0x26,0x27,0x28,0x29,0x2a,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x43,0x44,0x45,0x46,0x47,0x48,0x49, + 0x4a,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x83,0x84,0x85,0x86,0x87,0x88,0x89, + 0x8a,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xc2,0xc3,0xc4,0xc5, + 0xc6,0xc7,0xc8,0xc9,0xca,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8, + 0xf9,0xfa + }; + static const uint8 s_dc_chroma_bits[17] = { 0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0 }; + static const uint8 s_dc_chroma_val[DC_CHROMA_CODES] = { 0,1,2,3,4,5,6,7,8,9,10,11 }; + static const uint8 s_ac_chroma_bits[17] = { 0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,0x77 }; + static const uint8 s_ac_chroma_val[AC_CHROMA_CODES] = { + 0x00,0x01,0x02,0x03,0x11,0x04,0x05,0x21,0x31,0x06,0x12,0x41,0x51,0x07,0x61,0x71,0x13,0x22,0x32,0x81,0x08,0x14,0x42,0x91,0xa1,0xb1,0xc1,0x09,0x23,0x33,0x52,0xf0, + 0x15,0x62,0x72,0xd1,0x0a,0x16,0x24,0x34,0xe1,0x25,0xf1,0x17,0x18,0x19,0x1a,0x26,0x27,0x28,0x29,0x2a,0x35,0x36,0x37,0x38,0x39,0x3a,0x43,0x44,0x45,0x46,0x47,0x48, + 0x49,0x4a,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x82,0x83,0x84,0x85,0x86,0x87, + 0x88,0x89,0x8a,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xc2,0xc3, + 0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8, + 0xf9,0xfa + }; + + const int YR = 19595, YG = 38470, YB = 7471, CB_R = -11059, CB_G = -21709, CB_B = 32768, CR_R = 32768, CR_G = -27439, CR_B = -5329; + + static int32 m_last_quality = 0; + static int32 m_quantization_tables[2][64]; + + static bool m_huff_initialized = false; + static uint m_huff_codes[4][256]; + static uint8 m_huff_code_sizes[4][256]; + static uint8 m_huff_bits[4][17]; + static uint8 m_huff_val[4][256]; + + static inline uint8 clamp(int i) { + if (i < 0) { + i = 0; + } else if (i > 255){ + i = 255; + } + return static_cast(i); + } + + static void RGB_to_YCC(uint8* pDst, const uint8 *pSrc, int num_pixels) { + for ( ; num_pixels; pDst += 3, pSrc += 3, num_pixels--) { + const int r = pSrc[0], g = pSrc[1], b = pSrc[2]; + pDst[0] = static_cast((r * YR + g * YG + b * YB + 32768) >> 16); + pDst[1] = clamp(128 + ((r * CB_R + g * CB_G + b * CB_B + 32768) >> 16)); + pDst[2] = clamp(128 + ((r * CR_R + g * CR_G + b * CR_B + 32768) >> 16)); + } + } + + static void RGB_to_Y(uint8* pDst, const uint8 *pSrc, int num_pixels) { + for ( ; num_pixels; pDst++, pSrc += 3, num_pixels--) { + pDst[0] = static_cast((pSrc[0] * YR + pSrc[1] * YG + pSrc[2] * YB + 32768) >> 16); + } + } + + static void Y_to_YCC(uint8* pDst, const uint8* pSrc, int num_pixels) { + for( ; num_pixels; pDst += 3, pSrc++, num_pixels--) { + pDst[0] = pSrc[0]; + pDst[1] = 128; + pDst[2] = 128; + } + } + + // Forward DCT - DCT derived from jfdctint. + enum { CONST_BITS = 13, ROW_BITS = 2 }; +#define DCT_DESCALE(x, n) (((x) + (((int32)1) << ((n) - 1))) >> (n)) +#define DCT_MUL(var, c) (static_cast(var) * static_cast(c)) +#define DCT1D(s0, s1, s2, s3, s4, s5, s6, s7) \ + int32 t0 = s0 + s7, t7 = s0 - s7, t1 = s1 + s6, t6 = s1 - s6, t2 = s2 + s5, t5 = s2 - s5, t3 = s3 + s4, t4 = s3 - s4; \ + int32 t10 = t0 + t3, t13 = t0 - t3, t11 = t1 + t2, t12 = t1 - t2; \ + int32 u1 = DCT_MUL(t12 + t13, 4433); \ + s2 = u1 + DCT_MUL(t13, 6270); \ + s6 = u1 + DCT_MUL(t12, -15137); \ + u1 = t4 + t7; \ + int32 u2 = t5 + t6, u3 = t4 + t6, u4 = t5 + t7; \ + int32 z5 = DCT_MUL(u3 + u4, 9633); \ + t4 = DCT_MUL(t4, 2446); t5 = DCT_MUL(t5, 16819); \ + t6 = DCT_MUL(t6, 25172); t7 = DCT_MUL(t7, 12299); \ + u1 = DCT_MUL(u1, -7373); u2 = DCT_MUL(u2, -20995); \ + u3 = DCT_MUL(u3, -16069); u4 = DCT_MUL(u4, -3196); \ + u3 += z5; u4 += z5; \ + s0 = t10 + t11; s1 = t7 + u1 + u4; s3 = t6 + u2 + u3; s4 = t10 - t11; s5 = t5 + u2 + u4; s7 = t4 + u1 + u3; + + static void DCT2D(int32 *p) { + int32 c, *q = p; + for (c = 7; c >= 0; c--, q += 8) { + int32 s0 = q[0], s1 = q[1], s2 = q[2], s3 = q[3], s4 = q[4], s5 = q[5], s6 = q[6], s7 = q[7]; + DCT1D(s0, s1, s2, s3, s4, s5, s6, s7); + q[0] = s0 << ROW_BITS; q[1] = DCT_DESCALE(s1, CONST_BITS-ROW_BITS); q[2] = DCT_DESCALE(s2, CONST_BITS-ROW_BITS); q[3] = DCT_DESCALE(s3, CONST_BITS-ROW_BITS); + q[4] = s4 << ROW_BITS; q[5] = DCT_DESCALE(s5, CONST_BITS-ROW_BITS); q[6] = DCT_DESCALE(s6, CONST_BITS-ROW_BITS); q[7] = DCT_DESCALE(s7, CONST_BITS-ROW_BITS); + } + for (q = p, c = 7; c >= 0; c--, q++) { + int32 s0 = q[0*8], s1 = q[1*8], s2 = q[2*8], s3 = q[3*8], s4 = q[4*8], s5 = q[5*8], s6 = q[6*8], s7 = q[7*8]; + DCT1D(s0, s1, s2, s3, s4, s5, s6, s7); + q[0*8] = DCT_DESCALE(s0, ROW_BITS+3); q[1*8] = DCT_DESCALE(s1, CONST_BITS+ROW_BITS+3); q[2*8] = DCT_DESCALE(s2, CONST_BITS+ROW_BITS+3); q[3*8] = DCT_DESCALE(s3, CONST_BITS+ROW_BITS+3); + q[4*8] = DCT_DESCALE(s4, ROW_BITS+3); q[5*8] = DCT_DESCALE(s5, CONST_BITS+ROW_BITS+3); q[6*8] = DCT_DESCALE(s6, CONST_BITS+ROW_BITS+3); q[7*8] = DCT_DESCALE(s7, CONST_BITS+ROW_BITS+3); + } + } + + // Compute the actual canonical Huffman codes/code sizes given the JPEG huff bits and val arrays. + static void compute_huffman_table(uint *codes, uint8 *code_sizes, uint8 *bits, uint8 *val) + { + int i, l, last_p, si; + static uint8 huff_size[257]; + static uint huff_code[257]; + uint code; + + int p = 0; + for (l = 1; l <= 16; l++) { + for (i = 1; i <= bits[l]; i++) { + huff_size[p++] = (char)l; + } + } + + huff_size[p] = 0; + last_p = p; // write sentinel + + code = 0; si = huff_size[0]; p = 0; + + while (huff_size[p]) { + while (huff_size[p] == si) { + huff_code[p++] = code++; + } + code <<= 1; + si++; + } + + memset(codes, 0, sizeof(codes[0])*256); + memset(code_sizes, 0, sizeof(code_sizes[0])*256); + for (p = 0; p < last_p; p++) { + codes[val[p]] = huff_code[p]; + code_sizes[val[p]] = huff_size[p]; + } + } + + void jpeg_encoder::flush_output_buffer() + { + if (m_out_buf_left != JPGE_OUT_BUF_SIZE) { + m_all_stream_writes_succeeded = m_all_stream_writes_succeeded && m_pStream->put_buf(m_out_buf, JPGE_OUT_BUF_SIZE - m_out_buf_left); + } + m_pOut_buf = m_out_buf; + m_out_buf_left = JPGE_OUT_BUF_SIZE; + } + + void jpeg_encoder::emit_byte(uint8 i) + { + *m_pOut_buf++ = i; + if (--m_out_buf_left == 0) { + flush_output_buffer(); + } + } + + void jpeg_encoder::put_bits(uint bits, uint len) + { + uint8 c = 0; + m_bit_buffer |= ((uint32)bits << (24 - (m_bits_in += len))); + while (m_bits_in >= 8) { + c = (uint8)((m_bit_buffer >> 16) & 0xFF); + emit_byte(c); + if (c == 0xFF) { + emit_byte(0); + } + m_bit_buffer <<= 8; + m_bits_in -= 8; + } + } + + void jpeg_encoder::emit_word(uint i) + { + emit_byte(uint8(i >> 8)); emit_byte(uint8(i & 0xFF)); + } + + // JPEG marker generation. + void jpeg_encoder::emit_marker(int marker) + { + emit_byte(uint8(0xFF)); emit_byte(uint8(marker)); + } + + // Emit JFIF marker + void jpeg_encoder::emit_jfif_app0() + { + emit_marker(M_APP0); + emit_word(2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); + emit_byte(0x4A); emit_byte(0x46); emit_byte(0x49); emit_byte(0x46); /* Identifier: ASCII "JFIF" */ + emit_byte(0); + emit_byte(1); /* Major version */ + emit_byte(1); /* Minor version */ + emit_byte(0); /* Density unit */ + emit_word(1); + emit_word(1); + emit_byte(0); /* No thumbnail image */ + emit_byte(0); + } + + // Emit quantization tables + void jpeg_encoder::emit_dqt() + { + for (int i = 0; i < ((m_num_components == 3) ? 2 : 1); i++) + { + emit_marker(M_DQT); + emit_word(64 + 1 + 2); + emit_byte(static_cast(i)); + for (int j = 0; j < 64; j++) + emit_byte(static_cast(m_quantization_tables[i][j])); + } + } + + // Emit start of frame marker + void jpeg_encoder::emit_sof() + { + emit_marker(M_SOF0); /* baseline */ + emit_word(3 * m_num_components + 2 + 5 + 1); + emit_byte(8); /* precision */ + emit_word(m_image_y); + emit_word(m_image_x); + emit_byte(m_num_components); + for (int i = 0; i < m_num_components; i++) + { + emit_byte(static_cast(i + 1)); /* component ID */ + emit_byte((m_comp_h_samp[i] << 4) + m_comp_v_samp[i]); /* h and v sampling */ + emit_byte(i > 0); /* quant. table num */ + } + } + + // Emit Huffman table. + void jpeg_encoder::emit_dht(uint8 *bits, uint8 *val, int index, bool ac_flag) + { + emit_marker(M_DHT); + + int length = 0; + for (int i = 1; i <= 16; i++) + length += bits[i]; + + emit_word(length + 2 + 1 + 16); + emit_byte(static_cast(index + (ac_flag << 4))); + + for (int i = 1; i <= 16; i++) + emit_byte(bits[i]); + + for (int i = 0; i < length; i++) + emit_byte(val[i]); + } + + // Emit all Huffman tables. + void jpeg_encoder::emit_dhts() + { + emit_dht(m_huff_bits[0+0], m_huff_val[0+0], 0, false); + emit_dht(m_huff_bits[2+0], m_huff_val[2+0], 0, true); + if (m_num_components == 3) { + emit_dht(m_huff_bits[0+1], m_huff_val[0+1], 1, false); + emit_dht(m_huff_bits[2+1], m_huff_val[2+1], 1, true); + } + } + + // emit start of scan + void jpeg_encoder::emit_sos() + { + emit_marker(M_SOS); + emit_word(2 * m_num_components + 2 + 1 + 3); + emit_byte(m_num_components); + for (int i = 0; i < m_num_components; i++) + { + emit_byte(static_cast(i + 1)); + if (i == 0) + emit_byte((0 << 4) + 0); + else + emit_byte((1 << 4) + 1); + } + emit_byte(0); /* spectral selection */ + emit_byte(63); + emit_byte(0); + } + + void jpeg_encoder::load_block_8_8_grey(int x) + { + uint8 *pSrc; + sample_array_t *pDst = m_sample_array; + x <<= 3; + for (int i = 0; i < 8; i++, pDst += 8) + { + pSrc = m_mcu_lines[i] + x; + pDst[0] = pSrc[0] - 128; pDst[1] = pSrc[1] - 128; pDst[2] = pSrc[2] - 128; pDst[3] = pSrc[3] - 128; + pDst[4] = pSrc[4] - 128; pDst[5] = pSrc[5] - 128; pDst[6] = pSrc[6] - 128; pDst[7] = pSrc[7] - 128; + } + } + + void jpeg_encoder::load_block_8_8(int x, int y, int c) + { + uint8 *pSrc; + sample_array_t *pDst = m_sample_array; + x = (x * (8 * 3)) + c; + y <<= 3; + for (int i = 0; i < 8; i++, pDst += 8) + { + pSrc = m_mcu_lines[y + i] + x; + pDst[0] = pSrc[0 * 3] - 128; pDst[1] = pSrc[1 * 3] - 128; pDst[2] = pSrc[2 * 3] - 128; pDst[3] = pSrc[3 * 3] - 128; + pDst[4] = pSrc[4 * 3] - 128; pDst[5] = pSrc[5 * 3] - 128; pDst[6] = pSrc[6 * 3] - 128; pDst[7] = pSrc[7 * 3] - 128; + } + } + + void jpeg_encoder::load_block_16_8(int x, int c) + { + uint8 *pSrc1, *pSrc2; + sample_array_t *pDst = m_sample_array; + x = (x * (16 * 3)) + c; + int a = 0, b = 2; + for (int i = 0; i < 16; i += 2, pDst += 8) + { + pSrc1 = m_mcu_lines[i + 0] + x; + pSrc2 = m_mcu_lines[i + 1] + x; + pDst[0] = ((pSrc1[ 0 * 3] + pSrc1[ 1 * 3] + pSrc2[ 0 * 3] + pSrc2[ 1 * 3] + a) >> 2) - 128; pDst[1] = ((pSrc1[ 2 * 3] + pSrc1[ 3 * 3] + pSrc2[ 2 * 3] + pSrc2[ 3 * 3] + b) >> 2) - 128; + pDst[2] = ((pSrc1[ 4 * 3] + pSrc1[ 5 * 3] + pSrc2[ 4 * 3] + pSrc2[ 5 * 3] + a) >> 2) - 128; pDst[3] = ((pSrc1[ 6 * 3] + pSrc1[ 7 * 3] + pSrc2[ 6 * 3] + pSrc2[ 7 * 3] + b) >> 2) - 128; + pDst[4] = ((pSrc1[ 8 * 3] + pSrc1[ 9 * 3] + pSrc2[ 8 * 3] + pSrc2[ 9 * 3] + a) >> 2) - 128; pDst[5] = ((pSrc1[10 * 3] + pSrc1[11 * 3] + pSrc2[10 * 3] + pSrc2[11 * 3] + b) >> 2) - 128; + pDst[6] = ((pSrc1[12 * 3] + pSrc1[13 * 3] + pSrc2[12 * 3] + pSrc2[13 * 3] + a) >> 2) - 128; pDst[7] = ((pSrc1[14 * 3] + pSrc1[15 * 3] + pSrc2[14 * 3] + pSrc2[15 * 3] + b) >> 2) - 128; + int temp = a; a = b; b = temp; + } + } + + void jpeg_encoder::load_block_16_8_8(int x, int c) + { + uint8 *pSrc1; + sample_array_t *pDst = m_sample_array; + x = (x * (16 * 3)) + c; + for (int i = 0; i < 8; i++, pDst += 8) + { + pSrc1 = m_mcu_lines[i + 0] + x; + pDst[0] = ((pSrc1[ 0 * 3] + pSrc1[ 1 * 3]) >> 1) - 128; pDst[1] = ((pSrc1[ 2 * 3] + pSrc1[ 3 * 3]) >> 1) - 128; + pDst[2] = ((pSrc1[ 4 * 3] + pSrc1[ 5 * 3]) >> 1) - 128; pDst[3] = ((pSrc1[ 6 * 3] + pSrc1[ 7 * 3]) >> 1) - 128; + pDst[4] = ((pSrc1[ 8 * 3] + pSrc1[ 9 * 3]) >> 1) - 128; pDst[5] = ((pSrc1[10 * 3] + pSrc1[11 * 3]) >> 1) - 128; + pDst[6] = ((pSrc1[12 * 3] + pSrc1[13 * 3]) >> 1) - 128; pDst[7] = ((pSrc1[14 * 3] + pSrc1[15 * 3]) >> 1) - 128; + } + } + + void jpeg_encoder::load_quantized_coefficients(int component_num) + { + int32 *q = m_quantization_tables[component_num > 0]; + int16 *pDst = m_coefficient_array; + for (int i = 0; i < 64; i++) + { + sample_array_t j = m_sample_array[s_zag[i]]; + if (j < 0) + { + if ((j = -j + (*q >> 1)) < *q) + *pDst++ = 0; + else + *pDst++ = static_cast(-(j / *q)); + } + else + { + if ((j = j + (*q >> 1)) < *q) + *pDst++ = 0; + else + *pDst++ = static_cast((j / *q)); + } + q++; + } + } + + void jpeg_encoder::code_coefficients_pass_two(int component_num) + { + int i, j, run_len, nbits, temp1, temp2; + int16 *pSrc = m_coefficient_array; + uint *codes[2]; + uint8 *code_sizes[2]; + + if (component_num == 0) + { + codes[0] = m_huff_codes[0 + 0]; codes[1] = m_huff_codes[2 + 0]; + code_sizes[0] = m_huff_code_sizes[0 + 0]; code_sizes[1] = m_huff_code_sizes[2 + 0]; + } + else + { + codes[0] = m_huff_codes[0 + 1]; codes[1] = m_huff_codes[2 + 1]; + code_sizes[0] = m_huff_code_sizes[0 + 1]; code_sizes[1] = m_huff_code_sizes[2 + 1]; + } + + temp1 = temp2 = pSrc[0] - m_last_dc_val[component_num]; + m_last_dc_val[component_num] = pSrc[0]; + + if (temp1 < 0) + { + temp1 = -temp1; temp2--; + } + + nbits = 0; + while (temp1) + { + nbits++; temp1 >>= 1; + } + + put_bits(codes[0][nbits], code_sizes[0][nbits]); + if (nbits) put_bits(temp2 & ((1 << nbits) - 1), nbits); + + for (run_len = 0, i = 1; i < 64; i++) + { + if ((temp1 = m_coefficient_array[i]) == 0) + run_len++; + else + { + while (run_len >= 16) + { + put_bits(codes[1][0xF0], code_sizes[1][0xF0]); + run_len -= 16; + } + if ((temp2 = temp1) < 0) + { + temp1 = -temp1; + temp2--; + } + nbits = 1; + while (temp1 >>= 1) + nbits++; + j = (run_len << 4) + nbits; + put_bits(codes[1][j], code_sizes[1][j]); + put_bits(temp2 & ((1 << nbits) - 1), nbits); + run_len = 0; + } + } + if (run_len) + put_bits(codes[1][0], code_sizes[1][0]); + } + + void jpeg_encoder::code_block(int component_num) + { + DCT2D(m_sample_array); + load_quantized_coefficients(component_num); + code_coefficients_pass_two(component_num); + } + + void jpeg_encoder::process_mcu_row() + { + if (m_num_components == 1) + { + for (int i = 0; i < m_mcus_per_row; i++) + { + load_block_8_8_grey(i); code_block(0); + } + } + else if ((m_comp_h_samp[0] == 1) && (m_comp_v_samp[0] == 1)) + { + for (int i = 0; i < m_mcus_per_row; i++) + { + load_block_8_8(i, 0, 0); code_block(0); load_block_8_8(i, 0, 1); code_block(1); load_block_8_8(i, 0, 2); code_block(2); + } + } + else if ((m_comp_h_samp[0] == 2) && (m_comp_v_samp[0] == 1)) + { + for (int i = 0; i < m_mcus_per_row; i++) + { + load_block_8_8(i * 2 + 0, 0, 0); code_block(0); load_block_8_8(i * 2 + 1, 0, 0); code_block(0); + load_block_16_8_8(i, 1); code_block(1); load_block_16_8_8(i, 2); code_block(2); + } + } + else if ((m_comp_h_samp[0] == 2) && (m_comp_v_samp[0] == 2)) + { + for (int i = 0; i < m_mcus_per_row; i++) + { + load_block_8_8(i * 2 + 0, 0, 0); code_block(0); load_block_8_8(i * 2 + 1, 0, 0); code_block(0); + load_block_8_8(i * 2 + 0, 1, 0); code_block(0); load_block_8_8(i * 2 + 1, 1, 0); code_block(0); + load_block_16_8(i, 1); code_block(1); load_block_16_8(i, 2); code_block(2); + } + } + } + + void jpeg_encoder::load_mcu(const void *pSrc) + { + const uint8* Psrc = reinterpret_cast(pSrc); + + uint8* pDst = m_mcu_lines[m_mcu_y_ofs]; // OK to write up to m_image_bpl_xlt bytes to pDst + + if (m_num_components == 1) { + if (m_image_bpp == 3) + RGB_to_Y(pDst, Psrc, m_image_x); + else + memcpy(pDst, Psrc, m_image_x); + } else { + if (m_image_bpp == 3) + RGB_to_YCC(pDst, Psrc, m_image_x); + else + Y_to_YCC(pDst, Psrc, m_image_x); + } + + // Possibly duplicate pixels at end of scanline if not a multiple of 8 or 16 + if (m_num_components == 1) + memset(m_mcu_lines[m_mcu_y_ofs] + m_image_bpl_xlt, pDst[m_image_bpl_xlt - 1], m_image_x_mcu - m_image_x); + else + { + const uint8 y = pDst[m_image_bpl_xlt - 3 + 0], cb = pDst[m_image_bpl_xlt - 3 + 1], cr = pDst[m_image_bpl_xlt - 3 + 2]; + uint8 *q = m_mcu_lines[m_mcu_y_ofs] + m_image_bpl_xlt; + for (int i = m_image_x; i < m_image_x_mcu; i++) + { + *q++ = y; *q++ = cb; *q++ = cr; + } + } + + if (++m_mcu_y_ofs == m_mcu_y) + { + process_mcu_row(); + m_mcu_y_ofs = 0; + } + } + + // Quantization table generation. + void jpeg_encoder::compute_quant_table(int32 *pDst, const int16 *pSrc) + { + int32 q; + if (m_params.m_quality < 50) + q = 5000 / m_params.m_quality; + else + q = 200 - m_params.m_quality * 2; + for (int i = 0; i < 64; i++) + { + int32 j = *pSrc++; j = (j * q + 50L) / 100L; + *pDst++ = JPGE_MIN(JPGE_MAX(j, 1), 255); + } + } + + // Higher-level methods. + bool jpeg_encoder::jpg_open(int p_x_res, int p_y_res, int src_channels) + { + m_num_components = 3; + switch (m_params.m_subsampling) + { + case Y_ONLY: + { + m_num_components = 1; + m_comp_h_samp[0] = 1; m_comp_v_samp[0] = 1; + m_mcu_x = 8; m_mcu_y = 8; + break; + } + case H1V1: + { + m_comp_h_samp[0] = 1; m_comp_v_samp[0] = 1; + m_comp_h_samp[1] = 1; m_comp_v_samp[1] = 1; + m_comp_h_samp[2] = 1; m_comp_v_samp[2] = 1; + m_mcu_x = 8; m_mcu_y = 8; + break; + } + case H2V1: + { + m_comp_h_samp[0] = 2; m_comp_v_samp[0] = 1; + m_comp_h_samp[1] = 1; m_comp_v_samp[1] = 1; + m_comp_h_samp[2] = 1; m_comp_v_samp[2] = 1; + m_mcu_x = 16; m_mcu_y = 8; + break; + } + case H2V2: + { + m_comp_h_samp[0] = 2; m_comp_v_samp[0] = 2; + m_comp_h_samp[1] = 1; m_comp_v_samp[1] = 1; + m_comp_h_samp[2] = 1; m_comp_v_samp[2] = 1; + m_mcu_x = 16; m_mcu_y = 16; + } + } + + m_image_x = p_x_res; m_image_y = p_y_res; + m_image_bpp = src_channels; + m_image_bpl = m_image_x * src_channels; + m_image_x_mcu = (m_image_x + m_mcu_x - 1) & (~(m_mcu_x - 1)); + m_image_y_mcu = (m_image_y + m_mcu_y - 1) & (~(m_mcu_y - 1)); + m_image_bpl_xlt = m_image_x * m_num_components; + m_image_bpl_mcu = m_image_x_mcu * m_num_components; + m_mcus_per_row = m_image_x_mcu / m_mcu_x; + + if ((m_mcu_lines[0] = static_cast(jpge_malloc(m_image_bpl_mcu * m_mcu_y))) == NULL) { + return false; + } + for (int i = 1; i < m_mcu_y; i++) + m_mcu_lines[i] = m_mcu_lines[i-1] + m_image_bpl_mcu; + + if(m_last_quality != m_params.m_quality){ + m_last_quality = m_params.m_quality; + compute_quant_table(m_quantization_tables[0], s_std_lum_quant); + compute_quant_table(m_quantization_tables[1], s_std_croma_quant); + } + + if(!m_huff_initialized){ + m_huff_initialized = true; + + memcpy(m_huff_bits[0+0], s_dc_lum_bits, 17); memcpy(m_huff_val[0+0], s_dc_lum_val, DC_LUM_CODES); + memcpy(m_huff_bits[2+0], s_ac_lum_bits, 17); memcpy(m_huff_val[2+0], s_ac_lum_val, AC_LUM_CODES); + memcpy(m_huff_bits[0+1], s_dc_chroma_bits, 17); memcpy(m_huff_val[0+1], s_dc_chroma_val, DC_CHROMA_CODES); + memcpy(m_huff_bits[2+1], s_ac_chroma_bits, 17); memcpy(m_huff_val[2+1], s_ac_chroma_val, AC_CHROMA_CODES); + + compute_huffman_table(&m_huff_codes[0+0][0], &m_huff_code_sizes[0+0][0], m_huff_bits[0+0], m_huff_val[0+0]); + compute_huffman_table(&m_huff_codes[2+0][0], &m_huff_code_sizes[2+0][0], m_huff_bits[2+0], m_huff_val[2+0]); + compute_huffman_table(&m_huff_codes[0+1][0], &m_huff_code_sizes[0+1][0], m_huff_bits[0+1], m_huff_val[0+1]); + compute_huffman_table(&m_huff_codes[2+1][0], &m_huff_code_sizes[2+1][0], m_huff_bits[2+1], m_huff_val[2+1]); + } + + m_out_buf_left = JPGE_OUT_BUF_SIZE; + m_pOut_buf = m_out_buf; + m_bit_buffer = 0; + m_bits_in = 0; + m_mcu_y_ofs = 0; + m_pass_num = 2; + memset(m_last_dc_val, 0, 3 * sizeof(m_last_dc_val[0])); + + // Emit all markers at beginning of image file. + emit_marker(M_SOI); + emit_jfif_app0(); + emit_dqt(); + emit_sof(); + emit_dhts(); + emit_sos(); + + return m_all_stream_writes_succeeded; + } + + bool jpeg_encoder::process_end_of_image() + { + if (m_mcu_y_ofs) { + if (m_mcu_y_ofs < 16) { // check here just to shut up static analysis + for (int i = m_mcu_y_ofs; i < m_mcu_y; i++) { + memcpy(m_mcu_lines[i], m_mcu_lines[m_mcu_y_ofs - 1], m_image_bpl_mcu); + } + } + process_mcu_row(); + } + + put_bits(0x7F, 7); + emit_marker(M_EOI); + flush_output_buffer(); + m_all_stream_writes_succeeded = m_all_stream_writes_succeeded && m_pStream->put_buf(NULL, 0); + m_pass_num++; // purposely bump up m_pass_num, for debugging + return true; + } + + void jpeg_encoder::clear() + { + m_mcu_lines[0] = NULL; + m_pass_num = 0; + m_all_stream_writes_succeeded = true; + } + + jpeg_encoder::jpeg_encoder() + { + clear(); + } + + jpeg_encoder::~jpeg_encoder() + { + deinit(); + } + + bool jpeg_encoder::init(output_stream *pStream, int width, int height, int src_channels, const params &comp_params) + { + deinit(); + if (((!pStream) || (width < 1) || (height < 1)) || ((src_channels != 1) && (src_channels != 3) && (src_channels != 4)) || (!comp_params.check())) return false; + m_pStream = pStream; + m_params = comp_params; + return jpg_open(width, height, src_channels); + } + + void jpeg_encoder::deinit() + { + jpge_free(m_mcu_lines[0]); + clear(); + } + + bool jpeg_encoder::process_scanline(const void* pScanline) + { + if ((m_pass_num < 1) || (m_pass_num > 2)) { + return false; + } + if (m_all_stream_writes_succeeded) { + if (!pScanline) { + if (!process_end_of_image()) { + return false; + } + } else { + load_mcu(pScanline); + } + } + return m_all_stream_writes_succeeded; + } + +} // namespace jpge diff --git a/lib/libesp32_div/esp32-camera/conversions/private_include/jpge.h b/lib/libesp32_div/esp32-camera/conversions/private_include/jpge.h new file mode 100644 index 000000000..aa295c8af --- /dev/null +++ b/lib/libesp32_div/esp32-camera/conversions/private_include/jpge.h @@ -0,0 +1,142 @@ +// jpge.h - C++ class for JPEG compression. +// Public domain, Rich Geldreich +// Alex Evans: Added RGBA support, linear memory allocator. +#ifndef JPEG_ENCODER_H +#define JPEG_ENCODER_H + +namespace jpge +{ + typedef unsigned char uint8; + typedef signed short int16; + typedef signed int int32; + typedef unsigned short uint16; + typedef unsigned int uint32; + typedef unsigned int uint; + + // JPEG chroma subsampling factors. Y_ONLY (grayscale images) and H2V2 (color images) are the most common. + enum subsampling_t { Y_ONLY = 0, H1V1 = 1, H2V1 = 2, H2V2 = 3 }; + + // JPEG compression parameters structure. + struct params { + inline params() : m_quality(85), m_subsampling(H2V2) { } + + inline bool check() const { + if ((m_quality < 1) || (m_quality > 100)) { + return false; + } + if ((uint)m_subsampling > (uint)H2V2) { + return false; + } + return true; + } + + // Quality: 1-100, higher is better. Typical values are around 50-95. + int m_quality; + + // m_subsampling: + // 0 = Y (grayscale) only + // 1 = H1V1 subsampling (YCbCr 1x1x1, 3 blocks per MCU) + // 2 = H2V1 subsampling (YCbCr 2x1x1, 4 blocks per MCU) + // 3 = H2V2 subsampling (YCbCr 4x1x1, 6 blocks per MCU-- very common) + subsampling_t m_subsampling; + }; + + // Output stream abstract class - used by the jpeg_encoder class to write to the output stream. + // put_buf() is generally called with len==JPGE_OUT_BUF_SIZE bytes, but for headers it'll be called with smaller amounts. + class output_stream { + public: + virtual ~output_stream() { }; + virtual bool put_buf(const void* Pbuf, int len) = 0; + virtual uint get_size() const = 0; + }; + + // Lower level jpeg_encoder class - useful if more control is needed than the above helper functions. + class jpeg_encoder { + public: + jpeg_encoder(); + ~jpeg_encoder(); + + // Initializes the compressor. + // pStream: The stream object to use for writing compressed data. + // params - Compression parameters structure, defined above. + // width, height - Image dimensions. + // channels - May be 1, or 3. 1 indicates grayscale, 3 indicates RGB source data. + // Returns false on out of memory or if a stream write fails. + bool init(output_stream *pStream, int width, int height, int src_channels, const params &comp_params = params()); + + // Call this method with each source scanline. + // width * src_channels bytes per scanline is expected (RGB or Y format). + // You must call with NULL after all scanlines are processed to finish compression. + // Returns false on out of memory or if a stream write fails. + bool process_scanline(const void* pScanline); + + // Deinitializes the compressor, freeing any allocated memory. May be called at any time. + void deinit(); + + private: + jpeg_encoder(const jpeg_encoder &); + jpeg_encoder &operator =(const jpeg_encoder &); + + typedef int32 sample_array_t; + enum { JPGE_OUT_BUF_SIZE = 512 }; + + output_stream *m_pStream; + params m_params; + uint8 m_num_components; + uint8 m_comp_h_samp[3], m_comp_v_samp[3]; + int m_image_x, m_image_y, m_image_bpp, m_image_bpl; + int m_image_x_mcu, m_image_y_mcu; + int m_image_bpl_xlt, m_image_bpl_mcu; + int m_mcus_per_row; + int m_mcu_x, m_mcu_y; + uint8 *m_mcu_lines[16]; + uint8 m_mcu_y_ofs; + sample_array_t m_sample_array[64]; + int16 m_coefficient_array[64]; + + int m_last_dc_val[3]; + uint8 m_out_buf[JPGE_OUT_BUF_SIZE]; + uint8 *m_pOut_buf; + uint m_out_buf_left; + uint32 m_bit_buffer; + uint m_bits_in; + uint8 m_pass_num; + bool m_all_stream_writes_succeeded; + + bool jpg_open(int p_x_res, int p_y_res, int src_channels); + + void flush_output_buffer(); + void put_bits(uint bits, uint len); + + void emit_byte(uint8 i); + void emit_word(uint i); + void emit_marker(int marker); + + void emit_jfif_app0(); + void emit_dqt(); + void emit_sof(); + void emit_dht(uint8 *bits, uint8 *val, int index, bool ac_flag); + void emit_dhts(); + void emit_sos(); + + void compute_quant_table(int32 *dst, const int16 *src); + void load_quantized_coefficients(int component_num); + + void load_block_8_8_grey(int x); + void load_block_8_8(int x, int y, int c); + void load_block_16_8(int x, int c); + void load_block_16_8_8(int x, int c); + + void code_coefficients_pass_two(int component_num); + void code_block(int component_num); + + void process_mcu_row(); + bool process_end_of_image(); + void load_mcu(const void* src); + void clear(); + void init(); + }; + +} // namespace jpge + +#endif // JPEG_ENCODER diff --git a/lib/libesp32_div/esp32-camera/conversions/private_include/yuv.h b/lib/libesp32_div/esp32-camera/conversions/private_include/yuv.h new file mode 100644 index 000000000..c5a0577ef --- /dev/null +++ b/lib/libesp32_div/esp32-camera/conversions/private_include/yuv.h @@ -0,0 +1,29 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef _CONVERSIONS_YUV_H_ +#define _CONVERSIONS_YUV_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +void yuv2rgb(uint8_t y, uint8_t u, uint8_t v, uint8_t *r, uint8_t *g, uint8_t *b); + +#ifdef __cplusplus +} +#endif + +#endif /* _CONVERSIONS_YUV_H_ */ diff --git a/lib/libesp32_div/esp32-camera/conversions/to_bmp.c b/lib/libesp32_div/esp32-camera/conversions/to_bmp.c new file mode 100644 index 000000000..5a54bdbae --- /dev/null +++ b/lib/libesp32_div/esp32-camera/conversions/to_bmp.c @@ -0,0 +1,393 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#include +#include +#include "img_converters.h" +#include "soc/efuse_reg.h" +#include "esp_heap_caps.h" +#include "yuv.h" +#include "sdkconfig.h" +#include "esp_jpg_decode.h" + +#include "esp_system.h" +#if ESP_IDF_VERSION_MAJOR >= 4 // IDF 4+ +#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 +#include "esp32/spiram.h" +#elif CONFIG_IDF_TARGET_ESP32S2 +#include "esp32s2/spiram.h" +#elif CONFIG_IDF_TARGET_ESP32S3 +#include "esp32s3/spiram.h" +#else +#error Target CONFIG_IDF_TARGET is not supported +#endif +#else // ESP32 Before IDF 4.0 +#include "esp_spiram.h" +#endif + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#define TAG "" +#else +#include "esp_log.h" +static const char* TAG = "to_bmp"; +#endif + +static const int BMP_HEADER_LEN = 54; + +typedef struct { + uint32_t filesize; + uint32_t reserved; + uint32_t fileoffset_to_pixelarray; + uint32_t dibheadersize; + int32_t width; + int32_t height; + uint16_t planes; + uint16_t bitsperpixel; + uint32_t compression; + uint32_t imagesize; + uint32_t ypixelpermeter; + uint32_t xpixelpermeter; + uint32_t numcolorspallette; + uint32_t mostimpcolor; +} bmp_header_t; + +typedef struct { + uint16_t width; + uint16_t height; + uint16_t data_offset; + const uint8_t *input; + uint8_t *output; +} rgb_jpg_decoder; + +static void *_malloc(size_t size) +{ + return heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); +} + +//output buffer and image width +static bool _rgb_write(void * arg, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t *data) +{ + rgb_jpg_decoder * jpeg = (rgb_jpg_decoder *)arg; + if(!data){ + if(x == 0 && y == 0){ + //write start + jpeg->width = w; + jpeg->height = h; + //if output is null, this is BMP + if(!jpeg->output){ + jpeg->output = (uint8_t *)_malloc((w*h*3)+jpeg->data_offset); + if(!jpeg->output){ + return false; + } + } + } else { + //write end + } + return true; + } + + size_t jw = jpeg->width*3; + size_t t = y * jw; + size_t b = t + (h * jw); + size_t l = x * 3; + uint8_t *out = jpeg->output+jpeg->data_offset; + uint8_t *o = out; + size_t iy, ix; + + w = w * 3; + + for(iy=t; iywidth = w; + jpeg->height = h; + //if output is null, this is BMP + if(!jpeg->output){ + jpeg->output = (uint8_t *)_malloc((w*h*3)+jpeg->data_offset); + if(!jpeg->output){ + return false; + } + } + } else { + //write end + } + return true; + } + + size_t jw = jpeg->width*3; + size_t jw2 = jpeg->width*2; + size_t t = y * jw; + size_t t2 = y * jw2; + size_t b = t + (h * jw); + size_t l = x * 2; + uint8_t *out = jpeg->output+jpeg->data_offset; + uint8_t *o = out; + size_t iy, iy2, ix, ix2; + + w = w * 3; + + for(iy=t, iy2=t2; iy> 3); + o[ix2+1] = c>>8; + o[ix2] = c&0xff; + } + data+=w; + } + return true; +} + +//input buffer +static uint32_t _jpg_read(void * arg, size_t index, uint8_t *buf, size_t len) +{ + rgb_jpg_decoder * jpeg = (rgb_jpg_decoder *)arg; + if(buf) { + memcpy(buf, jpeg->input + index, len); + } + return len; +} + +static bool jpg2rgb888(const uint8_t *src, size_t src_len, uint8_t * out, jpg_scale_t scale) +{ + rgb_jpg_decoder jpeg; + jpeg.width = 0; + jpeg.height = 0; + jpeg.input = src; + jpeg.output = out; + jpeg.data_offset = 0; + + if(esp_jpg_decode(src_len, scale, _jpg_read, _rgb_write, (void*)&jpeg) != ESP_OK){ + return false; + } + return true; +} + +bool jpg2rgb565(const uint8_t *src, size_t src_len, uint8_t * out, jpg_scale_t scale) +{ + rgb_jpg_decoder jpeg; + jpeg.width = 0; + jpeg.height = 0; + jpeg.input = src; + jpeg.output = out; + jpeg.data_offset = 0; + + if(esp_jpg_decode(src_len, scale, _jpg_read, _rgb565_write, (void*)&jpeg) != ESP_OK){ + return false; + } + return true; +} + +bool jpg2bmp(const uint8_t *src, size_t src_len, uint8_t ** out, size_t * out_len) +{ + + rgb_jpg_decoder jpeg; + jpeg.width = 0; + jpeg.height = 0; + jpeg.input = src; + jpeg.output = NULL; + jpeg.data_offset = BMP_HEADER_LEN; + + if(esp_jpg_decode(src_len, JPG_SCALE_NONE, _jpg_read, _rgb_write, (void*)&jpeg) != ESP_OK){ + return false; + } + + size_t output_size = jpeg.width*jpeg.height*3; + + jpeg.output[0] = 'B'; + jpeg.output[1] = 'M'; + bmp_header_t * bitmap = (bmp_header_t*)&jpeg.output[2]; + bitmap->reserved = 0; + bitmap->filesize = output_size+BMP_HEADER_LEN; + bitmap->fileoffset_to_pixelarray = BMP_HEADER_LEN; + bitmap->dibheadersize = 40; + bitmap->width = jpeg.width; + bitmap->height = -jpeg.height;//set negative for top to bottom + bitmap->planes = 1; + bitmap->bitsperpixel = 24; + bitmap->compression = 0; + bitmap->imagesize = output_size; + bitmap->ypixelpermeter = 0x0B13 ; //2835 , 72 DPI + bitmap->xpixelpermeter = 0x0B13 ; //2835 , 72 DPI + bitmap->numcolorspallette = 0; + bitmap->mostimpcolor = 0; + + *out = jpeg.output; + *out_len = output_size+BMP_HEADER_LEN; + + return true; +} + +bool fmt2rgb888(const uint8_t *src_buf, size_t src_len, pixformat_t format, uint8_t * rgb_buf) +{ + int pix_count = 0; + if(format == PIXFORMAT_JPEG) { + return jpg2rgb888(src_buf, src_len, rgb_buf, JPG_SCALE_NONE); + } else if(format == PIXFORMAT_RGB888) { + memcpy(rgb_buf, src_buf, src_len); + } else if(format == PIXFORMAT_RGB565) { + int i; + uint8_t hb, lb; + pix_count = src_len / 2; + for(i=0; i> 3; + *rgb_buf++ = hb & 0xF8; + } + } else if(format == PIXFORMAT_GRAYSCALE) { + int i; + uint8_t b; + pix_count = src_len; + for(i=0; ireserved = 0; + bitmap->filesize = out_size; + bitmap->fileoffset_to_pixelarray = BMP_HEADER_LEN; + bitmap->dibheadersize = 40; + bitmap->width = width; + bitmap->height = -height;//set negative for top to bottom + bitmap->planes = 1; + bitmap->bitsperpixel = 24; + bitmap->compression = 0; + bitmap->imagesize = pix_count * 3; + bitmap->ypixelpermeter = 0x0B13 ; //2835 , 72 DPI + bitmap->xpixelpermeter = 0x0B13 ; //2835 , 72 DPI + bitmap->numcolorspallette = 0; + bitmap->mostimpcolor = 0; + + uint8_t * rgb_buf = out_buf + BMP_HEADER_LEN; + uint8_t * src_buf = src; + + + //convert data to RGB888 + if(format == PIXFORMAT_RGB888) { + memcpy(rgb_buf, src_buf, pix_count*3); + } else if(format == PIXFORMAT_RGB565) { + int i; + uint8_t hb, lb; + for(i=0; i> 3; + *rgb_buf++ = hb & 0xF8; + } + } else if(format == PIXFORMAT_GRAYSCALE) { + int i; + uint8_t b; + for(i=0; ibuf, fb->len, fb->width, fb->height, fb->format, out, out_len); +} diff --git a/lib/libesp32_div/esp32-camera/conversions/to_jpg.cpp b/lib/libesp32_div/esp32-camera/conversions/to_jpg.cpp new file mode 100644 index 000000000..9b8905a73 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/conversions/to_jpg.cpp @@ -0,0 +1,245 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#include +#include +#include "esp_attr.h" +#include "soc/efuse_reg.h" +#include "esp_heap_caps.h" +#include "esp_camera.h" +#include "img_converters.h" +#include "jpge.h" +#include "yuv.h" + +#include "esp_system.h" +#if ESP_IDF_VERSION_MAJOR >= 4 // IDF 4+ +#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 +#include "esp32/spiram.h" +#elif CONFIG_IDF_TARGET_ESP32S2 +#include "esp32s2/spiram.h" +#elif CONFIG_IDF_TARGET_ESP32S3 +#include "esp32s3/spiram.h" +#else +#error Target CONFIG_IDF_TARGET is not supported +#endif +#else // ESP32 Before IDF 4.0 +#include "esp_spiram.h" +#endif + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#define TAG "" +#else +#include "esp_log.h" +static const char* TAG = "to_jpg"; +#endif + +static void *_malloc(size_t size) +{ + void * res = malloc(size); + if(res) { + return res; + } + return heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); +} + +static IRAM_ATTR void convert_line_format(uint8_t * src, pixformat_t format, uint8_t * dst, size_t width, size_t in_channels, size_t line) +{ + int i=0, o=0, l=0; + if(format == PIXFORMAT_GRAYSCALE) { + memcpy(dst, src + line * width, width); + } else if(format == PIXFORMAT_RGB888) { + l = width * 3; + src += l * line; + for(i=0; i> 3; + dst[o++] = (src[i+1] & 0x1F) << 3; + } + } else if(format == PIXFORMAT_YUV422) { + uint8_t y0, y1, u, v; + uint8_t r, g, b; + l = width * 2; + src += l * line; + for(i=0; i 100) { + quality = 100; + } + + jpge::params comp_params = jpge::params(); + comp_params.m_subsampling = subsampling; + comp_params.m_quality = quality; + + jpge::jpeg_encoder dst_image; + + if (!dst_image.init(dst_stream, width, height, num_channels, comp_params)) { + ESP_LOGE(TAG, "JPG encoder init failed"); + return false; + } + + uint8_t* line = (uint8_t*)_malloc(width * num_channels); + if(!line) { + ESP_LOGE(TAG, "Scan line malloc failed"); + return false; + } + + for (int i = 0; i < height; i++) { + convert_line_format(src, format, line, width, num_channels, i); + if (!dst_image.process_scanline(line)) { + ESP_LOGE(TAG, "JPG process line %u failed", i); + free(line); + return false; + } + } + free(line); + + if (!dst_image.process_scanline(NULL)) { + ESP_LOGE(TAG, "JPG image finish failed"); + return false; + } + dst_image.deinit(); + return true; +} + +class callback_stream : public jpge::output_stream { +protected: + jpg_out_cb ocb; + void * oarg; + size_t index; + +public: + callback_stream(jpg_out_cb cb, void * arg) : ocb(cb), oarg(arg), index(0) { } + virtual ~callback_stream() { } + virtual bool put_buf(const void* data, int len) + { + index += ocb(oarg, index, data, len); + return true; + } + virtual size_t get_size() const + { + return index; + } +}; + +bool fmt2jpg_cb(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t quality, jpg_out_cb cb, void * arg) +{ + callback_stream dst_stream(cb, arg); + return convert_image(src, width, height, format, quality, &dst_stream); +} + +bool frame2jpg_cb(camera_fb_t * fb, uint8_t quality, jpg_out_cb cb, void * arg) +{ + return fmt2jpg_cb(fb->buf, fb->len, fb->width, fb->height, fb->format, quality, cb, arg); +} + + + +class memory_stream : public jpge::output_stream { +protected: + uint8_t *out_buf; + size_t max_len, index; + +public: + memory_stream(void *pBuf, uint buf_size) : out_buf(static_cast(pBuf)), max_len(buf_size), index(0) { } + + virtual ~memory_stream() { } + + virtual bool put_buf(const void* pBuf, int len) + { + if (!pBuf) { + //end of image + return true; + } + if ((size_t)len > (max_len - index)) { + //ESP_LOGW(TAG, "JPG output overflow: %d bytes (%d,%d,%d)", len - (max_len - index), len, index, max_len); + len = max_len - index; + } + if (len) { + memcpy(out_buf + index, pBuf, len); + index += len; + } + return true; + } + + virtual size_t get_size() const + { + return index; + } +}; + +bool fmt2jpg(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t quality, uint8_t ** out, size_t * out_len) +{ + //todo: allocate proper buffer for holding JPEG data + //this should be enough for CIF frame size + int jpg_buf_len = 128*1024; + + + uint8_t * jpg_buf = (uint8_t *)_malloc(jpg_buf_len); + if(jpg_buf == NULL) { + ESP_LOGE(TAG, "JPG buffer malloc failed"); + return false; + } + memory_stream dst_stream(jpg_buf, jpg_buf_len); + + if(!convert_image(src, width, height, format, quality, &dst_stream)) { + free(jpg_buf); + return false; + } + + *out = jpg_buf; + *out_len = dst_stream.get_size(); + return true; +} + +bool frame2jpg(camera_fb_t * fb, uint8_t quality, uint8_t ** out, size_t * out_len) +{ + return fmt2jpg(fb->buf, fb->len, fb->width, fb->height, fb->format, quality, out, out_len); +} diff --git a/lib/libesp32_div/esp32-camera/conversions/yuv.c b/lib/libesp32_div/esp32-camera/conversions/yuv.c new file mode 100644 index 000000000..46034cc86 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/conversions/yuv.c @@ -0,0 +1,298 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#include "yuv.h" +#include "esp_attr.h" + +typedef struct { + int16_t vY; + int16_t vVr; + int16_t vVg; + int16_t vUg; + int16_t vUb; +} yuv_table_row; + +static const yuv_table_row yuv_table[256] = { + // Y Vr Vg Ug Ub // # + { -18, -204, 50, 104, -258 }, // 0 + { -17, -202, 49, 103, -256 }, // 1 + { -16, -201, 49, 102, -254 }, // 2 + { -15, -199, 48, 101, -252 }, // 3 + { -13, -197, 48, 100, -250 }, // 4 + { -12, -196, 48, 99, -248 }, // 5 + { -11, -194, 47, 99, -246 }, // 6 + { -10, -193, 47, 98, -244 }, // 7 + { -9, -191, 46, 97, -242 }, // 8 + { -8, -189, 46, 96, -240 }, // 9 + { -6, -188, 46, 95, -238 }, // 10 + { -5, -186, 45, 95, -236 }, // 11 + { -4, -185, 45, 94, -234 }, // 12 + { -3, -183, 44, 93, -232 }, // 13 + { -2, -181, 44, 92, -230 }, // 14 + { -1, -180, 44, 91, -228 }, // 15 + { 0, -178, 43, 91, -226 }, // 16 + { 1, -177, 43, 90, -223 }, // 17 + { 2, -175, 43, 89, -221 }, // 18 + { 3, -173, 42, 88, -219 }, // 19 + { 4, -172, 42, 87, -217 }, // 20 + { 5, -170, 41, 86, -215 }, // 21 + { 6, -169, 41, 86, -213 }, // 22 + { 8, -167, 41, 85, -211 }, // 23 + { 9, -165, 40, 84, -209 }, // 24 + { 10, -164, 40, 83, -207 }, // 25 + { 11, -162, 39, 82, -205 }, // 26 + { 12, -161, 39, 82, -203 }, // 27 + { 13, -159, 39, 81, -201 }, // 28 + { 15, -158, 38, 80, -199 }, // 29 + { 16, -156, 38, 79, -197 }, // 30 + { 17, -154, 37, 78, -195 }, // 31 + { 18, -153, 37, 78, -193 }, // 32 + { 19, -151, 37, 77, -191 }, // 33 + { 20, -150, 36, 76, -189 }, // 34 + { 22, -148, 36, 75, -187 }, // 35 + { 23, -146, 35, 74, -185 }, // 36 + { 24, -145, 35, 73, -183 }, // 37 + { 25, -143, 35, 73, -181 }, // 38 + { 26, -142, 34, 72, -179 }, // 39 + { 27, -140, 34, 71, -177 }, // 40 + { 29, -138, 34, 70, -175 }, // 41 + { 30, -137, 33, 69, -173 }, // 42 + { 31, -135, 33, 69, -171 }, // 43 + { 32, -134, 32, 68, -169 }, // 44 + { 33, -132, 32, 67, -167 }, // 45 + { 34, -130, 32, 66, -165 }, // 46 + { 36, -129, 31, 65, -163 }, // 47 + { 37, -127, 31, 65, -161 }, // 48 + { 38, -126, 30, 64, -159 }, // 49 + { 39, -124, 30, 63, -157 }, // 50 + { 40, -122, 30, 62, -155 }, // 51 + { 41, -121, 29, 61, -153 }, // 52 + { 43, -119, 29, 60, -151 }, // 53 + { 44, -118, 28, 60, -149 }, // 54 + { 45, -116, 28, 59, -147 }, // 55 + { 46, -114, 28, 58, -145 }, // 56 + { 47, -113, 27, 57, -143 }, // 57 + { 48, -111, 27, 56, -141 }, // 58 + { 50, -110, 26, 56, -139 }, // 59 + { 51, -108, 26, 55, -137 }, // 60 + { 52, -106, 26, 54, -135 }, // 61 + { 53, -105, 25, 53, -133 }, // 62 + { 54, -103, 25, 52, -131 }, // 63 + { 55, -102, 25, 52, -129 }, // 64 + { 57, -100, 24, 51, -127 }, // 65 + { 58, -98, 24, 50, -125 }, // 66 + { 59, -97, 23, 49, -123 }, // 67 + { 60, -95, 23, 48, -121 }, // 68 + { 61, -94, 23, 47, -119 }, // 69 + { 62, -92, 22, 47, -117 }, // 70 + { 64, -90, 22, 46, -115 }, // 71 + { 65, -89, 21, 45, -113 }, // 72 + { 66, -87, 21, 44, -110 }, // 73 + { 67, -86, 21, 43, -108 }, // 74 + { 68, -84, 20, 43, -106 }, // 75 + { 69, -82, 20, 42, -104 }, // 76 + { 71, -81, 19, 41, -102 }, // 77 + { 72, -79, 19, 40, -100 }, // 78 + { 73, -78, 19, 39, -98 }, // 79 + { 74, -76, 18, 39, -96 }, // 80 + { 75, -75, 18, 38, -94 }, // 81 + { 76, -73, 17, 37, -92 }, // 82 + { 77, -71, 17, 36, -90 }, // 83 + { 79, -70, 17, 35, -88 }, // 84 + { 80, -68, 16, 34, -86 }, // 85 + { 81, -67, 16, 34, -84 }, // 86 + { 82, -65, 16, 33, -82 }, // 87 + { 83, -63, 15, 32, -80 }, // 88 + { 84, -62, 15, 31, -78 }, // 89 + { 86, -60, 14, 30, -76 }, // 90 + { 87, -59, 14, 30, -74 }, // 91 + { 88, -57, 14, 29, -72 }, // 92 + { 89, -55, 13, 28, -70 }, // 93 + { 90, -54, 13, 27, -68 }, // 94 + { 91, -52, 12, 26, -66 }, // 95 + { 93, -51, 12, 26, -64 }, // 96 + { 94, -49, 12, 25, -62 }, // 97 + { 95, -47, 11, 24, -60 }, // 98 + { 96, -46, 11, 23, -58 }, // 99 + { 97, -44, 10, 22, -56 }, // 100 + { 98, -43, 10, 21, -54 }, // 101 + { 100, -41, 10, 21, -52 }, // 102 + { 101, -39, 9, 20, -50 }, // 103 + { 102, -38, 9, 19, -48 }, // 104 + { 103, -36, 8, 18, -46 }, // 105 + { 104, -35, 8, 17, -44 }, // 106 + { 105, -33, 8, 17, -42 }, // 107 + { 107, -31, 7, 16, -40 }, // 108 + { 108, -30, 7, 15, -38 }, // 109 + { 109, -28, 7, 14, -36 }, // 110 + { 110, -27, 6, 13, -34 }, // 111 + { 111, -25, 6, 13, -32 }, // 112 + { 112, -23, 5, 12, -30 }, // 113 + { 114, -22, 5, 11, -28 }, // 114 + { 115, -20, 5, 10, -26 }, // 115 + { 116, -19, 4, 9, -24 }, // 116 + { 117, -17, 4, 8, -22 }, // 117 + { 118, -15, 3, 8, -20 }, // 118 + { 119, -14, 3, 7, -18 }, // 119 + { 121, -12, 3, 6, -16 }, // 120 + { 122, -11, 2, 5, -14 }, // 121 + { 123, -9, 2, 4, -12 }, // 122 + { 124, -7, 1, 4, -10 }, // 123 + { 125, -6, 1, 3, -8 }, // 124 + { 126, -4, 1, 2, -6 }, // 125 + { 128, -3, 0, 1, -4 }, // 126 + { 129, -1, 0, 0, -2 }, // 127 + { 130, 0, 0, 0, 0 }, // 128 + { 131, 1, 0, 0, 2 }, // 129 + { 132, 3, 0, -1, 4 }, // 130 + { 133, 4, -1, -2, 6 }, // 131 + { 135, 6, -1, -3, 8 }, // 132 + { 136, 7, -1, -4, 10 }, // 133 + { 137, 9, -2, -4, 12 }, // 134 + { 138, 11, -2, -5, 14 }, // 135 + { 139, 12, -3, -6, 16 }, // 136 + { 140, 14, -3, -7, 18 }, // 137 + { 142, 15, -3, -8, 20 }, // 138 + { 143, 17, -4, -8, 22 }, // 139 + { 144, 19, -4, -9, 24 }, // 140 + { 145, 20, -5, -10, 26 }, // 141 + { 146, 22, -5, -11, 28 }, // 142 + { 147, 23, -5, -12, 30 }, // 143 + { 148, 25, -6, -13, 32 }, // 144 + { 150, 27, -6, -13, 34 }, // 145 + { 151, 28, -7, -14, 36 }, // 146 + { 152, 30, -7, -15, 38 }, // 147 + { 153, 31, -7, -16, 40 }, // 148 + { 154, 33, -8, -17, 42 }, // 149 + { 155, 35, -8, -17, 44 }, // 150 + { 157, 36, -8, -18, 46 }, // 151 + { 158, 38, -9, -19, 48 }, // 152 + { 159, 39, -9, -20, 50 }, // 153 + { 160, 41, -10, -21, 52 }, // 154 + { 161, 43, -10, -21, 54 }, // 155 + { 162, 44, -10, -22, 56 }, // 156 + { 164, 46, -11, -23, 58 }, // 157 + { 165, 47, -11, -24, 60 }, // 158 + { 166, 49, -12, -25, 62 }, // 159 + { 167, 51, -12, -26, 64 }, // 160 + { 168, 52, -12, -26, 66 }, // 161 + { 169, 54, -13, -27, 68 }, // 162 + { 171, 55, -13, -28, 70 }, // 163 + { 172, 57, -14, -29, 72 }, // 164 + { 173, 59, -14, -30, 74 }, // 165 + { 174, 60, -14, -30, 76 }, // 166 + { 175, 62, -15, -31, 78 }, // 167 + { 176, 63, -15, -32, 80 }, // 168 + { 178, 65, -16, -33, 82 }, // 169 + { 179, 67, -16, -34, 84 }, // 170 + { 180, 68, -16, -34, 86 }, // 171 + { 181, 70, -17, -35, 88 }, // 172 + { 182, 71, -17, -36, 90 }, // 173 + { 183, 73, -17, -37, 92 }, // 174 + { 185, 75, -18, -38, 94 }, // 175 + { 186, 76, -18, -39, 96 }, // 176 + { 187, 78, -19, -39, 98 }, // 177 + { 188, 79, -19, -40, 100 }, // 178 + { 189, 81, -19, -41, 102 }, // 179 + { 190, 82, -20, -42, 104 }, // 180 + { 192, 84, -20, -43, 106 }, // 181 + { 193, 86, -21, -43, 108 }, // 182 + { 194, 87, -21, -44, 110 }, // 183 + { 195, 89, -21, -45, 113 }, // 184 + { 196, 90, -22, -46, 115 }, // 185 + { 197, 92, -22, -47, 117 }, // 186 + { 199, 94, -23, -47, 119 }, // 187 + { 200, 95, -23, -48, 121 }, // 188 + { 201, 97, -23, -49, 123 }, // 189 + { 202, 98, -24, -50, 125 }, // 190 + { 203, 100, -24, -51, 127 }, // 191 + { 204, 102, -25, -52, 129 }, // 192 + { 206, 103, -25, -52, 131 }, // 193 + { 207, 105, -25, -53, 133 }, // 194 + { 208, 106, -26, -54, 135 }, // 195 + { 209, 108, -26, -55, 137 }, // 196 + { 210, 110, -26, -56, 139 }, // 197 + { 211, 111, -27, -56, 141 }, // 198 + { 213, 113, -27, -57, 143 }, // 199 + { 214, 114, -28, -58, 145 }, // 200 + { 215, 116, -28, -59, 147 }, // 201 + { 216, 118, -28, -60, 149 }, // 202 + { 217, 119, -29, -60, 151 }, // 203 + { 218, 121, -29, -61, 153 }, // 204 + { 219, 122, -30, -62, 155 }, // 205 + { 221, 124, -30, -63, 157 }, // 206 + { 222, 126, -30, -64, 159 }, // 207 + { 223, 127, -31, -65, 161 }, // 208 + { 224, 129, -31, -65, 163 }, // 209 + { 225, 130, -32, -66, 165 }, // 210 + { 226, 132, -32, -67, 167 }, // 211 + { 228, 134, -32, -68, 169 }, // 212 + { 229, 135, -33, -69, 171 }, // 213 + { 230, 137, -33, -69, 173 }, // 214 + { 231, 138, -34, -70, 175 }, // 215 + { 232, 140, -34, -71, 177 }, // 216 + { 233, 142, -34, -72, 179 }, // 217 + { 235, 143, -35, -73, 181 }, // 218 + { 236, 145, -35, -73, 183 }, // 219 + { 237, 146, -35, -74, 185 }, // 220 + { 238, 148, -36, -75, 187 }, // 221 + { 239, 150, -36, -76, 189 }, // 222 + { 240, 151, -37, -77, 191 }, // 223 + { 242, 153, -37, -78, 193 }, // 224 + { 243, 154, -37, -78, 195 }, // 225 + { 244, 156, -38, -79, 197 }, // 226 + { 245, 158, -38, -80, 199 }, // 227 + { 246, 159, -39, -81, 201 }, // 228 + { 247, 161, -39, -82, 203 }, // 229 + { 249, 162, -39, -82, 205 }, // 230 + { 250, 164, -40, -83, 207 }, // 231 + { 251, 165, -40, -84, 209 }, // 232 + { 252, 167, -41, -85, 211 }, // 233 + { 253, 169, -41, -86, 213 }, // 234 + { 254, 170, -41, -86, 215 }, // 235 + { 256, 172, -42, -87, 217 }, // 236 + { 257, 173, -42, -88, 219 }, // 237 + { 258, 175, -43, -89, 221 }, // 238 + { 259, 177, -43, -90, 223 }, // 239 + { 260, 178, -43, -91, 226 }, // 240 + { 261, 180, -44, -91, 228 }, // 241 + { 263, 181, -44, -92, 230 }, // 242 + { 264, 183, -44, -93, 232 }, // 243 + { 265, 185, -45, -94, 234 }, // 244 + { 266, 186, -45, -95, 236 }, // 245 + { 267, 188, -46, -95, 238 }, // 246 + { 268, 189, -46, -96, 240 }, // 247 + { 270, 191, -46, -97, 242 }, // 248 + { 271, 193, -47, -98, 244 }, // 249 + { 272, 194, -47, -99, 246 }, // 250 + { 273, 196, -48, -99, 248 }, // 251 + { 274, 197, -48, -100, 250 }, // 252 + { 275, 199, -48, -101, 252 }, // 253 + { 277, 201, -49, -102, 254 }, // 254 + { 278, 202, -49, -103, 256 } // 255 +}; + +#define YUYV_CONSTRAIN(v) ((v)<0)?0:(((v)>255)?255:(v)) + +void IRAM_ATTR yuv2rgb(uint8_t y, uint8_t u, uint8_t v, uint8_t *r, uint8_t *g, uint8_t *b) +{ + int16_t ri, gi, bi; + + ri = yuv_table[y].vY + yuv_table[v].vVr; + gi = yuv_table[y].vY + yuv_table[u].vUg + yuv_table[v].vVg; + bi = yuv_table[y].vY + yuv_table[u].vUb; + + *r = YUYV_CONSTRAIN(ri); + *g = YUYV_CONSTRAIN(gi); + *b = YUYV_CONSTRAIN(bi); +} diff --git a/lib/libesp32_div/esp32-camera/driver/cam_hal.c b/lib/libesp32_div/esp32-camera/driver/cam_hal.c new file mode 100644 index 000000000..c54fb8172 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/driver/cam_hal.c @@ -0,0 +1,483 @@ +// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include "esp_heap_caps.h" +#include "ll_cam.h" +#include "cam_hal.h" + +static const char *TAG = "cam_hal"; + +static cam_obj_t *cam_obj = NULL; + +static const uint32_t JPEG_SOI_MARKER = 0xFFD8FF; // written in little-endian for esp32 +static const uint16_t JPEG_EOI_MARKER = 0xD9FF; // written in little-endian for esp32 + +static int cam_verify_jpeg_soi(const uint8_t *inbuf, uint32_t length) +{ + uint32_t sig = *((uint32_t *)inbuf) & 0xFFFFFF; + if(sig != JPEG_SOI_MARKER) { + for (uint32_t i = 0; i < length; i++) { + sig = *((uint32_t *)(&inbuf[i])) & 0xFFFFFF; + if (sig == JPEG_SOI_MARKER) { + ESP_LOGW(TAG, "SOI: %d", i); + return i; + } + } + ESP_LOGW(TAG, "NO-SOI"); + return -1; + } + return 0; +} + +static int cam_verify_jpeg_eoi(const uint8_t *inbuf, uint32_t length) +{ + int offset = -1; + uint8_t *dptr = (uint8_t *)inbuf + length - 2; + while (dptr > inbuf) { + uint16_t sig = *((uint16_t *)dptr); + if (JPEG_EOI_MARKER == sig) { + offset = dptr - inbuf; + //ESP_LOGW(TAG, "EOI: %d", length - (offset + 2)); + return offset; + } + dptr--; + } + return -1; +} + +static bool cam_get_next_frame(int * frame_pos) +{ + if(!cam_obj->frames[*frame_pos].en){ + for (int x = 0; x < cam_obj->frame_cnt; x++) { + if (cam_obj->frames[x].en) { + *frame_pos = x; + return true; + } + } + } else { + return true; + } + return false; +} + +static bool cam_start_frame(int * frame_pos) +{ + if (cam_get_next_frame(frame_pos)) { + if(ll_cam_start(cam_obj, *frame_pos)){ + // Vsync the frame manually + ll_cam_do_vsync(cam_obj); + uint64_t us = (uint64_t)esp_timer_get_time(); + cam_obj->frames[*frame_pos].fb.timestamp.tv_sec = us / 1000000UL; + cam_obj->frames[*frame_pos].fb.timestamp.tv_usec = us % 1000000UL; + return true; + } + } + return false; +} + +void IRAM_ATTR ll_cam_send_event(cam_obj_t *cam, cam_event_t cam_event, BaseType_t * HPTaskAwoken) +{ + if (xQueueSendFromISR(cam->event_queue, (void *)&cam_event, HPTaskAwoken) != pdTRUE) { + ll_cam_stop(cam); + cam->state = CAM_STATE_IDLE; + ESP_EARLY_LOGE(TAG, "EV-%s-OVF", cam_event==CAM_IN_SUC_EOF_EVENT ? "EOF" : "VSYNC"); + } +} + +//Copy fram from DMA dma_buffer to fram dma_buffer +static void cam_task(void *arg) +{ + int cnt = 0; + int frame_pos = 0; + cam_obj->state = CAM_STATE_IDLE; + cam_event_t cam_event = 0; + + xQueueReset(cam_obj->event_queue); + + while (1) { + xQueueReceive(cam_obj->event_queue, (void *)&cam_event, portMAX_DELAY); + DBG_PIN_SET(1); + switch (cam_obj->state) { + + case CAM_STATE_IDLE: { + if (cam_event == CAM_VSYNC_EVENT) { + //DBG_PIN_SET(1); + if(cam_start_frame(&frame_pos)){ + cam_obj->frames[frame_pos].fb.len = 0; + cam_obj->state = CAM_STATE_READ_BUF; + } + cnt = 0; + } + } + break; + + case CAM_STATE_READ_BUF: { + camera_fb_t * frame_buffer_event = &cam_obj->frames[frame_pos].fb; + size_t pixels_per_dma = (cam_obj->dma_half_buffer_size * cam_obj->fb_bytes_per_pixel) / (cam_obj->dma_bytes_per_item * cam_obj->in_bytes_per_pixel); + + if (cam_event == CAM_IN_SUC_EOF_EVENT) { + if(!cam_obj->psram_mode){ + if (cam_obj->fb_size < (frame_buffer_event->len + pixels_per_dma)) { + ESP_LOGW(TAG, "FB-OVF"); + ll_cam_stop(cam_obj); + DBG_PIN_SET(0); + continue; + } + frame_buffer_event->len += ll_cam_memcpy(cam_obj, + &frame_buffer_event->buf[frame_buffer_event->len], + &cam_obj->dma_buffer[(cnt % cam_obj->dma_half_buffer_cnt) * cam_obj->dma_half_buffer_size], + cam_obj->dma_half_buffer_size); + } + //Check for JPEG SOI in the first buffer. stop if not found + if (cam_obj->jpeg_mode && cnt == 0 && cam_verify_jpeg_soi(frame_buffer_event->buf, frame_buffer_event->len) != 0) { + ll_cam_stop(cam_obj); + cam_obj->state = CAM_STATE_IDLE; + } + cnt++; + + } else if (cam_event == CAM_VSYNC_EVENT) { + //DBG_PIN_SET(1); + ll_cam_stop(cam_obj); + + if (cnt || !cam_obj->jpeg_mode || cam_obj->psram_mode) { + if (cam_obj->jpeg_mode) { + if (!cam_obj->psram_mode) { + if (cam_obj->fb_size < (frame_buffer_event->len + pixels_per_dma)) { + ESP_LOGW(TAG, "FB-OVF"); + cnt--; + } else { + frame_buffer_event->len += ll_cam_memcpy(cam_obj, + &frame_buffer_event->buf[frame_buffer_event->len], + &cam_obj->dma_buffer[(cnt % cam_obj->dma_half_buffer_cnt) * cam_obj->dma_half_buffer_size], + cam_obj->dma_half_buffer_size); + } + } + cnt++; + } + + cam_obj->frames[frame_pos].en = 0; + + if (cam_obj->psram_mode) { + if (cam_obj->jpeg_mode) { + frame_buffer_event->len = cnt * cam_obj->dma_half_buffer_size; + } else { + frame_buffer_event->len = cam_obj->recv_size; + } + } else if (!cam_obj->jpeg_mode) { + if (frame_buffer_event->len != cam_obj->fb_size) { + cam_obj->frames[frame_pos].en = 1; + ESP_LOGE(TAG, "FB-SIZE: %u != %u", frame_buffer_event->len, cam_obj->fb_size); + } + } + //send frame + if(!cam_obj->frames[frame_pos].en && xQueueSend(cam_obj->frame_buffer_queue, (void *)&frame_buffer_event, 0) != pdTRUE) { + //pop frame buffer from the queue + camera_fb_t * fb2 = NULL; + if(xQueueReceive(cam_obj->frame_buffer_queue, &fb2, 0) == pdTRUE) { + //push the new frame to the end of the queue + if (xQueueSend(cam_obj->frame_buffer_queue, (void *)&frame_buffer_event, 0) != pdTRUE) { + cam_obj->frames[frame_pos].en = 1; + ESP_LOGE(TAG, "FBQ-SND"); + } + //free the popped buffer + cam_give(fb2); + } else { + //queue is full and we could not pop a frame from it + cam_obj->frames[frame_pos].en = 1; + ESP_LOGE(TAG, "FBQ-RCV"); + } + } + } + + if(!cam_start_frame(&frame_pos)){ + cam_obj->state = CAM_STATE_IDLE; + } else { + cam_obj->frames[frame_pos].fb.len = 0; + } + cnt = 0; + } + } + break; + } + DBG_PIN_SET(0); + } +} + +static lldesc_t * allocate_dma_descriptors(uint32_t count, uint16_t size, uint8_t * buffer) +{ + lldesc_t *dma = (lldesc_t *)heap_caps_malloc(count * sizeof(lldesc_t), MALLOC_CAP_DMA); + if (dma == NULL) { + return dma; + } + + for (int x = 0; x < count; x++) { + dma[x].size = size; + dma[x].length = 0; + dma[x].sosf = 0; + dma[x].eof = 0; + dma[x].owner = 1; + dma[x].buf = (buffer + size * x); + dma[x].empty = (uint32_t)&dma[(x + 1) % count]; + } + return dma; +} + +static esp_err_t cam_dma_config(const camera_config_t *config) +{ + bool ret = ll_cam_dma_sizes(cam_obj); + if (0 == ret) { + return ESP_FAIL; + } + + cam_obj->dma_node_cnt = (cam_obj->dma_buffer_size) / cam_obj->dma_node_buffer_size; // Number of DMA nodes + cam_obj->frame_copy_cnt = cam_obj->recv_size / cam_obj->dma_half_buffer_size; // Number of interrupted copies, ping-pong copy + + ESP_LOGI(TAG, "buffer_size: %d, half_buffer_size: %d, node_buffer_size: %d, node_cnt: %d, total_cnt: %d", + cam_obj->dma_buffer_size, cam_obj->dma_half_buffer_size, cam_obj->dma_node_buffer_size, cam_obj->dma_node_cnt, cam_obj->frame_copy_cnt); + + cam_obj->dma_buffer = NULL; + cam_obj->dma = NULL; + + cam_obj->frames = (cam_frame_t *)heap_caps_calloc(1, cam_obj->frame_cnt * sizeof(cam_frame_t), MALLOC_CAP_DEFAULT); + CAM_CHECK(cam_obj->frames != NULL, "frames malloc failed", ESP_FAIL); + + uint8_t dma_align = 0; + size_t fb_size = cam_obj->fb_size; + if (cam_obj->psram_mode) { + dma_align = ll_cam_get_dma_align(cam_obj); + if (cam_obj->fb_size < cam_obj->recv_size) { + fb_size = cam_obj->recv_size; + } + } + + /* Allocate memeory for frame buffer */ + size_t alloc_size = fb_size * sizeof(uint8_t) + dma_align; + uint32_t _caps = MALLOC_CAP_8BIT; + if (CAMERA_FB_IN_DRAM == config->fb_location) { + _caps |= MALLOC_CAP_INTERNAL; + } else { + _caps |= MALLOC_CAP_SPIRAM; + } + for (int x = 0; x < cam_obj->frame_cnt; x++) { + cam_obj->frames[x].dma = NULL; + cam_obj->frames[x].fb_offset = 0; + cam_obj->frames[x].en = 0; + ESP_LOGI(TAG, "Allocating %d Byte frame buffer in %s", alloc_size, _caps & MALLOC_CAP_SPIRAM ? "PSRAM" : "OnBoard RAM"); + cam_obj->frames[x].fb.buf = (uint8_t *)heap_caps_malloc(alloc_size, _caps); + CAM_CHECK(cam_obj->frames[x].fb.buf != NULL, "frame buffer malloc failed", ESP_FAIL); + if (cam_obj->psram_mode) { + //align PSRAM buffer. TODO: save the offset so proper address can be freed later + cam_obj->frames[x].fb_offset = dma_align - ((uint32_t)cam_obj->frames[x].fb.buf & (dma_align - 1)); + cam_obj->frames[x].fb.buf += cam_obj->frames[x].fb_offset; + ESP_LOGI(TAG, "Frame[%d]: Offset: %u, Addr: 0x%08X", x, cam_obj->frames[x].fb_offset, (uint32_t)cam_obj->frames[x].fb.buf); + cam_obj->frames[x].dma = allocate_dma_descriptors(cam_obj->dma_node_cnt, cam_obj->dma_node_buffer_size, cam_obj->frames[x].fb.buf); + CAM_CHECK(cam_obj->frames[x].dma != NULL, "frame dma malloc failed", ESP_FAIL); + } + cam_obj->frames[x].en = 1; + } + + if (!cam_obj->psram_mode) { + cam_obj->dma_buffer = (uint8_t *)heap_caps_malloc(cam_obj->dma_buffer_size * sizeof(uint8_t), MALLOC_CAP_DMA); + if(NULL == cam_obj->dma_buffer) { + ESP_LOGE(TAG,"%s(%d): DMA buffer %d Byte malloc failed, the current largest free block:%d Byte", __FUNCTION__, __LINE__, + cam_obj->dma_buffer_size, heap_caps_get_largest_free_block(MALLOC_CAP_DMA)); + return ESP_FAIL; + } + + cam_obj->dma = allocate_dma_descriptors(cam_obj->dma_node_cnt, cam_obj->dma_node_buffer_size, cam_obj->dma_buffer); + CAM_CHECK(cam_obj->dma != NULL, "dma malloc failed", ESP_FAIL); + } + + return ESP_OK; +} + +esp_err_t cam_init(const camera_config_t *config) +{ + CAM_CHECK(NULL != config, "config pointer is invalid", ESP_ERR_INVALID_ARG); + + esp_err_t ret = ESP_OK; + cam_obj = (cam_obj_t *)heap_caps_calloc(1, sizeof(cam_obj_t), MALLOC_CAP_DMA); + CAM_CHECK(NULL != cam_obj, "lcd_cam object malloc error", ESP_ERR_NO_MEM); + + cam_obj->swap_data = 0; + cam_obj->vsync_pin = config->pin_vsync; + cam_obj->vsync_invert = true; + + ll_cam_set_pin(cam_obj, config); + ret = ll_cam_config(cam_obj, config); + CAM_CHECK_GOTO(ret == ESP_OK, "ll_cam initialize failed", err); + +#if CAMERA_DBG_PIN_ENABLE + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[DBG_PIN_NUM], PIN_FUNC_GPIO); + gpio_set_direction(DBG_PIN_NUM, GPIO_MODE_OUTPUT); + gpio_set_pull_mode(DBG_PIN_NUM, GPIO_FLOATING); +#endif + + ESP_LOGI(TAG, "cam init ok"); + return ESP_OK; + +err: + free(cam_obj); + cam_obj = NULL; + return ESP_FAIL; +} + +esp_err_t cam_config(const camera_config_t *config, framesize_t frame_size, uint16_t sensor_pid) +{ + CAM_CHECK(NULL != config, "config pointer is invalid", ESP_ERR_INVALID_ARG); + esp_err_t ret = ESP_OK; + + ret = ll_cam_set_sample_mode(cam_obj, (pixformat_t)config->pixel_format, config->xclk_freq_hz, sensor_pid); + + cam_obj->jpeg_mode = config->pixel_format == PIXFORMAT_JPEG; +#if CONFIG_IDF_TARGET_ESP32 + cam_obj->psram_mode = false; +#else + cam_obj->psram_mode = (config->xclk_freq_hz == 16000000); +#endif + cam_obj->frame_cnt = config->fb_count; + cam_obj->width = resolution[frame_size].width; + cam_obj->height = resolution[frame_size].height; + + if(cam_obj->jpeg_mode){ + cam_obj->recv_size = cam_obj->width * cam_obj->height / 5; + cam_obj->fb_size = cam_obj->recv_size; + } else { + cam_obj->recv_size = cam_obj->width * cam_obj->height * cam_obj->in_bytes_per_pixel; + cam_obj->fb_size = cam_obj->width * cam_obj->height * cam_obj->fb_bytes_per_pixel; + } + + ret = cam_dma_config(config); + CAM_CHECK_GOTO(ret == ESP_OK, "cam_dma_config failed", err); + + cam_obj->event_queue = xQueueCreate(cam_obj->dma_half_buffer_cnt - 1, sizeof(cam_event_t)); + CAM_CHECK_GOTO(cam_obj->event_queue != NULL, "event_queue create failed", err); + + size_t frame_buffer_queue_len = cam_obj->frame_cnt; + if (config->grab_mode == CAMERA_GRAB_LATEST && cam_obj->frame_cnt > 1) { + frame_buffer_queue_len = cam_obj->frame_cnt - 1; + } + cam_obj->frame_buffer_queue = xQueueCreate(frame_buffer_queue_len, sizeof(camera_fb_t*)); + CAM_CHECK_GOTO(cam_obj->frame_buffer_queue != NULL, "frame_buffer_queue create failed", err); + + ret = ll_cam_init_isr(cam_obj); + CAM_CHECK_GOTO(ret == ESP_OK, "cam intr alloc failed", err); + + +#if CONFIG_CAMERA_CORE0 + xTaskCreatePinnedToCore(cam_task, "cam_task", 2048, NULL, configMAX_PRIORITIES - 2, &cam_obj->task_handle, 0); +#elif CONFIG_CAMERA_CORE1 + xTaskCreatePinnedToCore(cam_task, "cam_task", 2048, NULL, configMAX_PRIORITIES - 2, &cam_obj->task_handle, 1); +#else + xTaskCreate(cam_task, "cam_task", 2048, NULL, configMAX_PRIORITIES - 2, &cam_obj->task_handle); +#endif + + ESP_LOGI(TAG, "cam config ok"); + return ESP_OK; + +err: + cam_deinit(); + return ESP_FAIL; +} + +esp_err_t cam_deinit(void) +{ + if (!cam_obj) { + return ESP_FAIL; + } + + cam_stop(); + if (cam_obj->task_handle) { + vTaskDelete(cam_obj->task_handle); + } + if (cam_obj->event_queue) { + vQueueDelete(cam_obj->event_queue); + } + if (cam_obj->frame_buffer_queue) { + vQueueDelete(cam_obj->frame_buffer_queue); + } + if (cam_obj->dma) { + free(cam_obj->dma); + } + if (cam_obj->dma_buffer) { + free(cam_obj->dma_buffer); + } + if (cam_obj->frames) { + for (int x = 0; x < cam_obj->frame_cnt; x++) { + free(cam_obj->frames[x].fb.buf - cam_obj->frames[x].fb_offset); + if (cam_obj->frames[x].dma) { + free(cam_obj->frames[x].dma); + } + } + free(cam_obj->frames); + } + + ll_cam_deinit(cam_obj); + + free(cam_obj); + cam_obj = NULL; + return ESP_OK; +} + +void cam_stop(void) +{ + ll_cam_vsync_intr_enable(cam_obj, false); + ll_cam_stop(cam_obj); +} + +void cam_start(void) +{ + ll_cam_vsync_intr_enable(cam_obj, true); +} + +camera_fb_t *cam_take(TickType_t timeout) +{ + camera_fb_t *dma_buffer = NULL; + TickType_t start = xTaskGetTickCount(); + xQueueReceive(cam_obj->frame_buffer_queue, (void *)&dma_buffer, timeout); + if (dma_buffer) { + if(cam_obj->jpeg_mode){ + // find the end marker for JPEG. Data after that can be discarded + int offset_e = cam_verify_jpeg_eoi(dma_buffer->buf, dma_buffer->len); + if (offset_e >= 0) { + // adjust buffer length + dma_buffer->len = offset_e + sizeof(JPEG_EOI_MARKER); + return dma_buffer; + } else { + ESP_LOGW(TAG, "NO-EOI"); + cam_give(dma_buffer); + return cam_take(timeout - (xTaskGetTickCount() - start));//recurse!!!! + } + } else if(cam_obj->psram_mode && cam_obj->in_bytes_per_pixel != cam_obj->fb_bytes_per_pixel){ + //currently this is used only for YUV to GRAYSCALE + dma_buffer->len = ll_cam_memcpy(cam_obj, dma_buffer->buf, dma_buffer->buf, dma_buffer->len); + } + return dma_buffer; + } else { + ESP_LOGW(TAG, "Failed to get the frame on time!"); + } + return NULL; +} + +void cam_give(camera_fb_t *dma_buffer) +{ + for (int x = 0; x < cam_obj->frame_cnt; x++) { + if (&cam_obj->frames[x].fb == dma_buffer) { + cam_obj->frames[x].en = 1; + break; + } + } +} diff --git a/lib/libesp32_div/esp32-camera/driver/esp_camera.c b/lib/libesp32_div/esp32-camera/driver/esp_camera.c new file mode 100644 index 000000000..9ae1b56ca --- /dev/null +++ b/lib/libesp32_div/esp32-camera/driver/esp_camera.c @@ -0,0 +1,416 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#include +#include +#include +#include "time.h" +#include "sys/time.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "driver/gpio.h" +#include "esp_system.h" +#include "nvs_flash.h" +#include "nvs.h" +#include "sensor.h" +#include "sccb.h" +#include "cam_hal.h" +#include "esp_camera.h" +#include "xclk.h" +#if CONFIG_OV2640_SUPPORT +#include "ov2640.h" +#endif +#if CONFIG_OV7725_SUPPORT +#include "ov7725.h" +#endif +#if CONFIG_OV3660_SUPPORT +#include "ov3660.h" +#endif +#if CONFIG_OV5640_SUPPORT +#include "ov5640.h" +#endif +#if CONFIG_NT99141_SUPPORT +#include "nt99141.h" +#endif +#if CONFIG_OV7670_SUPPORT +#include "ov7670.h" +#endif +#if CONFIG_GC2145_SUPPORT +#include "gc2145.h" +#endif +#if CONFIG_GC032A_SUPPORT +#include "gc032a.h" +#endif +#if CONFIG_GC0308_SUPPORT +#include "gc0308.h" +#endif + + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#define TAG "" +#else +#include "esp_log.h" +static const char *TAG = "camera"; +#endif + +typedef struct { + sensor_t sensor; + camera_fb_t fb; +} camera_state_t; + +static const char *CAMERA_SENSOR_NVS_KEY = "sensor"; +static const char *CAMERA_PIXFORMAT_NVS_KEY = "pixformat"; +static camera_state_t *s_state = NULL; + +#if CONFIG_IDF_TARGET_ESP32S3 // LCD_CAM module of ESP32-S3 will generate xclk +#define CAMERA_ENABLE_OUT_CLOCK(v) +#define CAMERA_DISABLE_OUT_CLOCK() +#else +#define CAMERA_ENABLE_OUT_CLOCK(v) camera_enable_out_clock((v)) +#define CAMERA_DISABLE_OUT_CLOCK() camera_disable_out_clock() +#endif + +typedef struct { + int (*detect)(int slv_addr, sensor_id_t *id); + int (*init)(sensor_t *sensor); +} sensor_func_t; + +static const sensor_func_t g_sensors[] = { +#if CONFIG_OV7725_SUPPORT + {ov7725_detect, ov7725_init}, +#endif +#if CONFIG_OV7670_SUPPORT + {ov7670_detect, ov7670_init}, +#endif +#if CONFIG_OV2640_SUPPORT + {ov2640_detect, ov2640_init}, +#endif +#if CONFIG_OV3660_SUPPORT + {ov3660_detect, ov3660_init}, +#endif +#if CONFIG_OV5640_SUPPORT + {ov5640_detect, ov5640_init}, +#endif +#if CONFIG_NT99141_SUPPORT + {nt99141_detect, nt99141_init}, +#endif +#if CONFIG_GC2145_SUPPORT + {gc2145_detect, gc2145_init}, +#endif +#if CONFIG_GC032A_SUPPORT + {gc032a_detect, gc032a_init}, +#endif +#if CONFIG_GC0308_SUPPORT + {gc0308_detect, gc0308_init}, +#endif +}; + +static esp_err_t camera_probe(const camera_config_t *config, camera_model_t *out_camera_model) +{ + *out_camera_model = CAMERA_NONE; + if (s_state != NULL) { + return ESP_ERR_INVALID_STATE; + } + + s_state = (camera_state_t *) calloc(sizeof(camera_state_t), 1); + if (!s_state) { + return ESP_ERR_NO_MEM; + } + + if (config->pin_xclk >= 0) { + ESP_LOGD(TAG, "Enabling XCLK output"); + CAMERA_ENABLE_OUT_CLOCK(config); + } + + if (config->pin_sscb_sda != -1) { + ESP_LOGD(TAG, "Initializing SSCB"); + SCCB_Init(config->pin_sscb_sda, config->pin_sscb_scl); + } + + if (config->pin_pwdn >= 0) { + ESP_LOGD(TAG, "Resetting camera by power down line"); + gpio_config_t conf = { 0 }; + conf.pin_bit_mask = 1LL << config->pin_pwdn; + conf.mode = GPIO_MODE_OUTPUT; + gpio_config(&conf); + + // carefull, logic is inverted compared to reset pin + gpio_set_level(config->pin_pwdn, 1); + vTaskDelay(10 / portTICK_PERIOD_MS); + gpio_set_level(config->pin_pwdn, 0); + vTaskDelay(10 / portTICK_PERIOD_MS); + } + + if (config->pin_reset >= 0) { + ESP_LOGD(TAG, "Resetting camera"); + gpio_config_t conf = { 0 }; + conf.pin_bit_mask = 1LL << config->pin_reset; + conf.mode = GPIO_MODE_OUTPUT; + gpio_config(&conf); + + gpio_set_level(config->pin_reset, 0); + vTaskDelay(10 / portTICK_PERIOD_MS); + gpio_set_level(config->pin_reset, 1); + vTaskDelay(10 / portTICK_PERIOD_MS); + } + + + ESP_LOGD(TAG, "Searching for camera address"); + vTaskDelay(10 / portTICK_PERIOD_MS); + + uint8_t slv_addr = SCCB_Probe(); + + if (slv_addr == 0) { + CAMERA_DISABLE_OUT_CLOCK(); + return ESP_ERR_NOT_FOUND; + } + + ESP_LOGI(TAG, "Detected camera at address=0x%02x", slv_addr); + s_state->sensor.slv_addr = slv_addr; + s_state->sensor.xclk_freq_hz = config->xclk_freq_hz; + + /** + * Read sensor ID and then initialize sensor + * Attention: Some sensors have the same SCCB address. Therefore, several attempts may be made in the detection process + */ + sensor_id_t *id = &s_state->sensor.id; + for (size_t i = 0; i < sizeof(g_sensors) / sizeof(sensor_func_t); i++) { + if (g_sensors[i].detect(slv_addr, id)) { + camera_sensor_info_t *info = esp_camera_sensor_get_info(id); + if (NULL != info) { + *out_camera_model = info->model; + ESP_LOGI(TAG, "Detected %s camera", info->name); + g_sensors[i].init(&s_state->sensor); + break; + } + } + } + + if (CAMERA_NONE == *out_camera_model) { //If no supported sensors are detected + CAMERA_DISABLE_OUT_CLOCK(); + ESP_LOGE(TAG, "Detected camera not supported."); + return ESP_ERR_NOT_SUPPORTED; + } + + ESP_LOGI(TAG, "Camera PID=0x%02x VER=0x%02x MIDL=0x%02x MIDH=0x%02x", + id->PID, id->VER, id->MIDH, id->MIDL); + + ESP_LOGD(TAG, "Doing SW reset of sensor"); + vTaskDelay(10 / portTICK_PERIOD_MS); + s_state->sensor.reset(&s_state->sensor); + + return ESP_OK; +} + +esp_err_t esp_camera_init(const camera_config_t *config) +{ + esp_err_t err; + err = cam_init(config); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Camera init failed with error 0x%x", err); + return err; + } + + camera_model_t camera_model = CAMERA_NONE; + err = camera_probe(config, &camera_model); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Camera probe failed with error 0x%x(%s)", err, esp_err_to_name(err)); + goto fail; + } + + framesize_t frame_size = (framesize_t) config->frame_size; + pixformat_t pix_format = (pixformat_t) config->pixel_format; + + if (PIXFORMAT_JPEG == pix_format && (!camera_sensor[camera_model].support_jpeg)) { + ESP_LOGE(TAG, "JPEG format is not supported on this sensor"); + err = ESP_ERR_NOT_SUPPORTED; + goto fail; + } + + if (frame_size > camera_sensor[camera_model].max_size) { + ESP_LOGW(TAG, "The frame size exceeds the maximum for this sensor, it will be forced to the maximum possible value"); + frame_size = camera_sensor[camera_model].max_size; + } + + err = cam_config(config, frame_size, s_state->sensor.id.PID); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Camera config failed with error 0x%x", err); + goto fail; + } + + s_state->sensor.status.framesize = frame_size; + s_state->sensor.pixformat = pix_format; + ESP_LOGD(TAG, "Setting frame size to %dx%d", resolution[frame_size].width, resolution[frame_size].height); + if (s_state->sensor.set_framesize(&s_state->sensor, frame_size) != 0) { + ESP_LOGE(TAG, "Failed to set frame size"); + err = ESP_ERR_CAMERA_FAILED_TO_SET_FRAME_SIZE; + goto fail; + } + s_state->sensor.set_pixformat(&s_state->sensor, pix_format); + + if (s_state->sensor.id.PID == OV2640_PID) { + s_state->sensor.set_gainceiling(&s_state->sensor, GAINCEILING_2X); + s_state->sensor.set_bpc(&s_state->sensor, false); + s_state->sensor.set_wpc(&s_state->sensor, true); + s_state->sensor.set_lenc(&s_state->sensor, true); + } + + if (pix_format == PIXFORMAT_JPEG) { + s_state->sensor.set_quality(&s_state->sensor, config->jpeg_quality); + } + s_state->sensor.init_status(&s_state->sensor); + + cam_start(); + + return ESP_OK; + +fail: + esp_camera_deinit(); + return err; +} + +esp_err_t esp_camera_deinit() +{ + esp_err_t ret = cam_deinit(); + CAMERA_DISABLE_OUT_CLOCK(); + if (s_state) { + SCCB_Deinit(); + + free(s_state); + s_state = NULL; + } + + return ret; +} + +#define FB_GET_TIMEOUT (4000 / portTICK_PERIOD_MS) + +camera_fb_t *esp_camera_fb_get() +{ + if (s_state == NULL) { + return NULL; + } + camera_fb_t *fb = cam_take(FB_GET_TIMEOUT); + //set the frame properties + if (fb) { + fb->width = resolution[s_state->sensor.status.framesize].width; + fb->height = resolution[s_state->sensor.status.framesize].height; + fb->format = s_state->sensor.pixformat; + } + return fb; +} + +void esp_camera_fb_return(camera_fb_t *fb) +{ + if (s_state == NULL) { + return; + } + cam_give(fb); +} + +sensor_t *esp_camera_sensor_get() +{ + if (s_state == NULL) { + return NULL; + } + return &s_state->sensor; +} + +esp_err_t esp_camera_save_to_nvs(const char *key) +{ +#if ESP_IDF_VERSION_MAJOR > 3 + nvs_handle_t handle; +#else + nvs_handle handle; +#endif + esp_err_t ret = nvs_open(key, NVS_READWRITE, &handle); + + if (ret == ESP_OK) { + sensor_t *s = esp_camera_sensor_get(); + if (s != NULL) { + ret = nvs_set_blob(handle, CAMERA_SENSOR_NVS_KEY, &s->status, sizeof(camera_status_t)); + if (ret == ESP_OK) { + uint8_t pf = s->pixformat; + ret = nvs_set_u8(handle, CAMERA_PIXFORMAT_NVS_KEY, pf); + } + return ret; + } else { + return ESP_ERR_CAMERA_NOT_DETECTED; + } + nvs_close(handle); + return ret; + } else { + return ret; + } +} + +esp_err_t esp_camera_load_from_nvs(const char *key) +{ +#if ESP_IDF_VERSION_MAJOR > 3 + nvs_handle_t handle; +#else + nvs_handle handle; +#endif + uint8_t pf; + + esp_err_t ret = nvs_open(key, NVS_READWRITE, &handle); + + if (ret == ESP_OK) { + sensor_t *s = esp_camera_sensor_get(); + camera_status_t st; + if (s != NULL) { + size_t size = sizeof(camera_status_t); + ret = nvs_get_blob(handle, CAMERA_SENSOR_NVS_KEY, &st, &size); + if (ret == ESP_OK) { + s->set_ae_level(s, st.ae_level); + s->set_aec2(s, st.aec2); + s->set_aec_value(s, st.aec_value); + s->set_agc_gain(s, st.agc_gain); + s->set_awb_gain(s, st.awb_gain); + s->set_bpc(s, st.bpc); + s->set_brightness(s, st.brightness); + s->set_colorbar(s, st.colorbar); + s->set_contrast(s, st.contrast); + s->set_dcw(s, st.dcw); + s->set_denoise(s, st.denoise); + s->set_exposure_ctrl(s, st.aec); + s->set_framesize(s, st.framesize); + s->set_gain_ctrl(s, st.agc); + s->set_gainceiling(s, st.gainceiling); + s->set_hmirror(s, st.hmirror); + s->set_lenc(s, st.lenc); + s->set_quality(s, st.quality); + s->set_raw_gma(s, st.raw_gma); + s->set_saturation(s, st.saturation); + s->set_sharpness(s, st.sharpness); + s->set_special_effect(s, st.special_effect); + s->set_vflip(s, st.vflip); + s->set_wb_mode(s, st.wb_mode); + s->set_whitebal(s, st.awb); + s->set_wpc(s, st.wpc); + } + ret = nvs_get_u8(handle, CAMERA_PIXFORMAT_NVS_KEY, &pf); + if (ret == ESP_OK) { + s->set_pixformat(s, pf); + } + } else { + return ESP_ERR_CAMERA_NOT_DETECTED; + } + nvs_close(handle); + return ret; + } else { + ESP_LOGW(TAG, "Error (%d) opening nvs key \"%s\"", ret, key); + return ret; + } +} diff --git a/lib/libesp32_div/esp32-camera/driver/include/esp_camera.h b/lib/libesp32_div/esp32-camera/driver/include/esp_camera.h new file mode 100644 index 000000000..e9981671f --- /dev/null +++ b/lib/libesp32_div/esp32-camera/driver/include/esp_camera.h @@ -0,0 +1,214 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* + * Example Use + * + static camera_config_t camera_example_config = { + .pin_pwdn = PIN_PWDN, + .pin_reset = PIN_RESET, + .pin_xclk = PIN_XCLK, + .pin_sscb_sda = PIN_SIOD, + .pin_sscb_scl = PIN_SIOC, + .pin_d7 = PIN_D7, + .pin_d6 = PIN_D6, + .pin_d5 = PIN_D5, + .pin_d4 = PIN_D4, + .pin_d3 = PIN_D3, + .pin_d2 = PIN_D2, + .pin_d1 = PIN_D1, + .pin_d0 = PIN_D0, + .pin_vsync = PIN_VSYNC, + .pin_href = PIN_HREF, + .pin_pclk = PIN_PCLK, + + .xclk_freq_hz = 20000000, + .ledc_timer = LEDC_TIMER_0, + .ledc_channel = LEDC_CHANNEL_0, + .pixel_format = PIXFORMAT_JPEG, + .frame_size = FRAMESIZE_SVGA, + .jpeg_quality = 10, + .fb_count = 2, + .grab_mode = CAMERA_GRAB_WHEN_EMPTY + }; + + esp_err_t camera_example_init(){ + return esp_camera_init(&camera_example_config); + } + + esp_err_t camera_example_capture(){ + //capture a frame + camera_fb_t * fb = esp_camera_fb_get(); + if (!fb) { + ESP_LOGE(TAG, "Frame buffer could not be acquired"); + return ESP_FAIL; + } + + //replace this with your own function + display_image(fb->width, fb->height, fb->pixformat, fb->buf, fb->len); + + //return the frame buffer back to be reused + esp_camera_fb_return(fb); + + return ESP_OK; + } +*/ + +#pragma once + +#include "esp_err.h" +#include "driver/ledc.h" +#include "sensor.h" +#include "sys/time.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Configuration structure for camera initialization + */ +typedef enum { + CAMERA_GRAB_WHEN_EMPTY, /*!< Fills buffers when they are empty. Less resources but first 'fb_count' frames might be old */ + CAMERA_GRAB_LATEST /*!< Except when 1 frame buffer is used, queue will always contain the last 'fb_count' frames */ +} camera_grab_mode_t; + +/** + * @brief Camera frame buffer location + */ +typedef enum { + CAMERA_FB_IN_PSRAM, /*!< Frame buffer is placed in external PSRAM */ + CAMERA_FB_IN_DRAM /*!< Frame buffer is placed in internal DRAM */ +} camera_fb_location_t; + +/** + * @brief Configuration structure for camera initialization + */ +typedef struct { + int pin_pwdn; /*!< GPIO pin for camera power down line */ + int pin_reset; /*!< GPIO pin for camera reset line */ + int pin_xclk; /*!< GPIO pin for camera XCLK line */ + int pin_sscb_sda; /*!< GPIO pin for camera SDA line */ + int pin_sscb_scl; /*!< GPIO pin for camera SCL line */ + int pin_d7; /*!< GPIO pin for camera D7 line */ + int pin_d6; /*!< GPIO pin for camera D6 line */ + int pin_d5; /*!< GPIO pin for camera D5 line */ + int pin_d4; /*!< GPIO pin for camera D4 line */ + int pin_d3; /*!< GPIO pin for camera D3 line */ + int pin_d2; /*!< GPIO pin for camera D2 line */ + int pin_d1; /*!< GPIO pin for camera D1 line */ + int pin_d0; /*!< GPIO pin for camera D0 line */ + int pin_vsync; /*!< GPIO pin for camera VSYNC line */ + int pin_href; /*!< GPIO pin for camera HREF line */ + int pin_pclk; /*!< GPIO pin for camera PCLK line */ + + int xclk_freq_hz; /*!< Frequency of XCLK signal, in Hz. EXPERIMENTAL: Set to 16MHz on ESP32-S2 or ESP32-S3 to enable EDMA mode */ + + ledc_timer_t ledc_timer; /*!< LEDC timer to be used for generating XCLK */ + ledc_channel_t ledc_channel; /*!< LEDC channel to be used for generating XCLK */ + + pixformat_t pixel_format; /*!< Format of the pixel data: PIXFORMAT_ + YUV422|GRAYSCALE|RGB565|JPEG */ + framesize_t frame_size; /*!< Size of the output image: FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA */ + + int jpeg_quality; /*!< Quality of JPEG output. 0-63 lower means higher quality */ + size_t fb_count; /*!< Number of frame buffers to be allocated. If more than one, then each frame will be acquired (double speed) */ + camera_fb_location_t fb_location; /*!< The location where the frame buffer will be allocated */ + camera_grab_mode_t grab_mode; /*!< When buffers should be filled */ +} camera_config_t; + +/** + * @brief Data structure of camera frame buffer + */ +typedef struct { + uint8_t * buf; /*!< Pointer to the pixel data */ + size_t len; /*!< Length of the buffer in bytes */ + size_t width; /*!< Width of the buffer in pixels */ + size_t height; /*!< Height of the buffer in pixels */ + pixformat_t format; /*!< Format of the pixel data */ + struct timeval timestamp; /*!< Timestamp since boot of the first DMA buffer of the frame */ +} camera_fb_t; + +#define ESP_ERR_CAMERA_BASE 0x20000 +#define ESP_ERR_CAMERA_NOT_DETECTED (ESP_ERR_CAMERA_BASE + 1) +#define ESP_ERR_CAMERA_FAILED_TO_SET_FRAME_SIZE (ESP_ERR_CAMERA_BASE + 2) +#define ESP_ERR_CAMERA_FAILED_TO_SET_OUT_FORMAT (ESP_ERR_CAMERA_BASE + 3) +#define ESP_ERR_CAMERA_NOT_SUPPORTED (ESP_ERR_CAMERA_BASE + 4) + +/** + * @brief Initialize the camera driver + * + * @note call camera_probe before calling this function + * + * This function detects and configures camera over I2C interface, + * allocates framebuffer and DMA buffers, + * initializes parallel I2S input, and sets up DMA descriptors. + * + * Currently this function can only be called once and there is + * no way to de-initialize this module. + * + * @param config Camera configuration parameters + * + * @return ESP_OK on success + */ +esp_err_t esp_camera_init(const camera_config_t* config); + +/** + * @brief Deinitialize the camera driver + * + * @return + * - ESP_OK on success + * - ESP_ERR_INVALID_STATE if the driver hasn't been initialized yet + */ +esp_err_t esp_camera_deinit(); + +/** + * @brief Obtain pointer to a frame buffer. + * + * @return pointer to the frame buffer + */ +camera_fb_t* esp_camera_fb_get(); + +/** + * @brief Return the frame buffer to be reused again. + * + * @param fb Pointer to the frame buffer + */ +void esp_camera_fb_return(camera_fb_t * fb); + +/** + * @brief Get a pointer to the image sensor control structure + * + * @return pointer to the sensor + */ +sensor_t * esp_camera_sensor_get(); + +/** + * @brief Save camera settings to non-volatile-storage (NVS) + * + * @param key A unique nvs key name for the camera settings + */ +esp_err_t esp_camera_save_to_nvs(const char *key); + +/** + * @brief Load camera settings from non-volatile-storage (NVS) + * + * @param key A unique nvs key name for the camera settings + */ +esp_err_t esp_camera_load_from_nvs(const char *key); + +#ifdef __cplusplus +} +#endif + +#include "img_converters.h" + diff --git a/lib/libesp32_div/esp32-camera/driver/include/sensor.h b/lib/libesp32_div/esp32-camera/driver/include/sensor.h new file mode 100644 index 000000000..1f99c1541 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/driver/include/sensor.h @@ -0,0 +1,245 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * Sensor abstraction layer. + * + */ +#ifndef __SENSOR_H__ +#define __SENSOR_H__ +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + OV9650_PID = 0x96, + OV7725_PID = 0x77, + OV2640_PID = 0x26, + OV3660_PID = 0x3660, + OV5640_PID = 0x5640, + OV7670_PID = 0x76, + NT99141_PID = 0x1410, + GC2145_PID = 0x2145, + GC032A_PID = 0x232a, + GC0308_PID = 0x9b, +} camera_pid_t; + +typedef enum { + CAMERA_OV7725, + CAMERA_OV2640, + CAMERA_OV3660, + CAMERA_OV5640, + CAMERA_OV7670, + CAMERA_NT99141, + CAMERA_GC2145, + CAMERA_GC032A, + CAMERA_GC0308, + CAMERA_MODEL_MAX, + CAMERA_NONE, +} camera_model_t; + +typedef enum { + OV2640_SCCB_ADDR = 0x30,// 0x60 >> 1 + OV5640_SCCB_ADDR = 0x3C,// 0x78 >> 1 + OV3660_SCCB_ADDR = 0x3C,// 0x78 >> 1 + OV7725_SCCB_ADDR = 0x21,// 0x42 >> 1 + OV7670_SCCB_ADDR = 0x21,// 0x42 >> 1 + NT99141_SCCB_ADDR = 0x2A,// 0x54 >> 1 + GC2145_SCCB_ADDR = 0x3C,// 0x78 >> 1 + GC032A_SCCB_ADDR = 0x21,// 0x42 >> 1 + GC0308_SCCB_ADDR = 0x21,// 0x42 >> 1 +} camera_sccb_addr_t; + +typedef enum { + PIXFORMAT_RGB565, // 2BPP/RGB565 + PIXFORMAT_YUV422, // 2BPP/YUV422 + PIXFORMAT_GRAYSCALE, // 1BPP/GRAYSCALE + PIXFORMAT_JPEG, // JPEG/COMPRESSED + PIXFORMAT_RGB888, // 3BPP/RGB888 + PIXFORMAT_RAW, // RAW + PIXFORMAT_RGB444, // 3BP2P/RGB444 + PIXFORMAT_RGB555, // 3BP2P/RGB555 +} pixformat_t; + +typedef enum { + FRAMESIZE_96X96, // 96x96 + FRAMESIZE_QQVGA, // 160x120 + FRAMESIZE_QCIF, // 176x144 + FRAMESIZE_HQVGA, // 240x176 + FRAMESIZE_240X240, // 240x240 + FRAMESIZE_QVGA, // 320x240 + FRAMESIZE_CIF, // 400x296 + FRAMESIZE_HVGA, // 480x320 + FRAMESIZE_VGA, // 640x480 + FRAMESIZE_SVGA, // 800x600 + FRAMESIZE_XGA, // 1024x768 + FRAMESIZE_HD, // 1280x720 + FRAMESIZE_SXGA, // 1280x1024 + FRAMESIZE_UXGA, // 1600x1200 + // 3MP Sensors + FRAMESIZE_FHD, // 1920x1080 + FRAMESIZE_P_HD, // 720x1280 + FRAMESIZE_P_3MP, // 864x1536 + FRAMESIZE_QXGA, // 2048x1536 + // 5MP Sensors + FRAMESIZE_QHD, // 2560x1440 + FRAMESIZE_WQXGA, // 2560x1600 + FRAMESIZE_P_FHD, // 1080x1920 + FRAMESIZE_QSXGA, // 2560x1920 + FRAMESIZE_INVALID +} framesize_t; + +typedef struct { + const camera_model_t model; + const char *name; + const camera_sccb_addr_t sccb_addr; + const camera_pid_t pid; + const framesize_t max_size; + const bool support_jpeg; +} camera_sensor_info_t; + +typedef enum { + ASPECT_RATIO_4X3, + ASPECT_RATIO_3X2, + ASPECT_RATIO_16X10, + ASPECT_RATIO_5X3, + ASPECT_RATIO_16X9, + ASPECT_RATIO_21X9, + ASPECT_RATIO_5X4, + ASPECT_RATIO_1X1, + ASPECT_RATIO_9X16 +} aspect_ratio_t; + +typedef enum { + GAINCEILING_2X, + GAINCEILING_4X, + GAINCEILING_8X, + GAINCEILING_16X, + GAINCEILING_32X, + GAINCEILING_64X, + GAINCEILING_128X, +} gainceiling_t; + +typedef struct { + uint16_t max_width; + uint16_t max_height; + uint16_t start_x; + uint16_t start_y; + uint16_t end_x; + uint16_t end_y; + uint16_t offset_x; + uint16_t offset_y; + uint16_t total_x; + uint16_t total_y; +} ratio_settings_t; + +typedef struct { + const uint16_t width; + const uint16_t height; + const aspect_ratio_t aspect_ratio; +} resolution_info_t; + +// Resolution table (in sensor.c) +extern const resolution_info_t resolution[]; +// camera sensor table (in sensor.c) +extern const camera_sensor_info_t camera_sensor[]; + +typedef struct { + uint8_t MIDH; + uint8_t MIDL; + uint16_t PID; + uint8_t VER; +} sensor_id_t; + +typedef struct { + framesize_t framesize;//0 - 10 + bool scale; + bool binning; + uint8_t quality;//0 - 63 + int8_t brightness;//-2 - 2 + int8_t contrast;//-2 - 2 + int8_t saturation;//-2 - 2 + int8_t sharpness;//-2 - 2 + uint8_t denoise; + uint8_t special_effect;//0 - 6 + uint8_t wb_mode;//0 - 4 + uint8_t awb; + uint8_t awb_gain; + uint8_t aec; + uint8_t aec2; + int8_t ae_level;//-2 - 2 + uint16_t aec_value;//0 - 1200 + uint8_t agc; + uint8_t agc_gain;//0 - 30 + uint8_t gainceiling;//0 - 6 + uint8_t bpc; + uint8_t wpc; + uint8_t raw_gma; + uint8_t lenc; + uint8_t hmirror; + uint8_t vflip; + uint8_t dcw; + uint8_t colorbar; +} camera_status_t; + +typedef struct _sensor sensor_t; +typedef struct _sensor { + sensor_id_t id; // Sensor ID. + uint8_t slv_addr; // Sensor I2C slave address. + pixformat_t pixformat; + camera_status_t status; + int xclk_freq_hz; + + // Sensor function pointers + int (*init_status) (sensor_t *sensor); + int (*reset) (sensor_t *sensor); + int (*set_pixformat) (sensor_t *sensor, pixformat_t pixformat); + int (*set_framesize) (sensor_t *sensor, framesize_t framesize); + int (*set_contrast) (sensor_t *sensor, int level); + int (*set_brightness) (sensor_t *sensor, int level); + int (*set_saturation) (sensor_t *sensor, int level); + int (*set_sharpness) (sensor_t *sensor, int level); + int (*set_denoise) (sensor_t *sensor, int level); + int (*set_gainceiling) (sensor_t *sensor, gainceiling_t gainceiling); + int (*set_quality) (sensor_t *sensor, int quality); + int (*set_colorbar) (sensor_t *sensor, int enable); + int (*set_whitebal) (sensor_t *sensor, int enable); + int (*set_gain_ctrl) (sensor_t *sensor, int enable); + int (*set_exposure_ctrl) (sensor_t *sensor, int enable); + int (*set_hmirror) (sensor_t *sensor, int enable); + int (*set_vflip) (sensor_t *sensor, int enable); + + int (*set_aec2) (sensor_t *sensor, int enable); + int (*set_awb_gain) (sensor_t *sensor, int enable); + int (*set_agc_gain) (sensor_t *sensor, int gain); + int (*set_aec_value) (sensor_t *sensor, int gain); + + int (*set_special_effect) (sensor_t *sensor, int effect); + int (*set_wb_mode) (sensor_t *sensor, int mode); + int (*set_ae_level) (sensor_t *sensor, int level); + + int (*set_dcw) (sensor_t *sensor, int enable); + int (*set_bpc) (sensor_t *sensor, int enable); + int (*set_wpc) (sensor_t *sensor, int enable); + + int (*set_raw_gma) (sensor_t *sensor, int enable); + int (*set_lenc) (sensor_t *sensor, int enable); + + int (*get_reg) (sensor_t *sensor, int reg, int mask); + int (*set_reg) (sensor_t *sensor, int reg, int mask, int value); + int (*set_res_raw) (sensor_t *sensor, int startX, int startY, int endX, int endY, int offsetX, int offsetY, int totalX, int totalY, int outputX, int outputY, bool scale, bool binning); + int (*set_pll) (sensor_t *sensor, int bypass, int mul, int sys, int root, int pre, int seld5, int pclken, int pclk); + int (*set_xclk) (sensor_t *sensor, int timer, int xclk); +} sensor_t; + +camera_sensor_info_t *esp_camera_sensor_get_info(sensor_id_t *id); + +#ifdef __cplusplus +} +#endif + +#endif /* __SENSOR_H__ */ diff --git a/lib/libesp32_div/esp32-camera/driver/private_include/cam_hal.h b/lib/libesp32_div/esp32-camera/driver/private_include/cam_hal.h new file mode 100644 index 000000000..c8e38ed47 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/driver/private_include/cam_hal.h @@ -0,0 +1,60 @@ +// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "esp_camera.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Uninitialize the lcd_cam module + * + * @param handle Provide handle pointer to release resources + * + * @return + * - ESP_OK Success + * - ESP_FAIL Uninitialize fail + */ +esp_err_t cam_deinit(void); + +/** + * @brief Initialize the lcd_cam module + * + * @param config Configurations - see lcd_cam_config_t struct + * + * @return + * - ESP_OK Success + * - ESP_ERR_INVALID_ARG Parameter error + * - ESP_ERR_NO_MEM No memory to initialize lcd_cam + * - ESP_FAIL Initialize fail + */ +esp_err_t cam_init(const camera_config_t *config); + +esp_err_t cam_config(const camera_config_t *config, framesize_t frame_size, uint16_t sensor_pid); + +void cam_stop(void); + +void cam_start(void); + +camera_fb_t *cam_take(TickType_t timeout); + +void cam_give(camera_fb_t *dma_buffer); + +#ifdef __cplusplus +} +#endif diff --git a/lib/libesp32_div/esp32-camera/driver/private_include/sccb.h b/lib/libesp32_div/esp32-camera/driver/private_include/sccb.h new file mode 100644 index 000000000..ace081a48 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/driver/private_include/sccb.h @@ -0,0 +1,19 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * SCCB (I2C like) driver. + * + */ +#ifndef __SCCB_H__ +#define __SCCB_H__ +#include +int SCCB_Init(int pin_sda, int pin_scl); +int SCCB_Deinit(void); +uint8_t SCCB_Probe(); +uint8_t SCCB_Read(uint8_t slv_addr, uint8_t reg); +uint8_t SCCB_Write(uint8_t slv_addr, uint8_t reg, uint8_t data); +uint8_t SCCB_Read16(uint8_t slv_addr, uint16_t reg); +uint8_t SCCB_Write16(uint8_t slv_addr, uint16_t reg, uint8_t data); +#endif // __SCCB_H__ diff --git a/lib/libesp32_div/esp32-camera/driver/private_include/xclk.h b/lib/libesp32_div/esp32-camera/driver/private_include/xclk.h new file mode 100644 index 000000000..3d721a613 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/driver/private_include/xclk.h @@ -0,0 +1,9 @@ +#pragma once + +#include "esp_system.h" + +esp_err_t xclk_timer_conf(int ledc_timer, int xclk_freq_hz); + +esp_err_t camera_enable_out_clock(); + +void camera_disable_out_clock(); diff --git a/lib/libesp32_div/esp32-camera/driver/sccb.c b/lib/libesp32_div/esp32-camera/driver/sccb.c new file mode 100644 index 000000000..1a2c56e23 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/driver/sccb.c @@ -0,0 +1,184 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * SCCB (I2C like) driver. + * + */ +#include +#include +#include +#include +#include "sccb.h" +#include "sensor.h" +#include +#include "sdkconfig.h" +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#else +#include "esp_log.h" +static const char* TAG = "sccb"; +#endif + +#define LITTLETOBIG(x) ((x<<8)|(x>>8)) + +#include "driver/i2c.h" + +#define SCCB_FREQ 100000 /*!< I2C master frequency*/ +#define WRITE_BIT I2C_MASTER_WRITE /*!< I2C master write */ +#define READ_BIT I2C_MASTER_READ /*!< I2C master read */ +#define ACK_CHECK_EN 0x1 /*!< I2C master will check ack from slave*/ +#define ACK_CHECK_DIS 0x0 /*!< I2C master will not check ack from slave */ +#define ACK_VAL 0x0 /*!< I2C ack value */ +#define NACK_VAL 0x1 /*!< I2C nack value */ +#if CONFIG_SCCB_HARDWARE_I2C_PORT1 +const int SCCB_I2C_PORT = 1; +#else +const int SCCB_I2C_PORT = 0; +#endif + +int SCCB_Init(int pin_sda, int pin_scl) +{ + ESP_LOGI(TAG, "pin_sda %d pin_scl %d", pin_sda, pin_scl); + i2c_config_t conf; + memset(&conf, 0, sizeof(i2c_config_t)); + conf.mode = I2C_MODE_MASTER; + conf.sda_io_num = pin_sda; + conf.sda_pullup_en = GPIO_PULLUP_ENABLE; + conf.scl_io_num = pin_scl; + conf.scl_pullup_en = GPIO_PULLUP_ENABLE; + conf.master.clk_speed = SCCB_FREQ; + + i2c_param_config(SCCB_I2C_PORT, &conf); + i2c_driver_install(SCCB_I2C_PORT, conf.mode, 0, 0, 0); + return 0; +} + +int SCCB_Deinit(void) +{ + return i2c_driver_delete(SCCB_I2C_PORT); +} + +uint8_t SCCB_Probe(void) +{ + uint8_t slave_addr = 0x0; + // for (size_t i = 1; i < 0x80; i++) { + // i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + // i2c_master_start(cmd); + // i2c_master_write_byte(cmd, ( i << 1 ) | WRITE_BIT, ACK_CHECK_EN); + // i2c_master_stop(cmd); + // esp_err_t ret = i2c_master_cmd_begin(SCCB_I2C_PORT, cmd, 1000 / portTICK_RATE_MS); + // i2c_cmd_link_delete(cmd); + // if( ret == ESP_OK) { + // ESP_LOGW(TAG, "Found I2C Device at 0x%02X", i); + // } + // } + for (size_t i = 0; i < CAMERA_MODEL_MAX; i++) { + if (slave_addr == camera_sensor[i].sccb_addr) { + continue; + } + slave_addr = camera_sensor[i].sccb_addr; + i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + i2c_master_start(cmd); + i2c_master_write_byte(cmd, ( slave_addr << 1 ) | WRITE_BIT, ACK_CHECK_EN); + i2c_master_stop(cmd); + esp_err_t ret = i2c_master_cmd_begin(SCCB_I2C_PORT, cmd, 1000 / portTICK_RATE_MS); + i2c_cmd_link_delete(cmd); + if( ret == ESP_OK) { + return slave_addr; + } + } + return 0; +} + +uint8_t SCCB_Read(uint8_t slv_addr, uint8_t reg) +{ + uint8_t data=0; + esp_err_t ret = ESP_FAIL; + i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + i2c_master_start(cmd); + i2c_master_write_byte(cmd, ( slv_addr << 1 ) | WRITE_BIT, ACK_CHECK_EN); + i2c_master_write_byte(cmd, reg, ACK_CHECK_EN); + i2c_master_stop(cmd); + ret = i2c_master_cmd_begin(SCCB_I2C_PORT, cmd, 1000 / portTICK_RATE_MS); + i2c_cmd_link_delete(cmd); + if(ret != ESP_OK) return -1; + cmd = i2c_cmd_link_create(); + i2c_master_start(cmd); + i2c_master_write_byte(cmd, ( slv_addr << 1 ) | READ_BIT, ACK_CHECK_EN); + i2c_master_read_byte(cmd, &data, NACK_VAL); + i2c_master_stop(cmd); + ret = i2c_master_cmd_begin(SCCB_I2C_PORT, cmd, 1000 / portTICK_RATE_MS); + i2c_cmd_link_delete(cmd); + if(ret != ESP_OK) { + ESP_LOGE(TAG, "SCCB_Read Failed addr:0x%02x, reg:0x%02x, data:0x%02x, ret:%d", slv_addr, reg, data, ret); + } + return data; +} + +uint8_t SCCB_Write(uint8_t slv_addr, uint8_t reg, uint8_t data) +{ + esp_err_t ret = ESP_FAIL; + i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + i2c_master_start(cmd); + i2c_master_write_byte(cmd, ( slv_addr << 1 ) | WRITE_BIT, ACK_CHECK_EN); + i2c_master_write_byte(cmd, reg, ACK_CHECK_EN); + i2c_master_write_byte(cmd, data, ACK_CHECK_EN); + i2c_master_stop(cmd); + ret = i2c_master_cmd_begin(SCCB_I2C_PORT, cmd, 1000 / portTICK_RATE_MS); + i2c_cmd_link_delete(cmd); + if(ret != ESP_OK) { + ESP_LOGE(TAG, "SCCB_Write Failed addr:0x%02x, reg:0x%02x, data:0x%02x, ret:%d", slv_addr, reg, data, ret); + } + return ret == ESP_OK ? 0 : -1; +} + +uint8_t SCCB_Read16(uint8_t slv_addr, uint16_t reg) +{ + uint8_t data=0; + esp_err_t ret = ESP_FAIL; + uint16_t reg_htons = LITTLETOBIG(reg); + uint8_t *reg_u8 = (uint8_t *)®_htons; + i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + i2c_master_start(cmd); + i2c_master_write_byte(cmd, ( slv_addr << 1 ) | WRITE_BIT, ACK_CHECK_EN); + i2c_master_write_byte(cmd, reg_u8[0], ACK_CHECK_EN); + i2c_master_write_byte(cmd, reg_u8[1], ACK_CHECK_EN); + i2c_master_stop(cmd); + ret = i2c_master_cmd_begin(SCCB_I2C_PORT, cmd, 1000 / portTICK_RATE_MS); + i2c_cmd_link_delete(cmd); + if(ret != ESP_OK) return -1; + cmd = i2c_cmd_link_create(); + i2c_master_start(cmd); + i2c_master_write_byte(cmd, ( slv_addr << 1 ) | READ_BIT, ACK_CHECK_EN); + i2c_master_read_byte(cmd, &data, NACK_VAL); + i2c_master_stop(cmd); + ret = i2c_master_cmd_begin(SCCB_I2C_PORT, cmd, 1000 / portTICK_RATE_MS); + i2c_cmd_link_delete(cmd); + if(ret != ESP_OK) { + ESP_LOGE(TAG, "W [%04x]=%02x fail\n", reg, data); + } + return data; +} + +uint8_t SCCB_Write16(uint8_t slv_addr, uint16_t reg, uint8_t data) +{ + static uint16_t i = 0; + esp_err_t ret = ESP_FAIL; + uint16_t reg_htons = LITTLETOBIG(reg); + uint8_t *reg_u8 = (uint8_t *)®_htons; + i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + i2c_master_start(cmd); + i2c_master_write_byte(cmd, ( slv_addr << 1 ) | WRITE_BIT, ACK_CHECK_EN); + i2c_master_write_byte(cmd, reg_u8[0], ACK_CHECK_EN); + i2c_master_write_byte(cmd, reg_u8[1], ACK_CHECK_EN); + i2c_master_write_byte(cmd, data, ACK_CHECK_EN); + i2c_master_stop(cmd); + ret = i2c_master_cmd_begin(SCCB_I2C_PORT, cmd, 1000 / portTICK_RATE_MS); + i2c_cmd_link_delete(cmd); + if(ret != ESP_OK) { + ESP_LOGE(TAG, "W [%04x]=%02x %d fail\n", reg, data, i++); + } + return ret == ESP_OK ? 0 : -1; +} diff --git a/lib/libesp32_div/esp32-camera/driver/sensor.c b/lib/libesp32_div/esp32-camera/driver/sensor.c new file mode 100644 index 000000000..7ebd7af21 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/driver/sensor.c @@ -0,0 +1,52 @@ +#include +#include "sensor.h" + +const camera_sensor_info_t camera_sensor[CAMERA_MODEL_MAX] = { + // The sequence must be consistent with camera_model_t + {CAMERA_OV7725, "OV7725", OV7725_SCCB_ADDR, OV7725_PID, FRAMESIZE_VGA, false}, + {CAMERA_OV2640, "OV2640", OV2640_SCCB_ADDR, OV2640_PID, FRAMESIZE_UXGA, true}, + {CAMERA_OV3660, "OV3660", OV3660_SCCB_ADDR, OV3660_PID, FRAMESIZE_QXGA, true}, + {CAMERA_OV5640, "OV5640", OV5640_SCCB_ADDR, OV5640_PID, FRAMESIZE_QSXGA, true}, + {CAMERA_OV7670, "OV7670", OV7670_SCCB_ADDR, OV7670_PID, FRAMESIZE_VGA, false}, + {CAMERA_NT99141, "NT99141", NT99141_SCCB_ADDR, NT99141_PID, FRAMESIZE_HD, true}, + {CAMERA_GC2145, "GC2145", GC2145_SCCB_ADDR, GC2145_PID, FRAMESIZE_UXGA, false}, + {CAMERA_GC032A, "GC032A", GC032A_SCCB_ADDR, GC032A_PID, FRAMESIZE_VGA, false}, + {CAMERA_GC0308, "GC0308", GC0308_SCCB_ADDR, GC0308_PID, FRAMESIZE_VGA, false}, +}; + +const resolution_info_t resolution[FRAMESIZE_INVALID] = { + { 96, 96, ASPECT_RATIO_1X1 }, /* 96x96 */ + { 160, 120, ASPECT_RATIO_4X3 }, /* QQVGA */ + { 176, 144, ASPECT_RATIO_5X4 }, /* QCIF */ + { 240, 176, ASPECT_RATIO_4X3 }, /* HQVGA */ + { 240, 240, ASPECT_RATIO_1X1 }, /* 240x240 */ + { 320, 240, ASPECT_RATIO_4X3 }, /* QVGA */ + { 400, 296, ASPECT_RATIO_4X3 }, /* CIF */ + { 480, 320, ASPECT_RATIO_3X2 }, /* HVGA */ + { 640, 480, ASPECT_RATIO_4X3 }, /* VGA */ + { 800, 600, ASPECT_RATIO_4X3 }, /* SVGA */ + { 1024, 768, ASPECT_RATIO_4X3 }, /* XGA */ + { 1280, 720, ASPECT_RATIO_16X9 }, /* HD */ + { 1280, 1024, ASPECT_RATIO_5X4 }, /* SXGA */ + { 1600, 1200, ASPECT_RATIO_4X3 }, /* UXGA */ + // 3MP Sensors + { 1920, 1080, ASPECT_RATIO_16X9 }, /* FHD */ + { 720, 1280, ASPECT_RATIO_9X16 }, /* Portrait HD */ + { 864, 1536, ASPECT_RATIO_9X16 }, /* Portrait 3MP */ + { 2048, 1536, ASPECT_RATIO_4X3 }, /* QXGA */ + // 5MP Sensors + { 2560, 1440, ASPECT_RATIO_16X9 }, /* QHD */ + { 2560, 1600, ASPECT_RATIO_16X10 }, /* WQXGA */ + { 1088, 1920, ASPECT_RATIO_9X16 }, /* Portrait FHD */ + { 2560, 1920, ASPECT_RATIO_4X3 }, /* QSXGA */ +}; + +camera_sensor_info_t *esp_camera_sensor_get_info(sensor_id_t *id) +{ + for (int i = 0; i < CAMERA_MODEL_MAX; i++) { + if (id->PID == camera_sensor[i].pid) { + return (camera_sensor_info_t *)&camera_sensor[i]; + } + } + return NULL; +} diff --git a/lib/libesp32_div/esp32-camera/examples/CMakeLists.txt b/lib/libesp32_div/esp32-camera/examples/CMakeLists.txt new file mode 100644 index 000000000..0a0396884 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/examples/CMakeLists.txt @@ -0,0 +1,9 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +set(EXTRA_COMPONENT_DIRS "../") + +add_compile_options(-fdiagnostics-color=always) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(camera_example) \ No newline at end of file diff --git a/lib/libesp32_div/esp32-camera/examples/Makefile b/lib/libesp32_div/esp32-camera/examples/Makefile new file mode 100644 index 000000000..f06df0ecc --- /dev/null +++ b/lib/libesp32_div/esp32-camera/examples/Makefile @@ -0,0 +1,11 @@ +# +# This is a project Makefile. It is assumed the directory this Makefile resides in is a +# project subdirectory. +# + +PROJECT_NAME := camera_example + +EXTRA_COMPONENT_DIRS := ../ + +include $(IDF_PATH)/make/project.mk + diff --git a/lib/libesp32_div/esp32-camera/examples/main/CMakeLists.txt b/lib/libesp32_div/esp32-camera/examples/main/CMakeLists.txt new file mode 100644 index 000000000..1735fb184 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/examples/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS take_picture.c) +set(COMPONENT_ADD_INCLUDEDIRS .) +register_component() \ No newline at end of file diff --git a/lib/libesp32_div/esp32-camera/examples/main/component.mk b/lib/libesp32_div/esp32-camera/examples/main/component.mk new file mode 100644 index 000000000..0b9d7585e --- /dev/null +++ b/lib/libesp32_div/esp32-camera/examples/main/component.mk @@ -0,0 +1,5 @@ +# +# "main" pseudo-component makefile. +# +# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) + diff --git a/lib/libesp32_div/esp32-camera/examples/main/take_picture.c b/lib/libesp32_div/esp32-camera/examples/main/take_picture.c new file mode 100644 index 000000000..1cbad908b --- /dev/null +++ b/lib/libesp32_div/esp32-camera/examples/main/take_picture.c @@ -0,0 +1,155 @@ +/** + * This example takes a picture every 5s and print its size on serial monitor. + */ + +// =============================== SETUP ====================================== + +// 1. Board setup (Uncomment): +// #define BOARD_WROVER_KIT +// #define BOARD_ESP32CAM_AITHINKER + +/** + * 2. Kconfig setup + * + * If you have a Kconfig file, copy the content from + * https://github.com/espressif/esp32-camera/blob/master/Kconfig into it. + * In case you haven't, copy and paste this Kconfig file inside the src directory. + * This Kconfig file has definitions that allows more control over the camera and + * how it will be initialized. + */ + +/** + * 3. Enable PSRAM on sdkconfig: + * + * CONFIG_ESP32_SPIRAM_SUPPORT=y + * + * More info on + * https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig.html#config-esp32-spiram-support + */ + +// ================================ CODE ====================================== + +#include +#include +#include +#include +#include + +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + +#include "esp_camera.h" + +#define BOARD_WROVER_KIT 1 + +// WROVER-KIT PIN Map +#ifdef BOARD_WROVER_KIT + +#define CAM_PIN_PWDN -1 //power down is not used +#define CAM_PIN_RESET -1 //software reset will be performed +#define CAM_PIN_XCLK 21 +#define CAM_PIN_SIOD 26 +#define CAM_PIN_SIOC 27 + +#define CAM_PIN_D7 35 +#define CAM_PIN_D6 34 +#define CAM_PIN_D5 39 +#define CAM_PIN_D4 36 +#define CAM_PIN_D3 19 +#define CAM_PIN_D2 18 +#define CAM_PIN_D1 5 +#define CAM_PIN_D0 4 +#define CAM_PIN_VSYNC 25 +#define CAM_PIN_HREF 23 +#define CAM_PIN_PCLK 22 + +#endif + +// ESP32Cam (AiThinker) PIN Map +#ifdef BOARD_ESP32CAM_AITHINKER + +#define CAM_PIN_PWDN 32 +#define CAM_PIN_RESET -1 //software reset will be performed +#define CAM_PIN_XCLK 0 +#define CAM_PIN_SIOD 26 +#define CAM_PIN_SIOC 27 + +#define CAM_PIN_D7 35 +#define CAM_PIN_D6 34 +#define CAM_PIN_D5 39 +#define CAM_PIN_D4 36 +#define CAM_PIN_D3 21 +#define CAM_PIN_D2 19 +#define CAM_PIN_D1 18 +#define CAM_PIN_D0 5 +#define CAM_PIN_VSYNC 25 +#define CAM_PIN_HREF 23 +#define CAM_PIN_PCLK 22 + +#endif + +static const char *TAG = "example:take_picture"; + +static camera_config_t camera_config = { + .pin_pwdn = CAM_PIN_PWDN, + .pin_reset = CAM_PIN_RESET, + .pin_xclk = CAM_PIN_XCLK, + .pin_sscb_sda = CAM_PIN_SIOD, + .pin_sscb_scl = CAM_PIN_SIOC, + + .pin_d7 = CAM_PIN_D7, + .pin_d6 = CAM_PIN_D6, + .pin_d5 = CAM_PIN_D5, + .pin_d4 = CAM_PIN_D4, + .pin_d3 = CAM_PIN_D3, + .pin_d2 = CAM_PIN_D2, + .pin_d1 = CAM_PIN_D1, + .pin_d0 = CAM_PIN_D0, + .pin_vsync = CAM_PIN_VSYNC, + .pin_href = CAM_PIN_HREF, + .pin_pclk = CAM_PIN_PCLK, + + //XCLK 20MHz or 10MHz for OV2640 double FPS (Experimental) + .xclk_freq_hz = 20000000, + .ledc_timer = LEDC_TIMER_0, + .ledc_channel = LEDC_CHANNEL_0, + + .pixel_format = PIXFORMAT_RGB565, //YUV422,GRAYSCALE,RGB565,JPEG + .frame_size = FRAMESIZE_QVGA, //QQVGA-UXGA Do not use sizes above QVGA when not JPEG + + .jpeg_quality = 12, //0-63 lower number means higher quality + .fb_count = 1, //if more than one, i2s runs in continuous mode. Use only with JPEG + .grab_mode = CAMERA_GRAB_WHEN_EMPTY, +}; + +static esp_err_t init_camera() +{ + //initialize the camera + esp_err_t err = esp_camera_init(&camera_config); + if (err != ESP_OK) + { + ESP_LOGE(TAG, "Camera Init Failed"); + return err; + } + + return ESP_OK; +} + +void app_main() +{ + if(ESP_OK != init_camera()) { + return; + } + + while (1) + { + ESP_LOGI(TAG, "Taking picture..."); + camera_fb_t *pic = esp_camera_fb_get(); + + // use pic->buf to access the image + ESP_LOGI(TAG, "Picture taken! Its size was: %zu bytes", pic->len); + esp_camera_fb_return(pic); + + vTaskDelay(5000 / portTICK_RATE_MS); + } +} diff --git a/lib/libesp32_div/esp32-camera/examples/sdkconfig.defaults b/lib/libesp32_div/esp32-camera/examples/sdkconfig.defaults new file mode 100644 index 000000000..e5ac4557a --- /dev/null +++ b/lib/libesp32_div/esp32-camera/examples/sdkconfig.defaults @@ -0,0 +1,17 @@ +CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y + +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_PARTITION_TABLE_OFFSET=0x10000 + +CONFIG_FREERTOS_HZ=1000 +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y + +CONFIG_SPIRAM_SUPPORT=y +CONFIG_ESP32_SPIRAM_SUPPORT=y +CONFIG_ESP32S2_SPIRAM_SUPPORT=y +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +CONFIG_SPIRAM_SPEED_80M=y + diff --git a/lib/libesp32_div/esp32-camera/library.json b/lib/libesp32_div/esp32-camera/library.json new file mode 100644 index 000000000..2147a3908 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/library.json @@ -0,0 +1,26 @@ +{ + "name": "esp32-camera", + "version": "1.0.0", + "keywords": "esp32, camera, espressif, esp32-cam", + "description": "ESP32 compatible driver for OV2640, OV3660, OV5640, OV7670 and OV7725 image sensors.", + "repository": { + "type": "git", + "url": "https://github.com/espressif/esp32-camera" + }, + "frameworks": "*", + "platforms": "*", + "build": { + "flags": [ + "-Idriver/include", + "-Iconversions/include", + "-Idriver/private_include", + "-Iconversions/private_include", + "-Isensors/private_include", + "-Itarget/private_include", + "-fno-rtti" + ], + "includeDir": ".", + "srcDir": ".", + "srcFilter": ["-<*>", "+", "+", "+"] + } +} diff --git a/lib/libesp32_div/esp32-camera/sensors/gc0308.c b/lib/libesp32_div/esp32-camera/sensors/gc0308.c new file mode 100644 index 000000000..19064d3a7 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/gc0308.c @@ -0,0 +1,465 @@ +// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "sccb.h" +#include "gc0308.h" +#include "gc0308_regs.h" +#include "gc0308_settings.h" + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#else +#include "esp_log.h" +static const char *TAG = "gc0308"; +#endif + +#define H8(v) ((v)>>8) +#define L8(v) ((v)&0xff) + +//#define REG_DEBUG_ON + +static int read_reg(uint8_t slv_addr, const uint16_t reg) +{ + int ret = SCCB_Read(slv_addr, reg); +#ifdef REG_DEBUG_ON + if (ret < 0) { + ESP_LOGE(TAG, "READ REG 0x%04x FAILED: %d", reg, ret); + } +#endif + return ret; +} + +static int write_reg(uint8_t slv_addr, const uint16_t reg, uint8_t value) +{ + int ret = 0; +#ifndef REG_DEBUG_ON + ret = SCCB_Write(slv_addr, reg, value); +#else + int old_value = read_reg(slv_addr, reg); + if (old_value < 0) { + return old_value; + } + if ((uint8_t)old_value != value) { + ESP_LOGI(TAG, "NEW REG 0x%04x: 0x%02x to 0x%02x", reg, (uint8_t)old_value, value); + ret = SCCB_Write(slv_addr, reg, value); + } else { + ESP_LOGD(TAG, "OLD REG 0x%04x: 0x%02x", reg, (uint8_t)old_value); + ret = SCCB_Write(slv_addr, reg, value);//maybe not? + } + if (ret < 0) { + ESP_LOGE(TAG, "WRITE REG 0x%04x FAILED: %d", reg, ret); + } +#endif + return ret; +} + +static int check_reg_mask(uint8_t slv_addr, uint16_t reg, uint8_t mask) +{ + return (read_reg(slv_addr, reg) & mask) == mask; +} + +static int set_reg_bits(uint8_t slv_addr, uint16_t reg, uint8_t offset, uint8_t mask, uint8_t value) +{ + int ret = 0; + uint8_t c_value, new_value; + ret = read_reg(slv_addr, reg); + if (ret < 0) { + return ret; + } + c_value = ret; + new_value = (c_value & ~(mask << offset)) | ((value & mask) << offset); + ret = write_reg(slv_addr, reg, new_value); + return ret; +} + +static int write_regs(uint8_t slv_addr, const uint16_t (*regs)[2]) +{ + int i = 0, ret = 0; + while (!ret && regs[i][0] != REGLIST_TAIL) { + if (regs[i][0] == REG_DLY) { + vTaskDelay(regs[i][1] / portTICK_PERIOD_MS); + } else { + ret = write_reg(slv_addr, regs[i][0], regs[i][1]); + } + i++; + } + return ret; +} + +static void print_regs(uint8_t slv_addr) +{ +#ifdef DEBUG_PRINT_REG + ESP_LOGI(TAG, "REG list look ======================"); + for (size_t i = 0xf0; i <= 0xfe; i++) { + ESP_LOGI(TAG, "reg[0x%02x] = 0x%02x", i, read_reg(slv_addr, i)); + } + ESP_LOGI(TAG, "\npage 0 ==="); + write_reg(slv_addr, 0xfe, 0x00); // page 0 + for (size_t i = 0x03; i <= 0xa2; i++) { + ESP_LOGI(TAG, "p0 reg[0x%02x] = 0x%02x", i, read_reg(slv_addr, i)); + } + + ESP_LOGI(TAG, "\npage 3 ==="); + write_reg(slv_addr, 0xfe, 0x03); // page 3 + for (size_t i = 0x01; i <= 0x43; i++) { + ESP_LOGI(TAG, "p3 reg[0x%02x] = 0x%02x", i, read_reg(slv_addr, i)); + } +#endif +} + +static int reset(sensor_t *sensor) +{ + int ret = 0; + // Software Reset: clear all registers and reset them to their default values + ret = write_reg(sensor->slv_addr, RESET_RELATED, 0xf0); + if (ret) { + ESP_LOGE(TAG, "Software Reset FAILED!"); + return ret; + } + vTaskDelay(100 / portTICK_PERIOD_MS); + ret = write_regs(sensor->slv_addr, gc0308_sensor_default_regs); + if (ret == 0) { + ESP_LOGD(TAG, "Camera defaults loaded"); + vTaskDelay(100 / portTICK_PERIOD_MS); + write_reg(sensor->slv_addr, 0xfe, 0x00); +#ifdef CONFIG_IDF_TARGET_ESP32 + set_reg_bits(sensor->slv_addr, 0x28, 4, 0x07, 1); //frequency division for esp32, ensure pclk <= 15MHz +#endif + } + return ret; +} + +static int set_pixformat(sensor_t *sensor, pixformat_t pixformat) +{ + int ret = 0; + + switch (pixformat) { + case PIXFORMAT_RGB565: + write_reg(sensor->slv_addr, 0xfe, 0x00); + ret = set_reg_bits(sensor->slv_addr, 0x24, 0, 0x0f, 6); //RGB565 + break; + + case PIXFORMAT_YUV422: + write_reg(sensor->slv_addr, 0xfe, 0x00); + ret = set_reg_bits(sensor->slv_addr, 0x24, 0, 0x0f, 2); //yuv422 Y Cb Y Cr + break; + default: + ESP_LOGW(TAG, "unsupport format"); + ret = -1; + break; + } + + if (ret == 0) { + sensor->pixformat = pixformat; + ESP_LOGD(TAG, "Set pixformat to: %u", pixformat); + } + return ret; +} + +static int set_framesize(sensor_t *sensor, framesize_t framesize) +{ + int ret = 0; + if (framesize > FRAMESIZE_VGA) { + ESP_LOGW(TAG, "Invalid framesize: %u", framesize); + framesize = FRAMESIZE_VGA; + } + sensor->status.framesize = framesize; + uint16_t w = resolution[framesize].width; + uint16_t h = resolution[framesize].height; + uint16_t row_s = (resolution[FRAMESIZE_VGA].height - h) / 2; + uint16_t col_s = (resolution[FRAMESIZE_VGA].width - w) / 2; + +#if CONFIG_GC_SENSOR_SUBSAMPLE_MODE + struct subsample_cfg { + uint16_t ratio_numerator; + uint16_t ratio_denominator; + uint8_t reg0x54; + uint8_t reg0x56; + uint8_t reg0x57; + uint8_t reg0x58; + uint8_t reg0x59; + }; + const struct subsample_cfg subsample_cfgs[] = { // define some subsample ratio + {84, 420, 0x55, 0x00, 0x00, 0x00, 0x00}, //1/5 + {105, 420, 0x44, 0x00, 0x00, 0x00, 0x00},//1/4 + {140, 420, 0x33, 0x00, 0x00, 0x00, 0x00},//1/3 + {210, 420, 0x22, 0x00, 0x00, 0x00, 0x00},//1/2 + {240, 420, 0x77, 0x02, 0x46, 0x02, 0x46},//4/7 + {252, 420, 0x55, 0x02, 0x04, 0x02, 0x04},//3/5 + {280, 420, 0x33, 0x02, 0x00, 0x02, 0x00},//2/3 + {420, 420, 0x11, 0x00, 0x00, 0x00, 0x00},//1/1 + }; + uint16_t win_w = 640; + uint16_t win_h = 480; + const struct subsample_cfg *cfg = NULL; + /** + * Strategy: try to keep the maximum perspective + */ + for (size_t i = 0; i < sizeof(subsample_cfgs) / sizeof(struct subsample_cfg); i++) { + cfg = &subsample_cfgs[i]; + if ((win_w * cfg->ratio_numerator / cfg->ratio_denominator >= w) && (win_h * cfg->ratio_numerator / cfg->ratio_denominator >= h)) { + win_w = w * cfg->ratio_denominator / cfg->ratio_numerator; + win_h = h * cfg->ratio_denominator / cfg->ratio_numerator; + row_s = (resolution[FRAMESIZE_VGA].height - win_h) / 2; + col_s = (resolution[FRAMESIZE_VGA].width - win_w) / 2; + ESP_LOGI(TAG, "subsample win:%dx%d, ratio:%f", win_w, win_h, (float)cfg->ratio_numerator / (float)cfg->ratio_denominator); + break; + } + } + + write_reg(sensor->slv_addr, 0xfe, 0x00); + + write_reg(sensor->slv_addr, 0x05, H8(row_s)); + write_reg(sensor->slv_addr, 0x06, L8(row_s)); + write_reg(sensor->slv_addr, 0x07, H8(col_s)); + write_reg(sensor->slv_addr, 0x08, L8(col_s)); + write_reg(sensor->slv_addr, 0x09, H8(win_h + 8)); + write_reg(sensor->slv_addr, 0x0a, L8(win_h + 8)); + write_reg(sensor->slv_addr, 0x0b, H8(win_w + 8)); + write_reg(sensor->slv_addr, 0x0c, L8(win_w + 8)); + + write_reg(sensor->slv_addr, 0xfe, 0x01); + set_reg_bits(sensor->slv_addr, 0x53, 7, 0x01, 1); + set_reg_bits(sensor->slv_addr, 0x55, 0, 0x01, 1); + write_reg(sensor->slv_addr, 0x54, cfg->reg0x54); + write_reg(sensor->slv_addr, 0x56, cfg->reg0x56); + write_reg(sensor->slv_addr, 0x57, cfg->reg0x57); + write_reg(sensor->slv_addr, 0x58, cfg->reg0x58); + write_reg(sensor->slv_addr, 0x59, cfg->reg0x59); + + write_reg(sensor->slv_addr, 0xfe, 0x00); + +#elif CONFIG_GC_SENSOR_WINDOWING_MODE + write_reg(sensor->slv_addr, 0xfe, 0x00); + + write_reg(sensor->slv_addr, 0xf7, col_s / 4); + write_reg(sensor->slv_addr, 0xf8, row_s / 4); + write_reg(sensor->slv_addr, 0xf9, (col_s + h) / 4); + write_reg(sensor->slv_addr, 0xfa, (row_s + w) / 4); + + write_reg(sensor->slv_addr, 0x05, H8(row_s)); + write_reg(sensor->slv_addr, 0x06, L8(row_s)); + write_reg(sensor->slv_addr, 0x07, H8(col_s)); + write_reg(sensor->slv_addr, 0x08, L8(col_s)); + + write_reg(sensor->slv_addr, 0x09, H8(h + 8)); + write_reg(sensor->slv_addr, 0x0a, L8(h + 8)); + write_reg(sensor->slv_addr, 0x0b, H8(w + 8)); + write_reg(sensor->slv_addr, 0x0c, L8(w + 8)); + +#endif + if (ret == 0) { + ESP_LOGD(TAG, "Set framesize to: %ux%u", w, h); + } + return 0; +} + +static int set_contrast(sensor_t *sensor, int contrast) +{ + if (contrast != 0) { + write_reg(sensor->slv_addr, 0xfe, 0x00); + write_reg(sensor->slv_addr, 0xb3, contrast); + } + return 0; +} + +static int set_global_gain(sensor_t *sensor, int gain_level) +{ + if (gain_level != 0) { + write_reg(sensor->slv_addr, 0xfe, 0x00); + write_reg(sensor->slv_addr, 0x50, gain_level); + } + return 0; +} + +static int set_hmirror(sensor_t *sensor, int enable) +{ + int ret = 0; + sensor->status.hmirror = enable; + ret = write_reg(sensor->slv_addr, 0xfe, 0x00); + ret |= set_reg_bits(sensor->slv_addr, 0x14, 0, 0x01, enable != 0); + if (ret == 0) { + ESP_LOGD(TAG, "Set h-mirror to: %d", enable); + } + return ret; +} + +static int set_vflip(sensor_t *sensor, int enable) +{ + int ret = 0; + sensor->status.vflip = enable; + ret = write_reg(sensor->slv_addr, 0xfe, 0x00); + ret |= set_reg_bits(sensor->slv_addr, 0x14, 1, 0x01, enable != 0); + if (ret == 0) { + ESP_LOGD(TAG, "Set v-flip to: %d", enable); + } + return ret; +} + +static int set_colorbar(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg(sensor->slv_addr, 0xfe, 0x00); + ret |= set_reg_bits(sensor->slv_addr, 0x2e, 0, 0x01, enable); + if (ret == 0) { + sensor->status.colorbar = enable; + ESP_LOGD(TAG, "Set colorbar to: %d", enable); + } + return ret; +} + +static int get_reg(sensor_t *sensor, int reg, int mask) +{ + int ret = 0; + if (mask > 0xFF) { + ESP_LOGE(TAG, "mask should not more than 0xff"); + } else { + ret = read_reg(sensor->slv_addr, reg); + } + if (ret > 0) { + ret &= mask; + } + return ret; +} + +static int set_reg(sensor_t *sensor, int reg, int mask, int value) +{ + int ret = 0; + if (mask > 0xFF) { + ESP_LOGE(TAG, "mask should not more than 0xff"); + } else { + ret = read_reg(sensor->slv_addr, reg); + } + if (ret < 0) { + return ret; + } + value = (ret & ~mask) | (value & mask); + + if (mask > 0xFF) { + + } else { + ret = write_reg(sensor->slv_addr, reg, value); + } + return ret; +} + +static int init_status(sensor_t *sensor) +{ + write_reg(sensor->slv_addr, 0xfe, 0x00); + sensor->status.brightness = 0; + sensor->status.contrast = 0; + sensor->status.saturation = 0; + sensor->status.sharpness = 0; + sensor->status.denoise = 0; + sensor->status.ae_level = 0; + sensor->status.gainceiling = 0; + sensor->status.awb = 0; + sensor->status.dcw = 0; + sensor->status.agc = 0; + sensor->status.aec = 0; + sensor->status.hmirror = check_reg_mask(sensor->slv_addr, 0x14, 0x01); + sensor->status.vflip = check_reg_mask(sensor->slv_addr, 0x14, 0x02); + sensor->status.colorbar = 0; + sensor->status.bpc = 0; + sensor->status.wpc = 0; + sensor->status.raw_gma = 0; + sensor->status.lenc = 0; + sensor->status.quality = 0; + sensor->status.special_effect = 0; + sensor->status.wb_mode = 0; + sensor->status.awb_gain = 0; + sensor->status.agc_gain = 0; + sensor->status.aec_value = 0; + sensor->status.aec2 = 0; + + print_regs(sensor->slv_addr); + return 0; +} + +static int set_dummy(sensor_t *sensor, int val) +{ + ESP_LOGW(TAG, "Unsupported"); + return -1; +} +static int set_gainceiling_dummy(sensor_t *sensor, gainceiling_t val) +{ + ESP_LOGW(TAG, "Unsupported"); + return -1; +} + +int gc0308_detect(int slv_addr, sensor_id_t *id) +{ + if (GC0308_SCCB_ADDR == slv_addr) { + write_reg(slv_addr, 0xfe, 0x00); + uint8_t PID = SCCB_Read(slv_addr, 0x00); + if (GC0308_PID == PID) { + id->PID = PID; + return PID; + } else { + ESP_LOGI(TAG, "Mismatch PID=0x%x", PID); + } + } + return 0; +} + +int gc0308_init(sensor_t *sensor) +{ + sensor->init_status = init_status; + sensor->reset = reset; + sensor->set_pixformat = set_pixformat; + sensor->set_framesize = set_framesize; + sensor->set_contrast = set_contrast; + sensor->set_brightness = set_dummy; + sensor->set_saturation = set_dummy; + sensor->set_sharpness = set_dummy; + sensor->set_denoise = set_dummy; + sensor->set_gainceiling = set_gainceiling_dummy; + sensor->set_quality = set_dummy; + sensor->set_colorbar = set_colorbar; + sensor->set_whitebal = set_dummy; + sensor->set_gain_ctrl = set_global_gain; + sensor->set_exposure_ctrl = set_dummy; + sensor->set_hmirror = set_hmirror; + sensor->set_vflip = set_vflip; + + sensor->set_aec2 = set_dummy; + sensor->set_awb_gain = set_dummy; + sensor->set_agc_gain = set_dummy; + sensor->set_aec_value = set_dummy; + + sensor->set_special_effect = set_dummy; + sensor->set_wb_mode = set_dummy; + sensor->set_ae_level = set_dummy; + + sensor->set_dcw = set_dummy; + sensor->set_bpc = set_dummy; + sensor->set_wpc = set_dummy; + + sensor->set_raw_gma = set_dummy; + sensor->set_lenc = set_dummy; + + sensor->get_reg = get_reg; + sensor->set_reg = set_reg; + sensor->set_res_raw = NULL; + sensor->set_pll = NULL; + sensor->set_xclk = NULL; + + ESP_LOGD(TAG, "GC0308 Attached"); + return 0; +} diff --git a/lib/libesp32_div/esp32-camera/sensors/gc032a.c b/lib/libesp32_div/esp32-camera/sensors/gc032a.c new file mode 100644 index 000000000..612e17b1e --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/gc032a.c @@ -0,0 +1,391 @@ +// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "sccb.h" +#include "gc032a.h" +#include "gc032a_regs.h" +#include "gc032a_settings.h" + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#else +#include "esp_log.h" +static const char *TAG = "gc032a"; +#endif + +#define H8(v) ((v)>>8) +#define L8(v) ((v)&0xff) + +//#define REG_DEBUG_ON + +static int read_reg(uint8_t slv_addr, const uint16_t reg) +{ + int ret = SCCB_Read(slv_addr, reg); +#ifdef REG_DEBUG_ON + if (ret < 0) { + ESP_LOGE(TAG, "READ REG 0x%04x FAILED: %d", reg, ret); + } +#endif + return ret; +} + +static int write_reg(uint8_t slv_addr, const uint16_t reg, uint8_t value) +{ + int ret = 0; +#ifndef REG_DEBUG_ON + ret = SCCB_Write(slv_addr, reg, value); +#else + int old_value = read_reg(slv_addr, reg); + if (old_value < 0) { + return old_value; + } + if ((uint8_t)old_value != value) { + ESP_LOGI(TAG, "NEW REG 0x%04x: 0x%02x to 0x%02x", reg, (uint8_t)old_value, value); + ret = SCCB_Write(slv_addr, reg, value); + } else { + ESP_LOGD(TAG, "OLD REG 0x%04x: 0x%02x", reg, (uint8_t)old_value); + ret = SCCB_Write(slv_addr, reg, value);//maybe not? + } + if (ret < 0) { + ESP_LOGE(TAG, "WRITE REG 0x%04x FAILED: %d", reg, ret); + } +#endif + return ret; +} + +static int check_reg_mask(uint8_t slv_addr, uint16_t reg, uint8_t mask) +{ + return (read_reg(slv_addr, reg) & mask) == mask; +} + +static void print_regs(uint8_t slv_addr) +{ +#ifdef DEBUG_PRINT_REG + vTaskDelay(pdMS_TO_TICKS(100)); + ESP_LOGI(TAG, "REG list look ======================"); + for (size_t i = 0xf0; i <= 0xfe; i++) { + ESP_LOGI(TAG, "reg[0x%02x] = 0x%02x", i, read_reg(slv_addr, i)); + } + ESP_LOGI(TAG, "\npage 0 ==="); + write_reg(slv_addr, 0xfe, 0x00); // page 0 + for (size_t i = 0x03; i <= 0x24; i++) { + ESP_LOGI(TAG, "p0 reg[0x%02x] = 0x%02x", i, read_reg(slv_addr, i)); + } + for (size_t i = 0x40; i <= 0x95; i++) { + ESP_LOGI(TAG, "p0 reg[0x%02x] = 0x%02x", i, read_reg(slv_addr, i)); + } + ESP_LOGI(TAG, "\npage 3 ==="); + write_reg(slv_addr, 0xfe, 0x03); // page 3 + for (size_t i = 0x01; i <= 0x43; i++) { + ESP_LOGI(TAG, "p3 reg[0x%02x] = 0x%02x", i, read_reg(slv_addr, i)); + } +#endif +} + +static int set_reg_bits(uint8_t slv_addr, uint16_t reg, uint8_t offset, uint8_t mask, uint8_t value) +{ + int ret = 0; + uint8_t c_value, new_value; + ret = read_reg(slv_addr, reg); + if (ret < 0) { + return ret; + } + c_value = ret; + new_value = (c_value & ~(mask << offset)) | ((value & mask) << offset); + ret = write_reg(slv_addr, reg, new_value); + return ret; +} + +static int write_regs(uint8_t slv_addr, const uint16_t (*regs)[2]) +{ + int i = 0, ret = 0; + while (!ret && regs[i][0] != REGLIST_TAIL) { + if (regs[i][0] == REG_DLY) { + vTaskDelay(regs[i][1] / portTICK_PERIOD_MS); + } else { + ret = write_reg(slv_addr, regs[i][0], regs[i][1]); + } + i++; + } + return ret; +} + +static int reset(sensor_t *sensor) +{ + int ret; + // Software Reset: clear all registers and reset them to their default values + ret = write_reg(sensor->slv_addr, RESET_RELATED, 0xf0); + if (ret) { + ESP_LOGE(TAG, "Software Reset FAILED!"); + return ret; + } + vTaskDelay(100 / portTICK_PERIOD_MS); + + ret = write_regs(sensor->slv_addr, gc032a_default_regs); + if (ret == 0) { + ESP_LOGD(TAG, "Camera defaults loaded"); + vTaskDelay(100 / portTICK_PERIOD_MS); + write_reg(sensor->slv_addr, 0xfe, 0x00); + set_reg_bits(sensor->slv_addr, 0xf7, 1, 0x01, 1); // PLL_mode1:div2en + set_reg_bits(sensor->slv_addr, 0xf7, 7, 0x01, 1); // PLL_mode1:dvp mode + set_reg_bits(sensor->slv_addr, 0xf8, 0, 0x3f, 8); //PLL_mode2 :divx4 + set_reg_bits(sensor->slv_addr, 0xfa, 4, 0x0f, 2); //vlk div mode :divide_by + } + + return ret; +} + +static int set_pixformat(sensor_t *sensor, pixformat_t pixformat) +{ + int ret = 0; + switch (pixformat) { + case PIXFORMAT_RGB565: + write_reg(sensor->slv_addr, 0xfe, 0x00); + ret = set_reg_bits(sensor->slv_addr, 0x44, 0, 0x1f, 6); //RGB565 + break; + + case PIXFORMAT_YUV422: + write_reg(sensor->slv_addr, 0xfe, 0x00); + ret = set_reg_bits(sensor->slv_addr, 0x44, 0, 0x1f, 3); + break; + default: + ESP_LOGW(TAG, "unsupport format"); + ret = -1; + break; + } + if (ret == 0) { + sensor->pixformat = pixformat; + ESP_LOGD(TAG, "Set pixformat to: %u", pixformat); + } + + return ret; +} + +static int set_framesize(sensor_t *sensor, framesize_t framesize) +{ + ESP_LOGI(TAG, "set_framesize"); + int ret = 0; + if (framesize > FRAMESIZE_VGA) { + ESP_LOGW(TAG, "Invalid framesize: %u", framesize); + framesize = FRAMESIZE_VGA; + } + sensor->status.framesize = framesize; + uint16_t w = resolution[framesize].width; + uint16_t h = resolution[framesize].height; + uint16_t row_s = (resolution[FRAMESIZE_VGA].height - h) / 2; + uint16_t col_s = (resolution[FRAMESIZE_VGA].width - w) / 2; + + write_reg(sensor->slv_addr, 0xfe, 0x00); + write_reg(sensor->slv_addr, P0_ROW_START_HIGH, H8(row_s)); // Row_start[8] + write_reg(sensor->slv_addr, P0_ROW_START_LOW, L8(row_s)); // Row_start[7:0] + write_reg(sensor->slv_addr, P0_COLUMN_START_HIGH, H8(col_s)); // Column_start[9:8] + write_reg(sensor->slv_addr, P0_COLUMN_START_LOW, L8(col_s)); // Column_start[7:0] + write_reg(sensor->slv_addr, P0_WINDOW_HEIGHT_HIGH, H8(h + 8)); //window_height [8] + write_reg(sensor->slv_addr, P0_WINDOW_HEIGHT_LOW, L8(h + 8)); //window_height [7:0] + write_reg(sensor->slv_addr, P0_WINDOW_WIDTH_HIGH, H8(w + 8)); //window_width [9:8] + write_reg(sensor->slv_addr, P0_WINDOW_WIDTH_LOW, L8(w + 8)); //window_width [7:0] + + write_reg(sensor->slv_addr, P0_WIN_MODE, 0x01); + write_reg(sensor->slv_addr, P0_OUT_WIN_HEIGHT_HIGH, H8(h)); + write_reg(sensor->slv_addr, P0_OUT_WIN_HEIGHT_LOW, L8(h)); + write_reg(sensor->slv_addr, P0_OUT_WIN_WIDTH_HIGH, H8(w)); + write_reg(sensor->slv_addr, P0_OUT_WIN_WIDTH_LOW, L8(w)); + + if (ret == 0) { + ESP_LOGD(TAG, "Set framesize to: %ux%u", w, h); + } + print_regs(sensor->slv_addr); + return ret; +} + +static int set_hmirror(sensor_t *sensor, int enable) +{ + int ret = 0; + sensor->status.hmirror = enable; + ret = write_reg(sensor->slv_addr, 0xfe, 0x00); + ret |= set_reg_bits(sensor->slv_addr, P0_CISCTL_MODE1, 0, 0x01, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set h-mirror to: %d", enable); + } + return ret; +} + +static int set_vflip(sensor_t *sensor, int enable) +{ + int ret = 0; + sensor->status.vflip = enable; + ret = write_reg(sensor->slv_addr, 0xfe, 0x00); + ret |= set_reg_bits(sensor->slv_addr, P0_CISCTL_MODE1, 1, 0x01, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set v-flip to: %d", enable); + } + return ret; +} + +static int set_colorbar(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg(sensor->slv_addr, 0xfe, 0x00); + ret |= set_reg_bits(sensor->slv_addr, P0_DEBUG_MODE2, 3, 0x01, enable); + if (ret == 0) { + sensor->status.colorbar = enable; + ESP_LOGD(TAG, "Set colorbar to: %d", enable); + } + return ret; +} + +static int get_reg(sensor_t *sensor, int reg, int mask) +{ + int ret = 0; + if (mask > 0xFF) { + ESP_LOGE(TAG, "mask should not more than 0xff"); + } else { + ret = read_reg(sensor->slv_addr, reg); + } + if (ret > 0) { + ret &= mask; + } + return ret; +} + +static int set_reg(sensor_t *sensor, int reg, int mask, int value) +{ + int ret = 0; + if (mask > 0xFF) { + ESP_LOGE(TAG, "mask should not more than 0xff"); + } else { + ret = read_reg(sensor->slv_addr, reg); + } + if (ret < 0) { + return ret; + } + value = (ret & ~mask) | (value & mask); + + if (mask > 0xFF) { + + } else { + ret = write_reg(sensor->slv_addr, reg, value); + } + return ret; +} + +static int init_status(sensor_t *sensor) +{ + write_reg(sensor->slv_addr, 0xfe, 0x00); + sensor->status.brightness = 0; + sensor->status.contrast = 0; + sensor->status.saturation = 0; + sensor->status.sharpness = 0; + sensor->status.denoise = 0; + sensor->status.ae_level = 0; + sensor->status.gainceiling = 0; + sensor->status.awb = 0; + sensor->status.dcw = 0; + sensor->status.agc = 0; + sensor->status.aec = 0; + sensor->status.hmirror = check_reg_mask(sensor->slv_addr, P0_CISCTL_MODE1, 0x01); + sensor->status.vflip = check_reg_mask(sensor->slv_addr, P0_CISCTL_MODE1, 0x02); + sensor->status.colorbar = 0; + sensor->status.bpc = 0; + sensor->status.wpc = 0; + sensor->status.raw_gma = 0; + sensor->status.lenc = 0; + sensor->status.quality = 0; + sensor->status.special_effect = 0; + sensor->status.wb_mode = 0; + sensor->status.awb_gain = 0; + sensor->status.agc_gain = 0; + sensor->status.aec_value = 0; + sensor->status.aec2 = 0; + return 0; +} + +static int set_dummy(sensor_t *sensor, int val) +{ + ESP_LOGW(TAG, "Unsupported"); + return -1; +} +static int set_gainceiling_dummy(sensor_t *sensor, gainceiling_t val) +{ + ESP_LOGW(TAG, "Unsupported"); + return -1; +} + +int gc032a_detect(int slv_addr, sensor_id_t *id) +{ + if (GC032A_SCCB_ADDR == slv_addr) { + uint8_t MIDL = SCCB_Read(slv_addr, SENSOR_ID_LOW); + uint8_t MIDH = SCCB_Read(slv_addr, SENSOR_ID_HIGH); + uint16_t PID = MIDH << 8 | MIDL; + if (GC032A_PID == PID) { + id->PID = PID; + return PID; + } else { + ESP_LOGI(TAG, "Mismatch PID=0x%x", PID); + } + } + return 0; +} + +int gc032a_init(sensor_t *sensor) +{ + sensor->init_status = init_status; + sensor->reset = reset; + sensor->set_pixformat = set_pixformat; + sensor->set_framesize = set_framesize; + sensor->set_contrast = set_dummy; + sensor->set_brightness = set_dummy; + sensor->set_saturation = set_dummy; + sensor->set_sharpness = set_dummy; + sensor->set_denoise = set_dummy; + sensor->set_gainceiling = set_gainceiling_dummy; + sensor->set_quality = set_dummy; + sensor->set_colorbar = set_colorbar; + sensor->set_whitebal = set_dummy; + sensor->set_gain_ctrl = set_dummy; + sensor->set_exposure_ctrl = set_dummy; + sensor->set_hmirror = set_hmirror; + sensor->set_vflip = set_vflip; + + sensor->set_aec2 = set_dummy; + sensor->set_awb_gain = set_dummy; + sensor->set_agc_gain = set_dummy; + sensor->set_aec_value = set_dummy; + + sensor->set_special_effect = set_dummy; + sensor->set_wb_mode = set_dummy; + sensor->set_ae_level = set_dummy; + + sensor->set_dcw = set_dummy; + sensor->set_bpc = set_dummy; + sensor->set_wpc = set_dummy; + + sensor->set_raw_gma = set_dummy; + sensor->set_lenc = set_dummy; + + sensor->get_reg = get_reg; + sensor->set_reg = set_reg; + sensor->set_res_raw = NULL; + sensor->set_pll = NULL; + sensor->set_xclk = NULL; + + ESP_LOGD(TAG, "GC032A Attached"); + return 0; +} diff --git a/lib/libesp32_div/esp32-camera/sensors/gc2145.c b/lib/libesp32_div/esp32-camera/sensors/gc2145.c new file mode 100644 index 000000000..311308290 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/gc2145.c @@ -0,0 +1,475 @@ +// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "sccb.h" +#include "gc2145.h" +#include "gc2145_regs.h" +#include "gc2145_settings.h" + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#else +#include "esp_log.h" +static const char *TAG = "gc2145"; +#endif + +#define H8(v) ((v)>>8) +#define L8(v) ((v)&0xff) + +//#define REG_DEBUG_ON + +static int read_reg(uint8_t slv_addr, const uint16_t reg) +{ + int ret = SCCB_Read(slv_addr, reg); +#ifdef REG_DEBUG_ON + if (ret < 0) { + ESP_LOGE(TAG, "READ REG 0x%04x FAILED: %d", reg, ret); + } +#endif + return ret; +} + +static int write_reg(uint8_t slv_addr, const uint16_t reg, uint8_t value) +{ + int ret = 0; +#ifndef REG_DEBUG_ON + ret = SCCB_Write(slv_addr, reg, value); +#else + int old_value = read_reg(slv_addr, reg); + if (old_value < 0) { + return old_value; + } + if ((uint8_t)old_value != value) { + ESP_LOGI(TAG, "NEW REG 0x%04x: 0x%02x to 0x%02x", reg, (uint8_t)old_value, value); + ret = SCCB_Write(slv_addr, reg, value); + } else { + ESP_LOGD(TAG, "OLD REG 0x%04x: 0x%02x", reg, (uint8_t)old_value); + ret = SCCB_Write(slv_addr, reg, value);//maybe not? + } + if (ret < 0) { + ESP_LOGE(TAG, "WRITE REG 0x%04x FAILED: %d", reg, ret); + } +#endif + return ret; +} + +static int check_reg_mask(uint8_t slv_addr, uint16_t reg, uint8_t mask) +{ + return (read_reg(slv_addr, reg) & mask) == mask; +} + +static int set_reg_bits(uint8_t slv_addr, uint16_t reg, uint8_t offset, uint8_t mask, uint8_t value) +{ + int ret = 0; + uint8_t c_value, new_value; + ret = read_reg(slv_addr, reg); + if (ret < 0) { + return ret; + } + c_value = ret; + new_value = (c_value & ~(mask << offset)) | ((value & mask) << offset); + ret = write_reg(slv_addr, reg, new_value); + return ret; +} + +static int write_regs(uint8_t slv_addr, const uint16_t (*regs)[2]) +{ + int i = 0, ret = 0; + while (!ret && regs[i][0] != REGLIST_TAIL) { + if (regs[i][0] == REG_DLY) { + vTaskDelay(regs[i][1] / portTICK_PERIOD_MS); + } else { + ret = write_reg(slv_addr, regs[i][0], regs[i][1]); + } + i++; + } + return ret; +} + +static void print_regs(uint8_t slv_addr) +{ +#ifdef DEBUG_PRINT_REG + vTaskDelay(pdMS_TO_TICKS(100)); + ESP_LOGI(TAG, "REG list look ======================"); + for (size_t i = 0xf0; i <= 0xfe; i++) { + ESP_LOGI(TAG, "reg[0x%02x] = 0x%02x", i, read_reg(slv_addr, i)); + } + ESP_LOGI(TAG, "\npage 0 ==="); + write_reg(slv_addr, 0xfe, 0x00); // page 0 + for (size_t i = 0x03; i <= 0x24; i++) { + ESP_LOGI(TAG, "p0 reg[0x%02x] = 0x%02x", i, read_reg(slv_addr, i)); + } + for (size_t i = 0x80; i <= 0xa2; i++) { + ESP_LOGI(TAG, "p0 reg[0x%02x] = 0x%02x", i, read_reg(slv_addr, i)); + } + ESP_LOGI(TAG, "\npage 3 ==="); + write_reg(slv_addr, 0xfe, 0x03); // page 3 + for (size_t i = 0x01; i <= 0x43; i++) { + ESP_LOGI(TAG, "p3 reg[0x%02x] = 0x%02x", i, read_reg(slv_addr, i)); + } +#endif +} + +static int reset(sensor_t *sensor) +{ + int ret = 0; + // Software Reset: clear all registers and reset them to their default values + ret = write_reg(sensor->slv_addr, RESET_RELATED, 0xe0); + if (ret) { + ESP_LOGE(TAG, "Software Reset FAILED!"); + return ret; + } + vTaskDelay(100 / portTICK_PERIOD_MS); + ret = write_regs(sensor->slv_addr, gc2145_default_init_regs); + if (ret == 0) { + ESP_LOGD(TAG, "Camera defaults loaded"); + vTaskDelay(100 / portTICK_PERIOD_MS); +#ifdef CONFIG_IDF_TARGET_ESP32 + write_reg(sensor->slv_addr, 0xfe, 0x00); + //ensure pclk <= 15MHz for esp32 + set_reg_bits(sensor->slv_addr, 0xf8, 0, 0x3f, 2); // divx4 + set_reg_bits(sensor->slv_addr, 0xfa, 4, 0x0f, 2); // divide_by +#endif + + } + return ret; +} + +static int set_pixformat(sensor_t *sensor, pixformat_t pixformat) +{ + int ret = 0; + + switch (pixformat) { + case PIXFORMAT_RGB565: + write_reg(sensor->slv_addr, 0xfe, 0x00); + ret = set_reg_bits(sensor->slv_addr, P0_OUTPUT_FORMAT, 0, 0x1f, 6); //RGB565 + break; + + case PIXFORMAT_YUV422: + write_reg(sensor->slv_addr, 0xfe, 0x00); + ret = set_reg_bits(sensor->slv_addr, P0_OUTPUT_FORMAT, 0, 0x1f, 2); //yuv422 + break; + default: + ESP_LOGW(TAG, "unsupport format"); + ret = -1; + break; + } + + if (ret == 0) { + sensor->pixformat = pixformat; + ESP_LOGD(TAG, "Set pixformat to: %u", pixformat); + } + return ret; +} + +static int set_framesize(sensor_t *sensor, framesize_t framesize) +{ + int ret = 0; + if (framesize > FRAMESIZE_UXGA) { + ESP_LOGW(TAG, "Invalid framesize: %u", framesize); + framesize = FRAMESIZE_UXGA; + } + sensor->status.framesize = framesize; + uint16_t w = resolution[framesize].width; + uint16_t h = resolution[framesize].height; + uint16_t row_s = (resolution[FRAMESIZE_UXGA].height - h) / 2; + uint16_t col_s = (resolution[FRAMESIZE_UXGA].width - w) / 2; + +#if CONFIG_GC_SENSOR_SUBSAMPLE_MODE + struct subsample_cfg { + uint16_t ratio_numerator; + uint16_t ratio_denominator; + uint8_t reg0x99; + uint8_t reg0x9b; + uint8_t reg0x9c; + uint8_t reg0x9d; + uint8_t reg0x9e; + uint8_t reg0x9f; + uint8_t reg0xa0; + uint8_t reg0xa1; + uint8_t reg0xa2; + }; + const struct subsample_cfg subsample_cfgs[] = { // define some subsample ratio + // {60, 420, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, //1/7 // A smaller ratio brings a larger view, but it reduces the frame rate + // {84, 420, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, //1/5 + // {105, 420, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},//1/4 + {140, 420, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},//1/3 + {210, 420, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},//1/2 + {240, 420, 0x77, 0x02, 0x46, 0x02, 0x46, 0x02, 0x46, 0x02, 0x46},//4/7 + {252, 420, 0x55, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04},//3/5 + {280, 420, 0x33, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00},//2/3 + {420, 420, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},//1/1 + }; + uint16_t win_w = resolution[FRAMESIZE_UXGA].width; + uint16_t win_h = resolution[FRAMESIZE_UXGA].height; + const struct subsample_cfg *cfg = NULL; + /** + * Strategy: try to keep the maximum perspective + */ + uint8_t i = 0; + if (framesize >= FRAMESIZE_QVGA) { + i = 1; + } + for (; i < sizeof(subsample_cfgs) / sizeof(struct subsample_cfg); i++) { + cfg = &subsample_cfgs[i]; + if ((win_w * cfg->ratio_numerator / cfg->ratio_denominator >= w) && (win_h * cfg->ratio_numerator / cfg->ratio_denominator >= h)) { + win_w = w * cfg->ratio_denominator / cfg->ratio_numerator; + win_h = h * cfg->ratio_denominator / cfg->ratio_numerator; + row_s = (resolution[FRAMESIZE_UXGA].height - win_h) / 2; + col_s = (resolution[FRAMESIZE_UXGA].width - win_w) / 2; + ESP_LOGI(TAG, "subsample win:%dx%d, ratio:%f", win_w, win_h, (float)cfg->ratio_numerator / (float)cfg->ratio_denominator); + break; + } + } + + write_reg(sensor->slv_addr, 0xfe, 0x00); + write_reg(sensor->slv_addr, P0_CROP_ENABLE, 0x01); + write_reg(sensor->slv_addr, 0x09, H8(row_s)); + write_reg(sensor->slv_addr, 0x0a, L8(row_s)); + write_reg(sensor->slv_addr, 0x0b, H8(col_s)); + write_reg(sensor->slv_addr, 0x0c, L8(col_s)); + write_reg(sensor->slv_addr, 0x0d, H8(win_h + 8)); + write_reg(sensor->slv_addr, 0x0e, L8(win_h + 8)); + write_reg(sensor->slv_addr, 0x0f, H8(win_w + 16)); + write_reg(sensor->slv_addr, 0x10, L8(win_w + 16)); + + write_reg(sensor->slv_addr, 0x99, cfg->reg0x99); + write_reg(sensor->slv_addr, 0x9b, cfg->reg0x9b); + write_reg(sensor->slv_addr, 0x9c, cfg->reg0x9c); + write_reg(sensor->slv_addr, 0x9d, cfg->reg0x9d); + write_reg(sensor->slv_addr, 0x9e, cfg->reg0x9e); + write_reg(sensor->slv_addr, 0x9f, cfg->reg0x9f); + write_reg(sensor->slv_addr, 0xa0, cfg->reg0xa0); + write_reg(sensor->slv_addr, 0xa1, cfg->reg0xa1); + write_reg(sensor->slv_addr, 0xa2, cfg->reg0xa2); + + write_reg(sensor->slv_addr, 0x95, H8(h)); + write_reg(sensor->slv_addr, 0x96, L8(h)); + write_reg(sensor->slv_addr, 0x97, H8(w)); + write_reg(sensor->slv_addr, 0x98, L8(w)); + + +#elif CONFIG_GC_SENSOR_WINDOWING_MODE + write_reg(sensor->slv_addr, 0xfe, 0x00); + + write_reg(sensor->slv_addr, P0_CROP_ENABLE, 0x01); + // write_reg(sensor->slv_addr, 0xec, col_s / 8); //measure window + // write_reg(sensor->slv_addr, 0xed, row_s / 8); + // write_reg(sensor->slv_addr, 0xee, (col_s + h) / 8); + // write_reg(sensor->slv_addr, 0xef, (row_s + w) / 8); + + write_reg(sensor->slv_addr, 0x09, H8(row_s)); + write_reg(sensor->slv_addr, 0x0a, L8(row_s)); + write_reg(sensor->slv_addr, 0x0b, H8(col_s)); + write_reg(sensor->slv_addr, 0x0c, L8(col_s)); + write_reg(sensor->slv_addr, 0x0d, H8(h + 8)); + write_reg(sensor->slv_addr, 0x0e, L8(h + 8)); + write_reg(sensor->slv_addr, 0x0f, H8(w + 8)); + write_reg(sensor->slv_addr, 0x10, L8(w + 8)); + + write_reg(sensor->slv_addr, 0x95, H8(h)); + write_reg(sensor->slv_addr, 0x96, L8(h)); + write_reg(sensor->slv_addr, 0x97, H8(w)); + write_reg(sensor->slv_addr, 0x98, L8(w)); + +#endif + + if (ret == 0) { + ESP_LOGD(TAG, "Set framesize to: %ux%u", w, h); + } + return ret; + +} + +static int set_hmirror(sensor_t *sensor, int enable) +{ + int ret = 0; + sensor->status.hmirror = enable; + ret = write_reg(sensor->slv_addr, 0xfe, 0x00); + ret |= set_reg_bits(sensor->slv_addr, P0_ANALOG_MODE1, 0, 0x01, enable != 0); + if (ret == 0) { + ESP_LOGD(TAG, "Set h-mirror to: %d", enable); + } + return ret; +} + +static int set_vflip(sensor_t *sensor, int enable) +{ + int ret = 0; + sensor->status.vflip = enable; + ret = write_reg(sensor->slv_addr, 0xfe, 0x00); + ret |= set_reg_bits(sensor->slv_addr, P0_ANALOG_MODE1, 1, 0x01, enable != 0); + if (ret == 0) { + ESP_LOGD(TAG, "Set v-flip to: %d", enable); + } + return ret; +} + +static int set_colorbar(sensor_t *sensor, int enable) +{ + int ret = 0; + // ret = write_reg(sensor->slv_addr, 0xfe, 0x00); + // ret |= set_reg_bits(sensor->slv_addr, P0_DEBUG_MODE3, 3, 0x01, enable); + if (ret == 0) { + sensor->status.colorbar = enable; + ESP_LOGD(TAG, "Set colorbar to: %d", enable); + } + return ret; +} + +static int get_reg(sensor_t *sensor, int reg, int mask) +{ + int ret = 0; + if (mask > 0xFF) { + ESP_LOGE(TAG, "mask should not more than 0xff"); + } else { + ret = read_reg(sensor->slv_addr, reg); + } + if (ret > 0) { + ret &= mask; + } + return ret; +} + +static int set_reg(sensor_t *sensor, int reg, int mask, int value) +{ + int ret = 0; + if (mask > 0xFF) { + ESP_LOGE(TAG, "mask should not more than 0xff"); + } else { + ret = read_reg(sensor->slv_addr, reg); + } + if (ret < 0) { + return ret; + } + value = (ret & ~mask) | (value & mask); + + if (mask > 0xFF) { + + } else { + ret = write_reg(sensor->slv_addr, reg, value); + } + return ret; +} + +static int init_status(sensor_t *sensor) +{ + write_reg(sensor->slv_addr, 0xfe, 0x00); + sensor->status.brightness = 0; + sensor->status.contrast = 0; + sensor->status.saturation = 0; + sensor->status.sharpness = 0; + sensor->status.denoise = 0; + sensor->status.ae_level = 0; + sensor->status.gainceiling = 0; + sensor->status.awb = 0; + sensor->status.dcw = 0; + sensor->status.agc = 0; + sensor->status.aec = 0; + sensor->status.hmirror = check_reg_mask(sensor->slv_addr, P0_ANALOG_MODE1, 0x01); + sensor->status.vflip = check_reg_mask(sensor->slv_addr, P0_ANALOG_MODE1, 0x02); + sensor->status.colorbar = 0; + sensor->status.bpc = 0; + sensor->status.wpc = 0; + sensor->status.raw_gma = 0; + sensor->status.lenc = 0; + sensor->status.quality = 0; + sensor->status.special_effect = 0; + sensor->status.wb_mode = 0; + sensor->status.awb_gain = 0; + sensor->status.agc_gain = 0; + sensor->status.aec_value = 0; + sensor->status.aec2 = 0; + + print_regs(sensor->slv_addr); + return 0; +} + +static int set_dummy(sensor_t *sensor, int val) +{ + ESP_LOGW(TAG, "Unsupported"); + return -1; +} +static int set_gainceiling_dummy(sensor_t *sensor, gainceiling_t val) +{ + ESP_LOGW(TAG, "Unsupported"); + return -1; +} + +int gc2145_detect(int slv_addr, sensor_id_t *id) +{ + if (GC2145_SCCB_ADDR == slv_addr) { + uint8_t MIDL = SCCB_Read(slv_addr, CHIP_ID_LOW); + uint8_t MIDH = SCCB_Read(slv_addr, CHIP_ID_HIGH); + uint16_t PID = MIDH << 8 | MIDL; + if (GC2145_PID == PID) { + id->PID = PID; + return PID; + } else { + ESP_LOGI(TAG, "Mismatch PID=0x%x", PID); + } + } + return 0; +} + +int gc2145_init(sensor_t *sensor) +{ + sensor->init_status = init_status; + sensor->reset = reset; + sensor->set_pixformat = set_pixformat; + sensor->set_framesize = set_framesize; + sensor->set_contrast = set_dummy; + sensor->set_brightness = set_dummy; + sensor->set_saturation = set_dummy; + sensor->set_sharpness = set_dummy; + sensor->set_denoise = set_dummy; + sensor->set_gainceiling = set_gainceiling_dummy; + sensor->set_quality = set_dummy; + sensor->set_colorbar = set_colorbar; + sensor->set_whitebal = set_dummy; + sensor->set_gain_ctrl = set_dummy; + sensor->set_exposure_ctrl = set_dummy; + sensor->set_hmirror = set_hmirror; + sensor->set_vflip = set_vflip; + + sensor->set_aec2 = set_dummy; + sensor->set_awb_gain = set_dummy; + sensor->set_agc_gain = set_dummy; + sensor->set_aec_value = set_dummy; + + sensor->set_special_effect = set_dummy; + sensor->set_wb_mode = set_dummy; + sensor->set_ae_level = set_dummy; + + sensor->set_dcw = set_dummy; + sensor->set_bpc = set_dummy; + sensor->set_wpc = set_dummy; + + sensor->set_raw_gma = set_dummy; + sensor->set_lenc = set_dummy; + + sensor->get_reg = get_reg; + sensor->set_reg = set_reg; + sensor->set_res_raw = NULL; + sensor->set_pll = NULL; + sensor->set_xclk = NULL; + + ESP_LOGD(TAG, "GC2145 Attached"); + return 0; +} diff --git a/lib/libesp32_div/esp32-camera/sensors/nt99141.c b/lib/libesp32_div/esp32-camera/sensors/nt99141.c new file mode 100644 index 000000000..86a8b8a0b --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/nt99141.c @@ -0,0 +1,1022 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * NT99141 driver. + * + */ +#include +#include +#include +#include "sccb.h" +#include "xclk.h" +#include "nt99141.h" +#include "nt99141_regs.h" +#include "nt99141_settings.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#else +#include "esp_log.h" +static const char *TAG = "NT99141"; +#endif + +//#define REG_DEBUG_ON + +static int read_reg(uint8_t slv_addr, const uint16_t reg) +{ + int ret = SCCB_Read16(slv_addr, reg); +#ifdef REG_DEBUG_ON + + if (ret < 0) { + ESP_LOGE(TAG, "READ REG 0x%04x FAILED: %d", reg, ret); + } + +#endif + return ret; +} + +static int check_reg_mask(uint8_t slv_addr, uint16_t reg, uint8_t mask) +{ + return (read_reg(slv_addr, reg) & mask) == mask; +} + +static int read_reg16(uint8_t slv_addr, const uint16_t reg) +{ + int ret = 0, ret2 = 0; + ret = read_reg(slv_addr, reg); + + if (ret >= 0) { + ret = (ret & 0xFF) << 8; + ret2 = read_reg(slv_addr, reg + 1); + + if (ret2 < 0) { + ret = ret2; + } else { + ret |= ret2 & 0xFF; + } + } + + return ret; +} + + +static int write_reg(uint8_t slv_addr, const uint16_t reg, uint8_t value) +{ + int ret = 0; +#ifndef REG_DEBUG_ON + ret = SCCB_Write16(slv_addr, reg, value); +#else + int old_value = read_reg(slv_addr, reg); + + if (old_value < 0) { + return old_value; + } + + if ((uint8_t)old_value != value) { + ESP_LOGD(TAG, "NEW REG 0x%04x: 0x%02x to 0x%02x", reg, (uint8_t)old_value, value); + ret = SCCB_Write16(slv_addr, reg, value); + } else { + ESP_LOGD(TAG, "OLD REG 0x%04x: 0x%02x", reg, (uint8_t)old_value); + ret = SCCB_Write16(slv_addr, reg, value);//maybe not? + } + + if (ret < 0) { + ESP_LOGE(TAG, "WRITE REG 0x%04x FAILED: %d", reg, ret); + } + +#endif + return ret; +} + +static int set_reg_bits(uint8_t slv_addr, uint16_t reg, uint8_t offset, uint8_t mask, uint8_t value) +{ + int ret = 0; + uint8_t c_value, new_value; + ret = read_reg(slv_addr, reg); + + if (ret < 0) { + return ret; + } + + c_value = ret; + new_value = (c_value & ~(mask << offset)) | ((value & mask) << offset); + ret = write_reg(slv_addr, reg, new_value); + return ret; +} + +static int write_regs(uint8_t slv_addr, const uint16_t (*regs)[2]) +{ + int i = 0, ret = 0; + + while (!ret && regs[i][0] != REGLIST_TAIL) { + if (regs[i][0] == REG_DLY) { + vTaskDelay(regs[i][1] / portTICK_PERIOD_MS); + } else { + ret = write_reg(slv_addr, regs[i][0], regs[i][1]); + } + + i++; + } + + return ret; +} + +static int write_reg16(uint8_t slv_addr, const uint16_t reg, uint16_t value) +{ + if (write_reg(slv_addr, reg, value >> 8) || write_reg(slv_addr, reg + 1, value)) { + return -1; + } + + return 0; +} + +static int write_addr_reg(uint8_t slv_addr, const uint16_t reg, uint16_t x_value, uint16_t y_value) +{ + if (write_reg16(slv_addr, reg, x_value) || write_reg16(slv_addr, reg + 2, y_value)) { + return -1; + } + + return 0; +} + +#define write_reg_bits(slv_addr, reg, mask, enable) set_reg_bits(slv_addr, reg, 0, mask, enable?mask:0) + +static int set_pll(sensor_t *sensor, bool bypass, uint8_t multiplier, uint8_t sys_div, uint8_t pre_div, bool root_2x, uint8_t seld5, bool pclk_manual, uint8_t pclk_div) +{ + return -1; +} + +static int set_ae_level(sensor_t *sensor, int level); + +static int reset(sensor_t *sensor) +{ + + int ret = 0; + // Software Reset: clear all registers and reset them to their default values + ret = write_reg(sensor->slv_addr, SYSTEM_CTROL0, 0x01); + + if (ret) { + ESP_LOGE(TAG, "Software Reset FAILED!"); + return ret; + } + + vTaskDelay(100 / portTICK_PERIOD_MS); + ret = write_regs(sensor->slv_addr, sensor_default_regs); //re-initial + + if (ret == 0) { + ESP_LOGD(TAG, "Camera defaults loaded"); + ret = set_ae_level(sensor, 0); + vTaskDelay(100 / portTICK_PERIOD_MS); + } + + return ret; +} + +static int set_pixformat(sensor_t *sensor, pixformat_t pixformat) +{ + int ret = 0; + const uint16_t (*regs)[2]; + + switch (pixformat) { + case PIXFORMAT_YUV422: + regs = sensor_fmt_yuv422; + break; + + case PIXFORMAT_GRAYSCALE: + regs = sensor_fmt_grayscale; + break; + + case PIXFORMAT_RGB565: + case PIXFORMAT_RGB888: + regs = sensor_fmt_rgb565; + break; + + case PIXFORMAT_JPEG: + regs = sensor_fmt_jpeg; + break; + + case PIXFORMAT_RAW: + regs = sensor_fmt_raw; + break; + + default: + ESP_LOGE(TAG, "Unsupported pixformat: %u", pixformat); + return -1; + } + + ret = write_regs(sensor->slv_addr, regs); + + if (ret == 0) { + sensor->pixformat = pixformat; + ESP_LOGD(TAG, "Set pixformat to: %u", pixformat); + } + + return ret; +} + +static int set_image_options(sensor_t *sensor) +{ + int ret = 0; + uint8_t reg20 = 0; + uint8_t reg21 = 0; + uint8_t reg4514 = 0; + uint8_t reg4514_test = 0; + + // V-Flip + if (sensor->status.vflip) { + reg20 |= 0x01; + reg4514_test |= 1; + } + + // H-Mirror + if (sensor->status.hmirror) { + reg21 |= 0x02; + reg4514_test |= 2; + } + + switch (reg4514_test) { + + } + + if (write_reg(sensor->slv_addr, TIMING_TC_REG20, reg20 | reg21)) { + ESP_LOGE(TAG, "Setting Image Options Failed"); + ret = -1; + } + + ESP_LOGD(TAG, "Set Image Options: Compression: %u, Binning: %u, V-Flip: %u, H-Mirror: %u, Reg-4514: 0x%02x", + sensor->pixformat == PIXFORMAT_JPEG, sensor->status.binning, sensor->status.vflip, sensor->status.hmirror, reg4514); + return ret; +} + +static int set_framesize(sensor_t *sensor, framesize_t framesize) +{ + int ret = 0; + + sensor->status.framesize = framesize; + ret = write_regs(sensor->slv_addr, sensor_default_regs); + + if (framesize == FRAMESIZE_QVGA) { + ESP_LOGD(TAG, "Set FRAMESIZE_QVGA"); + ret = write_regs(sensor->slv_addr, sensor_framesize_QVGA); +#if CONFIG_NT99141_SUPPORT_XSKIP + ESP_LOGD(TAG, "Set FRAMESIZE_QVGA: xskip mode"); + ret = write_regs(sensor->slv_addr, sensor_framesize_QVGA_xskip); +#elif CONFIG_NT99141_SUPPORT_CROP + ESP_LOGD(TAG, "Set FRAMESIZE_QVGA: crop mode"); + ret = write_regs(sensor->slv_addr, sensor_framesize_QVGA_crop); +#endif + } else if (framesize == FRAMESIZE_VGA) { + ESP_LOGD(TAG, "Set FRAMESIZE_VGA"); + // ret = write_regs(sensor->slv_addr, sensor_framesize_VGA); + ret = write_regs(sensor->slv_addr, sensor_framesize_VGA_xyskip);// Resolution:640*360 This configuration is equally-scaled without deforming +#ifdef CONFIG_NT99141_SUPPORT_XSKIP + ESP_LOGD(TAG, "Set FRAMESIZE_QVGA: xskip mode"); + ret = write_regs(sensor->slv_addr, sensor_framesize_VGA_xskip); +#elif CONFIG_NT99141_SUPPORT_CROP + ESP_LOGD(TAG, "Set FRAMESIZE_QVGA: crop mode"); + ret = write_regs(sensor->slv_addr, sensor_framesize_VGA_crop); +#endif + } else if (framesize >= FRAMESIZE_HD) { + ESP_LOGD(TAG, "Set FRAMESIZE_HD"); + ret = write_regs(sensor->slv_addr, sensor_framesize_HD); + } else { + ESP_LOGD(TAG, "Dont suppost this size, Set FRAMESIZE_VGA"); + ret = write_regs(sensor->slv_addr, sensor_framesize_VGA); + } + + return ret; +} + +static int set_hmirror(sensor_t *sensor, int enable) +{ + int ret = 0; + sensor->status.hmirror = enable; + ret = set_image_options(sensor); + + if (ret == 0) { + ESP_LOGD(TAG, "Set h-mirror to: %d", enable); + } + + return ret; +} + +static int set_vflip(sensor_t *sensor, int enable) +{ + int ret = 0; + sensor->status.vflip = enable; + ret = set_image_options(sensor); + + if (ret == 0) { + ESP_LOGD(TAG, "Set v-flip to: %d", enable); + } + + return ret; +} + +static int set_quality(sensor_t *sensor, int qs) +{ + int ret = 0; + ret = write_reg(sensor->slv_addr, COMPRESSION_CTRL07, qs & 0x3f); + + if (ret == 0) { + sensor->status.quality = qs; + ESP_LOGD(TAG, "Set quality to: %d", qs); + } + + return ret; +} + +static int set_colorbar(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, PRE_ISP_TEST_SETTING_1, TEST_COLOR_BAR, enable); + + if (ret == 0) { + sensor->status.colorbar = enable; + ESP_LOGD(TAG, "Set colorbar to: %d", enable); + } + + return ret; +} + +static int set_gain_ctrl(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, 0x32bb, 0x87, enable); + + if (ret == 0) { + ESP_LOGD(TAG, "Set gain_ctrl to: %d", enable); + sensor->status.agc = enable; + } + + return ret; +} + +static int set_exposure_ctrl(sensor_t *sensor, int enable) +{ + int ret = 0; + int data = 0; + // ret = write_reg_bits(sensor->slv_addr, 0x32bb, 0x87, enable); + data = read_reg(sensor->slv_addr, 0x3201); + ESP_LOGD(TAG, "set_exposure_ctrl:enable"); + if (enable) { + ESP_LOGD(TAG, "set_exposure_ctrl:enable"); + ret = write_reg(sensor->slv_addr, 0x3201, (1 << 5) | data); + } else { + ESP_LOGD(TAG, "set_exposure_ctrl:disable"); + ret = write_reg(sensor->slv_addr, 0x3201, (~(1 << 5)) & data); + } + + if (ret == 0) { + ESP_LOGD(TAG, "Set exposure_ctrl to: %d", enable); + sensor->status.aec = enable; + } + + return ret; +} + +static int set_whitebal(sensor_t *sensor, int enable) +{ + int ret = 0; + + if (ret == 0) { + ESP_LOGD(TAG, "Set awb to: %d", enable); + sensor->status.awb = enable; + } + + return ret; +} + +//Advanced AWB +static int set_dcw_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + + if (ret == 0) { + ESP_LOGD(TAG, "Set dcw to: %d", enable); + sensor->status.dcw = enable; + } + + return ret; +} + +//night mode enable +static int set_aec2(sensor_t *sensor, int enable) +{ + int ret = 0; + + if (ret == 0) { + ESP_LOGD(TAG, "Set aec2 to: %d", enable); + sensor->status.aec2 = enable; + } + + return ret; +} + +static int set_bpc_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + + if (ret == 0) { + ESP_LOGD(TAG, "Set bpc to: %d", enable); + sensor->status.bpc = enable; + } + + return ret; +} + +static int set_wpc_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + + if (ret == 0) { + ESP_LOGD(TAG, "Set wpc to: %d", enable); + sensor->status.wpc = enable; + } + + return ret; +} + +//Gamma enable +static int set_raw_gma_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + + if (ret == 0) { + ESP_LOGD(TAG, "Set raw_gma to: %d", enable); + sensor->status.raw_gma = enable; + } + + return ret; +} + +static int set_lenc_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + + if (ret == 0) { + ESP_LOGD(TAG, "Set lenc to: %d", enable); + sensor->status.lenc = enable; + } + + return ret; +} + +static int get_agc_gain(sensor_t *sensor) +{ + ESP_LOGD(TAG, "get_agc_gain can not be configured at present"); + return 0; +} + +//real gain +static int set_agc_gain(sensor_t *sensor, int gain) +{ + ESP_LOGD(TAG, "set_agc_gain can not be configured at present"); + // ESP_LOGD(TAG, "GAIN = %d\n", gain); + int cnt = gain / 2; + + switch (cnt) { + case 0: + ESP_LOGD(TAG, "set_agc_gain: 1x"); + write_reg(sensor->slv_addr, 0X301D, 0X00); + break; + + case 1: + ESP_LOGD(TAG,"set_agc_gain: 2x"); + write_reg(sensor->slv_addr, 0X301D, 0X0F); + break; + + case 2: + ESP_LOGD(TAG,"set_agc_gain: 4x"); + write_reg(sensor->slv_addr, 0X301D, 0X2F); + break; + + case 3: + ESP_LOGD(TAG,"set_agc_gain: 6x"); + write_reg(sensor->slv_addr, 0X301D, 0X37); + break; + + case 4: + ESP_LOGD(TAG,"set_agc_gain: 8x"); + write_reg(sensor->slv_addr, 0X301D, 0X3F); + break; + + default: + ESP_LOGD(TAG,"fail set_agc_gain"); + break; + } + + return 0; +} + +static int get_aec_value(sensor_t *sensor) +{ + ESP_LOGD(TAG, "get_aec_value can not be configured at present"); + return 0; +} + +static int set_aec_value(sensor_t *sensor, int value) +{ + ESP_LOGD(TAG, "set_aec_value can not be configured at present"); + int ret = 0; + // ESP_LOGD(TAG, " set_aec_value to: %d", value); + ret = write_reg_bits(sensor->slv_addr, 0x3012, 0x00, (value >> 8) & 0xff); + ret = write_reg_bits(sensor->slv_addr, 0x3013, 0x01, value & 0xff); + + if (ret == 0) { + ESP_LOGD(TAG, " set_aec_value to: %d", value); + // sensor->status.aec = enable; + } + + return ret; +} + +static int set_ae_level(sensor_t *sensor, int level) +{ + ESP_LOGD(TAG, "set_ae_level can not be configured at present"); + int ret = 0; + + if (level < 0) { + level = 0; + } else if (level > 9) { + level = 9; + } + + for (int i = 0; i < 5; i++) { + ret += write_reg(sensor->slv_addr, sensor_ae_level[ 5 * level + i ][0], sensor_ae_level[5 * level + i ][1]); + } + + if (ret) { + ESP_LOGE(TAG, " fail to set ae level: %d", ret); + } + + return 0; +} + +static int set_wb_mode(sensor_t *sensor, int mode) +{ + int ret = 0; + + if (mode < 0 || mode > 4) { + return -1; + } + + ret = write_reg(sensor->slv_addr, 0x3201, (mode != 0)); + + if (ret) { + return ret; + } + + switch (mode) { + case 1://Sunny + ret = write_reg16(sensor->slv_addr, 0x3290, 0x01) + || write_reg16(sensor->slv_addr, 0x3291, 0x38) + || write_reg16(sensor->slv_addr, 0x3296, 0x01) + || write_reg16(sensor->slv_addr, 0x3297, 0x68) + || write_reg16(sensor->slv_addr, 0x3060, 0x01); + + break; + + case 2://Cloudy + + ret = write_reg16(sensor->slv_addr, 0x3290, 0x01) + || write_reg16(sensor->slv_addr, 0x3291, 0x51) + || write_reg16(sensor->slv_addr, 0x3296, 0x01) + || write_reg16(sensor->slv_addr, 0x3297, 0x00) + || write_reg16(sensor->slv_addr, 0x3060, 0x01); + break; + + case 3://INCANDESCENCE] + ret = write_reg16(sensor->slv_addr, 0x3290, 0x01) + || write_reg16(sensor->slv_addr, 0x3291, 0x30) + || write_reg16(sensor->slv_addr, 0x3296, 0x01) + || write_reg16(sensor->slv_addr, 0x3297, 0xCB) + || write_reg16(sensor->slv_addr, 0x3060, 0x01); + break; + + case 4://FLUORESCENT + ret = write_reg16(sensor->slv_addr, 0x3290, 0x01) + || write_reg16(sensor->slv_addr, 0x3291, 0x70) + || write_reg16(sensor->slv_addr, 0x3296, 0x01) + || write_reg16(sensor->slv_addr, 0x3297, 0xFF) + || write_reg16(sensor->slv_addr, 0x3060, 0x01); + break; + + default://AUTO + break; + } + + if (ret == 0) { + ESP_LOGD(TAG, "Set wb_mode to: %d", mode); + sensor->status.wb_mode = mode; + } + + return ret; +} + +static int set_awb_gain_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + int old_mode = sensor->status.wb_mode; + int mode = enable ? old_mode : 0; + + ret = set_wb_mode(sensor, mode); + + if (ret == 0) { + sensor->status.wb_mode = old_mode; + ESP_LOGD(TAG, "Set awb_gain to: %d", enable); + sensor->status.awb_gain = enable; + } + + return ret; +} + +static int set_special_effect(sensor_t *sensor, int effect) +{ + int ret = 0; + + if (effect < 0 || effect > 6) { + return -1; + } + + uint8_t *regs = (uint8_t *)sensor_special_effects[effect]; + ret = write_reg(sensor->slv_addr, 0x32F1, regs[0]) + || write_reg(sensor->slv_addr, 0x32F4, regs[1]) + || write_reg(sensor->slv_addr, 0x32F5, regs[2]) + || write_reg(sensor->slv_addr, 0x3060, regs[3]); + + if (ret == 0) { + ESP_LOGD(TAG, "Set special_effect to: %d", effect); + sensor->status.special_effect = effect; + } + + return ret; +} + +static int set_brightness(sensor_t *sensor, int level) +{ + int ret = 0; + uint8_t value = 0; + + switch (level) { + case 3: + value = 0xA0; + break; + + case 2: + value = 0x90; + break; + + case 1: + value = 0x88; + break; + + case -1: + value = 0x78; + break; + + case -2: + value = 0x70; + break; + + case -3: + value = 0x60; + break; + + default: // 0 + break; + } + + ret = write_reg(sensor->slv_addr, 0x32F2, value); + + if (ret == 0) { + ESP_LOGD(TAG, "Set brightness to: %d", level); + sensor->status.brightness = level; + } + + return ret; +} + +static int set_contrast(sensor_t *sensor, int level) +{ + int ret = 0; + uint8_t value1 = 0, value2 = 0 ; + + switch (level) { + case 3: + value1 = 0xD0; + value2 = 0xB0; + break; + + case 2: + value1 = 0xE0; + value2 = 0xA0; + break; + + case 1: + value1 = 0xF0; + value2 = 0x90; + break; + + case 0: + value1 = 0x00; + value2 = 0x80; + break; + + case -1: + value1 = 0x10; + value2 = 0x70; + break; + + case -2: + value1 = 0x20; + value2 = 0x60; + break; + + case -3: + value1 = 0x30; + value2 = 0x50; + break; + + default: // 0 + break; + } + + ret = write_reg(sensor->slv_addr, 0x32FC, value1); + ret = write_reg(sensor->slv_addr, 0x32F2, value2); + ret = write_reg(sensor->slv_addr, 0x3060, 0x01); + + if (ret == 0) { + ESP_LOGD(TAG, "Set contrast to: %d", level); + sensor->status.contrast = level; + } + + return ret; +} + +static int set_saturation(sensor_t *sensor, int level) +{ + int ret = 0; + + if (level > 4 || level < -4) { + return -1; + } + + uint8_t *regs = (uint8_t *)sensor_saturation_levels[level + 4]; + { + ret = write_reg(sensor->slv_addr, 0x32F3, regs[0]); + + if (ret) { + return ret; + } + } + + if (ret == 0) { + ESP_LOGD(TAG, "Set saturation to: %d", level); + sensor->status.saturation = level; + } + + return ret; +} + +static int set_sharpness(sensor_t *sensor, int level) +{ + int ret = 0; + + if (level > 3 || level < -3) { + return -1; + } + + uint8_t mt_offset_2 = (level + 3) * 8; + uint8_t mt_offset_1 = mt_offset_2 + 1; + + ret = write_reg_bits(sensor->slv_addr, 0x5308, 0x40, false)//0x40 means auto + || write_reg(sensor->slv_addr, 0x5300, 0x10) + || write_reg(sensor->slv_addr, 0x5301, 0x10) + || write_reg(sensor->slv_addr, 0x5302, mt_offset_1) + || write_reg(sensor->slv_addr, 0x5303, mt_offset_2) + || write_reg(sensor->slv_addr, 0x5309, 0x10) + || write_reg(sensor->slv_addr, 0x530a, 0x10) + || write_reg(sensor->slv_addr, 0x530b, 0x04) + || write_reg(sensor->slv_addr, 0x530c, 0x06); + + if (ret == 0) { + ESP_LOGD(TAG, "Set sharpness to: %d", level); + sensor->status.sharpness = level; + } + + return ret; +} + +static int set_gainceiling(sensor_t *sensor, gainceiling_t level) +{ + ESP_LOGD(TAG, "set_gainceiling can not be configured at present"); + return 0; +} + +static int get_denoise(sensor_t *sensor) +{ + + return (read_reg(sensor->slv_addr, 0x5306) / 4) + 1; +} + +static int set_denoise(sensor_t *sensor, int level) +{ + ESP_LOGD(TAG, "set_denoise can not be configured at present"); + return 0; +} + +static int get_reg(sensor_t *sensor, int reg, int mask) +{ + int ret = 0, ret2 = 0; + + if (mask > 0xFF) { + ret = read_reg16(sensor->slv_addr, reg); + + if (ret >= 0 && mask > 0xFFFF) { + ret2 = read_reg(sensor->slv_addr, reg + 2); + + if (ret2 >= 0) { + ret = (ret << 8) | ret2 ; + } else { + ret = ret2; + } + } + } else { + ret = read_reg(sensor->slv_addr, reg); + } + + if (ret > 0) { + ret &= mask; + } + + return ret; +} + +static int set_reg(sensor_t *sensor, int reg, int mask, int value) +{ + int ret = 0, ret2 = 0; + + if (mask > 0xFF) { + ret = read_reg16(sensor->slv_addr, reg); + + if (ret >= 0 && mask > 0xFFFF) { + ret2 = read_reg(sensor->slv_addr, reg + 2); + + if (ret2 >= 0) { + ret = (ret << 8) | ret2 ; + } else { + ret = ret2; + } + } + } else { + ret = read_reg(sensor->slv_addr, reg); + } + + if (ret < 0) { + return ret; + } + + value = (ret & ~mask) | (value & mask); + + if (mask > 0xFFFF) { + ret = write_reg16(sensor->slv_addr, reg, value >> 8); + + if (ret >= 0) { + ret = write_reg(sensor->slv_addr, reg + 2, value & 0xFF); + } + } else if (mask > 0xFF) { + ret = write_reg16(sensor->slv_addr, reg, value); + } else { + ret = write_reg(sensor->slv_addr, reg, value); + } + + return ret; +} + +static int set_res_raw(sensor_t *sensor, int startX, int startY, int endX, int endY, int offsetX, int offsetY, int totalX, int totalY, int outputX, int outputY, bool scale, bool binning) +{ + int ret = 0; + ret = write_addr_reg(sensor->slv_addr, X_ADDR_ST_H, startX, startY) + || write_addr_reg(sensor->slv_addr, X_ADDR_END_H, endX, endY) + || write_addr_reg(sensor->slv_addr, X_OFFSET_H, offsetX, offsetY) + || write_addr_reg(sensor->slv_addr, X_TOTAL_SIZE_H, totalX, totalY) + || write_addr_reg(sensor->slv_addr, X_OUTPUT_SIZE_H, outputX, outputY); + + if (!ret) { + sensor->status.scale = scale; + sensor->status.binning = binning; + ret = set_image_options(sensor); + } + + return ret; +} + +static int _set_pll(sensor_t *sensor, int bypass, int multiplier, int sys_div, int root_2x, int pre_div, int seld5, int pclk_manual, int pclk_div) +{ + return set_pll(sensor, bypass > 0, multiplier, sys_div, pre_div, root_2x > 0, seld5, pclk_manual > 0, pclk_div); +} + +static int set_xclk(sensor_t *sensor, int timer, int xclk) +{ + int ret = 0; + if (xclk > 10) + { + ESP_LOGE(TAG, "only XCLK under 10MHz is supported, and XCLK is now set to 10M"); + xclk = 10; + } + sensor->xclk_freq_hz = xclk * 1000000U; + ret = xclk_timer_conf(timer, sensor->xclk_freq_hz); + return ret; +} + +int nt99141_detect(int slv_addr, sensor_id_t *id) +{ + if (NT99141_SCCB_ADDR == slv_addr) { + SCCB_Write16(slv_addr, 0x3008, 0x01);//bank sensor + uint16_t h = SCCB_Read16(slv_addr, 0x3000); + uint16_t l = SCCB_Read16(slv_addr, 0x3001); + uint16_t PID = (h<<8) | l; + if (NT99141_PID == PID) { + id->PID = PID; + return PID; + } else { + ESP_LOGI(TAG, "Mismatch PID=0x%x", PID); + } + } + return 0; +} + +static int init_status(sensor_t *sensor) +{ + sensor->status.brightness = 0; + sensor->status.contrast = 0; + sensor->status.saturation = 0; + sensor->status.sharpness = (read_reg(sensor->slv_addr, 0x3301)); + sensor->status.denoise = get_denoise(sensor); + sensor->status.ae_level = 0; + sensor->status.gainceiling = read_reg16(sensor->slv_addr, 0x32F0) & 0xFF; + sensor->status.awb = check_reg_mask(sensor->slv_addr, ISP_CONTROL_01, 0x10); + sensor->status.dcw = !check_reg_mask(sensor->slv_addr, 0x5183, 0x80); + sensor->status.agc = !check_reg_mask(sensor->slv_addr, AEC_PK_MANUAL, AEC_PK_MANUAL_AGC_MANUALEN); + sensor->status.aec = !check_reg_mask(sensor->slv_addr, AEC_PK_MANUAL, AEC_PK_MANUAL_AEC_MANUALEN); + sensor->status.hmirror = check_reg_mask(sensor->slv_addr, TIMING_TC_REG21, TIMING_TC_REG21_HMIRROR); + sensor->status.vflip = check_reg_mask(sensor->slv_addr, TIMING_TC_REG20, TIMING_TC_REG20_VFLIP); + sensor->status.colorbar = check_reg_mask(sensor->slv_addr, PRE_ISP_TEST_SETTING_1, TEST_COLOR_BAR); + sensor->status.bpc = check_reg_mask(sensor->slv_addr, 0x5000, 0x04); + sensor->status.wpc = check_reg_mask(sensor->slv_addr, 0x5000, 0x02); + sensor->status.raw_gma = check_reg_mask(sensor->slv_addr, 0x5000, 0x20); + sensor->status.lenc = check_reg_mask(sensor->slv_addr, 0x5000, 0x80); + sensor->status.quality = read_reg(sensor->slv_addr, COMPRESSION_CTRL07) & 0x3f; + sensor->status.special_effect = 0; + sensor->status.wb_mode = 0; + sensor->status.awb_gain = check_reg_mask(sensor->slv_addr, 0x3000, 0x01); + sensor->status.agc_gain = get_agc_gain(sensor); + sensor->status.aec_value = get_aec_value(sensor); + sensor->status.aec2 = check_reg_mask(sensor->slv_addr, 0x3000, 0x04); + return 0; +} + +int nt99141_init(sensor_t *sensor) +{ + sensor->reset = reset; + sensor->set_pixformat = set_pixformat; + sensor->set_framesize = set_framesize; + sensor->set_contrast = set_contrast; + sensor->set_brightness = set_brightness; + sensor->set_saturation = set_saturation; + sensor->set_sharpness = set_sharpness; + sensor->set_gainceiling = set_gainceiling; + sensor->set_quality = set_quality; + sensor->set_colorbar = set_colorbar; + sensor->set_gain_ctrl = set_gain_ctrl; + sensor->set_exposure_ctrl = set_exposure_ctrl; + sensor->set_whitebal = set_whitebal; + sensor->set_hmirror = set_hmirror; + sensor->set_vflip = set_vflip; + sensor->init_status = init_status; + sensor->set_aec2 = set_aec2; + sensor->set_aec_value = set_aec_value; + sensor->set_special_effect = set_special_effect; + sensor->set_wb_mode = set_wb_mode; + sensor->set_ae_level = set_ae_level; + sensor->set_dcw = set_dcw_dsp; + sensor->set_bpc = set_bpc_dsp; + sensor->set_wpc = set_wpc_dsp; + sensor->set_awb_gain = set_awb_gain_dsp; + sensor->set_agc_gain = set_agc_gain; + sensor->set_raw_gma = set_raw_gma_dsp; + sensor->set_lenc = set_lenc_dsp; + sensor->set_denoise = set_denoise; + + sensor->get_reg = get_reg; + sensor->set_reg = set_reg; + sensor->set_res_raw = set_res_raw; + sensor->set_pll = _set_pll; + sensor->set_xclk = set_xclk; + return 0; +} diff --git a/lib/libesp32_div/esp32-camera/sensors/ov2640.c b/lib/libesp32_div/esp32-camera/sensors/ov2640.c new file mode 100644 index 000000000..7e3d77174 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/ov2640.c @@ -0,0 +1,612 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * OV2640 driver. + * + */ +#include +#include +#include +#include "sccb.h" +#include "xclk.h" +#include "ov2640.h" +#include "ov2640_regs.h" +#include "ov2640_settings.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#else +#include "esp_log.h" +static const char* TAG = "ov2640"; +#endif + +static volatile ov2640_bank_t reg_bank = BANK_MAX; +static int set_bank(sensor_t *sensor, ov2640_bank_t bank) +{ + int res = 0; + if (bank != reg_bank) { + reg_bank = bank; + res = SCCB_Write(sensor->slv_addr, BANK_SEL, bank); + } + return res; +} + +static int write_regs(sensor_t *sensor, const uint8_t (*regs)[2]) +{ + int i=0, res = 0; + while (regs[i][0]) { + if (regs[i][0] == BANK_SEL) { + res = set_bank(sensor, regs[i][1]); + } else { + res = SCCB_Write(sensor->slv_addr, regs[i][0], regs[i][1]); + } + if (res) { + return res; + } + i++; + } + return res; +} + +static int write_reg(sensor_t *sensor, ov2640_bank_t bank, uint8_t reg, uint8_t value) +{ + int ret = set_bank(sensor, bank); + if(!ret) { + ret = SCCB_Write(sensor->slv_addr, reg, value); + } + return ret; +} + +static int set_reg_bits(sensor_t *sensor, uint8_t bank, uint8_t reg, uint8_t offset, uint8_t mask, uint8_t value) +{ + int ret = 0; + uint8_t c_value, new_value; + + ret = set_bank(sensor, bank); + if(ret) { + return ret; + } + c_value = SCCB_Read(sensor->slv_addr, reg); + new_value = (c_value & ~(mask << offset)) | ((value & mask) << offset); + ret = SCCB_Write(sensor->slv_addr, reg, new_value); + return ret; +} + +static int read_reg(sensor_t *sensor, ov2640_bank_t bank, uint8_t reg) +{ + if(set_bank(sensor, bank)){ + return 0; + } + return SCCB_Read(sensor->slv_addr, reg); +} + +static uint8_t get_reg_bits(sensor_t *sensor, uint8_t bank, uint8_t reg, uint8_t offset, uint8_t mask) +{ + return (read_reg(sensor, bank, reg) >> offset) & mask; +} + +static int write_reg_bits(sensor_t *sensor, uint8_t bank, uint8_t reg, uint8_t mask, int enable) +{ + return set_reg_bits(sensor, bank, reg, 0, mask, enable?mask:0); +} + +#define WRITE_REGS_OR_RETURN(regs) ret = write_regs(sensor, regs); if(ret){return ret;} +#define WRITE_REG_OR_RETURN(bank, reg, val) ret = write_reg(sensor, bank, reg, val); if(ret){return ret;} +#define SET_REG_BITS_OR_RETURN(bank, reg, offset, mask, val) ret = set_reg_bits(sensor, bank, reg, offset, mask, val); if(ret){return ret;} + +static int reset(sensor_t *sensor) +{ + int ret = 0; + WRITE_REG_OR_RETURN(BANK_SENSOR, COM7, COM7_SRST); + vTaskDelay(10 / portTICK_PERIOD_MS); + WRITE_REGS_OR_RETURN(ov2640_settings_cif); + return ret; +} + +static int set_pixformat(sensor_t *sensor, pixformat_t pixformat) +{ + int ret = 0; + sensor->pixformat = pixformat; + switch (pixformat) { + case PIXFORMAT_RGB565: + case PIXFORMAT_RGB888: + WRITE_REGS_OR_RETURN(ov2640_settings_rgb565); + break; + case PIXFORMAT_YUV422: + case PIXFORMAT_GRAYSCALE: + WRITE_REGS_OR_RETURN(ov2640_settings_yuv422); + break; + case PIXFORMAT_JPEG: + WRITE_REGS_OR_RETURN(ov2640_settings_jpeg3); + break; + default: + ret = -1; + break; + } + if(!ret) { + vTaskDelay(10 / portTICK_PERIOD_MS); + } + + return ret; +} + +static int set_window(sensor_t *sensor, ov2640_sensor_mode_t mode, int offset_x, int offset_y, int max_x, int max_y, int w, int h){ + int ret = 0; + const uint8_t (*regs)[2]; + ov2640_clk_t c; + c.reserved = 0; + + max_x /= 4; + max_y /= 4; + w /= 4; + h /= 4; + uint8_t win_regs[][2] = { + {BANK_SEL, BANK_DSP}, + {HSIZE, max_x & 0xFF}, + {VSIZE, max_y & 0xFF}, + {XOFFL, offset_x & 0xFF}, + {YOFFL, offset_y & 0xFF}, + {VHYX, ((max_y >> 1) & 0X80) | ((offset_y >> 4) & 0X70) | ((max_x >> 5) & 0X08) | ((offset_x >> 8) & 0X07)}, + {TEST, (max_x >> 2) & 0X80}, + {ZMOW, (w)&0xFF}, + {ZMOH, (h)&0xFF}, + {ZMHH, ((h>>6)&0x04)|((w>>8)&0x03)}, + {0, 0} + }; + + if (sensor->pixformat == PIXFORMAT_JPEG) { + c.clk_2x = 0; + c.clk_div = 0; + c.pclk_auto = 0; + c.pclk_div = 8; + if(mode == OV2640_MODE_UXGA) { + c.pclk_div = 12; + } + // if (sensor->xclk_freq_hz == 16000000) { + // c.pclk_div = c.pclk_div / 2; + // } + } else { +#if CONFIG_IDF_TARGET_ESP32 + c.clk_2x = 0; +#else + c.clk_2x = 1; +#endif + c.clk_div = 7; + c.pclk_auto = 1; + c.pclk_div = 8; + if (mode == OV2640_MODE_CIF) { + c.clk_div = 3; + } else if(mode == OV2640_MODE_UXGA) { + c.pclk_div = 12; + } + } + ESP_LOGI(TAG, "Set PLL: clk_2x: %u, clk_div: %u, pclk_auto: %u, pclk_div: %u", c.clk_2x, c.clk_div, c.pclk_auto, c.pclk_div); + + if (mode == OV2640_MODE_CIF) { + regs = ov2640_settings_to_cif; + } else if (mode == OV2640_MODE_SVGA) { + regs = ov2640_settings_to_svga; + } else { + regs = ov2640_settings_to_uxga; + } + + WRITE_REG_OR_RETURN(BANK_DSP, R_BYPASS, R_BYPASS_DSP_BYPAS); + WRITE_REGS_OR_RETURN(regs); + WRITE_REGS_OR_RETURN(win_regs); + WRITE_REG_OR_RETURN(BANK_SENSOR, CLKRC, c.clk); + WRITE_REG_OR_RETURN(BANK_DSP, R_DVP_SP, c.pclk); + WRITE_REG_OR_RETURN(BANK_DSP, R_BYPASS, R_BYPASS_DSP_EN); + + vTaskDelay(10 / portTICK_PERIOD_MS); + //required when changing resolution + set_pixformat(sensor, sensor->pixformat); + + return ret; +} + +static int set_framesize(sensor_t *sensor, framesize_t framesize) +{ + int ret = 0; + uint16_t w = resolution[framesize].width; + uint16_t h = resolution[framesize].height; + aspect_ratio_t ratio = resolution[framesize].aspect_ratio; + uint16_t max_x = ratio_table[ratio].max_x; + uint16_t max_y = ratio_table[ratio].max_y; + uint16_t offset_x = ratio_table[ratio].offset_x; + uint16_t offset_y = ratio_table[ratio].offset_y; + ov2640_sensor_mode_t mode = OV2640_MODE_UXGA; + + sensor->status.framesize = framesize; + + + + if (framesize <= FRAMESIZE_CIF) { + mode = OV2640_MODE_CIF; + max_x /= 4; + max_y /= 4; + offset_x /= 4; + offset_y /= 4; + if(max_y > 296){ + max_y = 296; + } + } else if (framesize <= FRAMESIZE_SVGA) { + mode = OV2640_MODE_SVGA; + max_x /= 2; + max_y /= 2; + offset_x /= 2; + offset_y /= 2; + } + + ret = set_window(sensor, mode, offset_x, offset_y, max_x, max_y, w, h); + return ret; +} + +static int set_contrast(sensor_t *sensor, int level) +{ + int ret=0; + level += 3; + if (level <= 0 || level > NUM_CONTRAST_LEVELS) { + return -1; + } + sensor->status.contrast = level-3; + for (int i=0; i<7; i++) { + WRITE_REG_OR_RETURN(BANK_DSP, contrast_regs[0][i], contrast_regs[level][i]); + } + return ret; +} + +static int set_brightness(sensor_t *sensor, int level) +{ + int ret=0; + level += 3; + if (level <= 0 || level > NUM_BRIGHTNESS_LEVELS) { + return -1; + } + sensor->status.brightness = level-3; + for (int i=0; i<5; i++) { + WRITE_REG_OR_RETURN(BANK_DSP, brightness_regs[0][i], brightness_regs[level][i]); + } + return ret; +} + +static int set_saturation(sensor_t *sensor, int level) +{ + int ret=0; + level += 3; + if (level <= 0 || level > NUM_SATURATION_LEVELS) { + return -1; + } + sensor->status.saturation = level-3; + for (int i=0; i<5; i++) { + WRITE_REG_OR_RETURN(BANK_DSP, saturation_regs[0][i], saturation_regs[level][i]); + } + return ret; +} + +static int set_special_effect(sensor_t *sensor, int effect) +{ + int ret=0; + effect++; + if (effect <= 0 || effect > NUM_SPECIAL_EFFECTS) { + return -1; + } + sensor->status.special_effect = effect-1; + for (int i=0; i<5; i++) { + WRITE_REG_OR_RETURN(BANK_DSP, special_effects_regs[0][i], special_effects_regs[effect][i]); + } + return ret; +} + +static int set_wb_mode(sensor_t *sensor, int mode) +{ + int ret=0; + if (mode < 0 || mode > NUM_WB_MODES) { + return -1; + } + sensor->status.wb_mode = mode; + SET_REG_BITS_OR_RETURN(BANK_DSP, 0XC7, 6, 1, mode?1:0); + if(mode) { + for (int i=0; i<3; i++) { + WRITE_REG_OR_RETURN(BANK_DSP, wb_modes_regs[0][i], wb_modes_regs[mode][i]); + } + } + return ret; +} + +static int set_ae_level(sensor_t *sensor, int level) +{ + int ret=0; + level += 3; + if (level <= 0 || level > NUM_AE_LEVELS) { + return -1; + } + sensor->status.ae_level = level-3; + for (int i=0; i<3; i++) { + WRITE_REG_OR_RETURN(BANK_SENSOR, ae_levels_regs[0][i], ae_levels_regs[level][i]); + } + return ret; +} + +static int set_quality(sensor_t *sensor, int quality) +{ + if(quality < 0) { + quality = 0; + } else if(quality > 63) { + quality = 63; + } + sensor->status.quality = quality; + return write_reg(sensor, BANK_DSP, QS, quality); +} + +static int set_agc_gain(sensor_t *sensor, int gain) +{ + if(gain < 0) { + gain = 0; + } else if(gain > 30) { + gain = 30; + } + sensor->status.agc_gain = gain; + return write_reg(sensor, BANK_SENSOR, GAIN, agc_gain_tbl[gain]); +} + +static int set_gainceiling_sensor(sensor_t *sensor, gainceiling_t gainceiling) +{ + sensor->status.gainceiling = gainceiling; + //return write_reg(sensor, BANK_SENSOR, COM9, COM9_AGC_SET(gainceiling)); + return set_reg_bits(sensor, BANK_SENSOR, COM9, 5, 7, gainceiling); +} + +static int set_aec_value(sensor_t *sensor, int value) +{ + if(value < 0) { + value = 0; + } else if(value > 1200) { + value = 1200; + } + sensor->status.aec_value = value; + return set_reg_bits(sensor, BANK_SENSOR, REG04, 0, 3, value & 0x3) + || write_reg(sensor, BANK_SENSOR, AEC, (value >> 2) & 0xFF) + || set_reg_bits(sensor, BANK_SENSOR, REG45, 0, 0x3F, value >> 10); +} + +static int set_aec2(sensor_t *sensor, int enable) +{ + sensor->status.aec2 = enable; + return set_reg_bits(sensor, BANK_DSP, CTRL0, 6, 1, enable?0:1); +} + +static int set_colorbar(sensor_t *sensor, int enable) +{ + sensor->status.colorbar = enable; + return write_reg_bits(sensor, BANK_SENSOR, COM7, COM7_COLOR_BAR, enable?1:0); +} + +static int set_agc_sensor(sensor_t *sensor, int enable) +{ + sensor->status.agc = enable; + return write_reg_bits(sensor, BANK_SENSOR, COM8, COM8_AGC_EN, enable?1:0); +} + +static int set_aec_sensor(sensor_t *sensor, int enable) +{ + sensor->status.aec = enable; + return write_reg_bits(sensor, BANK_SENSOR, COM8, COM8_AEC_EN, enable?1:0); +} + +static int set_hmirror_sensor(sensor_t *sensor, int enable) +{ + sensor->status.hmirror = enable; + return write_reg_bits(sensor, BANK_SENSOR, REG04, REG04_HFLIP_IMG, enable?1:0); +} + +static int set_vflip_sensor(sensor_t *sensor, int enable) +{ + int ret = 0; + sensor->status.vflip = enable; + ret = write_reg_bits(sensor, BANK_SENSOR, REG04, REG04_VREF_EN, enable?1:0); + return ret & write_reg_bits(sensor, BANK_SENSOR, REG04, REG04_VFLIP_IMG, enable?1:0); +} + +static int set_raw_gma_dsp(sensor_t *sensor, int enable) +{ + sensor->status.raw_gma = enable; + return set_reg_bits(sensor, BANK_DSP, CTRL1, 5, 1, enable?1:0); +} + +static int set_awb_dsp(sensor_t *sensor, int enable) +{ + sensor->status.awb = enable; + return set_reg_bits(sensor, BANK_DSP, CTRL1, 3, 1, enable?1:0); +} + +static int set_awb_gain_dsp(sensor_t *sensor, int enable) +{ + sensor->status.awb_gain = enable; + return set_reg_bits(sensor, BANK_DSP, CTRL1, 2, 1, enable?1:0); +} + +static int set_lenc_dsp(sensor_t *sensor, int enable) +{ + sensor->status.lenc = enable; + return set_reg_bits(sensor, BANK_DSP, CTRL1, 1, 1, enable?1:0); +} + +static int set_dcw_dsp(sensor_t *sensor, int enable) +{ + sensor->status.dcw = enable; + return set_reg_bits(sensor, BANK_DSP, CTRL2, 5, 1, enable?1:0); +} + +static int set_bpc_dsp(sensor_t *sensor, int enable) +{ + sensor->status.bpc = enable; + return set_reg_bits(sensor, BANK_DSP, CTRL3, 7, 1, enable?1:0); +} + +static int set_wpc_dsp(sensor_t *sensor, int enable) +{ + sensor->status.wpc = enable; + return set_reg_bits(sensor, BANK_DSP, CTRL3, 6, 1, enable?1:0); +} + +//unsupported +static int set_sharpness(sensor_t *sensor, int level) +{ + return -1; +} + +static int set_denoise(sensor_t *sensor, int level) +{ + return -1; +} + +static int get_reg(sensor_t *sensor, int reg, int mask) +{ + int ret = read_reg(sensor, (reg >> 8) & 0x01, reg & 0xFF); + if(ret > 0){ + ret &= mask; + } + return ret; +} + +static int set_reg(sensor_t *sensor, int reg, int mask, int value) +{ + int ret = 0; + ret = read_reg(sensor, (reg >> 8) & 0x01, reg & 0xFF); + if(ret < 0){ + return ret; + } + value = (ret & ~mask) | (value & mask); + ret = write_reg(sensor, (reg >> 8) & 0x01, reg & 0xFF, value); + return ret; +} + +static int set_res_raw(sensor_t *sensor, int startX, int startY, int endX, int endY, int offsetX, int offsetY, int totalX, int totalY, int outputX, int outputY, bool scale, bool binning) +{ + return set_window(sensor, (ov2640_sensor_mode_t)startX, offsetX, offsetY, totalX, totalY, outputX, outputY); +} + +static int _set_pll(sensor_t *sensor, int bypass, int multiplier, int sys_div, int root_2x, int pre_div, int seld5, int pclk_manual, int pclk_div) +{ + return -1; +} + +static int set_xclk(sensor_t *sensor, int timer, int xclk) +{ + int ret = 0; + sensor->xclk_freq_hz = xclk * 1000000U; + ret = xclk_timer_conf(timer, sensor->xclk_freq_hz); + return ret; +} + +static int init_status(sensor_t *sensor){ + sensor->status.brightness = 0; + sensor->status.contrast = 0; + sensor->status.saturation = 0; + sensor->status.ae_level = 0; + sensor->status.special_effect = 0; + sensor->status.wb_mode = 0; + + sensor->status.agc_gain = 30; + int agc_gain = read_reg(sensor, BANK_SENSOR, GAIN); + for (int i=0; i<30; i++){ + if(agc_gain >= agc_gain_tbl[i] && agc_gain < agc_gain_tbl[i+1]){ + sensor->status.agc_gain = i; + break; + } + } + + sensor->status.aec_value = ((uint16_t)get_reg_bits(sensor, BANK_SENSOR, REG45, 0, 0x3F) << 10) + | ((uint16_t)read_reg(sensor, BANK_SENSOR, AEC) << 2) + | get_reg_bits(sensor, BANK_SENSOR, REG04, 0, 3);//0 - 1200 + sensor->status.quality = read_reg(sensor, BANK_DSP, QS); + sensor->status.gainceiling = get_reg_bits(sensor, BANK_SENSOR, COM9, 5, 7); + + sensor->status.awb = get_reg_bits(sensor, BANK_DSP, CTRL1, 3, 1); + sensor->status.awb_gain = get_reg_bits(sensor, BANK_DSP, CTRL1, 2, 1); + sensor->status.aec = get_reg_bits(sensor, BANK_SENSOR, COM8, 0, 1); + sensor->status.aec2 = get_reg_bits(sensor, BANK_DSP, CTRL0, 6, 1); + sensor->status.agc = get_reg_bits(sensor, BANK_SENSOR, COM8, 2, 1); + sensor->status.bpc = get_reg_bits(sensor, BANK_DSP, CTRL3, 7, 1); + sensor->status.wpc = get_reg_bits(sensor, BANK_DSP, CTRL3, 6, 1); + sensor->status.raw_gma = get_reg_bits(sensor, BANK_DSP, CTRL1, 5, 1); + sensor->status.lenc = get_reg_bits(sensor, BANK_DSP, CTRL1, 1, 1); + sensor->status.hmirror = get_reg_bits(sensor, BANK_SENSOR, REG04, 7, 1); + sensor->status.vflip = get_reg_bits(sensor, BANK_SENSOR, REG04, 6, 1); + sensor->status.dcw = get_reg_bits(sensor, BANK_DSP, CTRL2, 5, 1); + sensor->status.colorbar = get_reg_bits(sensor, BANK_SENSOR, COM7, 1, 1); + + sensor->status.sharpness = 0;//not supported + sensor->status.denoise = 0; + return 0; +} + +int ov2640_detect(int slv_addr, sensor_id_t *id) +{ + if (OV2640_SCCB_ADDR == slv_addr) { + SCCB_Write(slv_addr, 0xFF, 0x01);//bank sensor + uint16_t PID = SCCB_Read(slv_addr, 0x0A); + if (OV2640_PID == PID) { + id->PID = PID; + id->VER = SCCB_Read(slv_addr, REG_VER); + id->MIDL = SCCB_Read(slv_addr, REG_MIDL); + id->MIDH = SCCB_Read(slv_addr, REG_MIDH); + return PID; + } else { + ESP_LOGI(TAG, "Mismatch PID=0x%x", PID); + } + } + return 0; +} + +int ov2640_init(sensor_t *sensor) +{ + sensor->reset = reset; + sensor->init_status = init_status; + sensor->set_pixformat = set_pixformat; + sensor->set_framesize = set_framesize; + sensor->set_contrast = set_contrast; + sensor->set_brightness= set_brightness; + sensor->set_saturation= set_saturation; + + sensor->set_quality = set_quality; + sensor->set_colorbar = set_colorbar; + + sensor->set_gainceiling = set_gainceiling_sensor; + sensor->set_gain_ctrl = set_agc_sensor; + sensor->set_exposure_ctrl = set_aec_sensor; + sensor->set_hmirror = set_hmirror_sensor; + sensor->set_vflip = set_vflip_sensor; + + sensor->set_whitebal = set_awb_dsp; + sensor->set_aec2 = set_aec2; + sensor->set_aec_value = set_aec_value; + sensor->set_special_effect = set_special_effect; + sensor->set_wb_mode = set_wb_mode; + sensor->set_ae_level = set_ae_level; + + sensor->set_dcw = set_dcw_dsp; + sensor->set_bpc = set_bpc_dsp; + sensor->set_wpc = set_wpc_dsp; + sensor->set_awb_gain = set_awb_gain_dsp; + sensor->set_agc_gain = set_agc_gain; + + sensor->set_raw_gma = set_raw_gma_dsp; + sensor->set_lenc = set_lenc_dsp; + + //not supported + sensor->set_sharpness = set_sharpness; + sensor->set_denoise = set_denoise; + + sensor->get_reg = get_reg; + sensor->set_reg = set_reg; + sensor->set_res_raw = set_res_raw; + sensor->set_pll = _set_pll; + sensor->set_xclk = set_xclk; + ESP_LOGD(TAG, "OV2640 Attached"); + return 0; +} diff --git a/lib/libesp32_div/esp32-camera/sensors/ov3660.c b/lib/libesp32_div/esp32-camera/sensors/ov3660.c new file mode 100644 index 000000000..b9ebdba3b --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/ov3660.c @@ -0,0 +1,1053 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * OV3660 driver. + * + */ +#include +#include +#include +#include "sccb.h" +#include "xclk.h" +#include "ov3660.h" +#include "ov3660_regs.h" +#include "ov3660_settings.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#else +#include "esp_log.h" +static const char *TAG = "ov3660"; +#endif + +//#define REG_DEBUG_ON + +static int read_reg(uint8_t slv_addr, const uint16_t reg){ + int ret = SCCB_Read16(slv_addr, reg); +#ifdef REG_DEBUG_ON + if (ret < 0) { + ESP_LOGE(TAG, "READ REG 0x%04x FAILED: %d", reg, ret); + } +#endif + return ret; +} + +static int check_reg_mask(uint8_t slv_addr, uint16_t reg, uint8_t mask){ + return (read_reg(slv_addr, reg) & mask) == mask; +} + +static int read_reg16(uint8_t slv_addr, const uint16_t reg){ + int ret = 0, ret2 = 0; + ret = read_reg(slv_addr, reg); + if (ret >= 0) { + ret = (ret & 0xFF) << 8; + ret2 = read_reg(slv_addr, reg+1); + if (ret2 < 0) { + ret = ret2; + } else { + ret |= ret2 & 0xFF; + } + } + return ret; +} + + +static int write_reg(uint8_t slv_addr, const uint16_t reg, uint8_t value){ + int ret = 0; +#ifndef REG_DEBUG_ON + ret = SCCB_Write16(slv_addr, reg, value); +#else + int old_value = read_reg(slv_addr, reg); + if (old_value < 0) { + return old_value; + } + if ((uint8_t)old_value != value) { + ESP_LOGI(TAG, "NEW REG 0x%04x: 0x%02x to 0x%02x", reg, (uint8_t)old_value, value); + ret = SCCB_Write16(slv_addr, reg, value); + } else { + ESP_LOGD(TAG, "OLD REG 0x%04x: 0x%02x", reg, (uint8_t)old_value); + ret = SCCB_Write16(slv_addr, reg, value);//maybe not? + } + if (ret < 0) { + ESP_LOGE(TAG, "WRITE REG 0x%04x FAILED: %d", reg, ret); + } +#endif + return ret; +} + +static int set_reg_bits(uint8_t slv_addr, uint16_t reg, uint8_t offset, uint8_t mask, uint8_t value) +{ + int ret = 0; + uint8_t c_value, new_value; + ret = read_reg(slv_addr, reg); + if(ret < 0) { + return ret; + } + c_value = ret; + new_value = (c_value & ~(mask << offset)) | ((value & mask) << offset); + ret = write_reg(slv_addr, reg, new_value); + return ret; +} + +static int write_regs(uint8_t slv_addr, const uint16_t (*regs)[2]) +{ + int i = 0, ret = 0; + while (!ret && regs[i][0] != REGLIST_TAIL) { + if (regs[i][0] == REG_DLY) { + vTaskDelay(regs[i][1] / portTICK_PERIOD_MS); + } else { + ret = write_reg(slv_addr, regs[i][0], regs[i][1]); + } + i++; + } + return ret; +} + +static int write_reg16(uint8_t slv_addr, const uint16_t reg, uint16_t value) +{ + if (write_reg(slv_addr, reg, value >> 8) || write_reg(slv_addr, reg + 1, value)) { + return -1; + } + return 0; +} + +static int write_addr_reg(uint8_t slv_addr, const uint16_t reg, uint16_t x_value, uint16_t y_value) +{ + if (write_reg16(slv_addr, reg, x_value) || write_reg16(slv_addr, reg + 2, y_value)) { + return -1; + } + return 0; +} + +#define write_reg_bits(slv_addr, reg, mask, enable) set_reg_bits(slv_addr, reg, 0, mask, enable?mask:0) + +static int calc_sysclk(int xclk, bool pll_bypass, int pll_multiplier, int pll_sys_div, int pll_pre_div, bool pll_root_2x, int pll_seld5, bool pclk_manual, int pclk_div) +{ + const int pll_pre_div2x_map[] = { 2, 3, 4, 6 };//values are multiplied by two to avoid floats + const int pll_seld52x_map[] = { 2, 2, 4, 5 }; + + if(!pll_sys_div) { + pll_sys_div = 1; + } + + int pll_pre_div2x = pll_pre_div2x_map[pll_pre_div]; + int pll_root_div = pll_root_2x?2:1; + int pll_seld52x = pll_seld52x_map[pll_seld5]; + + int VCO = (xclk / 1000) * pll_multiplier * pll_root_div * 2 / pll_pre_div2x; + int PLLCLK = pll_bypass?(xclk):(VCO * 1000 * 2 / pll_sys_div / pll_seld52x); + int PCLK = PLLCLK / 2 / ((pclk_manual && pclk_div)?pclk_div:1); + int SYSCLK = PLLCLK / 4; + + ESP_LOGI(TAG, "Calculated VCO: %d Hz, PLLCLK: %d Hz, SYSCLK: %d Hz, PCLK: %d Hz", VCO*1000, PLLCLK, SYSCLK, PCLK); + return SYSCLK; +} + +static int set_pll(sensor_t *sensor, bool bypass, uint8_t multiplier, uint8_t sys_div, uint8_t pre_div, bool root_2x, uint8_t seld5, bool pclk_manual, uint8_t pclk_div){ + int ret = 0; + if(multiplier > 31 || sys_div > 15 || pre_div > 3 || pclk_div > 31 || seld5 > 3){ + ESP_LOGE(TAG, "Invalid arguments"); + return -1; + } + + calc_sysclk(sensor->xclk_freq_hz, bypass, multiplier, sys_div, pre_div, root_2x, seld5, pclk_manual, pclk_div); + + ret = write_reg(sensor->slv_addr, SC_PLLS_CTRL0, bypass?0x80:0x00); + if (ret == 0) { + ret = write_reg(sensor->slv_addr, SC_PLLS_CTRL1, multiplier & 0x1f); + } + if (ret == 0) { + ret = write_reg(sensor->slv_addr, SC_PLLS_CTRL2, 0x10 | (sys_div & 0x0f)); + } + if (ret == 0) { + ret = write_reg(sensor->slv_addr, SC_PLLS_CTRL3, (pre_div & 0x3) << 4 | seld5 | (root_2x?0x40:0x00)); + } + if (ret == 0) { + ret = write_reg(sensor->slv_addr, PCLK_RATIO, pclk_div & 0x1f); + } + if (ret == 0) { + ret = write_reg(sensor->slv_addr, VFIFO_CTRL0C, pclk_manual?0x22:0x20); + } + if(ret){ + ESP_LOGE(TAG, "set_sensor_pll FAILED!"); + } + return ret; +} + +static int set_ae_level(sensor_t *sensor, int level); + +static int reset(sensor_t *sensor) +{ + int ret = 0; + // Software Reset: clear all registers and reset them to their default values + ret = write_reg(sensor->slv_addr, SYSTEM_CTROL0, 0x82); + if(ret){ + ESP_LOGE(TAG, "Software Reset FAILED!"); + return ret; + } + vTaskDelay(100 / portTICK_PERIOD_MS); + ret = write_regs(sensor->slv_addr, sensor_default_regs); + if (ret == 0) { + ESP_LOGD(TAG, "Camera defaults loaded"); + ret = set_ae_level(sensor, 0); + vTaskDelay(100 / portTICK_PERIOD_MS); + } + return ret; +} + +static int set_pixformat(sensor_t *sensor, pixformat_t pixformat) +{ + int ret = 0; + const uint16_t (*regs)[2]; + + switch (pixformat) { + case PIXFORMAT_YUV422: + regs = sensor_fmt_yuv422; + break; + + case PIXFORMAT_GRAYSCALE: + regs = sensor_fmt_grayscale; + break; + + case PIXFORMAT_RGB565: + case PIXFORMAT_RGB888: + regs = sensor_fmt_rgb565; + break; + + case PIXFORMAT_JPEG: + regs = sensor_fmt_jpeg; + break; + + case PIXFORMAT_RAW: + regs = sensor_fmt_raw; + break; + + default: + ESP_LOGE(TAG, "Unsupported pixformat: %u", pixformat); + return -1; + } + + ret = write_regs(sensor->slv_addr, regs); + if(ret == 0) { + sensor->pixformat = pixformat; + ESP_LOGD(TAG, "Set pixformat to: %u", pixformat); + } + return ret; +} + +static int set_image_options(sensor_t *sensor) +{ + int ret = 0; + uint8_t reg20 = 0; + uint8_t reg21 = 0; + uint8_t reg4514 = 0; + uint8_t reg4514_test = 0; + + // compression + if (sensor->pixformat == PIXFORMAT_JPEG) { + reg21 |= 0x20; + } + + // binning + if (sensor->status.binning) { + reg20 |= 0x01; + reg21 |= 0x01; + reg4514_test |= 4; + } else { + reg20 |= 0x40; + } + + // V-Flip + if (sensor->status.vflip) { + reg20 |= 0x06; + reg4514_test |= 1; + } + + // H-Mirror + if (sensor->status.hmirror) { + reg21 |= 0x06; + reg4514_test |= 2; + } + + switch (reg4514_test) { + //no binning + case 0: reg4514 = 0x88; break;//normal + case 1: reg4514 = 0x88; break;//v-flip + case 2: reg4514 = 0xbb; break;//h-mirror + case 3: reg4514 = 0xbb; break;//v-flip+h-mirror + //binning + case 4: reg4514 = 0xaa; break;//normal + case 5: reg4514 = 0xbb; break;//v-flip + case 6: reg4514 = 0xbb; break;//h-mirror + case 7: reg4514 = 0xaa; break;//v-flip+h-mirror + } + + if(write_reg(sensor->slv_addr, TIMING_TC_REG20, reg20) + || write_reg(sensor->slv_addr, TIMING_TC_REG21, reg21) + || write_reg(sensor->slv_addr, 0x4514, reg4514)){ + ESP_LOGE(TAG, "Setting Image Options Failed"); + ret = -1; + } + + if (sensor->status.binning) { + ret = write_reg(sensor->slv_addr, 0x4520, 0x0b) + || write_reg(sensor->slv_addr, X_INCREMENT, 0x31)//odd:3, even: 1 + || write_reg(sensor->slv_addr, Y_INCREMENT, 0x31);//odd:3, even: 1 + } else { + ret = write_reg(sensor->slv_addr, 0x4520, 0xb0) + || write_reg(sensor->slv_addr, X_INCREMENT, 0x11)//odd:1, even: 1 + || write_reg(sensor->slv_addr, Y_INCREMENT, 0x11);//odd:1, even: 1 + } + + ESP_LOGD(TAG, "Set Image Options: Compression: %u, Binning: %u, V-Flip: %u, H-Mirror: %u, Reg-4514: 0x%02x", + sensor->pixformat == PIXFORMAT_JPEG, sensor->status.binning, sensor->status.vflip, sensor->status.hmirror, reg4514); + return ret; +} + +static int set_framesize(sensor_t *sensor, framesize_t framesize) +{ + int ret = 0; + + if(framesize > FRAMESIZE_QXGA){ + ESP_LOGW(TAG, "Invalid framesize: %u", framesize); + framesize = FRAMESIZE_QXGA; + } + framesize_t old_framesize = sensor->status.framesize; + sensor->status.framesize = framesize; + uint16_t w = resolution[framesize].width; + uint16_t h = resolution[framesize].height; + aspect_ratio_t ratio = resolution[sensor->status.framesize].aspect_ratio; + ratio_settings_t settings = ratio_table[ratio]; + + sensor->status.binning = (w <= (settings.max_width / 2) && h <= (settings.max_height / 2)); + sensor->status.scale = !((w == settings.max_width && h == settings.max_height) + || (w == (settings.max_width / 2) && h == (settings.max_height / 2))); + + ret = write_addr_reg(sensor->slv_addr, X_ADDR_ST_H, settings.start_x, settings.start_y) + || write_addr_reg(sensor->slv_addr, X_ADDR_END_H, settings.end_x, settings.end_y) + || write_addr_reg(sensor->slv_addr, X_OUTPUT_SIZE_H, w, h); + + if (ret) { + goto fail; + } + + if (sensor->status.binning) { + ret = write_addr_reg(sensor->slv_addr, X_TOTAL_SIZE_H, settings.total_x, (settings.total_y / 2) + 1) + || write_addr_reg(sensor->slv_addr, X_OFFSET_H, 8, 2); + } else { + ret = write_addr_reg(sensor->slv_addr, X_TOTAL_SIZE_H, settings.total_x, settings.total_y) + || write_addr_reg(sensor->slv_addr, X_OFFSET_H, 16, 6); + } + + if (ret == 0) { + ret = write_reg_bits(sensor->slv_addr, ISP_CONTROL_01, 0x20, sensor->status.scale); + } + + if (ret == 0) { + ret = set_image_options(sensor); + } + + if (ret) { + goto fail; + } + + if (sensor->pixformat == PIXFORMAT_JPEG) { + if (framesize == FRAMESIZE_QXGA || sensor->xclk_freq_hz == 16000000) { + //40MHz SYSCLK and 10MHz PCLK + ret = set_pll(sensor, false, 24, 1, 3, false, 0, true, 8); + } else { + //50MHz SYSCLK and 10MHz PCLK + ret = set_pll(sensor, false, 30, 1, 3, false, 0, true, 10); + } + } else { + //tuned for 16MHz XCLK and 8MHz PCLK + if (framesize > FRAMESIZE_HVGA) { + //8MHz SYSCLK and 8MHz PCLK (4.44 FPS) + ret = set_pll(sensor, false, 4, 1, 0, false, 2, true, 2); + } else if (framesize >= FRAMESIZE_QVGA) { + //16MHz SYSCLK and 8MHz PCLK (10.25 FPS) + ret = set_pll(sensor, false, 8, 1, 0, false, 2, true, 4); + } else { + //32MHz SYSCLK and 8MHz PCLK (17.77 FPS) + ret = set_pll(sensor, false, 8, 1, 0, false, 0, true, 8); + } + } + + if (ret == 0) { + ESP_LOGD(TAG, "Set framesize to: %ux%u", w, h); + } + return ret; + +fail: + sensor->status.framesize = old_framesize; + ESP_LOGE(TAG, "Setting framesize to: %ux%u failed", w, h); + return ret; +} + +static int set_hmirror(sensor_t *sensor, int enable) +{ + int ret = 0; + sensor->status.hmirror = enable; + ret = set_image_options(sensor); + if (ret == 0) { + ESP_LOGD(TAG, "Set h-mirror to: %d", enable); + } + return ret; +} + +static int set_vflip(sensor_t *sensor, int enable) +{ + int ret = 0; + sensor->status.vflip = enable; + ret = set_image_options(sensor); + if (ret == 0) { + ESP_LOGD(TAG, "Set v-flip to: %d", enable); + } + return ret; +} + +static int set_quality(sensor_t *sensor, int qs) +{ + int ret = 0; + ret = write_reg(sensor->slv_addr, COMPRESSION_CTRL07, qs & 0x3f); + if (ret == 0) { + sensor->status.quality = qs; + ESP_LOGD(TAG, "Set quality to: %d", qs); + } + return ret; +} + +static int set_colorbar(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, PRE_ISP_TEST_SETTING_1, TEST_COLOR_BAR, enable); + if (ret == 0) { + sensor->status.colorbar = enable; + ESP_LOGD(TAG, "Set colorbar to: %d", enable); + } + return ret; +} + +static int set_gain_ctrl(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, AEC_PK_MANUAL, AEC_PK_MANUAL_AGC_MANUALEN, !enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set gain_ctrl to: %d", enable); + sensor->status.agc = enable; + } + return ret; +} + +static int set_exposure_ctrl(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, AEC_PK_MANUAL, AEC_PK_MANUAL_AEC_MANUALEN, !enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set exposure_ctrl to: %d", enable); + sensor->status.aec = enable; + } + return ret; +} + +static int set_whitebal(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, ISP_CONTROL_01, 0x01, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set awb to: %d", enable); + sensor->status.awb = enable; + } + return ret; +} + +//Advanced AWB +static int set_dcw_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, 0x5183, 0x80, !enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set dcw to: %d", enable); + sensor->status.dcw = enable; + } + return ret; +} + +//night mode enable +static int set_aec2(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, 0x3a00, 0x04, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set aec2 to: %d", enable); + sensor->status.aec2 = enable; + } + return ret; +} + +static int set_bpc_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, 0x5000, 0x04, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set bpc to: %d", enable); + sensor->status.bpc = enable; + } + return ret; +} + +static int set_wpc_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, 0x5000, 0x02, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set wpc to: %d", enable); + sensor->status.wpc = enable; + } + return ret; +} + +//Gamma enable +static int set_raw_gma_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, 0x5000, 0x20, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set raw_gma to: %d", enable); + sensor->status.raw_gma = enable; + } + return ret; +} + +static int set_lenc_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, 0x5000, 0x80, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set lenc to: %d", enable); + sensor->status.lenc = enable; + } + return ret; +} + +static int get_agc_gain(sensor_t *sensor) +{ + int ra = read_reg(sensor->slv_addr, 0x350a); + if (ra < 0) { + return 0; + } + int rb = read_reg(sensor->slv_addr, 0x350b); + if (rb < 0) { + return 0; + } + int res = (rb & 0xF0) >> 4 | (ra & 0x03) << 4; + if (rb & 0x0F) { + res += 1; + } + return res; +} + +//real gain +static int set_agc_gain(sensor_t *sensor, int gain) +{ + int ret = 0; + if(gain < 0) { + gain = 0; + } else if(gain > 64) { + gain = 64; + } + + //gain value is 6.4 bits float + //in order to use the max range, we deduct 1/16 + int gainv = gain << 4; + if(gainv){ + gainv -= 1; + } + + ret = write_reg(sensor->slv_addr, 0x350a, gainv >> 8) || write_reg(sensor->slv_addr, 0x350b, gainv & 0xff); + if (ret == 0) { + ESP_LOGD(TAG, "Set agc_gain to: %d", gain); + sensor->status.agc_gain = gain; + } + return ret; +} + +static int get_aec_value(sensor_t *sensor) +{ + int ra = read_reg(sensor->slv_addr, 0x3500); + if (ra < 0) { + return 0; + } + int rb = read_reg(sensor->slv_addr, 0x3501); + if (rb < 0) { + return 0; + } + int rc = read_reg(sensor->slv_addr, 0x3502); + if (rc < 0) { + return 0; + } + int res = (ra & 0x0F) << 12 | (rb & 0xFF) << 4 | (rc & 0xF0) >> 4; + return res; +} + +static int set_aec_value(sensor_t *sensor, int value) +{ + int ret = 0, max_val = 0; + max_val = read_reg16(sensor->slv_addr, 0x380e); + if (max_val < 0) { + ESP_LOGE(TAG, "Could not read max aec_value"); + return -1; + } + if (value > max_val) { + value =max_val; + } + + ret = write_reg(sensor->slv_addr, 0x3500, (value >> 12) & 0x0F) + || write_reg(sensor->slv_addr, 0x3501, (value >> 4) & 0xFF) + || write_reg(sensor->slv_addr, 0x3502, (value << 4) & 0xF0); + + if (ret == 0) { + ESP_LOGD(TAG, "Set aec_value to: %d / %d", value, max_val); + sensor->status.aec_value = value; + } + return ret; +} + +static int set_ae_level(sensor_t *sensor, int level) +{ + int ret = 0; + if (level < -5 || level > 5) { + return -1; + } + //good targets are between 5 and 115 + int target_level = ((level + 5) * 10) + 5; + + int level_high, level_low; + int fast_high, fast_low; + + level_low = target_level * 23 / 25; //0.92 (0.46) + level_high = target_level * 27 / 25; //1.08 (2.08) + + fast_low = level_low >> 1; + fast_high = level_high << 1; + + if(fast_high>255) { + fast_high = 255; + } + + ret = write_reg(sensor->slv_addr, 0x3a0f, level_high) + || write_reg(sensor->slv_addr, 0x3a10, level_low) + || write_reg(sensor->slv_addr, 0x3a1b, level_high) + || write_reg(sensor->slv_addr, 0x3a1e, level_low) + || write_reg(sensor->slv_addr, 0x3a11, fast_high) + || write_reg(sensor->slv_addr, 0x3a1f, fast_low); + + if (ret == 0) { + ESP_LOGD(TAG, "Set ae_level to: %d", level); + sensor->status.ae_level = level; + } + return ret; +} + +static int set_wb_mode(sensor_t *sensor, int mode) +{ + int ret = 0; + if (mode < 0 || mode > 4) { + return -1; + } + + ret = write_reg(sensor->slv_addr, 0x3406, (mode != 0)); + if (ret) { + return ret; + } + switch (mode) { + case 1://Sunny + ret = write_reg16(sensor->slv_addr, 0x3400, 0x5e0) //AWB R GAIN + || write_reg16(sensor->slv_addr, 0x3402, 0x410) //AWB G GAIN + || write_reg16(sensor->slv_addr, 0x3404, 0x540);//AWB B GAIN + break; + case 2://Cloudy + ret = write_reg16(sensor->slv_addr, 0x3400, 0x650) //AWB R GAIN + || write_reg16(sensor->slv_addr, 0x3402, 0x410) //AWB G GAIN + || write_reg16(sensor->slv_addr, 0x3404, 0x4f0);//AWB B GAIN + break; + case 3://Office + ret = write_reg16(sensor->slv_addr, 0x3400, 0x520) //AWB R GAIN + || write_reg16(sensor->slv_addr, 0x3402, 0x410) //AWB G GAIN + || write_reg16(sensor->slv_addr, 0x3404, 0x660);//AWB B GAIN + break; + case 4://HOME + ret = write_reg16(sensor->slv_addr, 0x3400, 0x420) //AWB R GAIN + || write_reg16(sensor->slv_addr, 0x3402, 0x3f0) //AWB G GAIN + || write_reg16(sensor->slv_addr, 0x3404, 0x710);//AWB B GAIN + break; + default://AUTO + break; + } + + if (ret == 0) { + ESP_LOGD(TAG, "Set wb_mode to: %d", mode); + sensor->status.wb_mode = mode; + } + return ret; +} + +static int set_awb_gain_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + int old_mode = sensor->status.wb_mode; + int mode = enable?old_mode:0; + + ret = set_wb_mode(sensor, mode); + + if (ret == 0) { + sensor->status.wb_mode = old_mode; + ESP_LOGD(TAG, "Set awb_gain to: %d", enable); + sensor->status.awb_gain = enable; + } + return ret; +} + +static int set_special_effect(sensor_t *sensor, int effect) +{ + int ret=0; + if (effect < 0 || effect > 6) { + return -1; + } + + uint8_t * regs = (uint8_t *)sensor_special_effects[effect]; + ret = write_reg(sensor->slv_addr, 0x5580, regs[0]) + || write_reg(sensor->slv_addr, 0x5583, regs[1]) + || write_reg(sensor->slv_addr, 0x5584, regs[2]) + || write_reg(sensor->slv_addr, 0x5003, regs[3]); + + if (ret == 0) { + ESP_LOGD(TAG, "Set special_effect to: %d", effect); + sensor->status.special_effect = effect; + } + return ret; +} + +static int set_brightness(sensor_t *sensor, int level) +{ + int ret = 0; + uint8_t value = 0; + bool negative = false; + + switch (level) { + case 3: + value = 0x30; + break; + case 2: + value = 0x20; + break; + case 1: + value = 0x10; + break; + case -1: + value = 0x10; + negative = true; + break; + case -2: + value = 0x20; + negative = true; + break; + case -3: + value = 0x30; + negative = true; + break; + default: // 0 + break; + } + + ret = write_reg(sensor->slv_addr, 0x5587, value); + if (ret == 0) { + ret = write_reg_bits(sensor->slv_addr, 0x5588, 0x08, negative); + } + + if (ret == 0) { + ESP_LOGD(TAG, "Set brightness to: %d", level); + sensor->status.brightness = level; + } + return ret; +} + +static int set_contrast(sensor_t *sensor, int level) +{ + int ret = 0; + if(level > 3 || level < -3) { + return -1; + } + ret = write_reg(sensor->slv_addr, 0x5586, (level + 4) << 3); + + if (ret == 0) { + ESP_LOGD(TAG, "Set contrast to: %d", level); + sensor->status.contrast = level; + } + return ret; +} + +static int set_saturation(sensor_t *sensor, int level) +{ + int ret = 0; + if(level > 4 || level < -4) { + return -1; + } + + uint8_t * regs = (uint8_t *)sensor_saturation_levels[level+4]; + for(int i=0; i<11; i++) { + ret = write_reg(sensor->slv_addr, 0x5381 + i, regs[i]); + if (ret) { + break; + } + } + + if (ret == 0) { + ESP_LOGD(TAG, "Set saturation to: %d", level); + sensor->status.saturation = level; + } + return ret; +} + +static int set_sharpness(sensor_t *sensor, int level) +{ + int ret = 0; + if(level > 3 || level < -3) { + return -1; + } + + uint8_t mt_offset_2 = (level + 3) * 8; + uint8_t mt_offset_1 = mt_offset_2 + 1; + + ret = write_reg_bits(sensor->slv_addr, 0x5308, 0x40, false)//0x40 means auto + || write_reg(sensor->slv_addr, 0x5300, 0x10) + || write_reg(sensor->slv_addr, 0x5301, 0x10) + || write_reg(sensor->slv_addr, 0x5302, mt_offset_1) + || write_reg(sensor->slv_addr, 0x5303, mt_offset_2) + || write_reg(sensor->slv_addr, 0x5309, 0x10) + || write_reg(sensor->slv_addr, 0x530a, 0x10) + || write_reg(sensor->slv_addr, 0x530b, 0x04) + || write_reg(sensor->slv_addr, 0x530c, 0x06); + + if (ret == 0) { + ESP_LOGD(TAG, "Set sharpness to: %d", level); + sensor->status.sharpness = level; + } + return ret; +} + +static int set_gainceiling(sensor_t *sensor, gainceiling_t level) +{ + int ret = 0, l = (int)level; + + ret = write_reg(sensor->slv_addr, 0x3A18, (l >> 8) & 3) + || write_reg(sensor->slv_addr, 0x3A19, l & 0xFF); + + if (ret == 0) { + ESP_LOGD(TAG, "Set gainceiling to: %d", l); + sensor->status.gainceiling = l; + } + return ret; +} + +static int get_denoise(sensor_t *sensor) +{ + if (!check_reg_mask(sensor->slv_addr, 0x5308, 0x10)) { + return 0; + } + return (read_reg(sensor->slv_addr, 0x5306) / 4) + 1; +} + +static int set_denoise(sensor_t *sensor, int level) +{ + int ret = 0; + if (level < 0 || level > 8) { + return -1; + } + + ret = write_reg_bits(sensor->slv_addr, 0x5308, 0x10, level > 0); + if (ret == 0 && level > 0) { + ret = write_reg(sensor->slv_addr, 0x5306, (level - 1) * 4); + } + + if (ret == 0) { + ESP_LOGD(TAG, "Set denoise to: %d", level); + sensor->status.denoise = level; + } + return ret; +} + +static int get_reg(sensor_t *sensor, int reg, int mask) +{ + int ret = 0, ret2 = 0; + if(mask > 0xFF){ + ret = read_reg16(sensor->slv_addr, reg); + if(ret >= 0 && mask > 0xFFFF){ + ret2 = read_reg(sensor->slv_addr, reg+2); + if(ret2 >= 0){ + ret = (ret << 8) | ret2 ; + } else { + ret = ret2; + } + } + } else { + ret = read_reg(sensor->slv_addr, reg); + } + if(ret > 0){ + ret &= mask; + } + return ret; +} + +static int set_reg(sensor_t *sensor, int reg, int mask, int value) +{ + int ret = 0, ret2 = 0; + if(mask > 0xFF){ + ret = read_reg16(sensor->slv_addr, reg); + if(ret >= 0 && mask > 0xFFFF){ + ret2 = read_reg(sensor->slv_addr, reg+2); + if(ret2 >= 0){ + ret = (ret << 8) | ret2 ; + } else { + ret = ret2; + } + } + } else { + ret = read_reg(sensor->slv_addr, reg); + } + if(ret < 0){ + return ret; + } + value = (ret & ~mask) | (value & mask); + if(mask > 0xFFFF){ + ret = write_reg16(sensor->slv_addr, reg, value >> 8); + if(ret >= 0){ + ret = write_reg(sensor->slv_addr, reg+2, value & 0xFF); + } + } else if(mask > 0xFF){ + ret = write_reg16(sensor->slv_addr, reg, value); + } else { + ret = write_reg(sensor->slv_addr, reg, value); + } + return ret; +} + +static int set_res_raw(sensor_t *sensor, int startX, int startY, int endX, int endY, int offsetX, int offsetY, int totalX, int totalY, int outputX, int outputY, bool scale, bool binning) +{ + int ret = 0; + ret = write_addr_reg(sensor->slv_addr, X_ADDR_ST_H, startX, startY) + || write_addr_reg(sensor->slv_addr, X_ADDR_END_H, endX, endY) + || write_addr_reg(sensor->slv_addr, X_OFFSET_H, offsetX, offsetY) + || write_addr_reg(sensor->slv_addr, X_TOTAL_SIZE_H, totalX, totalY) + || write_addr_reg(sensor->slv_addr, X_OUTPUT_SIZE_H, outputX, outputY) + || write_reg_bits(sensor->slv_addr, ISP_CONTROL_01, 0x20, scale); + if(!ret){ + sensor->status.scale = scale; + sensor->status.binning = binning; + ret = set_image_options(sensor); + } + return ret; +} + +static int _set_pll(sensor_t *sensor, int bypass, int multiplier, int sys_div, int root_2x, int pre_div, int seld5, int pclk_manual, int pclk_div) +{ + return set_pll(sensor, bypass > 0, multiplier, sys_div, pre_div, root_2x > 0, seld5, pclk_manual > 0, pclk_div); +} + +static int set_xclk(sensor_t *sensor, int timer, int xclk) +{ + int ret = 0; + sensor->xclk_freq_hz = xclk * 1000000U; + ret = xclk_timer_conf(timer, sensor->xclk_freq_hz); + return ret; +} + +static int init_status(sensor_t *sensor) +{ + sensor->status.brightness = 0; + sensor->status.contrast = 0; + sensor->status.saturation = 0; + sensor->status.sharpness = (read_reg(sensor->slv_addr, 0x5303) / 8) - 3; + sensor->status.denoise = get_denoise(sensor); + sensor->status.ae_level = 0; + sensor->status.gainceiling = read_reg16(sensor->slv_addr, 0x3A18) & 0x3FF; + sensor->status.awb = check_reg_mask(sensor->slv_addr, ISP_CONTROL_01, 0x01); + sensor->status.dcw = !check_reg_mask(sensor->slv_addr, 0x5183, 0x80); + sensor->status.agc = !check_reg_mask(sensor->slv_addr, AEC_PK_MANUAL, AEC_PK_MANUAL_AGC_MANUALEN); + sensor->status.aec = !check_reg_mask(sensor->slv_addr, AEC_PK_MANUAL, AEC_PK_MANUAL_AEC_MANUALEN); + sensor->status.hmirror = check_reg_mask(sensor->slv_addr, TIMING_TC_REG21, TIMING_TC_REG21_HMIRROR); + sensor->status.vflip = check_reg_mask(sensor->slv_addr, TIMING_TC_REG20, TIMING_TC_REG20_VFLIP); + sensor->status.colorbar = check_reg_mask(sensor->slv_addr, PRE_ISP_TEST_SETTING_1, TEST_COLOR_BAR); + sensor->status.bpc = check_reg_mask(sensor->slv_addr, 0x5000, 0x04); + sensor->status.wpc = check_reg_mask(sensor->slv_addr, 0x5000, 0x02); + sensor->status.raw_gma = check_reg_mask(sensor->slv_addr, 0x5000, 0x20); + sensor->status.lenc = check_reg_mask(sensor->slv_addr, 0x5000, 0x80); + sensor->status.quality = read_reg(sensor->slv_addr, COMPRESSION_CTRL07) & 0x3f; + sensor->status.special_effect = 0; + sensor->status.wb_mode = 0; + sensor->status.awb_gain = check_reg_mask(sensor->slv_addr, 0x3406, 0x01); + sensor->status.agc_gain = get_agc_gain(sensor); + sensor->status.aec_value = get_aec_value(sensor); + sensor->status.aec2 = check_reg_mask(sensor->slv_addr, 0x3a00, 0x04); + return 0; +} + +int ov3660_detect(int slv_addr, sensor_id_t *id) +{ + if (OV3660_SCCB_ADDR == slv_addr) { + uint8_t h = SCCB_Read16(slv_addr, 0x300A); + uint8_t l = SCCB_Read16(slv_addr, 0x300B); + uint16_t PID = (h<<8) | l; + if (OV3660_PID == PID) { + id->PID = PID; + return PID; + } else { + ESP_LOGI(TAG, "Mismatch PID=0x%x", PID); + } + } + return 0; +} + +int ov3660_init(sensor_t *sensor) +{ + sensor->reset = reset; + sensor->set_pixformat = set_pixformat; + sensor->set_framesize = set_framesize; + sensor->set_contrast = set_contrast; + sensor->set_brightness = set_brightness; + sensor->set_saturation = set_saturation; + sensor->set_sharpness = set_sharpness; + sensor->set_gainceiling = set_gainceiling; + sensor->set_quality = set_quality; + sensor->set_colorbar = set_colorbar; + sensor->set_gain_ctrl = set_gain_ctrl; + sensor->set_exposure_ctrl = set_exposure_ctrl; + sensor->set_whitebal = set_whitebal; + sensor->set_hmirror = set_hmirror; + sensor->set_vflip = set_vflip; + sensor->init_status = init_status; + sensor->set_aec2 = set_aec2; + sensor->set_aec_value = set_aec_value; + sensor->set_special_effect = set_special_effect; + sensor->set_wb_mode = set_wb_mode; + sensor->set_ae_level = set_ae_level; + sensor->set_dcw = set_dcw_dsp; + sensor->set_bpc = set_bpc_dsp; + sensor->set_wpc = set_wpc_dsp; + sensor->set_awb_gain = set_awb_gain_dsp; + sensor->set_agc_gain = set_agc_gain; + sensor->set_raw_gma = set_raw_gma_dsp; + sensor->set_lenc = set_lenc_dsp; + sensor->set_denoise = set_denoise; + + sensor->get_reg = get_reg; + sensor->set_reg = set_reg; + sensor->set_res_raw = set_res_raw; + sensor->set_pll = _set_pll; + sensor->set_xclk = set_xclk; + return 0; +} diff --git a/lib/libesp32_div/esp32-camera/sensors/ov5640.c b/lib/libesp32_div/esp32-camera/sensors/ov5640.c new file mode 100644 index 000000000..a32b374f5 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/ov5640.c @@ -0,0 +1,1130 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * OV3660 driver. + * + */ +#include +#include +#include +#include "sccb.h" +#include "xclk.h" +#include "ov5640.h" +#include "ov5640_regs.h" +#include "ov5640_settings.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#else +#include "esp_log.h" +static const char *TAG = "ov5640"; +#endif + +//#define REG_DEBUG_ON + +static int read_reg(uint8_t slv_addr, const uint16_t reg){ + int ret = SCCB_Read16(slv_addr, reg); +#ifdef REG_DEBUG_ON + if (ret < 0) { + ESP_LOGE(TAG, "READ REG 0x%04x FAILED: %d", reg, ret); + } +#endif + return ret; +} + +static int check_reg_mask(uint8_t slv_addr, uint16_t reg, uint8_t mask){ + return (read_reg(slv_addr, reg) & mask) == mask; +} + +static int read_reg16(uint8_t slv_addr, const uint16_t reg){ + int ret = 0, ret2 = 0; + ret = read_reg(slv_addr, reg); + if (ret >= 0) { + ret = (ret & 0xFF) << 8; + ret2 = read_reg(slv_addr, reg+1); + if (ret2 < 0) { + ret = ret2; + } else { + ret |= ret2 & 0xFF; + } + } + return ret; +} + +//static void dump_reg(sensor_t *sensor, const uint16_t reg){ +// int v = SCCB_Read16(sensor->slv_addr, reg); +// if(v < 0){ +// ets_printf(" 0x%04x: FAIL[%d]\n", reg, v); +// } else { +// ets_printf(" 0x%04x: 0x%02X\n", reg, v); +// } +//} +// +//static void dump_range(sensor_t *sensor, const char * name, const uint16_t start_reg, const uint16_t end_reg){ +// ets_printf("%s: 0x%04x - 0x%04X\n", name, start_reg, end_reg); +// for(uint16_t reg = start_reg; reg <= end_reg; reg++){ +// dump_reg(sensor, reg); +// } +//} +// +//static void dump_regs(sensor_t *sensor){ +//// dump_range(sensor, "All Regs", 0x3000, 0x6100); +//// dump_range(sensor, "system and IO pad control", 0x3000, 0x3052); +//// dump_range(sensor, "SCCB control", 0x3100, 0x3108); +//// dump_range(sensor, "SRB control", 0x3200, 0x3211); +//// dump_range(sensor, "AWB gain control", 0x3400, 0x3406); +//// dump_range(sensor, "AEC/AGC control", 0x3500, 0x350D); +//// dump_range(sensor, "VCM control", 0x3600, 0x3606); +//// dump_range(sensor, "timing control", 0x3800, 0x3821); +//// dump_range(sensor, "AEC/AGC power down domain control", 0x3A00, 0x3A25); +//// dump_range(sensor, "strobe control", 0x3B00, 0x3B0C); +//// dump_range(sensor, "50/60Hz detector control", 0x3C00, 0x3C1E); +//// dump_range(sensor, "OTP control", 0x3D00, 0x3D21); +//// dump_range(sensor, "MC control", 0x3F00, 0x3F0D); +//// dump_range(sensor, "BLC control", 0x4000, 0x4033); +//// dump_range(sensor, "frame control", 0x4201, 0x4202); +//// dump_range(sensor, "format control", 0x4300, 0x430D); +//// dump_range(sensor, "JPEG control", 0x4400, 0x4431); +//// dump_range(sensor, "VFIFO control", 0x4600, 0x460D); +//// dump_range(sensor, "DVP control", 0x4709, 0x4745); +//// dump_range(sensor, "MIPI control", 0x4800, 0x4837); +//// dump_range(sensor, "ISP frame control", 0x4901, 0x4902); +//// dump_range(sensor, "ISP top control", 0x5000, 0x5063); +//// dump_range(sensor, "AWB control", 0x5180, 0x51D0); +//// dump_range(sensor, "CIP control", 0x5300, 0x530F); +//// dump_range(sensor, "CMX control", 0x5380, 0x538B); +//// dump_range(sensor, "gamma control", 0x5480, 0x5490); +//// dump_range(sensor, "SDE control", 0x5580, 0x558C); +//// dump_range(sensor, "scale control", 0x5600, 0x5606); +//// dump_range(sensor, "AVG control", 0x5680, 0x56A2); +//// dump_range(sensor, "LENC control", 0x5800, 0x5849); +//// dump_range(sensor, "AFC control", 0x6000, 0x603F); +//} + +static int write_reg(uint8_t slv_addr, const uint16_t reg, uint8_t value){ + int ret = 0; +#ifndef REG_DEBUG_ON + ret = SCCB_Write16(slv_addr, reg, value); +#else + int old_value = read_reg(slv_addr, reg); + if (old_value < 0) { + return old_value; + } + if ((uint8_t)old_value != value) { + ESP_LOGI(TAG, "NEW REG 0x%04x: 0x%02x to 0x%02x", reg, (uint8_t)old_value, value); + ret = SCCB_Write16(slv_addr, reg, value); + } else { + ESP_LOGD(TAG, "OLD REG 0x%04x: 0x%02x", reg, (uint8_t)old_value); + ret = SCCB_Write16(slv_addr, reg, value);//maybe not? + } + if (ret < 0) { + ESP_LOGE(TAG, "WRITE REG 0x%04x FAILED: %d", reg, ret); + } +#endif + return ret; +} + +static int set_reg_bits(uint8_t slv_addr, uint16_t reg, uint8_t offset, uint8_t mask, uint8_t value) +{ + int ret = 0; + uint8_t c_value, new_value; + ret = read_reg(slv_addr, reg); + if(ret < 0) { + return ret; + } + c_value = ret; + new_value = (c_value & ~(mask << offset)) | ((value & mask) << offset); + ret = write_reg(slv_addr, reg, new_value); + return ret; +} + +static int write_regs(uint8_t slv_addr, const uint16_t (*regs)[2]) +{ + int i = 0, ret = 0; + while (!ret && regs[i][0] != REGLIST_TAIL) { + if (regs[i][0] == REG_DLY) { + vTaskDelay(regs[i][1] / portTICK_PERIOD_MS); + } else { + ret = write_reg(slv_addr, regs[i][0], regs[i][1]); + } + i++; + } + return ret; +} + +static int write_reg16(uint8_t slv_addr, const uint16_t reg, uint16_t value) +{ + if (write_reg(slv_addr, reg, value >> 8) || write_reg(slv_addr, reg + 1, value)) { + return -1; + } + return 0; +} + +static int write_addr_reg(uint8_t slv_addr, const uint16_t reg, uint16_t x_value, uint16_t y_value) +{ + if (write_reg16(slv_addr, reg, x_value) || write_reg16(slv_addr, reg + 2, y_value)) { + return -1; + } + return 0; +} + +#define write_reg_bits(slv_addr, reg, mask, enable) set_reg_bits(slv_addr, reg, 0, mask, (enable)?(mask):0) + +static int calc_sysclk(int xclk, bool pll_bypass, int pll_multiplier, int pll_sys_div, int pre_div, bool root_2x, int pclk_root_div, bool pclk_manual, int pclk_div) +{ + const float pll_pre_div2x_map[] = { 1, 1, 2, 3, 4, 1.5, 6, 2.5, 8}; + const int pll_pclk_root_div_map[] = { 1, 2, 4, 8 }; + + if(!pll_sys_div) { + pll_sys_div = 1; + } + + float pll_pre_div = pll_pre_div2x_map[pre_div]; + unsigned int root_2x_div = root_2x?2:1; + unsigned int pll_pclk_root_div = pll_pclk_root_div_map[pclk_root_div]; + + unsigned int REFIN = xclk / pll_pre_div; + + unsigned int VCO = REFIN * pll_multiplier / root_2x_div; + + unsigned int PLL_CLK = pll_bypass?(xclk):(VCO / pll_sys_div * 2 / 5);//5 here is 10bit mode / 2, for 8bit it should be 4 (reg 0x3034) + + unsigned int PCLK = PLL_CLK / pll_pclk_root_div / ((pclk_manual && pclk_div)?pclk_div:2); + + unsigned int SYSCLK = PLL_CLK / 4; + + ESP_LOGI(TAG, "Calculated XVCLK: %d Hz, REFIN: %u Hz, VCO: %u Hz, PLL_CLK: %u Hz, SYSCLK: %u Hz, PCLK: %u Hz", xclk, REFIN, VCO, PLL_CLK, SYSCLK, PCLK); + return SYSCLK; +} + +static int set_pll(sensor_t *sensor, bool bypass, uint8_t multiplier, uint8_t sys_div, uint8_t pre_div, bool root_2x, uint8_t pclk_root_div, bool pclk_manual, uint8_t pclk_div){ + int ret = 0; + if(multiplier > 252 || multiplier < 4 || sys_div > 15 || pre_div > 8 || pclk_div > 31 || pclk_root_div > 3){ + ESP_LOGE(TAG, "Invalid arguments"); + return -1; + } + if(multiplier > 127){ + multiplier &= 0xFE;//only even integers above 127 + } + ESP_LOGI(TAG, "Set PLL: bypass: %u, multiplier: %u, sys_div: %u, pre_div: %u, root_2x: %u, pclk_root_div: %u, pclk_manual: %u, pclk_div: %u", bypass, multiplier, sys_div, pre_div, root_2x, pclk_root_div, pclk_manual, pclk_div); + + calc_sysclk(sensor->xclk_freq_hz, bypass, multiplier, sys_div, pre_div, root_2x, pclk_root_div, pclk_manual, pclk_div); + + ret = write_reg(sensor->slv_addr, 0x3039, bypass?0x80:0x00); + if (ret == 0) { + ret = write_reg(sensor->slv_addr, 0x3034, 0x1A);//10bit mode + } + if (ret == 0) { + ret = write_reg(sensor->slv_addr, 0x3035, 0x01 | ((sys_div & 0x0f) << 4)); + } + if (ret == 0) { + ret = write_reg(sensor->slv_addr, 0x3036, multiplier & 0xff); + } + if (ret == 0) { + ret = write_reg(sensor->slv_addr, 0x3037, (pre_div & 0xf) | (root_2x?0x10:0x00)); + } + if (ret == 0) { + ret = write_reg(sensor->slv_addr, 0x3108, (pclk_root_div & 0x3) << 4 | 0x06); + } + if (ret == 0) { + ret = write_reg(sensor->slv_addr, 0x3824, pclk_div & 0x1f); + } + if (ret == 0) { + ret = write_reg(sensor->slv_addr, 0x460C, pclk_manual?0x22:0x20); + } + if (ret == 0) { + ret = write_reg(sensor->slv_addr, 0x3103, 0x13);// system clock from pll, bit[1] + } + if(ret){ + ESP_LOGE(TAG, "set_sensor_pll FAILED!"); + } + return ret; +} + +static int set_ae_level(sensor_t *sensor, int level); + +static int reset(sensor_t *sensor) +{ + //dump_regs(sensor); + vTaskDelay(100 / portTICK_PERIOD_MS); + int ret = 0; + // Software Reset: clear all registers and reset them to their default values + ret = write_reg(sensor->slv_addr, SYSTEM_CTROL0, 0x82); + if(ret){ + ESP_LOGE(TAG, "Software Reset FAILED!"); + return ret; + } + vTaskDelay(100 / portTICK_PERIOD_MS); + ret = write_regs(sensor->slv_addr, sensor_default_regs); + if (ret == 0) { + ESP_LOGD(TAG, "Camera defaults loaded"); + vTaskDelay(100 / portTICK_PERIOD_MS); + //write_regs(sensor->slv_addr, sensor_regs_awb0); + //write_regs(sensor->slv_addr, sensor_regs_gamma1); + } + return ret; +} + +static int set_pixformat(sensor_t *sensor, pixformat_t pixformat) +{ + int ret = 0; + const uint16_t (*regs)[2]; + + switch (pixformat) { + case PIXFORMAT_YUV422: + regs = sensor_fmt_yuv422; + break; + + case PIXFORMAT_GRAYSCALE: + regs = sensor_fmt_grayscale; + break; + + case PIXFORMAT_RGB565: + case PIXFORMAT_RGB888: + regs = sensor_fmt_rgb565; + break; + + case PIXFORMAT_JPEG: + regs = sensor_fmt_jpeg; + break; + + case PIXFORMAT_RAW: + regs = sensor_fmt_raw; + break; + + default: + ESP_LOGE(TAG, "Unsupported pixformat: %u", pixformat); + return -1; + } + + ret = write_regs(sensor->slv_addr, regs); + if(ret == 0) { + sensor->pixformat = pixformat; + ESP_LOGD(TAG, "Set pixformat to: %u", pixformat); + } + return ret; +} + +static int set_image_options(sensor_t *sensor) +{ + int ret = 0; + uint8_t reg20 = 0; + uint8_t reg21 = 0; + uint8_t reg4514 = 0; + uint8_t reg4514_test = 0; + + // compression + if (sensor->pixformat == PIXFORMAT_JPEG) { + reg21 |= 0x20; + } + + // binning + if (!sensor->status.binning) { + reg20 |= 0x40; + } else { + reg20 |= 0x01; + reg21 |= 0x01; + reg4514_test |= 4; + } + + // V-Flip + if (sensor->status.vflip) { + reg20 |= 0x06; + reg4514_test |= 1; + } + + // H-Mirror + if (sensor->status.hmirror) { + reg21 |= 0x06; + reg4514_test |= 2; + } + + switch (reg4514_test) { + //no binning + case 0: reg4514 = 0x88; break;//normal + case 1: reg4514 = 0x00; break;//v-flip + case 2: reg4514 = 0xbb; break;//h-mirror + case 3: reg4514 = 0x00; break;//v-flip+h-mirror + //binning + case 4: reg4514 = 0xaa; break;//normal + case 5: reg4514 = 0xbb; break;//v-flip + case 6: reg4514 = 0xbb; break;//h-mirror + case 7: reg4514 = 0xaa; break;//v-flip+h-mirror + } + + if(write_reg(sensor->slv_addr, TIMING_TC_REG20, reg20) + || write_reg(sensor->slv_addr, TIMING_TC_REG21, reg21) + || write_reg(sensor->slv_addr, 0x4514, reg4514)){ + ESP_LOGE(TAG, "Setting Image Options Failed"); + return -1; + } + + if (!sensor->status.binning) { + ret = write_reg(sensor->slv_addr, 0x4520, 0x10) + || write_reg(sensor->slv_addr, X_INCREMENT, 0x11)//odd:1, even: 1 + || write_reg(sensor->slv_addr, Y_INCREMENT, 0x11);//odd:1, even: 1 + } else { + ret = write_reg(sensor->slv_addr, 0x4520, 0x0b) + || write_reg(sensor->slv_addr, X_INCREMENT, 0x31)//odd:3, even: 1 + || write_reg(sensor->slv_addr, Y_INCREMENT, 0x31);//odd:3, even: 1 + } + + ESP_LOGD(TAG, "Set Image Options: Compression: %u, Binning: %u, V-Flip: %u, H-Mirror: %u, Reg-4514: 0x%02x", + sensor->pixformat == PIXFORMAT_JPEG, sensor->status.binning, sensor->status.vflip, sensor->status.hmirror, reg4514); + return ret; +} + +static int set_framesize(sensor_t *sensor, framesize_t framesize) +{ + int ret = 0; + framesize_t old_framesize = sensor->status.framesize; + sensor->status.framesize = framesize; + + if(framesize > FRAMESIZE_QSXGA){ + ESP_LOGE(TAG, "Invalid framesize: %u", framesize); + return -1; + } + uint16_t w = resolution[framesize].width; + uint16_t h = resolution[framesize].height; + aspect_ratio_t ratio = resolution[framesize].aspect_ratio; + ratio_settings_t settings = ratio_table[ratio]; + + sensor->status.binning = (w <= (settings.max_width / 2) && h <= (settings.max_height / 2)); + sensor->status.scale = !((w == settings.max_width && h == settings.max_height) + || (w == (settings.max_width / 2) && h == (settings.max_height / 2))); + + ret = write_addr_reg(sensor->slv_addr, X_ADDR_ST_H, settings.start_x, settings.start_y) + || write_addr_reg(sensor->slv_addr, X_ADDR_END_H, settings.end_x, settings.end_y) + || write_addr_reg(sensor->slv_addr, X_OUTPUT_SIZE_H, w, h); + + if (ret) { + goto fail; + } + + if (!sensor->status.binning) { + ret = write_addr_reg(sensor->slv_addr, X_TOTAL_SIZE_H, settings.total_x, settings.total_y) + || write_addr_reg(sensor->slv_addr, X_OFFSET_H, settings.offset_x, settings.offset_y); + } else { + if (w > 920) { + ret = write_addr_reg(sensor->slv_addr, X_TOTAL_SIZE_H, settings.total_x - 200, settings.total_y / 2); + } else { + ret = write_addr_reg(sensor->slv_addr, X_TOTAL_SIZE_H, 2060, settings.total_y / 2); + } + if (ret == 0) { + ret = write_addr_reg(sensor->slv_addr, X_OFFSET_H, settings.offset_x / 2, settings.offset_y / 2); + } + } + + if (ret == 0) { + ret = write_reg_bits(sensor->slv_addr, ISP_CONTROL_01, 0x20, sensor->status.scale); + } + + if (ret == 0) { + ret = set_image_options(sensor); + } + + if (ret) { + goto fail; + } + + if (sensor->pixformat == PIXFORMAT_JPEG) { + //10MHz PCLK + uint8_t sys_mul = 200; + if(framesize < FRAMESIZE_QVGA || sensor->xclk_freq_hz == 16000000){ + sys_mul = 160; + } else if(framesize < FRAMESIZE_XGA){ + sys_mul = 180; + } + ret = set_pll(sensor, false, sys_mul, 4, 2, false, 2, true, 4); + //Set PLL: bypass: 0, multiplier: sys_mul, sys_div: 4, pre_div: 2, root_2x: 0, pclk_root_div: 2, pclk_manual: 1, pclk_div: 4 + } else { + //ret = set_pll(sensor, false, 8, 1, 1, false, 1, true, 4); + if (framesize > FRAMESIZE_HVGA) { + ret = set_pll(sensor, false, 10, 1, 2, false, 1, true, 2); + } else if (framesize >= FRAMESIZE_QVGA) { + ret = set_pll(sensor, false, 8, 1, 1, false, 1, true, 4); + } else { + ret = set_pll(sensor, false, 20, 1, 1, false, 1, true, 8); + } + } + + if (ret == 0) { + ESP_LOGD(TAG, "Set framesize to: %ux%u", w, h); + } + return ret; + +fail: + sensor->status.framesize = old_framesize; + ESP_LOGE(TAG, "Setting framesize to: %ux%u failed", w, h); + return ret; +} + +static int set_hmirror(sensor_t *sensor, int enable) +{ + int ret = 0; + sensor->status.hmirror = enable; + ret = set_image_options(sensor); + if (ret == 0) { + ESP_LOGD(TAG, "Set h-mirror to: %d", enable); + } + return ret; +} + +static int set_vflip(sensor_t *sensor, int enable) +{ + int ret = 0; + sensor->status.vflip = enable; + ret = set_image_options(sensor); + if (ret == 0) { + ESP_LOGD(TAG, "Set v-flip to: %d", enable); + } + return ret; +} + +static int set_quality(sensor_t *sensor, int qs) +{ + int ret = 0; + ret = write_reg(sensor->slv_addr, COMPRESSION_CTRL07, qs & 0x3f); + if (ret == 0) { + sensor->status.quality = qs; + ESP_LOGD(TAG, "Set quality to: %d", qs); + } + return ret; +} + +static int set_colorbar(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, PRE_ISP_TEST_SETTING_1, TEST_COLOR_BAR, enable); + if (ret == 0) { + sensor->status.colorbar = enable; + ESP_LOGD(TAG, "Set colorbar to: %d", enable); + } + return ret; +} + +static int set_gain_ctrl(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, AEC_PK_MANUAL, AEC_PK_MANUAL_AGC_MANUALEN, !enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set gain_ctrl to: %d", enable); + sensor->status.agc = enable; + } + return ret; +} + +static int set_exposure_ctrl(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, AEC_PK_MANUAL, AEC_PK_MANUAL_AEC_MANUALEN, !enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set exposure_ctrl to: %d", enable); + sensor->status.aec = enable; + } + return ret; +} + +static int set_whitebal(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, ISP_CONTROL_01, 0x01, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set awb to: %d", enable); + sensor->status.awb = enable; + } + return ret; +} + +//Advanced AWB +static int set_dcw_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, 0x5183, 0x80, !enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set dcw to: %d", enable); + sensor->status.dcw = enable; + } + return ret; +} + +//night mode enable +static int set_aec2(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, 0x3a00, 0x04, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set aec2 to: %d", enable); + sensor->status.aec2 = enable; + } + return ret; +} + +static int set_bpc_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, 0x5000, 0x04, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set bpc to: %d", enable); + sensor->status.bpc = enable; + } + return ret; +} + +static int set_wpc_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, 0x5000, 0x02, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set wpc to: %d", enable); + sensor->status.wpc = enable; + } + return ret; +} + +//Gamma enable +static int set_raw_gma_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, 0x5000, 0x20, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set raw_gma to: %d", enable); + sensor->status.raw_gma = enable; + } + return ret; +} + +static int set_lenc_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = write_reg_bits(sensor->slv_addr, 0x5000, 0x80, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set lenc to: %d", enable); + sensor->status.lenc = enable; + } + return ret; +} + +static int get_agc_gain(sensor_t *sensor) +{ + int ra = read_reg(sensor->slv_addr, 0x350a); + if (ra < 0) { + return 0; + } + int rb = read_reg(sensor->slv_addr, 0x350b); + if (rb < 0) { + return 0; + } + int res = (rb & 0xF0) >> 4 | (ra & 0x03) << 4; + if (rb & 0x0F) { + res += 1; + } + return res; +} + +//real gain +static int set_agc_gain(sensor_t *sensor, int gain) +{ + int ret = 0; + if(gain < 0) { + gain = 0; + } else if(gain > 64) { + gain = 64; + } + + //gain value is 6.4 bits float + //in order to use the max range, we deduct 1/16 + int gainv = gain << 4; + if(gainv){ + gainv -= 1; + } + + ret = write_reg(sensor->slv_addr, 0x350a, gainv >> 8) || write_reg(sensor->slv_addr, 0x350b, gainv & 0xff); + if (ret == 0) { + ESP_LOGD(TAG, "Set agc_gain to: %d", gain); + sensor->status.agc_gain = gain; + } + return ret; +} + +static int get_aec_value(sensor_t *sensor) +{ + int ra = read_reg(sensor->slv_addr, 0x3500); + if (ra < 0) { + return 0; + } + int rb = read_reg(sensor->slv_addr, 0x3501); + if (rb < 0) { + return 0; + } + int rc = read_reg(sensor->slv_addr, 0x3502); + if (rc < 0) { + return 0; + } + int res = (ra & 0x0F) << 12 | (rb & 0xFF) << 4 | (rc & 0xF0) >> 4; + return res; +} + +static int set_aec_value(sensor_t *sensor, int value) +{ + int ret = 0, max_val = 0; + max_val = read_reg16(sensor->slv_addr, 0x380e); + if (max_val < 0) { + ESP_LOGE(TAG, "Could not read max aec_value"); + return -1; + } + if (value > max_val) { + value =max_val; + } + + ret = write_reg(sensor->slv_addr, 0x3500, (value >> 12) & 0x0F) + || write_reg(sensor->slv_addr, 0x3501, (value >> 4) & 0xFF) + || write_reg(sensor->slv_addr, 0x3502, (value << 4) & 0xF0); + + if (ret == 0) { + ESP_LOGD(TAG, "Set aec_value to: %d / %d", value, max_val); + sensor->status.aec_value = value; + } + return ret; +} + +static int set_ae_level(sensor_t *sensor, int level) +{ + int ret = 0; + if (level < -5 || level > 5) { + return -1; + } + //good targets are between 5 and 115 + int target_level = ((level + 5) * 10) + 5; + + int level_high, level_low; + int fast_high, fast_low; + + level_low = target_level * 23 / 25; //0.92 (0.46) + level_high = target_level * 27 / 25; //1.08 (2.08) + + fast_low = level_low >> 1; + fast_high = level_high << 1; + + if(fast_high>255) { + fast_high = 255; + } + + ret = write_reg(sensor->slv_addr, 0x3a0f, level_high) + || write_reg(sensor->slv_addr, 0x3a10, level_low) + || write_reg(sensor->slv_addr, 0x3a1b, level_high) + || write_reg(sensor->slv_addr, 0x3a1e, level_low) + || write_reg(sensor->slv_addr, 0x3a11, fast_high) + || write_reg(sensor->slv_addr, 0x3a1f, fast_low); + + if (ret == 0) { + ESP_LOGD(TAG, "Set ae_level to: %d", level); + sensor->status.ae_level = level; + } + return ret; +} + +static int set_wb_mode(sensor_t *sensor, int mode) +{ + int ret = 0; + if (mode < 0 || mode > 4) { + return -1; + } + + ret = write_reg(sensor->slv_addr, 0x3406, (mode != 0)); + if (ret) { + return ret; + } + switch (mode) { + case 1://Sunny + ret = write_reg16(sensor->slv_addr, 0x3400, 0x5e0) //AWB R GAIN + || write_reg16(sensor->slv_addr, 0x3402, 0x410) //AWB G GAIN + || write_reg16(sensor->slv_addr, 0x3404, 0x540);//AWB B GAIN + break; + case 2://Cloudy + ret = write_reg16(sensor->slv_addr, 0x3400, 0x650) //AWB R GAIN + || write_reg16(sensor->slv_addr, 0x3402, 0x410) //AWB G GAIN + || write_reg16(sensor->slv_addr, 0x3404, 0x4f0);//AWB B GAIN + break; + case 3://Office + ret = write_reg16(sensor->slv_addr, 0x3400, 0x520) //AWB R GAIN + || write_reg16(sensor->slv_addr, 0x3402, 0x410) //AWB G GAIN + || write_reg16(sensor->slv_addr, 0x3404, 0x660);//AWB B GAIN + break; + case 4://HOME + ret = write_reg16(sensor->slv_addr, 0x3400, 0x420) //AWB R GAIN + || write_reg16(sensor->slv_addr, 0x3402, 0x3f0) //AWB G GAIN + || write_reg16(sensor->slv_addr, 0x3404, 0x710);//AWB B GAIN + break; + default://AUTO + break; + } + + if (ret == 0) { + ESP_LOGD(TAG, "Set wb_mode to: %d", mode); + sensor->status.wb_mode = mode; + } + return ret; +} + +static int set_awb_gain_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + int old_mode = sensor->status.wb_mode; + int mode = enable?old_mode:0; + + ret = set_wb_mode(sensor, mode); + + if (ret == 0) { + sensor->status.wb_mode = old_mode; + ESP_LOGD(TAG, "Set awb_gain to: %d", enable); + sensor->status.awb_gain = enable; + } + return ret; +} + +static int set_special_effect(sensor_t *sensor, int effect) +{ + int ret=0; + if (effect < 0 || effect > 6) { + return -1; + } + + uint8_t * regs = (uint8_t *)sensor_special_effects[effect]; + ret = write_reg(sensor->slv_addr, 0x5580, regs[0]) + || write_reg(sensor->slv_addr, 0x5583, regs[1]) + || write_reg(sensor->slv_addr, 0x5584, regs[2]) + || write_reg(sensor->slv_addr, 0x5003, regs[3]); + + if (ret == 0) { + ESP_LOGD(TAG, "Set special_effect to: %d", effect); + sensor->status.special_effect = effect; + } + return ret; +} + +static int set_brightness(sensor_t *sensor, int level) +{ + int ret = 0; + uint8_t value = 0; + bool negative = false; + + switch (level) { + case 3: + value = 0x30; + break; + case 2: + value = 0x20; + break; + case 1: + value = 0x10; + break; + case -1: + value = 0x10; + negative = true; + break; + case -2: + value = 0x20; + negative = true; + break; + case -3: + value = 0x30; + negative = true; + break; + default: // 0 + break; + } + + ret = write_reg(sensor->slv_addr, 0x5587, value); + if (ret == 0) { + ret = write_reg_bits(sensor->slv_addr, 0x5588, 0x08, negative); + } + + if (ret == 0) { + ESP_LOGD(TAG, "Set brightness to: %d", level); + sensor->status.brightness = level; + } + return ret; +} + +static int set_contrast(sensor_t *sensor, int level) +{ + int ret = 0; + if(level > 3 || level < -3) { + return -1; + } + ret = write_reg(sensor->slv_addr, 0x5586, (level + 4) << 3); + + if (ret == 0) { + ESP_LOGD(TAG, "Set contrast to: %d", level); + sensor->status.contrast = level; + } + return ret; +} + +static int set_saturation(sensor_t *sensor, int level) +{ + int ret = 0; + if(level > 4 || level < -4) { + return -1; + } + + uint8_t * regs = (uint8_t *)sensor_saturation_levels[level+4]; + for(int i=0; i<11; i++) { + ret = write_reg(sensor->slv_addr, 0x5381 + i, regs[i]); + if (ret) { + break; + } + } + + if (ret == 0) { + ESP_LOGD(TAG, "Set saturation to: %d", level); + sensor->status.saturation = level; + } + return ret; +} + +static int set_sharpness(sensor_t *sensor, int level) +{ + int ret = 0; + if(level > 3 || level < -3) { + return -1; + } + + uint8_t mt_offset_2 = (level + 3) * 8; + uint8_t mt_offset_1 = mt_offset_2 + 1; + + ret = write_reg_bits(sensor->slv_addr, 0x5308, 0x40, false)//0x40 means auto + || write_reg(sensor->slv_addr, 0x5300, 0x10) + || write_reg(sensor->slv_addr, 0x5301, 0x10) + || write_reg(sensor->slv_addr, 0x5302, mt_offset_1) + || write_reg(sensor->slv_addr, 0x5303, mt_offset_2) + || write_reg(sensor->slv_addr, 0x5309, 0x10) + || write_reg(sensor->slv_addr, 0x530a, 0x10) + || write_reg(sensor->slv_addr, 0x530b, 0x04) + || write_reg(sensor->slv_addr, 0x530c, 0x06); + + if (ret == 0) { + ESP_LOGD(TAG, "Set sharpness to: %d", level); + sensor->status.sharpness = level; + } + return ret; +} + +static int set_gainceiling(sensor_t *sensor, gainceiling_t level) +{ + int ret = 0, l = (int)level; + + ret = write_reg(sensor->slv_addr, 0x3A18, (l >> 8) & 3) + || write_reg(sensor->slv_addr, 0x3A19, l & 0xFF); + + if (ret == 0) { + ESP_LOGD(TAG, "Set gainceiling to: %d", l); + sensor->status.gainceiling = l; + } + return ret; +} + +static int get_denoise(sensor_t *sensor) +{ + if (!check_reg_mask(sensor->slv_addr, 0x5308, 0x10)) { + return 0; + } + return (read_reg(sensor->slv_addr, 0x5306) / 4) + 1; +} + +static int set_denoise(sensor_t *sensor, int level) +{ + int ret = 0; + if (level < 0 || level > 8) { + return -1; + } + + ret = write_reg_bits(sensor->slv_addr, 0x5308, 0x10, level > 0); + if (ret == 0 && level > 0) { + ret = write_reg(sensor->slv_addr, 0x5306, (level - 1) * 4); + } + + if (ret == 0) { + ESP_LOGD(TAG, "Set denoise to: %d", level); + sensor->status.denoise = level; + } + return ret; +} + +static int get_reg(sensor_t *sensor, int reg, int mask) +{ + int ret = 0, ret2 = 0; + if(mask > 0xFF){ + ret = read_reg16(sensor->slv_addr, reg); + if(ret >= 0 && mask > 0xFFFF){ + ret2 = read_reg(sensor->slv_addr, reg+2); + if(ret2 >= 0){ + ret = (ret << 8) | ret2 ; + } else { + ret = ret2; + } + } + } else { + ret = read_reg(sensor->slv_addr, reg); + } + if(ret > 0){ + ret &= mask; + } + return ret; +} + +static int set_reg(sensor_t *sensor, int reg, int mask, int value) +{ + int ret = 0, ret2 = 0; + if(mask > 0xFF){ + ret = read_reg16(sensor->slv_addr, reg); + if(ret >= 0 && mask > 0xFFFF){ + ret2 = read_reg(sensor->slv_addr, reg+2); + if(ret2 >= 0){ + ret = (ret << 8) | ret2 ; + } else { + ret = ret2; + } + } + } else { + ret = read_reg(sensor->slv_addr, reg); + } + if(ret < 0){ + return ret; + } + value = (ret & ~mask) | (value & mask); + if(mask > 0xFFFF){ + ret = write_reg16(sensor->slv_addr, reg, value >> 8); + if(ret >= 0){ + ret = write_reg(sensor->slv_addr, reg+2, value & 0xFF); + } + } else if(mask > 0xFF){ + ret = write_reg16(sensor->slv_addr, reg, value); + } else { + ret = write_reg(sensor->slv_addr, reg, value); + } + return ret; +} + +static int set_res_raw(sensor_t *sensor, int startX, int startY, int endX, int endY, int offsetX, int offsetY, int totalX, int totalY, int outputX, int outputY, bool scale, bool binning) +{ + int ret = 0; + ret = write_addr_reg(sensor->slv_addr, X_ADDR_ST_H, startX, startY) + || write_addr_reg(sensor->slv_addr, X_ADDR_END_H, endX, endY) + || write_addr_reg(sensor->slv_addr, X_OFFSET_H, offsetX, offsetY) + || write_addr_reg(sensor->slv_addr, X_TOTAL_SIZE_H, totalX, totalY) + || write_addr_reg(sensor->slv_addr, X_OUTPUT_SIZE_H, outputX, outputY) + || write_reg_bits(sensor->slv_addr, ISP_CONTROL_01, 0x20, scale); + if(!ret){ + sensor->status.scale = scale; + sensor->status.binning = binning; + ret = set_image_options(sensor); + } + return ret; +} + +static int _set_pll(sensor_t *sensor, int bypass, int multiplier, int sys_div, int root_2x, int pre_div, int seld5, int pclk_manual, int pclk_div) +{ + int ret = 0; + ret = set_pll(sensor, bypass > 0, multiplier, sys_div, pre_div, root_2x > 0, seld5, pclk_manual > 0, pclk_div); + return ret; +} + +static int set_xclk(sensor_t *sensor, int timer, int xclk) +{ + int ret = 0; + sensor->xclk_freq_hz = xclk * 1000000U; + ret = xclk_timer_conf(timer, sensor->xclk_freq_hz); + return ret; +} + +static int init_status(sensor_t *sensor) +{ + sensor->status.brightness = 0; + sensor->status.contrast = 0; + sensor->status.saturation = 0; + sensor->status.sharpness = (read_reg(sensor->slv_addr, 0x5303) / 8) - 3; + sensor->status.denoise = get_denoise(sensor); + sensor->status.ae_level = 0; + sensor->status.gainceiling = read_reg16(sensor->slv_addr, 0x3A18) & 0x3FF; + sensor->status.awb = check_reg_mask(sensor->slv_addr, ISP_CONTROL_01, 0x01); + sensor->status.dcw = !check_reg_mask(sensor->slv_addr, 0x5183, 0x80); + sensor->status.agc = !check_reg_mask(sensor->slv_addr, AEC_PK_MANUAL, AEC_PK_MANUAL_AGC_MANUALEN); + sensor->status.aec = !check_reg_mask(sensor->slv_addr, AEC_PK_MANUAL, AEC_PK_MANUAL_AEC_MANUALEN); + sensor->status.hmirror = check_reg_mask(sensor->slv_addr, TIMING_TC_REG21, TIMING_TC_REG21_HMIRROR); + sensor->status.vflip = check_reg_mask(sensor->slv_addr, TIMING_TC_REG20, TIMING_TC_REG20_VFLIP); + sensor->status.colorbar = check_reg_mask(sensor->slv_addr, PRE_ISP_TEST_SETTING_1, TEST_COLOR_BAR); + sensor->status.bpc = check_reg_mask(sensor->slv_addr, 0x5000, 0x04); + sensor->status.wpc = check_reg_mask(sensor->slv_addr, 0x5000, 0x02); + sensor->status.raw_gma = check_reg_mask(sensor->slv_addr, 0x5000, 0x20); + sensor->status.lenc = check_reg_mask(sensor->slv_addr, 0x5000, 0x80); + sensor->status.quality = read_reg(sensor->slv_addr, COMPRESSION_CTRL07) & 0x3f; + sensor->status.special_effect = 0; + sensor->status.wb_mode = 0; + sensor->status.awb_gain = check_reg_mask(sensor->slv_addr, 0x3406, 0x01); + sensor->status.agc_gain = get_agc_gain(sensor); + sensor->status.aec_value = get_aec_value(sensor); + sensor->status.aec2 = check_reg_mask(sensor->slv_addr, 0x3a00, 0x04); + return 0; +} + +int ov5640_detect(int slv_addr, sensor_id_t *id) +{ + if (OV5640_SCCB_ADDR == slv_addr) { + uint8_t h = SCCB_Read16(slv_addr, 0x300A); + uint8_t l = SCCB_Read16(slv_addr, 0x300B); + uint16_t PID = (h<<8) | l; + if (OV5640_PID == PID) { + id->PID = PID; + return PID; + } else { + ESP_LOGI(TAG, "Mismatch PID=0x%x", PID); + } + } + return 0; +} + +int ov5640_init(sensor_t *sensor) +{ + sensor->reset = reset; + sensor->set_pixformat = set_pixformat; + sensor->set_framesize = set_framesize; + sensor->set_contrast = set_contrast; + sensor->set_brightness = set_brightness; + sensor->set_saturation = set_saturation; + sensor->set_sharpness = set_sharpness; + sensor->set_gainceiling = set_gainceiling; + sensor->set_quality = set_quality; + sensor->set_colorbar = set_colorbar; + sensor->set_gain_ctrl = set_gain_ctrl; + sensor->set_exposure_ctrl = set_exposure_ctrl; + sensor->set_whitebal = set_whitebal; + sensor->set_hmirror = set_hmirror; + sensor->set_vflip = set_vflip; + sensor->init_status = init_status; + sensor->set_aec2 = set_aec2; + sensor->set_aec_value = set_aec_value; + sensor->set_special_effect = set_special_effect; + sensor->set_wb_mode = set_wb_mode; + sensor->set_ae_level = set_ae_level; + sensor->set_dcw = set_dcw_dsp; + sensor->set_bpc = set_bpc_dsp; + sensor->set_wpc = set_wpc_dsp; + sensor->set_awb_gain = set_awb_gain_dsp; + sensor->set_agc_gain = set_agc_gain; + sensor->set_raw_gma = set_raw_gma_dsp; + sensor->set_lenc = set_lenc_dsp; + sensor->set_denoise = set_denoise; + + sensor->get_reg = get_reg; + sensor->set_reg = set_reg; + sensor->set_res_raw = set_res_raw; + sensor->set_pll = _set_pll; + sensor->set_xclk = set_xclk; + return 0; +} diff --git a/lib/libesp32_div/esp32-camera/sensors/ov7670.c b/lib/libesp32_div/esp32-camera/sensors/ov7670.c new file mode 100644 index 000000000..b9dcf2327 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/ov7670.c @@ -0,0 +1,457 @@ +/* + * This file is part of the OpenMV project. + * author: Juan Schiavoni + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * OV7725 driver. + * + */ +#include +#include +#include +#include "sccb.h" +#include "ov7670.h" +#include "ov7670_regs.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#else +#include "esp_log.h" +static const char* TAG = "ov7760"; +#endif + +static int ov7670_clkrc = 0x01; + +/* + * The default register settings, as obtained from OmniVision. There + * is really no making sense of most of these - lots of "reserved" values + * and such. + * + * These settings give VGA YUYV. + */ +struct regval_list { + uint8_t reg_num; + uint8_t value; +}; + +static struct regval_list ov7670_default_regs[] = { + /* Sensor automatically sets output window when resolution changes. */ + {TSLB, 0x04}, + + /* Frame rate 30 fps at 12 Mhz clock */ + {CLKRC, 0x00}, + {DBLV, 0x4A}, + + {COM10, COM10_VSYNC_NEG | COM10_PCLK_MASK}, + + /* Improve white balance */ + {COM4, 0x40}, + + /* Improve color */ + {RSVD_B0, 0x84}, + + /* Enable 50/60 Hz auto detection */ + {COM11, COM11_EXP|COM11_HZAUTO}, + + /* Disable some delays */ + {HSYST, 0}, + {HSYEN, 0}, + + {MVFP, MVFP_SUN}, + + /* More reserved magic, some of which tweaks white balance */ + {AWBC1, 0x0a}, + {AWBC2, 0xf0}, + {AWBC3, 0x34}, + {AWBC4, 0x58}, + {AWBC5, 0x28}, + {AWBC6, 0x3a}, + + {AWBCTR3, 0x0a}, + {AWBCTR2, 0x55}, + {AWBCTR1, 0x11}, + {AWBCTR0, 0x9e}, + + {COM8, COM8_FAST_AUTO|COM8_STEP_UNLIMIT|COM8_AGC_EN|COM8_AEC_EN|COM8_AWB_EN}, + + /* End marker is FF because in ov7670 the address of GAIN 0 and default value too. */ + {0xFF, 0xFF}, +}; + +static struct regval_list ov7670_fmt_yuv422[] = { + { COM7, 0x0 }, /* Selects YUV mode */ + { RGB444, 0 }, /* No RGB444 please */ + { COM1, 0 }, /* CCIR601 */ + { COM15, COM15_R00FF }, + { MVFP, MVFP_SUN }, + { COM9, 0x6A }, /* 128x gain ceiling; 0x8 is reserved bit */ + { MTX1, 0x80 }, /* "matrix coefficient 1" */ + { MTX2, 0x80 }, /* "matrix coefficient 2" */ + { MTX3, 0 }, /* vb */ + { MTX4, 0x22 }, /* "matrix coefficient 4" */ + { MTX5, 0x5e }, /* "matrix coefficient 5" */ + { MTX6, 0x80 }, /* "matrix coefficient 6" */ + { COM13, COM13_UVSAT }, + { 0xff, 0xff }, /* END MARKER */ +}; + +static struct regval_list ov7670_fmt_rgb565[] = { + { COM7, COM7_FMT_RGB565 }, /* Selects RGB mode */ + { RGB444, 0 }, /* No RGB444 please */ + { COM1, 0x0 }, /* CCIR601 */ + { COM15, COM15_RGB565 |COM15_R00FF }, + { MVFP, MVFP_SUN }, + { COM9, 0x6A }, /* 128x gain ceiling; 0x8 is reserved bit */ + { MTX1, 0xb3 }, /* "matrix coefficient 1" */ + { MTX2, 0xb3 }, /* "matrix coefficient 2" */ + { MTX3, 0 }, /* vb */ + { MTX4, 0x3d }, /* "matrix coefficient 4" */ + { MTX5, 0xa7 }, /* "matrix coefficient 5" */ + { MTX6, 0xe4 }, /* "matrix coefficient 6" */ + { COM13, COM13_UVSAT }, + { 0xff, 0xff }, /* END MARKER */ +}; + + +static struct regval_list ov7670_vga[] = { + { COM3, 0x00 }, + { COM14, 0x00 }, + { SCALING_XSC, 0x3A }, + { SCALING_YSC, 0x35 }, + { SCALING_DCWCTR, 0x11 }, + { SCALING_PCLK_DIV, 0xF0 }, + { SCALING_PCLK_DELAY, 0x02 }, + { 0xff, 0xff }, +}; + +static struct regval_list ov7670_qvga[] = { + { COM3, 0x04 }, + { COM14, 0x19 }, + { SCALING_XSC, 0x3A }, + { SCALING_YSC, 0x35 }, + { SCALING_DCWCTR, 0x11 }, + { SCALING_PCLK_DIV, 0xF1 }, + { SCALING_PCLK_DELAY, 0x02 }, + { 0xff, 0xff }, +}; + +static struct regval_list ov7670_qqvga[] = { + { COM3, 0x04 }, //DCW enable + { COM14, 0x1a }, //pixel clock divided by 4, manual scaling enable, DCW and PCLK controlled by register + { SCALING_XSC, 0x3a }, + { SCALING_YSC, 0x35 }, + { SCALING_DCWCTR, 0x22 }, //downsample by 4 + { SCALING_PCLK_DIV, 0xf2 }, //pixel clock divided by 4 + { SCALING_PCLK_DELAY, 0x02 }, + { 0xff, 0xff }, +}; + +/* + * Write a list of register settings; ff/ff stops the process. + */ +static int ov7670_write_array(sensor_t *sensor, struct regval_list *vals) +{ +int ret = 0; + + while ( (vals->reg_num != 0xff || vals->value != 0xff) && (ret == 0) ) { + ret = SCCB_Write(sensor->slv_addr, vals->reg_num, vals->value); + + ESP_LOGD(TAG, "reset reg %02X, W(%02X) R(%02X)", vals->reg_num, + vals->value, SCCB_Read(sensor->slv_addr, vals->reg_num) ); + + vals++; + } + + return ret; +} + +/* + * Calculate the frame control registers. + */ +static int ov7670_frame_control(sensor_t *sensor, int hstart, int hstop, int vstart, int vstop) +{ +struct regval_list frame[7]; + + frame[0].reg_num = HSTART; + frame[0].value = (hstart >> 3); + + frame[1].reg_num = HSTOP; + frame[1].value = (hstop >> 3); + + frame[2].reg_num = HREF; + frame[2].value = (((hstop & 0x07) << 3) | (hstart & 0x07)); + + frame[3].reg_num = VSTART; + frame[3].value = (vstart >> 2); + + frame[4].reg_num = VSTOP; + frame[4].value = (vstop >> 2); + + frame[5].reg_num = VREF; + frame[5].value = (((vstop & 0x02) << 2) | (vstart & 0x02)); + + /* End mark */ + frame[5].reg_num = 0xFF; + frame[5].value = 0xFF; + + return ov7670_write_array(sensor, frame); +} + +static int reset(sensor_t *sensor) +{ + int ret; + + // Reset all registers + SCCB_Write(sensor->slv_addr, COM7, COM7_RESET); + + // Delay 10 ms + vTaskDelay(10 / portTICK_PERIOD_MS); + + ret = ov7670_write_array(sensor, ov7670_default_regs); + + // Delay + vTaskDelay(30 / portTICK_PERIOD_MS); + + return ret; +} + +static int set_pixformat(sensor_t *sensor, pixformat_t pixformat) +{ +int ret; + + switch (pixformat) { + case PIXFORMAT_RGB565: + case PIXFORMAT_RGB888: + ret = ov7670_write_array(sensor, ov7670_fmt_rgb565); + break; + + case PIXFORMAT_YUV422: + case PIXFORMAT_GRAYSCALE: + default: + ret = ov7670_write_array(sensor, ov7670_fmt_yuv422); + break; + } + + vTaskDelay(30 / portTICK_PERIOD_MS); + + /* + * If we're running RGB565, we must rewrite clkrc after setting + * the other parameters or the image looks poor. If we're *not* + * doing RGB565, we must not rewrite clkrc or the image looks + * *really* poor. + * + * (Update) Now that we retain clkrc state, we should be able + * to write it unconditionally, and that will make the frame + * rate persistent too. + */ + if (pixformat == PIXFORMAT_RGB565) { + ret = SCCB_Write(sensor->slv_addr, CLKRC, ov7670_clkrc); + } + + return ret; +} + +static int set_framesize(sensor_t *sensor, framesize_t framesize) +{ + int ret; + + // store clkrc before changing window settings... + ov7670_clkrc = SCCB_Read(sensor->slv_addr, CLKRC); + + switch (framesize){ + case FRAMESIZE_VGA: + if( (ret = ov7670_write_array(sensor, ov7670_vga)) == 0 ) { + /* These values from Omnivision */ + ret = ov7670_frame_control(sensor, 158, 14, 10, 490); + } + break; + case FRAMESIZE_QVGA: + if( (ret = ov7670_write_array(sensor, ov7670_qvga)) == 0 ) { + /* These values from Omnivision */ + ret = ov7670_frame_control(sensor, 158, 14, 10, 490); + } + break; + case FRAMESIZE_QQVGA: + if( (ret = ov7670_write_array(sensor, ov7670_qqvga)) == 0 ) { + /* These values from Omnivision */ + ret = ov7670_frame_control(sensor, 158, 14, 10, 490); + } + break; + + default: + ret = -1; + } + + vTaskDelay(30 / portTICK_PERIOD_MS); + + if (ret == 0) { + sensor->status.framesize = framesize; + } + + return ret; +} + +static int set_colorbar(sensor_t *sensor, int enable) +{ + uint8_t ret = 0; + // Read register scaling_xsc + uint8_t reg = SCCB_Read(sensor->slv_addr, SCALING_XSC); + + // Pattern to set color bar bit[0]=0 in every case + reg = SCALING_XSC_CBAR(reg); + + // Write pattern to SCALING_XSC + ret = SCCB_Write(sensor->slv_addr, SCALING_XSC, reg); + + // Read register scaling_ysc + reg = SCCB_Read(sensor->slv_addr, SCALING_YSC); + + // Pattern to set color bar bit[0]=0 in every case + reg = SCALING_YSC_CBAR(reg, enable); + + // Write pattern to SCALING_YSC + ret = ret | SCCB_Write(sensor->slv_addr, SCALING_YSC, reg); + + // return 0 or 0xFF + return ret; +} + +static int set_whitebal(sensor_t *sensor, int enable) +{ + // Read register COM8 + uint8_t reg = SCCB_Read(sensor->slv_addr, COM8); + + // Set white bal on/off + reg = COM8_SET_AWB(reg, enable); + + // Write back register COM8 + return SCCB_Write(sensor->slv_addr, COM8, reg); +} + +static int set_gain_ctrl(sensor_t *sensor, int enable) +{ + // Read register COM8 + uint8_t reg = SCCB_Read(sensor->slv_addr, COM8); + + // Set white bal on/off + reg = COM8_SET_AGC(reg, enable); + + // Write back register COM8 + return SCCB_Write(sensor->slv_addr, COM8, reg); +} + +static int set_exposure_ctrl(sensor_t *sensor, int enable) +{ + // Read register COM8 + uint8_t reg = SCCB_Read(sensor->slv_addr, COM8); + + // Set white bal on/off + reg = COM8_SET_AEC(reg, enable); + + // Write back register COM8 + return SCCB_Write(sensor->slv_addr, COM8, reg); +} + +static int set_hmirror(sensor_t *sensor, int enable) +{ + // Read register MVFP + uint8_t reg = SCCB_Read(sensor->slv_addr, MVFP); + + // Set mirror on/off + reg = MVFP_SET_MIRROR(reg, enable); + + // Write back register MVFP + return SCCB_Write(sensor->slv_addr, MVFP, reg); +} + +static int set_vflip(sensor_t *sensor, int enable) +{ + // Read register MVFP + uint8_t reg = SCCB_Read(sensor->slv_addr, MVFP); + + // Set mirror on/off + reg = MVFP_SET_FLIP(reg, enable); + + // Write back register MVFP + return SCCB_Write(sensor->slv_addr, MVFP, reg); +} + +static int init_status(sensor_t *sensor) +{ + sensor->status.awb = 0; + sensor->status.aec = 0; + sensor->status.agc = 0; + sensor->status.hmirror = 0; + sensor->status.vflip = 0; + sensor->status.colorbar = 0; + return 0; +} + +static int set_dummy(sensor_t *sensor, int val){ return -1; } +static int set_gainceiling_dummy(sensor_t *sensor, gainceiling_t val){ return -1; } + +int ov7670_detect(int slv_addr, sensor_id_t *id) +{ + if (OV7670_SCCB_ADDR == slv_addr) { + SCCB_Write(slv_addr, 0xFF, 0x01);//bank sensor + uint16_t PID = SCCB_Read(slv_addr, 0x0A); + if (OV7670_PID == PID) { + id->PID = PID; + id->VER = SCCB_Read(slv_addr, REG_VER); + id->MIDL = SCCB_Read(slv_addr, REG_MIDL); + id->MIDH = SCCB_Read(slv_addr, REG_MIDH); + return PID; + } else { + ESP_LOGI(TAG, "Mismatch PID=0x%x", PID); + } + } + return 0; +} + +int ov7670_init(sensor_t *sensor) +{ + // Set function pointers + sensor->reset = reset; + sensor->init_status = init_status; + sensor->set_pixformat = set_pixformat; + sensor->set_framesize = set_framesize; + sensor->set_colorbar = set_colorbar; + sensor->set_whitebal = set_whitebal; + sensor->set_gain_ctrl = set_gain_ctrl; + sensor->set_exposure_ctrl = set_exposure_ctrl; + sensor->set_hmirror = set_hmirror; + sensor->set_vflip = set_vflip; + + //not supported + sensor->set_brightness= set_dummy; + sensor->set_saturation= set_dummy; + sensor->set_quality = set_dummy; + sensor->set_gainceiling = set_gainceiling_dummy; + sensor->set_aec2 = set_dummy; + sensor->set_aec_value = set_dummy; + sensor->set_special_effect = set_dummy; + sensor->set_wb_mode = set_dummy; + sensor->set_ae_level = set_dummy; + sensor->set_dcw = set_dummy; + sensor->set_bpc = set_dummy; + sensor->set_wpc = set_dummy; + sensor->set_awb_gain = set_dummy; + sensor->set_agc_gain = set_dummy; + sensor->set_raw_gma = set_dummy; + sensor->set_lenc = set_dummy; + sensor->set_sharpness = set_dummy; + sensor->set_denoise = set_dummy; + + // Retrieve sensor's signature + sensor->id.MIDH = SCCB_Read(sensor->slv_addr, REG_MIDH); + sensor->id.MIDL = SCCB_Read(sensor->slv_addr, REG_MIDL); + sensor->id.PID = SCCB_Read(sensor->slv_addr, REG_PID); + sensor->id.VER = SCCB_Read(sensor->slv_addr, REG_VER); + + ESP_LOGD(TAG, "OV7670 Attached"); + + return 0; +} diff --git a/lib/libesp32_div/esp32-camera/sensors/ov7725.c b/lib/libesp32_div/esp32-camera/sensors/ov7725.c new file mode 100644 index 000000000..ad5d89541 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/ov7725.c @@ -0,0 +1,575 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * OV7725 driver. + * + */ +#include +#include +#include +#include +#include "sccb.h" +#include "xclk.h" +#include "ov7725.h" +#include "ov7725_regs.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#else +#include "esp_log.h" +static const char* TAG = "ov7725"; +#endif + + +static const uint8_t default_regs[][2] = { + {COM3, COM3_SWAP_YUV}, + {COM7, COM7_RES_QVGA | COM7_FMT_YUV}, + + {COM4, 0x01 | 0x00}, /* bypass PLL (0x00:off, 0x40:4x, 0x80:6x, 0xC0:8x) */ + {CLKRC, 0x80 | 0x03}, /* Res/Bypass pre-scalar (0x40:bypass, 0x00-0x3F:prescaler PCLK=XCLK/(prescaler + 1)/2 ) */ + + // QVGA Window Size + {HSTART, 0x3F}, + {HSIZE, 0x50}, + {VSTART, 0x03}, + {VSIZE, 0x78}, + {HREF, 0x00}, + + // Scale down to QVGA Resolution + {HOUTSIZE, 0x50}, + {VOUTSIZE, 0x78}, + {EXHCH, 0x00}, + + {COM12, 0x03}, + {TGT_B, 0x7F}, + {FIXGAIN, 0x09}, + {AWB_CTRL0, 0xE0}, + {DSP_CTRL1, 0xFF}, + + {DSP_CTRL2, DSP_CTRL2_VDCW_EN | DSP_CTRL2_HDCW_EN | DSP_CTRL2_HZOOM_EN | DSP_CTRL2_VZOOM_EN}, + + {DSP_CTRL3, 0x00}, + {DSP_CTRL4, 0x00}, + {DSPAUTO, 0xFF}, + + {COM8, 0xF0}, + {COM6, 0xC5}, + {COM9, 0x11}, + {COM10, COM10_VSYNC_NEG | COM10_PCLK_MASK}, //Invert VSYNC and MASK PCLK + {BDBASE, 0x7F}, + {DBSTEP, 0x03}, + {AEW, 0x96}, + {AEB, 0x64}, + {VPT, 0xA1}, + {EXHCL, 0x00}, + {AWB_CTRL3, 0xAA}, + {COM8, 0xFF}, + + //Gamma + {GAM1, 0x0C}, + {GAM2, 0x16}, + {GAM3, 0x2A}, + {GAM4, 0x4E}, + {GAM5, 0x61}, + {GAM6, 0x6F}, + {GAM7, 0x7B}, + {GAM8, 0x86}, + {GAM9, 0x8E}, + {GAM10, 0x97}, + {GAM11, 0xA4}, + {GAM12, 0xAF}, + {GAM13, 0xC5}, + {GAM14, 0xD7}, + {GAM15, 0xE8}, + + {SLOP, 0x20}, + {EDGE1, 0x05}, + {EDGE2, 0x03}, + {EDGE3, 0x00}, + {DNSOFF, 0x01}, + + {MTX1, 0xB0}, + {MTX2, 0x9D}, + {MTX3, 0x13}, + {MTX4, 0x16}, + {MTX5, 0x7B}, + {MTX6, 0x91}, + {MTX_CTRL, 0x1E}, + + {BRIGHTNESS, 0x08}, + {CONTRAST, 0x30}, + {UVADJ0, 0x81}, + {SDE, (SDE_CONT_BRIGHT_EN | SDE_SATURATION_EN)}, + + // For 30 fps/60Hz + {DM_LNL, 0x00}, + {DM_LNH, 0x00}, + {BDBASE, 0x7F}, + {DBSTEP, 0x03}, + + // Lens Correction, should be tuned with real camera module + {LC_RADI, 0x10}, + {LC_COEF, 0x10}, + {LC_COEFB, 0x14}, + {LC_COEFR, 0x17}, + {LC_CTR, 0x05}, + {COM5, 0xF5}, //0x65 + + {0x00, 0x00}, +}; + +static int get_reg(sensor_t *sensor, int reg, int mask) +{ + int ret = SCCB_Read(sensor->slv_addr, reg & 0xFF); + if(ret > 0){ + ret &= mask; + } + return ret; +} + +static int set_reg(sensor_t *sensor, int reg, int mask, int value) +{ + int ret = 0; + ret = SCCB_Read(sensor->slv_addr, reg & 0xFF); + if(ret < 0){ + return ret; + } + value = (ret & ~mask) | (value & mask); + ret = SCCB_Write(sensor->slv_addr, reg & 0xFF, value); + return ret; +} + +static int set_reg_bits(sensor_t *sensor, uint8_t reg, uint8_t offset, uint8_t length, uint8_t value) +{ + int ret = 0; + ret = SCCB_Read(sensor->slv_addr, reg); + if(ret < 0){ + return ret; + } + uint8_t mask = ((1 << length) - 1) << offset; + value = (ret & ~mask) | ((value << offset) & mask); + ret = SCCB_Write(sensor->slv_addr, reg & 0xFF, value); + return ret; +} + +static int get_reg_bits(sensor_t *sensor, uint8_t reg, uint8_t offset, uint8_t length) +{ + int ret = 0; + ret = SCCB_Read(sensor->slv_addr, reg); + if(ret < 0){ + return ret; + } + uint8_t mask = ((1 << length) - 1) << offset; + return (ret & mask) >> offset; +} + + +static int reset(sensor_t *sensor) +{ + int i=0; + const uint8_t (*regs)[2]; + + // Reset all registers + SCCB_Write(sensor->slv_addr, COM7, COM7_RESET); + + // Delay 10 ms + vTaskDelay(10 / portTICK_PERIOD_MS); + + // Write default regsiters + for (i=0, regs = default_regs; regs[i][0]; i++) { + SCCB_Write(sensor->slv_addr, regs[i][0], regs[i][1]); + } + + // Delay + vTaskDelay(30 / portTICK_PERIOD_MS); + + return 0; +} + + +static int set_pixformat(sensor_t *sensor, pixformat_t pixformat) +{ + int ret=0; + sensor->pixformat = pixformat; + // Read register COM7 + uint8_t reg = SCCB_Read(sensor->slv_addr, COM7); + + switch (pixformat) { + case PIXFORMAT_RGB565: + reg = COM7_SET_RGB(reg, COM7_FMT_RGB565); + break; + case PIXFORMAT_YUV422: + case PIXFORMAT_GRAYSCALE: + reg = COM7_SET_FMT(reg, COM7_FMT_YUV); + break; + default: + return -1; + } + + // Write back register COM7 + ret = SCCB_Write(sensor->slv_addr, COM7, reg); + + // Delay + vTaskDelay(30 / portTICK_PERIOD_MS); + + return ret; +} + +static int set_framesize(sensor_t *sensor, framesize_t framesize) +{ + int ret=0; + if (framesize > FRAMESIZE_VGA) { + return -1; + } + uint16_t w = resolution[framesize].width; + uint16_t h = resolution[framesize].height; + uint8_t reg = SCCB_Read(sensor->slv_addr, COM7); + + sensor->status.framesize = framesize; + + // Write MSBs + ret |= SCCB_Write(sensor->slv_addr, HOUTSIZE, w>>2); + ret |= SCCB_Write(sensor->slv_addr, VOUTSIZE, h>>1); + + ret |= SCCB_Write(sensor->slv_addr, HSIZE, w>>2); + ret |= SCCB_Write(sensor->slv_addr, VSIZE, h>>1); + + // Write LSBs + ret |= SCCB_Write(sensor->slv_addr, HREF, ((w&0x3) | ((h&0x1) << 2))); + + if (framesize < FRAMESIZE_VGA) { + // Enable auto-scaling/zooming factors + ret |= SCCB_Write(sensor->slv_addr, DSPAUTO, 0xFF); + + ret |= SCCB_Write(sensor->slv_addr, HSTART, 0x3F); + ret |= SCCB_Write(sensor->slv_addr, VSTART, 0x03); + + ret |= SCCB_Write(sensor->slv_addr, COM7, reg | COM7_RES_QVGA); + + ret |= SCCB_Write(sensor->slv_addr, CLKRC, 0x80 | 0x01); + + } else { + // Disable auto-scaling/zooming factors + ret |= SCCB_Write(sensor->slv_addr, DSPAUTO, 0xF3); + + // Clear auto-scaling/zooming factors + ret |= SCCB_Write(sensor->slv_addr, SCAL0, 0x00); + ret |= SCCB_Write(sensor->slv_addr, SCAL1, 0x00); + ret |= SCCB_Write(sensor->slv_addr, SCAL2, 0x00); + + ret |= SCCB_Write(sensor->slv_addr, HSTART, 0x23); + ret |= SCCB_Write(sensor->slv_addr, VSTART, 0x07); + + ret |= SCCB_Write(sensor->slv_addr, COM7, reg & ~COM7_RES_QVGA); + + ret |= SCCB_Write(sensor->slv_addr, CLKRC, 0x80 | 0x03); + } + + // Delay + vTaskDelay(30 / portTICK_PERIOD_MS); + + return ret; +} + +static int set_colorbar(sensor_t *sensor, int enable) +{ + int ret=0; + uint8_t reg; + sensor->status.colorbar = enable; + + // Read reg COM3 + reg = SCCB_Read(sensor->slv_addr, COM3); + // Enable colorbar test pattern output + reg = COM3_SET_CBAR(reg, enable); + // Write back COM3 + ret |= SCCB_Write(sensor->slv_addr, COM3, reg); + + // Read reg DSP_CTRL3 + reg = SCCB_Read(sensor->slv_addr, DSP_CTRL3); + // Enable DSP colorbar output + reg = DSP_CTRL3_SET_CBAR(reg, enable); + // Write back DSP_CTRL3 + ret |= SCCB_Write(sensor->slv_addr, DSP_CTRL3, reg); + + return ret; +} + +static int set_whitebal(sensor_t *sensor, int enable) +{ + if(set_reg_bits(sensor, COM8, 1, 1, enable) >= 0){ + sensor->status.awb = !!enable; + } + return sensor->status.awb; +} + +static int set_gain_ctrl(sensor_t *sensor, int enable) +{ + if(set_reg_bits(sensor, COM8, 2, 1, enable) >= 0){ + sensor->status.agc = !!enable; + } + return sensor->status.agc; +} + +static int set_exposure_ctrl(sensor_t *sensor, int enable) +{ + if(set_reg_bits(sensor, COM8, 0, 1, enable) >= 0){ + sensor->status.aec = !!enable; + } + return sensor->status.aec; +} + +static int set_hmirror(sensor_t *sensor, int enable) +{ + if(set_reg_bits(sensor, COM3, 6, 1, enable) >= 0){ + sensor->status.hmirror = !!enable; + } + return sensor->status.hmirror; +} + +static int set_vflip(sensor_t *sensor, int enable) +{ + if(set_reg_bits(sensor, COM3, 7, 1, enable) >= 0){ + sensor->status.vflip = !!enable; + } + return sensor->status.vflip; +} + +static int set_dcw_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = set_reg_bits(sensor, 0x65, 2, 1, !enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set dcw to: %d", enable); + sensor->status.dcw = enable; + } + return ret; +} + +static int set_aec2(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = set_reg_bits(sensor, COM8, 7, 1, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set aec2 to: %d", enable); + sensor->status.aec2 = enable; + } + return ret; +} + +static int set_bpc_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = set_reg_bits(sensor, 0x64, 1, 1, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set bpc to: %d", enable); + sensor->status.bpc = enable; + } + return ret; +} + +static int set_wpc_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = set_reg_bits(sensor, 0x64, 0, 1, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set wpc to: %d", enable); + sensor->status.wpc = enable; + } + return ret; +} + +static int set_raw_gma_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = set_reg_bits(sensor, 0x64, 2, 1, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set raw_gma to: %d", enable); + sensor->status.raw_gma = enable; + } + return ret; +} + +static int set_lenc_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = set_reg_bits(sensor, LC_CTR, 0, 1, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set lenc to: %d", enable); + sensor->status.lenc = enable; + } + return ret; +} + +//real gain +static int set_agc_gain(sensor_t *sensor, int gain) +{ + int ret = 0; + ret = set_reg_bits(sensor, COM9, 4, 3, gain % 5); + if (ret == 0) { + ESP_LOGD(TAG, "Set gain to: %d", gain); + sensor->status.agc_gain = gain; + } + return ret; +} + +static int set_aec_value(sensor_t *sensor, int value) +{ + int ret = 0; + ret = SCCB_Write(sensor->slv_addr, AEC, value & 0xff) | SCCB_Write(sensor->slv_addr, AECH, value >> 8); + if (ret == 0) { + ESP_LOGD(TAG, "Set aec_value to: %d", value); + sensor->status.aec_value = value; + } + return ret; +} + +static int set_awb_gain_dsp(sensor_t *sensor, int enable) +{ + int ret = 0; + ret = set_reg_bits(sensor, 0x63, 7, 1, enable); + if (ret == 0) { + ESP_LOGD(TAG, "Set awb_gain to: %d", enable); + sensor->status.awb_gain = enable; + } + return ret; +} + +static int set_brightness(sensor_t *sensor, int level) +{ + int ret = 0; + ret = SCCB_Write(sensor->slv_addr, 0x9B, level); + if (ret == 0) { + ESP_LOGD(TAG, "Set brightness to: %d", level); + sensor->status.brightness = level; + } + return ret; +} + +static int set_contrast(sensor_t *sensor, int level) +{ + int ret = 0; + ret = SCCB_Write(sensor->slv_addr, 0x9C, level); + if (ret == 0) { + ESP_LOGD(TAG, "Set contrast to: %d", level); + sensor->status.contrast = level; + } + return ret; +} + +static int init_status(sensor_t *sensor) +{ + sensor->status.brightness = SCCB_Read(sensor->slv_addr, 0x9B); + sensor->status.contrast = SCCB_Read(sensor->slv_addr, 0x9C); + sensor->status.saturation = 0; + sensor->status.ae_level = 0; + sensor->status.special_effect = get_reg_bits(sensor, 0x64, 5, 1); + sensor->status.wb_mode = get_reg_bits(sensor, 0x6B, 7, 1); + sensor->status.agc_gain = get_reg_bits(sensor, COM9, 4, 3); + sensor->status.aec_value = SCCB_Read(sensor->slv_addr, AEC) | (SCCB_Read(sensor->slv_addr, AECH) << 8); + sensor->status.gainceiling = SCCB_Read(sensor->slv_addr, 0x00); + sensor->status.awb = get_reg_bits(sensor, COM8, 1, 1); + sensor->status.awb_gain = get_reg_bits(sensor, 0x63, 7, 1); + sensor->status.aec = get_reg_bits(sensor, COM8, 0, 1); + sensor->status.aec2 = get_reg_bits(sensor, COM8, 7, 1); + sensor->status.agc = get_reg_bits(sensor, COM8, 2, 1); + sensor->status.bpc = get_reg_bits(sensor, 0x64, 1, 1); + sensor->status.wpc = get_reg_bits(sensor, 0x64, 0, 1); + sensor->status.raw_gma = get_reg_bits(sensor, 0x64, 2, 1); + sensor->status.lenc = get_reg_bits(sensor, LC_CTR, 0, 1); + sensor->status.hmirror = get_reg_bits(sensor, COM3, 6, 1); + sensor->status.vflip = get_reg_bits(sensor, COM3, 7, 1); + sensor->status.dcw = get_reg_bits(sensor, 0x65, 2, 1); + sensor->status.colorbar = get_reg_bits(sensor, COM3, 0, 1); + sensor->status.sharpness = get_reg_bits(sensor, EDGE0, 0, 5); + sensor->status.denoise = SCCB_Read(sensor->slv_addr, 0x8E); + return 0; +} + +static int set_dummy(sensor_t *sensor, int val){ return -1; } +static int set_gainceiling_dummy(sensor_t *sensor, gainceiling_t val){ return -1; } +static int set_res_raw(sensor_t *sensor, int startX, int startY, int endX, int endY, int offsetX, int offsetY, int totalX, int totalY, int outputX, int outputY, bool scale, bool binning){return -1;} +static int _set_pll(sensor_t *sensor, int bypass, int multiplier, int sys_div, int root_2x, int pre_div, int seld5, int pclk_manual, int pclk_div){return -1;} + +static int set_xclk(sensor_t *sensor, int timer, int xclk) +{ + int ret = 0; + sensor->xclk_freq_hz = xclk * 1000000U; + ret = xclk_timer_conf(timer, sensor->xclk_freq_hz); + return ret; +} + +int ov7725_detect(int slv_addr, sensor_id_t *id) +{ + if (OV7725_SCCB_ADDR == slv_addr) { + SCCB_Write(slv_addr, 0xFF, 0x01);//bank sensor + uint16_t PID = SCCB_Read(slv_addr, 0x0A); + if (OV7725_PID == PID) { + id->PID = PID; + id->VER = SCCB_Read(slv_addr, REG_VER); + id->MIDL = SCCB_Read(slv_addr, REG_MIDL); + id->MIDH = SCCB_Read(slv_addr, REG_MIDH); + return PID; + } else { + ESP_LOGI(TAG, "Mismatch PID=0x%x", PID); + } + } + return 0; +} + +int ov7725_init(sensor_t *sensor) +{ + // Set function pointers + sensor->reset = reset; + sensor->init_status = init_status; + sensor->set_pixformat = set_pixformat; + sensor->set_framesize = set_framesize; + sensor->set_colorbar = set_colorbar; + sensor->set_whitebal = set_whitebal; + sensor->set_gain_ctrl = set_gain_ctrl; + sensor->set_exposure_ctrl = set_exposure_ctrl; + sensor->set_hmirror = set_hmirror; + sensor->set_vflip = set_vflip; + + sensor->set_brightness = set_brightness; + sensor->set_contrast = set_contrast; + sensor->set_aec2 = set_aec2; + sensor->set_aec_value = set_aec_value; + sensor->set_awb_gain = set_awb_gain_dsp; + sensor->set_agc_gain = set_agc_gain; + sensor->set_dcw = set_dcw_dsp; + sensor->set_bpc = set_bpc_dsp; + sensor->set_wpc = set_wpc_dsp; + sensor->set_raw_gma = set_raw_gma_dsp; + sensor->set_lenc = set_lenc_dsp; + + //not supported + sensor->set_saturation= set_dummy; + sensor->set_sharpness = set_dummy; + sensor->set_denoise = set_dummy; + sensor->set_quality = set_dummy; + sensor->set_special_effect = set_dummy; + sensor->set_wb_mode = set_dummy; + sensor->set_ae_level = set_dummy; + sensor->set_gainceiling = set_gainceiling_dummy; + + + sensor->get_reg = get_reg; + sensor->set_reg = set_reg; + sensor->set_res_raw = set_res_raw; + sensor->set_pll = _set_pll; + sensor->set_xclk = set_xclk; + + // Retrieve sensor's signature + sensor->id.MIDH = SCCB_Read(sensor->slv_addr, REG_MIDH); + sensor->id.MIDL = SCCB_Read(sensor->slv_addr, REG_MIDL); + sensor->id.PID = SCCB_Read(sensor->slv_addr, REG_PID); + sensor->id.VER = SCCB_Read(sensor->slv_addr, REG_VER); + + ESP_LOGD(TAG, "OV7725 Attached"); + + return 0; +} diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/gc0308.h b/lib/libesp32_div/esp32-camera/sensors/private_include/gc0308.h new file mode 100644 index 000000000..edffca1e0 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/gc0308.h @@ -0,0 +1,31 @@ +#pragma once + +#include "sensor.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Detect sensor pid + * + * @param slv_addr SCCB address + * @param id Detection result + * @return + * 0: Can't detect this sensor + * Nonzero: This sensor has been detected + */ +int gc0308_detect(int slv_addr, sensor_id_t *id); + +/** + * @brief initialize sensor function pointers + * + * @param sensor pointer of sensor + * @return + * Always 0 + */ +int gc0308_init(sensor_t *sensor); + +#ifdef __cplusplus +} +#endif diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/gc0308_regs.h b/lib/libesp32_div/esp32-camera/sensors/private_include/gc0308_regs.h new file mode 100644 index 000000000..f1cb4532b --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/gc0308_regs.h @@ -0,0 +1,25 @@ +/* + * GC0308 register definitions. + */ +#ifndef __GC0308_REG_REGS_H__ +#define __GC0308_REG_REGS_H__ + +#define RESET_RELATED 0xfe // Bit[7]: Software reset + // Bit[6:5]: NA + // Bit[4]: CISCTL_restart_n + // Bit[3:1]: NA + // Bit[0]: page select + // 0:page0 + // 1:page1 + + +// page0: + + + +/** + * @brief register value + */ + + +#endif // __GC0308_REG_REGS_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/gc0308_settings.h b/lib/libesp32_div/esp32-camera/sensors/private_include/gc0308_settings.h new file mode 100644 index 000000000..32ef3816a --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/gc0308_settings.h @@ -0,0 +1,245 @@ +#ifndef _GC0308_SETTINGS_H_ +#define _GC0308_SETTINGS_H_ + +#include + +#define REG_DLY 0xffff +#define REGLIST_TAIL 0x0000 /* Array end token */ + +static const uint16_t gc0308_sensor_default_regs[][2] = { + {0xfe, 0x00}, + {0xec, 0x20}, + {0x05, 0x00}, + {0x06, 0x00}, + {0x07, 0x00}, + {0x08, 0x00}, + {0x09, 0x01}, + {0x0a, 0xe8}, + {0x0b, 0x02}, + {0x0c, 0x88}, + {0x0d, 0x02}, + {0x0e, 0x02}, + {0x10, 0x26}, + {0x11, 0x0d}, + {0x12, 0x2a}, + {0x13, 0x00}, + {0x14, 0x11}, + {0x15, 0x0a}, + {0x16, 0x05}, + {0x17, 0x01}, + {0x18, 0x44}, + {0x19, 0x44}, + {0x1a, 0x2a}, + {0x1b, 0x00}, + {0x1c, 0x49}, + {0x1d, 0x9a}, + {0x1e, 0x61}, + {0x1f, 0x00}, //pad drv <=24MHz, use 0x00 is ok + {0x20, 0x7f}, + {0x21, 0xfa}, + {0x22, 0x57}, + {0x24, 0xa2}, //YCbYCr + {0x25, 0x0f}, + {0x26, 0x03}, // 0x01 + {0x28, 0x00}, + {0x2d, 0x0a}, + {0x2f, 0x01}, + {0x30, 0xf7}, + {0x31, 0x50}, + {0x32, 0x00}, + {0x33, 0x28}, + {0x34, 0x2a}, + {0x35, 0x28}, + {0x39, 0x04}, + {0x3a, 0x20}, + {0x3b, 0x20}, + {0x3c, 0x00}, + {0x3d, 0x00}, + {0x3e, 0x00}, + {0x3f, 0x00}, + {0x50, 0x14}, // 0x14 + {0x52, 0x41}, + {0x53, 0x80}, + {0x54, 0x80}, + {0x55, 0x80}, + {0x56, 0x80}, + {0x8b, 0x20}, + {0x8c, 0x20}, + {0x8d, 0x20}, + {0x8e, 0x14}, + {0x8f, 0x10}, + {0x90, 0x14}, + {0x91, 0x3c}, + {0x92, 0x50}, +//{0x8b,0x10}, +//{0x8c,0x10}, +//{0x8d,0x10}, +//{0x8e,0x10}, +//{0x8f,0x10}, +//{0x90,0x10}, +//{0x91,0x3c}, +//{0x92,0x50}, + {0x5d, 0x12}, + {0x5e, 0x1a}, + {0x5f, 0x24}, + {0x60, 0x07}, + {0x61, 0x15}, + {0x62, 0x08}, // 0x08 + {0x64, 0x03}, // 0x03 + {0x66, 0xe8}, + {0x67, 0x86}, + {0x68, 0x82}, + {0x69, 0x18}, + {0x6a, 0x0f}, + {0x6b, 0x00}, + {0x6c, 0x5f}, + {0x6d, 0x8f}, + {0x6e, 0x55}, + {0x6f, 0x38}, + {0x70, 0x15}, + {0x71, 0x33}, + {0x72, 0xdc}, + {0x73, 0x00}, + {0x74, 0x02}, + {0x75, 0x3f}, + {0x76, 0x02}, + {0x77, 0x38}, // 0x47 + {0x78, 0x88}, + {0x79, 0x81}, + {0x7a, 0x81}, + {0x7b, 0x22}, + {0x7c, 0xff}, + {0x93, 0x48}, //color matrix default + {0x94, 0x02}, + {0x95, 0x07}, + {0x96, 0xe0}, + {0x97, 0x40}, + {0x98, 0xf0}, + {0xb1, 0x40}, + {0xb2, 0x40}, + {0xb3, 0x40}, //0x40 + {0xb6, 0xe0}, + {0xbd, 0x38}, + {0xbe, 0x36}, + {0xd0, 0xCB}, + {0xd1, 0x10}, + {0xd2, 0x90}, + {0xd3, 0x48}, + {0xd5, 0xF2}, + {0xd6, 0x16}, + {0xdb, 0x92}, + {0xdc, 0xA5}, + {0xdf, 0x23}, + {0xd9, 0x00}, + {0xda, 0x00}, + {0xe0, 0x09}, + {0xed, 0x04}, + {0xee, 0xa0}, + {0xef, 0x40}, + {0x80, 0x03}, + + {0x9F, 0x10}, + {0xA0, 0x20}, + {0xA1, 0x38}, + {0xA2, 0x4e}, + {0xA3, 0x63}, + {0xA4, 0x76}, + {0xA5, 0x87}, + {0xA6, 0xa2}, + {0xA7, 0xb8}, + {0xA8, 0xca}, + {0xA9, 0xd8}, + {0xAA, 0xe3}, + {0xAB, 0xeb}, + {0xAC, 0xf0}, + {0xAD, 0xF8}, + {0xAE, 0xFd}, + {0xAF, 0xFF}, + + {0xc0, 0x00}, + {0xc1, 0x10}, + {0xc2, 0x1c}, + {0xc3, 0x30}, + {0xc4, 0x43}, + {0xc5, 0x54}, + {0xc6, 0x65}, + {0xc7, 0x75}, + {0xc8, 0x93}, + {0xc9, 0xB0}, + {0xca, 0xCB}, + {0xcb, 0xE6}, + {0xcc, 0xFF}, + {0xf0, 0x02}, + {0xf1, 0x01}, + {0xf2, 0x02}, + {0xf3, 0x30}, + {0xf7, 0x04}, + {0xf8, 0x02}, + {0xf9, 0x9f}, + {0xfa, 0x78}, + {0xfe, 0x01}, + {0x00, 0xf5}, + {0x02, 0x20}, + {0x04, 0x10}, + {0x05, 0x08}, + {0x06, 0x20}, + {0x08, 0x0a}, + {0x0a, 0xa0}, + {0x0b, 0x60}, + {0x0c, 0x08}, + {0x0e, 0x44}, + {0x0f, 0x32}, + {0x10, 0x41}, + {0x11, 0x37}, + {0x12, 0x22}, + {0x13, 0x19}, + {0x14, 0x44}, + {0x15, 0x44}, + {0x16, 0xc2}, + {0x17, 0xA8}, + {0x18, 0x18}, + {0x19, 0x50}, + {0x1a, 0xd8}, + {0x1b, 0xf5}, + {0x70, 0x40}, + {0x71, 0x58}, + {0x72, 0x30}, + {0x73, 0x48}, + {0x74, 0x20}, + {0x75, 0x60}, + {0x77, 0x20}, + {0x78, 0x32}, + {0x30, 0x03}, + {0x31, 0x40}, + {0x32, 0x10}, + {0x33, 0xe0}, + {0x34, 0xe0}, + {0x35, 0x00}, + {0x36, 0x80}, + {0x37, 0x00}, + {0x38, 0x04}, + {0x39, 0x09}, + {0x3a, 0x12}, + {0x3b, 0x1C}, + {0x3c, 0x28}, + {0x3d, 0x31}, + {0x3e, 0x44}, + {0x3f, 0x57}, + {0x40, 0x6C}, + {0x41, 0x81}, + {0x42, 0x94}, + {0x43, 0xA7}, + {0x44, 0xB8}, + {0x45, 0xD6}, + {0x46, 0xEE}, + {0x47, 0x0d}, + {0x62, 0xf7}, + {0x63, 0x68}, + {0x64, 0xd3}, + {0x65, 0xd3}, + {0x66, 0x60}, + {0xfe, 0x00}, + {REGLIST_TAIL, 0x00}, +}; + +#endif diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/gc032a.h b/lib/libesp32_div/esp32-camera/sensors/private_include/gc032a.h new file mode 100644 index 000000000..7679f0708 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/gc032a.h @@ -0,0 +1,31 @@ +/* + * + * GC032A driver. + * + */ +#ifndef __GC032A_H__ +#define __GC032A_H__ + +#include "sensor.h" + +/** + * @brief Detect sensor pid + * + * @param slv_addr SCCB address + * @param id Detection result + * @return + * 0: Can't detect this sensor + * Nonzero: This sensor has been detected + */ +int gc032a_detect(int slv_addr, sensor_id_t *id); + +/** + * @brief initialize sensor function pointers + * + * @param sensor pointer of sensor + * @return + * Always 0 + */ +int gc032a_init(sensor_t *sensor); + +#endif // __GC032A_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/gc032a_regs.h b/lib/libesp32_div/esp32-camera/sensors/private_include/gc032a_regs.h new file mode 100644 index 000000000..5de59d1d2 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/gc032a_regs.h @@ -0,0 +1,82 @@ +/* + * GC032A register definitions. + */ +#ifndef __GC032A_REG_REGS_H__ +#define __GC032A_REG_REGS_H__ + +#define SENSOR_ID_HIGH 0XF0 +#define SENSOR_ID_LOW 0XF1 +#define PAD_VB_HIZ_MODE 0XF2 +#define SYNC_OUTPUT 0XF3 +#define I2C_CONFIG 0XF4 +#define PLL_MODE1 0XF7 +#define PLL_MODE2 0XF8 +#define CM_MODE 0XF9 +#define ISP_DIV_MODE 0XFA +#define I2C_DEVICE_ID 0XFB +#define ANALOG_PWC 0XFC +#define ISP_DIV_MODE2 0XFD +#define RESET_RELATED 0XFE // Bit[7]: Software reset + // Bit[6]: cm reset + // Bit[5]: spi reset + // Bit[4]: CISCTL_restart_n + // Bit[3]: PLL_rst + // Bit[2:0]: page select + // 000:page0 + // 001:page1 + // 010:page2 + // 011:page3 + +//----page0----------------------------- +#define P0_EXPOSURE_HIGH 0X03 +#define P0_EXPOSURE_LOW 0X04 +#define P0_HB_HIGH 0X05 +#define P0_HB_LOW 0X06 +#define P0_VB_HIGH 0X07 +#define P0_VB_LOW 0X08 +#define P0_ROW_START_HIGH 0X09 +#define P0_ROW_START_LOW 0X0A +#define P0_COLUMN_START_HIGH 0X0B +#define P0_COLUMN_START_LOW 0X0C +#define P0_WINDOW_HEIGHT_HIGH 0X0D +#define P0_WINDOW_HEIGHT_LOW 0X0E +#define P0_WINDOW_WIDTH_HIGH 0X0F +#define P0_WINDOW_WIDTH_LOW 0X10 +#define P0_SH_DELAY 0X11 +#define P0_VS_ST 0X12 +#define P0_VS_ET 0X13 +#define P0_CISCTL_MODE1 0X17 + +#define P0_BLOCK_ENABLE_1 0X40 +#define P0_AAAA_ENABLE 0X42 +#define P0_SPECIAL_EFFECT 0X43 +#define P0_SYNC_MODE 0X46 +#define P0_GAIN_CODE 0X48 +#define P0_DEBUG_MODE2 0X4C +#define P0_WIN_MODE 0X50 +#define P0_OUT_WIN_Y1_HIGH 0X51 +#define P0_OUT_WIN_Y1_LOW 0X52 +#define P0_OUT_WIN_X1_HIGH 0X53 +#define P0_OUT_WIN_X1_LOW 0X54 +#define P0_OUT_WIN_HEIGHT_HIGH 0X55 +#define P0_OUT_WIN_HEIGHT_LOW 0X56 +#define P0_OUT_WIN_WIDTH_HIGH 0X57 +#define P0_OUT_WIN_WIDTH_LOW 0X58 + +#define P0_GLOBAL_SATURATION 0XD0 +#define P0_SATURATION_CB 0XD1 +#define P0_SATURATION_CR 0XD2 +#define P0_LUMA_CONTRAST 0XD3 +#define P0_CONTRAST_CENTER 0XD4 +#define P0_LUMA_OFFSET 0XD5 +#define P0_FIXED_CB 0XDA +#define P0_FIXED_CR 0XDB + +//----page3----------------------------- +#define P3_IMAGE_WIDTH_LOW 0X5B +#define P3_IMAGE_WIDTH_HIGH 0X5C +#define P3_IMAGE_HEIGHT_LOW 0X5D +#define P3_IMAGE_HEIGHT_HIGH 0X5E + + +#endif //__GC032A_REG_REGS_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/gc032a_settings.h b/lib/libesp32_div/esp32-camera/sensors/private_include/gc032a_settings.h new file mode 100644 index 000000000..a19ffc7c6 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/gc032a_settings.h @@ -0,0 +1,401 @@ +#ifndef _GC032A_SETTINGS_H_ +#define _GC032A_SETTINGS_H_ + +#include +#include +#include "esp_attr.h" +#include "gc032a_regs.h" + + +#define REG_DLY 0xffff +#define REGLIST_TAIL 0x0000 + + +/* + * The default register settings, as obtained from OmniVision. There + * is really no making sense of most of these - lots of "reserved" values + * and such. + * + */ +static const uint16_t gc032a_default_regs[][2] = { + /*System*/ + {0xf3, 0xff}, + {0xf5, 0x06}, + {0xf7, 0x01}, + {0xf8, 0x03}, + {0xf9, 0xce}, + {0xfa, 0x00}, + {0xfc, 0x02}, + {0xfe, 0x02}, + {0x81, 0x03}, + + {0xfe, 0x00}, + {0x77, 0x64}, + {0x78, 0x40}, + {0x79, 0x60}, + /*ANALOG & CISCTL*/ + {0xfe, 0x00}, + {0x03, 0x01}, + {0x04, 0xce}, + {0x05, 0x01}, + {0x06, 0xad}, + {0x07, 0x00}, + {0x08, 0x10}, + {0x0a, 0x00}, + {0x0c, 0x00}, + {0x0d, 0x01}, + {0x0e, 0xe8}, // height 488 + {0x0f, 0x02}, + {0x10, 0x88}, // width 648 + {0x17, 0x54}, + {0x19, 0x08}, + {0x1a, 0x0a}, + {0x1f, 0x40}, + {0x20, 0x30}, + {0x2e, 0x80}, + {0x2f, 0x2b}, + {0x30, 0x1a}, + {0xfe, 0x02}, + {0x03, 0x02}, + {0x05, 0xd7}, + {0x06, 0x60}, + {0x08, 0x80}, + {0x12, 0x89}, + + /*blk*/ + {0xfe, 0x00}, + {0x18, 0x02}, + {0xfe, 0x02}, + {0x40, 0x22}, + {0x45, 0x00}, + {0x46, 0x00}, + {0x49, 0x20}, + {0x4b, 0x3c}, + {0x50, 0x20}, + {0x42, 0x10}, + + /*isp*/ + {0xfe, 0x01}, + {0x0a, 0xc5}, + {0x45, 0x00}, + {0xfe, 0x00}, + {0x40, 0xff}, + {0x41, 0x25}, + {0x42, 0xcf}, + {0x43, 0x10}, + {0x44, 0x83}, + {0x46, 0x23}, + {0x49, 0x03}, + {0x52, 0x02}, + {0x54, 0x00}, + {0xfe, 0x02}, + {0x22, 0xf6}, + + /*Shading*/ + {0xfe, 0x01}, + {0xc1, 0x38}, + {0xc2, 0x4c}, + {0xc3, 0x00}, + {0xc4, 0x32}, + {0xc5, 0x24}, + {0xc6, 0x16}, + {0xc7, 0x08}, + {0xc8, 0x08}, + {0xc9, 0x00}, + {0xca, 0x20}, + {0xdc, 0x8a}, + {0xdd, 0xa0}, + {0xde, 0xa6}, + {0xdf, 0x75}, + + /*AWB*/ + {0xfe, 0x01}, + {0x7c, 0x09}, + {0x65, 0x06}, + {0x7c, 0x08}, + {0x56, 0xf4}, + {0x66, 0x0f}, + {0x67, 0x84}, + {0x6b, 0x80}, + {0x6d, 0x12}, + {0x6e, 0xb0}, + {0x86, 0x00}, + {0x87, 0x00}, + {0x88, 0x00}, + {0x89, 0x00}, + {0x8a, 0x00}, + {0x8b, 0x00}, + {0x8c, 0x00}, + {0x8d, 0x00}, + {0x8e, 0x00}, + {0x8f, 0x00}, + {0x90, 0x00}, + {0x91, 0x00}, + {0x92, 0xf4}, + {0x93, 0xd5}, + {0x94, 0x50}, + {0x95, 0x0f}, + {0x96, 0xf4}, + {0x97, 0x2d}, + {0x98, 0x0f}, + {0x99, 0xa6}, + {0x9a, 0x2d}, + {0x9b, 0x0f}, + {0x9c, 0x59}, + {0x9d, 0x2d}, + {0x9e, 0xaa}, + {0x9f, 0x67}, + {0xa0, 0x59}, + {0xa1, 0x00}, + {0xa2, 0x00}, + {0xa3, 0x0a}, + {0xa4, 0x00}, + {0xa5, 0x00}, + {0xa6, 0xd4}, + {0xa7, 0x9f}, + {0xa8, 0x55}, + {0xa9, 0xd4}, + {0xaa, 0x9f}, + {0xab, 0xac}, + {0xac, 0x9f}, + {0xad, 0x55}, + {0xae, 0xd4}, + {0xaf, 0xac}, + {0xb0, 0xd4}, + {0xb1, 0xa3}, + {0xb2, 0x55}, + {0xb3, 0xd4}, + {0xb4, 0xac}, + {0xb5, 0x00}, + {0xb6, 0x00}, + {0xb7, 0x05}, + {0xb8, 0xd6}, + {0xb9, 0x8c}, + + /*CC*/ + {0xfe, 0x01}, + {0xd0, 0x40}, + {0xd1, 0xf8}, + {0xd2, 0x00}, + {0xd3, 0xfa}, + {0xd4, 0x45}, + {0xd5, 0x02}, + + {0xd6, 0x30}, + {0xd7, 0xfa}, + {0xd8, 0x08}, + {0xd9, 0x08}, + {0xda, 0x58}, + {0xdb, 0x02}, + {0xfe, 0x00}, + + /*Gamma*/ + {0xfe, 0x00}, + {0xba, 0x00}, + {0xbb, 0x04}, + {0xbc, 0x0a}, + {0xbd, 0x0e}, + {0xbe, 0x22}, + {0xbf, 0x30}, + {0xc0, 0x3d}, + {0xc1, 0x4a}, + {0xc2, 0x5d}, + {0xc3, 0x6b}, + {0xc4, 0x7a}, + {0xc5, 0x85}, + {0xc6, 0x90}, + {0xc7, 0xa5}, + {0xc8, 0xb5}, + {0xc9, 0xc2}, + {0xca, 0xcc}, + {0xcb, 0xd5}, + {0xcc, 0xde}, + {0xcd, 0xea}, + {0xce, 0xf5}, + {0xcf, 0xff}, + + /*Auto Gamma*/ + {0xfe, 0x00}, + {0x5a, 0x08}, + {0x5b, 0x0f}, + {0x5c, 0x15}, + {0x5d, 0x1c}, + {0x5e, 0x28}, + {0x5f, 0x36}, + {0x60, 0x45}, + {0x61, 0x51}, + {0x62, 0x6a}, + {0x63, 0x7d}, + {0x64, 0x8d}, + {0x65, 0x98}, + {0x66, 0xa2}, + {0x67, 0xb5}, + {0x68, 0xc3}, + {0x69, 0xcd}, + {0x6a, 0xd4}, + {0x6b, 0xdc}, + {0x6c, 0xe3}, + {0x6d, 0xf0}, + {0x6e, 0xf9}, + {0x6f, 0xff}, + + /*Gain*/ + {0xfe, 0x00}, + {0x70, 0x50}, + + /*AEC*/ + {0xfe, 0x00}, + {0x4f, 0x01}, + {0xfe, 0x01}, + {0x0d, 0x00}, + {0x12, 0xa0}, + {0x13, 0x3a}, + {0x44, 0x04}, + {0x1f, 0x30}, + {0x20, 0x40}, + {0x26, 0x9a}, + {0x3e, 0x20}, + {0x3f, 0x2d}, + {0x40, 0x40}, + {0x41, 0x5b}, + {0x42, 0x82}, + {0x43, 0xb7}, + {0x04, 0x0a}, + {0x02, 0x79}, + {0x03, 0xc0}, + + /*measure window*/ + {0xfe, 0x01}, + {0xcc, 0x08}, + {0xcd, 0x08}, + {0xce, 0xa4}, + {0xcf, 0xec}, + + /*DNDD*/ + {0xfe, 0x00}, + {0x81, 0xb8}, + {0x82, 0x12}, + {0x83, 0x0a}, + {0x84, 0x01}, + {0x86, 0x50}, + {0x87, 0x18}, + {0x88, 0x10}, + {0x89, 0x70}, + {0x8a, 0x20}, + {0x8b, 0x10}, + {0x8c, 0x08}, + {0x8d, 0x0a}, + + /*Intpee*/ + {0xfe, 0x00}, + {0x8f, 0xaa}, + {0x90, 0x9c}, + {0x91, 0x52}, + {0x92, 0x03}, + {0x93, 0x03}, + {0x94, 0x08}, + {0x95, 0x44}, + {0x97, 0x00}, + {0x98, 0x00}, + + /*ASDE*/ + {0xfe, 0x00}, + {0xa1, 0x30}, + {0xa2, 0x41}, + {0xa4, 0x30}, + {0xa5, 0x20}, + {0xaa, 0x30}, + {0xac, 0x32}, + + /*YCP*/ + {0xfe, 0x00}, + {0xd1, 0x3c}, + {0xd2, 0x3c}, + {0xd3, 0x38}, + {0xd6, 0xf4}, + {0xd7, 0x1d}, + {0xdd, 0x73}, + {0xde, 0x84}, + + /*Banding*/ + {0xfe, 0x00}, + {0x05, 0x01}, + {0x06, 0xad}, + {0x07, 0x00}, + {0x08, 0x10}, + + {0xfe, 0x01}, + {0x25, 0x00}, + {0x26, 0x9a}, + + {0x27, 0x01}, + {0x28, 0xce}, + {0x29, 0x02}, + {0x2a, 0x68}, + {0x2b, 0x02}, + {0x2c, 0x68}, + {0x2d, 0x07}, + {0x2e, 0xd2}, + {0x2f, 0x0b}, + {0x30, 0x6e}, + {0x31, 0x0e}, + {0x32, 0x70}, + {0x33, 0x12}, + {0x34, 0x0c}, + {0x3c, 0x30}, + + /*Analog&Cisctl*/ + {0xfe, 0x00}, + {0x05, 0x01}, + {0x06, 0xa0}, + {0x07, 0x00}, + {0x08, 0x20}, + {0x0a, 0x78}, + {0x0c, 0xa0}, + {0x0d, 0x00}, //window_height [8] + {0x0e, 0xf8}, //window_height [7:0] 248 + {0x0f, 0x01}, //window_width [9:8] + {0x10, 0x48}, //window_width [7:0] 328 + + {0x55, 0x00}, + {0x56, 0xf0}, // 240 + {0x57, 0x01}, + {0x58, 0x40}, // 320 + + /*SPI*/ + {0xfe, 0x03}, + {0x5b, 0x40}, + {0x5c, 0x01}, + {0x5d, 0xf0}, + {0x5e, 0x00}, + + /*AEC*/ + {0xfe, 0x01}, + {0x25, 0x00}, //step + {0x26, 0x63}, + {0x27, 0x01}, + {0x28, 0x29}, + {0x29, 0x01}, + {0x2a, 0x29}, + {0x2b, 0x01}, + {0x2c, 0x29}, + {0x2d, 0x01}, + {0x2e, 0x29}, + {0x2f, 0x01}, + {0x30, 0x29}, + {0x31, 0x01}, + {0x32, 0x29}, + {0x33, 0x01}, + {0x34, 0x29}, + {0x3c, 0x00}, + + /*measure window*/ + {0xfe, 0x01}, + {0xcc, 0x04}, + {0xcd, 0x04}, + {0xce, 0x72}, + {0xcf, 0x52}, + {REGLIST_TAIL, 0x00}, +}; + +#endif diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/gc2145.h b/lib/libesp32_div/esp32-camera/sensors/private_include/gc2145.h new file mode 100644 index 000000000..6c5b60f70 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/gc2145.h @@ -0,0 +1,27 @@ + +#ifndef __GC2145_H__ +#define __GC2145_H__ + +#include "sensor.h" + +/** + * @brief Detect sensor pid + * + * @param slv_addr SCCB address + * @param id Detection result + * @return + * 0: Can't detect this sensor + * Nonzero: This sensor has been detected + */ +int gc2145_detect(int slv_addr, sensor_id_t *id); + +/** + * @brief initialize sensor function pointers + * + * @param sensor pointer of sensor + * @return + * Always 0 + */ +int gc2145_init(sensor_t *sensor); + +#endif // __GC2145_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/gc2145_regs.h b/lib/libesp32_div/esp32-camera/sensors/private_include/gc2145_regs.h new file mode 100644 index 000000000..b034a1689 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/gc2145_regs.h @@ -0,0 +1,85 @@ +/* + * GC2145 register definitions. + */ +#ifndef __GC2145_REG_REGS_H__ +#define __GC2145_REG_REGS_H__ + +#define CHIP_ID_HIGH 0XF0 +#define CHIP_ID_LOW 0XF1 +#define PLL_MODE1 0XF7 +#define PLL_MODE2 0XF8 +#define CM_MODE 0XF9 +#define CLK_DIV_MODE 0XFA +#define RESET_RELATED 0xfe // Bit[7]: Software reset + // Bit[6]: cm reset + // Bit[5]: mipi reset + // Bit[4]: CISCTL_restart_n + // Bit[3]: NA + // Bit[2:0]: page select + // 000:page0 + // 001:page1 + // 010:page2 + // 011:page3 + +//-page0---------------- + +#define P0_EXPOSURE_HIGH 0X03 +#define P0_EXPOSURE_LOW 0X04 +#define P0_HB_HIGH 0X05 +#define P0_HB_LOW 0X06 +#define P0_VB_HIGH 0X07 +#define P0_VB_LOW 0X08 +#define P0_ROW_START_HIGH 0X09 +#define P0_ROW_START_LOW 0X0A +#define P0_COL_START_HIGH 0X0B +#define P0_COL_START_LOW 0X0C + +#define P0_WIN_HEIGHT_HIGH 0X0D +#define P0_WIN_HEIGHT_LOW 0X0E +#define P0_WIN_WIDTH_HIGH 0X0F +#define P0_WIN_WIDTH_LOW 0X10 +#define P0_ANALOG_MODE1 0X17 +#define P0_ANALOG_MODE2 0X18 + +#define P0_SPECIAL_EFFECT 0X83 +#define P0_OUTPUT_FORMAT 0x84 // Format select + // Bit[7]:YUV420 row switch + // Bit[6]:YUV420 col switch + // Bit[7]:YUV420_legacy + // Bit[4:0]:output data mode + // 5’h00 Cb Y Cr Y + // 5’h01 Cr Y Cb Y + // 5’h02 Y Cb Y Cr + // 5’h03 Y Cr Y Cb + // 5’h04 LSC bypass, C/Y + // 5’h05 LSC bypass, Y/C + // 5’h06 RGB 565 + // 5’h0f bypass 10bits + // 5’h17 switch odd/even column /row to controls output Bayer pattern + // 00 RGBG + // 01 RGGB + // 10 BGGR + // 11 GBRG + // 5'h18 DNDD out mode + // 5'h19 LSC out mode + // 5;h1b EEINTP out mode +#define P0_FRAME_START 0X85 +#define P0_SYNC_MODE 0X86 +#define P0_MODULE_GATING 0X88 +#define P0_BYPASS_MODE 0X89 +#define P0_DEBUG_MODE2 0X8C +#define P0_DEBUG_MODE3 0X8D +#define P0_CROP_ENABLE 0X90 +#define P0_OUT_WIN_Y1_HIGH 0X91 +#define P0_OUT_WIN_Y1_LOW 0X92 +#define P0_OUT_WIN_X1_HIGH 0X93 +#define P0_OUT_WIN_X1_LOW 0X94 +#define P0_OUT_WIN_HEIGHT_HIGH 0X95 +#define P0_OUT_WIN_HEIGHT_LOW 0X96 +#define P0_OUT_WIN_WIDTH_HIGH 0X97 +#define P0_OUT_WIN_WIDTH_LOW 0X98 +#define P0_SUBSAMPLE 0X99 +#define P0_SUBSAMPLE_MODE 0X9A + + +#endif // __GC2145_REG_REGS_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/gc2145_settings.h b/lib/libesp32_div/esp32-camera/sensors/private_include/gc2145_settings.h new file mode 100644 index 000000000..879fd53b3 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/gc2145_settings.h @@ -0,0 +1,719 @@ + +#include + +#define REG_DLY 0xffff +#define REGLIST_TAIL 0x0000 /* Array end token */ + +static const uint16_t gc2145_default_init_regs[][2] = { + {0xfe, 0xf0}, + {0xfe, 0xf0}, + {0xfe, 0xf0}, + + {0xfc, 0x06}, + {0xf6, 0x00}, + + {0xf7, 0x1d}, //37 //17 //37 //1d//05 + {0xf8, 0x83}, //87 //83 //82 + {0xfa, 0x00}, + {0xf9, 0xfe}, //ff + {0xfd, 0x00}, + {0xc2, 0x00}, + {0xf2, 0x0f}, +////////////////////////////////////////////////////// +//////////////////// Analog & Cisctl //////////////// +////////////////////////////////////////////////////// + {0xfe, 0x00}, + + {0x03, 0x04}, //exp time + {0x04, 0x62}, //exp time + + {0x05, 0x01}, //00 //hb[11:8] + {0x06, 0x3b}, //0b //hb + + {0x09, 0x00}, //row start + {0x0a, 0x00}, // + {0x0b, 0x00}, //col start + {0x0c, 0x00}, + {0x0d, 0x04}, //height + {0x0e, 0xc0}, + {0x0f, 0x06}, //width + {0x10, 0x52}, + + {0x12, 0x2e}, //sh_delay 太短 YUV出图异常 + {0x17, 0x14}, //CISCTL Mode1 [1:0]mirror flip + {0x18, 0x22}, //sdark mode + {0x19, 0x0f}, // AD pipe number + {0x1a, 0x01}, //AD manual switch mode + + {0x1b, 0x4b}, //48 restg Width,SH width + {0x1c, 0x07}, //06 帧率快后,横条纹 //12 //TX Width,Space Width + {0x1d, 0x10}, //double reset + {0x1e, 0x88}, //90//98 //fix 竖线//Analog Mode1,TX high,Coln_r + {0x1f, 0x78}, //78 //38 //18 //Analog Mode2,txlow + {0x20, 0x03}, //07 //Analog Mode3,comv,ad_clk mode + {0x21, 0x40}, //10//20//40 //fix 灯管横条纹 + {0x22, 0xa0}, //d0//f0 //a2 //Vref vpix FPN严重 + {0x24, 0x1e}, + {0x25, 0x01}, //col sel + {0x26, 0x10}, //Analog PGA gain1 + {0x2d, 0x60}, //40//40 //txl drv mode + {0x30, 0x01}, //Analog Mode4 + {0x31, 0x90}, //b0//70 // Analog Mode7 [7:5]rsgh_r灯管横条纹[4:3]isp_g + {0x33, 0x06}, //03//02//01 //EQ_hstart_width + {0x34, 0x01}, +// +/////////////////////////////////////////////////// +//////////////////// ISP reg ////////////////////// +////////////////////////////////////////////////////// + {0x80, 0xff}, //outdoor gamma_en, GAMMA_en, CC_en, EE_en, INTP_en, DN_en, DD_en,LSC_en + {0x81, 0x24}, //26//24 //BLK dither mode, ll_y_en ,skin_en, edge SA, new_skin_mode, autogray_en,ll_gamma_en,BFF test image + {0x82, 0xfa}, //FA //auto_SA, auto_EE, auto_DN, auto_DD, auto_LSC, ABS_en, AWB_en, NA + {0x83, 0x00}, //special_effect + {0x84, 0x02}, //output format + {0x86, 0x03}, //c2 //46 //c2 //sync mode + {0x88, 0x03}, //[1]ctl_auto_gating [0]out_auto_gating + {0x89, 0x03}, //bypass disable + {0x85, 0x30}, //60//frame start cut + {0x8a, 0x00}, //ISP_quiet_mode,close aaa pclk,BLK gate mode,exception,close first pipe clock,close dndd clock,close intp clock,DIV_gatedclk_en + {0x8b, 0x00}, //[7:6]BFF_gate_mode,[5]BLK switch gain,[4]protect exp,[3:2]pipe gate mode,[1]not split sram,[0]dark current update + + {0xb0, 0x55}, //60 //global gain + {0xc3, 0x00}, //[7:4]auto_exp_gamma_th1[11:8],[3:0]auto_exp_gamma_th2[11:8] + {0xc4, 0x80}, //auto_exp_gamma_th1[7:0] into + {0xc5, 0x90}, //auto_exp_gamma_th2[7:0] out //outdoor gamma + {0xc6, 0x38}, //auto_gamma_th1 + {0xc7, 0x40}, //auto_gamma_th2 + + {0xec, 0x06}, //measure window + {0xed, 0x04}, + {0xee, 0x60}, //16 col + {0xef, 0x90}, //8 row + + {0xb6, 0x01}, //[0]aec en + + {0x90, 0x01}, //crop + {0x91, 0x00}, + {0x92, 0x00}, + {0x93, 0x00}, + {0x94, 0x00}, //08 + {0x95, 0x04}, + {0x96, 0xb0}, + {0x97, 0x06}, + {0x98, 0x40}, + +/////////////////////////////////////////////// +/////////// BLK //////////////////////// +/////////////////////////////////////////////// + {0x18, 0x02}, + {0x40, 0x42}, //2b //27 + {0x41, 0x00}, //80 //dark row sel + {0x43, 0x54}, //[7:4]BLK start not smooth [3:0]output start frame + + {0x5e, 0x00}, //00//10 //18 + {0x5f, 0x00}, //00//10 //18 + {0x60, 0x00}, //00//10 //18 + {0x61, 0x00}, //00///10 //18 + {0x62, 0x00}, //00//10 //18 + {0x63, 0x00}, //00//10 //18 + {0x64, 0x00}, //00/10 //18 + {0x65, 0x00}, //00//10 //18 + {0x66, 0x20}, //1e + {0x67, 0x20}, //1e + {0x68, 0x20}, //1e + {0x69, 0x20}, //1e + + + {0x76, 0x00}, //0f + + {0x6a, 0x00}, //06 + {0x6b, 0x00}, //06 + {0x6c, 0x3e}, //06 + {0x6d, 0x3e}, //06 + {0x6e, 0x3f}, //06 + {0x6f, 0x3f}, //06 + {0x70, 0x00}, //06 + {0x71, 0x00}, //06 //manual offset + + {0x76, 0x00}, //1f//add offset + {0x72, 0xf0}, //[7:4]BLK DD th [3:0]BLK various th + {0x7e, 0x3c}, //ndark + {0x7f, 0x00}, + + {0xfe, 0x02}, + {0x48, 0x15}, + {0x49, 0x00}, //04//04 //ASDE OFFSET SLOPE + {0x4b, 0x0b}, //ASDE y OFFSET SLOPE + {0xfe, 0x00}, + +/////////////////////////////////////////////// +/////////// AEC //////////////////////// +/////////////////////////////////////////////// + {0xfe, 0x01}, + + {0x01, 0x04}, //AEC X1 + {0x02, 0xc0}, //AEC X2 + {0x03, 0x04}, //AEC Y1 + {0x04, 0x90}, //AEC Y2 + {0x05, 0x30}, //20 //AEC center X1 + {0x06, 0x90}, //40 //AEC center X2 + {0x07, 0x20}, //30 //AEC center Y1 + {0x08, 0x70}, //60 //AEC center Y2 + + {0x09, 0x00}, //AEC show mode + {0x0a, 0xc2}, //[7]col gain enable + {0x0b, 0x11}, //AEC every N + {0x0c, 0x10}, //AEC_mode3 center weight + {0x13, 0x40}, //2a //AEC Y target + {0x17, 0x00}, //AEC ignore mode + {0x1c, 0x11}, // + {0x1e, 0x61}, // + {0x1f, 0x30}, //40//50 //max pre gain + {0x20, 0x40}, //60//40 //max post gain + {0x22, 0x80}, //AEC outdoor THD + {0x23, 0x20}, //target_Y_low_limit + {0xfe, 0x02}, + {0x0f, 0x04}, //05 + {0xfe, 0x01}, + + {0x12, 0x35}, //35 //[5:4]group_size [3]slope_disable [2]outdoor_enable [0]histogram_enable + {0x15, 0x50}, //target_Y_high_limit + {0x10, 0x31}, //num_thd_high + {0x3e, 0x28}, //num_thd_low + {0x3f, 0xe0}, //luma_thd + {0x40, 0x20}, //luma_slope + {0x41, 0x0f}, //color_diff + + {0xfe, 0x02}, + {0x0f, 0x05}, //max_col_level +/////////////////////////// +////// INTPEE ///////////// +/////////////////////////// + {0xfe, 0x02}, //page2 + {0x90, 0x6c}, //ac //eeintp mode1 + {0x91, 0x03}, //02 ////eeintp mode2 + {0x92, 0xc8}, //44 //low criteria for direction + {0x94, 0x66}, + {0x95, 0xb5}, + {0x97, 0x64}, //78 ////edge effect + {0xa2, 0x11}, //fix direction + {0xfe, 0x00}, + +///////////////////////////// +//////// DNDD/////////////// +///////////////////////////// + {0xfe, 0x02}, + {0x80, 0xc1}, //c1 //[7]share mode [6]skin mode [5]is 5x5 mode [1:0]noise value select 0:2 1:2.5 2:3 3:4 + {0x81, 0x08}, // + {0x82, 0x08}, //signal a 0.6 + {0x83, 0x08}, //04 //signal b 2.5 + + {0x84, 0x0a}, //10 //05 dark_DD_TH + {0x86, 0xf0}, //a0 Y_value_dd_th2 + {0x87, 0x50}, //90 Y_value_dd_th3 + {0x88, 0x15}, //60 Y_value_dd_th4 + + {0x89, 0x50}, //80 // asde th2 + {0x8a, 0x30}, //60 // asde th3 + {0x8b, 0x10}, //30 // asde th4 + +///////////////////////////////////////////////// +///////////// ASDE //////////////////////// +///////////////////////////////////////////////// + {0xfe, 0x01}, //page 1 + {0x21, 0x14}, //luma_value_div_sel(分频,与0xef呈2倍关系,增大1,0xef的值减小1倍) +//ff ef luma_value read_only + + {0xfe, 0x02}, //page2 + {0xa3, 0x40}, //ASDE_low_luma_value_LSC_th_H + {0xa4, 0x20}, //ASDE_low_luma_value_LSC_th_L + + {0xa5, 0x40}, //80 //ASDE_LSC_gain_dec_slope_H + {0xa6, 0x80}, // 80 //ASDE_LSC_gain_dec_slope_L +//ff a7 ASDE_LSC_gain_dec //read only + + {0xab, 0x40}, //50 //ASDE_low_luma_value_OT_th + + {0xae, 0x0c}, //[3]EE1_effect_inc_or_dec_high,[2]EE2_effect_inc_or_dec_high, + //[1]EE1_effect_inc_or_dec_low,[0]EE2_effect_inc_or_dec_low, 1:inc 0:dec + + {0xb3, 0x34}, //44 //ASDE_EE1_effect_slope_low,ASDE_EE2_effect_slope_low + {0xb4, 0x44}, //12 //ASDE_EE1_effect_slope_high,ASDE_EE2_effect_slope_high + + {0xb6, 0x38}, //40//40 //ASDE_auto_saturation_dec_slope + {0xb7, 0x02}, //04 //ASDE_sub_saturation_slope + {0xb9, 0x30}, //[7:0]ASDE_auto_saturation_low_limit + {0x3c, 0x08}, //[3:0]auto gray_dec_slope + {0x3d, 0x30}, //[7:0]auto gray_dec_th + + + {0x4b, 0x0d}, //y offset slope + {0x4c, 0x20}, //y offset limit + + {0xfe, 0x00}, +// +///////////////////gamma1//////////////////// +////Gamma + {0xfe, 0x02}, + {0x10, 0x10}, + {0x11, 0x15}, + {0x12, 0x1a}, + {0x13, 0x1f}, + {0x14, 0x2c}, + {0x15, 0x39}, + {0x16, 0x45}, + {0x17, 0x54}, + {0x18, 0x69}, + {0x19, 0x7d}, + {0x1a, 0x8f}, + {0x1b, 0x9d}, + {0x1c, 0xa9}, + {0x1d, 0xbd}, + {0x1e, 0xcd}, + {0x1f, 0xd9}, + {0x20, 0xe3}, + {0x21, 0xea}, + {0x22, 0xef}, + {0x23, 0xf5}, + {0x24, 0xf9}, + {0x25, 0xff}, + +/////auto gamma///// + {0xfe, 0x02}, + {0x26, 0x0f}, + {0x27, 0x14}, + {0x28, 0x19}, + {0x29, 0x1e}, + {0x2a, 0x27}, + {0x2b, 0x33}, + {0x2c, 0x3b}, + {0x2d, 0x45}, + {0x2e, 0x59}, + {0x2f, 0x69}, + {0x30, 0x7c}, + {0x31, 0x89}, + {0x32, 0x98}, + {0x33, 0xae}, + {0x34, 0xc0}, + {0x35, 0xcf}, + {0x36, 0xda}, + {0x37, 0xe2}, + {0x38, 0xe9}, + {0x39, 0xf3}, + {0x3a, 0xf9}, + {0x3b, 0xff}, + +/////////////////////////////////////////////// +/////////// YCP /////////////////////// +/////////////////////////////////////////////// + {0xfe, 0x02}, + {0xd1, 0x30}, //32 // + {0xd2, 0x30}, //32 // + {0xd3, 0x45}, + {0xdd, 0x14}, //edge sa + {0xde, 0x86}, //asde auto gray + {0xed, 0x01}, // + {0xee, 0x28}, + {0xef, 0x30}, + {0xd8, 0xd8}, //autogray protecy + +//////////////////////////// +//////// LSC 0.8/////////////// +//////////////////////////// + {0xfe, 0x01}, + {0xa1, 0x80}, // center_row + {0xa2, 0x80}, // center_col + {0xa4, 0x00}, // sign of b1 + {0xa5, 0x00}, // sign of b1 + {0xa6, 0x70}, // sign of b4 + {0xa7, 0x00}, // sign of b4 + {0xa8, 0x77}, // sign of b22 + {0xa9, 0x77}, // sign of b22 + {0xaa, 0x1f}, // Q1_b1 of R + {0xab, 0x0d}, // Q1_b1 of G + {0xac, 0x19}, // Q1_b1 of B + {0xad, 0x24}, // Q2_b1 of R + {0xae, 0x0e}, // Q2_b1 of G + {0xaf, 0x1d}, // Q2_b1 of B + {0xb0, 0x12}, // Q3_b1 of R + {0xb1, 0x0c}, // Q3_b1 of G + {0xb2, 0x06}, // Q3_b1 of B + {0xb3, 0x13}, // Q4_b1 of R + {0xb4, 0x10}, // Q4_b1 of G + {0xb5, 0x0c}, // Q4_b1 of B + {0xb6, 0x6a}, // right_b2 of R + {0xb7, 0x46}, // right_b2 of G + {0xb8, 0x40}, // right_b2 of B + {0xb9, 0x0b}, // right_b4 of R + {0xba, 0x04}, // right_b4 of G + {0xbb, 0x00}, // right_b4 of B + {0xbc, 0x53}, // left_b2 of R + {0xbd, 0x37}, // left_b2 of G + {0xbe, 0x2d}, // left_b2 of B + {0xbf, 0x0a}, // left_b4 of R + {0xc0, 0x0a}, // left_b4 of G + {0xc1, 0x14}, // left_b4 of B + {0xc2, 0x34}, // up_b2 of R + {0xc3, 0x22}, // up_b2 of G + {0xc4, 0x18}, // up_b2 of B + {0xc5, 0x23}, // up_b4 of R + {0xc6, 0x0f}, // up_b4 of G + {0xc7, 0x3c}, // up_b4 of B + {0xc8, 0x20}, // down_b2 of R + {0xc9, 0x1f}, // down_b2 of G + {0xca, 0x17}, // down_b2 of B + {0xcb, 0x2d}, // down_b4 of R + {0xcc, 0x12}, // down_b4 of G + {0xcd, 0x20}, // down_b4 of B + {0xd0, 0x61}, // right_up_b22 of R + {0xd1, 0x2f}, // right_up_b22 of G + {0xd2, 0x39}, // right_up_b22 of B + {0xd3, 0x45}, // right_down_b22 of R + {0xd4, 0x2c}, // right_down_b22 of G + {0xd5, 0x21}, // right_down_b22 of B + {0xd6, 0x64}, // left_up_b22 of R + {0xd7, 0x2d}, // left_up_b22 of G + {0xd8, 0x30}, // left_up_b22 of B + {0xd9, 0x42}, // left_down_b22 of R + {0xda, 0x27}, // left_down_b22 of G + {0xdb, 0x13}, // left_down_b22 of B + {0xfe, 0x00}, + +///////////////////////////////////////////////// +///////////// AWB //////////////////////// +///////////////////////////////////////////////// + {0xfe, 0x01}, + + {0x4f, 0x00}, + {0x4f, 0x00}, + {0x4b, 0x01}, + {0x4f, 0x00}, + + + {0x4c, 0x01}, + {0x4d, 0x6f}, + {0x4e, 0x02}, + {0x4c, 0x01}, + {0x4d, 0x70}, + + {0x4e, 0x02}, + {0x4c, 0x01}, + {0x4d, 0x8f}, + {0x4e, 0x02}, + + {0x4c, 0x01}, + {0x4d, 0x90}, + {0x4e, 0x02}, //light + + + {0x4c, 0x01}, + {0x4d, 0xed}, + {0x4e, 0x33}, //light + {0x4c, 0x01}, + {0x4d, 0xcd}, + {0x4e, 0x33}, //light + {0x4c, 0x01}, + {0x4d, 0xec}, + {0x4e, 0x03}, //light + + {0x4c, 0x01}, + {0x4d, 0x6c}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0x6d}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0x6e}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0x8c}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0x8d}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0x8e}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0xab}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0xac}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0xad}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0xae}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0xcb}, + {0x4e, 0x03}, + + {0x4c, 0x01}, + {0x4d, 0xcc}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0xce}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0xeb}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0xec}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0xee}, + {0x4e, 0x03}, + {0x4c, 0x02}, + {0x4d, 0x0c}, + {0x4e, 0x03}, + {0x4c, 0x02}, + {0x4d, 0x0d}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0xea}, + {0x4e, 0x03}, + {0x4c, 0x01}, + {0x4d, 0xaf}, + {0x4e, 0x03}, //dark + {0x4c, 0x01}, + {0x4d, 0xcf}, + {0x4e, 0x03}, //dark + + {0x4c, 0x01}, + {0x4d, 0xca}, + {0x4e, 0x04}, //light + {0x4c, 0x02}, + {0x4d, 0x0b}, + {0x4e, 0x05}, //light + {0x4c, 0x02}, + {0x4d, 0xc8}, + {0x4e, 0x06}, //light 100lux + {0x4c, 0x02}, + {0x4d, 0xa8}, + + {0x4e, 0x06}, //light + {0x4c, 0x02}, + {0x4d, 0xa9}, + {0x4e, 0x06}, //light + + + {0x4c, 0x02}, + {0x4d, 0x89}, + {0x4e, 0x06}, //400lux + {0x4c, 0x02}, + {0x4d, 0x69}, + {0x4e, 0x06}, //f12 + {0x4c, 0x02}, + {0x4d, 0x6a}, + {0x4e, 0x06}, //f12 + {0x4c, 0x02}, + {0x4d, 0xc7}, + {0x4e, 0x07}, + {0x4c, 0x02}, + {0x4d, 0xe7}, + {0x4e, 0x07}, //100lux + {0x4c, 0x03}, + {0x4d, 0x07}, + {0x4e, 0x07}, //light + + {0x4c, 0x02}, + {0x4d, 0xe8}, + {0x4e, 0x07}, + {0x4c, 0x02}, + {0x4d, 0xe9}, + {0x4e, 0x07}, + {0x4c, 0x03}, + {0x4d, 0x08}, + {0x4e, 0x07}, + {0x4c, 0x03}, + {0x4d, 0x09}, + {0x4e, 0x07}, + {0x4c, 0x03}, + {0x4d, 0x27}, + {0x4e, 0x07}, + {0x4c, 0x03}, + {0x4d, 0x28}, + {0x4e, 0x07}, + {0x4c, 0x03}, + {0x4d, 0x29}, + {0x4e, 0x07}, + {0x4c, 0x03}, + {0x4d, 0x47}, + {0x4e, 0x07}, + {0x4c, 0x03}, + {0x4d, 0x48}, + {0x4e, 0x07}, + {0x4c, 0x03}, + {0x4d, 0x49}, + {0x4e, 0x07}, + {0x4c, 0x03}, + {0x4d, 0x67}, + {0x4e, 0x07}, + {0x4c, 0x03}, + {0x4d, 0x68}, + {0x4e, 0x07}, + {0x4c, 0x03}, + {0x4d, 0x69}, + {0x4e, 0x07}, + + {0x4f, 0x01}, + {0xfe, 0x01}, + {0x50, 0x80}, //AWB_PRE_mode + {0x51, 0xa8}, //AWB_pre_THD_min[7:0] + {0x52, 0x57}, //AWB_pre_THD_min[15:8] Dominiate luma 0.25=639c 0.22=57a8 + {0x53, 0x38}, //AWB_pre_THD_min_MIX[7:0] + {0x54, 0xc7}, //AWB_pre_THD_min_MIX[15:8] Mix luma 0.5 + + {0x56, 0x0e}, //AWB_tone mode + {0x58, 0x08}, //AWB_C_num_sel,AWB_D_num_sel + {0x5b, 0x00}, //AWB_mix_mode + + {0x5c, 0x74}, //green_num0[7:0] + {0x5d, 0x8b}, //green_num0[15:8] 0.35 + + {0x61, 0xd3}, //R2G_stand0 + {0x62, 0xb5}, //B2G_stand0 + {0x63, 0x00}, //88//a4 //AWB gray mode [7]enable + {0x65, 0x04}, //AWB margin + + {0x67, 0xb2}, //R2G_stand3[7:0] FF/CWF + {0x68, 0xac}, //B2G_stand3[7:0] + {0x69, 0x00}, //R2G_stand4[9:8] B2G_stand4[9:8] R2G_stand3[9:8] B2G_stand3[9:8] + {0x6a, 0xb2}, //R2G_stand4[7:0] TL84/TL84&CWF + {0x6b, 0xac}, //B2G_stand4[7:0] + {0x6c, 0xb2}, //R2G_stand5[7:0] A + {0x6d, 0xac}, //B2G_stand5[7:0] + {0x6e, 0x40}, //AWB_skin_weight R2G_stand5[9:8] B2G_stand5[9:8] + {0x6f, 0x18}, //AWB_indoor_THD (0x21=17 caculate) + {0x73, 0x00}, //AWB_indoor_mode + + {0x70, 0x10}, //AWB low luma TH + {0x71, 0xe8}, //AWB outdoor TH + {0x72, 0xc0}, //outdoor mode + {0x74, 0x01}, //[2:0]AWB skip mode 2x2,4x4,4x8,8x8 + {0x75, 0x01}, //[1:0]AWB_every_N + {0x7f, 0x08}, //[3]gray world frame start + + {0x76, 0x70}, //R limit + {0x77, 0x58}, //G limit + {0x78, 0xa0}, //d8 //B limit + + {0xfe, 0x00}, +// +////////////////////////////////////////// +/////////// CC //////////////////////// +////////////////////////////////////////// + {0xfe, 0x02}, + + {0xc0, 0x01}, //[5:4] CC mode [0]CCT enable + + {0xC1, 0x50}, //D50/D65 + {0xc2, 0xF9}, + {0xc3, 0x00}, //0 + {0xc4, 0xe8}, //e0 + {0xc5, 0x48}, + {0xc6, 0xf0}, + + + {0xC7, 0x50}, + {0xc8, 0xf2}, + {0xc9, 0x00}, + {0xcA, 0xE0}, + {0xcB, 0x45}, + {0xcC, 0xec}, + + {0xCd, 0x45}, + {0xce, 0xf0}, + {0xcf, 0x00}, + {0xe3, 0xf0}, + {0xe4, 0x45}, + {0xe5, 0xe8}, + + + {0xfe, 0x00}, + + {0xf2, 0x0f}, + + +//////////////frame rate 50Hz + {0xfe, 0x00}, + + {0xf7, 0x1d}, + {0xf8, 0x84}, + {0xfa, 0x00}, + + {0x05, 0x01}, //hb + {0x06, 0x3b}, + {0x07, 0x01}, //Vb + {0x08, 0x0b}, + + {0xfe, 0x01}, + {0x25, 0x01}, + {0x26, 0x32}, //step + {0x27, 0x03}, //8.15fps + {0x28, 0x96}, + {0x29, 0x03}, //8.15fps + {0x2a, 0x96}, + {0x2b, 0x03}, //8.15fps + {0x2c, 0x96}, + {0x2d, 0x04}, //8.15fps + {0x2e, 0x62}, + {0x3c, 0x00}, + {0xfe, 0x00}, + +/////////dark sun////// + {0xfe, 0x00}, + {0x18, 0x22}, + {0xfe, 0x02}, + {0x40, 0xbf}, + {0x46, 0xcf}, + {0xfe, 0x00}, + + {0xfe, 0x00}, + + {0xf7, 0x1d}, + {0xf8, 0x84}, + {0xfa, 0x10}, + + {0x05, 0x01}, //hb + {0x06, 0x18}, + {0x07, 0x00}, //Vb + {0x08, 0x2e}, + + {0xfe, 0x01}, + {0x25, 0x00}, + {0x26, 0xa2}, //step + {0x27, 0x01}, + {0x28, 0xe6}, + {0x29, 0x01}, + {0x2a, 0xe6}, + {0x2b, 0x01}, + {0x2c, 0xe6}, + {0x2d, 0x04}, // AEC_exp_level4[12:8] + {0x2e, 0x62}, // AEC_exp_level4[7:0] + {0x3c, 0x00}, + {0xfe, 0x00}, + + {0x09, 0x01}, //row start + {0x0a, 0xd0}, // + {0x0b, 0x02}, //col start + {0x0c, 0x70}, + {0x0d, 0x01}, //height + {0x0e, 0x00}, + {0x0f, 0x01}, //width + {0x10, 0x50}, + + {0x90, 0x01}, //crop + {0x91, 0x00}, + {0x92, 0x00}, + {0x93, 0x00}, + {0x94, 0x00}, + {0x95, 0x00}, + {0x96, 0xf0}, + {0x97, 0x01}, + {0x98, 0x40}, + + + {REGLIST_TAIL, 0x00}, +}; diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/nt99141.h b/lib/libesp32_div/esp32-camera/sensors/private_include/nt99141.h new file mode 100644 index 000000000..8b0c562b9 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/nt99141.h @@ -0,0 +1,34 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * NT99141 driver. + * + */ +#ifndef __NT99141_H__ +#define __NT99141_H__ + +#include "sensor.h" + +/** + * @brief Detect sensor pid + * + * @param slv_addr SCCB address + * @param id Detection result + * @return + * 0: Can't detect this sensor + * Nonzero: This sensor has been detected + */ +int nt99141_detect(int slv_addr, sensor_id_t *id); + +/** + * @brief initialize sensor function pointers + * + * @param sensor pointer of sensor + * @return + * Always 0 + */ +int nt99141_init(sensor_t *sensor); + +#endif // __NT99141_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/nt99141_regs.h b/lib/libesp32_div/esp32-camera/sensors/private_include/nt99141_regs.h new file mode 100644 index 000000000..8301db901 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/nt99141_regs.h @@ -0,0 +1,211 @@ +/* + * NT99141 register definitions. + */ +#ifndef __NT99141_REG_REGS_H__ +#define __NT99141_REG_REGS_H__ + +/* system control registers */ +#define SYSTEM_CTROL0 0x3021 // Bit[7]: Software reset + // Bit[6]: Software power down + // Bit[5]: Reserved + // Bit[4]: SRB clock SYNC enable + // Bit[3]: Isolation suspend select + // Bit[2:0]: Not used + +/* output format control registers */ +#define FORMAT_CTRL 0x501F // Format select + // Bit[2:0]: + // 000: YUV422 + // 001: RGB + // 010: Dither + // 011: RAW after DPC + // 101: RAW after CIP + +/* format control registers */ +#define FORMAT_CTRL00 0x4300 + +/* frame control registers */ +#define FRAME_CTRL01 0x4201 // Control Passed Frame Number When both ON and OFF number set to 0x00,frame control is in bypass mode + // Bit[7:4]: Not used + // Bit[3:0]: Frame ON number +#define FRAME_CTRL02 0x4202 // Control Masked Frame Number When both ON and OFF number set to 0x00,frame control is in bypass mode + // Bit[7:4]: Not used + // BIT[3:0]: Frame OFF number + +/* ISP top control registers */ +#define PRE_ISP_TEST_SETTING_1 0x3025 // Bit[7]: Test enable + // 0: Test disable + // 1: Color bar enable + // Bit[6]: Rolling + // Bit[5]: Transparent + // Bit[4]: Square black and white + // Bit[3:2]: Color bar style + // 00: Standard 8 color bar + // 01: Gradual change at vertical mode 1 + // 10: Gradual change at horizontal + // 11: Gradual change at vertical mode 2 + // Bit[1:0]: Test select + // 00: Color bar + // 01: Random data + // 10: Square data + // 11: Black image + +//exposure = {0x3500[3:0], 0x3501[7:0], 0x3502[7:0]} / 16 × tROW + +/* AEC/AGC control functions */ +#define AEC_PK_MANUAL 0x3201 // AEC Manual Mode Control + // Bit[7:6]: Reserved + // Bit[5]: Gain delay option + // Valid when 0x3503[4]=1’b0 + // 0: Delay one frame latch + // 1: One frame latch + // Bit[4:2]: Reserved + // Bit[1]: AGC manual + // 0: Auto enable + // 1: Manual enable + // Bit[0]: AEC manual + // 0: Auto enable + // 1: Manual enable + +//gain = {0x350A[1:0], 0x350B[7:0]} / 16 + +/* mirror and flip registers */ +#define TIMING_TC_REG20 0x3022 // Timing Control Register + // Bit[2:1]: Vertical flip enable + // 00: Normal + // 11: Vertical flip + // Bit[0]: Vertical binning enable +#define TIMING_TC_REG21 0x3022 // Timing Control Register + // Bit[5]: Compression Enable + // Bit[2:1]: Horizontal mirror enable + // 00: Normal + // 11: Horizontal mirror + // Bit[0]: Horizontal binning enable + +#define CLOCK_POL_CONTROL 0x3024// Bit[5]: PCLK polarity 0: active low + // 1: active high + // Bit[3]: Gate PCLK under VSYNC + // Bit[2]: Gate PCLK under HREF + // Bit[1]: HREF polarity + // 0: active low + // 1: active high + // Bit[0] VSYNC polarity + // 0: active low + // 1: active high +#define DRIVE_CAPABILITY 0x306a // Bit[7:6]: + // 00: 1x + // 01: 2x + // 10: 3x + // 11: 4x + + +#define X_ADDR_ST_H 0x3800 //Bit[3:0]: X address start[11:8] +#define X_ADDR_ST_L 0x3801 //Bit[7:0]: X address start[7:0] +#define Y_ADDR_ST_H 0x3802 //Bit[2:0]: Y address start[10:8] +#define Y_ADDR_ST_L 0x3803 //Bit[7:0]: Y address start[7:0] +#define X_ADDR_END_H 0x3804 //Bit[3:0]: X address end[11:8] +#define X_ADDR_END_L 0x3805 //Bit[7:0]: +#define Y_ADDR_END_H 0x3806 //Bit[2:0]: Y address end[10:8] +#define Y_ADDR_END_L 0x3807 //Bit[7:0]: +// Size after scaling +#define X_OUTPUT_SIZE_H 0x3808 //Bit[3:0]: DVP output horizontal width[11:8] +#define X_OUTPUT_SIZE_L 0x3809 //Bit[7:0]: +#define Y_OUTPUT_SIZE_H 0x380a //Bit[2:0]: DVP output vertical height[10:8] +#define Y_OUTPUT_SIZE_L 0x380b //Bit[7:0]: +#define X_TOTAL_SIZE_H 0x380c //Bit[3:0]: Total horizontal size[11:8] +#define X_TOTAL_SIZE_L 0x380d //Bit[7:0]: +#define Y_TOTAL_SIZE_H 0x380e //Bit[7:0]: Total vertical size[15:8] +#define Y_TOTAL_SIZE_L 0x380f //Bit[7:0]: +#define X_OFFSET_H 0x3810 //Bit[3:0]: ISP horizontal offset[11:8] +#define X_OFFSET_L 0x3811 //Bit[7:0]: +#define Y_OFFSET_H 0x3812 //Bit[2:0]: ISP vertical offset[10:8] +#define Y_OFFSET_L 0x3813 //Bit[7:0]: +#define X_INCREMENT 0x3814 //Bit[7:4]: Horizontal odd subsample increment + //Bit[3:0]: Horizontal even subsample increment +#define Y_INCREMENT 0x3815 //Bit[7:4]: Vertical odd subsample increment + //Bit[3:0]: Vertical even subsample increment +// Size before scaling +//#define X_INPUT_SIZE (X_ADDR_END - X_ADDR_ST + 1 - (2 * X_OFFSET)) +//#define Y_INPUT_SIZE (Y_ADDR_END - Y_ADDR_ST + 1 - (2 * Y_OFFSET)) + +#define ISP_CONTROL_01 0x3021 // Bit[5]: Scale enable + // 0: Disable + // 1: Enable + +#define SCALE_CTRL_1 0x5601 // Bit[6:4]: HDIV RW + // DCW scale times + // 000: DCW 1 time + // 001: DCW 2 times + // 010: DCW 4 times + // 100: DCW 8 times + // 101: DCW 16 times + // Others: DCW 16 times + // Bit[2:0]: VDIV RW + // DCW scale times + // 000: DCW 1 time + // 001: DCW 2 times + // 010: DCW 4 times + // 100: DCW 8 times + // 101: DCW 16 times + // Others: DCW 16 times + +#define SCALE_CTRL_2 0x5602 // X_SCALE High Bits +#define SCALE_CTRL_3 0x5603 // X_SCALE Low Bits +#define SCALE_CTRL_4 0x5604 // Y_SCALE High Bits +#define SCALE_CTRL_5 0x5605 // Y_SCALE Low Bits +#define SCALE_CTRL_6 0x5606 // Bit[3:0]: V Offset + +#define PCLK_RATIO 0x3824 // Bit[4:0]: PCLK ratio manual +#define VFIFO_CTRL0C 0x460C // Bit[1]: PCLK manual enable + // 0: Auto + // 1: Manual by PCLK_RATIO + +#define VFIFO_X_SIZE_H 0x4602 +#define VFIFO_X_SIZE_L 0x4603 +#define VFIFO_Y_SIZE_H 0x4604 +#define VFIFO_Y_SIZE_L 0x4605 + +#define SC_PLLS_CTRL0 0x303a // Bit[7]: PLLS bypass +#define SC_PLLS_CTRL1 0x303b // Bit[4:0]: PLLS multiplier +#define SC_PLLS_CTRL2 0x303c // Bit[6:4]: PLLS charge pump control + // Bit[3:0]: PLLS system divider +#define SC_PLLS_CTRL3 0x303d // Bit[5:4]: PLLS pre-divider + // 00: 1 + // 01: 1.5 + // 10: 2 + // 11: 3 + // Bit[2]: PLLS root-divider - 1 + // Bit[1:0]: PLLS seld5 + // 00: 1 + // 01: 1 + // 10: 2 + // 11: 2.5 + +#define COMPRESSION_CTRL00 0x4400 // +#define COMPRESSION_CTRL01 0x4401 // +#define COMPRESSION_CTRL02 0x4402 // +#define COMPRESSION_CTRL03 0x4403 // +#define COMPRESSION_CTRL04 0x4404 // +#define COMPRESSION_CTRL05 0x4405 // +#define COMPRESSION_CTRL06 0x4406 // +#define COMPRESSION_CTRL07 0x3401 // Bit[5:0]: QS +#define COMPRESSION_ISI_CTRL 0x4408 // +#define COMPRESSION_CTRL09 0x4409 // +#define COMPRESSION_CTRL0a 0x440a // +#define COMPRESSION_CTRL0b 0x440b // +#define COMPRESSION_CTRL0c 0x440c // +#define COMPRESSION_CTRL0d 0x440d // +#define COMPRESSION_CTRL0E 0x440e // + +/** + * @brief register value + */ +#define TEST_COLOR_BAR 0x02 /* Enable Color Bar roling Test */ + +#define AEC_PK_MANUAL_AGC_MANUALEN 0x02 /* Enable AGC Manual enable */ +#define AEC_PK_MANUAL_AEC_MANUALEN 0x01 /* Enable AEC Manual enable */ + +#define TIMING_TC_REG20_VFLIP 0x01 /* Vertical flip enable */ +#define TIMING_TC_REG21_HMIRROR 0x02 /* Horizontal mirror enable */ + +#endif // __NT99141_REG_REGS_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/nt99141_settings.h b/lib/libesp32_div/esp32-camera/sensors/private_include/nt99141_settings.h new file mode 100644 index 000000000..1ffec2053 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/nt99141_settings.h @@ -0,0 +1,825 @@ +#ifndef _NT99141_SETTINGS_H_ +#define _NT99141_SETTINGS_H_ + +#include +#include +#include "esp_attr.h" +#include "nt99141_regs.h" + +static const ratio_settings_t ratio_table[] = { + // mw, mh, sx, sy, ex, ey, ox, oy, tx, ty + { 1280, 720, 0, 4, 1283, 723, 0, 4, 1660, 963 }, + +}; + +#define REG_DLY 0xffff +#define REGLIST_TAIL 0x0000 + +static const DRAM_ATTR uint16_t sensor_default_regs[][2] = { + //initial +{0x3021, 0x00}, +{REG_DLY, 100}, // delay 100ms +{0x3109, 0x04}, +{0x3040, 0x04}, +{0x3041, 0x02}, +{0x3042, 0xFF}, +{0x3043, 0x08}, +{0x3052, 0xE0}, +{0x305F, 0x33}, +{0x3100, 0x07}, +{0x3106, 0x03}, +{0x3105, 0x01}, +{0x3108, 0x05}, +{0x3110, 0x22}, +{0x3111, 0x57}, +{0x3112, 0x22}, +{0x3113, 0x55}, +{0x3114, 0x05}, +{0x3135, 0x00}, +{0x32F0, 0x01}, +{0x3290, 0x01}, +{0x3291, 0x80}, +{0x3296, 0x01}, +{0x3297, 0x73}, +{0x3250, 0x80}, +{0x3251, 0x03}, +{0x3252, 0xFF}, +{0x3253, 0x00}, +{0x3254, 0x03}, +{0x3255, 0xFF}, +{0x3256, 0x00}, +{0x3257, 0x50}, +{0x3270, 0x00}, +{0x3271, 0x0C}, +{0x3272, 0x18}, +{0x3273, 0x32}, +{0x3274, 0x44}, +{0x3275, 0x54}, +{0x3276, 0x70}, +{0x3277, 0x88}, +{0x3278, 0x9D}, +{0x3279, 0xB0}, +{0x327A, 0xCF}, +{0x327B, 0xE2}, +{0x327C, 0xEF}, +{0x327D, 0xF7}, +{0x327E, 0xFF}, +{0x3302, 0x00}, +{0x3303, 0x40}, +{0x3304, 0x00}, +{0x3305, 0x96}, +{0x3306, 0x00}, +{0x3307, 0x29}, +{0x3308, 0x07}, +{0x3309, 0xBA}, +{0x330A, 0x06}, +{0x330B, 0xF5}, +{0x330C, 0x01}, +{0x330D, 0x51}, +{0x330E, 0x01}, +{0x330F, 0x30}, +{0x3310, 0x07}, +{0x3311, 0x16}, +{0x3312, 0x07}, +{0x3313, 0xBA}, +{0x3326, 0x02}, +{0x32F6, 0x0F}, +{0x32F9, 0x42}, +{0x32FA, 0x24}, +{0x3325, 0x4A}, +{0x3330, 0x00}, +{0x3331, 0x0A}, +{0x3332, 0xFF}, +{0x3338, 0x30}, +{0x3339, 0x84}, +{0x333A, 0x48}, +{0x333F, 0x07}, +{0x3360, 0x10}, +{0x3361, 0x18}, +{0x3362, 0x1f}, +{0x3363, 0x37}, +{0x3364, 0x80}, +{0x3365, 0x80}, +{0x3366, 0x68}, +{0x3367, 0x60}, +{0x3368, 0x30}, +{0x3369, 0x28}, +{0x336A, 0x20}, +{0x336B, 0x10}, +{0x336C, 0x00}, +{0x336D, 0x20}, +{0x336E, 0x1C}, +{0x336F, 0x18}, +{0x3370, 0x10}, +{0x3371, 0x38}, +{0x3372, 0x3C}, +{0x3373, 0x3F}, +{0x3374, 0x3F}, +{0x338A, 0x34}, +{0x338B, 0x7F}, +{0x338C, 0x10}, +{0x338D, 0x23}, +{0x338E, 0x7F}, +{0x338F, 0x14}, +{0x3375, 0x08}, +{0x3376, 0x0C}, +{0x3377, 0x18}, +{0x3378, 0x20}, +{0x3012, 0x02}, +{0x3013, 0xD0}, +{0x3025, 0x02}, //colorbar +{REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_fmt_jpeg[][2] = { + {0x32F0, 0x70}, // YUV422 + {REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_fmt_raw[][2] = { + {0x32F0, 0x50}, // RAW + {REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_fmt_grayscale[][2] = { + {0x32F1, 0x01}, + {REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_fmt_yuv422[][2] = { + {0x32F0, 0x00}, // YUV422 + {REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_fmt_rgb565[][2] = { + {0x32F0, 0x01}, // RGB + {REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint8_t sensor_saturation_levels[9][1] = { + {0x60},//-4 + {0x68},//-3 + {0x70},//-2 + {0x78},//-1 + {0x80},//0 + {0x88},//+1 + {0x90},//+2 + {0x98},//+3 + {0xA0},//+4 +}; + +static const DRAM_ATTR uint8_t sensor_special_effects[7][4] = { + {0x00, 0x80, 0x80, 0x01},//Normal + {0x03, 0x80, 0x80, 0x01},//Negative + {0x01, 0x80, 0x80, 0x01},//Grayscale + {0x05, 0x2A, 0xF0, 0x01},//Red Tint + {0x05, 0x60, 0x20, 0x01},//Green Tint + {0x05, 0xF0, 0x80, 0x01},//Blue Tint + {0x02, 0x80, 0x80, 0x01},//Sepia + +}; + +// AE LEVEL +static const DRAM_ATTR uint16_t sensor_ae_level[][2] = { + +// 1. [AE_Target : 0x24] +// Set_Device_Format = FORMAT_16_8 +// SET_Device_Addr = 0x54 + {0x32B8, 0x29 }, + {0x32B9, 0x1F }, + {0x32BC, 0x24 }, + {0x32BD, 0x27 }, + {0x32BE, 0x21 }, +//------------------------------------------------------------------------ +// 2. [AE_Target : 0x28] +// Set_Device_Format = FORMAT_16_8 +// SET_Device_Addr = 0x54 + {0x32B8, 0x2D }, + {0x32B9, 0x23 }, + {0x32BC, 0x28 }, + {0x32BD, 0x2B }, + {0x32BE, 0x25 }, +//------------------------------------------------------------------------ +// 3. [AE_Target : 0x2C] +// Set_Device_Format = FORMAT_16_8 +// SET_Device_Addr = 0x54 + {0x32B8, 0x32 }, + {0x32B9, 0x26 }, + {0x32BC, 0x2C }, + {0x32BD, 0x2F }, + {0x32BE, 0x29 }, +//------------------------------------------------------------------------ +// 4, [AE_Target : 0x30] +// Set_Device_Format = FORMAT_16_8 +// SET_Device_Addr = 0x54 + {0x32B8, 0x36 }, + {0x32B9, 0x2A }, + {0x32BC, 0x30 }, + {0x32BD, 0x33 }, + {0x32BE, 0x2D }, +//------------------------------------------------------------------------ +// 5. [AE_Target : 0x34] +// Set_Device_Format = FORMAT_16_8 +// SET_Device_Addr = 0x54 + {0x32B8, 0x3B }, + {0x32B9, 0x2D }, + {0x32BC, 0x34 }, + {0x32BD, 0x38 }, + {0x32BE, 0x30 }, +//------------------------------------------------------------------------ +// 6. [AE_Target : 0x38] +// Set_Device_Format = FORMAT_16_8 +// SET_Device_Addr = 0x54 + {0x32B8, 0x3F }, + {0x32B9, 0x31 }, + {0x32BC, 0x38 }, + {0x32BD, 0x3C }, + {0x32BE, 0x34 }, +//------------------------------------------------------------------------ +// 7. [AE_Target : 0x3D] +// Set_Device_Format = FORMAT_16_8 +// SET_Device_Addr = 0x54 + {0x32B8, 0x44 }, + {0x32B9, 0x34 }, + {0x32BC, 0x3C }, + {0x32BD, 0x40 }, + {0x32BE, 0x38 }, +//------------------------------------------------------------------------ +// 8. [AE_Target : 0x40] +// Set_Device_Format = FORMAT_16_8 +// SET_Device_Addr = 0x54 + {0x32B8, 0x48 }, + {0x32B9, 0x38 }, + {0x32BC, 0x40 }, + {0x32BD, 0x44 }, + {0x32BE, 0x3C }, +//------------------------------------------------------------------------ +// 9. [AE_Target : 0x44] +// Set_Device_Format = FORMAT_16_8 +// SET_Device_Addr = 0x54 + {0x32B8, 0x4D }, + {0x32B9, 0x3B }, + {0x32BC, 0x44 }, + {0x32BD, 0x49 }, + {0x32BE, 0x3F }, +}; + +static const DRAM_ATTR uint16_t sensor_framesize_HD[][2] = { +//[JPEG_1280x720_8.18_8.18_Fps] +{0x3021, 0x00}, +{REG_DLY, 100}, // delay 100ms +{0x32BF, 0x60}, +{0x32C0, 0x5A}, +{0x32C1, 0x5A}, +{0x32C2, 0x5A}, +{0x32C3, 0x00}, +{0x32C4, 0x20}, +{0x32C5, 0x20}, +{0x32C6, 0x20}, +{0x32C7, 0x00}, +{0x32C8, 0x3C}, +{0x32C9, 0x5A}, +{0x32CA, 0x7A}, +{0x32CB, 0x7A}, +{0x32CC, 0x7A}, +{0x32CD, 0x7A}, +{0x32DB, 0x5E}, +{0x32F0, 0x70}, +{0x3400, 0x08}, +{0x3400, 0x00}, +{0x3401, 0x4E}, +{0x3404, 0x00}, +{0x3405, 0x00}, +{0x3410, 0x00}, +{0x3200, 0x3E}, +{0x3201, 0x0F}, +{0x3028, 0x0F}, +{0x3029, 0x00}, +{0x302A, 0x08}, +{0x3022, 0x24}, +{0x3023, 0x24}, +{0x3002, 0x00}, +{0x3003, 0x04}, +{0x3004, 0x00}, +{0x3005, 0x04}, +{0x3006, 0x05}, +{0x3007, 0x03}, +{0x3008, 0x02}, +{0x3009, 0xD3}, +{0x300A, 0x06}, +{0x300B, 0x7C}, +{0x300C, 0x02}, +{0x300D, 0xE0}, +{0x300E, 0x05}, +{0x300F, 0x00}, +{0x3010, 0x02}, +{0x3011, 0xD0}, +{0x32B8, 0x3F}, +{0x32B9, 0x31}, +{0x32BB, 0x87}, +{0x32BC, 0x38}, +{0x32BD, 0x3C}, +{0x32BE, 0x34}, +{0x3201, 0x3F}, +{0x3021, 0x06}, +{0x3025, 0x00}, //normal +{0x3400, 0x01}, +{0x3060, 0x01}, +{REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_framesize_VGA[][2] = { +//[JPEG_640x480_10.14_10.14_Fps] +{0x3021, 0x00}, +{REG_DLY, 100}, // delay 100ms +{0x32BF, 0x60}, +{0x32C0, 0x5A}, +{0x32C1, 0x5A}, +{0x32C2, 0x5A}, +{0x32C3, 0x00}, +{0x32C4, 0x20}, +{0x32C5, 0x20}, +{0x32C6, 0x20}, +{0x32C7, 0x00}, +{0x32C8, 0x4B}, +{0x32C9, 0x5A}, +{0x32CA, 0x7A}, +{0x32CB, 0x7A}, +{0x32CC, 0x7A}, +{0x32CD, 0x7A}, +{0x32DB, 0x62}, +{0x32F0, 0x70}, +{0x3400, 0x08}, +{0x3400, 0x00}, +{0x3401, 0x4E}, +{0x3404, 0x00}, +{0x3405, 0x00}, +{0x3410, 0x00}, +{0x32E0, 0x02}, +{0x32E1, 0x80}, +{0x32E2, 0x01}, +{0x32E3, 0xE0}, +{0x32E4, 0x00}, +{0x32E5, 0x80}, +{0x32E6, 0x00}, +{0x32E7, 0x80}, +{0x3200, 0x3E}, +{0x3201, 0x0F}, +{0x3028, 0x0F}, +{0x3029, 0x00}, +{0x302A, 0x08}, +{0x3022, 0x24}, +{0x3023, 0x24}, +{0x3002, 0x00}, +{0x3003, 0xA4}, +{0x3004, 0x00}, +{0x3005, 0x04}, +{0x3006, 0x04}, +{0x3007, 0x63}, +{0x3008, 0x02}, +{0x3009, 0xD3}, +{0x300A, 0x05}, +{0x300B, 0x3C}, +{0x300C, 0x02}, +{0x300D, 0xE0}, +{0x300E, 0x03}, +{0x300F, 0xC0}, +{0x3010, 0x02}, +{0x3011, 0xD0}, +{0x32B8, 0x3F}, +{0x32B9, 0x31}, +{0x32BB, 0x87}, +{0x32BC, 0x38}, +{0x32BD, 0x3C}, +{0x32BE, 0x34}, +{0x3201, 0x7F}, +{0x3021, 0x06}, +{0x3025, 0x00}, //normal +{0x3400, 0x01}, +{0x3060, 0x01}, +{REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_framesize_QVGA[][2] = { +//[JPEG_320x240_10.14_10.14_Fps] +{0x3021, 0x00}, +{REG_DLY, 100}, // delay 100ms +{0x32BF, 0x60}, +{0x32C0, 0x5A}, +{0x32C1, 0x5A}, +{0x32C2, 0x5A}, +{0x32C3, 0x00}, +{0x32C4, 0x20}, +{0x32C5, 0x20}, +{0x32C6, 0x20}, +{0x32C7, 0x00}, +{0x32C8, 0x4B}, +{0x32C9, 0x5A}, +{0x32CA, 0x7A}, +{0x32CB, 0x7A}, +{0x32CC, 0x7A}, +{0x32CD, 0x7A}, +{0x32DB, 0x62}, +{0x32F0, 0x70}, +{0x3400, 0x08}, +{0x3400, 0x00}, +{0x3401, 0x4E}, +{0x3404, 0x00}, +{0x3405, 0x00}, +{0x3410, 0x00}, +{0x32E0, 0x01}, +{0x32E1, 0x40}, +{0x32E2, 0x00}, +{0x32E3, 0xF0}, +{0x32E4, 0x02}, +{0x32E5, 0x02}, +{0x32E6, 0x02}, +{0x32E7, 0x03}, +{0x3200, 0x3E}, +{0x3201, 0x0F}, +{0x3028, 0x0F}, +{0x3029, 0x00}, +{0x302A, 0x08}, +{0x3022, 0x24}, +{0x3023, 0x24}, +{0x3002, 0x00}, +{0x3003, 0xA4}, +{0x3004, 0x00}, +{0x3005, 0x04}, +{0x3006, 0x04}, +{0x3007, 0x63}, +{0x3008, 0x02}, +{0x3009, 0xD3}, +{0x300A, 0x05}, +{0x300B, 0x3C}, +{0x300C, 0x02}, +{0x300D, 0xE0}, +{0x300E, 0x03}, +{0x300F, 0xC0}, +{0x3010, 0x02}, +{0x3011, 0xD0}, +{0x32B8, 0x3F}, +{0x32B9, 0x31}, +{0x32BB, 0x87}, +{0x32BC, 0x38}, +{0x32BD, 0x3C}, +{0x32BE, 0x34}, +{0x3201, 0x7F}, +{0x3021, 0x06}, +{0x3025, 0x00}, //normal +{0x3400, 0x01}, +{0x3060, 0x01}, +{REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_framesize_VGA_xyskip[][2] = { +// [JPEG_640x360_20.00_25.01_Fps_XY_Skip] +// Set_Device_Format = FORMAT_16_8 +// SET_Device_Addr = 0x54 +{0x3021, 0x00}, +{REG_DLY, 100}, // delay 100ms +{0x32BF, 0x60 }, +{0x320A, 0xB2 }, +{0x32C0, 0x64 }, +{0x32C1, 0x64 }, +{0x32C2, 0x64 }, +{0x32C3, 0x00 }, +{0x32C4, 0x20 }, +{0x32C5, 0x20 }, +{0x32C6, 0x20 }, +{0x32C7, 0x00 }, +{0x32C8, 0x62 }, +{0x32C9, 0x64 }, +{0x32CA, 0x84 }, +{0x32CB, 0x84 }, +{0x32CC, 0x84 }, +{0x32CD, 0x84 }, +{0x32DB, 0x68 }, +{0x32F0, 0x70 }, +{0x3400, 0x08 }, +{0x3400, 0x00 }, +{0x3401, 0x4E }, +{0x3404, 0x00 }, +{0x3405, 0x00 }, +{0x3410, 0x00 }, +{0x3200, 0x3E }, +{0x3201, 0x0F }, +{0x3028, 0x0F }, +{0x3029, 0x00 }, +{0x302A, 0x08 }, +{0x3022, 0x24 }, +{0x3023, 0x6C }, +{0x3002, 0x00 }, +{0x3003, 0x04 }, +{0x3004, 0x00 }, +{0x3005, 0x04 }, +{0x3006, 0x05 }, +{0x3007, 0x03 }, +{0x3008, 0x02 }, +{0x3009, 0xD3 }, +{0x300A, 0x03 }, +{0x300B, 0xFC }, +{0x300C, 0x01 }, +{0x300D, 0x88 }, +{0x300E, 0x02 }, +{0x300F, 0x80 }, +{0x3010, 0x01 }, +{0x3011, 0x68 }, +{0x32B8, 0x3F }, +{0x32B9, 0x31 }, +{0x32BB, 0x87 }, +{0x32BC, 0x38 }, +{0x32BD, 0x3C }, +{0x32BE, 0x34 }, +{0x3201, 0x3F }, +{0x3025, 0x00 }, //normal +{0x3021, 0x06 }, +{0x3400, 0x01 }, +{0x3060, 0x01 }, +{REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_framesize_VGA_xskip[][2] = { +//[JPEG_640x480_Xskip_13.32_13.32_Fps] +{0x3021, 0x00}, +{REG_DLY, 100}, // delay 100ms +{0x32BF, 0x60}, +{0x32C0, 0x5A}, +{0x32C1, 0x5A}, +{0x32C2, 0x5A}, +{0x32C3, 0x00}, +{0x32C4, 0x20}, +{0x32C5, 0x20}, +{0x32C6, 0x20}, +{0x32C7, 0x00}, +{0x32C8, 0x62}, +{0x32C9, 0x5A}, +{0x32CA, 0x7A}, +{0x32CB, 0x7A}, +{0x32CC, 0x7A}, +{0x32CD, 0x7A}, +{0x32DB, 0x68}, +{0x32F0, 0x70}, +{0x3400, 0x08}, +{0x3400, 0x00}, +{0x3401, 0x4E}, +{0x3404, 0x00}, +{0x3405, 0x00}, +{0x3410, 0x00}, +{0x32E0, 0x02}, +{0x32E1, 0x80}, +{0x32E2, 0x01}, +{0x32E3, 0xE0}, +{0x32E4, 0x00}, +{0x32E5, 0x00}, +{0x32E6, 0x00}, +{0x32E7, 0x80}, +{0x3200, 0x3E}, +{0x3201, 0x0F}, +{0x3028, 0x0F}, +{0x3029, 0x00}, +{0x302A, 0x08}, +{0x3022, 0x24}, +{0x3023, 0x2C}, +{0x3002, 0x00}, +{0x3003, 0x04}, +{0x3004, 0x00}, +{0x3005, 0x04}, +{0x3006, 0x05}, +{0x3007, 0x03}, +{0x3008, 0x02}, +{0x3009, 0xD3}, +{0x300A, 0x03}, +{0x300B, 0xFC}, +{0x300C, 0x02}, +{0x300D, 0xE0}, +{0x300E, 0x02}, +{0x300F, 0x80}, +{0x3010, 0x02}, +{0x3011, 0xD0}, +{0x32B8, 0x3F}, +{0x32B9, 0x31}, +{0x32BB, 0x87}, +{0x32BC, 0x38}, +{0x32BD, 0x3C}, +{0x32BE, 0x34}, +{0x3201, 0x7F}, +{0x3021, 0x06}, +{0x3025, 0x00}, //normal +{0x3400, 0x01}, +{0x3060, 0x01}, +{REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_framesize_QVGA_xskip[][2] = { +{0x3021, 0x00}, +{REG_DLY, 100}, // delay 100ms +//[JPEG_320x240_Xskip_13.32_13.32_Fps] +{0x32BF, 0x60}, +{0x32C0, 0x5A}, +{0x32C1, 0x5A}, +{0x32C2, 0x5A}, +{0x32C3, 0x00}, +{0x32C4, 0x20}, +{0x32C5, 0x20}, +{0x32C6, 0x20}, +{0x32C7, 0x00}, +{0x32C8, 0x62}, +{0x32C9, 0x5A}, +{0x32CA, 0x7A}, +{0x32CB, 0x7A}, +{0x32CC, 0x7A}, +{0x32CD, 0x7A}, +{0x32DB, 0x68}, +{0x32F0, 0x70}, +{0x3400, 0x08}, +{0x3400, 0x00}, +{0x3401, 0x4E}, +{0x3404, 0x00}, +{0x3405, 0x00}, +{0x3410, 0x00}, +{0x32E0, 0x01}, +{0x32E1, 0x40}, +{0x32E2, 0x00}, +{0x32E3, 0xF0}, +{0x32E4, 0x01}, +{0x32E5, 0x01}, +{0x32E6, 0x02}, +{0x32E7, 0x03}, +{0x3200, 0x3E}, +{0x3201, 0x0F}, +{0x3028, 0x0F}, +{0x3029, 0x00}, +{0x302A, 0x08}, +{0x3022, 0x24}, +{0x3023, 0x2C}, +{0x3002, 0x00}, +{0x3003, 0x04}, +{0x3004, 0x00}, +{0x3005, 0x04}, +{0x3006, 0x05}, +{0x3007, 0x03}, +{0x3008, 0x02}, +{0x3009, 0xD3}, +{0x300A, 0x03}, +{0x300B, 0xFC}, +{0x300C, 0x02}, +{0x300D, 0xE0}, +{0x300E, 0x02}, +{0x300F, 0x80}, +{0x3010, 0x02}, +{0x3011, 0xD0}, +{0x32B8, 0x3F}, +{0x32B9, 0x31}, +{0x32BB, 0x87}, +{0x32BC, 0x38}, +{0x32BD, 0x3C}, +{0x32BE, 0x34}, +{0x3201, 0x7F}, +{0x3021, 0x06}, +{0x3025, 0x00}, //normal +{0x3400, 0x01}, +{0x3060, 0x01}, +{REGLIST_TAIL, 0x00}, // tail +}; + + +static const DRAM_ATTR uint16_t sensor_framesize_VGA_crop[][2] = { +//[JPEG_640x480_Crop_19.77_19.77_Fps] +{0x3021, 0x00}, +{REG_DLY, 100}, // delay 100ms +{0x32BF, 0x60}, +{0x32C0, 0x5A}, +{0x32C1, 0x5A}, +{0x32C2, 0x5A}, +{0x32C3, 0x00}, +{0x32C4, 0x20}, +{0x32C5, 0x20}, +{0x32C6, 0x20}, +{0x32C7, 0x00}, +{0x32C8, 0x62}, +{0x32C9, 0x5A}, +{0x32CA, 0x7A}, +{0x32CB, 0x7A}, +{0x32CC, 0x7A}, +{0x32CD, 0x7A}, +{0x32DB, 0x68}, +{0x32F0, 0x70}, +{0x3400, 0x08}, +{0x3400, 0x00}, +{0x3401, 0x4E}, +{0x3404, 0x00}, +{0x3405, 0x00}, +{0x3410, 0x00}, +{0x3200, 0x3E}, +{0x3201, 0x0F}, +{0x3028, 0x0F}, +{0x3029, 0x00}, +{0x302A, 0x08}, +{0x3022, 0x24}, +{0x3023, 0x24}, +{0x3002, 0x01}, +{0x3003, 0x44}, +{0x3004, 0x00}, +{0x3005, 0x7C}, +{0x3006, 0x03}, +{0x3007, 0xC3}, +{0x3008, 0x02}, +{0x3009, 0x5B}, +{0x300A, 0x03}, +{0x300B, 0xFC}, +{0x300C, 0x01}, +{0x300D, 0xF0}, +{0x300E, 0x02}, +{0x300F, 0x80}, +{0x3010, 0x01}, +{0x3011, 0xE0}, +{0x32B8, 0x3F}, +{0x32B9, 0x31}, +{0x32BB, 0x87}, +{0x32BC, 0x38}, +{0x32BD, 0x3C}, +{0x32BE, 0x34}, +{0x3201, 0x3F}, +{0x3021, 0x06}, +{0x3025, 0x00}, //normal +{0x3400, 0x01}, +{0x3060, 0x01}, +{REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_framesize_QVGA_crop[][2] = { +//[JPEG_320x240_Crop_19.77_19.77_Fps] +{0x3021, 0x00}, +{REG_DLY, 100}, // delay 100ms +{0x32BF, 0x60}, +{0x32C0, 0x5A}, +{0x32C1, 0x5A}, +{0x32C2, 0x5A}, +{0x32C3, 0x00}, +{0x32C4, 0x20}, +{0x32C5, 0x20}, +{0x32C6, 0x20}, +{0x32C7, 0x00}, +{0x32C8, 0x62}, +{0x32C9, 0x5A}, +{0x32CA, 0x7A}, +{0x32CB, 0x7A}, +{0x32CC, 0x7A}, +{0x32CD, 0x7A}, +{0x32DB, 0x68}, +{0x32F0, 0x70}, +{0x3400, 0x08}, +{0x3400, 0x00}, +{0x3401, 0x4E}, +{0x3404, 0x00}, +{0x3405, 0x00}, +{0x3410, 0x00}, +{0x32E0, 0x01}, +{0x32E1, 0x40}, +{0x32E2, 0x00}, +{0x32E3, 0xF0}, +{0x32E4, 0x01}, +{0x32E5, 0x01}, +{0x32E6, 0x01}, +{0x32E7, 0x02}, +{0x3200, 0x3E}, +{0x3201, 0x0F}, +{0x3028, 0x0F}, +{0x3029, 0x00}, +{0x302A, 0x08}, +{0x3022, 0x24}, +{0x3023, 0x24}, +{0x3002, 0x01}, +{0x3003, 0x44}, +{0x3004, 0x00}, +{0x3005, 0x7C}, +{0x3006, 0x03}, +{0x3007, 0xC3}, +{0x3008, 0x02}, +{0x3009, 0x5B}, +{0x300A, 0x03}, +{0x300B, 0xFC}, +{0x300C, 0x01}, +{0x300D, 0xF0}, +{0x300E, 0x02}, +{0x300F, 0x80}, +{0x3010, 0x01}, +{0x3011, 0xE0}, +{0x32B8, 0x3F}, +{0x32B9, 0x31}, +{0x32BB, 0x87}, +{0x32BC, 0x38}, +{0x32BD, 0x3C}, +{0x32BE, 0x34}, +{0x3201, 0x7F}, +{0x3021, 0x06}, +{0x3025, 0x00}, //normal +{0x3400, 0x01}, +{0x3060, 0x01}, +{REGLIST_TAIL, 0x00}, // tail +}; + +#endif + + diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/ov2640.h b/lib/libesp32_div/esp32-camera/sensors/private_include/ov2640.h new file mode 100644 index 000000000..342ab2132 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/ov2640.h @@ -0,0 +1,32 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * OV2640 driver. + * + */ +#ifndef __OV2640_H__ +#define __OV2640_H__ +#include "sensor.h" +/** + * @brief Detect sensor pid + * + * @param slv_addr SCCB address + * @param id Detection result + * @return + * 0: Can't detect this sensor + * Nonzero: This sensor has been detected + */ +int ov2640_detect(int slv_addr, sensor_id_t *id); + +/** + * @brief initialize sensor function pointers + * + * @param sensor pointer of sensor + * @return + * Always 0 + */ +int ov2640_init(sensor_t *sensor); + +#endif // __OV2640_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/ov2640_regs.h b/lib/libesp32_div/esp32-camera/sensors/private_include/ov2640_regs.h new file mode 100644 index 000000000..8f47333fa --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/ov2640_regs.h @@ -0,0 +1,216 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * OV2640 register definitions. + */ +#ifndef __REG_REGS_H__ +#define __REG_REGS_H__ +/* DSP register bank FF=0x00*/ +#define R_BYPASS 0x05 +#define QS 0x44 +#define CTRLI 0x50 +#define HSIZE 0x51 +#define VSIZE 0x52 +#define XOFFL 0x53 +#define YOFFL 0x54 +#define VHYX 0x55 +#define DPRP 0x56 +#define TEST 0x57 +#define ZMOW 0x5A +#define ZMOH 0x5B +#define ZMHH 0x5C +#define BPADDR 0x7C +#define BPDATA 0x7D +#define CTRL2 0x86 +#define CTRL3 0x87 +#define SIZEL 0x8C +#define HSIZE8 0xC0 +#define VSIZE8 0xC1 +#define CTRL0 0xC2 +#define CTRL1 0xC3 +#define R_DVP_SP 0xD3 +#define IMAGE_MODE 0xDA +#define RESET 0xE0 +#define MS_SP 0xF0 +#define SS_ID 0xF7 +#define SS_CTRL 0xF7 +#define MC_BIST 0xF9 +#define MC_AL 0xFA +#define MC_AH 0xFB +#define MC_D 0xFC +#define P_CMD 0xFD +#define P_STATUS 0xFE +#define BANK_SEL 0xFF + +#define CTRLI_LP_DP 0x80 +#define CTRLI_ROUND 0x40 + +#define CTRL0_AEC_EN 0x80 +#define CTRL0_AEC_SEL 0x40 +#define CTRL0_STAT_SEL 0x20 +#define CTRL0_VFIRST 0x10 +#define CTRL0_YUV422 0x08 +#define CTRL0_YUV_EN 0x04 +#define CTRL0_RGB_EN 0x02 +#define CTRL0_RAW_EN 0x01 + +#define CTRL2_DCW_EN 0x20 +#define CTRL2_SDE_EN 0x10 +#define CTRL2_UV_ADJ_EN 0x08 +#define CTRL2_UV_AVG_EN 0x04 +#define CTRL2_CMX_EN 0x01 + +#define CTRL3_BPC_EN 0x80 +#define CTRL3_WPC_EN 0x40 + +#define R_DVP_SP_AUTO_MODE 0x80 + +#define R_BYPASS_DSP_EN 0x00 +#define R_BYPASS_DSP_BYPAS 0x01 + +#define IMAGE_MODE_Y8_DVP_EN 0x40 +#define IMAGE_MODE_JPEG_EN 0x10 +#define IMAGE_MODE_YUV422 0x00 +#define IMAGE_MODE_RAW10 0x04 +#define IMAGE_MODE_RGB565 0x08 +#define IMAGE_MODE_HREF_VSYNC 0x02 +#define IMAGE_MODE_LBYTE_FIRST 0x01 + +#define RESET_MICROC 0x40 +#define RESET_SCCB 0x20 +#define RESET_JPEG 0x10 +#define RESET_DVP 0x04 +#define RESET_IPU 0x02 +#define RESET_CIF 0x01 + +#define MC_BIST_RESET 0x80 +#define MC_BIST_BOOT_ROM_SEL 0x40 +#define MC_BIST_12KB_SEL 0x20 +#define MC_BIST_12KB_MASK 0x30 +#define MC_BIST_512KB_SEL 0x08 +#define MC_BIST_512KB_MASK 0x0C +#define MC_BIST_BUSY_BIT_R 0x02 +#define MC_BIST_MC_RES_ONE_SH_W 0x02 +#define MC_BIST_LAUNCH 0x01 + + +typedef enum { + BANK_DSP, BANK_SENSOR, BANK_MAX +} ov2640_bank_t; + +/* Sensor register bank FF=0x01*/ +#define GAIN 0x00 +#define COM1 0x03 +#define REG04 0x04 +#define REG08 0x08 +#define COM2 0x09 +#define REG_PID 0x0A +#define REG_VER 0x0B +#define COM3 0x0C +#define COM4 0x0D +#define AEC 0x10 +#define CLKRC 0x11 +#define COM7 0x12 +#define COM8 0x13 +#define COM9 0x14 /* AGC gain ceiling */ +#define COM10 0x15 +#define HSTART 0x17 +#define HSTOP 0x18 +#define VSTART 0x19 +#define VSTOP 0x1A +#define REG_MIDH 0x1C +#define REG_MIDL 0x1D +#define AEW 0x24 +#define AEB 0x25 +#define VV 0x26 +#define REG2A 0x2A +#define FRARL 0x2B +#define ADDVSL 0x2D +#define ADDVSH 0x2E +#define YAVG 0x2F +#define HSDY 0x30 +#define HEDY 0x31 +#define REG32 0x32 +#define ARCOM2 0x34 +#define REG45 0x45 +#define FLL 0x46 +#define FLH 0x47 +#define COM19 0x48 +#define ZOOMS 0x49 +#define COM22 0x4B +#define COM25 0x4E +#define BD50 0x4F +#define BD60 0x50 +#define REG5D 0x5D +#define REG5E 0x5E +#define REG5F 0x5F +#define REG60 0x60 +#define HISTO_LOW 0x61 +#define HISTO_HIGH 0x62 + +#define REG04_DEFAULT 0x28 +#define REG04_HFLIP_IMG 0x80 +#define REG04_VFLIP_IMG 0x40 +#define REG04_VREF_EN 0x10 +#define REG04_HREF_EN 0x08 +#define REG04_SET(x) (REG04_DEFAULT|x) + +#define COM2_STDBY 0x10 +#define COM2_OUT_DRIVE_1x 0x00 +#define COM2_OUT_DRIVE_2x 0x01 +#define COM2_OUT_DRIVE_3x 0x02 +#define COM2_OUT_DRIVE_4x 0x03 + +#define COM3_DEFAULT 0x38 +#define COM3_BAND_50Hz 0x04 +#define COM3_BAND_60Hz 0x00 +#define COM3_BAND_AUTO 0x02 +#define COM3_BAND_SET(x) (COM3_DEFAULT|x) + +#define COM7_SRST 0x80 +#define COM7_RES_UXGA 0x00 /* UXGA */ +#define COM7_RES_SVGA 0x40 /* SVGA */ +#define COM7_RES_CIF 0x20 /* CIF */ +#define COM7_ZOOM_EN 0x04 /* Enable Zoom */ +#define COM7_COLOR_BAR 0x02 /* Enable Color Bar Test */ + +#define COM8_DEFAULT 0xC0 +#define COM8_BNDF_EN 0x20 /* Enable Banding filter */ +#define COM8_AGC_EN 0x04 /* AGC Auto/Manual control selection */ +#define COM8_AEC_EN 0x01 /* Auto/Manual Exposure control */ +#define COM8_SET(x) (COM8_DEFAULT|x) + +#define COM9_DEFAULT 0x08 +#define COM9_AGC_GAIN_2x 0x00 /* AGC: 2x */ +#define COM9_AGC_GAIN_4x 0x01 /* AGC: 4x */ +#define COM9_AGC_GAIN_8x 0x02 /* AGC: 8x */ +#define COM9_AGC_GAIN_16x 0x03 /* AGC: 16x */ +#define COM9_AGC_GAIN_32x 0x04 /* AGC: 32x */ +#define COM9_AGC_GAIN_64x 0x05 /* AGC: 64x */ +#define COM9_AGC_GAIN_128x 0x06 /* AGC: 128x */ +#define COM9_AGC_SET(x) (COM9_DEFAULT|(x<<5)) + +#define COM10_HREF_EN 0x80 /* HSYNC changes to HREF */ +#define COM10_HSYNC_EN 0x40 /* HREF changes to HSYNC */ +#define COM10_PCLK_FREE 0x20 /* PCLK output option: free running PCLK */ +#define COM10_PCLK_EDGE 0x10 /* Data is updated at the rising edge of PCLK */ +#define COM10_HREF_NEG 0x08 /* HREF negative */ +#define COM10_VSYNC_NEG 0x02 /* VSYNC negative */ +#define COM10_HSYNC_NEG 0x01 /* HSYNC negative */ + +#define CTRL1_AWB 0x08 /* Enable AWB */ + +#define VV_AGC_TH_SET(h,l) ((h<<4)|(l&0x0F)) + +#define REG32_UXGA 0x36 +#define REG32_SVGA 0x09 +#define REG32_CIF 0x89 + +#define CLKRC_2X 0x80 +#define CLKRC_2X_UXGA (0x01 | CLKRC_2X) +#define CLKRC_2X_SVGA CLKRC_2X +#define CLKRC_2X_CIF CLKRC_2X + +#endif //__REG_REGS_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/ov2640_settings.h b/lib/libesp32_div/esp32-camera/sensors/private_include/ov2640_settings.h new file mode 100644 index 000000000..f151f0a42 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/ov2640_settings.h @@ -0,0 +1,485 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef _OV2640_SETTINGS_H_ +#define _OV2640_SETTINGS_H_ + +#include +#include +#include "esp_attr.h" +#include "ov2640_regs.h" + +typedef enum { + OV2640_MODE_UXGA, OV2640_MODE_SVGA, OV2640_MODE_CIF, OV2640_MODE_MAX +} ov2640_sensor_mode_t; + +typedef struct { + union { + struct { + uint8_t pclk_div:7; + uint8_t pclk_auto:1; + }; + uint8_t pclk; + }; + union { + struct { + uint8_t clk_div:6; + uint8_t reserved:1; + uint8_t clk_2x:1; + }; + uint8_t clk; + }; +} ov2640_clk_t; + +typedef struct { + uint16_t offset_x; + uint16_t offset_y; + uint16_t max_x; + uint16_t max_y; +} ov2640_ratio_settings_t; + +static const DRAM_ATTR ov2640_ratio_settings_t ratio_table[] = { + // ox, oy, mx, my + { 0, 0, 1600, 1200 }, //4x3 + { 8, 72, 1584, 1056 }, //3x2 + { 0, 100, 1600, 1000 }, //16x10 + { 0, 120, 1600, 960 }, //5x3 + { 0, 150, 1600, 900 }, //16x9 + { 2, 258, 1596, 684 }, //21x9 + { 50, 0, 1500, 1200 }, //5x4 + { 200, 0, 1200, 1200 }, //1x1 + { 462, 0, 676, 1200 } //9x16 +}; + +// 30fps@24MHz +const DRAM_ATTR uint8_t ov2640_settings_cif[][2] = { + {BANK_SEL, BANK_DSP}, + {0x2c, 0xff}, + {0x2e, 0xdf}, + {BANK_SEL, BANK_SENSOR}, + {0x3c, 0x32}, + {CLKRC, 0x01}, + {COM2, COM2_OUT_DRIVE_3x}, + {REG04, REG04_DEFAULT}, + {COM8, COM8_DEFAULT | COM8_BNDF_EN | COM8_AGC_EN | COM8_AEC_EN}, + {COM9, COM9_AGC_SET(COM9_AGC_GAIN_8x)}, + {0x2c, 0x0c}, + {0x33, 0x78}, + {0x3a, 0x33}, + {0x3b, 0xfB}, + {0x3e, 0x00}, + {0x43, 0x11}, + {0x16, 0x10}, + {0x39, 0x92}, + {0x35, 0xda}, + {0x22, 0x1a}, + {0x37, 0xc3}, + {0x23, 0x00}, + {ARCOM2, 0xc0}, + {0x06, 0x88}, + {0x07, 0xc0}, + {COM4, 0x87}, + {0x0e, 0x41}, + {0x4c, 0x00}, + {0x4a, 0x81}, + {0x21, 0x99}, + {AEW, 0x40}, + {AEB, 0x38}, + {VV, VV_AGC_TH_SET(8,2)}, + {0x5c, 0x00}, + {0x63, 0x00}, + {HISTO_LOW, 0x70}, + {HISTO_HIGH, 0x80}, + {0x7c, 0x05}, + {0x20, 0x80}, + {0x28, 0x30}, + {0x6c, 0x00}, + {0x6d, 0x80}, + {0x6e, 0x00}, + {0x70, 0x02}, + {0x71, 0x94}, + {0x73, 0xc1}, + {0x3d, 0x34}, + {0x5a, 0x57}, + {BD50, 0xbb}, + {BD60, 0x9c}, + {COM7, COM7_RES_CIF}, + {HSTART, 0x11}, + {HSTOP, 0x43}, + {VSTART, 0x00}, + {VSTOP, 0x25}, + {REG32, 0x89}, + {0x37, 0xc0}, + {BD50, 0xca}, + {BD60, 0xa8}, + {0x6d, 0x00}, + {0x3d, 0x38}, + {BANK_SEL, BANK_DSP}, + {0xe5, 0x7f}, + {MC_BIST, MC_BIST_RESET | MC_BIST_BOOT_ROM_SEL}, + {0x41, 0x24}, + {RESET, RESET_JPEG | RESET_DVP}, + {0x76, 0xff}, + {0x33, 0xa0}, + {0x42, 0x20}, + {0x43, 0x18}, + {0x4c, 0x00}, + {CTRL3, CTRL3_WPC_EN | 0x10 }, + {0x88, 0x3f}, + {0xd7, 0x03}, + {0xd9, 0x10}, + {R_DVP_SP, R_DVP_SP_AUTO_MODE | 0x02}, + {0xc8, 0x08}, + {0xc9, 0x80}, + {BPADDR, 0x00}, + {BPDATA, 0x00}, + {BPADDR, 0x03}, + {BPDATA, 0x48}, + {BPDATA, 0x48}, + {BPADDR, 0x08}, + {BPDATA, 0x20}, + {BPDATA, 0x10}, + {BPDATA, 0x0e}, + {0x90, 0x00}, + {0x91, 0x0e}, + {0x91, 0x1a}, + {0x91, 0x31}, + {0x91, 0x5a}, + {0x91, 0x69}, + {0x91, 0x75}, + {0x91, 0x7e}, + {0x91, 0x88}, + {0x91, 0x8f}, + {0x91, 0x96}, + {0x91, 0xa3}, + {0x91, 0xaf}, + {0x91, 0xc4}, + {0x91, 0xd7}, + {0x91, 0xe8}, + {0x91, 0x20}, + {0x92, 0x00}, + {0x93, 0x06}, + {0x93, 0xe3}, + {0x93, 0x05}, + {0x93, 0x05}, + {0x93, 0x00}, + {0x93, 0x04}, + {0x93, 0x00}, + {0x93, 0x00}, + {0x93, 0x00}, + {0x93, 0x00}, + {0x93, 0x00}, + {0x93, 0x00}, + {0x93, 0x00}, + {0x96, 0x00}, + {0x97, 0x08}, + {0x97, 0x19}, + {0x97, 0x02}, + {0x97, 0x0c}, + {0x97, 0x24}, + {0x97, 0x30}, + {0x97, 0x28}, + {0x97, 0x26}, + {0x97, 0x02}, + {0x97, 0x98}, + {0x97, 0x80}, + {0x97, 0x00}, + {0x97, 0x00}, + {0xa4, 0x00}, + {0xa8, 0x00}, + {0xc5, 0x11}, + {0xc6, 0x51}, + {0xbf, 0x80}, + {0xc7, 0x10}, + {0xb6, 0x66}, + {0xb8, 0xA5}, + {0xb7, 0x64}, + {0xb9, 0x7C}, + {0xb3, 0xaf}, + {0xb4, 0x97}, + {0xb5, 0xFF}, + {0xb0, 0xC5}, + {0xb1, 0x94}, + {0xb2, 0x0f}, + {0xc4, 0x5c}, + {CTRL1, 0xfd}, + {0x7f, 0x00}, + {0xe5, 0x1f}, + {0xe1, 0x67}, + {0xdd, 0x7f}, + {IMAGE_MODE, 0x00}, + {RESET, 0x00}, + {R_BYPASS, R_BYPASS_DSP_EN}, + {0, 0} +}; + +const DRAM_ATTR uint8_t ov2640_settings_to_cif[][2] = { + {BANK_SEL, BANK_SENSOR}, + {COM7, COM7_RES_CIF}, + + //Set the sensor output window + {COM1, 0x0A}, + {REG32, REG32_CIF}, + {HSTART, 0x11}, + {HSTOP, 0x43}, + {VSTART, 0x00}, + {VSTOP, 0x25}, + + //{CLKRC, 0x00}, + {BD50, 0xca}, + {BD60, 0xa8}, + {0x5a, 0x23}, + {0x6d, 0x00}, + {0x3d, 0x38}, + {0x39, 0x92}, + {0x35, 0xda}, + {0x22, 0x1a}, + {0x37, 0xc3}, + {0x23, 0x00}, + {ARCOM2, 0xc0}, + {0x06, 0x88}, + {0x07, 0xc0}, + {COM4, 0x87}, + {0x0e, 0x41}, + {0x4c, 0x00}, + {BANK_SEL, BANK_DSP}, + {RESET, RESET_DVP}, + + //Set the sensor resolution (UXGA, SVGA, CIF) + {HSIZE8, 0x32}, + {VSIZE8, 0x25}, + {SIZEL, 0x00}, + + //Set the image window size >= output size + {HSIZE, 0x64}, + {VSIZE, 0x4a}, + {XOFFL, 0x00}, + {YOFFL, 0x00}, + {VHYX, 0x00}, + {TEST, 0x00}, + + {CTRL2, CTRL2_DCW_EN | 0x1D}, + {CTRLI, CTRLI_LP_DP | 0x00}, + //{R_DVP_SP, 0x08}, + {0, 0} +}; + +const DRAM_ATTR uint8_t ov2640_settings_to_svga[][2] = { + {BANK_SEL, BANK_SENSOR}, + {COM7, COM7_RES_SVGA}, + + //Set the sensor output window + {COM1, 0x0A}, + {REG32, REG32_SVGA}, + {HSTART, 0x11}, + {HSTOP, 0x43}, + {VSTART, 0x00}, + {VSTOP, 0x4b}, + + //{CLKRC, 0x00}, + {0x37, 0xc0}, + {BD50, 0xca}, + {BD60, 0xa8}, + {0x5a, 0x23}, + {0x6d, 0x00}, + {0x3d, 0x38}, + {0x39, 0x92}, + {0x35, 0xda}, + {0x22, 0x1a}, + {0x37, 0xc3}, + {0x23, 0x00}, + {ARCOM2, 0xc0}, + {0x06, 0x88}, + {0x07, 0xc0}, + {COM4, 0x87}, + {0x0e, 0x41}, + {0x42, 0x03}, + {0x4c, 0x00}, + {BANK_SEL, BANK_DSP}, + {RESET, RESET_DVP}, + + //Set the sensor resolution (UXGA, SVGA, CIF) + {HSIZE8, 0x64}, + {VSIZE8, 0x4B}, + {SIZEL, 0x00}, + + //Set the image window size >= output size + {HSIZE, 0xC8}, + {VSIZE, 0x96}, + {XOFFL, 0x00}, + {YOFFL, 0x00}, + {VHYX, 0x00}, + {TEST, 0x00}, + + {CTRL2, CTRL2_DCW_EN | 0x1D}, + {CTRLI, CTRLI_LP_DP | 0x00}, + //{R_DVP_SP, 0x08}, + {0, 0} +}; + +const DRAM_ATTR uint8_t ov2640_settings_to_uxga[][2] = { + {BANK_SEL, BANK_SENSOR}, + {COM7, COM7_RES_UXGA}, + + //Set the sensor output window + {COM1, 0x0F}, + {REG32, REG32_UXGA}, + {HSTART, 0x11}, + {HSTOP, 0x75}, + {VSTART, 0x01}, + {VSTOP, 0x97}, + + //{CLKRC, 0x00}, + {0x3d, 0x34}, + {BD50, 0xbb}, + {BD60, 0x9c}, + {0x5a, 0x57}, + {0x6d, 0x80}, + {0x39, 0x82}, + {0x23, 0x00}, + {0x07, 0xc0}, + {0x4c, 0x00}, + {0x35, 0x88}, + {0x22, 0x0a}, + {0x37, 0x40}, + {ARCOM2, 0xa0}, + {0x06, 0x02}, + {COM4, 0xb7}, + {0x0e, 0x01}, + {0x42, 0x83}, + {BANK_SEL, BANK_DSP}, + {RESET, RESET_DVP}, + + //Set the sensor resolution (UXGA, SVGA, CIF) + {HSIZE8, 0xc8}, + {VSIZE8, 0x96}, + {SIZEL, 0x00}, + + //Set the image window size >= output size + {HSIZE, 0x90}, + {VSIZE, 0x2c}, + {XOFFL, 0x00}, + {YOFFL, 0x00}, + {VHYX, 0x88}, + {TEST, 0x00}, + + {CTRL2, CTRL2_DCW_EN | 0x1d}, + {CTRLI, 0x00}, + //{R_DVP_SP, 0x06}, + {0, 0} +}; + +const DRAM_ATTR uint8_t ov2640_settings_jpeg3[][2] = { + {BANK_SEL, BANK_DSP}, + {RESET, RESET_JPEG | RESET_DVP}, + {IMAGE_MODE, IMAGE_MODE_JPEG_EN | IMAGE_MODE_HREF_VSYNC}, + {0xD7, 0x03}, + {0xE1, 0x77}, + {0xE5, 0x1F}, + {0xD9, 0x10}, + {0xDF, 0x80}, + {0x33, 0x80}, + {0x3C, 0x10}, + {0xEB, 0x30}, + {0xDD, 0x7F}, + {RESET, 0x00}, + {0, 0} +}; + +static const uint8_t ov2640_settings_yuv422[][2] = { + {BANK_SEL, BANK_DSP}, + {RESET, RESET_DVP}, + {IMAGE_MODE, IMAGE_MODE_YUV422}, + {0xD7, 0x01}, + {0xE1, 0x67}, + {RESET, 0x00}, + {0, 0}, +}; + +static const uint8_t ov2640_settings_rgb565[][2] = { + {BANK_SEL, BANK_DSP}, + {RESET, RESET_DVP}, + {IMAGE_MODE, IMAGE_MODE_RGB565}, + {0xD7, 0x03}, + {0xE1, 0x77}, + {RESET, 0x00}, + {0, 0}, +}; + +#define NUM_BRIGHTNESS_LEVELS (5) +static const uint8_t brightness_regs[NUM_BRIGHTNESS_LEVELS + 1][5] = { + {BPADDR, BPDATA, BPADDR, BPDATA, BPDATA }, + {0x00, 0x04, 0x09, 0x00, 0x00 }, /* -2 */ + {0x00, 0x04, 0x09, 0x10, 0x00 }, /* -1 */ + {0x00, 0x04, 0x09, 0x20, 0x00 }, /* 0 */ + {0x00, 0x04, 0x09, 0x30, 0x00 }, /* +1 */ + {0x00, 0x04, 0x09, 0x40, 0x00 }, /* +2 */ +}; + +#define NUM_CONTRAST_LEVELS (5) +static const uint8_t contrast_regs[NUM_CONTRAST_LEVELS + 1][7] = { + {BPADDR, BPDATA, BPADDR, BPDATA, BPDATA, BPDATA, BPDATA }, + {0x00, 0x04, 0x07, 0x20, 0x18, 0x34, 0x06 }, /* -2 */ + {0x00, 0x04, 0x07, 0x20, 0x1c, 0x2a, 0x06 }, /* -1 */ + {0x00, 0x04, 0x07, 0x20, 0x20, 0x20, 0x06 }, /* 0 */ + {0x00, 0x04, 0x07, 0x20, 0x24, 0x16, 0x06 }, /* +1 */ + {0x00, 0x04, 0x07, 0x20, 0x28, 0x0c, 0x06 }, /* +2 */ +}; + +#define NUM_SATURATION_LEVELS (5) +static const uint8_t saturation_regs[NUM_SATURATION_LEVELS + 1][5] = { + {BPADDR, BPDATA, BPADDR, BPDATA, BPDATA }, + {0x00, 0x02, 0x03, 0x28, 0x28 }, /* -2 */ + {0x00, 0x02, 0x03, 0x38, 0x38 }, /* -1 */ + {0x00, 0x02, 0x03, 0x48, 0x48 }, /* 0 */ + {0x00, 0x02, 0x03, 0x58, 0x58 }, /* +1 */ + {0x00, 0x02, 0x03, 0x68, 0x68 }, /* +2 */ +}; + +#define NUM_SPECIAL_EFFECTS (7) +static const uint8_t special_effects_regs[NUM_SPECIAL_EFFECTS + 1][5] = { + {BPADDR, BPDATA, BPADDR, BPDATA, BPDATA }, + {0x00, 0X00, 0x05, 0X80, 0X80 }, /* no effect */ + {0x00, 0X40, 0x05, 0X80, 0X80 }, /* negative */ + {0x00, 0X18, 0x05, 0X80, 0X80 }, /* black and white */ + {0x00, 0X18, 0x05, 0X40, 0XC0 }, /* reddish */ + {0x00, 0X18, 0x05, 0X40, 0X40 }, /* greenish */ + {0x00, 0X18, 0x05, 0XA0, 0X40 }, /* blue */ + {0x00, 0X18, 0x05, 0X40, 0XA6 }, /* retro */ +}; + +#define NUM_WB_MODES (4) +static const uint8_t wb_modes_regs[NUM_WB_MODES + 1][3] = { + {0XCC, 0XCD, 0XCE }, + {0x5E, 0X41, 0x54 }, /* sunny */ + {0x65, 0X41, 0x4F }, /* cloudy */ + {0x52, 0X41, 0x66 }, /* office */ + {0x42, 0X3F, 0x71 }, /* home */ +}; + +#define NUM_AE_LEVELS (5) +static const uint8_t ae_levels_regs[NUM_AE_LEVELS + 1][3] = { + { AEW, AEB, VV }, + {0x20, 0X18, 0x60 }, + {0x34, 0X1C, 0x00 }, + {0x3E, 0X38, 0x81 }, + {0x48, 0X40, 0x81 }, + {0x58, 0X50, 0x92 }, +}; + +const uint8_t agc_gain_tbl[31] = { + 0x00, 0x10, 0x18, 0x30, 0x34, 0x38, 0x3C, 0x70, 0x72, 0x74, 0x76, 0x78, 0x7A, 0x7C, 0x7E, 0xF0, + 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF +}; + +#endif /* _OV2640_SETTINGS_H_ */ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/ov3660.h b/lib/libesp32_div/esp32-camera/sensors/private_include/ov3660.h new file mode 100644 index 000000000..341d68861 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/ov3660.h @@ -0,0 +1,34 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * OV3660 driver. + * + */ +#ifndef __OV3660_H__ +#define __OV3660_H__ + +#include "sensor.h" + +/** + * @brief Detect sensor pid + * + * @param slv_addr SCCB address + * @param id Detection result + * @return + * 0: Can't detect this sensor + * Nonzero: This sensor has been detected + */ +int ov3660_detect(int slv_addr, sensor_id_t *id); + +/** + * @brief initialize sensor function pointers + * + * @param sensor pointer of sensor + * @return + * Always 0 + */ +int ov3660_init(sensor_t *sensor); + +#endif // __OV3660_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/ov3660_regs.h b/lib/libesp32_div/esp32-camera/sensors/private_include/ov3660_regs.h new file mode 100644 index 000000000..b5cf30a5b --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/ov3660_regs.h @@ -0,0 +1,211 @@ +/* + * OV3660 register definitions. + */ +#ifndef __OV3660_REG_REGS_H__ +#define __OV3660_REG_REGS_H__ + +/* system control registers */ +#define SYSTEM_CTROL0 0x3008 // Bit[7]: Software reset + // Bit[6]: Software power down + // Bit[5]: Reserved + // Bit[4]: SRB clock SYNC enable + // Bit[3]: Isolation suspend select + // Bit[2:0]: Not used + +/* output format control registers */ +#define FORMAT_CTRL 0x501F // Format select + // Bit[2:0]: + // 000: YUV422 + // 001: RGB + // 010: Dither + // 011: RAW after DPC + // 101: RAW after CIP + +/* format control registers */ +#define FORMAT_CTRL00 0x4300 + +/* frame control registers */ +#define FRAME_CTRL01 0x4201 // Control Passed Frame Number When both ON and OFF number set to 0x00,frame control is in bypass mode + // Bit[7:4]: Not used + // Bit[3:0]: Frame ON number +#define FRAME_CTRL02 0x4202 // Control Masked Frame Number When both ON and OFF number set to 0x00,frame control is in bypass mode + // Bit[7:4]: Not used + // BIT[3:0]: Frame OFF number + +/* ISP top control registers */ +#define PRE_ISP_TEST_SETTING_1 0x503D // Bit[7]: Test enable + // 0: Test disable + // 1: Color bar enable + // Bit[6]: Rolling + // Bit[5]: Transparent + // Bit[4]: Square black and white + // Bit[3:2]: Color bar style + // 00: Standard 8 color bar + // 01: Gradual change at vertical mode 1 + // 10: Gradual change at horizontal + // 11: Gradual change at vertical mode 2 + // Bit[1:0]: Test select + // 00: Color bar + // 01: Random data + // 10: Square data + // 11: Black image + +//exposure = {0x3500[3:0], 0x3501[7:0], 0x3502[7:0]} / 16 × tROW + +/* AEC/AGC control functions */ +#define AEC_PK_MANUAL 0x3503 // AEC Manual Mode Control + // Bit[7:6]: Reserved + // Bit[5]: Gain delay option + // Valid when 0x3503[4]=1’b0 + // 0: Delay one frame latch + // 1: One frame latch + // Bit[4:2]: Reserved + // Bit[1]: AGC manual + // 0: Auto enable + // 1: Manual enable + // Bit[0]: AEC manual + // 0: Auto enable + // 1: Manual enable + +//gain = {0x350A[1:0], 0x350B[7:0]} / 16 + +/* mirror and flip registers */ +#define TIMING_TC_REG20 0x3820 // Timing Control Register + // Bit[2:1]: Vertical flip enable + // 00: Normal + // 11: Vertical flip + // Bit[0]: Vertical binning enable +#define TIMING_TC_REG21 0x3821 // Timing Control Register + // Bit[5]: Compression Enable + // Bit[2:1]: Horizontal mirror enable + // 00: Normal + // 11: Horizontal mirror + // Bit[0]: Horizontal binning enable + +#define CLOCK_POL_CONTROL 0x4740// Bit[5]: PCLK polarity 0: active low + // 1: active high + // Bit[3]: Gate PCLK under VSYNC + // Bit[2]: Gate PCLK under HREF + // Bit[1]: HREF polarity + // 0: active low + // 1: active high + // Bit[0] VSYNC polarity + // 0: active low + // 1: active high +#define DRIVE_CAPABILITY 0x302c // Bit[7:6]: + // 00: 1x + // 01: 2x + // 10: 3x + // 11: 4x + + +#define X_ADDR_ST_H 0x3800 //Bit[3:0]: X address start[11:8] +#define X_ADDR_ST_L 0x3801 //Bit[7:0]: X address start[7:0] +#define Y_ADDR_ST_H 0x3802 //Bit[2:0]: Y address start[10:8] +#define Y_ADDR_ST_L 0x3803 //Bit[7:0]: Y address start[7:0] +#define X_ADDR_END_H 0x3804 //Bit[3:0]: X address end[11:8] +#define X_ADDR_END_L 0x3805 //Bit[7:0]: +#define Y_ADDR_END_H 0x3806 //Bit[2:0]: Y address end[10:8] +#define Y_ADDR_END_L 0x3807 //Bit[7:0]: +// Size after scaling +#define X_OUTPUT_SIZE_H 0x3808 //Bit[3:0]: DVP output horizontal width[11:8] +#define X_OUTPUT_SIZE_L 0x3809 //Bit[7:0]: +#define Y_OUTPUT_SIZE_H 0x380a //Bit[2:0]: DVP output vertical height[10:8] +#define Y_OUTPUT_SIZE_L 0x380b //Bit[7:0]: +#define X_TOTAL_SIZE_H 0x380c //Bit[3:0]: Total horizontal size[11:8] +#define X_TOTAL_SIZE_L 0x380d //Bit[7:0]: +#define Y_TOTAL_SIZE_H 0x380e //Bit[7:0]: Total vertical size[15:8] +#define Y_TOTAL_SIZE_L 0x380f //Bit[7:0]: +#define X_OFFSET_H 0x3810 //Bit[3:0]: ISP horizontal offset[11:8] +#define X_OFFSET_L 0x3811 //Bit[7:0]: +#define Y_OFFSET_H 0x3812 //Bit[2:0]: ISP vertical offset[10:8] +#define Y_OFFSET_L 0x3813 //Bit[7:0]: +#define X_INCREMENT 0x3814 //Bit[7:4]: Horizontal odd subsample increment + //Bit[3:0]: Horizontal even subsample increment +#define Y_INCREMENT 0x3815 //Bit[7:4]: Vertical odd subsample increment + //Bit[3:0]: Vertical even subsample increment +// Size before scaling +//#define X_INPUT_SIZE (X_ADDR_END - X_ADDR_ST + 1 - (2 * X_OFFSET)) +//#define Y_INPUT_SIZE (Y_ADDR_END - Y_ADDR_ST + 1 - (2 * Y_OFFSET)) + +#define ISP_CONTROL_01 0x5001 // Bit[5]: Scale enable + // 0: Disable + // 1: Enable + +#define SCALE_CTRL_1 0x5601 // Bit[6:4]: HDIV RW + // DCW scale times + // 000: DCW 1 time + // 001: DCW 2 times + // 010: DCW 4 times + // 100: DCW 8 times + // 101: DCW 16 times + // Others: DCW 16 times + // Bit[2:0]: VDIV RW + // DCW scale times + // 000: DCW 1 time + // 001: DCW 2 times + // 010: DCW 4 times + // 100: DCW 8 times + // 101: DCW 16 times + // Others: DCW 16 times + +#define SCALE_CTRL_2 0x5602 // X_SCALE High Bits +#define SCALE_CTRL_3 0x5603 // X_SCALE Low Bits +#define SCALE_CTRL_4 0x5604 // Y_SCALE High Bits +#define SCALE_CTRL_5 0x5605 // Y_SCALE Low Bits +#define SCALE_CTRL_6 0x5606 // Bit[3:0]: V Offset + +#define PCLK_RATIO 0x3824 // Bit[4:0]: PCLK ratio manual +#define VFIFO_CTRL0C 0x460C // Bit[1]: PCLK manual enable + // 0: Auto + // 1: Manual by PCLK_RATIO + +#define VFIFO_X_SIZE_H 0x4602 +#define VFIFO_X_SIZE_L 0x4603 +#define VFIFO_Y_SIZE_H 0x4604 +#define VFIFO_Y_SIZE_L 0x4605 + +#define SC_PLLS_CTRL0 0x303a // Bit[7]: PLLS bypass +#define SC_PLLS_CTRL1 0x303b // Bit[4:0]: PLLS multiplier +#define SC_PLLS_CTRL2 0x303c // Bit[6:4]: PLLS charge pump control + // Bit[3:0]: PLLS system divider +#define SC_PLLS_CTRL3 0x303d // Bit[5:4]: PLLS pre-divider + // 00: 1 + // 01: 1.5 + // 10: 2 + // 11: 3 + // Bit[2]: PLLS root-divider - 1 + // Bit[1:0]: PLLS seld5 + // 00: 1 + // 01: 1 + // 10: 2 + // 11: 2.5 + +#define COMPRESSION_CTRL00 0x4400 // +#define COMPRESSION_CTRL01 0x4401 // +#define COMPRESSION_CTRL02 0x4402 // +#define COMPRESSION_CTRL03 0x4403 // +#define COMPRESSION_CTRL04 0x4404 // +#define COMPRESSION_CTRL05 0x4405 // +#define COMPRESSION_CTRL06 0x4406 // +#define COMPRESSION_CTRL07 0x4407 // Bit[5:0]: QS +#define COMPRESSION_ISI_CTRL 0x4408 // +#define COMPRESSION_CTRL09 0x4409 // +#define COMPRESSION_CTRL0a 0x440a // +#define COMPRESSION_CTRL0b 0x440b // +#define COMPRESSION_CTRL0c 0x440c // +#define COMPRESSION_CTRL0d 0x440d // +#define COMPRESSION_CTRL0E 0x440e // + +/** + * @brief register value + */ +#define TEST_COLOR_BAR 0xC0 /* Enable Color Bar roling Test */ + +#define AEC_PK_MANUAL_AGC_MANUALEN 0x02 /* Enable AGC Manual enable */ +#define AEC_PK_MANUAL_AEC_MANUALEN 0x01 /* Enable AEC Manual enable */ + +#define TIMING_TC_REG20_VFLIP 0x06 /* Vertical flip enable */ +#define TIMING_TC_REG21_HMIRROR 0x06 /* Horizontal mirror enable */ + +#endif // __OV3660_REG_REGS_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/ov3660_settings.h b/lib/libesp32_div/esp32-camera/sensors/private_include/ov3660_settings.h new file mode 100644 index 000000000..97c4e03b6 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/ov3660_settings.h @@ -0,0 +1,318 @@ +#ifndef _OV3660_SETTINGS_H_ +#define _OV3660_SETTINGS_H_ + +#include +#include +#include "esp_attr.h" +#include "ov3660_regs.h" + +static const ratio_settings_t ratio_table[] = { + // mw, mh, sx, sy, ex, ey, ox, oy, tx, ty + { 2048, 1536, 0, 0, 2079, 1547, 16, 6, 2300, 1564 }, //4x3 + { 1920, 1280, 64, 128, 2015, 1419, 16, 6, 2172, 1436 }, //3x2 + { 2048, 1280, 0, 128, 2079, 1419, 16, 6, 2300, 1436 }, //16x10 + { 1920, 1152, 64, 192, 2015, 1355, 16, 6, 2172, 1372 }, //5x3 + { 1920, 1080, 64, 242, 2015, 1333, 16, 6, 2172, 1322 }, //16x9 + { 2048, 880, 0, 328, 2079, 1219, 16, 6, 2300, 1236 }, //21x9 + { 1920, 1536, 64, 0, 2015, 1547, 16, 6, 2172, 1564 }, //5x4 + { 1536, 1536, 256, 0, 1823, 1547, 16, 6, 2044, 1564 }, //1x1 + { 864, 1536, 592, 0, 1487, 1547, 16, 6, 2044, 1564 } //9x16 +}; + +#define REG_DLY 0xffff +#define REGLIST_TAIL 0x0000 + +static const DRAM_ATTR uint16_t sensor_default_regs[][2] = { + {SYSTEM_CTROL0, 0x82}, // software reset + {REG_DLY, 10}, // delay 10ms + + {0x3103, 0x13}, + {SYSTEM_CTROL0, 0x42}, + {0x3017, 0xff}, + {0x3018, 0xff}, + {DRIVE_CAPABILITY, 0xc3}, + {CLOCK_POL_CONTROL, 0x21}, + + {0x3611, 0x01}, + {0x3612, 0x2d}, + + {0x3032, 0x00}, + {0x3614, 0x80}, + {0x3618, 0x00}, + {0x3619, 0x75}, + {0x3622, 0x80}, + {0x3623, 0x00}, + {0x3624, 0x03}, + {0x3630, 0x52}, + {0x3632, 0x07}, + {0x3633, 0xd2}, + {0x3704, 0x80}, + {0x3708, 0x66}, + {0x3709, 0x12}, + {0x370b, 0x12}, + {0x3717, 0x00}, + {0x371b, 0x60}, + {0x371c, 0x00}, + {0x3901, 0x13}, + + {0x3600, 0x08}, + {0x3620, 0x43}, + {0x3702, 0x20}, + {0x3739, 0x48}, + {0x3730, 0x20}, + {0x370c, 0x0c}, + + {0x3a18, 0x00}, + {0x3a19, 0xf8}, + + {0x3000, 0x10}, + {0x3004, 0xef}, + + {0x6700, 0x05}, + {0x6701, 0x19}, + {0x6702, 0xfd}, + {0x6703, 0xd1}, + {0x6704, 0xff}, + {0x6705, 0xff}, + + {0x3c01, 0x80}, + {0x3c00, 0x04}, + {0x3a08, 0x00}, {0x3a09, 0x62}, //50Hz Band Width Step (10bit) + {0x3a0e, 0x08}, //50Hz Max Bands in One Frame (6 bit) + {0x3a0a, 0x00}, {0x3a0b, 0x52}, //60Hz Band Width Step (10bit) + {0x3a0d, 0x09}, //60Hz Max Bands in One Frame (6 bit) + + {0x3a00, 0x3a},//night mode off + {0x3a14, 0x09}, + {0x3a15, 0x30}, + {0x3a02, 0x09}, + {0x3a03, 0x30}, + + {COMPRESSION_CTRL0E, 0x08}, + {0x4520, 0x0b}, + {0x460b, 0x37}, + {0x4713, 0x02}, + {0x471c, 0xd0}, + {0x5086, 0x00}, + + {0x5002, 0x00}, + {0x501f, 0x00}, + + {SYSTEM_CTROL0, 0x02}, + + {0x5180, 0xff}, + {0x5181, 0xf2}, + {0x5182, 0x00}, + {0x5183, 0x14}, + {0x5184, 0x25}, + {0x5185, 0x24}, + {0x5186, 0x16}, + {0x5187, 0x16}, + {0x5188, 0x16}, + {0x5189, 0x68}, + {0x518a, 0x60}, + {0x518b, 0xe0}, + {0x518c, 0xb2}, + {0x518d, 0x42}, + {0x518e, 0x35}, + {0x518f, 0x56}, + {0x5190, 0x56}, + {0x5191, 0xf8}, + {0x5192, 0x04}, + {0x5193, 0x70}, + {0x5194, 0xf0}, + {0x5195, 0xf0}, + {0x5196, 0x03}, + {0x5197, 0x01}, + {0x5198, 0x04}, + {0x5199, 0x12}, + {0x519a, 0x04}, + {0x519b, 0x00}, + {0x519c, 0x06}, + {0x519d, 0x82}, + {0x519e, 0x38}, + + {0x5381, 0x1d}, + {0x5382, 0x60}, + {0x5383, 0x03}, + {0x5384, 0x0c}, + {0x5385, 0x78}, + {0x5386, 0x84}, + {0x5387, 0x7d}, + {0x5388, 0x6b}, + {0x5389, 0x12}, + {0x538a, 0x01}, + {0x538b, 0x98}, + + {0x5480, 0x01}, +// {0x5481, 0x05}, +// {0x5482, 0x09}, +// {0x5483, 0x10}, +// {0x5484, 0x3a}, +// {0x5485, 0x4c}, +// {0x5486, 0x5a}, +// {0x5487, 0x68}, +// {0x5488, 0x74}, +// {0x5489, 0x80}, +// {0x548a, 0x8e}, +// {0x548b, 0xa4}, +// {0x548c, 0xb4}, +// {0x548d, 0xc8}, +// {0x548e, 0xde}, +// {0x548f, 0xf0}, +// {0x5490, 0x15}, + + {0x5000, 0xa7}, + {0x5800, 0x0C}, + {0x5801, 0x09}, + {0x5802, 0x0C}, + {0x5803, 0x0C}, + {0x5804, 0x0D}, + {0x5805, 0x17}, + {0x5806, 0x06}, + {0x5807, 0x05}, + {0x5808, 0x04}, + {0x5809, 0x06}, + {0x580a, 0x09}, + {0x580b, 0x0E}, + {0x580c, 0x05}, + {0x580d, 0x01}, + {0x580e, 0x01}, + {0x580f, 0x01}, + {0x5810, 0x05}, + {0x5811, 0x0D}, + {0x5812, 0x05}, + {0x5813, 0x01}, + {0x5814, 0x01}, + {0x5815, 0x01}, + {0x5816, 0x05}, + {0x5817, 0x0D}, + {0x5818, 0x08}, + {0x5819, 0x06}, + {0x581a, 0x05}, + {0x581b, 0x07}, + {0x581c, 0x0B}, + {0x581d, 0x0D}, + {0x581e, 0x12}, + {0x581f, 0x0D}, + {0x5820, 0x0E}, + {0x5821, 0x10}, + {0x5822, 0x10}, + {0x5823, 0x1E}, + {0x5824, 0x53}, + {0x5825, 0x15}, + {0x5826, 0x05}, + {0x5827, 0x14}, + {0x5828, 0x54}, + {0x5829, 0x25}, + {0x582a, 0x33}, + {0x582b, 0x33}, + {0x582c, 0x34}, + {0x582d, 0x16}, + {0x582e, 0x24}, + {0x582f, 0x41}, + {0x5830, 0x50}, + {0x5831, 0x42}, + {0x5832, 0x15}, + {0x5833, 0x25}, + {0x5834, 0x34}, + {0x5835, 0x33}, + {0x5836, 0x24}, + {0x5837, 0x26}, + {0x5838, 0x54}, + {0x5839, 0x25}, + {0x583a, 0x15}, + {0x583b, 0x25}, + {0x583c, 0x53}, + {0x583d, 0xCF}, + + {0x3a0f, 0x30}, + {0x3a10, 0x28}, + {0x3a1b, 0x30}, + {0x3a1e, 0x28}, + {0x3a11, 0x60}, + {0x3a1f, 0x14}, + + {0x5302, 0x28}, + {0x5303, 0x20}, + + {0x5306, 0x1c}, //de-noise offset 1 + {0x5307, 0x28}, //de-noise offset 2 + + {0x4002, 0xc5}, + {0x4003, 0x81}, + {0x4005, 0x12}, + + {0x5688, 0x11}, + {0x5689, 0x11}, + {0x568a, 0x11}, + {0x568b, 0x11}, + {0x568c, 0x11}, + {0x568d, 0x11}, + {0x568e, 0x11}, + {0x568f, 0x11}, + + {0x5580, 0x06}, + {0x5588, 0x00}, + {0x5583, 0x40}, + {0x5584, 0x2c}, + + {ISP_CONTROL_01, 0x83}, // turn color matrix, awb and SDE + {REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_fmt_jpeg[][2] = { + {FORMAT_CTRL, 0x00}, // YUV422 + {FORMAT_CTRL00, 0x30}, // YUYV + {0x3002, 0x00},//0x1c to 0x00 !!! + {0x3006, 0xff},//0xc3 to 0xff !!! + {0x471c, 0x50},//0xd0 to 0x50 !!! + {REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_fmt_raw[][2] = { + {FORMAT_CTRL00, 0x00}, // RAW + {REGLIST_TAIL, 0x00} +}; + +static const DRAM_ATTR uint16_t sensor_fmt_grayscale[][2] = { + {FORMAT_CTRL, 0x00}, // YUV422 + {FORMAT_CTRL00, 0x10}, // Y8 + {REGLIST_TAIL, 0x00} +}; + +static const DRAM_ATTR uint16_t sensor_fmt_yuv422[][2] = { + {FORMAT_CTRL, 0x00}, // YUV422 + {FORMAT_CTRL00, 0x30}, // YUYV + {REGLIST_TAIL, 0x00} +}; + +static const DRAM_ATTR uint16_t sensor_fmt_rgb565[][2] = { + {FORMAT_CTRL, 0x01}, // RGB + {FORMAT_CTRL00, 0x61}, // RGB565 (BGR) + {REGLIST_TAIL, 0x00} +}; + +static const DRAM_ATTR uint8_t sensor_saturation_levels[9][11] = { + {0x1d, 0x60, 0x03, 0x07, 0x48, 0x4f, 0x4b, 0x40, 0x0b, 0x01, 0x98},//-4 + {0x1d, 0x60, 0x03, 0x08, 0x54, 0x5c, 0x58, 0x4b, 0x0d, 0x01, 0x98},//-3 + {0x1d, 0x60, 0x03, 0x0a, 0x60, 0x6a, 0x64, 0x56, 0x0e, 0x01, 0x98},//-2 + {0x1d, 0x60, 0x03, 0x0b, 0x6c, 0x77, 0x70, 0x60, 0x10, 0x01, 0x98},//-1 + {0x1d, 0x60, 0x03, 0x0c, 0x78, 0x84, 0x7d, 0x6b, 0x12, 0x01, 0x98},//0 + {0x1d, 0x60, 0x03, 0x0d, 0x84, 0x91, 0x8a, 0x76, 0x14, 0x01, 0x98},//+1 + {0x1d, 0x60, 0x03, 0x0e, 0x90, 0x9e, 0x96, 0x80, 0x16, 0x01, 0x98},//+2 + {0x1d, 0x60, 0x03, 0x10, 0x9c, 0xac, 0xa2, 0x8b, 0x17, 0x01, 0x98},//+3 + {0x1d, 0x60, 0x03, 0x11, 0xa8, 0xb9, 0xaf, 0x96, 0x19, 0x01, 0x98},//+4 +}; + +static const DRAM_ATTR uint8_t sensor_special_effects[7][4] = { + {0x06, 0x40, 0x2c, 0x08},//Normal + {0x46, 0x40, 0x28, 0x08},//Negative + {0x1e, 0x80, 0x80, 0x08},//Grayscale + {0x1e, 0x80, 0xc0, 0x08},//Red Tint + {0x1e, 0x60, 0x60, 0x08},//Green Tint + {0x1e, 0xa0, 0x40, 0x08},//Blue Tint + {0x1e, 0x40, 0xa0, 0x08},//Sepia +}; + +#endif diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/ov5640.h b/lib/libesp32_div/esp32-camera/sensors/private_include/ov5640.h new file mode 100644 index 000000000..120ae7205 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/ov5640.h @@ -0,0 +1,27 @@ + +#ifndef __OV5640_H__ +#define __OV5640_H__ + +#include "sensor.h" + +/** + * @brief Detect sensor pid + * + * @param slv_addr SCCB address + * @param id Detection result + * @return + * 0: Can't detect this sensor + * Nonzero: This sensor has been detected + */ +int ov5640_detect(int slv_addr, sensor_id_t *id); + +/** + * @brief initialize sensor function pointers + * + * @param sensor pointer of sensor + * @return + * Always 0 + */ +int ov5640_init(sensor_t *sensor); + +#endif // __OV5640_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/ov5640_regs.h b/lib/libesp32_div/esp32-camera/sensors/private_include/ov5640_regs.h new file mode 100644 index 000000000..c28d80f5b --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/ov5640_regs.h @@ -0,0 +1,213 @@ +/* + * OV5640 register definitions. + */ +#ifndef __OV5640_REG_REGS_H__ +#define __OV5640_REG_REGS_H__ + +/* system control registers */ +#define SYSTEM_CTROL0 0x3008 // Bit[7]: Software reset + // Bit[6]: Software power down + // Bit[5]: Reserved + // Bit[4]: SRB clock SYNC enable + // Bit[3]: Isolation suspend select + // Bit[2:0]: Not used + +#define DRIVE_CAPABILITY 0x302c // Bit[7:6]: + // 00: 1x + // 01: 2x + // 10: 3x + // 11: 4x + +#define SC_PLLS_CTRL0 0x303a // Bit[7]: PLLS bypass +#define SC_PLLS_CTRL1 0x303b // Bit[4:0]: PLLS multiplier +#define SC_PLLS_CTRL2 0x303c // Bit[6:4]: PLLS charge pump control + // Bit[3:0]: PLLS system divider +#define SC_PLLS_CTRL3 0x303d // Bit[5:4]: PLLS pre-divider + // 00: 1 + // 01: 1.5 + // 10: 2 + // 11: 3 + // Bit[2]: PLLS root-divider - 1 + // Bit[1:0]: PLLS seld5 + // 00: 1 + // 01: 1 + // 10: 2 + // 11: 2.5 + +/* AEC/AGC control functions */ +#define AEC_PK_MANUAL 0x3503 // AEC Manual Mode Control + // Bit[7:6]: Reserved + // Bit[5]: Gain delay option + // Valid when 0x3503[4]=1’b0 + // 0: Delay one frame latch + // 1: One frame latch + // Bit[4:2]: Reserved + // Bit[1]: AGC manual + // 0: Auto enable + // 1: Manual enable + // Bit[0]: AEC manual + // 0: Auto enable + // 1: Manual enable + +//gain = {0x350A[1:0], 0x350B[7:0]} / 16 + + +#define X_ADDR_ST_H 0x3800 //Bit[3:0]: X address start[11:8] +#define X_ADDR_ST_L 0x3801 //Bit[7:0]: X address start[7:0] +#define Y_ADDR_ST_H 0x3802 //Bit[2:0]: Y address start[10:8] +#define Y_ADDR_ST_L 0x3803 //Bit[7:0]: Y address start[7:0] +#define X_ADDR_END_H 0x3804 //Bit[3:0]: X address end[11:8] +#define X_ADDR_END_L 0x3805 //Bit[7:0]: +#define Y_ADDR_END_H 0x3806 //Bit[2:0]: Y address end[10:8] +#define Y_ADDR_END_L 0x3807 //Bit[7:0]: +// Size after scaling +#define X_OUTPUT_SIZE_H 0x3808 //Bit[3:0]: DVP output horizontal width[11:8] +#define X_OUTPUT_SIZE_L 0x3809 //Bit[7:0]: +#define Y_OUTPUT_SIZE_H 0x380a //Bit[2:0]: DVP output vertical height[10:8] +#define Y_OUTPUT_SIZE_L 0x380b //Bit[7:0]: +#define X_TOTAL_SIZE_H 0x380c //Bit[3:0]: Total horizontal size[11:8] +#define X_TOTAL_SIZE_L 0x380d //Bit[7:0]: +#define Y_TOTAL_SIZE_H 0x380e //Bit[7:0]: Total vertical size[15:8] +#define Y_TOTAL_SIZE_L 0x380f //Bit[7:0]: +#define X_OFFSET_H 0x3810 //Bit[3:0]: ISP horizontal offset[11:8] +#define X_OFFSET_L 0x3811 //Bit[7:0]: +#define Y_OFFSET_H 0x3812 //Bit[2:0]: ISP vertical offset[10:8] +#define Y_OFFSET_L 0x3813 //Bit[7:0]: +#define X_INCREMENT 0x3814 //Bit[7:4]: Horizontal odd subsample increment + //Bit[3:0]: Horizontal even subsample increment +#define Y_INCREMENT 0x3815 //Bit[7:4]: Vertical odd subsample increment + //Bit[3:0]: Vertical even subsample increment +// Size before scaling +//#define X_INPUT_SIZE (X_ADDR_END - X_ADDR_ST + 1 - (2 * X_OFFSET)) +//#define Y_INPUT_SIZE (Y_ADDR_END - Y_ADDR_ST + 1 - (2 * Y_OFFSET)) + +/* mirror and flip registers */ +#define TIMING_TC_REG20 0x3820 // Timing Control Register + // Bit[2:1]: Vertical flip enable + // 00: Normal + // 11: Vertical flip + // Bit[0]: Vertical binning enable +#define TIMING_TC_REG21 0x3821 // Timing Control Register + // Bit[5]: Compression Enable + // Bit[2:1]: Horizontal mirror enable + // 00: Normal + // 11: Horizontal mirror + // Bit[0]: Horizontal binning enable + +#define PCLK_RATIO 0x3824 // Bit[4:0]: PCLK ratio manual + +/* frame control registers */ +#define FRAME_CTRL01 0x4201 // Control Passed Frame Number When both ON and OFF number set to 0x00,frame control is in bypass mode + // Bit[7:4]: Not used + // Bit[3:0]: Frame ON number +#define FRAME_CTRL02 0x4202 // Control Masked Frame Number When both ON and OFF number set to 0x00,frame control is in bypass mode + // Bit[7:4]: Not used + // BIT[3:0]: Frame OFF number + +/* format control registers */ +#define FORMAT_CTRL00 0x4300 + +#define CLOCK_POL_CONTROL 0x4740// Bit[5]: PCLK polarity 0: active low + // 1: active high + // Bit[3]: Gate PCLK under VSYNC + // Bit[2]: Gate PCLK under HREF + // Bit[1]: HREF polarity + // 0: active low + // 1: active high + // Bit[0] VSYNC polarity + // 0: active low + // 1: active high + +#define ISP_CONTROL_01 0x5001 // Bit[5]: Scale enable + // 0: Disable + // 1: Enable + +/* output format control registers */ +#define FORMAT_CTRL 0x501F // Format select + // Bit[2:0]: + // 000: YUV422 + // 001: RGB + // 010: Dither + // 011: RAW after DPC + // 101: RAW after CIP + +/* ISP top control registers */ +#define PRE_ISP_TEST_SETTING_1 0x503D // Bit[7]: Test enable + // 0: Test disable + // 1: Color bar enable + // Bit[6]: Rolling + // Bit[5]: Transparent + // Bit[4]: Square black and white + // Bit[3:2]: Color bar style + // 00: Standard 8 color bar + // 01: Gradual change at vertical mode 1 + // 10: Gradual change at horizontal + // 11: Gradual change at vertical mode 2 + // Bit[1:0]: Test select + // 00: Color bar + // 01: Random data + // 10: Square data + // 11: Black image + +//exposure = {0x3500[3:0], 0x3501[7:0], 0x3502[7:0]} / 16 × tROW + +#define SCALE_CTRL_1 0x5601 // Bit[6:4]: HDIV RW + // DCW scale times + // 000: DCW 1 time + // 001: DCW 2 times + // 010: DCW 4 times + // 100: DCW 8 times + // 101: DCW 16 times + // Others: DCW 16 times + // Bit[2:0]: VDIV RW + // DCW scale times + // 000: DCW 1 time + // 001: DCW 2 times + // 010: DCW 4 times + // 100: DCW 8 times + // 101: DCW 16 times + // Others: DCW 16 times + +#define SCALE_CTRL_2 0x5602 // X_SCALE High Bits +#define SCALE_CTRL_3 0x5603 // X_SCALE Low Bits +#define SCALE_CTRL_4 0x5604 // Y_SCALE High Bits +#define SCALE_CTRL_5 0x5605 // Y_SCALE Low Bits +#define SCALE_CTRL_6 0x5606 // Bit[3:0]: V Offset + +#define VFIFO_CTRL0C 0x460C // Bit[1]: PCLK manual enable + // 0: Auto + // 1: Manual by PCLK_RATIO + +#define VFIFO_X_SIZE_H 0x4602 +#define VFIFO_X_SIZE_L 0x4603 +#define VFIFO_Y_SIZE_H 0x4604 +#define VFIFO_Y_SIZE_L 0x4605 + +#define COMPRESSION_CTRL00 0x4400 // +#define COMPRESSION_CTRL01 0x4401 // +#define COMPRESSION_CTRL02 0x4402 // +#define COMPRESSION_CTRL03 0x4403 // +#define COMPRESSION_CTRL04 0x4404 // +#define COMPRESSION_CTRL05 0x4405 // +#define COMPRESSION_CTRL06 0x4406 // +#define COMPRESSION_CTRL07 0x4407 // Bit[5:0]: QS +#define COMPRESSION_ISI_CTRL 0x4408 // +#define COMPRESSION_CTRL09 0x4409 // +#define COMPRESSION_CTRL0a 0x440a // +#define COMPRESSION_CTRL0b 0x440b // +#define COMPRESSION_CTRL0c 0x440c // +#define COMPRESSION_CTRL0d 0x440d // +#define COMPRESSION_CTRL0E 0x440e // + +/** + * @brief register value + */ +#define TEST_COLOR_BAR 0xC0 /* Enable Color Bar roling Test */ + +#define AEC_PK_MANUAL_AGC_MANUALEN 0x02 /* Enable AGC Manual enable */ +#define AEC_PK_MANUAL_AEC_MANUALEN 0x01 /* Enable AEC Manual enable */ + +#define TIMING_TC_REG20_VFLIP 0x06 /* Vertical flip enable */ +#define TIMING_TC_REG21_HMIRROR 0x06 /* Horizontal mirror enable */ + +#endif // __OV3660_REG_REGS_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/ov5640_settings.h b/lib/libesp32_div/esp32-camera/sensors/private_include/ov5640_settings.h new file mode 100644 index 000000000..fec7d679f --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/ov5640_settings.h @@ -0,0 +1,334 @@ +#ifndef _OV5640_SETTINGS_H_ +#define _OV5640_SETTINGS_H_ + +#include +#include +#include "esp_attr.h" +#include "ov5640_regs.h" + +static const ratio_settings_t ratio_table[] = { + // mw, mh, sx, sy, ex, ey, ox, oy, tx, ty + { 2560, 1920, 0, 0, 2623, 1951, 32, 16, 2844, 1968 }, //4x3 + { 2560, 1704, 0, 110, 2623, 1843, 32, 16, 2844, 1752 }, //3x2 + { 2560, 1600, 0, 160, 2623, 1791, 32, 16, 2844, 1648 }, //16x10 + { 2560, 1536, 0, 192, 2623, 1759, 32, 16, 2844, 1584 }, //5x3 + { 2560, 1440, 0, 240, 2623, 1711, 32, 16, 2844, 1488 }, //16x9 + { 2560, 1080, 0, 420, 2623, 1531, 32, 16, 2844, 1128 }, //21x9 + { 2400, 1920, 80, 0, 2543, 1951, 32, 16, 2684, 1968 }, //5x4 + { 1920, 1920, 320, 0, 2543, 1951, 32, 16, 2684, 1968 }, //1x1 + { 1088, 1920, 736, 0, 1887, 1951, 32, 16, 1884, 1968 } //9x16 +}; + +#define REG_DLY 0xffff +#define REGLIST_TAIL 0x0000 + +static const DRAM_ATTR uint16_t sensor_default_regs[][2] = { + {SYSTEM_CTROL0, 0x82}, // software reset + {REG_DLY, 10}, // delay 10ms + {SYSTEM_CTROL0, 0x42}, // power down + + //enable pll + {0x3103, 0x13}, + + //io direction + {0x3017, 0xff}, + {0x3018, 0xff}, + + {DRIVE_CAPABILITY, 0xc3}, + {CLOCK_POL_CONTROL, 0x21}, + + {0x4713, 0x02},//jpg mode select + + {ISP_CONTROL_01, 0x83}, // turn color matrix, awb and SDE + + //sys reset + {0x3000, 0x00}, + {0x3002, 0x1c}, + + //clock enable + {0x3004, 0xff}, + {0x3006, 0xc3}, + + //isp control + {0x5000, 0xa7}, + {ISP_CONTROL_01, 0xa3},//+scaling? + {0x5003, 0x08},//special_effect + + //unknown + {0x370c, 0x02},//!!IMPORTANT + {0x3634, 0x40},//!!IMPORTANT + + //AEC/AGC + {0x3a02, 0x03}, + {0x3a03, 0xd8}, + {0x3a08, 0x01}, + {0x3a09, 0x27}, + {0x3a0a, 0x00}, + {0x3a0b, 0xf6}, + {0x3a0d, 0x04}, + {0x3a0e, 0x03}, + {0x3a0f, 0x30},//ae_level + {0x3a10, 0x28},//ae_level + {0x3a11, 0x60},//ae_level + {0x3a13, 0x43}, + {0x3a14, 0x03}, + {0x3a15, 0xd8}, + {0x3a18, 0x00},//gainceiling + {0x3a19, 0xf8},//gainceiling + {0x3a1b, 0x30},//ae_level + {0x3a1e, 0x26},//ae_level + {0x3a1f, 0x14},//ae_level + + //vcm debug + {0x3600, 0x08}, + {0x3601, 0x33}, + + //50/60Hz + {0x3c01, 0xa4}, + {0x3c04, 0x28}, + {0x3c05, 0x98}, + {0x3c06, 0x00}, + {0x3c07, 0x08}, + {0x3c08, 0x00}, + {0x3c09, 0x1c}, + {0x3c0a, 0x9c}, + {0x3c0b, 0x40}, + + {0x460c, 0x22},//disable jpeg footer + + //BLC + {0x4001, 0x02}, + {0x4004, 0x02}, + + //AWB + {0x5180, 0xff}, + {0x5181, 0xf2}, + {0x5182, 0x00}, + {0x5183, 0x14}, + {0x5184, 0x25}, + {0x5185, 0x24}, + {0x5186, 0x09}, + {0x5187, 0x09}, + {0x5188, 0x09}, + {0x5189, 0x75}, + {0x518a, 0x54}, + {0x518b, 0xe0}, + {0x518c, 0xb2}, + {0x518d, 0x42}, + {0x518e, 0x3d}, + {0x518f, 0x56}, + {0x5190, 0x46}, + {0x5191, 0xf8}, + {0x5192, 0x04}, + {0x5193, 0x70}, + {0x5194, 0xf0}, + {0x5195, 0xf0}, + {0x5196, 0x03}, + {0x5197, 0x01}, + {0x5198, 0x04}, + {0x5199, 0x12}, + {0x519a, 0x04}, + {0x519b, 0x00}, + {0x519c, 0x06}, + {0x519d, 0x82}, + {0x519e, 0x38}, + + //color matrix (Saturation) + {0x5381, 0x1e}, + {0x5382, 0x5b}, + {0x5383, 0x08}, + {0x5384, 0x0a}, + {0x5385, 0x7e}, + {0x5386, 0x88}, + {0x5387, 0x7c}, + {0x5388, 0x6c}, + {0x5389, 0x10}, + {0x538a, 0x01}, + {0x538b, 0x98}, + + //CIP control (Sharpness) + {0x5300, 0x10},//sharpness + {0x5301, 0x10},//sharpness + {0x5302, 0x18},//sharpness + {0x5303, 0x19},//sharpness + {0x5304, 0x10}, + {0x5305, 0x10}, + {0x5306, 0x08},//denoise + {0x5307, 0x16}, + {0x5308, 0x40}, + {0x5309, 0x10},//sharpness + {0x530a, 0x10},//sharpness + {0x530b, 0x04},//sharpness + {0x530c, 0x06},//sharpness + + //GAMMA + {0x5480, 0x01}, + {0x5481, 0x00}, + {0x5482, 0x1e}, + {0x5483, 0x3b}, + {0x5484, 0x58}, + {0x5485, 0x66}, + {0x5486, 0x71}, + {0x5487, 0x7d}, + {0x5488, 0x83}, + {0x5489, 0x8f}, + {0x548a, 0x98}, + {0x548b, 0xa6}, + {0x548c, 0xb8}, + {0x548d, 0xca}, + {0x548e, 0xd7}, + {0x548f, 0xe3}, + {0x5490, 0x1d}, + + //Special Digital Effects (SDE) (UV adjust) + {0x5580, 0x06},//enable brightness and contrast + {0x5583, 0x40},//special_effect + {0x5584, 0x10},//special_effect + {0x5586, 0x20},//contrast + {0x5587, 0x00},//brightness + {0x5588, 0x00},//brightness + {0x5589, 0x10}, + {0x558a, 0x00}, + {0x558b, 0xf8}, + {0x501d, 0x40},// enable manual offset of contrast + + //power on + {0x3008, 0x02}, + + //50Hz + {0x3c00, 0x04}, + + {REG_DLY, 300}, + {REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_fmt_jpeg[][2] = { + {FORMAT_CTRL, 0x00}, // YUV422 + {FORMAT_CTRL00, 0x30}, // YUYV + {0x3002, 0x00},//0x1c to 0x00 !!! + {0x3006, 0xff},//0xc3 to 0xff !!! + {0x471c, 0x50},//0xd0 to 0x50 !!! + {REGLIST_TAIL, 0x00}, // tail +}; + +static const DRAM_ATTR uint16_t sensor_fmt_raw[][2] = { + {FORMAT_CTRL, 0x03}, // RAW (DPC) + {FORMAT_CTRL00, 0x00}, // RAW + {REGLIST_TAIL, 0x00} +}; + +static const DRAM_ATTR uint16_t sensor_fmt_grayscale[][2] = { + {FORMAT_CTRL, 0x00}, // YUV422 + {FORMAT_CTRL00, 0x10}, // Y8 + {REGLIST_TAIL, 0x00} +}; + +static const DRAM_ATTR uint16_t sensor_fmt_yuv422[][2] = { + {FORMAT_CTRL, 0x00}, // YUV422 + {FORMAT_CTRL00, 0x30}, // YUYV + {REGLIST_TAIL, 0x00} +}; + +static const DRAM_ATTR uint16_t sensor_fmt_rgb565[][2] = { + {FORMAT_CTRL, 0x01}, // RGB + {FORMAT_CTRL00, 0x61}, // RGB565 (BGR) + {REGLIST_TAIL, 0x00} +}; + +static const DRAM_ATTR uint8_t sensor_saturation_levels[9][11] = { + {0x1d, 0x60, 0x03, 0x07, 0x48, 0x4f, 0x4b, 0x40, 0x0b, 0x01, 0x98},//-4 + {0x1d, 0x60, 0x03, 0x08, 0x54, 0x5c, 0x58, 0x4b, 0x0d, 0x01, 0x98},//-3 + {0x1d, 0x60, 0x03, 0x0a, 0x60, 0x6a, 0x64, 0x56, 0x0e, 0x01, 0x98},//-2 + {0x1d, 0x60, 0x03, 0x0b, 0x6c, 0x77, 0x70, 0x60, 0x10, 0x01, 0x98},//-1 + {0x1d, 0x60, 0x03, 0x0c, 0x78, 0x84, 0x7d, 0x6b, 0x12, 0x01, 0x98},//0 + {0x1d, 0x60, 0x03, 0x0d, 0x84, 0x91, 0x8a, 0x76, 0x14, 0x01, 0x98},//+1 + {0x1d, 0x60, 0x03, 0x0e, 0x90, 0x9e, 0x96, 0x80, 0x16, 0x01, 0x98},//+2 + {0x1d, 0x60, 0x03, 0x10, 0x9c, 0xac, 0xa2, 0x8b, 0x17, 0x01, 0x98},//+3 + {0x1d, 0x60, 0x03, 0x11, 0xa8, 0xb9, 0xaf, 0x96, 0x19, 0x01, 0x98},//+4 +}; + +static const DRAM_ATTR uint8_t sensor_special_effects[7][4] = { + {0x06, 0x40, 0x2c, 0x08},//Normal + {0x46, 0x40, 0x28, 0x08},//Negative + {0x1e, 0x80, 0x80, 0x08},//Grayscale + {0x1e, 0x80, 0xc0, 0x08},//Red Tint + {0x1e, 0x60, 0x60, 0x08},//Green Tint + {0x1e, 0xa0, 0x40, 0x08},//Blue Tint + {0x1e, 0x40, 0xa0, 0x08},//Sepia +}; + +static const DRAM_ATTR uint16_t sensor_regs_gamma0[][2] = { + {0x5480, 0x01}, + {0x5481, 0x08}, + {0x5482, 0x14}, + {0x5483, 0x28}, + {0x5484, 0x51}, + {0x5485, 0x65}, + {0x5486, 0x71}, + {0x5487, 0x7d}, + {0x5488, 0x87}, + {0x5489, 0x91}, + {0x548a, 0x9a}, + {0x548b, 0xaa}, + {0x548c, 0xb8}, + {0x548d, 0xcd}, + {0x548e, 0xdd}, + {0x548f, 0xea}, + {0x5490, 0x1d} +}; + +static const DRAM_ATTR uint16_t sensor_regs_gamma1[][2] = { + {0x5480, 0x1}, + {0x5481, 0x0}, + {0x5482, 0x1e}, + {0x5483, 0x3b}, + {0x5484, 0x58}, + {0x5485, 0x66}, + {0x5486, 0x71}, + {0x5487, 0x7d}, + {0x5488, 0x83}, + {0x5489, 0x8f}, + {0x548a, 0x98}, + {0x548b, 0xa6}, + {0x548c, 0xb8}, + {0x548d, 0xca}, + {0x548e, 0xd7}, + {0x548f, 0xe3}, + {0x5490, 0x1d} +}; + +static const DRAM_ATTR uint16_t sensor_regs_awb0[][2] = { + {0x5180, 0xff}, + {0x5181, 0xf2}, + {0x5182, 0x00}, + {0x5183, 0x14}, + {0x5184, 0x25}, + {0x5185, 0x24}, + {0x5186, 0x09}, + {0x5187, 0x09}, + {0x5188, 0x09}, + {0x5189, 0x75}, + {0x518a, 0x54}, + {0x518b, 0xe0}, + {0x518c, 0xb2}, + {0x518d, 0x42}, + {0x518e, 0x3d}, + {0x518f, 0x56}, + {0x5190, 0x46}, + {0x5191, 0xf8}, + {0x5192, 0x04}, + {0x5193, 0x70}, + {0x5194, 0xf0}, + {0x5195, 0xf0}, + {0x5196, 0x03}, + {0x5197, 0x01}, + {0x5198, 0x04}, + {0x5199, 0x12}, + {0x519a, 0x04}, + {0x519b, 0x00}, + {0x519c, 0x06}, + {0x519d, 0x82}, + {0x519e, 0x38} +}; + +#endif diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/ov7670.h b/lib/libesp32_div/esp32-camera/sensors/private_include/ov7670.h new file mode 100644 index 000000000..b3a645a70 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/ov7670.h @@ -0,0 +1,33 @@ +/* + * This file is part of the OpenMV project. + * author: Juan Schiavoni + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * OV7670 driver. + * + */ +#ifndef __OV7670_H__ +#define __OV7670_H__ +#include "sensor.h" + +/** + * @brief Detect sensor pid + * + * @param slv_addr SCCB address + * @param id Detection result + * @return + * 0: Can't detect this sensor + * Nonzero: This sensor has been detected + */ +int ov7670_detect(int slv_addr, sensor_id_t *id); + +/** + * @brief initialize sensor function pointers + * + * @param sensor pointer of sensor + * @return + * Always 0 + */ +int ov7670_init(sensor_t *sensor); + +#endif // __OV7670_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/ov7670_regs.h b/lib/libesp32_div/esp32-camera/sensors/private_include/ov7670_regs.h new file mode 100644 index 000000000..699354877 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/ov7670_regs.h @@ -0,0 +1,354 @@ +/* + * This file is for the OpenMV project so the OV7670 can be used + * author: Juan Schiavoni + * + * OV7670 register definitions. + */ +#ifndef __OV7670_REG_REGS_H__ +#define __OV7670_REG_REGS_H__ +#define GAIN 0x00 /* AGC – Gain control gain setting */ +#define BLUE 0x01 /* AWB – Blue channel gain setting */ +#define RED 0x02 /* AWB – Red channel gain setting */ +#define VREF 0x03 /* AWB – Green channel gain setting */ +#define COM1 0x04 /* Common Control 1 */ +#define BAVG 0x05 /* U/B Average Level */ +#define GAVG 0x06 /* Y/Gb Average Level */ +#define AECH 0x07 /* Exposure VAlue - AEC MSB 5 bits */ +#define RAVG 0x08 /* V/R Average Level */ + +#define COM2 0x09 /* Common Control 2 */ +#define COM2_SOFT_SLEEP 0x10 /* Soft sleep mode */ +#define COM2_OUT_DRIVE_1x 0x00 /* Output drive capability 1x */ +#define COM2_OUT_DRIVE_2x 0x01 /* Output drive capability 2x */ +#define COM2_OUT_DRIVE_3x 0x02 /* Output drive capability 3x */ +#define COM2_OUT_DRIVE_4x 0x03 /* Output drive capability 4x */ + +#define REG_PID 0x0A /* Product ID Number MSB */ +#define REG_VER 0x0B /* Product ID Number LSB */ + +#define COM3 0x0C /* Common Control 3 */ +#define COM3_SWAP_OUT 0x40 /* Output data MSB/LSB swap */ +#define COM3_TRI_CLK 0x20 /* Tri-state output clock */ +#define COM3_TRI_DATA 0x10 /* Tri-state option output */ +#define COM3_SCALE_EN 0x08 /* Scale enable */ +#define COM3_DCW 0x04 /* DCW enable */ + +#define COM4 0x0D /* Common Control 4 */ +#define COM4_PLL_BYPASS 0x00 /* Bypass PLL */ +#define COM4_PLL_4x 0x40 /* PLL frequency 4x */ +#define COM4_PLL_6x 0x80 /* PLL frequency 6x */ +#define COM4_PLL_8x 0xc0 /* PLL frequency 8x */ +#define COM4_AEC_FULL 0x00 /* AEC evaluate full window */ +#define COM4_AEC_1_2 0x10 /* AEC evaluate 1/2 window */ +#define COM4_AEC_1_4 0x20 /* AEC evaluate 1/4 window */ +#define COM4_AEC_2_3 0x30 /* AEC evaluate 2/3 window */ + +#define COM5 0x0E /* Common Control 5 */ +#define COM5_AFR 0x80 /* Auto frame rate control ON/OFF selection (night mode) */ +#define COM5_AFR_SPEED 0x40 /* Auto frame rate control speed selection */ +#define COM5_AFR_0 0x00 /* No reduction of frame rate */ +#define COM5_AFR_1_2 0x10 /* Max reduction to 1/2 frame rate */ +#define COM5_AFR_1_4 0x20 /* Max reduction to 1/4 frame rate */ +#define COM5_AFR_1_8 0x30 /* Max reduction to 1/8 frame rate */ +#define COM5_AFR_4x 0x04 /* Add frame when AGC reaches 4x gain */ +#define COM5_AFR_8x 0x08 /* Add frame when AGC reaches 8x gain */ +#define COM5_AFR_16x 0x0c /* Add frame when AGC reaches 16x gain */ +#define COM5_AEC_NO_LIMIT 0x01 /* No limit to AEC increase step */ + +#define COM6 0x0F /* Common Control 6 */ +#define COM6_AUTO_WINDOW 0x01 /* Auto window setting ON/OFF selection when format changes */ + +#define AEC 0x10 /* AEC[7:0] (see register AECH for AEC[15:8]) */ +#define CLKRC 0x11 /* Internal Clock */ + +#define COM7 0x12 /* Common Control 7 */ +#define COM7_RESET 0x80 /* SCCB Register Reset */ +#define COM7_RES_VGA 0x00 /* Resolution VGA */ +#define COM7_RES_QVGA 0x40 /* Resolution QVGA */ +#define COM7_BT656 0x20 /* BT.656 protocol ON/OFF */ +#define COM7_SENSOR_RAW 0x10 /* Sensor RAW */ +#define COM7_FMT_GBR422 0x00 /* RGB output format GBR422 */ +#define COM7_FMT_RGB565 0x04 /* RGB output format RGB565 */ +#define COM7_FMT_RGB555 0x08 /* RGB output format RGB555 */ +#define COM7_FMT_RGB444 0x0C /* RGB output format RGB444 */ +#define COM7_FMT_YUV 0x00 /* Output format YUV */ +#define COM7_FMT_P_BAYER 0x01 /* Output format Processed Bayer RAW */ +#define COM7_FMT_RGB 0x04 /* Output format RGB */ +#define COM7_FMT_R_BAYER 0x03 /* Output format Bayer RAW */ +#define COM7_SET_FMT(r, x) ((r&0xFC)|((x&0x5)<<0)) + +#define COM8 0x13 /* Common Control 8 */ +#define COM8_FAST_AUTO 0x80 /* Enable fast AGC/AEC algorithm */ +#define COM8_STEP_VSYNC 0x00 /* AEC - Step size limited to vertical blank */ +#define COM8_STEP_UNLIMIT 0x40 /* AEC - Step size unlimited step size */ +#define COM8_BANDF_EN 0x20 /* Banding filter ON/OFF */ +#define COM8_AEC_BANDF 0x10 /* Enable AEC below banding value */ +#define COM8_AEC_FINE_EN 0x08 /* Fine AEC ON/OFF control */ +#define COM8_AGC_EN 0x04 /* AGC Enable */ +#define COM8_AWB_EN 0x02 /* AWB Enable */ +#define COM8_AEC_EN 0x01 /* AEC Enable */ +#define COM8_SET_AGC(r, x) ((r&0xFB)|((x&0x1)<<2)) +#define COM8_SET_AWB(r, x) ((r&0xFD)|((x&0x1)<<1)) +#define COM8_SET_AEC(r, x) ((r&0xFE)|((x&0x1)<<0)) + +#define COM9 0x14 /* Common Control 9 */ +#define COM9_HISTO_AVG 0x80 /* Histogram or average based AEC/AGC selection */ +#define COM9_AGC_GAIN_2x 0x00 /* Automatic Gain Ceiling 2x */ +#define COM9_AGC_GAIN_4x 0x10 /* Automatic Gain Ceiling 4x */ +#define COM9_AGC_GAIN_8x 0x20 /* Automatic Gain Ceiling 8x */ +#define COM9_AGC_GAIN_16x 0x30 /* Automatic Gain Ceiling 16x */ +#define COM9_AGC_GAIN_32x 0x40 /* Automatic Gain Ceiling 32x */ +#define COM9_DROP_VSYNC 0x04 /* Drop VSYNC output of corrupt frame */ +#define COM9_DROP_HREF 0x02 /* Drop HREF output of corrupt frame */ +#define COM9_SET_AGC(r, x) ((r&0x8F)|((x&0x07)<<4)) + +#define COM10 0x15 /* Common Control 10 */ +#define COM10_NEGATIVE 0x80 /* Output negative data */ +#define COM10_HSYNC_EN 0x40 /* HREF changes to HSYNC */ +#define COM10_PCLK_FREE 0x00 /* PCLK output option: free running PCLK */ +#define COM10_PCLK_MASK 0x20 /* PCLK output option: masked during horizontal blank */ +#define COM10_PCLK_REV 0x10 /* PCLK reverse */ +#define COM10_HREF_REV 0x08 /* HREF reverse */ +#define COM10_VSYNC_FALLING 0x00 /* VSYNC changes on falling edge of PCLK */ +#define COM10_VSYNC_RISING 0x04 /* VSYNC changes on rising edge of PCLK */ +#define COM10_VSYNC_NEG 0x02 /* VSYNC negative */ +#define COM10_OUT_RANGE_8 0x01 /* Output data range: Full range */ +#define COM10_OUT_RANGE_10 0x00 /* Output data range: Data from [10] to [F0] (8 MSBs) */ + +#define RSVD_16 0x16 /* Reserved register */ + +#define HSTART 0x17 /* Horizontal Frame (HREF column) Start high 8-bit(low 3 bits are at HREF[2:0]) */ +#define HSTOP 0x18 /* Horizontal Frame (HREF column) end high 8-bit (low 3 bits are at HREF[5:3]) */ +#define VSTART 0x19 /* Vertical Frame (row) Start high 8-bit (low 2 bits are at VREF[1:0]) */ +#define VSTOP 0x1A /* Vertical Frame (row) End high 8-bit (low 2 bits are at VREF[3:2]) */ +#define PSHFT 0x1B /* Data Format - Pixel Delay Select */ +#define REG_MIDH 0x1C /* Manufacturer ID Byte – High */ +#define REG_MIDL 0x1D /* Manufacturer ID Byte – Low */ + +#define MVFP 0x1E /* Mirror/Vflip Enable */ +#define MVFP_MIRROR 0x20 /* Mirror image */ +#define MVFP_FLIP 0x10 /* Vertical flip */ +#define MVFP_SUN 0x02 /* Black sun enable */ +#define MVFP_SET_MIRROR(r,x) ((r&0xDF)|((x&1)<<5)) /* change only bit5 according to x */ +#define MVFP_SET_FLIP(r,x) ((r&0xEF)|((x&1)<<4)) /* change only bit4 according to x */ + +#define LAEC 0x1F /* Fine AEC Value - defines exposure value less than one row period (Reserved?) */ +#define ADCCTR0 0x20 /* ADC control */ +#define ADCCTR1 0x21 /* reserved */ +#define ADCCTR2 0x22 /* reserved */ +#define ADCCTR3 0x23 /* reserved */ +#define AEW 0x24 /* AGC/AEC - Stable Operating Region (Upper Limit) */ +#define AEB 0x25 /* AGC/AEC - Stable Operating Region (Lower Limit) */ +#define VPT 0x26 /* AGC/AEC Fast Mode Operating Region */ +#define BBIAS 0x27 /* B channel signal output bias (effective only when COM6[3]=1) */ +#define GbBIAS 0x28 /* Gb channel signal output bias (effective only when COM6[3]=1) */ +#define RSVD_29 0x29 /* reserved */ +#define EXHCH 0x2A /* Dummy Pixel Insert MSB */ +#define EXHCL 0x2B /* Dummy Pixel Insert LSB */ +#define RBIAS 0x2C /* R channel signal output bias (effective only when COM6[3]=1) */ +#define ADVFL 0x2D /* LSB of Insert Dummy Rows in Vertical Sync (1 bit equals 1 row) */ +#define ADVFH 0x2E /* MSB of Insert Dummy Rows in Vertical Sync */ +#define YAVE 0x2F /* Y/G Channel Average Value */ +#define HSYST 0x30 /* HSync rising edge delay */ +#define HSYEN 0x31 /* HSync falling edge delay */ +#define HREF 0x32 /* Image Start and Size Control DIFFERENT CONTROL SEQUENCE */ +#define CHLF 0x33 /* Array Current control */ +#define ARBLM 0x34 /* Array reference control */ +#define RSVD_35 0x35 /* Reserved */ +#define RSVD_36 0x36 /* Reserved */ +#define ADC 0x37 /* ADC control */ +#define ACOM 0x38 /* ADC and analog common mode control */ +#define OFON 0x39 /* ADC offset control */ +#define TSLB 0x3A /* Line buffer test option */ + +#define COM11 0x3B /* Common control 11 */ +#define COM11_EXP 0x02 +#define COM11_HZAUTO 0x10 /* Auto detect 50/60 Hz */ + +#define COM12 0x3C /* Common control 12 */ + +#define COM13 0x3D /* Common control 13 */ +#define COM13_GAMMA 0x80 /* Gamma enable */ +#define COM13_UVSAT 0x40 /* UV saturation auto adjustment */ + +#define COM14 0x3E /* Common Control 14 */ + +#define EDGE 0x3F /* edge enhancement adjustment */ +#define COM15 0x40 /* Common Control 15 DIFFERENT CONTROLS */ +#define COM15_SET_RGB565(r,x) ((r&0xEF)|((x&1)<<4)) /* set rgb565 mode */ +#define COM15_RGB565 0x10 /* RGB565 output */ +#define COM15_R00FF 0xC0 /* Output range: [00] to [FF] */ + +#define COM16 0x41 /* Common Control 16 DIFFERENT CONTROLS */ +#define COM16_AWBGAIN 0x08 /* AWB gain enable */ +#define COM17 0x42 /* Common Control 17 */ + +#define AWBC1 0x43 /* Reserved */ +#define AWBC2 0x44 /* Reserved */ +#define AWBC3 0x45 /* Reserved */ +#define AWBC4 0x46 /* Reserved */ +#define AWBC5 0x47 /* Reserved */ +#define AWBC6 0x48 /* Reserved */ + +#define RSVD_49 0x49 /* Reserved */ +#define RSVD_4A 0x4A /* Reserved */ + +#define REG4B 0x4B /* Register 4B */ +#define DNSTH 0x4C /* Denoise strength */ + +#define RSVD_4D 0x4D /* Reserved */ +#define RSVD_4E 0x4E /* Reserved */ + +#define MTX1 0x4F /* Matrix coefficient 1 */ +#define MTX2 0x50 /* Matrix coefficient 2 */ +#define MTX3 0x51 /* Matrix coefficient 3 */ +#define MTX4 0x52 /* Matrix coefficient 4 */ +#define MTX5 0x53 /* Matrix coefficient 5 */ +#define MTX6 0x54 /* Matrix coefficient 6 */ +#define BRIGHTNESS 0x55 /* Brightness control */ +#define CONTRAST 0x56 /* Contrast control */ +#define CONTRASCENTER 0x57 /* Contrast center */ +#define MTXS 0x58 /* Matrix coefficient sign for coefficient 5 to 0*/ + +#define RSVD_59 0x59 /* Reserved */ +#define RSVD_5A 0x5A /* Reserved */ +#define RSVD_5B 0x5B /* Reserved */ +#define RSVD_5C 0x5C /* Reserved */ +#define RSVD_5D 0x5D /* Reserved */ +#define RSVD_5E 0x5E /* Reserved */ +#define RSVD_5F 0x5F /* Reserved */ +#define RSVD_60 0x60 /* Reserved */ +#define RSVD_61 0x61 /* Reserved */ + +#define LCC1 0x62 /* Lens correction option 1 */ + +#define LCC2 0x63 /* Lens correction option 2 */ +#define LCC3 0x64 /* Lens correction option 3 */ +#define LCC4 0x65 /* Lens correction option 4 */ +#define LCC5 0x66 /* Lens correction option 5 */ + +#define MANU 0x67 /* Manual U Value */ +#define MANV 0x68 /* Manual V Value */ +#define GFIX 0x69 /* Fix gain control */ +#define GGAIN 0x6A /* G channel AWB gain */ + +#define DBLV 0x6B /* PLL and clock ? */ + +#define AWBCTR3 0x6C /* AWB Control 3 */ +#define AWBCTR2 0x6D /* AWB Control 2 */ +#define AWBCTR1 0x6E /* AWB Control 1 */ +#define AWBCTR0 0x6F /* AWB Control 0 */ +#define SCALING_XSC 0x70 /* test pattern and horizontal scaling factor */ +#define SCALING_XSC_CBAR(r) (r&0x7F) /* make sure bit7 is 0 for color bar */ +#define SCALING_YSC 0x71 /* test pattern and vertical scaling factor */ +#define SCALING_YSC_CBAR(r,x) ((r&0x7F)|((x&1)<<7)) /* change bit7 for color bar on/off */ +#define SCALING_DCWCTR 0x72 /* DCW control */ +#define SCALING_PCLK_DIV 0x73 /* */ +#define REG74 0x74 /* */ +#define REG75 0x75 /* */ +#define REG76 0x76 /* */ +#define REG77 0x77 /* */ + +#define RSVD_78 0x78 /* Reserved */ +#define RSVD_79 0x79 /* Reserved */ + +#define SLOP 0x7A /* Gamma curve highest segment slope */ +#define GAM1 0x7B /* Gamma Curve 1st Segment Input End Point 0x04 Output Value */ +#define GAM2 0x7C /* Gamma Curve 2nd Segment Input End Point 0x08 Output Value */ +#define GAM3 0x7D /* Gamma Curve 3rd Segment Input End Point 0x10 Output Value */ +#define GAM4 0x7E /* Gamma Curve 4th Segment Input End Point 0x20 Output Value */ +#define GAM5 0x7F /* Gamma Curve 5th Segment Input End Point 0x28 Output Value */ +#define GAM6 0x80 /* Gamma Curve 6rd Segment Input End Point 0x30 Output Value */ +#define GAM7 0x81 /* Gamma Curve 7th Segment Input End Point 0x38 Output Value */ +#define GAM8 0x82 /* Gamma Curve 8th Segment Input End Point 0x40 Output Value */ +#define GAM9 0x83 /* Gamma Curve 9th Segment Input End Point 0x48 Output Value */ +#define GAM10 0x84 /* Gamma Curve 10th Segment Input End Point 0x50 Output Value */ +#define GAM11 0x85 /* Gamma Curve 11th Segment Input End Point 0x60 Output Value */ +#define GAM12 0x86 /* Gamma Curve 12th Segment Input End Point 0x70 Output Value */ +#define GAM13 0x87 /* Gamma Curve 13th Segment Input End Point 0x90 Output Value */ +#define GAM14 0x88 /* Gamma Curve 14th Segment Input End Point 0xB0 Output Value */ +#define GAM15 0x89 /* Gamma Curve 15th Segment Input End Point 0xD0 Output Value */ + +#define RSVD_8A 0x8A /* Reserved */ +#define RSVD_8B 0x8B /* Reserved */ + +#define RGB444 0x8C /* */ + +#define RSVD_8D 0x8D /* Reserved */ +#define RSVD_8E 0x8E /* Reserved */ +#define RSVD_8F 0x8F /* Reserved */ +#define RSVD_90 0x90 /* Reserved */ +#define RSVD_91 0x91 /* Reserved */ + +#define DM_LNL 0x92 /* Dummy line low 8 bit */ +#define DM_LNH 0x93 /* Dummy line high 8 bit */ +#define LCC6 0x94 /* Lens correction option 6 */ +#define LCC7 0x95 /* Lens correction option 7 */ + +#define RSVD_96 0x96 /* Reserved */ +#define RSVD_97 0x97 /* Reserved */ +#define RSVD_98 0x98 /* Reserved */ +#define RSVD_99 0x99 /* Reserved */ +#define RSVD_9A 0x9A /* Reserved */ +#define RSVD_9B 0x9B /* Reserved */ +#define RSVD_9C 0x9C /* Reserved */ + +#define BD50ST 0x9D /* 50 Hz banding filter value */ +#define BD60ST 0x9E /* 60 Hz banding filter value */ +#define HAECC1 0x9F /* Histogram-based AEC/AGC control 1 */ +#define HAECC2 0xA0 /* Histogram-based AEC/AGC control 2 */ + +#define RSVD_A1 0xA1 /* Reserved */ + +#define SCALING_PCLK_DELAY 0xA2 /* Pixel clock delay */ + +#define RSVD_A3 0xA3 /* Reserved */ + +#define NT_CNTRL 0xA4 /* */ +#define BD50MAX 0xA5 /* 50 Hz banding step limit */ +#define HAECC3 0xA6 /* Histogram-based AEC/AGC control 3 */ +#define HAECC4 0xA7 /* Histogram-based AEC/AGC control 4 */ +#define HAECC5 0xA8 /* Histogram-based AEC/AGC control 5 */ +#define HAECC6 0xA9 /* Histogram-based AEC/AGC control 6 */ + +#define HAECC7 0xAA /* Histogram-based AEC/AGC control 7 */ +#define HAECC_EN 0x80 /* Histogram-based AEC algorithm enable */ + +#define BD60MAX 0xAB /* 60 Hz banding step limit */ + +#define STR_OPT 0xAC /* Register AC */ +#define STR_R 0xAD /* R gain for led output frame */ +#define STR_G 0xAE /* G gain for led output frame */ +#define STR_B 0xAF /* B gain for led output frame */ +#define RSVD_B0 0xB0 /* Reserved */ +#define ABLC1 0xB1 /* */ +#define RSVD_B2 0xB2 /* Reserved */ +#define THL_ST 0xB3 /* ABLC target */ +#define THL_DLT 0xB5 /* ABLC stable range */ + +#define RSVD_B6 0xB6 /* Reserved */ +#define RSVD_B7 0xB7 /* Reserved */ +#define RSVD_B8 0xB8 /* Reserved */ +#define RSVD_B9 0xB9 /* Reserved */ +#define RSVD_BA 0xBA /* Reserved */ +#define RSVD_BB 0xBB /* Reserved */ +#define RSVD_BC 0xBC /* Reserved */ +#define RSVD_BD 0xBD /* Reserved */ + +#define AD_CHB 0xBE /* blue channel black level compensation */ +#define AD_CHR 0xBF /* Red channel black level compensation */ +#define AD_CHGb 0xC0 /* Gb channel black level compensation */ +#define AD_CHGr 0xC1 /* Gr channel black level compensation */ + +#define RSVD_C2 0xC2 /* Reserved */ +#define RSVD_C3 0xC3 /* Reserved */ +#define RSVD_C4 0xC4 /* Reserved */ +#define RSVD_C5 0xC5 /* Reserved */ +#define RSVD_C6 0xC6 /* Reserved */ +#define RSVD_C7 0xC7 /* Reserved */ +#define RSVD_C8 0xC8 /* Reserved */ + +#define SATCTR 0xC9 /* Saturation control */ +#define SET_REG(reg, x) (##reg_DEFAULT|x) + +#endif //__OV7670_REG_REGS_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/ov7725.h b/lib/libesp32_div/esp32-camera/sensors/private_include/ov7725.h new file mode 100644 index 000000000..291b26680 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/ov7725.h @@ -0,0 +1,33 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * OV7725 driver. + * + */ +#ifndef __OV7725_H__ +#define __OV7725_H__ +#include "sensor.h" + +/** + * @brief Detect sensor pid + * + * @param slv_addr SCCB address + * @param id Detection result + * @return + * 0: Can't detect this sensor + * Nonzero: This sensor has been detected + */ +int ov7725_detect(int slv_addr, sensor_id_t *id); + +/** + * @brief initialize sensor function pointers + * + * @param sensor pointer of sensor + * @return + * Always 0 + */ +int ov7725_init(sensor_t *sensor); + +#endif // __OV7725_H__ diff --git a/lib/libesp32_div/esp32-camera/sensors/private_include/ov7725_regs.h b/lib/libesp32_div/esp32-camera/sensors/private_include/ov7725_regs.h new file mode 100644 index 000000000..5cb233dc9 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/sensors/private_include/ov7725_regs.h @@ -0,0 +1,335 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * OV2640 register definitions. + */ +#ifndef __REG_REGS_H__ +#define __REG_REGS_H__ +#define GAIN 0x00 /* AGC – Gain control gain setting */ +#define BLUE 0x01 /* AWB – Blue channel gain setting */ +#define RED 0x02 /* AWB – Red channel gain setting */ +#define GREEN 0x03 /* AWB – Green channel gain setting */ +#define BAVG 0x05 /* U/B Average Level */ +#define GAVG 0x06 /* Y/Gb Average Level */ +#define RAVG 0x07 /* V/R Average Level */ +#define AECH 0x08 /* Exposure Value – AEC MSBs */ + +#define COM2 0x09 /* Common Control 2 */ +#define COM2_SOFT_SLEEP 0x10 /* Soft sleep mode */ +#define COM2_OUT_DRIVE_1x 0x00 /* Output drive capability 1x */ +#define COM2_OUT_DRIVE_2x 0x01 /* Output drive capability 2x */ +#define COM2_OUT_DRIVE_3x 0x02 /* Output drive capability 3x */ +#define COM2_OUT_DRIVE_4x 0x03 /* Output drive capability 4x */ + +#define REG_PID 0x0A /* Product ID Number MSB */ +#define REG_VER 0x0B /* Product ID Number LSB */ + +#define COM3 0x0C /* Common Control 3 */ +#define COM3_VFLIP 0x80 /* Vertical flip image ON/OFF selection */ +#define COM3_MIRROR 0x40 /* Horizontal mirror image ON/OFF selection */ +#define COM3_SWAP_BR 0x20 /* Swap B/R output sequence in RGB output mode */ +#define COM3_SWAP_YUV 0x10 /* Swap Y/UV output sequence in YUV output mode */ +#define COM3_SWAP_MSB 0x08 /* Swap output MSB/LSB */ +#define COM3_TRI_CLOCK 0x04 /* Tri-state option for output clock at power-down period */ +#define COM3_TRI_DATA 0x02 /* Tri-state option for output data at power-down period */ +#define COM3_COLOR_BAR 0x01 /* Sensor color bar test pattern output enable */ +#define COM3_SET_CBAR(r, x) ((r&0xFE)|((x&1)<<0)) +#define COM3_SET_MIRROR(r, x) ((r&0xBF)|((x&1)<<6)) +#define COM3_SET_FLIP(r, x) ((r&0x7F)|((x&1)<<7)) + +#define COM4 0x0D /* Common Control 4 */ +#define COM4_PLL_BYPASS 0x00 /* Bypass PLL */ +#define COM4_PLL_4x 0x40 /* PLL frequency 4x */ +#define COM4_PLL_6x 0x80 /* PLL frequency 6x */ +#define COM4_PLL_8x 0xc0 /* PLL frequency 8x */ +#define COM4_AEC_FULL 0x00 /* AEC evaluate full window */ +#define COM4_AEC_1_2 0x10 /* AEC evaluate 1/2 window */ +#define COM4_AEC_1_4 0x20 /* AEC evaluate 1/4 window */ +#define COM4_AEC_2_3 0x30 /* AEC evaluate 2/3 window */ + +#define COM5 0x0E /* Common Control 5 */ +#define COM5_AFR 0x80 /* Auto frame rate control ON/OFF selection (night mode) */ +#define COM5_AFR_SPEED 0x40 /* Auto frame rate control speed selection */ +#define COM5_AFR_0 0x00 /* No reduction of frame rate */ +#define COM5_AFR_1_2 0x10 /* Max reduction to 1/2 frame rate */ +#define COM5_AFR_1_4 0x20 /* Max reduction to 1/4 frame rate */ +#define COM5_AFR_1_8 0x30 /* Max reduction to 1/8 frame rate */ +#define COM5_AFR_4x 0x04 /* Add frame when AGC reaches 4x gain */ +#define COM5_AFR_8x 0x08 /* Add frame when AGC reaches 8x gain */ +#define COM5_AFR_16x 0x0c /* Add frame when AGC reaches 16x gain */ +#define COM5_AEC_NO_LIMIT 0x01 /* No limit to AEC increase step */ + +#define COM6 0x0F /* Common Control 6 */ +#define COM6_AUTO_WINDOW 0x01 /* Auto window setting ON/OFF selection when format changes */ + +#define AEC 0x10 /* AEC[7:0] (see register AECH for AEC[15:8]) */ +#define CLKRC 0x11 /* Internal Clock */ + +#define COM7 0x12 /* Common Control 7 */ +#define COM7_RESET 0x80 /* SCCB Register Reset */ +#define COM7_RES_VGA 0x00 /* Resolution VGA */ +#define COM7_RES_QVGA 0x40 /* Resolution QVGA */ +#define COM7_BT656 0x20 /* BT.656 protocol ON/OFF */ +#define COM7_SENSOR_RAW 0x10 /* Sensor RAW */ +#define COM7_FMT_GBR422 0x00 /* RGB output format GBR422 */ +#define COM7_FMT_RGB565 0x04 /* RGB output format RGB565 */ +#define COM7_FMT_RGB555 0x08 /* RGB output format RGB555 */ +#define COM7_FMT_RGB444 0x0C /* RGB output format RGB444 */ +#define COM7_FMT_YUV 0x00 /* Output format YUV */ +#define COM7_FMT_P_BAYER 0x01 /* Output format Processed Bayer RAW */ +#define COM7_FMT_RGB 0x02 /* Output format RGB */ +#define COM7_FMT_R_BAYER 0x03 /* Output format Bayer RAW */ +#define COM7_SET_FMT(r, x) ((r&0xFC)|((x&0x3)<<0)) +#define COM7_SET_RGB(r, x) ((r&0xF0)|(x&0x0C)|COM7_FMT_RGB) + +#define COM8 0x13 /* Common Control 8 */ +#define COM8_FAST_AUTO 0x80 /* Enable fast AGC/AEC algorithm */ +#define COM8_STEP_VSYNC 0x00 /* AEC - Step size limited to vertical blank */ +#define COM8_STEP_UNLIMIT 0x40 /* AEC - Step size unlimited step size */ +#define COM8_BANDF_EN 0x20 /* Banding filter ON/OFF */ +#define COM8_AEC_BANDF 0x10 /* Enable AEC below banding value */ +#define COM8_AEC_FINE_EN 0x08 /* Fine AEC ON/OFF control */ +#define COM8_AGC_EN 0x04 /* AGC Enable */ +#define COM8_AWB_EN 0x02 /* AWB Enable */ +#define COM8_AEC_EN 0x01 /* AEC Enable */ +#define COM8_SET_AGC(r, x) ((r&0xFB)|((x&0x1)<<2)) +#define COM8_SET_AWB(r, x) ((r&0xFD)|((x&0x1)<<1)) +#define COM8_SET_AEC(r, x) ((r&0xFE)|((x&0x1)<<0)) + +#define COM9 0x14 /* Common Control 9 */ +#define COM9_HISTO_AVG 0x80 /* Histogram or average based AEC/AGC selection */ +#define COM9_AGC_GAIN_2x 0x00 /* Automatic Gain Ceiling 2x */ +#define COM9_AGC_GAIN_4x 0x10 /* Automatic Gain Ceiling 4x */ +#define COM9_AGC_GAIN_8x 0x20 /* Automatic Gain Ceiling 8x */ +#define COM9_AGC_GAIN_16x 0x30 /* Automatic Gain Ceiling 16x */ +#define COM9_AGC_GAIN_32x 0x40 /* Automatic Gain Ceiling 32x */ +#define COM9_DROP_VSYNC 0x04 /* Drop VSYNC output of corrupt frame */ +#define COM9_DROP_HREF 0x02 /* Drop HREF output of corrupt frame */ +#define COM9_SET_AGC(r, x) ((r&0x8F)|((x&0x07)<<4)) + +#define COM10 0x15 /* Common Control 10 */ +#define COM10_NEGATIVE 0x80 /* Output negative data */ +#define COM10_HSYNC_EN 0x40 /* HREF changes to HSYNC */ +#define COM10_PCLK_FREE 0x00 /* PCLK output option: free running PCLK */ +#define COM10_PCLK_MASK 0x20 /* PCLK output option: masked during horizontal blank */ +#define COM10_PCLK_REV 0x10 /* PCLK reverse */ +#define COM10_HREF_REV 0x08 /* HREF reverse */ +#define COM10_VSYNC_FALLING 0x00 /* VSYNC changes on falling edge of PCLK */ +#define COM10_VSYNC_RISING 0x04 /* VSYNC changes on rising edge of PCLK */ +#define COM10_VSYNC_NEG 0x02 /* VSYNC negative */ +#define COM10_OUT_RANGE_8 0x01 /* Output data range: Full range */ +#define COM10_OUT_RANGE_10 0x00 /* Output data range: Data from [10] to [F0] (8 MSBs) */ + +#define REG16 0x16 /* Register 16 */ +#define REG16_BIT_SHIFT 0x80 /* Bit shift test pattern options */ +#define HSTART 0x17 /* Horizontal Frame (HREF column) Start 8 MSBs (2 LSBs are at HREF[5:4]) */ +#define HSIZE 0x18 /* Horizontal Sensor Size (2 LSBs are at HREF[1:0]) */ +#define VSTART 0x19 /* Vertical Frame (row) Start 8 MSBs (1 LSB is at HREF[6]) */ +#define VSIZE 0x1A /* Vertical Sensor Size (1 LSB is at HREF[2]) */ +#define PSHFT 0x1B /* Data Format - Pixel Delay Select */ +#define REG_MIDH 0x1C /* Manufacturer ID Byte – High */ +#define REG_MIDL 0x1D /* Manufacturer ID Byte – Low */ +#define LAEC 0x1F /* Fine AEC Value - defines exposure value less than one row period */ + +#define COM11 0x20 /* Common Control 11 */ +#define COM11_SNGL_FRAME_EN 0x02 /* Single frame ON/OFF selection */ +#define COM11_SNGL_XFR_TRIG 0x01 /* Single frame transfer trigger */ + +#define BDBASE 0x22 /* Banding Filter Minimum AEC Value */ +#define DBSTEP 0x23 /* Banding Filter Maximum Step */ +#define AEW 0x24 /* AGC/AEC - Stable Operating Region (Upper Limit) */ +#define AEB 0x25 /* AGC/AEC - Stable Operating Region (Lower Limit) */ +#define VPT 0x26 /* AGC/AEC Fast Mode Operating Region */ +#define REG28 0x28 /* Selection on the number of dummy rows, N */ +#define HOUTSIZE 0x29 /* Horizontal Data Output Size MSBs (2 LSBs at register EXHCH[1:0]) */ +#define EXHCH 0x2A /* Dummy Pixel Insert MSB */ +#define EXHCL 0x2B /* Dummy Pixel Insert LSB */ +#define VOUTSIZE 0x2C /* Vertical Data Output Size MSBs (LSB at register EXHCH[2]) */ +#define ADVFL 0x2D /* LSB of Insert Dummy Rows in Vertical Sync (1 bit equals 1 row) */ +#define ADVFH 0x2E /* MSB of Insert Dummy Rows in Vertical Sync */ +#define YAVE 0x2F /* Y/G Channel Average Value */ +#define LUMHTH 0x30 /* Histogram AEC/AGC Luminance High Level Threshold */ +#define LUMLTH 0x31 /* Histogram AEC/AGC Luminance Low Level Threshold */ +#define HREF 0x32 /* Image Start and Size Control */ +#define DM_LNL 0x33 /* Dummy Row Low 8 Bits */ +#define DM_LNH 0x34 /* Dummy Row High 8 Bits */ +#define ADOFF_B 0x35 /* AD Offset Compensation Value for B Channel */ +#define ADOFF_R 0x36 /* AD Offset Compensation Value for R Channel */ +#define ADOFF_GB 0x37 /* AD Offset Compensation Value for GB Channel */ +#define ADOFF_GR 0x38 /* AD Offset Compensation Value for GR Channel */ +#define OFF_B 0x39 /* AD Offset Compensation Value for B Channel */ +#define OFF_R 0x3A /* AD Offset Compensation Value for R Channel */ +#define OFF_GB 0x3B /* AD Offset Compensation Value for GB Channel */ +#define OFF_GR 0x3C /* AD Offset Compensation Value for GR Channel */ +#define COM12 0x3D /* DC offset compensation for analog process */ + +#define COM13 0x3E /* Common Control 13 */ +#define COM13_BLC_EN 0x80 /* BLC enable */ +#define COM13_ADC_EN 0x40 /* ADC channel BLC ON/OFF control */ +#define COM13_ANALOG_BLC 0x20 /* Analog processing channel BLC ON/OFF control */ +#define COM13_ABLC_GAIN_EN 0x04 /* ABLC gain trigger enable */ + +#define COM14 0x3F /* Common Control 14 */ +#define COM15 0x40 /* Common Control 15 */ +#define COM16 0x41 /* Common Control 16 */ +#define TGT_B 0x42 /* BLC Blue Channel Target Value */ +#define TGT_R 0x43 /* BLC Red Channel Target Value */ +#define TGT_GB 0x44 /* BLC Gb Channel Target Value */ +#define TGT_GR 0x45 /* BLC Gr Channel Target Value */ + +#define LC_CTR 0x46 /* Lens Correction Control */ +#define LC_CTR_RGB_COMP_1 0x00 /* R, G, and B channel compensation coefficient is set by LC_COEF (0x49) */ +#define LC_CTR_RGB_COMP_3 0x04 /* R, G, and B channel compensation coefficient is set by registers + LC_COEFB (0x4B), LC_COEF (0x49), and LC_COEFR (0x4C), respectively */ +#define LC_CTR_EN 0x01 /* Lens correction enable */ +#define LC_XC 0x47 /* X Coordinate of Lens Correction Center Relative to Array Center */ +#define LC_YC 0x48 /* Y Coordinate of Lens Correction Center Relative to Array Center */ +#define LC_COEF 0x49 /* Lens Correction Coefficient */ +#define LC_RADI 0x4A /* Lens Correction Radius */ +#define LC_COEFB 0x4B /* Lens Correction B Channel Compensation Coefficient */ +#define LC_COEFR 0x4C /* Lens Correction R Channel Compensation Coefficient */ + +#define FIXGAIN 0x4D /* Analog Fix Gain Amplifier */ +#define AREF0 0x4E /* Sensor Reference Control */ +#define AREF1 0x4F /* Sensor Reference Current Control */ +#define AREF2 0x50 /* Analog Reference Control */ +#define AREF3 0x51 /* ADC Reference Control */ +#define AREF4 0x52 /* ADC Reference Control */ +#define AREF5 0x53 /* ADC Reference Control */ +#define AREF6 0x54 /* Analog Reference Control */ +#define AREF7 0x55 /* Analog Reference Control */ +#define UFIX 0x60 /* U Channel Fixed Value Output */ +#define VFIX 0x61 /* V Channel Fixed Value Output */ +#define AWBB_BLK 0x62 /* AWB Option for Advanced AWB */ + +#define AWB_CTRL0 0x63 /* AWB Control Byte 0 */ +#define AWB_CTRL0_GAIN_EN 0x80 /* AWB gain enable */ +#define AWB_CTRL0_CALC_EN 0x40 /* AWB calculate enable */ +#define AWB_CTRL0_WBC_MASK 0x0F /* WBC threshold 2 */ + +#define DSP_CTRL1 0x64 /* DSP Control Byte 1 */ +#define DSP_CTRL1_FIFO_EN 0x80 /* FIFO enable/disable selection */ +#define DSP_CTRL1_UV_EN 0x40 /* UV adjust function ON/OFF selection */ +#define DSP_CTRL1_SDE_EN 0x20 /* SDE enable */ +#define DSP_CTRL1_MTRX_EN 0x10 /* Color matrix ON/OFF selection */ +#define DSP_CTRL1_INTRP_EN 0x08 /* Interpolation ON/OFF selection */ +#define DSP_CTRL1_GAMMA_EN 0x04 /* Gamma function ON/OFF selection */ +#define DSP_CTRL1_BLACK_EN 0x02 /* Black defect auto correction ON/OFF */ +#define DSP_CTRL1_WHITE_EN 0x01 /* White defect auto correction ON/OFF */ + +#define DSP_CTRL2 0x65 /* DSP Control Byte 2 */ +#define DSP_CTRL2_VDCW_EN 0x08 /* Vertical DCW enable */ +#define DSP_CTRL2_HDCW_EN 0x04 /* Horizontal DCW enable */ +#define DSP_CTRL2_VZOOM_EN 0x02 /* Vertical zoom out enable */ +#define DSP_CTRL2_HZOOM_EN 0x01 /* Horizontal zoom out enable */ + +#define DSP_CTRL3 0x66 /* DSP Control Byte 3 */ +#define DSP_CTRL3_UV_EN 0x80 /* UV output sequence option */ +#define DSP_CTRL3_CBAR_EN 0x20 /* DSP color bar ON/OFF selection */ +#define DSP_CTRL3_FIFO_EN 0x08 /* FIFO power down ON/OFF selection */ +#define DSP_CTRL3_SCAL1_PWDN 0x04 /* Scaling module power down control 1 */ +#define DSP_CTRL3_SCAL2_PWDN 0x02 /* Scaling module power down control 2 */ +#define DSP_CTRL3_INTRP_PWDN 0x01 /* Interpolation module power down control */ +#define DSP_CTRL3_SET_CBAR(r, x) ((r&0xDF)|((x&1)<<5)) + + +#define DSP_CTRL4 0x67 /* DSP Control Byte 4 */ +#define DSP_CTRL4_YUV_RGB 0x00 /* Output selection YUV or RGB */ +#define DSP_CTRL4_RAW8 0x02 /* Output selection RAW8 */ +#define DSP_CTRL4_RAW10 0x03 /* Output selection RAW10 */ + + +#define AWB_BIAS 0x68 /* AWB BLC Level Clip */ +#define AWB_CTRL1 0x69 /* AWB Control 1 */ +#define AWB_CTRL2 0x6A /* AWB Control 2 */ + +#define AWB_CTRL3 0x6B /* AWB Control 3 */ +#define AWB_CTRL3_ADVANCED 0x80 /* AWB mode select - Advanced AWB */ +#define AWB_CTRL3_SIMPLE 0x00 /* AWB mode select - Simple AWB */ + +#define AWB_CTRL4 0x6C /* AWB Control 4 */ +#define AWB_CTRL5 0x6D /* AWB Control 5 */ +#define AWB_CTRL6 0x6E /* AWB Control 6 */ +#define AWB_CTRL7 0x6F /* AWB Control 7 */ +#define AWB_CTRL8 0x70 /* AWB Control 8 */ +#define AWB_CTRL9 0x71 /* AWB Control 9 */ +#define AWB_CTRL10 0x72 /* AWB Control 10 */ +#define AWB_CTRL11 0x73 /* AWB Control 11 */ +#define AWB_CTRL12 0x74 /* AWB Control 12 */ +#define AWB_CTRL13 0x75 /* AWB Control 13 */ +#define AWB_CTRL14 0x76 /* AWB Control 14 */ +#define AWB_CTRL15 0x77 /* AWB Control 15 */ +#define AWB_CTRL16 0x78 /* AWB Control 16 */ +#define AWB_CTRL17 0x79 /* AWB Control 17 */ +#define AWB_CTRL18 0x7A /* AWB Control 18 */ +#define AWB_CTRL19 0x7B /* AWB Control 19 */ +#define AWB_CTRL20 0x7C /* AWB Control 20 */ +#define AWB_CTRL21 0x7D /* AWB Control 21 */ +#define GAM1 0x7E /* Gamma Curve 1st Segment Input End Point 0x04 Output Value */ +#define GAM2 0x7F /* Gamma Curve 2nd Segment Input End Point 0x08 Output Value */ +#define GAM3 0x80 /* Gamma Curve 3rd Segment Input End Point 0x10 Output Value */ +#define GAM4 0x81 /* Gamma Curve 4th Segment Input End Point 0x20 Output Value */ +#define GAM5 0x82 /* Gamma Curve 5th Segment Input End Point 0x28 Output Value */ +#define GAM6 0x83 /* Gamma Curve 6th Segment Input End Point 0x30 Output Value */ +#define GAM7 0x84 /* Gamma Curve 7th Segment Input End Point 0x38 Output Value */ +#define GAM8 0x85 /* Gamma Curve 8th Segment Input End Point 0x40 Output Value */ +#define GAM9 0x86 /* Gamma Curve 9th Segment Input End Point 0x48 Output Value */ +#define GAM10 0x87 /* Gamma Curve 10th Segment Input End Point 0x50 Output Value */ +#define GAM11 0x88 /* Gamma Curve 11th Segment Input End Point 0x60 Output Value */ +#define GAM12 0x89 /* Gamma Curve 12th Segment Input End Point 0x70 Output Value */ +#define GAM13 0x8A /* Gamma Curve 13th Segment Input End Point 0x90 Output Value */ +#define GAM14 0x8B /* Gamma Curve 14th Segment Input End Point 0xB0 Output Value */ +#define GAM15 0x8C /* Gamma Curve 15th Segment Input End Point 0xD0 Output Value */ +#define SLOP 0x8D /* Gamma Curve Highest Segment Slope */ +#define DNSTH 0x8E /* De-noise Threshold */ +#define EDGE0 0x8F /* Edge Enhancement Strength Control */ +#define EDGE1 0x90 /* Edge Enhancement Threshold Control */ +#define DNSOFF 0x91 /* Auto De-noise Threshold Control */ +#define EDGE2 0x92 /* Edge Enhancement Strength Upper Limit */ +#define EDGE3 0x93 /* Edge Enhancement Strength Upper Limit */ +#define MTX1 0x94 /* Matrix Coefficient 1 */ +#define MTX2 0x95 /* Matrix Coefficient 2 */ +#define MTX3 0x96 /* Matrix Coefficient 3 */ +#define MTX4 0x97 /* Matrix Coefficient 4 */ +#define MTX5 0x98 /* Matrix Coefficient 5 */ +#define MTX6 0x99 /* Matrix Coefficient 6 */ + +#define MTX_CTRL 0x9A /* Matrix Control */ +#define MTX_CTRL_DBL_EN 0x80 /* Matrix double ON/OFF selection */ + +#define BRIGHTNESS 0x9B /* Brightness Control */ +#define CONTRAST 0x9C /* Contrast Gain */ +#define UVADJ0 0x9E /* Auto UV Adjust Control 0 */ +#define UVADJ1 0x9F /* Auto UV Adjust Control 1 */ +#define SCAL0 0xA0 /* DCW Ratio Control */ +#define SCAL1 0xA1 /* Horizontal Zoom Out Control */ +#define SCAL2 0xA2 /* Vertical Zoom Out Control */ +#define FIFODLYM 0xA3 /* FIFO Manual Mode Delay Control */ +#define FIFODLYA 0xA4 /* FIFO Auto Mode Delay Control */ + +#define SDE 0xA6 /* Special Digital Effect Control */ +#define SDE_NEGATIVE_EN 0x40 /* Negative image enable */ +#define SDE_GRAYSCALE_EN 0x20 /* Gray scale image enable */ +#define SDE_V_FIXED_EN 0x10 /* V fixed value enable */ +#define SDE_U_FIXED_EN 0x08 /* U fixed value enable */ +#define SDE_CONT_BRIGHT_EN 0x04 /* Contrast/Brightness enable */ +#define SDE_SATURATION_EN 0x02 /* Saturation enable */ +#define SDE_HUE_EN 0x01 /* Hue enable */ + +#define USAT 0xA7 /* U Component Saturation Gain */ +#define VSAT 0xA8 /* V Component Saturation Gain */ +#define HUECOS 0xA9 /* Cosine value × 0x80 */ +#define HUESIN 0xAA /* Sine value × 0x80 */ +#define SIGN_BIT 0xAB /* Sign Bit for Hue and Brightness */ + +#define DSPAUTO 0xAC /* DSP Auto Function ON/OFF Control */ +#define DSPAUTO_AWB_EN 0x80 /* AWB auto threshold control */ +#define DSPAUTO_DENOISE_EN 0x40 /* De-noise auto threshold control */ +#define DSPAUTO_EDGE_EN 0x20 /* Sharpness (edge enhancement) auto strength control */ +#define DSPAUTO_UV_EN 0x10 /* UV adjust auto slope control */ +#define DSPAUTO_SCAL0_EN 0x08 /* Auto scaling factor control (register SCAL0 (0xA0)) */ +#define DSPAUTO_SCAL1_EN 0x04 /* Auto scaling factor control (registers SCAL1 (0xA1 and SCAL2 (0xA2))*/ +#define SET_REG(reg, x) (##reg_DEFAULT|x) +#endif //__REG_REGS_H__ diff --git a/lib/libesp32_div/esp32-camera/target/esp32/ll_cam.c b/lib/libesp32_div/esp32-camera/target/esp32/ll_cam.c new file mode 100644 index 000000000..e513205d2 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/target/esp32/ll_cam.c @@ -0,0 +1,522 @@ +// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include "soc/i2s_struct.h" +#include "esp_idf_version.h" +#if (ESP_IDF_VERSION_MAJOR >= 4) && (ESP_IDF_VERSION_MINOR > 1) +#include "hal/gpio_ll.h" +#else +#include "soc/gpio_periph.h" +#define esp_rom_delay_us ets_delay_us +static inline int gpio_ll_get_level(gpio_dev_t *hw, int gpio_num) +{ + if (gpio_num < 32) { + return (hw->in >> gpio_num) & 0x1; + } else { + return (hw->in1.data >> (gpio_num - 32)) & 0x1; + } +} +#endif +#include "ll_cam.h" +#include "xclk.h" +#include "cam_hal.h" + +static const char *TAG = "esp32 ll_cam"; + +#define I2S_ISR_ENABLE(i) {I2S0.int_clr.i = 1;I2S0.int_ena.i = 1;} +#define I2S_ISR_DISABLE(i) {I2S0.int_ena.i = 0;I2S0.int_clr.i = 1;} + +typedef union { + struct { + uint32_t sample2:8; + uint32_t unused2:8; + uint32_t sample1:8; + uint32_t unused1:8; + }; + uint32_t val; +} dma_elem_t; + +typedef enum { + /* camera sends byte sequence: s1, s2, s3, s4, ... + * fifo receives: 00 s1 00 s2, 00 s2 00 s3, 00 s3 00 s4, ... + */ + SM_0A0B_0B0C = 0, + /* camera sends byte sequence: s1, s2, s3, s4, ... + * fifo receives: 00 s1 00 s2, 00 s3 00 s4, ... + */ + SM_0A0B_0C0D = 1, + /* camera sends byte sequence: s1, s2, s3, s4, ... + * fifo receives: 00 s1 00 00, 00 s2 00 00, 00 s3 00 00, ... + */ + SM_0A00_0B00 = 3, +} i2s_sampling_mode_t; + +typedef size_t (*dma_filter_t)(uint8_t* dst, const uint8_t* src, size_t len); + +static i2s_sampling_mode_t sampling_mode = SM_0A00_0B00; + +static size_t ll_cam_bytes_per_sample(i2s_sampling_mode_t mode) +{ + switch(mode) { + case SM_0A00_0B00: + return 4; + case SM_0A0B_0B0C: + return 4; + case SM_0A0B_0C0D: + return 2; + default: + assert(0 && "invalid sampling mode"); + return 0; + } +} + +static size_t IRAM_ATTR ll_cam_dma_filter_jpeg(uint8_t* dst, const uint8_t* src, size_t len) +{ + const dma_elem_t* dma_el = (const dma_elem_t*)src; + size_t elements = len / sizeof(dma_elem_t); + size_t end = elements / 4; + // manually unrolling 4 iterations of the loop here + for (size_t i = 0; i < end; ++i) { + dst[0] = dma_el[0].sample1; + dst[1] = dma_el[1].sample1; + dst[2] = dma_el[2].sample1; + dst[3] = dma_el[3].sample1; + dma_el += 4; + dst += 4; + } + return elements; +} + +static size_t IRAM_ATTR ll_cam_dma_filter_grayscale(uint8_t* dst, const uint8_t* src, size_t len) +{ + const dma_elem_t* dma_el = (const dma_elem_t*)src; + size_t elements = len / sizeof(dma_elem_t); + size_t end = elements / 4; + for (size_t i = 0; i < end; ++i) { + // manually unrolling 4 iterations of the loop here + dst[0] = dma_el[0].sample1; + dst[1] = dma_el[1].sample1; + dst[2] = dma_el[2].sample1; + dst[3] = dma_el[3].sample1; + dma_el += 4; + dst += 4; + } + return elements; +} + +static size_t IRAM_ATTR ll_cam_dma_filter_grayscale_highspeed(uint8_t* dst, const uint8_t* src, size_t len) +{ + const dma_elem_t* dma_el = (const dma_elem_t*)src; + size_t elements = len / sizeof(dma_elem_t); + size_t end = elements / 8; + for (size_t i = 0; i < end; ++i) { + // manually unrolling 4 iterations of the loop here + dst[0] = dma_el[0].sample1; + dst[1] = dma_el[2].sample1; + dst[2] = dma_el[4].sample1; + dst[3] = dma_el[6].sample1; + dma_el += 8; + dst += 4; + } + // the final sample of a line in SM_0A0B_0B0C sampling mode needs special handling + if ((elements & 0x7) != 0) { + dst[0] = dma_el[0].sample1; + dst[1] = dma_el[2].sample1; + elements += 1; + } + return elements / 2; +} + +static size_t IRAM_ATTR ll_cam_dma_filter_yuyv(uint8_t* dst, const uint8_t* src, size_t len) +{ + const dma_elem_t* dma_el = (const dma_elem_t*)src; + size_t elements = len / sizeof(dma_elem_t); + size_t end = elements / 4; + for (size_t i = 0; i < end; ++i) { + dst[0] = dma_el[0].sample1;//y0 + dst[1] = dma_el[0].sample2;//u + dst[2] = dma_el[1].sample1;//y1 + dst[3] = dma_el[1].sample2;//v + + dst[4] = dma_el[2].sample1;//y0 + dst[5] = dma_el[2].sample2;//u + dst[6] = dma_el[3].sample1;//y1 + dst[7] = dma_el[3].sample2;//v + dma_el += 4; + dst += 8; + } + return elements * 2; +} + +static size_t IRAM_ATTR ll_cam_dma_filter_yuyv_highspeed(uint8_t* dst, const uint8_t* src, size_t len) +{ + const dma_elem_t* dma_el = (const dma_elem_t*)src; + size_t elements = len / sizeof(dma_elem_t); + size_t end = elements / 8; + for (size_t i = 0; i < end; ++i) { + dst[0] = dma_el[0].sample1;//y0 + dst[1] = dma_el[1].sample1;//u + dst[2] = dma_el[2].sample1;//y1 + dst[3] = dma_el[3].sample1;//v + + dst[4] = dma_el[4].sample1;//y0 + dst[5] = dma_el[5].sample1;//u + dst[6] = dma_el[6].sample1;//y1 + dst[7] = dma_el[7].sample1;//v + dma_el += 8; + dst += 8; + } + if ((elements & 0x7) != 0) { + dst[0] = dma_el[0].sample1;//y0 + dst[1] = dma_el[1].sample1;//u + dst[2] = dma_el[2].sample1;//y1 + dst[3] = dma_el[2].sample2;//v + elements += 4; + } + return elements; +} + +static void IRAM_ATTR ll_cam_vsync_isr(void *arg) +{ + //DBG_PIN_SET(1); + cam_obj_t *cam = (cam_obj_t *)arg; + BaseType_t HPTaskAwoken = pdFALSE; + // filter + ets_delay_us(1); + if (gpio_ll_get_level(&GPIO, cam->vsync_pin) == !cam->vsync_invert) { + ll_cam_send_event(cam, CAM_VSYNC_EVENT, &HPTaskAwoken); + if (HPTaskAwoken == pdTRUE) { + portYIELD_FROM_ISR(); + } + } + //DBG_PIN_SET(0); +} + +static void IRAM_ATTR ll_cam_dma_isr(void *arg) +{ + //DBG_PIN_SET(1); + cam_obj_t *cam = (cam_obj_t *)arg; + BaseType_t HPTaskAwoken = pdFALSE; + + typeof(I2S0.int_st) status = I2S0.int_st; + if (status.val == 0) { + return; + } + + I2S0.int_clr.val = status.val; + + if (status.in_suc_eof) { + ll_cam_send_event(cam, CAM_IN_SUC_EOF_EVENT, &HPTaskAwoken); + } + if (HPTaskAwoken == pdTRUE) { + portYIELD_FROM_ISR(); + } + //DBG_PIN_SET(0); +} + +bool ll_cam_stop(cam_obj_t *cam) +{ + I2S0.conf.rx_start = 0; + I2S_ISR_DISABLE(in_suc_eof); + I2S0.in_link.stop = 1; + return true; +} + +esp_err_t ll_cam_deinit(cam_obj_t *cam) +{ + gpio_isr_handler_remove(cam->vsync_pin); + + if (cam->cam_intr_handle) { + esp_intr_free(cam->cam_intr_handle); + cam->cam_intr_handle = NULL; + } + + return ESP_OK; +} + +bool ll_cam_start(cam_obj_t *cam, int frame_pos) +{ + I2S0.conf.rx_start = 0; + + I2S_ISR_ENABLE(in_suc_eof); + + I2S0.conf.rx_reset = 1; + I2S0.conf.rx_reset = 0; + I2S0.conf.rx_fifo_reset = 1; + I2S0.conf.rx_fifo_reset = 0; + I2S0.lc_conf.in_rst = 1; + I2S0.lc_conf.in_rst = 0; + I2S0.lc_conf.ahbm_fifo_rst = 1; + I2S0.lc_conf.ahbm_fifo_rst = 0; + I2S0.lc_conf.ahbm_rst = 1; + I2S0.lc_conf.ahbm_rst = 0; + + I2S0.rx_eof_num = cam->dma_half_buffer_size / sizeof(dma_elem_t); + I2S0.in_link.addr = ((uint32_t)&cam->dma[0]) & 0xfffff; + + I2S0.in_link.start = 1; + I2S0.conf.rx_start = 1; + return true; +} + +esp_err_t ll_cam_config(cam_obj_t *cam, const camera_config_t *config) +{ + // Enable and configure I2S peripheral + periph_module_enable(PERIPH_I2S0_MODULE); + + I2S0.conf.rx_reset = 1; + I2S0.conf.rx_reset = 0; + I2S0.conf.rx_fifo_reset = 1; + I2S0.conf.rx_fifo_reset = 0; + I2S0.lc_conf.in_rst = 1; + I2S0.lc_conf.in_rst = 0; + I2S0.lc_conf.ahbm_fifo_rst = 1; + I2S0.lc_conf.ahbm_fifo_rst = 0; + I2S0.lc_conf.ahbm_rst = 1; + I2S0.lc_conf.ahbm_rst = 0; + + I2S0.conf.rx_slave_mod = 1; + I2S0.conf.rx_right_first = 0; + I2S0.conf.rx_msb_right = 0; + I2S0.conf.rx_msb_shift = 0; + I2S0.conf.rx_mono = 0; + I2S0.conf.rx_short_sync = 0; + + I2S0.conf2.lcd_en = 1; + I2S0.conf2.camera_en = 1; + + // Configure clock divider + I2S0.clkm_conf.clkm_div_a = 0; + I2S0.clkm_conf.clkm_div_b = 0; + I2S0.clkm_conf.clkm_div_num = 2; + + I2S0.fifo_conf.dscr_en = 1; + I2S0.fifo_conf.rx_fifo_mod = sampling_mode; + I2S0.fifo_conf.rx_fifo_mod_force_en = 1; + + I2S0.conf_chan.rx_chan_mod = 1; + I2S0.sample_rate_conf.rx_bits_mod = 0; + I2S0.timing.val = 0; + I2S0.timing.rx_dsync_sw = 1; + + return ESP_OK; +} + +void ll_cam_vsync_intr_enable(cam_obj_t *cam, bool en) +{ + if (en) { + gpio_intr_enable(cam->vsync_pin); + } else { + gpio_intr_disable(cam->vsync_pin); + } +} + +esp_err_t ll_cam_set_pin(cam_obj_t *cam, const camera_config_t *config) +{ + gpio_config_t io_conf = {0}; + io_conf.intr_type = cam->vsync_invert ? GPIO_PIN_INTR_NEGEDGE : GPIO_PIN_INTR_POSEDGE; + io_conf.pin_bit_mask = 1ULL << config->pin_vsync; + io_conf.mode = GPIO_MODE_INPUT; + io_conf.pull_up_en = 1; + io_conf.pull_down_en = 0; + gpio_config(&io_conf); + gpio_install_isr_service(ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_IRAM); + gpio_isr_handler_add(config->pin_vsync, ll_cam_vsync_isr, cam); + gpio_intr_disable(config->pin_vsync); + + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[config->pin_pclk], PIN_FUNC_GPIO); + gpio_set_direction(config->pin_pclk, GPIO_MODE_INPUT); + gpio_set_pull_mode(config->pin_pclk, GPIO_FLOATING); + gpio_matrix_in(config->pin_pclk, I2S0I_WS_IN_IDX, false); + + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[config->pin_vsync], PIN_FUNC_GPIO); + gpio_set_direction(config->pin_vsync, GPIO_MODE_INPUT); + gpio_set_pull_mode(config->pin_vsync, GPIO_FLOATING); + gpio_matrix_in(config->pin_vsync, I2S0I_V_SYNC_IDX, false); + + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[config->pin_href], PIN_FUNC_GPIO); + gpio_set_direction(config->pin_href, GPIO_MODE_INPUT); + gpio_set_pull_mode(config->pin_href, GPIO_FLOATING); + gpio_matrix_in(config->pin_href, I2S0I_H_SYNC_IDX, false); + + int data_pins[8] = { + config->pin_d0, config->pin_d1, config->pin_d2, config->pin_d3, config->pin_d4, config->pin_d5, config->pin_d6, config->pin_d7, + }; + for (int i = 0; i < 8; i++) { + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[data_pins[i]], PIN_FUNC_GPIO); + gpio_set_direction(data_pins[i], GPIO_MODE_INPUT); + gpio_set_pull_mode(data_pins[i], GPIO_FLOATING); + gpio_matrix_in(data_pins[i], I2S0I_DATA_IN0_IDX + i, false); + } + + gpio_matrix_in(0x38, I2S0I_H_ENABLE_IDX, false); + return ESP_OK; +} + +esp_err_t ll_cam_init_isr(cam_obj_t *cam) +{ + return esp_intr_alloc(ETS_I2S0_INTR_SOURCE, ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_IRAM, ll_cam_dma_isr, cam, &cam->cam_intr_handle); +} + +void ll_cam_do_vsync(cam_obj_t *cam) +{ +} + +uint8_t ll_cam_get_dma_align(cam_obj_t *cam) +{ + return 0; +} + +static bool ll_cam_calc_rgb_dma(cam_obj_t *cam){ + size_t dma_half_buffer_max = CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX / 2 / cam->dma_bytes_per_item; + size_t dma_buffer_max = 2 * dma_half_buffer_max; + size_t node_max = LCD_CAM_DMA_NODE_BUFFER_MAX_SIZE / cam->dma_bytes_per_item; + + size_t line_width = cam->width * cam->in_bytes_per_pixel; + size_t image_size = cam->height * line_width; + if (image_size > (4 * 1024 * 1024) || (line_width > dma_half_buffer_max)) { + ESP_LOGE(TAG, "Resolution too high"); + return 0; + } + + size_t node_size = node_max; + size_t nodes_per_line = 1; + size_t lines_per_node = 1; + size_t lines_per_half_buffer = 1; + size_t dma_half_buffer_min = node_max; + size_t dma_half_buffer = dma_half_buffer_max; + size_t dma_buffer_size = dma_buffer_max; + + // Calculate DMA Node Size so that it's divisable by or divisor of the line width + if(line_width >= node_max){ + // One or more nodes will be requied for one line + for(size_t i = node_max; i > 0; i=i-1){ + if ((line_width % i) == 0) { + node_size = i; + nodes_per_line = line_width / node_size; + break; + } + } + } else { + // One or more lines can fit into one node + for(size_t i = node_max; i > 0; i=i-1){ + if ((i % line_width) == 0) { + node_size = i; + lines_per_node = node_size / line_width; + while((cam->height % lines_per_node) != 0){ + lines_per_node = lines_per_node - 1; + node_size = lines_per_node * line_width; + } + break; + } + } + } + // Calculate minimum EOF size = max(mode_size, line_size) + dma_half_buffer_min = node_size * nodes_per_line; + // Calculate max EOF size divisable by node size + dma_half_buffer = (dma_half_buffer_max / dma_half_buffer_min) * dma_half_buffer_min; + // Adjust EOF size so that height will be divisable by the number of lines in each EOF + lines_per_half_buffer = dma_half_buffer / line_width; + while((cam->height % lines_per_half_buffer) != 0){ + dma_half_buffer = dma_half_buffer - dma_half_buffer_min; + lines_per_half_buffer = dma_half_buffer / line_width; + } + // Calculate DMA size + dma_buffer_size =(dma_buffer_max / dma_half_buffer) * dma_half_buffer; + + ESP_LOGI(TAG, "node_size: %4u, nodes_per_line: %u, lines_per_node: %u, dma_half_buffer_min: %5u, dma_half_buffer: %5u, lines_per_half_buffer: %2u, dma_buffer_size: %5u, image_size: %u", + node_size * cam->dma_bytes_per_item, nodes_per_line, lines_per_node, dma_half_buffer_min * cam->dma_bytes_per_item, dma_half_buffer * cam->dma_bytes_per_item, lines_per_half_buffer, dma_buffer_size * cam->dma_bytes_per_item, image_size); + + cam->dma_buffer_size = dma_buffer_size * cam->dma_bytes_per_item; + cam->dma_half_buffer_size = dma_half_buffer * cam->dma_bytes_per_item; + cam->dma_node_buffer_size = node_size * cam->dma_bytes_per_item; + cam->dma_half_buffer_cnt = cam->dma_buffer_size / cam->dma_half_buffer_size; + return 1; +} + +bool ll_cam_dma_sizes(cam_obj_t *cam) +{ + cam->dma_bytes_per_item = ll_cam_bytes_per_sample(sampling_mode); + if (cam->jpeg_mode) { + cam->dma_half_buffer_cnt = 8; + cam->dma_node_buffer_size = 2048; + cam->dma_half_buffer_size = cam->dma_node_buffer_size * 2; + cam->dma_buffer_size = cam->dma_half_buffer_cnt * cam->dma_half_buffer_size; + } else { + return ll_cam_calc_rgb_dma(cam); + } + return 1; +} + +static dma_filter_t dma_filter = ll_cam_dma_filter_jpeg; + +size_t IRAM_ATTR ll_cam_memcpy(cam_obj_t *cam, uint8_t *out, const uint8_t *in, size_t len) +{ + //DBG_PIN_SET(1); + size_t r = dma_filter(out, in, len); + //DBG_PIN_SET(0); + return r; +} + +esp_err_t ll_cam_set_sample_mode(cam_obj_t *cam, pixformat_t pix_format, uint32_t xclk_freq_hz, uint16_t sensor_pid) +{ + if (pix_format == PIXFORMAT_GRAYSCALE) { + if (sensor_pid == OV3660_PID || sensor_pid == OV5640_PID || sensor_pid == NT99141_PID) { + if (xclk_freq_hz > 10000000) { + sampling_mode = SM_0A00_0B00; + dma_filter = ll_cam_dma_filter_yuyv_highspeed; + } else { + sampling_mode = SM_0A0B_0C0D; + dma_filter = ll_cam_dma_filter_yuyv; + } + cam->in_bytes_per_pixel = 1; // camera sends Y8 + } else { + if (xclk_freq_hz > 10000000 && sensor_pid != OV7725_PID) { + sampling_mode = SM_0A00_0B00; + dma_filter = ll_cam_dma_filter_grayscale_highspeed; + } else { + sampling_mode = SM_0A0B_0C0D; + dma_filter = ll_cam_dma_filter_grayscale; + } + cam->in_bytes_per_pixel = 2; // camera sends YU/YV + } + cam->fb_bytes_per_pixel = 1; // frame buffer stores Y8 + } else if (pix_format == PIXFORMAT_YUV422 || pix_format == PIXFORMAT_RGB565) { + if (xclk_freq_hz > 10000000 && sensor_pid != OV7725_PID) { + if (sensor_pid == OV7670_PID) { + sampling_mode = SM_0A0B_0B0C; + } else { + sampling_mode = SM_0A00_0B00; + } + dma_filter = ll_cam_dma_filter_yuyv_highspeed; + } else { + sampling_mode = SM_0A0B_0C0D; + dma_filter = ll_cam_dma_filter_yuyv; + } + cam->in_bytes_per_pixel = 2; // camera sends YU/YV + cam->fb_bytes_per_pixel = 2; // frame buffer stores YU/YV/RGB565 + } else if (pix_format == PIXFORMAT_JPEG) { + cam->in_bytes_per_pixel = 1; + cam->fb_bytes_per_pixel = 1; + dma_filter = ll_cam_dma_filter_jpeg; + sampling_mode = SM_0A00_0B00; + } else { + ESP_LOGE(TAG, "Requested format is not supported"); + return ESP_ERR_NOT_SUPPORTED; + } + I2S0.fifo_conf.rx_fifo_mod = sampling_mode; + return ESP_OK; +} diff --git a/lib/libesp32_div/esp32-camera/target/esp32s2/ll_cam.c b/lib/libesp32_div/esp32-camera/target/esp32s2/ll_cam.c new file mode 100644 index 000000000..d3cb5353b --- /dev/null +++ b/lib/libesp32_div/esp32-camera/target/esp32s2/ll_cam.c @@ -0,0 +1,402 @@ +// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include "soc/system_reg.h" +#include "soc/i2s_struct.h" +#include "hal/gpio_ll.h" +#include "ll_cam.h" +#include "xclk.h" +#include "cam_hal.h" + +static const char *TAG = "s2 ll_cam"; + +#define I2S_ISR_ENABLE(i) {I2S0.int_clr.i = 1;I2S0.int_ena.i = 1;} +#define I2S_ISR_DISABLE(i) {I2S0.int_ena.i = 0;I2S0.int_clr.i = 1;} + +static void IRAM_ATTR ll_cam_vsync_isr(void *arg) +{ + //DBG_PIN_SET(1); + cam_obj_t *cam = (cam_obj_t *)arg; + BaseType_t HPTaskAwoken = pdFALSE; + // filter + ets_delay_us(1); + if (gpio_ll_get_level(&GPIO, cam->vsync_pin) == !cam->vsync_invert) { + ll_cam_send_event(cam, CAM_VSYNC_EVENT, &HPTaskAwoken); + } + + if (HPTaskAwoken == pdTRUE) { + portYIELD_FROM_ISR(); + } + //DBG_PIN_SET(0); +} + +static void IRAM_ATTR ll_cam_dma_isr(void *arg) +{ + cam_obj_t *cam = (cam_obj_t *)arg; + BaseType_t HPTaskAwoken = pdFALSE; + + typeof(I2S0.int_st) status = I2S0.int_st; + if (status.val == 0) { + return; + } + + I2S0.int_clr.val = status.val; + + if (status.in_suc_eof) { + ll_cam_send_event(cam, CAM_IN_SUC_EOF_EVENT, &HPTaskAwoken); + } + + if (HPTaskAwoken == pdTRUE) { + portYIELD_FROM_ISR(); + } +} + +bool ll_cam_stop(cam_obj_t *cam) +{ + I2S0.conf.rx_start = 0; + + if (cam->jpeg_mode || !cam->psram_mode) { + I2S_ISR_DISABLE(in_suc_eof); + } + + I2S0.in_link.stop = 1; + return true; +} + +esp_err_t ll_cam_deinit(cam_obj_t *cam) +{ + gpio_isr_handler_remove(cam->vsync_pin); + + if (cam->cam_intr_handle) { + esp_intr_free(cam->cam_intr_handle); + cam->cam_intr_handle = NULL; + } + + return ESP_OK; +} + +bool ll_cam_start(cam_obj_t *cam, int frame_pos) +{ + I2S0.conf.rx_start = 0; + + if (cam->jpeg_mode || !cam->psram_mode) { + I2S_ISR_ENABLE(in_suc_eof); + } + + I2S0.conf.rx_reset = 1; + I2S0.conf.rx_reset = 0; + I2S0.conf.rx_fifo_reset = 1; + I2S0.conf.rx_fifo_reset = 0; + I2S0.lc_conf.in_rst = 1; + I2S0.lc_conf.in_rst = 0; + I2S0.lc_conf.ahbm_fifo_rst = 1; + I2S0.lc_conf.ahbm_fifo_rst = 0; + I2S0.lc_conf.ahbm_rst = 1; + I2S0.lc_conf.ahbm_rst = 0; + + I2S0.rx_eof_num = cam->dma_half_buffer_size; // Ping pong operation + if (!cam->psram_mode) { + I2S0.in_link.addr = ((uint32_t)&cam->dma[0]) & 0xfffff; + } else { + I2S0.in_link.addr = ((uint32_t)&cam->frames[frame_pos].dma[0]) & 0xfffff; + } + + I2S0.in_link.start = 1; + I2S0.conf.rx_start = 1; + return true; +} + +esp_err_t ll_cam_config(cam_obj_t *cam, const camera_config_t *config) +{ + esp_err_t err = camera_enable_out_clock(config); + if(err != ESP_OK) { + return err; + } + periph_module_enable(PERIPH_I2S0_MODULE); + // Configure the clock + I2S0.clkm_conf.clkm_div_num = 2; // 160MHz / 2 = 80MHz + I2S0.clkm_conf.clkm_div_b = 0; + I2S0.clkm_conf.clkm_div_a = 0; + I2S0.clkm_conf.clk_sel = 2; + I2S0.clkm_conf.clk_en = 1; + + + I2S0.conf.val = 0; + I2S0.fifo_conf.val = 0; + I2S0.fifo_conf.dscr_en = 1; + + I2S0.lc_conf.ahbm_fifo_rst = 1; + I2S0.lc_conf.ahbm_fifo_rst = 0; + I2S0.lc_conf.ahbm_rst = 1; + I2S0.lc_conf.ahbm_rst = 0; + I2S0.lc_conf.check_owner = 0; + //I2S0.lc_conf.indscr_burst_en = 1; + //I2S0.lc_conf.ext_mem_bk_size = 0; // DMA access external memory block size. 0: 16 bytes, 1: 32 bytes, 2:64 bytes, 3:reserved + + I2S0.timing.val = 0; + + I2S0.int_ena.val = 0; + I2S0.int_clr.val = ~0; + + I2S0.conf2.lcd_en = 1; + I2S0.conf2.camera_en = 1; + + // Configuration data format + I2S0.conf.rx_slave_mod = 1; + I2S0.conf.rx_right_first = 0; + I2S0.conf.rx_msb_right = cam->swap_data; + I2S0.conf.rx_short_sync = 0; + I2S0.conf.rx_mono = 0; + I2S0.conf.rx_msb_shift = 0; + I2S0.conf.rx_dma_equal = 1; + + // Configure sampling rate + I2S0.sample_rate_conf.rx_bck_div_num = 1; + I2S0.sample_rate_conf.rx_bits_mod = 8; + + I2S0.conf1.rx_pcm_bypass = 1; + + I2S0.conf2.i_v_sync_filter_en = 1; + I2S0.conf2.i_v_sync_filter_thres = 4; + I2S0.conf2.cam_sync_fifo_reset = 1; + I2S0.conf2.cam_sync_fifo_reset = 0; + + I2S0.conf_chan.rx_chan_mod = 1; + + I2S0.fifo_conf.rx_fifo_mod_force_en = 1; + I2S0.fifo_conf.rx_data_num = 32; + I2S0.fifo_conf.rx_fifo_mod = 2; + + I2S0.lc_conf.in_rst = 1; + I2S0.lc_conf.in_rst = 0; + + I2S0.conf.rx_start = 1; + + return ESP_OK; +} + +void ll_cam_vsync_intr_enable(cam_obj_t *cam, bool en) +{ + if (en) { + gpio_intr_enable(cam->vsync_pin); + } else { + gpio_intr_disable(cam->vsync_pin); + } +} + +esp_err_t ll_cam_set_pin(cam_obj_t *cam, const camera_config_t *config) +{ + gpio_config_t io_conf = {0}; + io_conf.intr_type = cam->vsync_invert ? GPIO_PIN_INTR_NEGEDGE : GPIO_PIN_INTR_POSEDGE; + io_conf.pin_bit_mask = 1ULL << config->pin_vsync; + io_conf.mode = GPIO_MODE_INPUT; + io_conf.pull_up_en = 1; + io_conf.pull_down_en = 0; + gpio_config(&io_conf); + gpio_install_isr_service(ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_IRAM); + gpio_isr_handler_add(config->pin_vsync, ll_cam_vsync_isr, cam); + gpio_intr_disable(config->pin_vsync); + + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[config->pin_pclk], PIN_FUNC_GPIO); + gpio_set_direction(config->pin_pclk, GPIO_MODE_INPUT); + gpio_set_pull_mode(config->pin_pclk, GPIO_FLOATING); + gpio_matrix_in(config->pin_pclk, I2S0I_WS_IN_IDX, false); + + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[config->pin_vsync], PIN_FUNC_GPIO); + gpio_set_direction(config->pin_vsync, GPIO_MODE_INPUT); + gpio_set_pull_mode(config->pin_vsync, GPIO_FLOATING); + gpio_matrix_in(config->pin_vsync, I2S0I_V_SYNC_IDX, cam->vsync_invert); + + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[config->pin_href], PIN_FUNC_GPIO); + gpio_set_direction(config->pin_href, GPIO_MODE_INPUT); + gpio_set_pull_mode(config->pin_href, GPIO_FLOATING); + gpio_matrix_in(config->pin_href, I2S0I_H_SYNC_IDX, false); + + int data_pins[8] = { + config->pin_d0, config->pin_d1, config->pin_d2, config->pin_d3, config->pin_d4, config->pin_d5, config->pin_d6, config->pin_d7, + }; + for (int i = 0; i < 8; i++) { + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[data_pins[i]], PIN_FUNC_GPIO); + gpio_set_direction(data_pins[i], GPIO_MODE_INPUT); + gpio_set_pull_mode(data_pins[i], GPIO_FLOATING); + // High bit alignment, IN16 is always the highest bit + // fifo accesses data by bit, when rx_bits_mod is 8, the data needs to be aligned by 8 bits + gpio_matrix_in(data_pins[i], I2S0I_DATA_IN0_IDX + 8 + i, false); + } + + gpio_matrix_in(0x38, I2S0I_H_ENABLE_IDX, false); + + return ESP_OK; +} + +esp_err_t ll_cam_init_isr(cam_obj_t *cam) +{ + return esp_intr_alloc(ETS_I2S0_INTR_SOURCE, ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_IRAM, ll_cam_dma_isr, cam, &cam->cam_intr_handle); +} + +void ll_cam_do_vsync(cam_obj_t *cam) +{ + ll_cam_vsync_intr_enable(cam, false); + gpio_matrix_in(cam->vsync_pin, I2S0I_V_SYNC_IDX, !cam->vsync_invert); + ets_delay_us(10); + gpio_matrix_in(cam->vsync_pin, I2S0I_V_SYNC_IDX, cam->vsync_invert); + ll_cam_vsync_intr_enable(cam, true); +} + +uint8_t ll_cam_get_dma_align(cam_obj_t *cam) +{ + return 64;//16 << I2S0.lc_conf.ext_mem_bk_size; +} + +static bool ll_cam_calc_rgb_dma(cam_obj_t *cam){ + size_t node_max = LCD_CAM_DMA_NODE_BUFFER_MAX_SIZE / cam->dma_bytes_per_item; + size_t line_width = cam->width * cam->in_bytes_per_pixel; + size_t node_size = node_max; + size_t nodes_per_line = 1; + size_t lines_per_node = 1; + + // Calculate DMA Node Size so that it's divisable by or divisor of the line width + if(line_width >= node_max){ + // One or more nodes will be requied for one line + for(size_t i = node_max; i > 0; i=i-1){ + if ((line_width % i) == 0) { + node_size = i; + nodes_per_line = line_width / node_size; + break; + } + } + } else { + // One or more lines can fit into one node + for(size_t i = node_max; i > 0; i=i-1){ + if ((i % line_width) == 0) { + node_size = i; + lines_per_node = node_size / line_width; + while((cam->height % lines_per_node) != 0){ + lines_per_node = lines_per_node - 1; + node_size = lines_per_node * line_width; + } + break; + } + } + } + + ESP_LOGI(TAG, "node_size: %4u, nodes_per_line: %u, lines_per_node: %u", + node_size * cam->dma_bytes_per_item, nodes_per_line, lines_per_node); + + cam->dma_node_buffer_size = node_size * cam->dma_bytes_per_item; + + if (cam->psram_mode) { + cam->dma_buffer_size = cam->recv_size * cam->dma_bytes_per_item; + cam->dma_half_buffer_cnt = 2; + cam->dma_half_buffer_size = cam->dma_buffer_size / cam->dma_half_buffer_cnt; + } else { + size_t dma_half_buffer_max = CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX / 2 / cam->dma_bytes_per_item; + if (line_width > dma_half_buffer_max) { + ESP_LOGE(TAG, "Resolution too high"); + return 0; + } + + // Calculate minimum EOF size = max(mode_size, line_size) + size_t dma_half_buffer_min = node_size * nodes_per_line; + + // Calculate max EOF size divisable by node size + size_t dma_half_buffer = (dma_half_buffer_max / dma_half_buffer_min) * dma_half_buffer_min; + + // Adjust EOF size so that height will be divisable by the number of lines in each EOF + size_t lines_per_half_buffer = dma_half_buffer / line_width; + while((cam->height % lines_per_half_buffer) != 0){ + dma_half_buffer = dma_half_buffer - dma_half_buffer_min; + lines_per_half_buffer = dma_half_buffer / line_width; + } + + // Calculate DMA size + size_t dma_buffer_max = 2 * dma_half_buffer_max; + size_t dma_buffer_size = dma_buffer_max; + dma_buffer_size =(dma_buffer_max / dma_half_buffer) * dma_half_buffer; + + ESP_LOGI(TAG, "dma_half_buffer_min: %5u, dma_half_buffer: %5u, lines_per_half_buffer: %2u, dma_buffer_size: %5u", + dma_half_buffer_min * cam->dma_bytes_per_item, dma_half_buffer * cam->dma_bytes_per_item, lines_per_half_buffer, dma_buffer_size * cam->dma_bytes_per_item); + + cam->dma_buffer_size = dma_buffer_size * cam->dma_bytes_per_item; + cam->dma_half_buffer_size = dma_half_buffer * cam->dma_bytes_per_item; + cam->dma_half_buffer_cnt = cam->dma_buffer_size / cam->dma_half_buffer_size; + } + return 1; +} + +bool ll_cam_dma_sizes(cam_obj_t *cam) +{ + cam->dma_bytes_per_item = 1; + if (cam->jpeg_mode) { + if (cam->psram_mode) { + cam->dma_buffer_size = cam->recv_size; + cam->dma_half_buffer_size = 1024; + cam->dma_half_buffer_cnt = cam->dma_buffer_size / cam->dma_half_buffer_size; + cam->dma_node_buffer_size = cam->dma_half_buffer_size; + } else { + cam->dma_half_buffer_cnt = 16; + cam->dma_buffer_size = cam->dma_half_buffer_cnt * 1024; + cam->dma_half_buffer_size = cam->dma_buffer_size / cam->dma_half_buffer_cnt; + cam->dma_node_buffer_size = cam->dma_half_buffer_size; + } + } else { + return ll_cam_calc_rgb_dma(cam); + } + return 1; +} + +size_t IRAM_ATTR ll_cam_memcpy(cam_obj_t *cam, uint8_t *out, const uint8_t *in, size_t len) +{ + // YUV to Grayscale + if (cam->in_bytes_per_pixel == 2 && cam->fb_bytes_per_pixel == 1) { + size_t end = len / 8; + for (size_t i = 0; i < end; ++i) { + out[0] = in[0]; + out[1] = in[2]; + out[2] = in[4]; + out[3] = in[6]; + out += 4; + in += 8; + } + return len / 2; + } + + // just memcpy + memcpy(out, in, len); + return len; +} + +esp_err_t ll_cam_set_sample_mode(cam_obj_t *cam, pixformat_t pix_format, uint32_t xclk_freq_hz, uint16_t sensor_pid) +{ + if (pix_format == PIXFORMAT_GRAYSCALE) { + if (sensor_pid == OV3660_PID || sensor_pid == OV5640_PID || sensor_pid == NT99141_PID) { + cam->in_bytes_per_pixel = 1; // camera sends Y8 + } else { + cam->in_bytes_per_pixel = 2; // camera sends YU/YV + } + cam->fb_bytes_per_pixel = 1; // frame buffer stores Y8 + } else if (pix_format == PIXFORMAT_YUV422 || pix_format == PIXFORMAT_RGB565) { + cam->in_bytes_per_pixel = 2; // camera sends YU/YV + cam->fb_bytes_per_pixel = 2; // frame buffer stores YU/YV/RGB565 + } else if (pix_format == PIXFORMAT_JPEG) { + cam->in_bytes_per_pixel = 1; + cam->fb_bytes_per_pixel = 1; + } else { + ESP_LOGE(TAG, "Requested format is not supported"); + return ESP_ERR_NOT_SUPPORTED; + } + return ESP_OK; +} diff --git a/lib/libesp32_div/esp32-camera/target/esp32s2/private_include/tjpgd.h b/lib/libesp32_div/esp32-camera/target/esp32s2/private_include/tjpgd.h new file mode 100644 index 000000000..31fbc97cc --- /dev/null +++ b/lib/libesp32_div/esp32-camera/target/esp32s2/private_include/tjpgd.h @@ -0,0 +1,99 @@ +/*----------------------------------------------------------------------------/ +/ TJpgDec - Tiny JPEG Decompressor include file (C)ChaN, 2012 +/----------------------------------------------------------------------------*/ +#ifndef _TJPGDEC +#define _TJPGDEC +/*---------------------------------------------------------------------------*/ +/* System Configurations */ + +#define JD_SZBUF 512 /* Size of stream input buffer */ +#define JD_FORMAT 0 /* Output pixel format 0:RGB888 (3 BYTE/pix), 1:RGB565 (1 WORD/pix) */ +#define JD_USE_SCALE 1 /* Use descaling feature for output */ +#define JD_TBLCLIP 1 /* Use table for saturation (might be a bit faster but increases 1K bytes of code size) */ + +/*---------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* These types must be 16-bit, 32-bit or larger integer */ +typedef int INT; +typedef unsigned int UINT; + +/* These types must be 8-bit integer */ +typedef char CHAR; +typedef unsigned char UCHAR; +typedef unsigned char BYTE; + +/* These types must be 16-bit integer */ +typedef short SHORT; +typedef unsigned short USHORT; +typedef unsigned short WORD; +typedef unsigned short WCHAR; + +/* These types must be 32-bit integer */ +typedef long LONG; +typedef unsigned long ULONG; +typedef unsigned long DWORD; + + +/* Error code */ +typedef enum { + JDR_OK = 0, /* 0: Succeeded */ + JDR_INTR, /* 1: Interrupted by output function */ + JDR_INP, /* 2: Device error or wrong termination of input stream */ + JDR_MEM1, /* 3: Insufficient memory pool for the image */ + JDR_MEM2, /* 4: Insufficient stream input buffer */ + JDR_PAR, /* 5: Parameter error */ + JDR_FMT1, /* 6: Data format error (may be damaged data) */ + JDR_FMT2, /* 7: Right format but not supported */ + JDR_FMT3 /* 8: Not supported JPEG standard */ +} JRESULT; + + + +/* Rectangular structure */ +typedef struct { + WORD left, right, top, bottom; +} JRECT; + + + +/* Decompressor object structure */ +typedef struct JDEC JDEC; +struct JDEC { + UINT dctr; /* Number of bytes available in the input buffer */ + BYTE* dptr; /* Current data read ptr */ + BYTE* inbuf; /* Bit stream input buffer */ + BYTE dmsk; /* Current bit in the current read byte */ + BYTE scale; /* Output scaling ratio */ + BYTE msx, msy; /* MCU size in unit of block (width, height) */ + BYTE qtid[3]; /* Quantization table ID of each component */ + SHORT dcv[3]; /* Previous DC element of each component */ + WORD nrst; /* Restart inverval */ + UINT width, height; /* Size of the input image (pixel) */ + BYTE* huffbits[2][2]; /* Huffman bit distribution tables [id][dcac] */ + WORD* huffcode[2][2]; /* Huffman code word tables [id][dcac] */ + BYTE* huffdata[2][2]; /* Huffman decoded data tables [id][dcac] */ + LONG* qttbl[4]; /* Dequaitizer tables [id] */ + void* workbuf; /* Working buffer for IDCT and RGB output */ + BYTE* mcubuf; /* Working buffer for the MCU */ + void* pool; /* Pointer to available memory pool */ + UINT sz_pool; /* Size of momory pool (bytes available) */ + UINT (*infunc)(JDEC*, BYTE*, UINT);/* Pointer to jpeg stream input function */ + void* device; /* Pointer to I/O device identifiler for the session */ +}; + + + +/* TJpgDec API functions */ +JRESULT jd_prepare (JDEC*, UINT(*)(JDEC*,BYTE*,UINT), void*, UINT, void*); +JRESULT jd_decomp (JDEC*, UINT(*)(JDEC*,void*,JRECT*), BYTE); + + +#ifdef __cplusplus +} +#endif + +#endif /* _TJPGDEC */ diff --git a/lib/libesp32_div/esp32-camera/target/esp32s2/tjpgd.c b/lib/libesp32_div/esp32-camera/target/esp32s2/tjpgd.c new file mode 100644 index 000000000..5a983c4c7 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/target/esp32s2/tjpgd.c @@ -0,0 +1,970 @@ +/*----------------------------------------------------------------------------/ +/ TJpgDec - Tiny JPEG Decompressor R0.01b (C)ChaN, 2012 +/-----------------------------------------------------------------------------/ +/ The TJpgDec is a generic JPEG decompressor module for tiny embedded systems. +/ This is a free software that opened for education, research and commercial +/ developments under license policy of following terms. +/ +/ Copyright (C) 2012, ChaN, all right reserved. +/ +/ * The TJpgDec module is a free software and there is NO WARRANTY. +/ * No restriction on use. You can use, modify and redistribute it for +/ personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY. +/ * Redistributions of source code must retain the above copyright notice. +/ +/-----------------------------------------------------------------------------/ +/ Oct 04,'11 R0.01 First release. +/ Feb 19,'12 R0.01a Fixed decompression fails when scan starts with an escape seq. +/ Sep 03,'12 R0.01b Added JD_TBLCLIP option. +/----------------------------------------------------------------------------*/ + +#include "tjpgd.h" + +#define SUPPORT_JPEG 1 + +#ifdef SUPPORT_JPEG +/*-----------------------------------------------*/ +/* Zigzag-order to raster-order conversion table */ +/*-----------------------------------------------*/ + +#define ZIG(n) Zig[n] + +static +const BYTE Zig[64] = { /* Zigzag-order to raster-order conversion table */ + 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63 +}; + + + +/*-------------------------------------------------*/ +/* Input scale factor of Arai algorithm */ +/* (scaled up 16 bits for fixed point operations) */ +/*-------------------------------------------------*/ + +#define IPSF(n) Ipsf[n] + +static +const WORD Ipsf[64] = { /* See also aa_idct.png */ + (WORD)(1.00000*8192), (WORD)(1.38704*8192), (WORD)(1.30656*8192), (WORD)(1.17588*8192), (WORD)(1.00000*8192), (WORD)(0.78570*8192), (WORD)(0.54120*8192), (WORD)(0.27590*8192), + (WORD)(1.38704*8192), (WORD)(1.92388*8192), (WORD)(1.81226*8192), (WORD)(1.63099*8192), (WORD)(1.38704*8192), (WORD)(1.08979*8192), (WORD)(0.75066*8192), (WORD)(0.38268*8192), + (WORD)(1.30656*8192), (WORD)(1.81226*8192), (WORD)(1.70711*8192), (WORD)(1.53636*8192), (WORD)(1.30656*8192), (WORD)(1.02656*8192), (WORD)(0.70711*8192), (WORD)(0.36048*8192), + (WORD)(1.17588*8192), (WORD)(1.63099*8192), (WORD)(1.53636*8192), (WORD)(1.38268*8192), (WORD)(1.17588*8192), (WORD)(0.92388*8192), (WORD)(0.63638*8192), (WORD)(0.32442*8192), + (WORD)(1.00000*8192), (WORD)(1.38704*8192), (WORD)(1.30656*8192), (WORD)(1.17588*8192), (WORD)(1.00000*8192), (WORD)(0.78570*8192), (WORD)(0.54120*8192), (WORD)(0.27590*8192), + (WORD)(0.78570*8192), (WORD)(1.08979*8192), (WORD)(1.02656*8192), (WORD)(0.92388*8192), (WORD)(0.78570*8192), (WORD)(0.61732*8192), (WORD)(0.42522*8192), (WORD)(0.21677*8192), + (WORD)(0.54120*8192), (WORD)(0.75066*8192), (WORD)(0.70711*8192), (WORD)(0.63638*8192), (WORD)(0.54120*8192), (WORD)(0.42522*8192), (WORD)(0.29290*8192), (WORD)(0.14932*8192), + (WORD)(0.27590*8192), (WORD)(0.38268*8192), (WORD)(0.36048*8192), (WORD)(0.32442*8192), (WORD)(0.27590*8192), (WORD)(0.21678*8192), (WORD)(0.14932*8192), (WORD)(0.07612*8192) +}; + + + +/*---------------------------------------------*/ +/* Conversion table for fast clipping process */ +/*---------------------------------------------*/ + +#if JD_TBLCLIP + +#define BYTECLIP(v) Clip8[(UINT)(v) & 0x3FF] + +static +const BYTE Clip8[1024] = { + /* 0..255 */ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + /* 256..511 */ + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + /* -512..-257 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /* -256..-1 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +#else /* JD_TBLCLIP */ + +inline +BYTE BYTECLIP ( + INT val +) +{ + if (val < 0) val = 0; + if (val > 255) val = 255; + + return (BYTE)val; +} + +#endif + + + +/*-----------------------------------------------------------------------*/ +/* Allocate a memory block from memory pool */ +/*-----------------------------------------------------------------------*/ + +static +void* alloc_pool ( /* Pointer to allocated memory block (NULL:no memory available) */ + JDEC* jd, /* Pointer to the decompressor object */ + UINT nd /* Number of bytes to allocate */ +) +{ + char *rp = 0; + + + nd = (nd + 3) & ~3; /* Align block size to the word boundary */ + + if (jd->sz_pool >= nd) { + jd->sz_pool -= nd; + rp = (char*)jd->pool; /* Get start of available memory pool */ + jd->pool = (void*)(rp + nd); /* Allocate requierd bytes */ + } + + return (void*)rp; /* Return allocated memory block (NULL:no memory to allocate) */ +} + + + + +/*-----------------------------------------------------------------------*/ +/* Create de-quantization and prescaling tables with a DQT segment */ +/*-----------------------------------------------------------------------*/ + +static +UINT create_qt_tbl ( /* 0:OK, !0:Failed */ + JDEC* jd, /* Pointer to the decompressor object */ + const BYTE* data, /* Pointer to the quantizer tables */ + UINT ndata /* Size of input data */ +) +{ + UINT i; + BYTE d, z; + LONG *pb; + + + while (ndata) { /* Process all tables in the segment */ + if (ndata < 65) return JDR_FMT1; /* Err: table size is unaligned */ + ndata -= 65; + d = *data++; /* Get table property */ + if (d & 0xF0) return JDR_FMT1; /* Err: not 8-bit resolution */ + i = d & 3; /* Get table ID */ + pb = alloc_pool(jd, 64 * sizeof (LONG));/* Allocate a memory block for the table */ + if (!pb) return JDR_MEM1; /* Err: not enough memory */ + jd->qttbl[i] = pb; /* Register the table */ + for (i = 0; i < 64; i++) { /* Load the table */ + z = ZIG(i); /* Zigzag-order to raster-order conversion */ + pb[z] = (LONG)((DWORD)*data++ * IPSF(z)); /* Apply scale factor of Arai algorithm to the de-quantizers */ + } + } + + return JDR_OK; +} + + + + +/*-----------------------------------------------------------------------*/ +/* Create huffman code tables with a DHT segment */ +/*-----------------------------------------------------------------------*/ + +static +UINT create_huffman_tbl ( /* 0:OK, !0:Failed */ + JDEC* jd, /* Pointer to the decompressor object */ + const BYTE* data, /* Pointer to the packed huffman tables */ + UINT ndata /* Size of input data */ +) +{ + UINT i, j, b, np, cls, num; + BYTE d, *pb, *pd; + WORD hc, *ph; + + + while (ndata) { /* Process all tables in the segment */ + if (ndata < 17) return JDR_FMT1; /* Err: wrong data size */ + ndata -= 17; + d = *data++; /* Get table number and class */ + cls = (d >> 4); num = d & 0x0F; /* class = dc(0)/ac(1), table number = 0/1 */ + if (d & 0xEE) return JDR_FMT1; /* Err: invalid class/number */ + pb = alloc_pool(jd, 16); /* Allocate a memory block for the bit distribution table */ + if (!pb) return JDR_MEM1; /* Err: not enough memory */ + jd->huffbits[num][cls] = pb; + for (np = i = 0; i < 16; i++) { /* Load number of patterns for 1 to 16-bit code */ + pb[i] = b = *data++; + np += b; /* Get sum of code words for each code */ + } + + ph = alloc_pool(jd, np * sizeof (WORD));/* Allocate a memory block for the code word table */ + if (!ph) return JDR_MEM1; /* Err: not enough memory */ + jd->huffcode[num][cls] = ph; + hc = 0; + for (j = i = 0; i < 16; i++) { /* Re-build huffman code word table */ + b = pb[i]; + while (b--) ph[j++] = hc++; + hc <<= 1; + } + + if (ndata < np) return JDR_FMT1; /* Err: wrong data size */ + ndata -= np; + pd = alloc_pool(jd, np); /* Allocate a memory block for the decoded data */ + if (!pd) return JDR_MEM1; /* Err: not enough memory */ + jd->huffdata[num][cls] = pd; + for (i = 0; i < np; i++) { /* Load decoded data corresponds to each code ward */ + d = *data++; + if (!cls && d > 11) return JDR_FMT1; + *pd++ = d; + } + } + + return JDR_OK; +} + + + + +/*-----------------------------------------------------------------------*/ +/* Extract N bits from input stream */ +/*-----------------------------------------------------------------------*/ + +static +INT bitext ( /* >=0: extracted data, <0: error code */ + JDEC* jd, /* Pointer to the decompressor object */ + UINT nbit /* Number of bits to extract (1 to 11) */ +) +{ + BYTE msk, s, *dp; + UINT dc, v, f; + + + msk = jd->dmsk; dc = jd->dctr; dp = jd->dptr; /* Bit mask, number of data available, read ptr */ + s = *dp; v = f = 0; + do { + if (!msk) { /* Next byte? */ + if (!dc) { /* No input data is available, re-fill input buffer */ + dp = jd->inbuf; /* Top of input buffer */ + dc = jd->infunc(jd, dp, JD_SZBUF); + if (!dc) return 0 - (INT)JDR_INP; /* Err: read error or wrong stream termination */ + } else { + dp++; /* Next data ptr */ + } + dc--; /* Decrement number of available bytes */ + if (f) { /* In flag sequence? */ + f = 0; /* Exit flag sequence */ + if (*dp != 0) return 0 - (INT)JDR_FMT1; /* Err: unexpected flag is detected (may be collapted data) */ + *dp = s = 0xFF; /* The flag is a data 0xFF */ + } else { + s = *dp; /* Get next data byte */ + if (s == 0xFF) { /* Is start of flag sequence? */ + f = 1; continue; /* Enter flag sequence */ + } + } + msk = 0x80; /* Read from MSB */ + } + v <<= 1; /* Get a bit */ + if (s & msk) v++; + msk >>= 1; + nbit--; + } while (nbit); + jd->dmsk = msk; jd->dctr = dc; jd->dptr = dp; + + return (INT)v; +} + + + + +/*-----------------------------------------------------------------------*/ +/* Extract a huffman decoded data from input stream */ +/*-----------------------------------------------------------------------*/ + +static +INT huffext ( /* >=0: decoded data, <0: error code */ + JDEC* jd, /* Pointer to the decompressor object */ + const BYTE* hbits, /* Pointer to the bit distribution table */ + const WORD* hcode, /* Pointer to the code word table */ + const BYTE* hdata /* Pointer to the data table */ +) +{ + BYTE msk, s, *dp; + UINT dc, v, f, bl, nd; + + + msk = jd->dmsk; dc = jd->dctr; dp = jd->dptr; /* Bit mask, number of data available, read ptr */ + s = *dp; v = f = 0; + bl = 16; /* Max code length */ + do { + if (!msk) { /* Next byte? */ + if (!dc) { /* No input data is available, re-fill input buffer */ + dp = jd->inbuf; /* Top of input buffer */ + dc = jd->infunc(jd, dp, JD_SZBUF); + if (!dc) return 0 - (INT)JDR_INP; /* Err: read error or wrong stream termination */ + } else { + dp++; /* Next data ptr */ + } + dc--; /* Decrement number of available bytes */ + if (f) { /* In flag sequence? */ + f = 0; /* Exit flag sequence */ + if (*dp != 0) + return 0 - (INT)JDR_FMT1; /* Err: unexpected flag is detected (may be collapted data) */ + *dp = s = 0xFF; /* The flag is a data 0xFF */ + } else { + s = *dp; /* Get next data byte */ + if (s == 0xFF) { /* Is start of flag sequence? */ + f = 1; continue; /* Enter flag sequence, get trailing byte */ + } + } + msk = 0x80; /* Read from MSB */ + } + v <<= 1; /* Get a bit */ + if (s & msk) v++; + msk >>= 1; + + for (nd = *hbits++; nd; nd--) { /* Search the code word in this bit length */ + if (v == *hcode++) { /* Matched? */ + jd->dmsk = msk; jd->dctr = dc; jd->dptr = dp; + return *hdata; /* Return the decoded data */ + } + hdata++; + } + bl--; + } while (bl); + + return 0 - (INT)JDR_FMT1; /* Err: code not found (may be collapted data) */ +} + + + + +/*-----------------------------------------------------------------------*/ +/* Apply Inverse-DCT in Arai Algorithm (see also aa_idct.png) */ +/*-----------------------------------------------------------------------*/ + +static +void block_idct ( + LONG* src, /* Input block data (de-quantized and pre-scaled for Arai Algorithm) */ + BYTE* dst /* Pointer to the destination to store the block as byte array */ +) +{ + const LONG M13 = (LONG)(1.41421*4096), M2 = (LONG)(1.08239*4096), M4 = (LONG)(2.61313*4096), M5 = (LONG)(1.84776*4096); + LONG v0, v1, v2, v3, v4, v5, v6, v7; + LONG t10, t11, t12, t13; + UINT i; + + /* Process columns */ + for (i = 0; i < 8; i++) { + v0 = src[8 * 0]; /* Get even elements */ + v1 = src[8 * 2]; + v2 = src[8 * 4]; + v3 = src[8 * 6]; + + t10 = v0 + v2; /* Process the even elements */ + t12 = v0 - v2; + t11 = (v1 - v3) * M13 >> 12; + v3 += v1; + t11 -= v3; + v0 = t10 + v3; + v3 = t10 - v3; + v1 = t11 + t12; + v2 = t12 - t11; + + v4 = src[8 * 7]; /* Get odd elements */ + v5 = src[8 * 1]; + v6 = src[8 * 5]; + v7 = src[8 * 3]; + + t10 = v5 - v4; /* Process the odd elements */ + t11 = v5 + v4; + t12 = v6 - v7; + v7 += v6; + v5 = (t11 - v7) * M13 >> 12; + v7 += t11; + t13 = (t10 + t12) * M5 >> 12; + v4 = t13 - (t10 * M2 >> 12); + v6 = t13 - (t12 * M4 >> 12) - v7; + v5 -= v6; + v4 -= v5; + + src[8 * 0] = v0 + v7; /* Write-back transformed values */ + src[8 * 7] = v0 - v7; + src[8 * 1] = v1 + v6; + src[8 * 6] = v1 - v6; + src[8 * 2] = v2 + v5; + src[8 * 5] = v2 - v5; + src[8 * 3] = v3 + v4; + src[8 * 4] = v3 - v4; + + src++; /* Next column */ + } + + /* Process rows */ + src -= 8; + for (i = 0; i < 8; i++) { + v0 = src[0] + (128L << 8); /* Get even elements (remove DC offset (-128) here) */ + v1 = src[2]; + v2 = src[4]; + v3 = src[6]; + + t10 = v0 + v2; /* Process the even elements */ + t12 = v0 - v2; + t11 = (v1 - v3) * M13 >> 12; + v3 += v1; + t11 -= v3; + v0 = t10 + v3; + v3 = t10 - v3; + v1 = t11 + t12; + v2 = t12 - t11; + + v4 = src[7]; /* Get odd elements */ + v5 = src[1]; + v6 = src[5]; + v7 = src[3]; + + t10 = v5 - v4; /* Process the odd elements */ + t11 = v5 + v4; + t12 = v6 - v7; + v7 += v6; + v5 = (t11 - v7) * M13 >> 12; + v7 += t11; + t13 = (t10 + t12) * M5 >> 12; + v4 = t13 - (t10 * M2 >> 12); + v6 = t13 - (t12 * M4 >> 12) - v7; + v5 -= v6; + v4 -= v5; + + dst[0] = BYTECLIP((v0 + v7) >> 8); /* Descale the transformed values 8 bits and output */ + dst[7] = BYTECLIP((v0 - v7) >> 8); + dst[1] = BYTECLIP((v1 + v6) >> 8); + dst[6] = BYTECLIP((v1 - v6) >> 8); + dst[2] = BYTECLIP((v2 + v5) >> 8); + dst[5] = BYTECLIP((v2 - v5) >> 8); + dst[3] = BYTECLIP((v3 + v4) >> 8); + dst[4] = BYTECLIP((v3 - v4) >> 8); + dst += 8; + + src += 8; /* Next row */ + } +} + + + + +/*-----------------------------------------------------------------------*/ +/* Load all blocks in the MCU into working buffer */ +/*-----------------------------------------------------------------------*/ + +static +JRESULT mcu_load ( + JDEC* jd /* Pointer to the decompressor object */ +) +{ + LONG *tmp = (LONG*)jd->workbuf; /* Block working buffer for de-quantize and IDCT */ + UINT blk, nby, nbc, i, z, id, cmp; + INT b, d, e; + BYTE *bp; + const BYTE *hb, *hd; + const WORD *hc; + const LONG *dqf; + + + nby = jd->msx * jd->msy; /* Number of Y blocks (1, 2 or 4) */ + nbc = 2; /* Number of C blocks (2) */ + bp = jd->mcubuf; /* Pointer to the first block */ + + for (blk = 0; blk < nby + nbc; blk++) { + cmp = (blk < nby) ? 0 : blk - nby + 1; /* Component number 0:Y, 1:Cb, 2:Cr */ + id = cmp ? 1 : 0; /* Huffman table ID of the component */ + + /* Extract a DC element from input stream */ + hb = jd->huffbits[id][0]; /* Huffman table for the DC element */ + hc = jd->huffcode[id][0]; + hd = jd->huffdata[id][0]; + b = huffext(jd, hb, hc, hd); /* Extract a huffman coded data (bit length) */ + if (b < 0) return 0 - b; /* Err: invalid code or input */ + d = jd->dcv[cmp]; /* DC value of previous block */ + if (b) { /* If there is any difference from previous block */ + e = bitext(jd, b); /* Extract data bits */ + if (e < 0) return 0 - e; /* Err: input */ + b = 1 << (b - 1); /* MSB position */ + if (!(e & b)) e -= (b << 1) - 1; /* Restore sign if needed */ + d += e; /* Get current value */ + jd->dcv[cmp] = (SHORT)d; /* Save current DC value for next block */ + } + dqf = jd->qttbl[jd->qtid[cmp]]; /* De-quantizer table ID for this component */ + tmp[0] = d * dqf[0] >> 8; /* De-quantize, apply scale factor of Arai algorithm and descale 8 bits */ + + /* Extract following 63 AC elements from input stream */ + for (i = 1; i < 64; i++) tmp[i] = 0; /* Clear rest of elements */ + hb = jd->huffbits[id][1]; /* Huffman table for the AC elements */ + hc = jd->huffcode[id][1]; + hd = jd->huffdata[id][1]; + i = 1; /* Top of the AC elements */ + do { + b = huffext(jd, hb, hc, hd); /* Extract a huffman coded value (zero runs and bit length) */ + if (b == 0) break; /* EOB? */ + if (b < 0) return 0 - b; /* Err: invalid code or input error */ + z = (UINT)b >> 4; /* Number of leading zero elements */ + if (z) { + i += z; /* Skip zero elements */ + if (i >= 64) return JDR_FMT1; /* Too long zero run */ + } + if (b &= 0x0F) { /* Bit length */ + d = bitext(jd, b); /* Extract data bits */ + if (d < 0) return 0 - d; /* Err: input device */ + b = 1 << (b - 1); /* MSB position */ + if (!(d & b)) d -= (b << 1) - 1;/* Restore negative value if needed */ + z = ZIG(i); /* Zigzag-order to raster-order converted index */ + tmp[z] = d * dqf[z] >> 8; /* De-quantize, apply scale factor of Arai algorithm and descale 8 bits */ + } + } while (++i < 64); /* Next AC element */ + + if (JD_USE_SCALE && jd->scale == 3) + *bp = (*tmp / 256) + 128; /* If scale ratio is 1/8, IDCT can be ommited and only DC element is used */ + else + block_idct(tmp, bp); /* Apply IDCT and store the block to the MCU buffer */ + + bp += 64; /* Next block */ + } + + return JDR_OK; /* All blocks have been loaded successfully */ +} + + + + +/*-----------------------------------------------------------------------*/ +/* Output an MCU: Convert YCrCb to RGB and output it in RGB form */ +/*-----------------------------------------------------------------------*/ + +static +JRESULT mcu_output ( + JDEC* jd, /* Pointer to the decompressor object */ + UINT (*outfunc)(JDEC*, void*, JRECT*), /* RGB output function */ + UINT x, /* MCU position in the image (left of the MCU) */ + UINT y /* MCU position in the image (top of the MCU) */ +) +{ + const INT CVACC = (sizeof (INT) > 2) ? 1024 : 128; + UINT ix, iy, mx, my, rx, ry; + INT yy, cb, cr; + BYTE *py, *pc, *rgb24; + JRECT rect; + + + mx = jd->msx * 8; my = jd->msy * 8; /* MCU size (pixel) */ + rx = (x + mx <= jd->width) ? mx : jd->width - x; /* Output rectangular size (it may be clipped at right/bottom end) */ + ry = (y + my <= jd->height) ? my : jd->height - y; + if (JD_USE_SCALE) { + rx >>= jd->scale; ry >>= jd->scale; + if (!rx || !ry) return JDR_OK; /* Skip this MCU if all pixel is to be rounded off */ + x >>= jd->scale; y >>= jd->scale; + } + rect.left = x; rect.right = x + rx - 1; /* Rectangular area in the frame buffer */ + rect.top = y; rect.bottom = y + ry - 1; + + + if (!JD_USE_SCALE || jd->scale != 3) { /* Not for 1/8 scaling */ + + /* Build an RGB MCU from discrete comopnents */ + rgb24 = (BYTE*)jd->workbuf; + for (iy = 0; iy < my; iy++) { + pc = jd->mcubuf; + py = pc + iy * 8; + if (my == 16) { /* Double block height? */ + pc += 64 * 4 + (iy >> 1) * 8; + if (iy >= 8) py += 64; + } else { /* Single block height */ + pc += mx * 8 + iy * 8; + } + for (ix = 0; ix < mx; ix++) { + cb = pc[0] - 128; /* Get Cb/Cr component and restore right level */ + cr = pc[64] - 128; + if (mx == 16) { /* Double block width? */ + if (ix == 8) py += 64 - 8; /* Jump to next block if double block heigt */ + pc += ix & 1; /* Increase chroma pointer every two pixels */ + } else { /* Single block width */ + pc++; /* Increase chroma pointer every pixel */ + } + yy = *py++; /* Get Y component */ + + /* Convert YCbCr to RGB */ + *rgb24++ = /* R */ BYTECLIP(yy + ((INT)(1.402 * CVACC) * cr) / CVACC); + *rgb24++ = /* G */ BYTECLIP(yy - ((INT)(0.344 * CVACC) * cb + (INT)(0.714 * CVACC) * cr) / CVACC); + *rgb24++ = /* B */ BYTECLIP(yy + ((INT)(1.772 * CVACC) * cb) / CVACC); + } + } + + /* Descale the MCU rectangular if needed */ + if (JD_USE_SCALE && jd->scale) { + UINT x, y, r, g, b, s, w, a; + BYTE *op; + + /* Get averaged RGB value of each square correcponds to a pixel */ + s = jd->scale * 2; /* Bumber of shifts for averaging */ + w = 1 << jd->scale; /* Width of square */ + a = (mx - w) * 3; /* Bytes to skip for next line in the square */ + op = (BYTE*)jd->workbuf; + for (iy = 0; iy < my; iy += w) { + for (ix = 0; ix < mx; ix += w) { + rgb24 = (BYTE*)jd->workbuf + (iy * mx + ix) * 3; + r = g = b = 0; + for (y = 0; y < w; y++) { /* Accumulate RGB value in the square */ + for (x = 0; x < w; x++) { + r += *rgb24++; + g += *rgb24++; + b += *rgb24++; + } + rgb24 += a; + } /* Put the averaged RGB value as a pixel */ + *op++ = (BYTE)(r >> s); + *op++ = (BYTE)(g >> s); + *op++ = (BYTE)(b >> s); + } + } + } + + } else { /* For only 1/8 scaling (left-top pixel in each block are the DC value of the block) */ + + /* Build a 1/8 descaled RGB MCU from discrete comopnents */ + rgb24 = (BYTE*)jd->workbuf; + pc = jd->mcubuf + mx * my; + cb = pc[0] - 128; /* Get Cb/Cr component and restore right level */ + cr = pc[64] - 128; + for (iy = 0; iy < my; iy += 8) { + py = jd->mcubuf; + if (iy == 8) py += 64 * 2; + for (ix = 0; ix < mx; ix += 8) { + yy = *py; /* Get Y component */ + py += 64; + + /* Convert YCbCr to RGB */ + *rgb24++ = /* R */ BYTECLIP(yy + ((INT)(1.402 * CVACC) * cr / CVACC)); + *rgb24++ = /* G */ BYTECLIP(yy - ((INT)(0.344 * CVACC) * cb + (INT)(0.714 * CVACC) * cr) / CVACC); + *rgb24++ = /* B */ BYTECLIP(yy + ((INT)(1.772 * CVACC) * cb / CVACC)); + } + } + } + + /* Squeeze up pixel table if a part of MCU is to be truncated */ + mx >>= jd->scale; + if (rx < mx) { + BYTE *s, *d; + UINT x, y; + + s = d = (BYTE*)jd->workbuf; + for (y = 0; y < ry; y++) { + for (x = 0; x < rx; x++) { /* Copy effective pixels */ + *d++ = *s++; + *d++ = *s++; + *d++ = *s++; + } + s += (mx - rx) * 3; /* Skip truncated pixels */ + } + } + + /* Convert RGB888 to RGB565 if needed */ + if (JD_FORMAT == 1) { + BYTE *s = (BYTE*)jd->workbuf; + WORD w, *d = (WORD*)s; + UINT n = rx * ry; + + do { + w = (*s++ & 0xF8) << 8; /* RRRRR----------- */ + w |= (*s++ & 0xFC) << 3; /* -----GGGGGG----- */ + w |= *s++ >> 3; /* -----------BBBBB */ + *d++ = w; + } while (--n); + } + + /* Output the RGB rectangular */ + return outfunc(jd, jd->workbuf, &rect) ? JDR_OK : JDR_INTR; +} + + + + +/*-----------------------------------------------------------------------*/ +/* Process restart interval */ +/*-----------------------------------------------------------------------*/ + +static +JRESULT restart ( + JDEC* jd, /* Pointer to the decompressor object */ + WORD rstn /* Expected restert sequense number */ +) +{ + UINT i, dc; + WORD d; + BYTE *dp; + + + /* Discard padding bits and get two bytes from the input stream */ + dp = jd->dptr; dc = jd->dctr; + d = 0; + for (i = 0; i < 2; i++) { + if (!dc) { /* No input data is available, re-fill input buffer */ + dp = jd->inbuf; + dc = jd->infunc(jd, dp, JD_SZBUF); + if (!dc) return JDR_INP; + } else { + dp++; + } + dc--; + d = (d << 8) | *dp; /* Get a byte */ + } + jd->dptr = dp; jd->dctr = dc; jd->dmsk = 0; + + /* Check the marker */ + if ((d & 0xFFD8) != 0xFFD0 || (d & 7) != (rstn & 7)) + return JDR_FMT1; /* Err: expected RSTn marker is not detected (may be collapted data) */ + + /* Reset DC offset */ + jd->dcv[2] = jd->dcv[1] = jd->dcv[0] = 0; + + return JDR_OK; +} + + + + +/*-----------------------------------------------------------------------*/ +/* Analyze the JPEG image and Initialize decompressor object */ +/*-----------------------------------------------------------------------*/ + +#define LDB_WORD(ptr) (WORD)(((WORD)*((BYTE*)(ptr))<<8)|(WORD)*(BYTE*)((ptr)+1)) + + +JRESULT jd_prepare ( + JDEC* jd, /* Blank decompressor object */ + UINT (*infunc)(JDEC*, BYTE*, UINT), /* JPEG strem input function */ + void* pool, /* Working buffer for the decompression session */ + UINT sz_pool, /* Size of working buffer */ + void* dev /* I/O device identifier for the session */ +) +{ + BYTE *seg, b; + WORD marker; + DWORD ofs; + UINT n, i, j, len; + JRESULT rc; + + + if (!pool) return JDR_PAR; + + jd->pool = pool; /* Work memroy */ + jd->sz_pool = sz_pool; /* Size of given work memory */ + jd->infunc = infunc; /* Stream input function */ + jd->device = dev; /* I/O device identifier */ + jd->nrst = 0; /* No restart interval (default) */ + + for (i = 0; i < 2; i++) { /* Nulls pointers */ + for (j = 0; j < 2; j++) { + jd->huffbits[i][j] = 0; + jd->huffcode[i][j] = 0; + jd->huffdata[i][j] = 0; + } + } + for (i = 0; i < 4; i++) jd->qttbl[i] = 0; + + jd->inbuf = seg = alloc_pool(jd, JD_SZBUF); /* Allocate stream input buffer */ + if (!seg) return JDR_MEM1; + + if (jd->infunc(jd, seg, 2) != 2) return JDR_INP;/* Check SOI marker */ + if (LDB_WORD(seg) != 0xFFD8) return JDR_FMT1; /* Err: SOI is not detected */ + ofs = 2; + + for (;;) { + /* Get a JPEG marker */ + if (jd->infunc(jd, seg, 4) != 4) return JDR_INP; + marker = LDB_WORD(seg); /* Marker */ + len = LDB_WORD(seg + 2); /* Length field */ + if (len <= 2 || (marker >> 8) != 0xFF) return JDR_FMT1; + len -= 2; /* Content size excluding length field */ + ofs += 4 + len; /* Number of bytes loaded */ + + switch (marker & 0xFF) { + case 0xC0: /* SOF0 (baseline JPEG) */ + /* Load segment data */ + if (len > JD_SZBUF) return JDR_MEM2; + if (jd->infunc(jd, seg, len) != len) return JDR_INP; + + jd->width = LDB_WORD(seg+3); /* Image width in unit of pixel */ + jd->height = LDB_WORD(seg+1); /* Image height in unit of pixel */ + if (seg[5] != 3) return JDR_FMT3; /* Err: Supports only Y/Cb/Cr format */ + + /* Check three image components */ + for (i = 0; i < 3; i++) { + b = seg[7 + 3 * i]; /* Get sampling factor */ + if (!i) { /* Y component */ + if (b != 0x11 && b != 0x22 && b != 0x21)/* Check sampling factor */ + return JDR_FMT3; /* Err: Supports only 4:4:4, 4:2:0 or 4:2:2 */ + jd->msx = b >> 4; jd->msy = b & 15; /* Size of MCU [blocks] */ + } else { /* Cb/Cr component */ + if (b != 0x11) return JDR_FMT3; /* Err: Sampling factor of Cr/Cb must be 1 */ + } + b = seg[8 + 3 * i]; /* Get dequantizer table ID for this component */ + if (b > 3) return JDR_FMT3; /* Err: Invalid ID */ + jd->qtid[i] = b; + } + break; + + case 0xDD: /* DRI */ + /* Load segment data */ + if (len > JD_SZBUF) return JDR_MEM2; + if (jd->infunc(jd, seg, len) != len) return JDR_INP; + + /* Get restart interval (MCUs) */ + jd->nrst = LDB_WORD(seg); + break; + + case 0xC4: /* DHT */ + /* Load segment data */ + if (len > JD_SZBUF) return JDR_MEM2; + if (jd->infunc(jd, seg, len) != len) return JDR_INP; + + /* Create huffman tables */ + rc = create_huffman_tbl(jd, seg, len); + if (rc) return rc; + break; + + case 0xDB: /* DQT */ + /* Load segment data */ + if (len > JD_SZBUF) return JDR_MEM2; + if (jd->infunc(jd, seg, len) != len) return JDR_INP; + + /* Create de-quantizer tables */ + rc = create_qt_tbl(jd, seg, len); + if (rc) return rc; + break; + + case 0xDA: /* SOS */ + /* Load segment data */ + if (len > JD_SZBUF) return JDR_MEM2; + if (jd->infunc(jd, seg, len) != len) return JDR_INP; + + if (!jd->width || !jd->height) return JDR_FMT1; /* Err: Invalid image size */ + + if (seg[0] != 3) return JDR_FMT3; /* Err: Supports only three color components format */ + + /* Check if all tables corresponding to each components have been loaded */ + for (i = 0; i < 3; i++) { + b = seg[2 + 2 * i]; /* Get huffman table ID */ + if (b != 0x00 && b != 0x11) return JDR_FMT3; /* Err: Different table number for DC/AC element */ + b = i ? 1 : 0; + if (!jd->huffbits[b][0] || !jd->huffbits[b][1]) /* Check huffman table for this component */ + return JDR_FMT1; /* Err: Huffman table not loaded */ + if (!jd->qttbl[jd->qtid[i]]) return JDR_FMT1; /* Err: Dequantizer table not loaded */ + } + + /* Allocate working buffer for MCU and RGB */ + n = jd->msy * jd->msx; /* Number of Y blocks in the MCU */ + if (!n) return JDR_FMT1; /* Err: SOF0 has not been loaded */ + len = n * 64 * 2 + 64; /* Allocate buffer for IDCT and RGB output */ + if (len < 256) len = 256; /* but at least 256 byte is required for IDCT */ + jd->workbuf = alloc_pool(jd, len); /* and it may occupy a part of following MCU working buffer for RGB output */ + if (!jd->workbuf) return JDR_MEM1; /* Err: not enough memory */ + jd->mcubuf = alloc_pool(jd, (n + 2) * 64); /* Allocate MCU working buffer */ + if (!jd->mcubuf) return JDR_MEM1; /* Err: not enough memory */ + + /* Pre-load the JPEG data to extract it from the bit stream */ + jd->dptr = seg; jd->dctr = 0; jd->dmsk = 0; /* Prepare to read bit stream */ + if (ofs %= JD_SZBUF) { /* Align read offset to JD_SZBUF */ + jd->dctr = jd->infunc(jd, seg + ofs, JD_SZBUF - (UINT)ofs); + jd->dptr = seg + ofs - 1; + } + + return JDR_OK; /* Initialization succeeded. Ready to decompress the JPEG image. */ + + case 0xC1: /* SOF1 */ + case 0xC2: /* SOF2 */ + case 0xC3: /* SOF3 */ + case 0xC5: /* SOF5 */ + case 0xC6: /* SOF6 */ + case 0xC7: /* SOF7 */ + case 0xC9: /* SOF9 */ + case 0xCA: /* SOF10 */ + case 0xCB: /* SOF11 */ + case 0xCD: /* SOF13 */ + case 0xCE: /* SOF14 */ + case 0xCF: /* SOF15 */ + case 0xD9: /* EOI */ + return JDR_FMT3; /* Unsuppoted JPEG standard (may be progressive JPEG) */ + + default: /* Unknown segment (comment, exif or etc..) */ + /* Skip segment data */ + if (jd->infunc(jd, 0, len) != len) /* Null pointer specifies to skip bytes of stream */ + return JDR_INP; + } + } +} + + + + +/*-----------------------------------------------------------------------*/ +/* Start to decompress the JPEG picture */ +/*-----------------------------------------------------------------------*/ + +JRESULT jd_decomp ( + JDEC* jd, /* Initialized decompression object */ + UINT (*outfunc)(JDEC*, void*, JRECT*), /* RGB output function */ + BYTE scale /* Output de-scaling factor (0 to 3) */ +) +{ + UINT x, y, mx, my; + WORD rst, rsc; + JRESULT rc; + + + if (scale > (JD_USE_SCALE ? 3 : 0)) return JDR_PAR; + jd->scale = scale; + + mx = jd->msx * 8; my = jd->msy * 8; /* Size of the MCU (pixel) */ + + jd->dcv[2] = jd->dcv[1] = jd->dcv[0] = 0; /* Initialize DC values */ + rst = rsc = 0; + + rc = JDR_OK; + for (y = 0; y < jd->height; y += my) { /* Vertical loop of MCUs */ + for (x = 0; x < jd->width; x += mx) { /* Horizontal loop of MCUs */ + if (jd->nrst && rst++ == jd->nrst) { /* Process restart interval if enabled */ + rc = restart(jd, rsc++); + if (rc != JDR_OK) return rc; + rst = 1; + } + rc = mcu_load(jd); /* Load an MCU (decompress huffman coded stream and apply IDCT) */ + if (rc != JDR_OK) return rc; + rc = mcu_output(jd, outfunc, x, y); /* Output the MCU (color space conversion, scaling and output) */ + if (rc != JDR_OK) return rc; + } + } + + return rc; +} +#endif//SUPPORT_JPEG + + diff --git a/lib/libesp32_div/esp32-camera/target/esp32s3/ll_cam.c b/lib/libesp32_div/esp32-camera/target/esp32s3/ll_cam.c new file mode 100644 index 000000000..9a1f185c4 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/target/esp32s3/ll_cam.c @@ -0,0 +1,452 @@ +// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include "soc/system_reg.h" +#include "soc/lcd_cam_struct.h" +#include "soc/lcd_cam_reg.h" +#include "soc/gdma_struct.h" +#include "soc/gdma_periph.h" +#include "soc/gdma_reg.h" +#include "ll_cam.h" +#include "cam_hal.h" + +static const char *TAG = "s3 ll_cam"; + +static void IRAM_ATTR ll_cam_vsync_isr(void *arg) +{ + //DBG_PIN_SET(1); + cam_obj_t *cam = (cam_obj_t *)arg; + BaseType_t HPTaskAwoken = pdFALSE; + + typeof(LCD_CAM.lc_dma_int_st) status = LCD_CAM.lc_dma_int_st; + if (status.val == 0) { + return; + } + + LCD_CAM.lc_dma_int_clr.val = status.val; + + if (status.cam_vsync_int_st) { + ll_cam_send_event(cam, CAM_VSYNC_EVENT, &HPTaskAwoken); + } + + if (HPTaskAwoken == pdTRUE) { + portYIELD_FROM_ISR(); + } + //DBG_PIN_SET(0); +} + +static void IRAM_ATTR ll_cam_dma_isr(void *arg) +{ + cam_obj_t *cam = (cam_obj_t *)arg; + BaseType_t HPTaskAwoken = pdFALSE; + + typeof(GDMA.channel[cam->dma_num].in.int_st) status = GDMA.channel[cam->dma_num].in.int_st; + if (status.val == 0) { + return; + } + + GDMA.channel[cam->dma_num].in.int_clr.val = status.val; + + if (status.in_suc_eof) { + ll_cam_send_event(cam, CAM_IN_SUC_EOF_EVENT, &HPTaskAwoken); + } + + if (HPTaskAwoken == pdTRUE) { + portYIELD_FROM_ISR(); + } +} + +bool ll_cam_stop(cam_obj_t *cam) +{ + if (cam->jpeg_mode || !cam->psram_mode) { + GDMA.channel[cam->dma_num].in.int_ena.in_suc_eof = 0; + GDMA.channel[cam->dma_num].in.int_clr.in_suc_eof = 1; + } + GDMA.channel[cam->dma_num].in.link.stop = 1; + return true; +} + +esp_err_t ll_cam_deinit(cam_obj_t *cam) +{ + if (cam->cam_intr_handle) { + esp_intr_free(cam->cam_intr_handle); + cam->cam_intr_handle = NULL; + } + + if (cam->dma_intr_handle) { + esp_intr_free(cam->dma_intr_handle); + cam->dma_intr_handle = NULL; + } + GDMA.channel[cam->dma_num].in.link.addr = 0x0; + + LCD_CAM.cam_ctrl1.cam_start = 0; + LCD_CAM.cam_ctrl1.cam_reset = 1; + LCD_CAM.cam_ctrl1.cam_reset = 0; + return ESP_OK; +} + +bool ll_cam_start(cam_obj_t *cam, int frame_pos) +{ + LCD_CAM.cam_ctrl1.cam_start = 0; + + if (cam->jpeg_mode || !cam->psram_mode) { + GDMA.channel[cam->dma_num].in.int_clr.in_suc_eof = 1; + GDMA.channel[cam->dma_num].in.int_ena.in_suc_eof = 1; + } + + LCD_CAM.cam_ctrl1.cam_reset = 1; + LCD_CAM.cam_ctrl1.cam_reset = 0; + LCD_CAM.cam_ctrl1.cam_afifo_reset = 1; + LCD_CAM.cam_ctrl1.cam_afifo_reset = 0; + GDMA.channel[cam->dma_num].in.conf0.in_rst = 1; + GDMA.channel[cam->dma_num].in.conf0.in_rst = 0; + + LCD_CAM.cam_ctrl1.cam_rec_data_bytelen = cam->dma_half_buffer_size - 1; // Ping pong operation + + if (!cam->psram_mode) { + GDMA.channel[cam->dma_num].in.link.addr = ((uint32_t)&cam->dma[0]) & 0xfffff; + } else { + GDMA.channel[cam->dma_num].in.link.addr = ((uint32_t)&cam->frames[frame_pos].dma[0]) & 0xfffff; + } + + GDMA.channel[cam->dma_num].in.link.start = 1; + + LCD_CAM.cam_ctrl.cam_update = 1; + LCD_CAM.cam_ctrl1.cam_start = 1; + return true; +} + +static esp_err_t ll_cam_dma_init(cam_obj_t *cam) +{ + for (int x = (SOC_GDMA_PAIRS_PER_GROUP - 1); x >= 0; x--) { + if (GDMA.channel[x].in.link.addr == 0x0) { + cam->dma_num = x; + ESP_LOGI(TAG, "DMA Channel=%d", cam->dma_num); + break; + } + if (x == 0) { + cam_deinit(); + ESP_LOGE(TAG, "Can't found available GDMA channel"); + return ESP_FAIL; + } + } + + if (REG_GET_BIT(SYSTEM_PERIP_CLK_EN1_REG, SYSTEM_DMA_CLK_EN) == 0) { + REG_CLR_BIT(SYSTEM_PERIP_CLK_EN1_REG, SYSTEM_DMA_CLK_EN); + REG_SET_BIT(SYSTEM_PERIP_CLK_EN1_REG, SYSTEM_DMA_CLK_EN); + REG_SET_BIT(SYSTEM_PERIP_RST_EN1_REG, SYSTEM_DMA_RST); + REG_CLR_BIT(SYSTEM_PERIP_RST_EN1_REG, SYSTEM_DMA_RST); + } + + GDMA.channel[cam->dma_num].in.int_clr.val = ~0; + GDMA.channel[cam->dma_num].in.int_ena.val = 0; + + GDMA.channel[cam->dma_num].in.conf0.val = 0; + GDMA.channel[cam->dma_num].in.conf0.in_rst = 1; + GDMA.channel[cam->dma_num].in.conf0.in_rst = 0; + + //internal SRAM only + if (!cam->psram_mode) { + GDMA.channel[cam->dma_num].in.conf0.indscr_burst_en = 1; + GDMA.channel[cam->dma_num].in.conf0.in_data_burst_en = 1; + } + + GDMA.channel[cam->dma_num].in.conf1.in_check_owner = 0; + + GDMA.channel[cam->dma_num].in.peri_sel.sel = 5; + //GDMA.channel[cam->dma_num].in.pri.rx_pri = 1;//rx prio 0-15 + //GDMA.channel[cam->dma_num].in.sram_size.in_size = 6;//This register is used to configure the size of L2 Tx FIFO for Rx channel. 0:16 bytes, 1:24 bytes, 2:32 bytes, 3: 40 bytes, 4: 48 bytes, 5:56 bytes, 6: 64 bytes, 7: 72 bytes, 8: 80 bytes. + //GDMA.channel[cam->dma_num].in.wight.rx_weight = 7;//The weight of Rx channel 0-15 + return ESP_OK; +} + +esp_err_t ll_cam_config(cam_obj_t *cam, const camera_config_t *config) +{ + if (REG_GET_BIT(SYSTEM_PERIP_CLK_EN1_REG, SYSTEM_LCD_CAM_CLK_EN) == 0) { + REG_CLR_BIT(SYSTEM_PERIP_CLK_EN1_REG, SYSTEM_LCD_CAM_CLK_EN); + REG_SET_BIT(SYSTEM_PERIP_CLK_EN1_REG, SYSTEM_LCD_CAM_CLK_EN); + REG_SET_BIT(SYSTEM_PERIP_RST_EN1_REG, SYSTEM_LCD_CAM_RST); + REG_CLR_BIT(SYSTEM_PERIP_RST_EN1_REG, SYSTEM_LCD_CAM_RST); + } + + LCD_CAM.cam_ctrl.val = 0; + + LCD_CAM.cam_ctrl.cam_clkm_div_b = 0; + LCD_CAM.cam_ctrl.cam_clkm_div_a = 0; + LCD_CAM.cam_ctrl.cam_clkm_div_num = 160000000 / config->xclk_freq_hz; + LCD_CAM.cam_ctrl.cam_clk_sel = 3;//Select Camera module source clock. 0: no clock. 1: APLL. 2: CLK160. 3: no clock. + + LCD_CAM.cam_ctrl.cam_stop_en = 0; + LCD_CAM.cam_ctrl.cam_vsync_filter_thres = 4; // Filter by LCD_CAM clock + LCD_CAM.cam_ctrl.cam_update = 0; + LCD_CAM.cam_ctrl.cam_byte_order = cam->swap_data; + LCD_CAM.cam_ctrl.cam_bit_order = 0; + LCD_CAM.cam_ctrl.cam_line_int_en = 0; + LCD_CAM.cam_ctrl.cam_vs_eof_en = 0; //1: CAM_VSYNC to generate in_suc_eof. 0: in_suc_eof is controlled by reg_cam_rec_data_cyclelen + + LCD_CAM.cam_ctrl1.val = 0; + LCD_CAM.cam_ctrl1.cam_rec_data_bytelen = LCD_CAM_DMA_NODE_BUFFER_MAX_SIZE - 1; // Cannot be assigned to 0, and it is easy to overflow + LCD_CAM.cam_ctrl1.cam_line_int_num = 0; // The number of hsyncs that generate hs interrupts + LCD_CAM.cam_ctrl1.cam_clk_inv = 0; + LCD_CAM.cam_ctrl1.cam_vsync_filter_en = 1; + LCD_CAM.cam_ctrl1.cam_2byte_en = 0; + LCD_CAM.cam_ctrl1.cam_de_inv = 0; + LCD_CAM.cam_ctrl1.cam_hsync_inv = 0; + LCD_CAM.cam_ctrl1.cam_vsync_inv = 0; + LCD_CAM.cam_ctrl1.cam_vh_de_mode_en = 0; + + LCD_CAM.cam_rgb_yuv.val = 0; + + LCD_CAM.cam_ctrl.cam_update = 1; + LCD_CAM.cam_ctrl1.cam_start = 1; + + esp_err_t err = ll_cam_dma_init(cam); + if(err != ESP_OK) { + return err; + } + + return ESP_OK; +} + +void ll_cam_vsync_intr_enable(cam_obj_t *cam, bool en) +{ + LCD_CAM.lc_dma_int_clr.cam_vsync_int_clr = 1; + if (en) { + LCD_CAM.lc_dma_int_ena.cam_vsync_int_ena = 1; + } else { + LCD_CAM.lc_dma_int_ena.cam_vsync_int_ena = 0; + } +} + +esp_err_t ll_cam_set_pin(cam_obj_t *cam, const camera_config_t *config) +{ + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[config->pin_pclk], PIN_FUNC_GPIO); + gpio_set_direction(config->pin_pclk, GPIO_MODE_INPUT); + gpio_set_pull_mode(config->pin_pclk, GPIO_FLOATING); + gpio_matrix_in(config->pin_pclk, CAM_PCLK_IDX, false); + + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[config->pin_vsync], PIN_FUNC_GPIO); + gpio_set_direction(config->pin_vsync, GPIO_MODE_INPUT); + gpio_set_pull_mode(config->pin_vsync, GPIO_FLOATING); + gpio_matrix_in(config->pin_vsync, CAM_V_SYNC_IDX, cam->vsync_invert); + + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[config->pin_href], PIN_FUNC_GPIO); + gpio_set_direction(config->pin_href, GPIO_MODE_INPUT); + gpio_set_pull_mode(config->pin_href, GPIO_FLOATING); + gpio_matrix_in(config->pin_href, CAM_H_ENABLE_IDX, false); + + int data_pins[8] = { + config->pin_d0, config->pin_d1, config->pin_d2, config->pin_d3, config->pin_d4, config->pin_d5, config->pin_d6, config->pin_d7, + }; + for (int i = 0; i < 8; i++) { + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[data_pins[i]], PIN_FUNC_GPIO); + gpio_set_direction(data_pins[i], GPIO_MODE_INPUT); + gpio_set_pull_mode(data_pins[i], GPIO_FLOATING); + gpio_matrix_in(data_pins[i], CAM_DATA_IN0_IDX + i, false); + } + + PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[config->pin_xclk], PIN_FUNC_GPIO); + gpio_set_direction(config->pin_xclk, GPIO_MODE_OUTPUT); + gpio_set_pull_mode(config->pin_xclk, GPIO_FLOATING); + gpio_matrix_out(config->pin_xclk, CAM_CLK_IDX, false, false); + + return ESP_OK; +} + +esp_err_t ll_cam_init_isr(cam_obj_t *cam) +{ + esp_err_t ret = ESP_OK; + ret = esp_intr_alloc_intrstatus(gdma_periph_signals.groups[0].pairs[cam->dma_num].rx_irq_id, + ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_SHARED | ESP_INTR_FLAG_IRAM, + (uint32_t)&GDMA.channel[cam->dma_num].in.int_st, GDMA_IN_SUC_EOF_CH0_INT_ST_M, + ll_cam_dma_isr, cam, &cam->dma_intr_handle); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "DMA interrupt allocation of camera failed"); + return ret; + } + + ret = esp_intr_alloc_intrstatus(ETS_LCD_CAM_INTR_SOURCE, + ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_SHARED | ESP_INTR_FLAG_IRAM, + (uint32_t)&LCD_CAM.lc_dma_int_st.val, LCD_CAM_CAM_VSYNC_INT_ST_M, + ll_cam_vsync_isr, cam, &cam->cam_intr_handle); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "LCD_CAM interrupt allocation of camera failed"); + return ret; + } + return ESP_OK; +} + +void ll_cam_do_vsync(cam_obj_t *cam) +{ + gpio_matrix_in(cam->vsync_pin, CAM_V_SYNC_IDX, !cam->vsync_invert); + ets_delay_us(10); + gpio_matrix_in(cam->vsync_pin, CAM_V_SYNC_IDX, cam->vsync_invert); +} + +uint8_t ll_cam_get_dma_align(cam_obj_t *cam) +{ + return 16 << GDMA.channel[cam->dma_num].in.conf1.in_ext_mem_bk_size; +} + +static bool ll_cam_calc_rgb_dma(cam_obj_t *cam){ + size_t node_max = LCD_CAM_DMA_NODE_BUFFER_MAX_SIZE / cam->dma_bytes_per_item; + size_t line_width = cam->width * cam->in_bytes_per_pixel; + size_t node_size = node_max; + size_t nodes_per_line = 1; + size_t lines_per_node = 1; + + // Calculate DMA Node Size so that it's divisable by or divisor of the line width + if(line_width >= node_max){ + // One or more nodes will be requied for one line + for(size_t i = node_max; i > 0; i=i-1){ + if ((line_width % i) == 0) { + node_size = i; + nodes_per_line = line_width / node_size; + break; + } + } + } else { + // One or more lines can fit into one node + for(size_t i = node_max; i > 0; i=i-1){ + if ((i % line_width) == 0) { + node_size = i; + lines_per_node = node_size / line_width; + while((cam->height % lines_per_node) != 0){ + lines_per_node = lines_per_node - 1; + node_size = lines_per_node * line_width; + } + break; + } + } + } + + ESP_LOGI(TAG, "node_size: %4u, nodes_per_line: %u, lines_per_node: %u", + node_size * cam->dma_bytes_per_item, nodes_per_line, lines_per_node); + + cam->dma_node_buffer_size = node_size * cam->dma_bytes_per_item; + + size_t dma_half_buffer_max = CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX / 2 / cam->dma_bytes_per_item; + if (line_width > dma_half_buffer_max) { + ESP_LOGE(TAG, "Resolution too high"); + return 0; + } + + // Calculate minimum EOF size = max(mode_size, line_size) + size_t dma_half_buffer_min = node_size * nodes_per_line; + + // Calculate max EOF size divisable by node size + size_t dma_half_buffer = (dma_half_buffer_max / dma_half_buffer_min) * dma_half_buffer_min; + + // Adjust EOF size so that height will be divisable by the number of lines in each EOF + size_t lines_per_half_buffer = dma_half_buffer / line_width; + while((cam->height % lines_per_half_buffer) != 0){ + dma_half_buffer = dma_half_buffer - dma_half_buffer_min; + lines_per_half_buffer = dma_half_buffer / line_width; + } + + // Calculate DMA size + size_t dma_buffer_max = 2 * dma_half_buffer_max; + if (cam->psram_mode) { + dma_buffer_max = cam->recv_size / cam->dma_bytes_per_item; + } + size_t dma_buffer_size = dma_buffer_max; + if (!cam->psram_mode) { + dma_buffer_size =(dma_buffer_max / dma_half_buffer) * dma_half_buffer; + } + + ESP_LOGI(TAG, "dma_half_buffer_min: %5u, dma_half_buffer: %5u, lines_per_half_buffer: %2u, dma_buffer_size: %5u", + dma_half_buffer_min * cam->dma_bytes_per_item, dma_half_buffer * cam->dma_bytes_per_item, lines_per_half_buffer, dma_buffer_size * cam->dma_bytes_per_item); + + cam->dma_buffer_size = dma_buffer_size * cam->dma_bytes_per_item; + cam->dma_half_buffer_size = dma_half_buffer * cam->dma_bytes_per_item; + cam->dma_half_buffer_cnt = cam->dma_buffer_size / cam->dma_half_buffer_size; + return 1; +} + +bool ll_cam_dma_sizes(cam_obj_t *cam) +{ + cam->dma_bytes_per_item = 1; + if (cam->jpeg_mode) { + if (cam->psram_mode) { + cam->dma_buffer_size = cam->recv_size; + cam->dma_half_buffer_size = 1024; + cam->dma_half_buffer_cnt = cam->dma_buffer_size / cam->dma_half_buffer_size; + cam->dma_node_buffer_size = cam->dma_half_buffer_size; + } else { + cam->dma_half_buffer_cnt = 16; + cam->dma_buffer_size = cam->dma_half_buffer_cnt * 1024; + cam->dma_half_buffer_size = cam->dma_buffer_size / cam->dma_half_buffer_cnt; + cam->dma_node_buffer_size = cam->dma_half_buffer_size; + } + } else { + return ll_cam_calc_rgb_dma(cam); + } + return 1; +} + +size_t IRAM_ATTR ll_cam_memcpy(cam_obj_t *cam, uint8_t *out, const uint8_t *in, size_t len) +{ + // YUV to Grayscale + if (cam->in_bytes_per_pixel == 2 && cam->fb_bytes_per_pixel == 1) { + size_t end = len / 8; + for (size_t i = 0; i < end; ++i) { + out[0] = in[0]; + out[1] = in[2]; + out[2] = in[4]; + out[3] = in[6]; + out += 4; + in += 8; + } + return len / 2; + } + + // just memcpy + memcpy(out, in, len); + return len; +} + +esp_err_t ll_cam_set_sample_mode(cam_obj_t *cam, pixformat_t pix_format, uint32_t xclk_freq_hz, uint16_t sensor_pid) +{ + if (pix_format == PIXFORMAT_GRAYSCALE) { + if (sensor_pid == OV3660_PID || sensor_pid == OV5640_PID || sensor_pid == NT99141_PID) { + cam->in_bytes_per_pixel = 1; // camera sends Y8 + } else { + cam->in_bytes_per_pixel = 2; // camera sends YU/YV + } + cam->fb_bytes_per_pixel = 1; // frame buffer stores Y8 + } else if (pix_format == PIXFORMAT_YUV422 || pix_format == PIXFORMAT_RGB565) { + cam->in_bytes_per_pixel = 2; // camera sends YU/YV + cam->fb_bytes_per_pixel = 2; // frame buffer stores YU/YV/RGB565 + } else if (pix_format == PIXFORMAT_JPEG) { + cam->in_bytes_per_pixel = 1; + cam->fb_bytes_per_pixel = 1; + } else { + ESP_LOGE(TAG, "Requested format is not supported"); + return ESP_ERR_NOT_SUPPORTED; + } + return ESP_OK; +} + +// implements function from xclk.c to allow dynamic XCLK change +esp_err_t xclk_timer_conf(int ledc_timer, int xclk_freq_hz) +{ + LCD_CAM.cam_ctrl.cam_clkm_div_b = 0; + LCD_CAM.cam_ctrl.cam_clkm_div_a = 0; + LCD_CAM.cam_ctrl.cam_clkm_div_num = 160000000 / xclk_freq_hz; + LCD_CAM.cam_ctrl.cam_clk_sel = 3;//Select Camera module source clock. 0: no clock. 1: APLL. 2: CLK160. 3: no clock. + LCD_CAM.cam_ctrl.cam_update = 1; + return ESP_OK; +} diff --git a/lib/libesp32_div/esp32-camera/target/private_include/ll_cam.h b/lib/libesp32_div/esp32-camera/target/private_include/ll_cam.h new file mode 100644 index 000000000..7d30c370a --- /dev/null +++ b/lib/libesp32_div/esp32-camera/target/private_include/ll_cam.h @@ -0,0 +1,141 @@ +// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include "sdkconfig.h" +#include "esp_idf_version.h" +#if CONFIG_IDF_TARGET_ESP32 +#if ESP_IDF_VERSION_MAJOR >= 4 +#include "esp32/rom/lldesc.h" +#else +#include "rom/lldesc.h" +#endif +#elif CONFIG_IDF_TARGET_ESP32S2 +#include "esp32s2/rom/lldesc.h" +#elif CONFIG_IDF_TARGET_ESP32S3 +#include "esp32s3/rom/lldesc.h" +#endif +#include "esp_log.h" +#include "esp_camera.h" +#include "freertos/FreeRTOS.h" +#include "freertos/queue.h" +#include "freertos/task.h" +#include "freertos/semphr.h" + +#if __has_include("esp_private/periph_ctrl.h") +# include "esp_private/periph_ctrl.h" +#endif + +#define CAMERA_DBG_PIN_ENABLE 0 +#if CAMERA_DBG_PIN_ENABLE + #if CONFIG_IDF_TARGET_ESP32 + #define DBG_PIN_NUM 26 + #else + #define DBG_PIN_NUM 7 + #endif + #include "hal/gpio_ll.h" + #define DBG_PIN_SET(v) gpio_ll_set_level(&GPIO, DBG_PIN_NUM, v) +#else + #define DBG_PIN_SET(v) +#endif + +#define CAM_CHECK(a, str, ret) if (!(a)) { \ + ESP_LOGE(TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \ + return (ret); \ + } + +#define CAM_CHECK_GOTO(a, str, lab) if (!(a)) { \ + ESP_LOGE(TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \ + goto lab; \ + } + +#define LCD_CAM_DMA_NODE_BUFFER_MAX_SIZE (4092) + +typedef enum { + CAM_IN_SUC_EOF_EVENT = 0, + CAM_VSYNC_EVENT +} cam_event_t; + +typedef enum { + CAM_STATE_IDLE = 0, + CAM_STATE_READ_BUF = 1, +} cam_state_t; + +typedef struct { + camera_fb_t fb; + uint8_t en; + //for RGB/YUV modes + lldesc_t *dma; + size_t fb_offset; +} cam_frame_t; + +typedef struct { + uint32_t dma_bytes_per_item; + uint32_t dma_buffer_size; + uint32_t dma_half_buffer_size; + uint32_t dma_half_buffer_cnt; + uint32_t dma_node_buffer_size; + uint32_t dma_node_cnt; + uint32_t frame_copy_cnt; + + //for JPEG mode + lldesc_t *dma; + uint8_t *dma_buffer; + + cam_frame_t *frames; + + QueueHandle_t event_queue; + QueueHandle_t frame_buffer_queue; + TaskHandle_t task_handle; + intr_handle_t cam_intr_handle; + + uint8_t dma_num;//ESP32-S3 + intr_handle_t dma_intr_handle;//ESP32-S3 + + uint8_t jpeg_mode; + uint8_t vsync_pin; + uint8_t vsync_invert; + uint32_t frame_cnt; + uint32_t recv_size; + bool swap_data; + bool psram_mode; + + //for RGB/YUV modes + uint16_t width; + uint16_t height; + uint8_t in_bytes_per_pixel; + uint8_t fb_bytes_per_pixel; + uint32_t fb_size; + + cam_state_t state; +} cam_obj_t; + + +bool ll_cam_stop(cam_obj_t *cam); +bool ll_cam_start(cam_obj_t *cam, int frame_pos); +esp_err_t ll_cam_config(cam_obj_t *cam, const camera_config_t *config); +esp_err_t ll_cam_deinit(cam_obj_t *cam); +void ll_cam_vsync_intr_enable(cam_obj_t *cam, bool en); +esp_err_t ll_cam_set_pin(cam_obj_t *cam, const camera_config_t *config); +esp_err_t ll_cam_init_isr(cam_obj_t *cam); +void ll_cam_do_vsync(cam_obj_t *cam); +uint8_t ll_cam_get_dma_align(cam_obj_t *cam); +bool ll_cam_dma_sizes(cam_obj_t *cam); +size_t IRAM_ATTR ll_cam_memcpy(cam_obj_t *cam, uint8_t *out, const uint8_t *in, size_t len); +esp_err_t ll_cam_set_sample_mode(cam_obj_t *cam, pixformat_t pix_format, uint32_t xclk_freq_hz, uint16_t sensor_pid); + +// implemented in cam_hal +void ll_cam_send_event(cam_obj_t *cam, cam_event_t cam_event, BaseType_t * HPTaskAwoken); diff --git a/lib/libesp32_div/esp32-camera/target/xclk.c b/lib/libesp32_div/esp32-camera/target/xclk.c new file mode 100644 index 000000000..b5ea53e77 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/target/xclk.c @@ -0,0 +1,64 @@ +#include "driver/gpio.h" +#include "driver/ledc.h" +#include "esp_err.h" +#include "esp_log.h" +#include "esp_system.h" +#include "xclk.h" +#include "esp_camera.h" + +#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) +#include "esp32-hal-log.h" +#else +#include "esp_log.h" +static const char* TAG = "camera_xclk"; +#endif + +static ledc_channel_t g_ledc_channel = 0; + +esp_err_t xclk_timer_conf(int ledc_timer, int xclk_freq_hz) +{ + ledc_timer_config_t timer_conf; + timer_conf.duty_resolution = LEDC_TIMER_1_BIT; + timer_conf.freq_hz = xclk_freq_hz; + timer_conf.speed_mode = LEDC_LOW_SPEED_MODE; + +#if ESP_IDF_VERSION_MAJOR >= 4 + timer_conf.clk_cfg = LEDC_AUTO_CLK; +#endif + timer_conf.timer_num = (ledc_timer_t)ledc_timer; + esp_err_t err = ledc_timer_config(&timer_conf); + if (err != ESP_OK) { + ESP_LOGE(TAG, "ledc_timer_config failed for freq %d, rc=%x", xclk_freq_hz, err); + } + return err; +} + +esp_err_t camera_enable_out_clock(camera_config_t* config) +{ + esp_err_t err = xclk_timer_conf(config->ledc_timer, config->xclk_freq_hz); + if (err != ESP_OK) { + ESP_LOGE(TAG, "ledc_timer_config failed, rc=%x", err); + return err; + } + + g_ledc_channel = config->ledc_channel; + ledc_channel_config_t ch_conf; + ch_conf.gpio_num = config->pin_xclk; + ch_conf.speed_mode = LEDC_LOW_SPEED_MODE; + ch_conf.channel = config->ledc_channel; + ch_conf.intr_type = LEDC_INTR_DISABLE; + ch_conf.timer_sel = config->ledc_timer; + ch_conf.duty = 1; + ch_conf.hpoint = 0; + err = ledc_channel_config(&ch_conf); + if (err != ESP_OK) { + ESP_LOGE(TAG, "ledc_channel_config failed, rc=%x", err); + return err; + } + return ESP_OK; +} + +void camera_disable_out_clock() +{ + ledc_stop(LEDC_LOW_SPEED_MODE, g_ledc_channel, 0); +} diff --git a/lib/libesp32_div/esp32-camera/test/CMakeLists.txt b/lib/libesp32_div/esp32-camera/test/CMakeLists.txt new file mode 100644 index 000000000..a8c3d16b7 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/test/CMakeLists.txt @@ -0,0 +1,4 @@ +idf_component_register(SRC_DIRS . + PRIV_INCLUDE_DIRS . + PRIV_REQUIRES test_utils esp32-camera nvs_flash + EMBED_TXTFILES pictures/testimg.jpeg pictures/test_outside.jpeg pictures/test_inside.jpeg) diff --git a/lib/libesp32_div/esp32-camera/test/component.mk b/lib/libesp32_div/esp32-camera/test/component.mk new file mode 100644 index 000000000..5fb883650 --- /dev/null +++ b/lib/libesp32_div/esp32-camera/test/component.mk @@ -0,0 +1,8 @@ +# +#Component Makefile +# + +COMPONENT_SRCDIRS += ./ +COMPONENT_PRIV_INCLUDEDIRS += ./ + +COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive diff --git a/lib/libesp32_div/esp32-camera/test/pictures/test_inside.jpeg b/lib/libesp32_div/esp32-camera/test/pictures/test_inside.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..92e7bc3694e8568be514673432c3601a8c1c4126 GIT binary patch literal 18832 zcmbTdWl&r}*Dg9RxCVj-4MQNfyF;)Lg4bgvmf9O1wEs|v6TL;A1I`Jck8AOa9`(EnTW+6e&s-#YAn8UZiM z04V?v5%E9iRghj2G8!^65)v{7Dk=&Z76uj;CI%)ZHV*z9Y#clsOw2b#Z}8p{5E2q% z;S!S&5s=^$5EA_7B?!RRF-XYh$jImf*qGP^|DWZh3xJ0PfFXzj5oiF2cnCl|gqJ=5 z)hjsU*LC>MQv7d0KzyAe3Mv{p2Igyr`ZoYX1RxL*3HYB`zxMWhZ3iIXA>+U2kU)8> z@*S1Nk$^K0@*52#S=~*jIt8QUGI9z+#~>mmA$|9Oj{YM9BR3B(AHRU0)F){fSvmR7 zYU&!ATG~2bV-r&|a|=r=XBSsDcMngm;2$BOVc`*x35iL`DXD2c({uCw=NFe(*EhF!_y56#0090E ztp9`T|A7nd6&E5B5)cXXKe!MO-Cr{h4+;4_2MWG~3hH;qw=|rAXatgw-__mdATCuH zp^?)R1`#dy#s~O+p#2xw|2tqo|G$v^A7K9%*Af5=i1503KskTaUAtBF zotRR^;v;aBEu_uFn2}aV-7l%igUp;|#ndZhVbpO}KaHF`Duo&pr8dT<$S99wjhk~N zE~K+KJ2wmx^Vf6_Qy_XvL$y*gp;`u)<;I`-H$M#^!GNHM~@K8|2$5@JS1VRgpp|Zv9!XGxSrP=0~ld4fpG9EbzfHLoy z6u#ZEKP2DPn8iMSQ^yl!{3N>yEf4p|$1~1Q`NnkY1yN~;wQ>z_Y=r(H+M_55D6MX{ z9Emy7^vP_4S!#-`79kePTov5eA8Gkyf0s=>{)m{G@?7WnpK{`5-mn-LkOS{vqzjd_ zR_=yOs=dQ+F9Ndn(znaN6k_?yrO@{xEq_3!1NBMG7y#S5c@}FZ^_1k4$#11IqE)}U zm~ygHScZ^X@)X#%OYFm`%oaSHqw`X<-#s$8ua>fh0$oM&cg*Um@S%;^e1!8~bNQ7OUxK^6TKqoYVzr%gA~9~;QxTDeS#JHyW;cFL zi2iepgMm4?&qZ=9PrFlAEVaov^r}-rw|#mbhWt;@a_m z-F6HXVcZQuqI{z$V-7~~WtCBty@Z1Vsb%*HMz-4QFTT=VAf4qfJY*C}L4*wN^kUE4 zfvo`1y4lu<3_;z@UJzn|HnNSrr7ikHq2-x!`A^dFsSkvWB!#pjR+GA*Kvhg~w*qA3 z0A6qP-1*3k25r#4e4?}y3E=_oGWlgO(QMX2xkjBpVU%yCXO2L0Tn*JZ!9vvP z$=CCVe1uUG-|(qxF7UI?W!_)WBvg)=Yqe)-5IEy<%!Z^&P|c_8`gNSMje{RJ;v^Ug zL01vSi4o628j0k@x^8{e48WzUWTt(gTpwrf5lFGQ6{y^Xl-;T;GZZ+T1`Xpzh_r2@ z@64B(d?QfqNsZy^oNpW(55C|4d;Ay`&0SOnY+dEV zpv%oqT66xXUYEA`*9>~hYfO|JOHJAMw|I7|_AHs@Y~Sy4(?!w54EK&?L)#>1FJ1s< zhw|698iF`c?9b=k_mSf&Ev%f?r(R~i%sC&+(AVEEQW*Ed`4XoRJiHBML^bfWj-092 z{fp)4%ueC361i{NX6zJfJy6CGm$X@R?X)s|5Ji_vl+}vIuQCiuyecUhB0hcAu)R8K z90K79K!!Awxtg+iN)02*Sq;$FJw7P4C9tBEsu;WNn;CpcG>;s7;GK5hFK;GYF$Pl3 z5hpYYfER5{7L&KBKL2EXwwfY3^bajiP$tV);p0k~StH~G19IzB7v4@65(PihO*ci) z1#k?0c304Ft^0wLQED%TDxluX9QqO%3P6h%8gvg4?uFTBA#P0U5W2CC6G+aJO+Rh3ot|nY3mQHVwo)eqe}0 z=ih8O5$YXOiQJUnsqc*cb>T?2`mYP%SyosNEO`Nd0o@62W0Qe>j?<0*CMoBTQVeDh z#>a?JBZp^CK{Mr9o~uSNUbPtr`ai3%L{B;N2KyAGUjRQe4?dS7Y8Bo58Ezi4NdF^B zGup5-R+7QQ-tC|BTtD-a3a9b}}ry9fh;)N|b{q46nGbNib^MMjEErPT~P)oE+B z!QG@~*xuc|_kGmy#t@wCWDirjKFZvd1ta88X2t3D-R*WJ3SO7vxG&2p?Mrcjc-`39!+dhbfil|j=IE+vz%3-;t0mATC) z$7`8PG!-#_T`f#>@FE2>Le+wB%e7n6y%(3PBMdyX0R~b{8S0Zur`t|K}Xco+(KFHQk^_P z90g=zwN$~(K@_~G0C4Oo#Wam}U|8xgqgiQvFqaBLap?hI|%xl-Gp{2aEF#$uS9v<*q8qIQLVGO5qf6Yn$p8$_7Pb9 zUYitPgN2h>L^$E!a67+_S=V6Ert(d5gLE^I8E;O#nHmy&9^{YP)4E-Eq2{2+uw)`>o+Qk)>5KRRP`iZ`AA!vh-3dnyRG0CvB7g9X62F(AzN7*_m>w&TU)^7b z>+N;)#zv(}nNF-eG5vnP^uI4IRH9Eu+!KcC`7V900p42YSQ8C?jwwSI!QJ@W?TlO& ziry~{&G22?2X|dSbFFDmKQjmIiC!1RqTRm>QXtRD&UCRgosdvgFj~wVVs(zQjOCqC zOe3!X+-n{;JgaU8rsp}a|Cur&WFWl3f3@I zvaeI`W`~*3_WY>&GdYx+D)MIlj@n|l?*|gX=22QajW=uKdUP@wzd3MP#xHUg(gL`& zrf2u)AqSeq(wNf`LNwEp>+3xEs1iEyS5)BHsCtRwLUeMCTNE#h@!$;2{K_xt+{kHO z7^hH^Alg}-@ zrFGPo>$}(q@<)}!*S~qku`VaUW_xvISO~hPNT5i?EA8v~^ga2TGvp|Jt)(V%7e6*I zkUWSJ+jF;!)sO1SJO@bMV%(Xf&8Lp^nU*rERE=7QjJj&&Pu!cIS_wbmaW@$)))9s^ zmT<*|yfxhtD;KPwj{0Cd+Ux1)KjBWecTYmltn8x2wb99LXM%)0TT>j)!nNrnlQJRB zKDXb^rH(pt;nd>0oa!|h_-LSua{h8HkrHSwgYIHvGeuhIoUXpypme z*6a-8UQrGfQ8l&i+H|fr{=%J?*Sz#L2zbFpJ}X1AU}8*w5aFDuj)-=Lc6+po>@yz-r3#W-?QgEJo z_tYxK*&ind;u1a}!c@RP-++6MA;P!QS)T|fUKd3^n97da_2%=b*vn*)N!aU?`@uKJZ(u*evUTR?vuR;~pI z%inx&q&A5S<~dh?rhBz_e@wCXO)=^YXo^SnVV!Qn4NeM=?nBys^t)|1-%#x#`C?1X zPVIa7U~!^)%{1`y>|ImxWC^36Y^AQ^%;>ZJ+QJsxBO7hlYc?IC3eRD6m2jBzqefv8 z96w*Wk_h$KnQ--aPR@VxP5ir@>5;)z9x8VFcyM69K}a0=WV(?X_#N~DAbtXVGlDCn z9iNdt+4w=*xE=h7SKmUys5ilCwY-*(7U4^yvRCA6qj)h%G|4*RyQj$=)$uLRxfUhsZ@G741?gKXCQLoq2quX0yqFQ#h0FDKc8(_U_ zxKB06=jM%vk2_G8+imf~d5%!cZM-J`7_X}iNWt>qF7!yghJyov)M(p;+{D*9H$zve z8D|JS3w7O!yZt%*?2nPmWB-QgE>iI>@@8uz6GgPeH4R|0i#K?nN*{Ll1+jrQ?Ic|G zR`cJ)XqNi|j2p_cxgc1!?dzyXtTxZ_0(dX~0ua1`p z-4YRV66=ZmL^na9+b*7gdC+;*B5ywXIiAhz;OYKqO#U*HcSN`Ndx%lAX=D%AJZ08Z zSfPGHb#dBOU1Jayeoh~08gO2u*y%TUT!2lbSxb9UTT{A=CMF)FhB($yKeYjxeufGKg#-bM3BVbLvAZ+>pUSW*JfXH?UepGh^aY^wMPj^nwx$jpEx@> zYxlb@0_>TB?5;hRw#7VX6?m4wVaW76A(R78sdY5JF6a8(KFcbcKdWnHh05Hj3>%~Q z;UvFqa=+UVcw4wxYKV3#>8t9D)K5XVBov;dy`4lc#PP10yh7qw#(Grr?LKdMV-(w? z5=tC)9{2c+zvU|TP0ILVjVuY-H{=?Juba61<4m6#-?wIS80Z^s;)z7dUVgLQKXPv2 z9~UeV%lGN@6?@d0{093={e{HM;0O|_9y7fS+hm2T z*OC)=xFj~=ZZB2rYV4CnP_ymn5}k)&{c%8%ZTHvjKcE29TlAm{ROWFUj7XD0ii}z=$(?WLsH2ZV4!WiZ0 zhFon^=Cs^D!wt!{0J6eDo=vaHUVZDH2KXT#T+)^mO;h{%s`;dIW`-J)#V}=w-xcMG zb+$Y3DQX;ndK(}j!=;cc5_4y?xq2m1*-KTA(!N`B_|7-x(dw8G@`Y8LzJmW*<18E3 zk9zU;K`!=uiIjy_(_$w`6Df~PS?*}znWlqn+UD~pZQA)h5GNo(eyGyw7Fa%!@6mr* zjh+HM&YaG}T^$0Mp;E4YdqVzFylf&^f`NV|n$@rqVks$5_V+6qVIf}s=Y-Upfd(7$>vFkY4%a1kmM~*uy@5g}VDk55^0;!B@==+l7(dO}om7$AGA1DwZ0eSb z{F5TVwm#=cfKdAK47WgmWn^$YV392Y@3)}(4`?Xs)!d9Y~N*F_p zgK#*mD3~%8bl+Vz|IAq|IZ7c_MQe_$eCTQSj8`lTLj73cPs22B_sSFO)X5QQov=G( zASBf9!@y}*4euk?i2ZxoF~FcKb17kKTALr{t|A1;035*YUcwJwvH4xfhp<#4Kjr`l zRHOlfWYo;%u@e3AUmX1Oye`B^vp&`mr%UyCU>#&X>}yiSs;=qPN1z}Csod`I%vybX zHyhg)x2KmJ$pL4H3J%Z|_XnwV9Uz{@iFk~e8i2UIIrtud0h+4_N0H<0WazZ!v4V35 zyMkeTQ67&{&VN{vhg0}9<#vGYhZDb(yA0~3r;qFGXeJmYHNqg%Elfw+4*Bn66v$6C z09lV)Svi`DGe2l;yG2Uret999GGu()t*H=vH~0+;{-RPYhyufCEQ7YPsgEGx?r`OV%oLf>5aTiE&__T-4+v?|RSLmB~Dd8p0~(AQzok zKeLWZ7|UT}h|5Kzkd~!bM81Mi{_HW0vILnD1#acczb5;)7IgCiOZw9Tx=OQl-#M#D zF*zagGw-#QgO7AuvLgnvU6GT^+m=$Q9rBK^*@LwA0!F7>T;G>-Lr9_gocZ>IA_sk%wq^K3;5pA&obQVOjb z!+H2ZY-0M;6Iy|GeobA>U&X+_$-iN15z*nz(VX&>`~bUcKg1T3I-BX-mf3r!wX?|S z2xpy?LT836((;eP6ik6O&T_4o#)x$%WFD7g;o8vTUwEX2XDojX}f5I9Sy-Vg%+ z9?v}eXd6^3T$weS%Q&7%FkV$!y3W&oX^Kad)gg>5#tS#ho~5jOdQ(fi@e>wd(}Xg| z(X3XS6>*=HYK};VZs=82{x8Rqths?aOR@$pl$f%y5|54^&opB1rW&o^WC2t;gr`53 z%a)^k_rLmcJQH4I2br#IvVbz;>OTp*0DPr=N!HHE>R$jA^mp^NEYWnft|a+?C=|&8 z4rS>Hn-Qm^2>>duSy{#+H-M&@?Du!Q_6%JfeUWxzRCq;+GL{YQ7fqDO^yCT@esBs3 zg#QZ+aFoTwrk2F8cQk{%4%D*WMAMUW2@dx@q>~S!P61x zb^23mRin(vhS>vm0cn_ITph0%4UX>-!xcdjB#52by^?F{5wwXd)KAG6A8~m^Hnh3S zAkD;t{S!zZd|owlqMs6D$}RCYjxO+IJz9L)j`PDtVXfVBaG`qBJ3Xd*%@A(36ZnebjK8 zxMxDe-WPyrL`Y_lNlg=-Y5`YZkUVV=C$8}N+_YB2TX1ZHH|?!++rYg#UjtIhPtr`v zPe)BAwRZj+!>e5s2otwFPtDfrt=1xTB;Z{Xh~_5xk8BGTP_+$iYjntRf)m;nVf%(o z-GK{}t}Y%u#FD^rd&QnL%%}>fQ7zhe<)U9@@+Wfz>lsH2)8h5uc@T(sZ)e=^dnbM1 zfD&ECHQKSC{cZBd;S`_b2eriKD_=I)xa~7pAUbw~j7n^;KxLY+#(Tb>6yajA)(2uC zSkwEmzz=4qvFknZTFLXjc1<)dSw7%XEYkhl_>S<%GsYEnl*NqNPKRTp z`0lIRdYsoJTnR7FX|{dgyqBEPK4lr8DyS-C9iHWZiVCqi+9O z1-A-0)}3z5g}~Yix@_3#7Z3Wc%8Pj5@Co4!399L~i4EeO7XX2W)`0u`{l7%fYy{fyvybybP5Bwjih(O zkvBO0^?1<)XLrp5bA7yF(D?MLA4~Zwe~ErO3L7YvbYXqE`{^Lz3aBOlm{Wm=;9&!Q zg?xE!C0LASY$`Yiz@hC`kii{2N~msf!_1W6CB$WM?2Q^&AqSU<&VyVpc=>nKU;a7AJ$d+&!SLgi(7of@ zC@8b5A0yh7=3P60oXKmOand3LitsOa9vCVb9!7RhPyf{8lm{@5NMLat&9qxeui}A5 z#H{_7lzlK@!wr%9OGl0FZ+J>=huD9r%g;v#&{73d$~E3*ZY-W~mw&J9o3=9JFSG3n zb};&#W;>2RiX3t81%!z`5~Rv?-Uh>udZB_eD^_vFf6O*}$Si5KAtuRx+?i&A+Oh-= znFdACe5~OAAaIOX3qP_tIA!T?-65ND9-$QNEzQK;1a8)nQC$*{zyxX6KpWKS*rej$ z;0Xa+yVN<*d1!zU{CF}aX4|>M^yDd3_(~%fi+uPDZ zQI^oZigPwsTt+M>vjZr2U(w8jw=YW+MIuEbav|EBK{yiI@4(;wW4iJxHCf|myZ|DS zt1mGhOU({?#QUJUPxmpMQ~t>cK-ITt%1_p8s!@L8dI>V@sCv*0`X^HVx9V&!fVr&8 zF4#nfALX1VrH7jkX?b3X#}(#5bjtZ%RD(hUt>IUs zzdd*X(9pgBt|tBWSq!oTsCYbOPk;`#ev~UMl5~k~Z@BR48~CvY^~lM+wS@R|Gg5mV zc57xflJQ8lYNN5waW_p-G3P~}mV$n=p7inwwqwSBySz2Sc zP7Iu3GUwXsby3QVv6d!P=3L=j%q6`yp8Na)kEJ>A@rqO`9B%KXtu(G9qDoAC>GO|# zR?e(`hsG4%5G|z*I`7PZW((Hcs?hD0(m}?w4cpdb3u;{Zq$|)QOwsrje@UpEU6vs^ zVf;I{?#^lo1f7%uh41p&*Sb2@q`J!XkMjlJ#l+pCRTdq4_Q9y{NW^v_>(q?<|Ao>Bx2>BW}65eJT;o7d=o+@KTRpr`V$h&oCrzF z9TGuNAos66(`S5u(4`A8t)V=1`qge6B!1~kB5a=7)_4&4TT1vo%xpd8@8Fln^A`Zc zveL${U#_WA?>_WFhD`^gfeZ3ky}EEm?%pN+kd2{D))cvE4Lf3mTsd;bsmwJ_mhb35vIJHVl57?=G2t965bBEq~LoDMf##omf>dGe}`QRTqc(&)-U-=tzsm9otS}x!016(d5cVH{~RN zWAfef4X^7jO_|QX3Od*eAf(*(>SIj)NT^w;EY=7*|1h~9VKtmF}G$Tfpz3^HtrE#vR$-p<=^J}7bu>6%6_CO7w$Z&#Ck zP$CNi#C>`9(AvF*ZTl!?Yg%D=cy84&kH;MTei=(t7rX0N97O;%>+W7_+dlNzz_~Qy zJ6oet!Y5{~P-F*xLumV;>h0C$lh!(MSlj!8!^U^MW0}3(4h^S-yNwuF-oHQr9$V8b z4Ez!cJ(l&(CuC0JR+48V+ASU!+71Bvg_tq!CCbqNAGaM{H^^L z^CS#Un3hvuS3|89>(aWv@k@(i#Ic)`aVeJVjjS&U*pRI*I8x-IN5>Mt+BHg*Z2I#d zk4jr?D7V%cQ*{exws{>Is@L;qtqu}H@7u*6r4>IXqzoi&Q5Hh8NT1@{I4V6@vAs9S zzzvyYA0K40%dOm-%v`BlbI|~*9<-MedX9!XkCL~8@Tjh(-hDsjlr!nhAEy>{^>T}0 zH%aSZYKNTIE~0Oriv8$s1)&3EzKr@Z_XyQ?tQ6VfYExite)~N`tw%XnO6r5W57tyz zEX(GkkHM4;u_9^s!A;Y{9}e30-+-)2*jc&Nw#U%W1_gB=k8ff%}=S|H*ss7U`%5C^&Tr zR+4Ji;D0@Bea4t6_P2bLf%(pA*61oYTGNJ`NVLxqs&pN47Lrz`mOV53=+`s`5zGop zkhAB=%^&{=QDz5>xb)-4304^9zR(sP}d6t>q$X2lE?j@-GZULWab9 z5;N>>_9D0I)}K~~td!KQjMs0X%;1f^RM^(U7{i{+g;PsTs7g=DwG#o3!w5$Rp*Fwv4}VvzYS)Jm%J8F)oM(hmv;ykdnG5j*Hc-2pYES65kK)Ath-3Zk+*RBeTKj9V=v2z_qfqHchbYA}FvE84G53c z({21%V4|#$DBD0{XYBljXhgrdgVw&EyItvV=?&!QD$sxW>F(r$vwSj*a@dz z>)uXYjt2UbRBQN5P%*PrzxhucKmO_UT9bz=m{?}eqzVTncF{Lj6<-phs;zP>g@j%^ zI&VHHTN^RgX!oLrPK#+W%niNX#hwXEmaq(QR$n;>v}N4mVt}u#T!YY7GXK*fNX!=n z2Nesoh;U|M1v`rRF0hwqKt{xxs;i|BV}6NjsM>HrZv=^X(L5xh&JNXesmsJ4e_khu z`w>{V{4X0%pBb*VJXT!FB;(E;35D5$7EYg-B5tKi7cHrX>K}wC1j#7aG-`;woCf45 z^;8K~hlS<;MtghBv3POc%H7{AYJ8vK+22hdCXcc{W2mO8>6lb^Ga2;S|B+(w7Ft>H z1CO+>6Bo=!s2L|Ip%f;@NqyU?Sw-{5_6kmZe9XpN2@P2=LXG@%49 zpP@Xl6O7Aj+}p(hm`rNXN{5|UeMsysspU`ck-n{`Q^jWt&fJnejE=BjL^J+Nn*1WKra6qvy2wj_;SXuqzcC*8A{!CcWw7_yY|H#72 zaDhZuPl0ZVgRwOdfc~wSI-Z>q6+Hj++mE^*j@xqsj&@r4Co?Yxa%wdWqL!1J7aLgf zY}wiw7t~_g6pN$>S5;5Dp3smz_~MUCV1nw*jg!nt$jLL_4O_cK9Y^>9k3^|pN)cDM zC-gPY{*&Sux|D^gfG||hsM<}a>{lw%0uurW_Oy#k87M6eAM%Q4%ZrF`%aWThkXe)5LEnucjwSu*i#)o;M{%K zscb#qN+G$W(UEn2=*e1PZcLl_WoLEaidl*FVXmL2nRWF|Lu%rn>s#jW=nAxNd(^>( zhWqLB;eJeqM1I7PyWT_PcAp#$pj(!nXjqi00*Q(9frIrvc1VEGeK z8`GB_)Nt(Qp;TSgF>Z%=U@lHn29DR(5m-m$n)(JeBK@he`-E=3rvs}s-ulKtq@c5C zdANm6M)iwaJCK27rD>0P8&ALR_yCqG$L1qaWTj%z3_j|U1Ij@AFDbWpd@0K*0=PaMlc-dE z-tVq6-Fi36QzHsmrwn^jpUEKc(&j~Zy~6%%{H{pkS)PQu#Devwkj;Urnaa~+me>q? z3M2GgdFnLA=qh0+kBZ3Uf%`{md-8wuvvXO(*(unq)z5q7Z%Pv89r>?>E3c2?cAe`< zGZp2or5|e9i<+jU@>uNI2hTWe0&F0yPmmcN?`z4K4!XzBu(5*97XUiPj4)?o(Xcs1 zOZcfe)ju3mkx<{mwTKQZ53x%mF*6X+ zDMN$pDbHGOwaAx_8(uxTlCO5yC@!epmG@ne7L2w!1Ac)k^)Iz$;FoOXqguVMm~ya6 z46QcScax@YIIb`eFacN6L41N|6CBrN7-slJ*cc^$6PxCr!r~vC`J8~U2`sAWagN}) z&-aOaRfEoj)uzLG(Oz+%?;LLfu>A-s^i`NU~AG3go9=YhX6G6*czXEZXU_3%R{PZkw$1ZRNGM3C`}rSDV0b z15t1DnI;i-S(L^-IAKAt4XZ7^{H6%0?&$-SSAH&+)gHue`B|`S=CrPK6<0lFsx3Te z7`RoIXin21m%61CP1<3PZ&)Q-bNR%yBxZed&7m_;UHWMxWDQam=G3vW)5&-zs<4@m z4NyI~g8)asfXyZhqKHETO0j(25(+KTIn>qo}dM8xP2{BUumD zqaUzrJ461`^a4ov?kKh zpelj=4zaL+ooNa$gN4;$zL_>awc33|pv&wlX zojj#v%<)hfaT}vrCp%Se%S`6F;%uFzJhZliHM>|>%F~?tI6;E*R4r)>KB4q^-8F2L zIeFd(rH$wxW3UMF?5Ae|Lgm#rH=;k9V1CW(WR`5gRAq`HWf*3HD1UtRKd21HGKfB! ztOq7|@<2N>bA1$H*FQ_!IE&K>vzE^1M%{TA^&V?*Bv2bAm87&%6t}RP4V+Q(Dj(Tm z_Y~rKZwzQ)Q^`9u*^1w8h^AWYES7|WBr{IFFB8t*aDIBGg;ugYGE`cCm!~8@g1G#XWGR=}7bv2-&{d^RDPLc>p zNaNSM@itw!uH1~UmfgIgq4t6mF`oXague;wFILJ%WI&mysndI4c3WGP;`gNk117jw zq^s`j^s?-1efW$|ZK`#slwDG#Thniz>}Ia<2Mf>KzxindmOi?q{M+cSKoi%{2{^ii>vdG;|Mf5V>oQ#{^g9AmMx1;* zUfP5{fYqKPuC9R3^p~B-RasKDn!L>ZrLKPrIDDr3^ew`6QsK{Nr{7 zh}_;~@e5#sCf%V5gjI8U`Yenjw#{nI7iQOGaL4kNtokKRpt7uUNj{A@_6Qwn701o2Y9 zc`$++XfIwK^!SUV#ai@R27vUS zsoLuPrPI~IjS_F()mEs#g{P-XQqG>n^$wjB2e;hUwb;iYN^_PbOijhuJ*aH^`6O<> z-UpDy2en-yO}M-Z-$+VQ3lhU<_k|nxHIBYJQsGPx8tB|mv&6r%^NZPE+IE+wWIzhI zL5-Y(`~AL-!_s?Cee)WorRbyoAoQpLJr$M`Dc{-BTRMp@;e(mPJ4W6QYIP8cQvOWZ ze%OfkA zEPm2Gp3-vn-Wl*ds?J*vGYzzv_L6>AETK^v5ZzZCN^WLZM2SJdX|~=cdX@7E?9B0> z+|@;qr#))6)C&Nao(wsMuI&KPuNl+c+Sd9?(t&g3%0b#E^cKGB85bAs0`%t<3WF(5 z6Zt&-esoFN_2uwDDlXa@o(Y_0D&$rXC;8(U|fEi(t7%9959;`Q~aEsS}NXoIfwKJ?4=(K z$??vtWH&yqB){Kn{zs>|EBncz>gzOrHm(Qa_4zegZq;|;9|%dbSnzphr;O;^M^MsbCBLqt9G?oseaTwctu?D6HZgMdbPke4znO%{uG=ba$8 z&vkSp&)kq+5ha@G$_$PFiY6=1`}rr8ukNE4bV^HxMQ34F|GGcVNw}&l_6HV>1MCUe zPz;PqmjuZ-;V1$5D>Hp`HuQ~qiQ(Ni&BdI>BO~TwoLMgbDexMuFln(zI!ubUxfowx zi5Q7eD6$?~de@hyaDpcg(;>`?fiV)(T$uc3kn~xj(bN;9%NLI{dA3B0Z`-w=l@rUQ zIQarFIYW#=a2>POhx6Ln8YqM)YP|kMR&6Isn2I{@sPGy~@IXbmES{ zc6RGkX(Bn!+kWte!ibZxl(HzYE8S!&&a6H!s_70{_}TFbpvbaibsK&d7ZAh4BRl2UW|qV42nVq;@`iegrE)glE^$ zSLa^pYCa!ZzlnFqh;=`7yz7YTnA~hugy(38&;kRGt#MUgdT@>u+@w9)k3&3hP%Brn z32enImGw0&kFc(#%IlO=S28({76zJ8r|2grh2v#qu8$CWPiD4`DN50ack)VZ%V@HS zg&+g3nZzG7-E2!VY@T|2BY*Ab82E9WU%I10q|p(gFB;O|@PJK`m3HUrEN1cX>VFl&V^%>XoqVx^AXWr)Q`S{ zlqJ^lJ``}2Uj6tbc3UAem6YmcY7StjjQ>u~y~|l-)3Aau`b?_YWP)b&_Jx|~Lx2bq z2djc(maNKwDrw*VQ;87y>Chu=?$=GZvWKc8aYQ)*ynSTvkWo=5F8vCUzk=qv%z&%$ zQ+C(7*!pe8bsV`z`sQG7$~(98ySaK*7M7vIfVj-3pzRBN)LtcQ-G##$3H$+O7hM%I zpB_I;GqN2&p_9dl<_b_R*yp~pkL={@fr3Q-r<8_pK`zcv<2!Oc(Yb>)>>5`w!jVpq zwp8~13CW{3IQ}$w7bUR+aYnx0a=}_~k<;v*lmJU)Gi?GpW8pG)Z^+K+m58--H#pJC zi`Le;@j;TvTDKoaJ%+c?=VeX`oQ%xh@SIzR^4yVr;!8}8l|4ZcAEa6rH-7;HY60^+ zQjU7O^4G%mXIV`MZ9k{DpyfZ(dLLv6Zr4IABkhfqdH-_!wwlU15Fw zj0MNZp}<@|v|z(i%lOJ3E4D74=Z9sj)-U#kg_#=jJEx(ZTwtDwO%7`O;PP_0C(q-> z5pkunBmFNf$L8ii5r15(on-YoK|($rr_@MS%ohNmegs_-dU7p+LIUJs?S5X2C5Z_r z;a&JeSAfM#RhmR#i=Ue6t94oWs;$w(7M6g>1hfowele7WmJjn~X{q*5~P(IVM$*r`2;+t|;<+^#9+!w0Cs&rawU z0tWg89KfF$?rGM!)3;+9dqx@Cb5WtIyj?$Pvy(Jq@=IBHVO~TcrP)6-F_?@7ujBEk z_!uZ3A#1Pk2>NGXKK4kEUgW9soh9)U-ovJ?IPf`(+o6UIlovS&lDO0q!#Bvuyh#>8 zA{P@D&5I*0(qdG?-P}N?UGJ0$9}a+>&22>pkF_*0b>}>J!nFe5b6 zZB9rmcM^Rn4GYCLm%6>2mdsIMkz7b}GC{}!x~bA}YUebnDIa%uwiA6U0zev7jTNwX z$WRS+9|*M3Z>g^23*RHJTEWsYtJ_&#&CAUiyDoA8AZMEN9|t5>S1BnQMlf(IvN2aM zZQ989?N~Oq@c#f@(cqLtb9-SuykxK+Ge$uDO@2~bYqz>R)bOz|+(jcpED|=-j--aq zp~&f9qJAy$*Zd>i7u4^qh-sj;W?b=-2Oq6|L+f5DzK6tD_ZN=xo2lMsnYkgEi8=M; z)nX!~qixYN+m5XIOT*t9bxR9CvV7{x^9evF83#R&YUzjV3oIm;hIrr0-SWtAN49I_ zyAKkH&=Dfb831s3Zp3{navu;j0A2e?#s+$K99IpbnbUP8q4Y(^?F}{1WVfo%6xGKP|QqdkZt_2Rk7 zbhmsukSImiZ5K>40 z4oBTS^?z2gWrUcNG-Y`QsQMbH>=|~p5@qP#zglD(!^OH8NGb2sfAy=CMH}<7rmbpRFXyXj0#PD>bC-cV(Pbyhzz{VCdvL0C%}J$G*YSgLZ~#V`qRg*f?T9e*0m zQR--0 z>S;9u)M48qEN**xRH$E3$=K-hPlzp%rH&MtsqpAFeu7gpKNbQCg=bZGe zJ5#<(U~}^moGASbdXc@4GWI@|(y!vP(B{3D<&Gt3WIgy?=ia(oIA`$h!%KU3+sf6o z0ID0fp5cfm{sLIH{j;w!OTl^Y_!cK*#@o!t_gT<4=nZ=H# z$ksHqi7lg19B42Ua0mI#Tepaa_mTeq*QQ(Au6Mg`$<0l3cooD52J$nvxE{63snn81 zOQbSMwD3q-1=}fe@`&cf&>ePJA>T1l#_j^hChui~zDS?>CuE%Ey zjGv`jwvl1^{{Yz_ZuIpun-yInJ4q*?<24IN1c|+J3+HL?{{Ysc%8RkJWnkjjuOwZp z;Ox)vudm}${h<;7vVtAC7;J46N37gme(c8@ARA86z#XbIvupc>M&P$3`Y7*Nv|DKz zXHD}ho!qhWI_^0;Yl_xy`txUa;`P++9W&CNqp= zabCON-4Y!ol>O;FYSgCe*$y#|$F*qFLv3wm3bu9tF`sJat+gPIHXJ7(&bS!0IOBzI za?6eZ;;bgL$QUUAeQUKzBbL`YZxw1^+Ikh;n>hXIGFRv4k9;KdI;_axk>(N8sL92B zjeoAZkrfTw^7pSH@!o@PtgN9?gq)Rpb*!qk^+u3MZhW;jhZ$#fjoK#lQ-hjO4yzGF zOOi%%H?C{awQmYZ1;BlzuXBp7JU58j3zh>Q)@r1YqooNRZ*Vn2!+iTm<0_z029G08 z8%V}n^d#q+?Dt<&TPyK&#%uFm{@?2xi2D>HnRw&UZC_f zQgi1fg+GQSfk2%1`EM zj-j=)ByJg4;Gchb66{GonIvK2&&tQ0!yl$9?7wBdhvZd;LP-pxzoDsW%(T-+Wu4Po zC|L=TK7jWEtlZkHgUpIe>;2$)ti^M0Ga*cK%Ae;_M|N!4+B3ZmB|UzXHrGJEa#L|6 z0hT}=f4z=J)Kxj5V*YizY;0txIR60k){KG++kNQk3-#Jh%sq`{9Ky^Pm2BtQv`e^L F|Jg`@ubTh> literal 0 HcmV?d00001 diff --git a/lib/libesp32_div/esp32-camera/test/pictures/test_outside.jpeg b/lib/libesp32_div/esp32-camera/test/pictures/test_outside.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..dcb4bf1b3c82c9aa3858223414be90a54a1ff4c6 GIT binary patch literal 81744 zcmeFYbyQtVlrMO3cX!CeEx0?ug9f*dV8Jc8J0Z9`BzSOwJHb7;y9IZ*IVAaBe?6<$ z%k%6%n=$H^tAP8W5?t~C9zsCsx6aB>t0H*!R0|{VOU@j^! zZUCJPz&OBo3Uqz|QvoA9AP5WcKV)J+voocq5lO72t)%)@%!UxTPP4H z{V#R_@QaW?o&z9=<}Wq^Fw0;3905=i90>ZE#>UP96$J^x2Cxq>0s1eF129DNA07xG z63{V-zpW|&=rA#V)-4AxT+E-fV1W7Xe=z_-2!Am;fD!-l*8%(oMDAoOhj4gxSE z@SG8dR#Xfm2q1xYSwNuZf8m&aVNljzoq+&CWc^w932-xH7Q%1cRsgp{{ly{x#{2q* z=eNDtaKCw;*MRtopQ8i`;OE@d1ayGN`NI!<1VR1_L;VXw=lrqV0N{uDOZNu&VgKT1 znQ;H&hyNEw_!ma}7e@XUeqQ@o#RAP89C?fxSl1c3~~`j>nHz@lf}t^s}`fc`8K7(m4T ziysz5@>d5`fKCcLeCB`dWB|`|tZ)JPi@)^ec!B{sA25;vA1MFISpgSub$G_1 z|I+g_AoKa%5&>)v1F#sd);%yc8o+J<76KNG2W$jLpgJJHi2z+1ptk@x3BVKp9TsqW zG9VKmgZh!?;4%RGoC~x7{VO2-SvQhiXo&28>68DLe&!AW6#+A!=aK`x9FX~Jy8tk^ z;;)|1`qcpRXWL%`^jZLu0$3HmbpS2~uswk50sPGSyqz`v38 z{7?HI5Bwi_fQ5~XJ3|_piIY|(_FQ|#v-y5$+5+MA7lDbSP_( z;8*47;W$$frv9%yDh%A`EXw){;w8(rUIr1y@g7W6exKSBNoVsBx(co=ZXaa|z4L!D zliQb^&?+a>DYKdMUYuXnw&XzVFqolpVf2KL?{lU!eD$Waq~cl1xz^+d%yCjOh5qn^ zR8|^=&eiIlJp=|nc)H9eFPE1tDa}Y+?9&Z*t=L*#f72X!2R^A8!A5 zM6zX}n2+hgz>XMR?MfGvyD!E=vCa_Pj>06;eh}urp6ICwr~Wvr_ABNM10lJfT@z^{ z&2ZQ|c_s7Ib+I~$ogAmPZ=G^>BKQ4|gf)phs$)E2ktUTY1IJ?E^&tsZ3B|ZMVezu=WVBrQ= zCRvRU9n3W(SmzshIK^OusfNBs#e>0|1=d(Wd~(&+%ShNb-izMK?*q3Y=@@Cw7i9VP z?S~^OjqD3qxg73&Peg^pHMdC?P&`2X$yy!;aX&5q>+^j+bI`9{R+Cgv&9Bm$G)L+$ z%gCue5lF?8SHM{9|9L=U_&5LhF4@ewczzfX?fx7(L$S<*$s|2)$Vx97$NVsv^c*FUKkBC zLgdRpRi)!4WE@N+;bm}od;uAj{Jhw~fTgVDP9zFB7euif732UMoly;0Cf7z$po?Gj zJbe_}7kR;LjU^9O&yCEzdKFrnH>`|hXhDvJ*00&vW!?RC$F-ZBZJ6mqZOXs7LuG4H zAwc5_dr!aWH72;7ZyY;j^4+(FtM!tW(2FZ2bJ&Vvx*1%WJ`(yT|BM78zON=d=O2P{ zd>pa-bN;dEXSwQZJ?Ed1ahcek{A>PC`8WJK{|+3m8#472{*`}iYlOxFuco|!{DTMb z5Ax|x{>eK1lYd;&PW9NqfAWv+cmDZZUjIk_{deLIT<$rVb-oi|ePB4TC+s65X_MHy zFw_|W@_6p6uS-D5f4MvU^LzN8hwE_g(AZ4uzfX-o!2$sUCBj@y_k1k;cl$HT62uPN zHU7We0Kc#RhuPof*Z|-x`=4tf&z3;`K4B!uKU)F;)M`K=j=vZ}%1@7MeRF-}M_}`T!2*^M8j~Rdt z`4`t={gK89EcCqAKjYJXRrQ(&iG$!_Vc}q5;Njrl5D?%Ik+D&bk&uuHFtO0ENeIbE zNeGFF$tjs>$X_smiHT{s=@?m9IXF1TXm|yA*aVo_IoO^6ArJ@%2*^mt_$Vm&Y!t*4 zZ2#@{)CR(U2TpT7P!KObkQfk97!XgLz#SL_0Rz@{6@!Kh;)4Pg3nsd^oHQyPJMAn;%?(q6yoe#UJ z#8@L=z`_r1*>(a;hARwRE_X7J+i8_FR1h|4Y@lX?@odpQnX zyQ@!DH#0F8msmayG2R%btcg=9-?Z{T87#J0rTOrjcgeZs;F9~v?MWr9Q5%1co?M-4 zTsCuBjDVw%t$?n9%-FXRR}n{!Li+4LDQA5;RK602*q?>rzrf7qGD72LWuX!ED`og@ zppRgKRyqRnEA8VEf2#G51*~brY-Bl3JAImolCqMqVTPnhkIFtql_FZ`O)+9*x?%XE zc5-`$&~LUfrT)?-%wJ8X4RGDpDidtQ`iC0Cqhk;rF%?$ROn(|}Qy=au%`J(N?uBf9 zJk3?vqn3INQa$Xji=HS0^F&HSZ?%s9%sFDj`qqCyYe{m@4Y$<2lwH0(6>}+09nV<8 zMv&cfnrXYhV}elSV?VPP{V;yy->0!`{xBe&Z-zEojbu@kjFVLJt2U6wOZMA=QVwKC z`KB$lvS3b$P;TC=fNUk5vr(84596i?92_YA7u-NMthwA~5D$|_mxoRyZK>?zuPD)V zf^JEBG%(08B~)~4W>K&7+Z7(XrmQLLnn?cUdpWEytP$SDD#9TPD(ZuA8$k$?$;i(h zqMpSPmnGsVIv*xKznJSgD?1!Hp3mo(A>TM}+eO%Kf>~o|b{02-DeB|Q-KeRRXGot# zRwSzLRY@KhhiqyYkxa2t&`Y3CB|n|xs-CY6?iK!J0Ocdeg0L8N0abQQR^nMBj4_uC zW+i$8RsHC^AKJ3+6@VCpSaB9WWtj1wSgOrLCR zyBb}}?i%;$hO|ah4!X>W?=bwiAipz-64t=Wgk)6{5PG8q=hh?s#QO1LGU)`w7OL)0 zmFqjbZkKkt({&n3R{Y+!k`fJ-Nk#+pNygQNPoj2AO~_n4(58$Eu(s@{SAuXtu8u^x zse3FOe$pfnH!~2H3TrF=k!jy;d5BRFh8!jeEm(8yUw+D}LX1cbA#Q+SBz1yK|xyu*-1rseoF zVN*sLO7psM#4Pv+O?6v{Gf|yfk#V>Ob)|L@=?x_OceIXjSM}lPuPocTV<2}CHltm) zw-+P`xo>D=D6mQ9${`lqU$1b=#8o}wOr zujBYbtMr$$C_W8TgxJ}`p+m|qA-o+27rD-q=Dh*p8l{^{i1bV2(GKhPE{Hgaf}Rz6 zksX>$2IHo663QI4q*~Vdkg!k}Hm3}IoO|hV3MUD5m;L+EOM_zpD5rV%;R^KC8Gk-o5%t5D&G!7i&r-f)Un5YiyK(+%elfeeer2`dk+)jRbDzTC-!Y?J|e zYhoW>x_XDxvv#n5^p&l=`BuzT{9ugp6=~jLN}^-2PFLFcIVby!LhEV-S0u^13m;&WX$kzAUjzNg=xY#%Ie5p z7Brttt;? zhb8yZj`8q!?In~?5|60ox4iIQg*x`+V*O1T^E?|H zj(x?H)68FLHg}#t-Y!gI_EUpm-x^QqO1TXM9!5vTJ`aRU9$I01J$n)VH9WVQ1Xrx6 z>EwHcy<#B`xpf@(>|t`YN;eO-c(XkcxjsmM)aPowT88+gU8#8t{^lLW=+FzPT9Z=< z@+-s++xE7LBR|E2K24`x6RLx~#dOj9*rBsdnPxp_Rs+QFrenE`ru7UN9L~d3%gZ^- zX?2HJgYdYAYgABKo2{QA6kiiZ*p0!Ot(-CEfD+!d;DQeW>93(OAjI2lYM&ZVN#GP9=dXwzjsYyd->f(Fgi^tGY<;!B7u+7qO^(xKUpo@TUu@xea-E zhisJRoH;|A6cL*0qCKR_;?-y!iNgF)y{9kjQgg`|F_iK7p{1{3D(~dnoS09cgHgJG*F#?7~+k;U7De7P_^GtsB=E!uh+g zera1}Bt`cyddc1t5itn3&%`kzK*#pBk?aPBO|$K_Se2~KTClIdMR23{RZ4;R8$J<4 z3fP4&Ab##f(FG{ z-#6mzt*=O7Wx_F}pzIQRSnKpk`ubsok`@{hw16-o?A*#ZzZsIzUebI8g^>WxgJo~O61;_y$}~0e_+*EXxMAYWxC!^R!J)T%beF};Z?(dC!no!; zhPWMnG6f98T?b_XIBUCwXRXphB3JL1_Vnya>L9ZOs_0xPMz%KMZQ|Rry%BBOV4-H{ z3sZUGTBP?|c*@ou6@D9-nxOh!%`m8)Q>Y0CMb(T$I+{7s)$6eO_gPpI1{rYlaJ3r* zSiaE81SHDY;X0$oMYWM5XGLtRl_wMlGQ>KmSw`KcTZ?ruu(k`t=WrwnC^~udRSO@o zDH4X?LG^Jq`EK~gR-E^CFFb)Vo9sot_TOZud^BVl?8K%lRENuYPXwN{i?qJ*LW=%2 zzwmmRj;SK#yVw3lVnZLae!KB$0SM(KbM=}l^mXcqVPg{+Zk|<5NQ4E}unohRZCm^^ z!JKNW82;8^DumX+3F++qSWJ5_l}=Jm_?0`2EZqg1@lq3s1r-`&T}KKxjih_-iPf0X zL)z5%5abwz6*l3%(h=opru}_^yyggmE#v~eazXamQdp_$P_=yX8Yv^Ni(ZDq8l`lT zS~0S*{CH;P*@MO8BjG?}`w86+acQe>2igN-lf~P5!{WCJ1zQZCK1*J2wkSF5{d@xP zU9<+Pe6~S~e;3wY40ksw>8)asm#$f&6|gqPQ-*spcCWAFa#me>5MMsi#(-Z}-H9Q*^IW-;8gy#Q%K#L%m&ZuL3@78TSagxG2U(eSCn@i)r%vkDJnQUPeRmi@Tgnz5h%pk#)zGfBHC5Js;5I>b- z_GNo6Be}pFBR}4XHvyNK$Un@H+_a#_z&rZu)Q3%fML(l6nEjB(NC?}C?Gwt#Qct^x zM%4)E4Wse=giBbl;bqH!@?MV%lHp-A;O#8!8VAWk#U(( zj_t+uv9WI|dUs}ZCtAj*f<>(iB;?s`rB%6NZC>n63576yW#WL|?Ye&kGnY z#2pK8Q|&vDePvgj!f=rK2#CvsvLoNT(bc<2)KC~EN$$W@LcY(=wBD+W%2DC?IS3gR zlkKONyc0XZpe;*>h`JRK?3LnGNZ*G~aT@&{QVoGeH-e{~@+_s{7Worvi>*+vu`(?s zt|U3}B{|DJ-&v1&|K$13ddum_3sDX`UA*_84*K-ATR*$=9?}}Ep}e^8%T5SA=Pr9m z`1T%r^03(D<@Q(wKIT=W<3m-lN-y>fJW zo4o?u5NS)P=bDq};?IrxR^OtwTlz7*9MB?$s#z0J9OzcCcX`ix^oma?tigXSH{f#> zRO^8X@k*HUMf=y#eif@-3;dkVMOkJl{imEUG8FAE*{j05a?&Q8Q&8fv;9tnS&vr5l zSMZEj@#I&Qpi=Q@{M1EfX^*8(e>2L|B;7xRAFXVU3NZpE*^Nm5Ci6{ufFVm=ManP@ zVj5(6U*Gf|L19GN5-`qwscX_FxlH?mPBTN^z@DUTAw93R$%zydy}do_*J@}?QGE{9 zeYk3G48jbrBkaaor}KH%LKzb06awlC8-=f_InSNw2UhP0Y^cnXlVm8IlsZvuS*L|d z_+BE;iGPeK4trfzQH%UANw(qUJ}M#Gr5?u_%jWOIAivs3{f@DOBag+GTZjewfH>kB zD&>3Lhf9syG&Wt4Fd-#aJ_A4A^I?a*x-$vvmhbBFwKVl?*4t0B&*e1`6eQ&H573~2 z9~k)OY8MP592_h>G9ofE5+V{33MwW#3MvLF5)wKtItCUt4h{}78Xi6_Ha;dc4)*UF z9TYGJ8U_Id1_2ud2?hJV-G0~TAVeTm{-;LwyY~41`x@PY=*-e`I&IkPW8ATW#79!K zpc~g+c}N!T+pSCmVwJl6AXmAJq}w+&k*~)_Wmk=;mo1ee&9!Ms0?1^wZLuLl)zOj1 z4ziF{#z+F@CFwq7Ibo4b7^wKB=vC_P;2Qn`Gq$|zA*fo zm*E2p@5*w9^vIWPGf3JwF+=$@Q}E$b2nh8&y0an-BGhPbwC0$b#+EPAjTx7UK|~v; z7CAyR_v`9AuF;xwX_qWU>N&3Q3K4A7UTXlfVH+snN}3e3ysHYnJ1Yb~ET=w!jEla+ zORKmF(&sEUPcgl@i|(U&^n*L&6dXJF053>M)*A|EBwkEBBVfoI7t(t472*M*(AbY5 z)yelKhe9p^{7NDIi~39g3kzC4y|7cRg5JYV<}F6i>A7klznaR)E1*Kpn29?C*L z3L{+m>weH9)eJjuw@%c^@-uud{28BKO~^om_k67+}7^!R* z=T7w$`LJ8Pho!v|A*ZTvkW+#xakp67_m~``uu~M5JXXa<5HIK2=;)T7I?R6muE&w=_xE%7rVd82_s`oo-DJB`GVpFC&e*> z_!;prj3XJe2bNXVJxW7MqG*CQ$t*#_?v|WWf@?CR5kfCMH2E9!_HKw>6xTRCbCxt3 zB<;f^{X}m>JuQUBxt`IK%<$}*}}kjirOvczwCUrv34-rP(8(Tv>cPIqZ4j-mj?p4Q{FIO^!6VvCL(uy*k?gQ*lXcGQBTAT<|s7$RwcQ% zpeMH}Z)(vbX-7(4f3-gYKTxwYPmjGJ4F zXRGiY_V~Vj3Kj#M>r~+~67KwUC3+cGF%~+4Opc{B^jocAO%$uk#3Ng~(Or2i8J=wG z2PTGF1CAW;1u#gZHJ?DvG-R~+!wkdsb~(Dcghv6E=w@^J>1BFzi*IM8HY@6a2&kh| zw1{JJUo5ck@JE6{)A=r@J=#~H_w0FZ=X5lO@|LuEh_wSSIWXbzf@9c}Ymb<-qna=k z;Apn%J=o3i%u`G%9CLP3OnRxp)m^4OSj+W>;NZs_8=rw08aqhnN%#=GR3)$zS_QseM7Ybxd zvCyhXcQ)xS;_C%1k|_k6m-h{TxYGQ+*N{`xTaSs98;%ds^BNtD`DCX^rK1g^m!bE0 z5S^qoBNgKJ)>1AV%|~V5$nH?bI?cb`aob0*^vGWs(vZAP&*PXYx%;3`D~*!g_cq!z zus>#3aZ#9d1nz_cjm#xzUFle_!9tNUxr$WvRxjtI39lGc&A-%0Nu&=NqUWvpb;~0f za6>%x2GztDTkxgLO-%C%Ru38vs*ChM z^~A>Y4f8@-+oQ7Xyk(D{>@rl%*G~;<%&Y!xR;0aGSft({6mTuaw3NS6hHg=7MU1g9 zH-J(zqn8~jibct~ulrsI4qUgFa{2^9_E4Pg&?=xh7)!@tT5S*CG}Ef6pNQYZbF$4p z4DJy~xp)FWE>UfFM5534LAGSVq<1RM(j0d6AM`;(O|}iA`^H9xZ8Z(btUjRqxN=H? zX}Yx<(A62Zl&fD)SmRlIyNQJ^LU1EOdBNLPmcFI|uNntdIE`K2?4aT!+W?8M_jGD=p-7 zScyybE7uecsFfsS&4ccQtw($O<9FvgorhNCrl6^<9qj)0D2OI@F4gkQ(35!H9`UUo zLDbC*N}(I-5uavh@GXkI>!qoUHH;lJDmP5*JTlChIYpsi_pML5Z^oE?yhAvmN*z&x ztPF$L;yFO2G!83K%Hg3{moowU(GM$3|}w7eo{y*;aYx-S(AtrUaCdh8Qa` zimXxnL^R~(j|U!iCyH&__8t-^T!||>{>3|lmUJ|k#DTR1YN)#k-0x<#p(0#B8d>*b zCm6@IopN1cOy_$=HznHMLR-#?4w@NlzdVvKS6#>aDp1k7%hXd zD~>R35<@}E=$nB>>dcl9okW(%V=c)063?O`&%NCn+)aQy%0ugT0;Vub36cNnkJX70^Vg$n+z#|-fS_3N;Vi8$> z#r>Y$f<OJEPzsa`}U5JYn|QERrFUjy&Dn z6|)BByYJp^xH^lCO3{zGifV6PUkUD6GQ+TitbTegp{Dc= z7SgvZkDnmzD>3bAk~f9yp~?FYTezin_rcAtqXU%SKq?TJz81-mq*khA=w+$U7@Bza7g59-w3d}JElh>!}oKn&izx>dsE zFk^#JwGs!B_=-N#*uuP;juBoorg=;*66A--(nREr)E=fbZSNfPtSNW`5e`i_y2~L5 zBKWota~QqKVAW#QFsCImrIO zEqomABH68oX^x9f&`T)yDb`Zi+JvbZqNhJAkfawfQTrshZrqx3oYAOGdV1*W5GOkl z>C6Zj&pOQ(;v(Pbqlo@!RcFne)T~t)2Ha^J^#mM=Ob=xOO{V#&#WLE5x2QJf?&(55 zG+~m6!II`M`h{5Ug(f-E zovbWWLzmTS>T0;q%~W)|~}e8)uFrBIQIhz*6(T$8S+(wRtW%#N(e#)cR9E`D-U zL|WwRBsez&E+rdMr>{11E5+O{seIjXZ~PJyL`MlWpdVDdoZst_;jVZk!NJ#GLqK>{Uasqra+-t0^oxiZPT@thZ>KThFwd?b zWdv)4B{L~UqM-VO;r7+9DrIdgSN%m%8u#qv%#OLTz!r*zaCdq4MU}0sqdWP?+5D!HVS4LrP}KXpf3IkBENk z^dxH;aORt74>;3xMK~1e0f~xy{tP$#9_YI>EG_P<}E1**MWbve(FQ@eGbi+IYW% zgjIVB`-={qWYb!TTq{%AWRc#o)zOBT6$kCT)7br+FE0Hf>i%jmhfvmIbN!o=hLIjY zBy|u7V#VH{A}uon94=!{(hq7oRWpAyY~@<4&ew4(OgXGE4Q;VmBLu>PfOm6FLU&t) z?=|G*I`xTaL$N2U^Ty=U&&!2wGB(h&0zH@~jct;=Jy6kbw!9eRQppgsoMkdFnqB=N zAmRk0t^&ii?x@E=$eNFEu7=M$wCs>PQL;X0&Vo{ohv{<`zo;`~#kThnO_o~QR^7#T z*~iAMhHAgLwP8?j6pw^0b8BJ;? z&hJ8o>YH3dr5Cqs61~RcD2$criSK8+JSC13l{2}l_+1e3@JVt%;RWUk@*Z6ryEkp+J~!s z{92lx==^ap)+^mA-#Y1S%(h|ahg<~_<_wH-he{WFh?=0^!zZ> zsivd0CA^>aIC;7sv;!`0n=}R^^UWdEl9sP`garF+q7xQ?zZv1oeI5;R{ZdF%zMxp2~ znM4{^ArDVP>@@2nV`X}R4XJrr1y(BSq-n}y0+0he?^`tDo`u^R? zTg}l!#{vzF@R@d#BL`b+N`iiR>3-StD1(AbchKbJi71;Ev>m&W~ zwUrv?a~vh6c~>&c(+#FpinPaYm%;%a?x@xIpG)LA=X0o+96woA(2}Ef^{w+FOYyEC z8x3T+*m^Ke+i=ROPuUl31w!q{CL0{Uwq(5R8^IR*%-6Ne%f27 zt{lIsVWaFjo1_v?Kb9`#(wB2MxryTxb5om_;&_meFTP?!;^H?Zmv|B?leZ}SEt>Zy z@j`WzrME{Vy>Fu*Qnas+41R$l5`O{nOU}%L&o+cQ@|5c3TqWMflCu+jcLAv}>{oFW z3&Gy6Lu(8A1=Lm;1cl_;JF%8Mzf8+o5M{yaD{Us-%xlRVAw>_Y6O^%QRc9hIEtNN9 zWPTa3jo}zISErWplYx-YAVP>Db|m-FsntFyuXCADDOk&zudaV1Z&_kISW|P^d{Fqa zn!AcDSfhoprtU;7FT|im?u~_84O{V;Na|$*t!z;M3D*Tw3!NAHpa)ex-<*uIx8MZ& zDGVz}#!AdpboXP8ns&|ael4En4r(h7Zkdjk{ zuG#cyg#c`>9!u^d00AcKnh{y1~MW-fth9wR$-EUSLwF6Tr5r2#AUd z@#8?-S6PB%WA9(?J%Of+uuu$4uAgwhVv*6q`WsZ3b$m8rl@jHB#}prr~c zm`f_ko8k+c9cWFHzW81fx+a5PY|EmBUx-hWML--I-8N)cGPL~(n{&`AcLuN5Hy6?@ zvBJ``&Fz5rHo7<8gd-d&TwkY;a9M%W(7$^75nAx(P(o*%BdHj>;$h>^S%&{%OIVxy z1%3jLm}DqR5%DYE^Ivp#dDc?NkzY$-@LH53chojB-LcgX;g;UJxqF(Yc5&<*ioji^ z=P*Tf_@<-?au0;T7>Nis;y>1B85P<=(yAJ?Iq93pk8WGqbJydOl~7cpM6zj-%{vJv z(3Rm7(`?TOFAJ|rGlJjZ2pYcmWz=`?lUFiP%3}!py<^z+8OLUGjc9*P1xC>L-9QmD#TS0*%W%CQP#4BVn;ll^b6h5@aqa=SXpAn`Fpx;bGb=$bb4>*-apEgt#ES*uW)=|Ey;hoYJhoo60;V)C{A>}n;E+Q{vc%UxdrF35(qGU;geqkwyc>l-SdF*aF?kd(t zN>p$!xTtPcj~mWG2`3=;fim>5cOA)&RMtGK%7mHuaHmge$nFDC|M84kSi@d%b*#i3 zm%(Yrd`!Am)cGc4J!|LC;aV+q@%_}?;{1pY3o%1KHr9;Mbc74qy76QD@p5Mi<#jY} za-O-iUe`KjX}n7!tenfI8FcH-ax`M2GvAcdW-WCdZ%hx>&t1ZJ=dG~v-{gUF@zv#w@uUgYJLHeon*J*NQE=Y|1h+8buhQnx<8pBH@ z*8|6ZyYYe@dq29*DfWT6ClO}j7NI9s?TIl;N7S^Z^rvfR0h zs>oD)VENhbn1eMZMX1 zJ~w`5_AYMO6MeqGz1e%Cq)UZ?g*(80&W7mq!! z>(Yvy6IJGKenngHciN>v%KQk+fS@VB*-_6W=vdM?B{)kAX#%f!lkOxIt`2!IaiP$= zRFlYVtJcQ2P6&J&WS3s1g(Se+9EJz`PK`ubS#OViWU_8A;cP}c70>7TzQGtBVg$?K zs`St&4lUM0KTA}zf;fErx&)%NDYigZcVeUoPGvx!8& z0i262N8Jscf$=#kO^GbUndYIl_uqz~qhEgs&1e?r@Z+76I(eUG#YaXoe{K5a!yL-{ zzWh<<%eIh{e%0*OK`4+YGX&4vIus>g@5Dz>DCLUjdxDZ#ZM{9*QP)ce5VO^c73Kz8 z!hE@3=Y@zObpyR}w`A-kyY8G;^|-=kxufdPUDu}=Pb@#b3(O}hx|{ahs-7O>e5ZM5!Ci4H$G6Oh4XE? zr7}=p&V5p%;2*-rx%-yYi@KWEUk}1!@xQ*bZ-iCKk(K>&3g=NOXFc+w$(lrsv&6fT zPcS3r^1TCgAyzLYWn36rQyVfVWNdm?4EtMfa@`7Hr&ydRSB!-om1E6igH>tcV%0#t zMJCvSu%*njVE49bbFRHWx3_{^#>Xh#cK&3-udlAQOuTovYq=A__?R@(@LMmlQQg#w z8t2o;kBIyGqCAZFb-Qr4)ujV#Hh$;8mzOck6WPTqx1zI~Ym684S5GSZOr7jS18*fC!>_gS3)?*mHBS7~nx-*% zDreJCo1$e0IUU2Sh-u|ffmeyQdW(&^NVIuOcC`bl7=CSsz2v^WhcgGN0x~7LZlOEC z_xLoI+Cq+hTv~pWAcoa~#c5{IG>F(vIph@N8d%+mcQh=Roi9x-$QIpRKv+yFM9q;Q z^vzst6C8FaWB*xJRaMvg?mbN7clfUvWyQW=!y|I_GakTK{ zZh1^)BHeP3Vc$KPy;85Mx;9+v45Cxb`|Q%k7uiS?a}Bi$3i?o`9iWhFwcQ3GS>bTG7)+^XFfhL`4U;Ux6f=F<{I z^YK+D${X3^j54pOM2w=6_J)LQj{;fr80oAi)L(7TzT?i?xB4HfIm%GX-MalP960iR z&T~HIQnD2f#(qH-4uBdk6lS&+0ppxGccPKhhP1q}Kp%oh;u@DDISBCaW$zaIWN5^* z;AFUgl;+XiFddxGuQ~XNN}oG4Ahx9@CR20IakjLX--2W@+?%W={0W4ho^4fXZj(E| zEVa4FQ)3#jB;WPLv4=md29>AH78PH^?D%Xo*stm(!rOM6b%s6HNu*_KlUj7$SI&}M z4%KT>4p(o%*@){l9L;FzW7P-T8i8Ox1`CVY1OZ*$d4EK!+4AsphAKbR^v;v8=`S9_ zCx*LA(DjwmR#kTc4Afk)I;FV$IFWXzmyn3CsCfLT_ybt;#A~H5a(RBlZNwRq7!LH0 z&lcrRXD4Jh%j6xN3)HT0`zS=O)r{ZMI17hdAh}xr$%KJLiOLNv#qSi@w~K#T*E_E} z63U^cp>+(KAs}At61saPZ$nptfM+MefEGJoKchxFnvIs^U$t^h*os{pP%|wc#pP$c zQrXZH(wFmkGb$NdS^=U1j2c`v=(<9<+d|l7m^)-@{UT`j?Zm5w0Nf=qdmAf4!NG!E z1u$qEUXeWQ9J1L`LVLzdb$4QFt|)ipdn^03TKuJ=)uCkC6t4~T;&p4s$;=Y>Cl&r8 zo{jOWs)~t;1??B}(MW4ASX;?l9j-(ShhByXcp9#e!Dwk;2g@}zOzMx#p$SRJ2z#jY z_agB7acQK_u9%Xq6d?7-a6r1{Z$%&99z<1OTx zI|xpF#t!y1+_=*=#E~4Gbm}g{s$U$%#BE(lW4kjUFRD-8rHaJdX{V}MB$t#yLoSw3 z*~)~+)jT$O83^eMT11^JhYb6#>Jf=H*VI>^aQX8Mkw>vrArgr4UvVc7d~8Ex4V%uX zI6tWiwf~`*!8Rsio#>4B?cm$POAEs*^{BNh209X=69eIRj*0wGjLbPXR6sJ=|{Vxd*qO_q?9iKLmc=5Ul#D|7;4+c zkJQUcnWm)sff2FahPJJBY_9D-!t`BFg5%`AwB>{0Iaq)c4aZW(Qpo6ardmkm&TEen zYo5g#w|t>6of|~x(^gRJD#2q_s}+T)jw|b~Y{7&4tGUm$h|$|iub)8VW;5!PkS2Ru z-fc-QPqX*OxSXNMj`+E+RZZ5Mc>2rkD!zL)sp8d!8(UCy4IZI188T78XL<8!hth?ShPCm;Q~e0CBMZmDz()S5C2B> zg69!Dk_U%VlZdN8N4Q6;;LAnnV(30}OZ}ffGrnw!%@9+>uCyym9 z34Ap9CQ~TKp0t7grx*NUvn5?%Ij!u#h0BwE7yPLVSqq_){51$eqOXu9d?4VOk4F*Pgy#u5FZc*T~QWVGI`Ww3%SKMu<@6=D<-&*Nn z3MQreqRrA^(Aud<`6$M(^Pyy&1eX#~ST^mO?_AOq0wy~ze0CwHT3*Wj8usbB@adH3 zeem^T6-d#x!4~-t7t;E7k_#5qvc=K7M~*_-=gt(?Hq)*wK0833L%$ z{$)W6xuTOa=VAG=njtWFeohL+uVi#V6Qfvvq;GcOy@KZF#k9+3oxk>(=yPGQQae$H zCug1JY^CVwqQfwnQ2dUVb85&Nq=zeFFQ{fV3p74F)YlRHB24o;JF=I?q`0jW8b9dP z!{Gu6HOG0}Kkp^%IxM}eUDu85Mw=C0_4aSUaT!n^^8g##xW3C9Dv+WKlA?-6!WbaU z6}+9E#6A1Ov=$ZFl$COp8HwT9x=Iti;Ag-Gn-$u+By4JrHXcDwLuLktVA*y*{*WY@ zx}F(QGeuYyyk9NPMuYVPGL^?_sx@S~tBd=;0K`B$zZ@I_S(UOdosVD9eIMW#!prn6 zW#A7Di(*3=4wnvaR2`!$!S(d%*Qdf?vag9XjS}Bm@s^Qq6t~)WOL-%eyt`X?9Rf7l z1~*7BilZYtj%)5Og})H3FRb07zmk1M#wg!j(<+`4Je=JeK zw}qCEdwTixd+pH^6>S?jtM7pR0=PiYct=OIom8qzZ(#^4lbrH|XFc)jS}|PslEVH8 zr$oNfULa-`sq@Cl8nh0_vXII~K^+LFZCpod9!Ei6Lj27RSH_pJ zU1*Hjde0W81FW{}_HsB^2aUjE3wO#@`leULi{zNv*XN)vhk4NHrMa4gHyK zYj3({BLRHIkjTR$8C3KFzPP;czKP>~Qt!f6m(j~{EFNJt&LrIka*`jHAYhHWo~Nf3 z@u$achI(JY4NPjf*0(B+UPiWyOVVA$v)h(3NPq!|!@F$A{t=FHYstn{N}sf+?^&-t ztNQzd{Ei<-_}y{h4;V$FUwDQ~IAF1Y*HG1AZQpC3%U3NSEx5POv*bA8Hv+3)LimGT z@bAR9^xqEnJ5q`-5ovONWJP;C%(o^e_Oz?OY@iXiVAv!v7#p)+5d2P$N!4P|Kj9M6 zn@+oX$9W7A$2$2NK2^!()CkVfJs5G3U9W(=MLxE+w%!=mZ|!_nC|UfARu(pC8>jkZ z+Zfn5VvvwmlG{{)$pZ`~E|qGoH`nKTYxh~*bazaZCDU_L;@-2Z>RvbdZLXPPrRp{l zm^B!oneJC$7$;y+wiCGR{wCbM+2p(@G@9PNsP=Q{cCiU3H_^&Lj(HTYiOV(${EzaG zp>vG%u2aF!)Ku#!fa5&pBWdr7>%`QrmC}qT#VTpLznXh&udceJVOCaY+jHE08fu!3m++GM-%5rj zlJXfXXL;O4BS&4Nh9m*ha(ZVyx$r3bAuWfECDP~8XSs=lW+^OZM}sa`a|u)^WoXexG5x_PCAk( zy4JMqGsd@8mfCx1_tM0Tdkx%&?1^>d?kCGq$9Cr%Njwrb9Y=HHDD>9w{MyflZDz66 zqq_So#l_Y6Nv;EY?ec91NyBn6%C;)qTCl4@(TuF4WpUCJs)gO3mAtSwXZxh&?XMq)!&+P)5cEBN!FHOXLt}Je zy1SVc<{9o`jL2D42x!4o`>Zj++mI`;@YbuXYF9c2qc_?ihVIp%vqLdOM;>RG6px#3 z)m6uQ`x>R7{9k*)sM_Dj40qB(@I)-5iC~39fQdfnGDrfqaCtoQ$5m`TFWOYEO{qpn zt0`S;btP?X)%_N!E9y3rTAE)I{8wkI_-n(u%ftPf1Tx1J)G2f#zJZ(*_ML+#X#|bA z1LZ-C5n8?#_@m-45tyy*d`oR?*7jl}eR8Qaii9ObPu)-%(>x4s90D<3E8{ zHrINE*14cdWAjKb;hxB+Bgn z05fn^x_qSx1D<_R{401hp{MD$7W&YeFi&#CByr4(hMicF!x$_>fB_imgI-bb$HRYT z@m=Ms+F; zNiB|+WM~cvCy34n0QKpN(=9(}SmyDrvEw}x;kLJ}cxK|}H@ws>?SykIaT6q;yT)6# zdFZ_2m%|^l9mbCSAo0eZ@VisF@Qm_2(rQ4YQ!hw&7`mK09{tZX`XZG3zr6Z6Mv~ew z`??puX8!<>pA)_CE^%nP5ZxU&(3TPJ>c9O0MnplxY^%!D*9xKr! zJ0i5x{>Ydeft6c7L4!|^OKZ{RK8b&+Td~Uj0BK+R&F|$BR1af=>?s9~qVHeQwD;LH z{k(2JfXEBy*bZtB_(`5|{)MIA-Hy&-@>KpZ6+eg-O49M{)5@^$yw=V-f+2=6{{RA3 zIs64&^ZY|U+_cl}0UczWc{1&LSjZRho=lfjyME-nQ3z0caN9zajf zoPLxHuHF>UEu-CdP0$>(U);2y`;g?1(w_&3G<#J0KAgX43(_4r6CfY=$l5;=D&&3= z(V=BA=@tl7cb}SBAw) ztdkQoqoHnt=sF6rnYr4ggFMkb72KuEtXe z6XXsWO#RRHbN+Ea1)=+5yddHPk(IIhT=e>LTz|)VxGnw^_^JsVSI*L|qFkQu3!wd2 z0rjrH&X!X=5rAGm8Z;k~{00V3y>P!7bZt6s0&3S9oU%&r*tgAW3n{@Z+GvTkY{6p?OjVyyffQKA_!L(4iq-gCfq2%+H!MWKK{i& z6Ew{O#~PKz_)Q|-^m$6tO3IJ8?%c()N$Y{%*Rl7Xin?cro5osiiEOmr3TjqOy>!){ z_DgGr-as3b$w%(YLV^b!tLCt{iqoYUwO8*IlUDg&%JzNiCbhaf&%+wMy`9WDO3t#` z%@?1hTmzMw3}m9Wa-aGMQ|nzM5hT{~Lm=F{nORS8Pxu<~e-(Jf86bT#Th%|Xj)iR< z-PQK!e$gGq&{fxr1V1w5E*m>~5)7UU_@p(T3~D-6_N*=ZTGBehD<_t>4#kWw40$KZ z+7RQY8O}~?=wn(hNBuRWiVujt5BwLQYkE!U=r1Mh%L@piu$`bWjijrB90=6{IV22n zYvX^6zqHqf{8{1`O*>1MRnoNEiEUp{)XEl|GX%}4<8Z)W0T{tzS#w`ue$ZYZ9vt{b ztZKT(vu~tNC8GIWREm-;#eR6>X9ZXlE&(gS$vN%$AFFuw>f-kMNrO$bwX|gzo*)Iu za#*{!@a2P%@`d|}=yT#@A8cJx`w>4eMIhffG|yw|m&6HgWEM zE>~s^xL|>_vXg**Qg|3GgPnVGr_bT720brM7nX7&!+mugL3Yj+S}<`N00syg?I$hG zc3%$sRWHNM8tUF#g^N$r;PP!{lq}J>C*)}(Ic6U*8CAd>@@tD3jKolcYEX~8%$F>; zYsu@r_tpMJ@sB2qoC$ZwK0j^s+OlHka^^cieOGuy9Twa{t$ zHm5F#j+(`#+!qibhS6rkh0CYN6}saX>(q3s#!3@Zoq45qz1mLp>1LnL{LH1M=dgS} zvA^*hi?oRxqANSQoJKL`1%c3O_r|(Cji$M(UD;{ceY~vpqR<%O ziabV&n^i)t?yboMTdC%~WA<$DjUx%|Zq~M~VR0N`<--X`T^Ez|dPW?|!L zy)xF?+RDQI_2;{^mwbX)ve?V^7-ky-bjMn5e#%tn;_%mMTPy5*zj_D0xvUgG`%4ZXUvZZfbKQe5Ns zn;VEFT%NV_w}*ZsUHDb(Ev`HzXC>)(c&=`s&CJ`I023m%P%sz(0ydBc%V*QT;A-Gs zw5LgOw%Uc&)zZGNYgw*Ub*pA|Z*3W+@XJ{L0E%);4I;u=JXaEndD`qOkX*oWHtmv9 z8z>J7gQDY}zWeagT=3_DejQm~-QQbT>9e$wT^nM)X42>jEKE1-%H)6uP<^r}cn89o zr-nQub>g!6Ts|k%jMq2Tx`v+&FKU|)$c&+OFkPo;R*6FIdS6=H$*=m!$ zf;uft&kjd<;9YN7@fMA7rd-|4C}h5Z;b)B({#nVlKkFD6)qy$OI-T|N508$g<9q#I zRcP(}>kF9$&Y^8<<*9+DW4w)^WU*iaVBwTwAY7b!} zY`YtZWrBhj?HC<8XNu!(J~;es@L$7yM_ReiwAnm2eoeaCT&VM4W|hwD00=vS6S$t$ z>b@9H+7m+Xb?=H2FAwVWHx|t8ph@ycZj(!r%J@)7DV%ORSC#xxzWBl5e}^`Dex)Xv zsA#?=iX-+|?T9voSW2oN1Ln(f*CM|12})M7-1esAqs`6JxBLUS_(|c@~j!=@;6@iFKoVvag6EwhKEh*UW7R$SuQiF`R>(*Cge6H=*cLjiQ#l zkB+}-oo7(e{y*G*Zi`FZdryYRq>|HoaI1*bf~d}LGwaVMiv5!KUmb_VkB9yp@j25| zNVnDOZSO-^Ok$c%=opgmk+c($fJyfqEAeOcjL{GLFE1TIe|-9l=h|X2>JlIl7ZIRk z!r^g~gVXNU>(BfX_f}n3_D=8`tE_^~32d^t$nxfO8?sM0#d?@#qU@hUeC|H-yK83A z>~^0HygOxVV2@0Rl=HfBW_15bo~oWv6>McpKS!tCdi#40EHZ3PB^WqifBZO zgOEocj-c0~cx((xdWv0xAomoBxm0dBZsZC>Fb$6M2!6oFkxQsEQE~z~{LqsWbpX5RGs%>QAjp(uyb=3Mit2f{G|SPyt0Xq*WO#0QEIVuT8-# zYZ;f)L&AQ2{{RX=U3S_t+Nm8x%EfJ?Gy1ngACG^-Gz~n>&D5TE`yCK|9sd9toX;E} zNB5r}aRyBTu?%)5X3f+2-Nbmp55vFXRwR}sX(LyLV#&UCYNtC9AGK=6%&Ja1{C=I3)G}^)=%jJhHpeJT0hQ__FT%TG#L1{wVEjV3tKoWm%$+5hmb~ z{K+FZ?}45aSE5~b-^Ci=i2O}wYoGFP>-=Zo? z^0Ga=_@7De?yacb>RLyU9qLc1S!>cyo9U7;i5#Xj<%064PFRNAM;Weu%f>gq5Ikq$ zylw-HqY04SODg;vWzE0`O$7sjN5p?x7i$+fMRPW{K6wE$1U{jASri z*d&e#0<*(no+@0G6H!{EP;w?_JJe*32=IJ-5e$9~uU02TF598KZ*FC2T^FkA&ABZuRE{zoQXdZsnI189Z*%}?Wy=7nz>|+rfsfR4SFP+} z*5Hdb@LEG8)Y@0u8p;KMq%a8HWmYGz%n29- zbJvZ$kz9VKd8&94<|w9y9vyeumH8&e-P}Kj0!jMuo(*qL8HdF4eO97!@@vrFM727f z3;1VO@a~}wp>+2eg_8mv=^%8sZN*d}$jMBSascRk>!j6w$$x2a9ME}o(88AxUBxRj zXc75fLCTYnjiB_&$0oV$KjT)jelG+Ub^<+0MT$#nl|t}JT|shyV8#IMxxnv=T|2~9 z_x6`F%V&ReaeHuV#1@hbvkm04k$^x4ZZa{?KDG0;BaZg*tBFap($Twl_Vc^@)s9zr zN-aH(?_T(eKZ^bqTurY%jrfY`AqrJYmr>0o#u;*O%0zBC!7+^I6^Cb~*!cHQxX?8x z&xw3B9FZ9k4lfbo+JljWmM{oWoZ#&}IOp}%*V4vDwb0Z0I)FbdNohGrZpp#d=GD`OvZPIL$a)yjKOoOu^&;eA_Ii$a-Tu#y>V1dz>YmgD8Y3-fIoh#_PFN#y6C73OBR zn$m?ncsnM((^u1Hr&~4TaZdAAdZu9n1+F0D#ODqay#?nybhVBOJ zV?RS)8}M&T)qWHFMuN}9*HT3l+-i~8wZhFBd5l#Ym2OVvATI=xF~QAy55tW%e-YiR zx{4TVQU@l+Md4(@+U%JH$IjyejE>mFaIp9u9RuPni>fB67OfZCt(N6)E#xh00*b+%{u#3@majN z(XVuPEiIyk+g16V85-VSFos+LpD2(5G7d4x2D86tZv@@=o;$sBO}9y+{@I((j@=0I zrFSn!yx;XD;t7o!JYj?I4l?3xl_-1De*+uKX`?;QdBBZx!67 z?V)S&J-%(8);T=1kYRE*oJ0u0`RTO{TU@yCu5+02aILrS!K`*nSZB>gUBe7l(A~zc%|x zj{HR(C1g~qd|Tty(&1(L($gu@N{ zm0RxvlNz8o$ie2g--Vt7lf#W^X%V;AUdCvyVz{%Ff*&(>3E6vQ4D!qja76 z>AtpPO|_ysU4O;CHM8*^siW$aI&QaVeIse2?Ic+ti5ZjY$hT4^@(tU6u)0Fd8k zfm8^waG5(?5hH@6v9 zd>i3SW5oJ)pQP&=ZN;j`Eb_`)`%SbPOF8?Xjfw*&@dg+japNBvwCy%u8Qkg8>DPK> z2n$WUv{EuJJei3|GwD6yTH2Z&u zFn?uT!~LWtp2v07tgIeV7oaG21A=(mc&!f;_)Ft-{v`14hi2C_8=D(w*5W;RtyyQ; zu;m^eS0iy59^Cb)55nJ$dRDWhcx}EXTBehxSSwmyjW|hizbYY##~B=u31;99D@(*0 zm&Usf7T($GH@+UX)3j|qMw42KGR=Du?dQqQ$m9(510eOTdnV4cDI|}~--??1_>=5+9W=64C6cuatAo#zf}JK;F2CFmr(c>uV^#P`-;5&U1FUO@20sOgD$8Gbi3 zQUUqmQ(mg&r#Qtk=jY8^GO&h8{{Ys$(f!!?{d)fZDwa4BA%sw) z+N2ouppifZD5E2}qglQtD^Hf* zDo-?XZ*bV%)_h=PwwfI+qg$nT)XQ}n2$VAbPJf8wAY-{1#d)X2gX2vnQ_=2x z4j$rVRfgg@r2!v%?`Qdr7=VX76Z5DU&mE*52(s|kpEjEd$9X%v?v~L7XbhU-8SsmYxW@dAvt!cdJVaLAT30R$u{SAPt~@coHxRXQg8JFZQF+ZoFCIIrW>w z(R2$-C7%jlgAa$d^YgUi~M8pN5!nSQr_NMUEJPUSlrq$ zw!64u12ZXLM!@@mkZ_>jbqCWv7igMht)fSv*}*1>6tNbH*6p8asQ^f-<$+)}xeObe z;Nz`sXu8aP4e`#MZD1xAIz54nuC5&$`(dUFw{dI*IDGCbPc4j!}3n z@z?$V)fDdS*yS}_ZA0MBmEsHSb5OOi)nize2xF2rQ7n=Z%Zc9PT_Ww@GY~@@f*1fWJCB&>*VV3cBjVp4eW>S!-S$)(+S zYb5&sj~Gm<>LJw8Us``2t`-;FJNU!~a{Ue#f`2V&1?xllM8SwRE%bHE&v!L2cA zZLQi`+gja2f2v!S@?u#P1f7BuZLH0e8+htSIV5Auw40>UES}sjjgYjFBR9$=D~yxh zj^9ePVQXzO!wb#k-J=2nDJScn!1v;l!_ZMtin9LzJ^S0_H~Yl9oh^@wb$LRgUCU!{ zaXu!D^8v@-Ay3Mufu1}4YtXe_OGELb);Aj7kZ+-iBylt|F)~J|7s(}l>V_xg!8jaX zky$<(y3@4-Y#CPK{vGbxWy`d1->YYO0#4PCXXWGuBe4LTO(`@jI@0y*-tSJhx4D+q zT|VVwG2wDB%*-}mjBp9cf(L5w@lPbINkzW8S=&{om(Qq@cX5(D>g(ZWhhAy* zogZ0UIacTqXLekeT)yqGmE2e+2n^kE&nCSRZFfVtz0vGP_I;+krbi=9;t_F(@5wB8 zGN=cUwQ_muk%N&(#`=7kjv&%>h_3IT5yf$JY9m#aS8v_4YQKLYsXYkn1#!L^(X{JZ z`?!2ZCGCXK?F$5Q7+&|X)#;~eecqNO%iU|S#`s=2 zd_S((-C9cG;wj>IQ_NWWyhv6|dVdKX!@YWsh%eyKJW{uw8hKG=VFOCiG^2l*3Bc)q zNF&$ln(~cVL=Sw8hns(z3VrMh~e((p5LC#M?mpT@N@W&11&B(B~ zj>l1g_8pQuQx7p_M%+snkghur8F0IZK5j1yLNKQb^0d9wv`M`d&->PGXs>$_N%LL@ z&e}GQsMuJ>w%0o@AX}>ho*;1>!0kG4!;r}{t`BU3UaxuM4NlKk*Y(S58+}5`<}EgP z;DXIWkw+z{5=pyn7$*ah!Eb8nd|jYJcctC6y{LjKDPz94n$8gN-N=B)%J39Ot{dg* zBpk3D;b}e>wD8A-S5}|I%V@WHWsCvfhcXn1PZWwnsR~&SUVGy>73fbHPZxomO4Pmh z*)-MP&dTcVZrytts3^OhTj39a8qb5gYo$RRp=qe;dXDQ^u2xa<+s-_Y@qr#~QNysG|q0Te@BzUd#opGtnjsap(tAn(00;d{xyn+x<64({%k_Ta88`bu88pEK{byR!G4B zi3ZTbZO;XA58bY7!yXNq%GXbeQI69>w_B^5dz(=?@{H43t1bb~c5Y|qH~@}wgMr~6 z5Lo!5MAP*vJDrx^9K17MTukvSknPLtig%nHvZP`qAw4ny09Tuh%P8V85X2;^CY7DE zO3KZ(WoGq#Jq%>-(azsm>faAMKjTeDRnxx7sOtX!X0^4AZj9GHUCX0`EQcUI)MJB# z*EQ!l--_)uD}7el_UJ|SV{a6XZKp)x+kPZvPzKh(Jd9+53HgnB-nW0Nd{)q)ytlT3 zO>bDflUat!TeQm*La4F%g?Ik|tdOc>I9v?kyt)s8{wt4Ii%*u-AUeAJt^*?o&~0`u z9ghe`(~+Jy^%eC{o)!s15h%uSj=HO)wd;K}e|L~d>1otw#c%jQd|ZCjqTkzS*S4D) z>J+t-AvyvV_ecqiUk#RA;OzN*5755`v@Z>KpTl>Slj@g^;JLt-Ju6$BZM2#q1|CHq z2;{?O01xj1I{aU#*^3G6n+-4$w6bA=+!TP!!?(-`0QRq@JQ;hZ{6Y9Ts%gf`eGcO7 zRtuZxLm1iB_lH+GQondIcHM>GV!LpdIMPs$JCtL4DLeM^>1{8!LN(O)ZBOA>$6GHD zX`T$9;w)o9wt=qgHAI2F+L=Jb9YzlgDPO*RovY0}YoPpX@dw4*KLTrBE1FAv8gH{( zYVB-emS~;QGDr7`-Udq^oolrCdGRaa2D$Mk#gcqV*KFY)9=0}7OQzk$0^M9Zs;a@V zs{a5iY}-lvIH^7-onzuZimkQXAI8t8>K5Ay&Yo0^O1N>m%amv4P(}x8?o*96<2zo* z)~XY$6*xUEcedUH_~~`=0_N8H;$?!%WMa3rxU{hIKG2NqgEF0Gc4i5jno?|eO`TIt#y;yY>4yoT!$N)|=k_esgeKAdq}+Uq|Vlf>gyxAC275qR?Z;Sa>C&399@j@IK$RW^2de6a>TY)ki~P)7vulb&iK z(~?WAjVDfVgOrxnJ_^z`d9CbbmBY>DOrR?b#{_fVx68-9eP{mw1ljQ%z7PGVbW4lL zp@&bsw7RsFjnrhQc*`c`4WGQIKBQO4UL2kcLrl82cf)Q3XVl}5$8CC#z;7C-!hedo z4y>?`w#9P`#^i2Q#HvXnzY2Kw73oxQjIV7^ou|z{X!k#RQ^l8Bh1$cW==W1axNp0< zA7_PExf{NAIO&DK^%c7;q+t*PA?Q6l&0_dg`YZnc4_MyYT}!A7=u+t>ow}pIQ>#BIFKz=_I>`H7?E-6lAwxE5kk~e$?7W zhMrA7!$`XBtRG=-m|LOtBk!J^FCP7n?2zGlwd{@<% zQt@5<^O2t}5sadfouGZx9XtlFE z3EF4b7XJVeyg7Foyjr!ZZX1G^!x7JKz}2PkC9U(KN2poAvOdK9`ZSJloB$3pj(hQ6 zoU-_5#eWU829;&Fp23MS+s`SQDGA^dl;oh}q2jtdC*p0qfLl)UX?F}avfRGZ&-*gx z41Xi-T+_u)p7FWqQoz!$@Km$x&(K)X+TFu(EWHC0xxf0=DS2fd!vgxZE&dYuKl505e1wANUa+e!ohX|wm3bB zb5&U{U#zn)p#9qa0F4V_JiCO9><{;@8~Fe#zGVE1-)BVo(y$*~e=3GaY@$EBnmmv1 z$)DzG1Ea>6FXZh5l4ITau{71N`$_pFc&+_VDwq6+0+yY_Uc&~VZ#mg*xs#(w6inZM zz{Ml#G1{<(+R{gujPe5DdXh;00PEDx3QLQ4H#XiG*~wJ=Gs*U=cA90qs&N|bCoIgM zmOiA>?uMpx7cBrRq86C_=Xr9+@KA6)s&RL7AOrxX{g_z)05U5_d`t3zppL@1omb)( zlcact4H{OF?`{CHQMm(C>aV!xxF49u|E? z(qu%+tS%pPfZ*~Ommluu8Ly_i6X1P5WL*!#kEvSOYZl?H>?5{F(V`(?jbtY!*e+yd zIRtr!Ip)514S|HJO1%c9dn-QLcfGVq+Ha}RQqi*6j@6*>kHen~OX9Ru)>?Eo5o%Dy zHs_p2kmv(^h{1r#E3_dw&3sj__`c^@i&fNbo@dkz)5X4J*i1#YF$0`7SwX=k1a=v( zyZ$_UE%6qMp-EvK#jUDpma{$FQ4HH6#G9B#TyFWvA19)W94&r#c+W@HTK%=HKt>kj zyvf;c6a zdU3~d>(9M(`gW!?%WESnQCzx-7j$rxa@k{z*yLr8C)3zgC7!Wu{hNs33%XVavdiW= z<8E1o02$*M9lfcVp016B@&q_wSbBTDRBke#i^C{nc#d74^llwNgjk`SE1;lZEM1pnr*yqYp5YH$dJjwLabTQ zdtuC31F<9l&0RRko|e<`G@((knpA!!@cp%^w=>BMmj)|Yk%Ou^00P6GmpI^#y*rBM zyd&Z(9WTZjrSFUE?6o_G97lT=Vk2WN=+!_RejNrm=~CNJ*E~OV`W4;m<{g4GwVFoS z2M#uz{G|Qwd{t=UwM+P56)JGqfQ0`DN03&Bn)b{UQW=n|nSlM$;$}MSo^EZ2H zo~in!rLCdN<7IaG9#MNN_R`tv4=7^Te78LhLOb^2yI%ll@J->_b!%ILXR2w}kv+eZ zn~o$|69=D^2Eos%$9i?0{{V%oti0i(+-joH6Kh@-UC7Qd*aU#vPTq1k&t96o0lLvO z8MUiTF3##E7AwBb<%BM~QVwOPhz175ih^ zMHQg^$;Nz=?#c-#cF-}OmjrX48t}x2Rn#uD=;Hf)(1*D&zwx|dAjg1C@B^qn?H)Pj z*8B^skBE9CHUlYjVIa1b$w<~&wkr_FkVBPHq@E-L_+3tXEYgkT4`z~#Iz1EVr)z#G zoLt=Uvl-wo7F%lCR-lu$^{v&typhEY8_u51ih`%hIaY{1;6_f;M?~Y$r_wZQ?Iy=b z)Nd_qtfztCxU_~n=6ikQF3_rha2Vmn4o?8rh(Tkocz@z))%0u2T~1gorny#7c5PL| zM=2^7B~A$B5Pi*en#Hc2;%y^LH@EWIoksTZ?%!1MgvM25ie-t=oM1@ogy-cdc)+ha z6&Ol{@igUW@}%vpz2#@Gr)_NXJ6w~sj%UQ*3T(BV2L8?u5L(zamR3kt%~iCKN!kRb zc?#$uVhKF6=hB(*qrw_ziY*cg)w_u_=4c|-wCN*avd6vDU@_b<&5f)NOnXv?#eNv@ z)#j~nsA#s=+CAci)S`%qW4CiEpq4oB2r5`)f3!f_dREo6$fkqD{vYt|!p;4?ZziLr zeTG*nb2L&cg`+qa1~Dq_Bo!wI73g68wTPoA)RVO0{pO>1%GTTQS`DRZ9e0UtH5s+| z^!+AXN%WW1gmdY)v&kHnZ1BRNT1Lr04@P2fymEW_&XuS5vJGES@CCnu^ea!bTQjUH zw&{{5+w+Dj*_UouJABzV;9yr>@cO|u4Lie)sOpU;h)$$Mt*Y;z&cjUz9WfJ;5b}umNEjesj%w7WMuVYCmGUKY z(@yCtOGm0!>%FX=h4QA(Yr~qg&95($Y2vfBkERpXR=;{-6od>(V0 zisVj6rY)L4l4kX=gJw-8%77@eT=QXhGg_w{{Bi zSXx!Z-NuJ9&7ydpQ!zO+>PQKe*$CPRgpNRMrzLsG8LuzUHEm)ob{TB$S{vX_E<^G# z4u3l6E;WA<=(9_xjc#_jl=*V`bCA+!*9WH^D|(Zs&&xg8^%Nc>+4EC&QQv!hXR-V@ z_+6^_>@Jz4!>V6uw@}YDrOL-^^XyIAOeJ?@VB`{{_Q@EpThhN~KNRR+27GaS;=LzV zw!W83cwn0BMFcLsbWTT*pE!Tr^=`+3SpNXK|Z2tftYo*gXM-)3@8e})O$>JHnq7d`YLo z(C)I-?qNc}ZYr{}kIWC}UcKtR=bmQFw(3G=m8X2B?(FW|vG?|`MNi#H zYIx2onYLm0lf`~H`1dow6|}Doy6kIR?c}#P%M*hk>DUfBcdm!R{{Rd0Ukb?^T}Zc@ zi}W&{SpNXBwS(e6+MD5zgLMO?rmZfocMu@kXcoqNWBs5)oM7}dXTbjew7u|NAyqs{Zz@~XW#Y;x@YT)^;qR{kG<{3mWszD#{=da+Rs_Ghd+8zcV zyDXzDf4j-Yw?SPp_!n1gT-~LlQ(KErBbGNqxROo*&QBPmm%=*r)Y7Du62%g@2*}Hl zyE!}_4o*J`(Md}2lImb$-f8jP#6zIYJBcF8DKalEVr*uG4s^MdnQCn_<$YV>r;9ua z?IxbmNopBM2&QO)gVSmGll}r~3m+Rt6uWg>R(FQW4 zu^s7*q2T@%%lMb!o{8ch?IpjFaNqLYACdn69y$DLhOP=S)gHYJ&aFKp?!3<*xpQypAe-Cwgj~Mv3Pw<`M+S}?^v9rZ}mJl%j;1F_DoE`>x*Oe?SNV`W<-lv#h z>PO$u+}5?v6Hno({6D7nt5LMm?r|KEd7<{lw*?W-Spgk^$F+GK@52iXIX26ug<`C& za>pfr@4w%#KhnOTy8WGeSEuFRiq7Z^5N&QqC%5qd+Oc&Xg+45?iNk2OG6H^YEO~(Y zVM)zuo+cj@TSih?I`7?@Pr7zKchmKM6L?NC!r^u6Fx!MK3fu+HW*vC-uH(Z$6s+$q z#Bpj9>6(&{n$F>jaxe5fJ667}@Y?bin{JzVq|dY}hqiGRMxU=y6{%+R5U723Xq*8^hu#hsa@^a;uU!IT!<` zJ*#5h;%&Xn@7bOtwAE0J_P1=3`Oi+(qSTBccxSefMaZ|3 zHVOzl<%j_K@%84mOBBe!b;uwo-T2V46=T$=m*HoxDfQ=oel_@0#%z|Bmm^QqN60k$ z&?1$%$=RM9d#ODur13q(c6xoq{qC;XMw@FHmRXRh?N#KKVhiLKQ`ZZWx$S8}V!sD)gH0keP&a6TNkztVgk zs`#(PiFu@H){)Ar)^h!suXgP6S|G)mHeY+x^4tn%GE2i*QitqKEcTt<-4~unO7CVn4 z>=Q!-O&z-^`HM&sba^-!;Wmy*B$}!i$kmi-O8ow7PwB0Hs~j`I*MKqTW}Mnq!l>+=nuuWi+xq{*V*>Yh5&WR~JRYgf1n6}8mj87EV1 z8oI2ba%8sgv~r{ofq`BHImjGiB%E{yvRK7UxYYbLIsKb^ zo?oQ+ZBNAQXHj_Kx4+Y8xxBD~G4h7C9%>BZ1Qt!8W1OE_`tQQtIkNGb{x7z+(q2Cg zE}Iq2jsF1Ju`p|r@>_^g8C|LrBD`yoZfw~jnmmK^ z0uzNHl(7JEa0t&7J|6sMzSFb@@a@~R#i?dXNg78j3bvw?6Xt@_Zt`5r8SVa_;c8xoTi@%!17oj9$ zu1BX)RW7YO?O8t1CKH%b&5}Wg#?S{$A58uNy+_7=Adgz`vTHhRrL0EQVz+RtYSLS& z*@r9!<_vN-3=HiDwtVVcWv_J@Wsgj>j#dGg6{IDY1?)-SkVzeKdkkX?Be+RB71jmBiiQ>hz*5v^-AtMgGax z4v%|q>u9Xd%QD7eW?YaMqjCpB*0z2UXw%wi%QM~E2%8YiD!MR@80~NYKQ|4|0RxWx zIeVcy$YEnG>~nz1$1Nbp&hK%};IaNjvpy2|y34{7Y8F!)jX_%I%{9b-ek>FF)hD4|xdd{31$yVe?GjtB8r@tx z@x`aW73bVTt8XBL&rBQ~j`;(fbof!?{V!0SNpGZUac!w- zuNgMrBC0Tb*xk5i1xPA+;{v@lab=un?W zm9x;`c$BboB;26iEY+U&-8ykGTe>W_V9ImvX>?9n_AiGw72!=eNACEC1!fpg#00M zp?Kdy(QS1g(?J%eEOM*k&Pe0)B4M5zBq>feo+Oye zn}}otgN}|qUT}FBuWRrYhS2yIOV-x$?KSCidzh>znd4Zpu<`DVacgB7+$1+aB6YgTMhuoY3PS><;fTrK$>4?P^)D3oN5_5) zpIE(3CdX6M!Sj^BB-uKaCF4+^F4KdN>w-=z!n{qX%kcZh>!aP;&Yl+4tk>-`t+I(6 zce{X+L3EH3ta^Y!7$jG=TIjYKkAVC=d8x$L8nuj<3k=$IicM*#MZG0f*vtpcvXhg5 zF(AMyYvyry95iT08wS$p%i8M6`CV&!+S?6E?D8KE{2T8Pd^{u~x^dAsi$8|Qf za2grB$RpmMxXU?z?vQdx?}5S1a^k30%xT9FI+Bduky>eYYiO-)V)e7X$enMg<}>^% zeLm-Jnj3(31;tn%07jGNo4txxR+f;Tg$A=y!kcPj7(s(_fDn!L3PZG;8lItmA|- z-7`hVFS{TOZd97J0$sLlogTqzwztCc3OYMeM4K)d`DreSZne=qN`;YX0|3q z%uj-F*~#_6=nZ`@@cYBQB+&l=X3M*qy9=v}H-_%sNFlcZ=GCN7Qf;MyXozeu>M#yE zitr!Wk4>@gFYOEBiyIaD91yHCT3N#m5N0$u9C3hH=eZuHyvIuMCDc0A)~NF8M&jzv z?Au}_1>GvjSaa&Q`Wp3U(NmOa&F#0{{dGDq7^NIK!@+CU@$>WSewh3-@Rqxy>Tzop z-Xns~!;$H>v)|iat2l&7=j|(Z@q<&p@cxxO?u+2aGqz|D zq?&^+3YH{&(sP9wxdc@{tW&Pd8m3M7#0^VF(+d9aw+}jw)I0b?B&Uo~%ao2nS;jaj_yt#Yh z45YqP3@%h0jEeE%vC*36rKfAJ_;b^0jN|Ul=60X5SM6nY;C)4WIpWLdo5R)#agjYmthxBkpJWY*Jp$s`FR z1Y~p6Kec-|f`4zX6li`E)BHcAjW%g55JZj@chJH5uSn)@Wt$aQ{DMh3- zw$e{4UFpzBk(3$x;XnZ3<0qU91DuVY5_~}Tsi9w6>DrIPOMOM8kcn<>Z7qtxn~uiX zS1t;IaxsDmo_Q(bAnB@#F4}tQ<+-eIvyAy1m*4uIO}&_GtDWHXBc)@@rg&>kzFk*U zy0O!yvt9P>I|ODUlegE?9`*9qhQ2g-=J!zXWxel-H66B4OE#NwZET|x1c~1=MguSe zs^bLx;0_Ia1$AnCVes!vyS^rCsjQ;7XW9qP<%TB%j;A$olBudeD7ZT|Te)uuG>a~k z<0Eh84>lobeJU_h$RPpFIUT(#L&LV7EAbtr#n*=XZLI1R*7F;7bLF^66arL;-#Qz}u@WJ`HP4R*f%Yy=##IpP7`Zg2US& z*3Q=0%G&N@h4{6l#O1YEFGxInr%pmP{{X-W);6!>PaRrCD8BHvgQ`N@yUT4PMX~kV z57!m+1kMm{pXTS~jR8NWdXLJQ^ZjV@B0VEhmOoS5=s!9y9;huPvpz!c=fn*XZVknr?BpGj2h`YAK_mPc(1`)(!PlW)wKFlg%;)@%@Glv6}iDv zo>cxd^xe*nr`}un7Zy-mL)XiiFzfjqD!e`v(jZ4jblY2WbtuaeN}#Fg2m`)N38b3t z51F*@vH6h%df$a3w_PIa-CC;zlGgRhCd2$g-~3NC>Aw%Iqw(3)Eg)6X^$Qq`^202H zV@3!YmA?_e#w*hQ0BHXJhx#9db&Vl3ojxlVE+LS~96;fSVUE9A^G^+5Xnq~C)~&TW z7n;{lu#(B1+7)>KVyB^H1Y~kEUPS0Y%FjdGrI=zV$47rtpt10Nt#=z4ETa<_U=|C2 z;Ezyv>*ROEE*Ys!3Yqj+n>-WQ8q&|gxrXtfx$`BkD2 zvGXH&6_7_E>E)1f?de|Or+gc~FpHZH8R`~EEDGre)TaeWT!43Ecg14xseP+l=#Fhy ztS)mQVA3?A`jx}m**ld7RXYZA_j4cz^YyBCKM&Jaw~p@6?Lev`!Sf*sIN^p!ZobuOTb4-5#sui#3!@coyIZP5s~ zy|IYf+_(L7hlO$Oq#h5;S>7Gh^e+_Yx`mznrjy|h5k(#r(^4|P;W-{+2Sp9HgMe5O z-<;N1oCBfn#&MiqRQ~`p?9=r_hG|Yp+>S5L{Q93g_`~9yegW6)^sf$CT{f|BOCm&` zWxiRkK~~5ul1FT0^V+4l_>1804QjIZpT=GulH*pnc)Ys=oh3yH(b-Nmu_ee;obKbM zYmMj}U4XLr;fDwYa#G z$hS?zB7#^cBZfVOFf-2s7@tGCw$!a)-0_I*)!I)rTg*7x4hTE|Sw?zs-0eI&)uSmAhrqlF{UPBB|Z85ZXoP`Mdvu_~h1*07M99C87 zMiJF-*yW6S>PYr*rHcfPQjLIHX5TR5C;{}so_q21tQ(n5lX!w$L+8n}bVF!BI-k^Z zu7krKD~|HeBPFy~7P9$-OzpYT4aN@{1wk0bbL~_b&P_>m2_|S^OVb-e7nhKjc`!G2 zKQ2H&-pz4Fe6o_Bi5BUmlTZ5fGNRTY(d9G8D2jV#ceV_0(*{NP8z6=qMminGsLguC z=9Q%Dz8ACA^nEtc&%{=W?QsQ??GUR2^ZnehP(kbRo}}_?$~;Y`T7PTCZW-ec+wOp> z20MVloCDCX>(`|=#Oj|7BDU00PcH3TI=17~HbC?sk(~bkvVAL8Puju~i+sy%e73)C z;*3=}JEN@A{4M8bw;Gbmo6DJwBaP9%;UKc@C#laJj~|;G&ulDYFyAxlBFdWNc3O+w z*n+|-M=a4GI4q+*mvIB3?0K%&9$$Itbf+6DElu54@+-)^>w6iC-O2WbDx`uzWoWZN_uRC%TH7`@Y}W_j{R;P1xS4fJHMZC7pc2~7 ztV|aut-|?(6-r$K zOV`r%OUubFUsRHK%eLadlp`wS=bxNY^ou)vTFN13xj~2tY_qxcZRMjs$Bww_Fgo%@ zt1CT1O%<%y&U;-h?mLvZjaVRN;E%hIaKMjHze@C~)2B){i{-wT>*cH8Ugog8u8(K< zaRN_aq`sRJ!S8LnyQ3tE=2r}(YW5gkF9SSoBe}1UTJ3x};&e-mJ*}p;zw@o+MqqNT zNgVb({{T+4^}oWK8%Q*?(&w7xZsNIu`WXfQ@}?p(8w3yoEM39N4lC!M9QZyj5o>>H zu)MfgboCWE1zHKV;Sa|bJ_HS3GqWwFOIJDf09y+saYG^*s zV<(>0q2^&Id7KUE{{SXAJBa5!`f-}s_<3$VAN(QJ^(&a|HJvL^XdU#I`K7nnI8Qft z{w&I@2bD#BdNg#ieklb#-D}&btyLh|Ux4l2AQ496jGIw&W33)5w~G{zCk!Dc<5`#h9T3d4rgf2?$&PV&riLrzayX7 z>(2h}hDGK6q2f&z?g`onAkcBF=~ou~MLm?P1NnU96mt|Xn)=0|%w;6n`xpbx(u}+V$pf5MN$`VQQLTT%FRB}jCs7u&HLdmBEUJ#ma}!2z zc1s!A^(ua*s};LzT7ILd*#7`&U1}Dwv=_GXnB}!-@>R~|)6io*hpOCYJ5Y{| zEx$Y7+bw$S=ya&s%`2N;C(`Y_S8kRU8jRNWx^A5E{g%qe&E|0KNL68s7yF=gRxWwRc0F&FhK!i1QJz< z1Oj^Iyr$>GzAw=<=(I$iPrHil=1W=QTXkc-PB_RPD+7fDafaYmwFw{Lm%+*B@En$t zYmm(V)TJ{AEjW|sizvezKxGNfB%Zjh0=0ZaB?@(FUz$&qF2CY-*?IcgOE~4TyF6pY z{{Rqfd@HJ6Y73=Y*lGHO&yfv`uLO~ujm(h9q{xgnb;b`&e zB2>G-yobz~+Y%TcNBfKcAoa;^nF717k4dU{tHE9qySvaXtlAmmeM$*!2bh;?5S1H7 z@0)O9=Vnc^X-7cBHNsW@A@Ybv!bt$;VpuFqm2uD7jXG zd);oIE|G6`?zKzL&|2<$ot3J?Z=HZ~_}9^Yv1=&tmb@^{A+b-8_xga%O3_q=ET)QHTpLC8zeC#D;(do_?X`ht;0Ps<0H2Xi=3TuX%<}2pW z?ZjyuK*Z-VsLO5#JbHE?O8JWR;@-zbS?#si#;R^wH`A6UP>_WiU(C+alaaTm#(US> zAMjA?YdL--M|$vyB|aSu{<)J5lFf{OaDOWKV^Y_k)qiJ=3rUX7!~0IpQ!*^kg%@%o zdD-3Eu6F*O)%5sXXhEaPs=s+8&RawAZS}l~B==V=pkU+&1bdG4+<0r^9irVZj^^UR z)oYgA8%_gZNjMTEyngUEz{w_v5oE82MIxzp{1PJ3Us={OTPyCVFlhIL@Utg{{CR6Ph(saz`A*!Pg!lab__g~n zXkI(BH&&3rX>>si2~0-k@cX8|F!8s+uNZt0@fp4F6{42aT;{-Yes~7f$oh^gN*=ZwS!)f7x3DI+TO*Xnrqc)+BOP+XK=~sz&$b- zkOgHza#dp8+FSnsU)SP1MI{<-MJv6meP5>h8SqAe6xjG=@IL;z5uX}|;W>FHb?{{Xbdfgewj<}VQ2tP60~g~%nD)B;Etl9MaoVYmUgaf8_Ke+uk0Uk_?`db~HNIT}N!Ohn!e#jxyLN0PT>&2dU3m`Xlyy@u~5h)~Le5_e7CQGChu?8ChhEsoKC0 zFuyS8)DcQJigIZuaGnnl2y?jE8a93>@xGig(rLGRa??QS$MILd{3+@2U&OZeDQ`BP zrO!EC!YFQC9FI^4ZYu}IpA~#f;qMh{wsz6zbK6^)3~4$jkZn9ECCBHA;6598&iCTC z?LDAfYZ_IRl$vIPb@Ez}>GQZ7iOCr`tzRwesm8gVQ`;l>yR1e>pW&%W_c2{5{{YaG zRjB?oDg*Yd15$)~sE$m2PAd1rT}w~!K9rZ=*o~>H77ZLS7{~#0k%7&5`}}3_qH8c| zw_X_3?d6%3M1u^2amOT)RcQBOyvTkqc$dQdKk)ELhNGtHu&e!!;M(RANVwErd@_CDo3|~udyHzhOa2ZAm6`Th8@+-o;UGZa6@Q05)LuD0^)Cb$9+GMz8 z0B&a7hTyEJb}#xiN2VP4#7cbbWcI|YYNw*<|1C|MFk>x4V^Z#*bn zn8_z`#tk2b+BEuihb8e1&8@bF1;o=_O%>G3=0hKt;3;4L>JA4u1OQK3`2jy@-yK`R zMUA$dWUavc)4A!_=4@0R9{r#^X=?XL;$2GPS++3)1T7M6^8w>HAC7UJK9#{NHAw#R zw@Q9SyTBnTs0~7c<_VOK4?PHSK<{2b~(=COSi*4GfyT|}#n5gJT zKO1XqW2E_K6c>$n7J1&9#99f%k_T6I^z$@e{>2pA+wV zRjTS2I-aE{Nn+C`U{&5RlsM^x3a5ZDU4X_jS@CMitK8}Oe~2tCE#tY4;H2L(%x)x@ zoyq~^sEvn02IJkqt|>v(-8Fye--nsT<<9Qbr!(0QpD;=_ILUR@tlvrn|$N%on%o0RjK zZKg=1l{V+@$QPE#8-N)GyiZZ_1+JkPhEO7f8N#p!pgG2R@_V0eO6%kC5%A58hL)D` zTk1G#gqtCs6U3h@b?Cf~;FhIQQc+yW@BFp@0Ea2Iv`ojfoLu;x>O?^_FE5)MV=ceY zM@}$68R>yt)~PE=q+BGn@xWWtuIlH(JdoXv~mJBC7pp>eA#2kBozP-bBgopCss>M6~C{`NAno)3so07SYS0{gB(nlbM!hoVO^bTdzGyW#b(O z9Vt+%r1@g>zxDloCKIJLuQCX6`G{-g#i`}HaBz0&&%7Kn(cI5Q^VdO zw3^>ASk5BJzSLwy@?#Bx(UPopAD84G?H&oud4-EzKyOFQD_nr98y%_0$SvweVO8#7 zDp^#=Bgci`{3`t!zQ5Ns(IqLXDO>uvoF&T}BiXz^rcZOFrKXo4@l~+6OQ%F;2#QET zj2MF(dD&Nn-*s;BZk#af}d8P;-&(UYBkCi{mXiIjnBK;U2q%e6w>RF|&}2E?o%RnNXlG z$Q)&QwQ%Dp*QmKERONf^__w!BH2L&4sW&u~H%9#01?GjSX;yanj``LpZ)Ul%yAwv^ zBn~($i~*c?A6o2uF0g1CJ>Aq6e{NZsE-oTxW{F{E7-6>ujJYd}0;j0Jt{1}k=CR;C zTFBj5-(6^I7$V54Bn=r-M2d0BA5NV+;~gE>i*4>~h2E_^@mpM3qebT&%GTlb9k~AK z+D7bT0y-M=aQJGI#6u5N-aFp*)m`-3-IH1q4p_d-^UIwqX!mxF1pY(BSfa-v%7AdE zJyh|Lp2Tu1)iixqUGWB)b9D{9mX2pw*45{BQ+YCgH*N0OV4HN^0ox_*@$=I1jcqf+|`lG@F8CQM}Gdz@zt zfI#CJHR|VeT&Y1)hcwf@nw7is_ghZe-rCz!Pl9?Qd*S_ou=uB-*-vn=$95HGV&T>x zUNRKmk@84YvVD8?uQtE&FNt)0Yg0O&vf6E(y!SBMrlk~(7zrUhQteZW=XTN80QMEu z=-R|qpAz-i9%xfh($eDi!6KcvEX@%dOH0|(TcwImD-o7q zg;3`wcNyp_llY0@DYbnk!SY%}x^2Cdk#A>xcPzmayELVVKzD6FDIYH-h~(Fy_%hzt z!TQ#l;0+z_ZH!u7&E5Uf=%RV#`z($E@rB!!9257kp1IeOgzKs)rrXgcZMSdI>+do6 zZrRLh8m*4C;+-;UJyO=r{^~ZFVY-~{6NwaT!>MRhcI6PC;v+pP2LAxWPF3Tff!*Gx%u(C843x;(ZJm29Ok%1(}t5}4xp1JsLvP6G%gG?f!<7!sh2J27V-H;}0z$(db)k)Cmk=Zx0|8cP)FMo#u_FQu*3 zFFiI^eJ(pCBzrf*{{RQwUTSv!DuYJ3)h%~dnHL(VE|i0$=5mvEI-8Wc z(r%Z0>ntsik}y{uwe%P4Lwlcy+Q4U35^2DW+rN0f`&wI@tEB;%(e_}2jC*>0 zYukTg3$s7PS;DYVmTt~F;1S2_EAKH;{miUyMc!)X(LWx3GH4$Qyh-7hwI342qv}^T zFuGVw1}^Qq)k(n0oUm5N3PWTLqc!fEgQAhhBEL9);HDNUFUJpqmlB*q6Eiu-7#A@U z`d8?llc`&3wkbWdsWfD8(Xb-CN|fUYROYvp{{S=5Qf_W9q4P)WTl*)EjyG+o=~q$M z>hV}hZmBY6DOm1hB#u{-c^vDWSpdFFq`PR~`%5vE4&tcoRuh+Y? zzCtsCa54GQC$Wm^%WSF%D}%>gfBjXi9}_r7m!PWCjGfP$ygB;|{4)5l@Uz1A7dE$= zUZr!TLSFXHK(cOV)RIF24?T}+`IF<9{1ey3Uj;NRU&VS(t!d&f3+d`5l^8U4(MOOA zG5}SA=Ol*CImLdUcx8XHA&MB{3vD0DioFz9HSzn))P4l`_AF<1lXf}(0CB6@gs*Gr zdD6UgKOQ^@s#;uLg?Zr(kg62&d9Ps8tXA;s8_=HkubzApX%shBvnczHq@Qf{uckB! zAij;BCrKP~25UuR#P4DYg++=hW-eAX!H|#!f4iRMzPJ5`XY%|j;) zudVn?O7WJKmfDrFP7GsgfPCrh4O+Q}%C>07fBwBmrA{P@1qXv2antu|B+X^4ZjX;X zI{wA$s5RE7qaiyRbaLDADqs#s1N9Z+8Wy#zO(cF0_?O{?@ph8X$qMRms7s_pLP>XG z1c5*VZXklA2Q~VOv@?5Gi~M=`VWMArJnVK#LhSjEaKgF`XW`DOpYV{Gei3*l z%S($nV+Qj+OqoUV$L@#j&UsE7lfkY>U5^Eb7Ry#>PNcP2vIh*j> zM$^t3y;Js5@qC^z@pp?ZE<8p3xNU9itx==W+RYFu<(0!^`JlELaxsp2rVX&A90X; z*+4lTjclxpwR)aGqI^5j^?`M!q}P$(+QieoQGAx=fX6xh92&;>gW+8#z`h-~)-Enw z*~)}4k}w!P-U(MTRVIpM=s&3qm2u&(5okUon%y1c)XtkMvgNJdf?eRKUc0zv$>0z;CpGAL z%$lEvbng^hYfT2B;u~w&H0vv!LuroK#+&3K5;#@!7_X~fo&c{km&Vth@T>3qEd{I^ zq>|j)-B>16l#^+BUD)%V-o!S6kC^1(8sVKcWfkhbTl~x;H!Ixme-~Nkw${x0bdudm zaCgZ)!tHF6&<~)<_BG1uI(5`GpRh!u;1Y@1EXthSt_%_V==ZKHfGumkEMM2dU4{b6s7Zgtd$B1V!RowoB_9hItkU zTYDES1`Y?yf;*AWb;WbKAA+^LPVZ2j%Gu_%vinBat<?Cj)4&Lt zW{0e3@m(+3Z0_yW#D>S84dbatbU8Z|8BYTqy{pTudT>hjvsdnu>-lZi^eM$V%14vv zSF&H}Ig)g{w$fGB7*)zJE?;TSvtZ-bx377r+uFybOuEF@>3Ic`&u=BFWm-9-3KS52 z`i-NfZVz0yQMA&nd`Et5(Jm&M>Cy|BqALuXlxcu|LV_7V1oyzHb+M!Amhg5!e*@L8Eh6o$Km>hl;YeBfvt|!#2Wzz1o z4Ki0TeWK92Mx|SW(;#vi<{hg$Q}CKc5?skG>Ap!4Sm3ybqO$H(^7jLRc?5n&v^+iG zt#;<>XkgPW4b9P(R*6E&v8d#H%a9LH51{v~lw&Bmicg#8t-ls!3pn%j>~*>n`hSG< znDm`S?H<-PvGtMWNs#1abRjg1dZiI0esJ4NT)B0*&=du0P)!YSz> z!N@94eg!JSCad6!oi6rUgz+m|z9+cy5P*(J`MTE^W#VZpd`AQ(%`9|daVr*;@>h1%E4*-26~VylYd2SY zM&ra9&XZ{jnxtQ7k%GLA7C20&dnnH*l_Nf_fDLmsiLV-QsXIM=-8ENMyINT-?aFi0HWoSJWfykxqc$6p3&8kC7~ zGOzYxLvMN|O{A)AFzvuNQa39Qd)JlxPqEj0U97=1#m(p1Z7m|Vlmt+oTwB0&`GE>l zlYkG+ymrM}@UEd}r`+i&saUYot?yFi8|9EkHvIA=QZh!~amF#69Ok;P*g7!BD(ZaG zQqg}Zm6Nu=F-j?^Gn9&LFGtcZVAFJXWke4pwdAbtG@FRr84JIS;;sBi)9tkO)l%MNwAB+)nkBMEU4=`w z*BHxVAals%^N>J>&ihB#HR$XiBwXBFNcMMIJg68c1=#O#v~?hoNKh9Q=}x3oDax!L zF1Jr#Uzg!;BG!pCW_aoiV_uiS*ZOqQ*)*`qZjPR<7?I2D+p%%E+$kkTX6fF#9Y;&P zm%=ue`sIV_T5Zh9rryPKF^cLTuz7PsD`XYt2Oy{_18_x9@kY6+_+tM6M@=GITWj=< zoc)Ypwv&zNC%Tc!@&Ww0{{S0&R=?78-3|ymyS*;nQqiR4oHT`lGL>R?Avg@AVC}9b zQN*ahVXUKj>%Fyh+ojdD{{VxWuN(57pWujBO0cr<)VG%3*|t;2e%}?M{kKgrzC?FO za#cAWG99@iJ*xfJkM6ux;&Y{HdL5ptEwqwtyKgpiA&&q?8CFavQ<2qk!99FB`{G`^ zsNY)ZR|y5&(7=j5&OXmN#!*-?kw7GlgCyhS7(FYhib!?e2@AX1pX{whc|=fL%G)A{ zlG`ParW+woRT%kt9OAj-l}DOYY9$%Vwd|z#Y3TLq{{Rnn2g??$dJn`;0o?d{EirY} z+2QDd+qCdNko@j9D!~~fGVq}19P@xqYs~yp;aKdndmAYHIVH{2#mCw$^9wBU}puJgdRfAEiZS$sd@9dUJSbyiEYGo98lDCfu*9a>Cej1UG_Jw-*R z_}a?O&PUNS#Mex}Wsg?V?g&!FINVRm*17N!s<~-RIr}%dyl>{y zvTJpwos6v8Rvj!s@9q?C^2@eRj@`|A_w0$A4~%MUys)ohKb#A5kCz|Feih`*HY|)u z87JDkEA~%|{x6=C6cyiTc3Ww{Y(#ONUW4+lw63pCOUTlelT6(I0D_U}R<}MX_-C`LD8m9r$}w@b-_lQq&;4mQWZ+X>a9280;4$ zvFdpzo;VfpNBk7-*hQ`UH@Q7yd!nb%g9)#@bPM5kqS(H9dvt92SDMz@?`1{b_H9DByq zF?XD7E^)hzbr~GiH;#1+yI&0Is|W9G{>3nO`?gf%lla$lJX{r%IcGvmyB~`>0)Y!D zI}Qi{9&6IHn>p+mnmHtgJY^dh=DfQ=xCF@~Cp*~t0m-j)v56OV^JpV-DhH|*=-MN^Q1 z;Qbz)t#R zJ~AE|({upgKpwxV*lq5ut+jJ&CEBoe{pzXQ6$+?U1RS~K3ZwA{OKV>oi~j%zd{~|Z zgH#}D7oH(`q(TFEPUDbJC@L5OkbYuw&z}cptFu0)r&S$)ql4U8^8tdEHDi!FZOYI+Wt;Jw$kcOup;Rjs`DSZ((^PXY~~ zvjU}uC+`7_S3ThU15zFnkbFz{vv+-K{j;#?qfsjj#jA-HL%0CX8NXc$r%7`=M0i3Ypl1mQ4qWDqcO*h2$*P~6;bsz1R?wVO6pIdhi5`2YY zkVnY*2;=W?81$~=!d@y*5O|MVlHFE!{?e0AvwybUO&-*NUPoZ5g(^51`GLSb-i#KF zo?UKa?ADu|N5OdPr}34}uc9Q{RM!^nH4Qx2%V2gOZGfLV60Ppu87xXQ)Z3rN`S+O+IM| z+P++B$1)76j!xAbROdM3o%o^qblBSK8i$4S4-eYw_IGOb%`}$`ilxTgj5gpmBoI#= zXVSeIGN&pNr&RgO#t+)YQG2h|oNvUR+IoKwcq#k?qsMit-&@=?X7)EMW!ebN&^hbq zI)hv%hO`|@=fs*D$EinmbgIp992-nF>OtE1Zb93CK?H&^US;81dkYJTxTNtNr-!^# z6EaG=f^UXYbAU3c`&kTpf)wO~oN-(FuC=KABA(n`YfwCzgbymsrA-{mB9cP}BRD6Y zetLGVj>bC4#&+jN0-mb-BkuOpwCz{J_tRKhMR*RJfu7ulOpB<<%LGxMnEKacq21dZ z6GH}6Lc-mOmH^{u$;YQk_}}2)?ExN{qUzdh?2x^jmTMid1_M95N8oiNfzKG?zK!rl zjO5p?zT2i*JbG+!M6q0uQ19B?@CP3$Bc4ZY)#<|)t0<BY$#r#(eL2T9lXv1B4j80~wT(78Sy)Fa+@lpFalt&E zb5!RkCl}Q9zN<-fK2o#QY&8D>9c$JXcb2QIYeoxIvPc@>+rVOUJC#>)AutI3BHNC0 zT;;dG*?c{Dd8Wf@tKMFt0l=?a(fmu{>n$@*ORZ1OxwckSpKj(LWDKxUbF=_( zYZ=t9c*YP-b$7F0D?9z@)&YVf7}y zy_F*qv4N;ULMu#mVG}@o@+~jl3qyhsFb53 zKJvK0KAiOSshs&*gVy(VeqZqAeO8iA%>2NgNk;O;r18pG2J(9D&&)rk=UO%zaJj|1 z?IPp%K45*OFj+wZJZBjnjZ3X~Cf`Z%4!W8}%S~&g%^YG z%$GALngix5G_j(g94h6r>M{>C&sDo!JDyB^=^sga7rE1XJMiyW(_rxg@oEcX@`f`A z?d@_`e*W&v11JFWBfk~nx<8ID^lus1Dt(twx6`1LO}2UdXxas5cycgvw~ztJ&*fQ< z;v2@(meRr(OGYuXw&Kj=en4Ul7v*3G^;)N@NpGQQkZTsupR)Nbqz^V5K8 zwUzz+*Am;>CA8?X`O+DfDnzA&D+V|`0szM+r=@z2gD*7AJHj&A>$dP|cQ=V9^)a-p zk`>((9l0nEVn@ovdWx!&RF}IH+v(TW?mXFYMLR3M>r+Ermq5JmRm2uoFlbL5wo+8y z?KEttavXfbgPZ}LbHEv{1^jbmDbjAPZAeI^5lb}cP)gV!ZbI94bUXkt`PV(;4PDLU z?TpjS1(u(b`#!-LpJTS&=awz=U}G2^efZnNwz@D4D4RRL5t?~iv~fyE=-l9N2TrE5 z!r&ZZ?D^$q_;=THo+?!~ld<(KuX>hRUX|iM4ZfQqTKQnwx<+?Otp5NjN4yZHZ(X_h zzV`r}ZwTCJUlFx^Y9j;bZvrHZX=cw9OCe3e3J-opIu6;%uMCsK8lQ%zjWu@y;iKB^ z5e3Qi8OPliC*0Sr{2I9ynx?gNycwrRw>mM%Vy%t9^gNE9)#+exH0ez#E3Hn+$CjH` zAn=y8cVlH8v@`zzqTa_DD|MDa#BxY(xy~{4Adato zhSHKAM&q6acx;YWCjS70G{^A`=AWnB>K|aUzJSX-s#PR*2yg(wV)fM524EUn!W%3b-!k18Et^KkSdkvVXmsQL>Nca#Y>h06U|V9217~{zF_PW-SEOmaAJTj+rHlJpokBfvZ0{1ke7l`R~wtiDlVySw3+?sVq_k<*-AW5oKN zgME9XM}78-L3;ATaV^$dLZo0s$13Vjp;Md?I&d-NR=_BOM+lbD14h?y&&x#y)vdNOt-qBj=LfauYgfYNT zp1?2z>0X6(GF(Vma0b%E7dRL^fm}wRp+!H57gAdZVtHA9 z(FMi>r13cCj+=sp?hfb1aaz%(PMvRU4ew{Y-J0{-+jjYrQZs3^&c9L8b!}tfZ;fs2 zECuz&z5CAu8}^6X;fCH$PER=W=cQo9rwuakHG5$(nkNd;+_Z7a0VD3?<~bl8tb2ow zmFhRrHj}G(s^>-3E=I9E#iZv+@}!mB$GAte0L=L2Zo!1dz; zH3y4yyPaE0(e;S*k!Nvp6tX;)Wx~qAh$Cq%IXNdCy=r|Y;#Z7qd@C=9uA#cT(JpZi zW-RY-mJAqfILFJ-@s5~0){spl?49prtI=Dw;M#1`@h8KN3hB16nDv{f_2`r{+I^U< zu#a&YjF}vcgOBeHpk@9V)U13#p=ufp(nOlY-|nEgF5X;wP6l(rvFJ`S^Lh%y@%E*u z_LN2O_Ru4x)c)>`)FZ8`?~1lKc@GBH+AuryKtc~BG_ z4i}HRS{lEOtnT#Kbo2x5MEga21+9WbYSdbHE%nFUWbDZ&m z>Q6l1B$O4UXLOa7wBOfXC1E}PCa39UgdA$%H541z2$SF{{VuT zY0_S4egmBbQ7-OcB=830LOK5cfSUUc!I62s5z!d@u54i~j(PIe{A=Zp_$dCHEyu&J z4P7QgaO#+H2?Lm)8TR77pZH^O_MeA77MuQhX%>(9!iK(XZun|p*nk_(mt^A6)+c zjdIE^CEraC!^;alEA0eu6uRT{uWPe{LvItQDEQn!uPjSthU-*?hTkq}m*0jp>Q>iL z7-3X$PSCj>#eH0!=aiPi=b7YQS%6-oo~E~SDZbJ0r^nIYjg6;1J#jOS>sWV@fXo8q zkT@06_#)U#;4g^L>?bx>ZUO0$c7y)_W}=(-tP@%vcK*ZCZ~dOM05Eo3U9Z#k%xmZ+ z2LnBYeC7KExRc-oh+(m#)Gn79{{U}4*1nGmf$d(UEs?=LiIK<@vXXjquQ>gpEY0V@ zuN}gO7@Z#EEFZpF#oK?h{3`KuKi<-AMnCP7Q5!QIgUmxyqq++w%^3fyF0={v9R7ytByc+tcL-_-noKwVT}N@)rT34y19=_UG~a zD?-=ox=pkS=O4NQXz%M@BxNN|*SkHckDjkJl2+-WKJfU{VR@$fKGC%uHSQw39uN>l zV8$YN;}WBV*mp2t$0HtxCcaNU2dBO89--n566J68Oa1=<+IPEgHrDx?IMflfa(-jf z`eMGY@z=$l>|GPUb_o=*Sn3)qma}R;R`F`eh=xZ4tbaE>4}6OAXYe+);QM%dRpGh+ z0O2M{6{XcioJ5w=sW~Jl3;`&dGRAfwbw26TTcvY5zY33(LC=A@3$M-6_+KK0Ob91 zUp)Lp@YjZXb8Vz+Iv8T_Fvz^ZDGWU zIg@g)&5y@5(?%TCXMK-n8(Ay{8gcl&2DxJfX+m_w9SLer%%(r7sy>*xEmvc(r zX>)~NPlqpl8|c0t(sa~|T(D_n zyVWiNJ6{sI^jGkK%Y! zN>XksL))}1KSl8?*(I!rZ+M|RxVGTTr+`#v3&dPFK;FdWV z18C3P1oObGnLI~f;rm;NZ}fXuQPxTAQb;2+73H#7OE5g~p5E1);;U^=#?DKL^#Q9+ z%F3(~ByJ8Ivnt8<1-mz zX=0?>Y1+xHn%956--*pr6&0)xO-~xl4wSZ*vL&A5x-wt^UPd^qf2)K4Zi~@uXKYM9O{9Ah&D=_{&Ot0gF+BA&*gPR~srZM)Yi}Ca zU&mo2w$`PKyNoZKi_@fSE1zi1bQYftZ4<;0m6g^zgnOcA;aHd15I(#Dc4S2mXMl6*07GD|V}^49OZKosONFU!t8R_VyEv!yC^CC#phUw`WUU5ylFPAXLv z=Z{)=CsewG!z8T&xVCn;j!n)MUCS8*@CP2={B@o>(fmIvYT8DVGet18wvq_0Rzl5j z7X9QK{?y63~1rQOW)MlL+P@ZChp z(8O3A0tm)NR~!rw1}d(hu3780mo`?iGiq-sl4X(*g5buujzy4sr9obtem!cZjdk1m zPY@a@0HOlyNS)Ts@!~xZ9q?%|9uJTCHjuc2&Je-gY zGoDX9YYJ2=PCnYKwOzco{{V(LIXdEPjTj#%U|-JS=p1D`-EobcwS z9-ra}118D06ShzqByP-e&H={i~=_Xg~%2QI|bNa7nUxXRjlreI+Gpu7_Gm7D(xJnd9*eu;%eIsrwFWo5Aywv&6EkHbA_?RDKU z)(tv6N*S4;l1Ce*w!(}^7@Tz7>BoNcXX174lc4y|P}UPxmhVx!wJ|M{E(B7tY%I(P z;C3Fp_^u8wBHKfm?QO)@@kBOUNaVJ_N|nGk{w(vJo$7rGXmtT~EP@el97WzDsy46y zsSJ8@FbBPJIn<-eCY;l^%gp9VN#6IlFT(ky()>lIOv`gEg|v!q798^sVV5}=`9@ng z-~&*6V$<$)FBC{s-w3NE)@Ad@_Fmm71Mk()o0K(yNRuBOg9s# zRr2!3%Q!e?VbJyCuc5AQ;y#v^-Zot!QtIZ*Px7Lb!t8ZB6r%&XkQI=SdVo#`7|N|r zYNIN0R=&62x8HNNoVm4#>ucW!K82~+TCL5k%tOz68;ipn$|MnoBVgL`{np6kKs+9C zTF%{I*0dNdAhy>mQNOd>&2KF{%r?gJGBOV0>gTBG(z%}=Xpu>*+3Jzp#FsHxTiZzZ zaLjy>8!M?FE<&Dq9FMJP*#z*ejVZdgU2ewZKF@6xq+38#c4A9^%QnMEqwf)u>0WJ2 zBw(Ck+_}59?E9zF?^iXR_Ob7puY+w@O1-?E;e6I$VVg(z0;08TT!sO@dk&bO=;fVes3BW(Xy8z<6 zs?_U!YY{2cz2ud&+3U9ZY0~~@JX=(q^yqf-Y4Z5HLbsN9A-5zfHxtT9k7(VIvmbbz zf&!iZ_Ro-N{{Rmn@RioCFA&3Rrpq6fbd!Y=9Px$Z?O~3YTXaeg{y|&Y@vLuP_ZI)X|*ea}hlw_Q+ zkP^cKa5-EWv<=!{{Vtht7m3%T0A}%(%xMX-%Qmcm(4rp zx?y6B5OM@zSb)Hg8JwPsdenXwheN;Aul!r$8JAAANn1|S^m6|IX_bJCt1=D0yd;3R z+1&KSQ24FldwYF7bl(r$UM2n3pz?<@mU0AYgt6PZ1aAkQT;{hv3+Y-mo29I`I#{}v zSPRd6b@Q_a>GHSBfhGw<>6h!6-n`|v#(ILe>U&pb@I~6+;}3-tCVN)(_C_inNjH-|$hrT5Au2dRz#F#m==1Wry(MDO>*lWv`9#B55O7{N%1R^lm+uc0+oDgoFAt#iqA9E&pHUV7r413qD{0eh*@L$04mK&Q# zv6rI z%-QLW=Tj!-d-<9CD(lGnTGZ|S&*HxlLPy-bxKsZCe;U0XNVbMMc)(G-bJLJ3knx?U zwfK|c2zHRs>X%FZ0Fhd{T_)itjx)H1L{Lw!74))~RC&=w`}{>9V};LZ>wX_0lfxen z)-Ve;j|1)cUP1mf#oSD8r7Fq@QGjc>_*=d7KZwi*Hh6e2{4Xu4D9hhPR9@-!XY3sN zJ_}0`7}=`MznY=`we*s=1Kz%2{ef;;=iw%-tbTa)i3uNAqBZpB;18{PRG+$!E_z9d z!@1dpXx1RAE|@w?7$mJ8^ZPUYW2K zBNGFjxoi>seJYvLn^Z+`#5`(OXgCZ%#-!I7;qdmUvyc`d-$5!5{hRfz-vjCFZT$H{ z`6CVU_c-ZZ1TK^H{SoZS&96i6&x6*`YEpP0%@Rtjrd`Crz+gd3XTkjIdgtH{ouhb? zU2DRZ_r4dqavFPU7saK=uJ}*OwyAAuJ!PY;6RPQG2res-3v{uT5L=mUrL!OeNr zce;BLrEMAcBk{%Wd_nOKT6nbkc-b{u%YC*{l#R+su*g>@1-9-u?sH$N9sx-Y!%qwY zfil?I1^{F!3Yo9W&y70e*MUAIYj<`L!{!}g`4OZ{mHqQ_q;fj{0FG<)-{6F;sr(%9 zWyI`dmVGAHM|M237}Sz~8usvZbtm4)^>YqqmEl|2Ieur4{@tGs^zBpjdGR&Wc99F% zo(razJ6Xcag|dEt*W+i5<+}Stjhjy&*`aA2RInai?^1go>tD400Jp{B*?!D^Cw7p> zxuA_$HaRk`2e>^y8vJ3_yeoO*O-$O_O266@DK^ou{{UIBL1gwgIT`fDcFD#yla|&z zs&u7S1*h|VgEZ|j=SYU$;iiu1E^`!9+PIN&I3uP(9C617t_^wz!yR){veahN?xsOw zd|4Q>hFImm+Qj-cHlEn$8Bto+p8|Dn4*W6j&BmjsY3+3_&}4tZc|r)eua z&QC#(+S=mcM}RfmwZ`MPC{;i>$0129q;feQTKgMF)@9T*D=A@(L~)dj<}3=xcJ)(_ zVh%XYMSNf4i7stCMJRIjfn6EDn2S&XtR8_B|TJ^TyF-A60q~E8iA^oB5rL^!wy0xJ; z*Y@RACRV{vWr!RfaBG?n&>gE-avv&5&(@kMC6H z_&Mq^&~*UhSJLxdB;;)&m9iA)j2hv!Ukd1Y8jIO1FLgp)Qafm}#7NElupDF_xjDz< zUpbDzI@47sw4YO6XKNle;Qcr3dY_Z3TCBFx;wVC<09^GT0)F-~dVMilGkA*fJy-h@ z);Nxb9HKb9v>sz1bMrA@nYdyGdS{XAm^FL94S3+nW4f`92|+P{>-&~ry+{mCOb-75 zolmR1t=_G4x^T8sl-wH?jh)>{Qt+Ww0|$%-Ia86zAR73J*iL%B{;g@`y*$@*ILXsm z9oLKQAUcMa)~f_o#75pu-HL@bDy~mG4?N(WYOlp@BTv%&X(x*Hw7arxW=m~0IU;-* zq4K0M1sFekc?r%iOJ|Dbw66-!rTBi*OVHoiL8UTF^C=Q}fE8FuKV$qj(Y!nHtKqMUbnRbLw}vfJRheY- z{JG$fWXwgd00CMx$2^X}b@=k~)>}<)RkfS@HtKJ+M`Ltys~n8351E`CB!N}b(5H@?JHkC7x7ht&AM$qIT=D$P{QIuun`kh_(gRf=M%y$oHq>#&JDG#{=C{|(9*FC;mRs9e4UDvKWeW2UDyINZ6 zwp0C_%PeSTcy0XlehURt$Qb8t-&~%%;eMg5_=`cZxwTCy&ht*xCAw`z;Zjt2G9N9# z8D#}|UWca#uh5##p<%3iNBBRiwZmJ5@hfRU(>uS>yo-qBZQy*~Wx#Bl<%gG=`V5Z` zI;wRmB%+mf4Ap_^jP(qC9%ETsk~CimWM3Rub9kB zHc#GZ-c0u(`T#yZ(kv3s&a;9o=NluFoU0rS-(G_r_3PJ4o0NMO3(cnbqRx{vlj_=! z*@o7Tmrs-wW&k3F&2!dl zwmMuQG949igl7eE2tSr6xYcfASrt_bG04hea0n`S2h<+CjCHE7hI5tFv|BEhB|SAg zAK|`_6{ffLOUU7S7@N$JVEfr)DhXD}?4XQet9$c5#oao`OYv8Yb(Yj)NcDYLt?Xfn zO_+>A78X)C+9h6N?xnctT&Kdvicc3=*hIc{wc`k#S&BwU8QRT)K;y60uKY&6mtK=z zlH}=0>auUn>9rpyhb`+q)X`s>|5L#-w*^Rif9cyVua#iq`Qw{{T|d z7V6^nNhx-hbHN;!Z7e_-6>tUsdSpAdaUw83Me6!#ab(cG`8s z%8eS13IpdL=V1Wn71cUWoi!VJ_1C}NZ40#|&!PNL<0~x}!+#IfD+HE#7Ul$=5(JQx zkxIJAyeR$lLE1(ep2T9_d^n2k!s6sx>66WE3#^t>-0hiJgFh0m%ZS2)8G*)eoMRl` zuklM$(*6%=15bFYZce#$tt{5-A$W=@D;%tuQUU{nU~t3Iy!+wL#0jspTbuT}{{Tpe zV=`Sx#(5$Pc8o`XyBX&^^O4gBmk~lyldTQiucrH1dT;u5znxWCw0dTV;cY8aw6VRK z2&28zc-L^oiHvo(ng8P-1aR884KGo<8@S{fYewqEJG!GQk!y#cOe4%$X_4zVY zLVVc=zdVyw{6Bpki8aejAI8_R#Rc$j=2^bk71l&N_Rhuot^mO3PHUC%kHp^**!a6p z(=F!It^6%zC>HTF5`O7Qjexm0R*)$GgX@4dV!3{;DMy;_&iZzJ*JanL@-mc~ii~zU zVXA0tHLaz?iw!c~&RF70WLX5#ZCsF?fZ1KVe8d5qS3Py(DLe%Zx#BCkAMHDPiK2m_ zdq%eM+!m0#HV)yGQJy(&xjC;i@b$#nwyr+dCA!h#BH~3YIJe|R}V}=}L9P!BY_YV*JQ`5ZFY1ZQU);05I zNMV3CmI*7sm*i~m$6roHK6UZ6ot3|cZsMBTZPZt78i+ZJg^|I*z#|wK$Qc>qis_!fZoOD|y)%=x+=1zMai=}v&Uf#;dX#nkyhl8TA;fs^)Wc>e%^8q&r_J5_y35j};(EIwHyD1L-s*F!Qt74;N18b+-j3R(c% z_QZ&PrD*tT#aeV)V%uLqaFIfH`H-L?$J0Dk9-`@M4yK5}s8?L)t`GkJTC;66XkfM4 z!*PFRe8EPh)4)3#sP{y5fTXi{j?TfI!k zG66CYEA$WG&y5>O_#5!;VbgB)OS_#82TOZ2UW*#;C76XBM^nvwDf?1bLw)0~6D`E; zYaBY|#@&(cELbV&k&Y|wf7yLvpW$DGgmRmhtn@p3c&237SQ7a=a&eHU-o1Pqe%1M; zdl<(Tlu&)7{{U0X{{U&dV)x0ILA{$|_V}tW|Zk_XAc7MS_G+km34e4`fu}Ew*YpL3KVaRCVx>eX1 zkKo>ut~!0+YW(-NmPx+Q?h3B(s!xBHB-S{Y%9Var?w^0_x%-EQc}@xCiy2ZXbEw^u zN%HdF@p?UV+vo273HZSUjm^|omhfEY;?Yam&jP$m++|9fj1oYqzZW%46T((HeeR2< zeUrnw)Nbqt(R5Ss6GOM~EzOJS zdX24;Y8G&V^M*pvx&hSujB*DjX!N3|v&6+xsk7VhJq|j_DA&MC6-EhFg1!8byZjFh zkzZWC8mdOd>g`r|*BDr3Dt7`v=v`TJ^yF97zYVl4HV+I(soO*%yt^5id=1RqSxNK< zKb3inpTn8_ES_DZtfnht z-m~<*S5}`){>n{4;>O<6AwWUK{s8OG&{xOeXjGJ4^iO?X&ELQEeFc8( z^?9#aPX_6?4S=)U+^_;qF}Rhm80{J39fw1}uXwuGEOgy3z}EVVa(NfJY!`PIa+F(j zSmj``kVx|sfZ2?k9FBWe&6-pfnty_p&4l|h&H-Sj_>i{k-1`jm_o+qC2^9z0&wuMfuBMS)%Kj*Z z-t$S+^=}Q_$8S1Mwsc6tTm6`ojZ_Wf1tqbN2>D1H99M{VlJY$dQEUArA-|2Hh`cuJ zB#D%q7>sB(>=+zi6<`lq^__pjxt?r^C?1eAydywAWr$*=A6zSEO!3`K0hV90SF9 zr@{}}%Krf3WF9N9gHy4!)bu-#CU5N-9wtr7-zumX&gF5=1_nD~zL4;hm5+vX?ORi_ z(^+jr$%$>JkQm{Ru`RHwt_CrVKZy6QAhPk)p9()}EmryMnCU(#NE%2)pLS^p+Q8$p zETfzuE!u1n%g%UEks-Pp+^>6%>Hc!Wg|MMgyd?9;0=-uE;l7_AiEn&G z1d^NkmL!?jI0MUQ!si2k8Mv+k;&zJm9}fIaA{gg!3A!M!-15~29P|FKKZ&neZdT-5 zBB{fbHqMLU&X3`pYv6NhTAkge_SJ^iME6pN%rUcoPCY;`f$#LMg(He9IbPB!*6&k+ z_cp`wu{*a8ago9NmcEAlp|#74zX4k4*5E}Zp(0BxQMhRw01k22Y4z?v9<|^}ZKr8I zD>pi(oh8Fv#DX~5L`{Iz>&MQHv^i_N$B@Rva*%Y&C7Ky)RDwyWJDyLtAeLH zvU`r)`&ZFF0k19f880VUECRw^bnHG?ndG27huZo%F` z8wD}5F#rzZzoEzBS$f&A#BkhQL>@p}V#o^|3}+wk5@@jStk0*cR+}#w%RFjeG7>>J z=RI+e^{o4^3!AG;bAJj*VU|RVL}5xE;~jl^*3PVFCm71lZ!#>oT4AM1_Hx^;mEv4T z6nxOi3C`>QK{@mp#d>FmE-kdL3TRh)baAEq?c@S~vmj}A1j822d*E&K&TEhOap12H z-D-ySS3?c8oNoSPD~1QC>FzU%>UO5L$f-=j=;4lZSMk|}PwjMC>?S;mvb0k_^jPNDP9qnr} zwnpK`QG<_9x=--)ui;+~w4NT+bUVP(-Nyu%7AhNtc$~bd54=ku#~(7NHO#0eOPOfz zt-76Yk1g5O_~KQM_IOL0HH6IVpXRT{e>1{TRAb>1P(V63xS)=nt4+OfYJ&T&~UkU5_ zuZQ(H9@_6O?+GH`H47-xbH89eif>#r8#xpzmOIP=}7wa;Dna@voLwEqC# z%`6Da(jz|bLty>W)DAm#J*(e*H{fe88~AP+ZM68-YbXS_7qc@Yk0eYL*c=vO%%OK4 zz~>xSgM2H!O+Umj*ui%j!KlW+XOJ-fNysZA^;hejgMp0KzkE6IWd0bn@nya({H-nI z3e&mAmf$g+esa_FN8SV zv~t*N?!o8iYs&mjr$M6XHX3|a0`4S;LJ;HQ7*Y1FE>DIl+MYg-~#pUma zd{3oL1mU8zvX69SA}zGZyPO;@-gBIe*snYI&)}UZE1fF-(@)jxgfJ$XaMI5l(IJl^ z)GDYuzV;NAJq|mcJ=3L6TicrUU)JA&jY-CoUpdO%cv|E88vg)SwbT|%FPc2v6C=u2 zLPD!5k)8t`#Yx8i_PgNgy=zmv(xgz9@~gFxl4y%GEK_oq`FKWBK>q-A`_gO6M!h4!x?Q%T@eysWG~sV<;T+o7Tr)bz zBOYGYW0Ri8B!xWJlZ$@J5>k&gk6)K>>tmjAlwJFs4YlldYvx4C==tS&2Cn#QNe_su zWC+I+u00RUSrKTcwpR9*ut#V<^0X<8_Qw@xP`=f)RkE{&1Zkv|Q7+IHROhK3bNW}( z-rBR?<#TE=KS!fgJatze09n8bhvX8WD16T#ERtXUZrO~n=k zayaEjBl8ujt3~ItK*|h5sXtN0d_6~LxSvf+;ZiQoCQ>vfCwBfTO-|*Fv(-jxn2KQ? z%qYxWGqy0<=zS}wi{`dWc10C1c1%?j+AOR7@PX8ztX~8$Zxr~|`O06z2jDF2&+~Kn z*2E`t$&S4ZdE4u^Iv;>ODENxW%vW~T*Vhp~6r8~lMlufv{ZD??(@R^Nb+ocSKYwV5 z5BxMgj`DVo?FRn<&_!iwQamXfnc7MY2h*)b@qfgJ#J?AOL8;7vC%u^_c;n?mnAETy z+09zAwl@~>mB9Vdk?qBM>)~FA<4d_J-pHtaQ=P{g{cF&E3*9x%{{W4mIoNzFfB4|U zf2Db)%yUD(g(KA0Y49^r`xl6OP4=QAx0AzKl02JF$~>?^{J{LpI&RZLn)g}tfBX~f zNSjIVnn#g~$O#Ai!_VnoT()z#EcPaw8vkhw*y~nTEs)1_mp#`WPRG`p%XkpINt# zL%BuC3g?ak6a0y;4&KvHis@yR+TvSaa;~u!73%u@QN`l_01!s%Fs-O4IL%^i40!Ux~*f8l$8 z4%?e^pJN=$UhNcvdH{auuQe`N$$5meS3fkrYRgN9_>bcV(OyOx>o^^Pm?J;VzT5qc zmPYs!pc!%PTmERt)jMQ4yksu`VQUCn@V*No$BdU!ddh_{jLVxuRLQu3SpnXmhJ#%;a<_?G1} z`|D)4Y!0McLn7ztvHt+?s{E*FH(J3v1>23GPq!b^zfwPIzZB@6FZfmBKM(1*@%Wl; zR^1ZT*GQEvWVN}C!-r);NJ5~3-H87HYQG))W#!mvPZ*rK1xW)bARK{__2(ajbYm&| zd8ntc?r@J1E*XtV@}}%up3pWgH#{eD$v*A4-1CG~+8beQo9HeFkO6l{09{H0W|Z zNk`(p#bn;gTP~;5J{v}8;i?xZt7Y{!m;411tg3x0Bt$kW;V_{` zLyyEB#})Np(fmCZ+GMryjrN^=EGrZAH_ZP41)=iZzwn>p9i`l=o*%r8S(h?KHv$enyPOe|p4?U@x1{R+8?{@FP6G@? z?PHvCoMWF%b6;R<9}GNQ;++JokBHKADyk*Xby)(+ql5AuIqQwp=6C-934BN4({UE4 zmnP0@kp67okQG}yw_xpK?cTeqW)&e#Nk#hZzXO}AfF zak*D%7|&8Wk4#hK_{+1uqBM4qD z=gZpmt*bPbmbaGoixiSZ{$!T>iXr*1fDb|UxvWiY8*Ng?QxBPMEwdYaw+fMlW*d`s zdauaCJYy@Bn_B+9!SCIjl=6(EYg-LKI>mU@;up6x4jqgJe%R%G2VC*&ehRTqt&HX zNaV>MB6E@I4o6-wUX}4n$J(!gJU#HCwCl+%%=QzOl^O7@9O0L8s}18Pp$Cu%=NR%& zgiwt)!grr(xkp$vXUv7cRvtunSd}}mg!a6pi6t*y3SzlV2;g@1=wq`|8 zRa>t)1&^mrmG<|7bop+)6{6{~Dy6IG5Ig05Zc#`KGH`MS{{RB7sQx3Nw7k8R*6sG{Y$KTt(g2NP#s)Y!_0LY#;hz=s*KY&gPruG>K1lTy z%5(dt-bWs*xPCRPV+cj^Ee+)s(cIbH>AL2MvfCx-iuT;e8;J?ZI)bDScs%i3J?5Kj zsQ43Eg2>$6TF(XKX*~|G8^24u|bDn>8 z=te83@b-%KT0-ff;ysy_w@8Pb?96%}S0H^VsyH?9mjx?c=bY)D7QEEH7Ph~p_;mP( zU%Jua7FYAPn6|P%l!a9YDi|*9x$a5oMR~2K!UWa6B3fwE#MgStMAwoyoCFdzws3Lt zU^0V&*F1Vx*B`QER}J7F3)@e2-`Ug0sMybL6LJ@Yq7jqtlz&b$k6Ow2z3^{F@a>MN z;xwMd(&2v88SZ*WivoxhS0gT3J=x^^%sO#hP~}N8k*Qs!)Z+XZ`#9Wqzv1tTCSj0-ef8$2&%O8LtWWN1~fw2;OR`wjnjpwEHt5R#K6pyAyyg zT0%WWK9%&gi{O6@Tlh-a<6C6!N7~G}1*O)=!+nqbY zwpUFNwA1byL1|=g0>Iuy8+zsI*`Ld*rdE_>D$mfGpd?6p5 zr^OghOFN7)z&|nKu16`md!!*tG;DU@ecrr#1B&9EIJVnId}VtT^sPk02B!oH=G9^bCPp|2b9xYOIjkwlS5@@@h{8-g84=m$9GC%02xsTAnemuoKQ)Z4UM(BSN1 zGm+mJKZh0KzB0C&9~oUl<8qy{COWc}1mpA-3X*j%eU0h6#T|!)HCtIUyZtoA;>qrW zCER?FDd(UYGFNJ1gn@Jz;TSb8CBND?@RqTd_pM%|Syb z4*9R0KeFJ{EM%5+ebOn7Bejs+QYxsFL{3ZS-@a~5e*izym5^xI#GO17x zI4TYRUOIR{^AGaY1Pf<>kau+QlNDGC2z?5y(;xDi1$O(C}D&N5l>TL2qdzmy_)>3Hd z1dMxK& zTvm}U;+DbQym5I{N00a?bq zCs&%H_q!|K@YoWJ;Ntb%t%0$dv&7Asw`ITaV?BMDKUrUP2YR41oi~*N#cJ8 z8%t}AKGEW|@W!*IPGpYmX&yN4VwilpyA8QQt(C?( zd+Vz%9ITP4h2sDWg3Q4QKPgjKUlFf98u-grlU1|S?R5F0c*PUQKc#KJIQ_T*MBE&`dH$v8QD5JMQ!c^ zyl@Weo@;v68J6nY%45s6?Sms8oc(K^@Vu%#H(_tQ$jG~cPla|RiRqGZ2|2BuBgK}J zNNgp$ht6OM#F7ondth}Vk6QJj(e5TlBN*pq59UT|t<_u!rT4EW z_*1UE_N}YO9ByqOSna&Rxc%a;Pv}K@F0*pYmsZABzc|EKN~>K@v%}JEnq(Sr{{Tw? zn|i!}fsTU!WAhc&TihE<7?rtJRl|CA!LAodylF2XAmn+Br2Z!r)Zbi@WSGVRbDycM zI{2?;LCB{{^HDWhSB}zHnnD&fVx@@b>H61{_-|TmRO=QCBzlH~X4jVL$yYyVFDP_U zI+6pp$Jd_Kv#9F{Z+4cKPOS^9j-}fJ<->A&W7fRy;f<8{E#gVqIR%Uw?1D2Km}v)^ ze8wb^@`h4}8Rbdo(_B6#tm(zYbyxoYKj|E}nkp?{sqv4-jVbicj6NW?iJ@qc3cZJ?v8(zxAK6ynz+vSol|9Be6=U|0x{e=>UL=M~bW5RoD;c6_i|`Vsja zxvpOI>O%@n4sE35 z`{t^fT+*NfqJypq3XARkZOSJrOkcG!mz{{Rzu`wIBq_8qvAZxZ;l zGX;;xx6aeo=6;p-9QP{`i~)hu7287>2vfUfomvmtG+W*xKn6N+DpSh()=;|K%gDDh>jx9sDfJ;TXx_Gq)*+t|itl_6Q=JN&WpV1;gd zjcEK8*EIhC7~5<5&xf^pyWKYW{FlA^9Ll!)q%Y;}eliq*KsfJ@UxLKf$446_O)q4> z7k8!lbUvDn8w)%nr8(NCMc;4uC(fU>rt6Q4K01&tZIa^FV&*)nf1<{t1oi2UYVmIv zz0RHB-2&mrkL?jWkf>k=-!<2P+m!ELe*9(leWS%}*4l_|M$b@;2e{j^L?ajtkHa61 zYv*5!-vO?CL!kJ7Pw>#Ux`Rtu;FHXh1_7lmGuOMYuKXrr2UC|4xmsSU?=Ggfd~o!Y z+LiuRJgfF^)I9GO-i97z$4|QQVh4FITEx^1|)~zO|a!q_!bebSg*( zup++M{h$63c%R{qi`T?Dj+(a?_AnNWV37$dLjm`Sj=Ynf@UA2F;_%Fu+9sc`FNW^) z;BOt}yPJHQ#DE@OB|yj+0QKY3KD{h`H;IipYU*89%lyw0s+4F-5?!C%d~cwAqWa?6 z&fQvThj4*Ve9UX=4O2|IO$Nd*K56bP<5=VpF2)VCaknP0zh~cqZF6hjzlbr}+-hDQ z{@NO5v$6IYX$;B`s}6vqi~j%u9)wrv&9Cg)r0Q2Mb1`WmEW#bZ2~^Gi$zFPLPI7D1 z#Y&vur+XzUZGBgf=g^d+J-Qzb{13O(bnQb}yOoWMvuTqgF2JZV6uKCx_R8&4?`7JT(q96U-)k`({4UI_)=s3k>P8VjOQr< zRAblpgA5LRE6P4Ne0lKi+4Sq14-4N!{{U(qX!9=D_lP5q0CE_WCD$XS6na;ncdB|-R*y1YMChPM9aJU@VB{Rl`i{#bDyOmR2|A9N}weEi=^gT^`>IyI)dX$*5) z+1%WckX;YnDKX+UCpbK*&NKIc6~Xvo{##8`PP2AcE#~vLTeF{$iw?Q$*c|&;tp?l@ zML}8Foi?lC`Snd9AV-EF3NmNQCRY94+z>gy*f25&eos%fw7aWlJTm}=CG#anVqcf< z1VNttz$c$x_^+BYuODd9X#-E2MzFt>vLisTi6txnVoMSVnrrc|Cor&aW+PC)V`a zD~nkLwZ*;FvnJjPIwxL#yBqV{@vfU*@dVA{9fILxSwp;!v}88r| zCAZA(8rC+Ob`&Tqy9aJ~X8L3E66(c%hnoB})E7>@`xC%fwGAm^3jBFS%QtwiVo09GroRo#biyp{*p zSESiZ_9&7D+2!rVNWmttarTPWv86WYs~nGk{yDe99}TXBZ#pH+TBe}W#Ng!>t{A81 z&reFN;vbEco;%eb({)L#wHVZ&COO$0EP(LLypA~;BRrbo1#sU_W}#xgPM*8;mJ;U!;| zF?zj@Y1NG=x{pM)XVf~LrKV~&miE^cdVYeXe4Fdgk)yPGx-+7Tje{rDf!`VIJa6$s z!TvGOG`$czsDBx8g8WlzoY z?OgRVvO43lXG!oE#a7n-BJhMy6WcAM*3MC!G9X)=92^1;2R)D0xZfXmN?-U%uP3?G zmJL2TnPW3~1h8ddG8B$^7(F}Uw>&jxK9K~{M=TR+a6r<_l3$QZamQsO{afix_~&-E z9y7LEYdcGM^(`je=To*E#~kmuo2ffPC=ZUs&N0BHQtm0kZ|nSy8P4))9KZY|+ODMp zu~=P2s>ODO*v3*aUOZ*KMgWG%$RK5L*0Jn$_;g)LIFilvGj*8cmg#)CB5q>=22aWf zO!Uq>R!@jD`)fskEG05pgjQ{;T*g}`83Wt7?d)r?k#9A>57=KzqO(L($Tt&9w&GQd zmk$~0Mm8=EL0~#(o=;;2nwHGxsR+tSo9IE|KOU`(yQ#NZWxPj;BRR`__yw789D$MZ z0uDzN-|Dybx>`vcuA)ty*Od2GTel<)B8f)~cq+wv`}VF|!ha7mU1r`BZ>!%&be5z= zWe&q6vo=^l;E)Ny$=XR6IbJK!PlYtyekttkE_|JD5r>{=rHWZ53>8&_V>?wjKBwqw zlBcq#Q<^c?s}v(=p^f7|ic-g82A^>(_mDI%Izc4BT14&uW#IKVE4z+5*5;SvUkP68 zx=-3Pb<%#{XKyYcJEPo5+(?yhz_0`nw{8Xr&2Zj2u+!nTj=|@W#BT+%3$Xg+jP{}pM#$=LU0doaZ#-ikx&Sd;^v`a;sjn}G zP@7n~33Viqk^8^iG3Ot{>~W5@*XlkWeGTJK=^)<7+4)H%WDoQ0T{44KT-u)El6#}{ zx8TkETC94#%q)DVB~~De0_veyk8YLS>Q@FkV<97N-8uI^;hOMofu1N$E5Vara_uaV z2<=xUNr;RvRLJFy4<6aBuIJ-+i>MgPv0Yi%q#{`^CWx#m+sd*QAP~S1c>rMb;=eI? zO46$-TInH%94HyjC#8Jd zb@6+`ehu^PZ*}Np@~#WKsk%l@!z-Kvk%AB7>&1De?KAs84;cJ9x3JSMO{5Y{10)A4 zJ;FBQy@oQ2^7L#IxNvd^?2cVLU8y}2dz_VVQKfpFk8svLBWPNrmfD^D{h-qA%Lt-o zQrB;l;10?$*SS&eo_pc1j0KE{x3?eJtt_(59L+dnG8>DBK+1SIGXd&GYvq3jStZ7a zV9e&*a%am5PTrs&(?5-L(#d0|-7IT;8M|gl6)qIGVyBEL<2}bgk=DKHxkPAFY7*O2 zc&{JrEar@#+G^Dz@nrg}A?KFjcb?{Q`;3nu+!ya0-~qrG{O~bj(=Id}4#sU_+Dlcs zv^O@9NZ8-hWZ>ucPaGbGx?dUi>fX;-y13Ksp4NXRHghcG#XQP?k8mML!uP0t!;f{K+P1x>rs*V0%Yiak#-JUg(1j?(wgKcEjAsV9u$3_>LY+w2JL=xAeLF7w zt)`4Dug%cl^R zjP36x)jS0+heS+)uJn7S0i|a}2&(Mp7i%+<&;;Ot!R~)$T{}?lhsBBI)wKJIEi?Nv z{@y$1VdbzZvl%OmRdb%z@^8SO5O_o3UEZlb_T}V~PYOoR-dTA?RWtJf81Cvgz&$-{-QoDF;muc6 zu!Ff*`J zY4+rv`Tqd**Pr-z;wGD`c;8&pL07P`hSJb}%0(ov7UDWr4GJnqqpK5Y1-@V`=>JXYFPjiilh zRJfQ6*1z2GMqeSzO@gNcovFY$$7*li_!a6N4DjZ;rg&a$8%)!!ZFHqOQrk}=IAa6?00SGb!Ol4cpML|> zd|$m@D~aw*4#AsZsRNLDZN^3iHPdOo6*XNACx=Yb@2z8y?pVY~@u~H}L(k>fxqhLH zo%!PR-&AVrP>gLE>*@ah0Q5~i;J=EczYVWQbt^!HV~N|4#EyhN0~yC2l|8rY@2lyz z5=ml_5h8x@OLOgPo+q||dwtG;Z{vdH%I#=yK;wY8A z*QQ(EH}I@`<0uI@_3eS%>Dsy}WwoPw#lKdJ{H1^!tZx?n(K_dfd^4(PaA~ch8|X|wZMC~*mLPZ~bKe;qJJ)qAzNI#tA#HEE zIjUn+?xkVadaKM#N9{{XoF{eEf(4IDDBg?Xd$8l;)eK~5ig{a+?zVn&Yiro52OFdb+I>H6?OI6S6 z)D1UPEKl~s9F8$+ynd#>W1Hir#4C}$Iqg&ff(3$+oPAIE6%zb+_<$|sadm95M}X1` zBmfiBnr{nJt6$g1N~(J!={u_}Z_7BZP5qoT+h)5)xOTF+x6J7zUS!JT@?&Dk0ooUw zeeCtdYt(dqi~6ReZmD&t$r>!idDX4pX+%J>?HEjBAPkHgkIOdq#+sweAUfs6w9+v# zC~%|H0rKq!9eC^5SD7qrI&rjY@8z-8Rua|Jy}eHY@z3nj<4soL+S^Rg=eV?3j0vb* zOsZqSEDHuX1Nd{EI@Wr84~7pA!kYfMV`%o4QN$vJyve4OGnLA&)$hqX=N0eTo}sPH zbhc3I8m-#g;o5YYkPiU>9=Lx`x=nIEA@JUprE0g@y{)5NYKs2=W?R_Te$$*XoRf?L z?VO%Q4R`+lXwEdftgQ6YN2~Se=cdP-DDz9)TKS$|;?ILxifTXFx;^rX86HQwa*A7i z&@;avjB&vn;Qeb8;gp)+!Oc@s)KX}5ICUwYH!5(bn@gPV$3K4~ryy6jUuhb*hwgOk zwzFR8cOF~Z+D`Zj^5Z813^BV0(XqxU*WMHfuUcGK%?wtBm2J>le(Kz;M|O4rkjH<_ zPg?We6H0~o>8AQyO&{O-9$jhFh0<3%$Kxl8Z(`LhuKYf>?{gx8ZUTploCIu+;4YkF!vaP7LkwG_dB)Kv^Fn(c-k^%Y*de^B0(k8fqD{GM_%0w29;6=Zk<$AFj zmvNS%*lvp282a$7^sGDI}=CPRA@*w;PGtc*Z$36!@-%G@~d!t@&^F{{UK; z!n|c^HE#N&$vjcui7u9Vi%8yUS+rjvXWpz<;wctLj(OydG-nmi=vwOPS|q0C%tLlr zT^Pcol`EgRI+4@1F`jFCR2RB>-$5O`wsw~m>$M98SzF8>bdI>>aB?~x^}}83qr>+R z7q?*yTUa9@S5Cv!o|}2=n)*BjVM`XA;_RPG>a;s#<7DE@KOTG_vhfFx+gH>8)wGFb zNg61eW?$VP3fax;pu!FmzEkHn*@xJMJl+8-XqVK5+)a_;D98Jni9fdSbM+CbqWltao}Xv|7HadlFnV*1#bO<95-L z!h^Jvjz}Z5ea2Mf2+FIKlH2wBkCx5lDM~b{#YsE!U$;-a{sxbTH3)UxFUi(I*{!Oy zA~xG0W($Up7RsvUC3#sZ~ ztN51Ht#7ZI(L!!E*6MOH23O3^;sF@voMY0w&tC9acw*(DxxF*QNA9-`te7L_86K7B z;#HEAF8jB;{7xJlO44o>Vw8GYr}gMn(KV?x9}MP6OJBm$MJD0?z98pr4_v6@o}(U> zTH0lIxQX1R=!-5620$ba$C3EeKMu!f`$0Bas9(d$@yo`c5>OCvU(cK>Qsis+&s#yz^o+x7halDjYM@8YJ)bxvOOy4iq0;5Eaa^@kp5CGbG z@T@SSq4dpN@jdI@czWGqE|xa$9PHvSzH+i}I9|BSWMe&v^{#f^-^Ds^9`-A(N&==` zk>#ZuK-_r*umA#a&j;4MQ(4mD)I1-4be%%l)_V(xB8l#!Ckq@#DK>+_$>$v72a%Ip zua&=e>UMFk?}RUC{x8yQB~?{-aVVLG-DrjZUisUeM@q^4tb93lr~GB{CHmW!)5y1E zbRdOOZ3sZXayo!BfO0DX#8%CwMQ?DBODMUKcgbv+R3iZAlg1Qn$4s8M=hFTxTN~dS zYZ}ss{EbJ#`Z-mdcO;I>6ku(~%zx3OI3G3?k<*~w8AU;9Rtrwt9RG)W;mF)HPoTcxpMdh}!E%vnw0VYRe)8EHI8^z;Bo@ai7Bj z%$>0iw>97O^XfS0wAAS}>kkQd&L*;oTdfe@sJOD4CQz(KShM`Qh{)TLPt*ZkSde&g zPm@reMuoK9egtKT-s0*@grBG^tP~Y0*v>#4`(~fwPZ>qx-wv1l%eK@aEgif%g1bZH zC;%gW4mvP7Cm0#dMR{G%g|%HaZ?svlxQw$jPYuG!i~`IK8-s->CmE~4;F^PsI0;O*vF_OxsH~^lt;KkyjYuDS${t5JQ zaF)?OJA4`N)5q4da zTj?9^I(6-?Bpb^yXxL$P=K!ho1b45vBe>G+cPwHEH#v3@t^s0sCj+UZpIy=HW8XFG zFsVIBz|Xm?xhKx&8n$oH*Ph8?>*ykcZYK!>u!?52+ zX!_NmxsgkxO5l>CspGf5Oz~Zw(yM9vOIx*!CX~}$r|0G8>_PEnOKW?3RMXH#pqU!< zAYA&`y2dE*KZ)T@l@Uwy3x)SQXBmt zKm-7eAsEk3p*83hAF_V2;Ex2{XdV!}(X?GsQYG`ExtY+*xG~@IWQ+^|dt$zuo5c38 z-NhLU=;vuNZB^&CbHV0~Lsztg#n{PyFoO-a^ap}{tD+d1YLnGl^aY2UX03al7k|Sh zd_rI%pT_(2!=eZGs+P1Wx*we*wmU+Biqe`W+$dJh*=O;WLTKbwDdO3Wz zmdZWyAtrL0KyKjYp5y##(|Cp}co%4eU55~c!xr>W-n@TpPWIB@Kl3|dMo?N_{-@2i zKeA7XR?^nlJZoz-a5tG8AK8jkSl|)}Wh18^nKgBPWbIv}w-flT+F3)A#cYbM(~v@q z*#jLxJom42xbf5@%`rzM$hRx!`AUCw4^megS+v+~qqy;1+~x=K1IHT1Snk{jBr(YK7~_hu;t$y~ zP4RWhKCj|UcJbU`kGE`62W%<<`d6{(+NQBQw<&XH94ixGFu~qEMh#3gsf2}0O_9TF zA9voGuTGoNEAB-5Imuf80EyvRKkP~1jSRopW4dV^e9bM(F+5}2(zX-!Pw?fSKWDZD z-9Tn(-=4km&{wHTtX}=NM66A@Qhd{ZM;?_uvR&T7{$1FUA1>rmxej^3Cbo`cQ)svN z8OsWyuPc5hn%Vx$o*uW_Cba~NeBs}d?ekWGe$QG5%%TyFnG(NWOlG|U&Ax(1j!`A- zC3sXI9D4JH1bu22(QTGFRp63gD+iOzY?Iq0lb$`RM~|%blQUEyllXCbc*pKsrUew+n8g`;)vyxAEy@OtH<@F0Agp=7ZV2zx0((|hiM(HF6t^fY^8+}Y z9inK=Pmhxaa**9dMmu`qvU#>Dq-`m+e%c$yD#JooOK##f#l2=3EN=e*vQl_1Auskv zMOH}M<8uMZfq}iBj2S>Dlff;Kk=vmh*C(oK+LFf! zOGnieWn&e}OssAr8<|5ZFxppuaypMpX8TQZu3lS2EF4-SJ7kXHMo5P&Kx`-^k=Sv- z>EAC^7ur?jzMpFvTSpu!<=H|kB;YnecgL>d>Uvi^@e|kD$?M&fY&|PkC1UexH@6no z_S3;-rfL^^cfEw)Jf(0{0(e$986Xpe&w7W$8W)Ik{VsX0bkuD>{#gS#B3U!W5<)s; z=j8(<+cjQq5?a|>eVwk9T#0wF5blR^fziV8gUJ~r5!1CMz2dRr%h;lgg|rNd8hw)B zh^>N2PfO>$GJx>ZNSwu1dNh+sgB^*j&XTh6*<-?QD#% zBY}?lyKr7E@dlCNdBE`fjP}=J)-+gVIc5q5&DqG^hHh8!uKZOA(u#b^CGe%C+ur_P z)z2PNlZ%UIbK!3uU20k#jJL!**0_Rk9m~ohUAs(dq?|TKA280|^|^cEjT=#)OR+E| zwxc3R1gj)OLxkl^0uFF7>&PRasq#^*0!2;$ZK1dk7FW$12YWn0A+y+4ttJx@bQ#llBa8_FLvGg zdSAKQmg8jUT5#Cub)O07*ON&%n=P4;ODfND3{l1N6TJ%nqyh&cBRCixD{6}7VltzU zK5VI0UUSd^^sN@4x(1|<(Y4G|Gc!W*I-)iR$|xCPFb@Y9#~h0Jw;HmOrs+3lrM^!0 z`_+vl%U+}Bqse}$ewrqA1H$)OYD1_&V)9x`5m&e}t49eKV9b8@azQ*F!cg$Ojp&lH11?+O5>-5yiB)%E^^G)M3jX%Iz)}N)?2&JAG8SV=z=Q&i#$I3D@v>cxODgOWld{=8_;7u`P zyjkZqal&jOkIcC9K-d?{UP9r2u6e66S=ws)8Po54!y`n*Njj@D5JHf^f(CL2LsNKL zL%Z-Ml?C3LA|;K@!mZlM!MDe>jf4;}j&ake_Q&biPA0<9aKphh1!(I2_Wgf7&ml+J zQ+)mZ079>gJ}c@F!5yWZiygJy#k>6XP8rAmv1N@v;6p4|1RCPJQQ)0R#aAFs?6P@8 zru}EBR2t#ei=OZ`=7&s*M!Rd4_ z4~-&tZ03;_VT|uRA|!yjgME0&_2#&94lQxRLKs)9V{LVMFZgd$kuFV<^Ddv^DJ}dy z^2Q!NHZgLlIx^-${Ci{ctsfD5E7U;KVX(Gop_dmZP!dj60|vn3IAiI+=Do%%W$=!M zmTji3*tZf%9MeV%My5tM>Bww@?a#h;^hn@)dn>rvTJF_6xnNWBu1Vk?c*htgIj<&s zRf$${jnZ%a1^a)&I_cKDv`5be;S{zyRxC!3GAp?k(`!M>t9UjFzN57Tfr%oYe^0*h#_Q2%M2(v z833G+c*ak9r)%JQYb`EIGR$O++r) ze@O3)(v8{j*M+_tp9A>3MSSfeM4 zO@`b2KrDx^7<21h`Dfv=rRh==1KvY5ypyy`^E|Kem1brjF=M!A*XlEsW#Je+N26(% zH=0yp^3v|?M`skWu@2444tfGO?Ov8wow(4iD!VH_m)2I>)&Bs)jm^7BpD4lL z8|!PEx4N)syqM+tJ=`e9DWnciWk=uO6UGR^&T=cG@GrsbKgJ#{)XuG@PZjN~QMvu# zSY6L5O5;3@-SNOU;MdbyPlhyYC``9Dk;t!rT49+LfjJ=HV<6+cahl4s(H1NH)(t-R zrE_qxO2Jw*RvU*r5(wkJJXep1;-^(qr%5=wSxfr){pM1w?^&aW@K1p?9VbuKEOkk2 z#4dd4VV4XU-aHl|4p$(*Y~qgK5ZD?1Rk1#wb)sF{+Qn@(sFvBni2%d(JGT+f z&7R$J&pi3B8;DX>B~e}KlF=rX@A~R<#;m2PJon)TgLN%OPrI_#(#{KeD22VO7O|?w z8;M=ZsOWejuRTHTD{tY4?CIfzxU<%-?5DMDGtQCVnsem|V~#u$2+lXVa85o_JCRy` z7SOIdKjLedXL*~*hB=(GlB`(|%HEhN-FxP~gYdSm2a0?Intq`jwY#vI2`(a*HI<1f n2q5#2M_zM|mEVQVYf{I~aDMFdw?ypU{2TtGjcH0w`=9^W(lnJ7?z4+%xAsGk@+}PG2qpu9+AZ8vuYn008)B050bM zdH|X$SE#R0(NI%U)6&w=F|aW*(9<(;vanudH_NTmw)5K_CiB5ET_A<)7@xKl=bmW-1mz z*;`jwVRxy80@>uEGs|d%bsM|E*5d~v@~%NoY3bOnb8vEriro;GfG8*`DXXZe>D|^h zFf=kYv9Yy-+dCkTZtfnQUfw<^^n>7#(6I1`nAm4=@d=4ZS=l+cdHDs;3tyF2U@EJs zvA8!)%`L5M?fADJdwL0d{R4wT#0k>m)R*a**`?(b^6J|9#^%=H(ecUY*|+aM&i`=% z0ib`g{;dCo{SO!O9~T8BC5V#x9~Y1!^v?t_Q&I`aUSYWfqrMx+DkK+8!={^A*4Rxe zEN^`Pb`2V*V;50a5l8+P z&|Jd&xqhlewzE;Ptp$mALApmGS*is~KNEX0PtwOZelDm7JCBX)ZDlT*ZTz9Hc;(XhfPQY}(U+!{BFx+N8LaMk}uNC4xz=i^*sB-F(Wbp|-LBoXNLwfk&e@cgV~q zHXHeL_6omt;H1IT?>4S);)HnTMm2Nl0q5t$^?0=Z&V`<@Ilpz;#2)(;w9-sZLeNnw zSCYO+ypA%o9S!0W5$03@q?ImNBjzMr-K}x)Yg)gb;^fVpRtR^uY;f2Kdwi(*uL0+2 z5NV3^K|>SzqR@z(0ex+yawiN78B;L4XWh=ZAm)1hq zI#-{=d+^x%<)gi*E&;N}VlyA6`qDJ%l4e;VnSy&17f%Y?MvjiTCCIRrcTl3(_&phA znHf9I=xz&|Z{X3d-q+#si~VbcrFr_C)Z3d#T$Pv%v?gu}*&w8S6=})1JTJEtNbHz< zIJKBU=Bg?C9*(BdI(5ixzZMQC$}`?ls}^6T#-f54=!( z4DBh6PqH)_(aMF+3l-1Y6TaXj6NU$_GzObXLq7+^C~lCtx-Zl?ap~BVXoLmFwaBfz z#J8iSJ@Q3AyqVOvJ~fX&!UORxx@WxGBfYRQ%dZi<4iR?H;k>Mlo4?1@Q!4y=NOX-} zD8fiq8C`rCuX!+WUJv|!zy;Q)inEvXTf79&tbB;>|ld8HsMdPt*P|vX&wXG3-=Z$dm0B7#XEL} zSn$vLQSa{c)31drmLe+-3+AzlN%_0{cw6C&AV~Hex^hX{ud>4BtyjCEh6$4+zoJzf zS>X}$RLe+MqH|zYfbXlE+Tgyoc`*P8reh`MZ>>piufS&Z>zrRr5d|v(yIlfBr4e`@ zv+*{{SWcBKA0!dsmRW8-$}vcJ1l&ies&51>dzjd+a;00eYI1*+qFPI2hIDjw_t!m; zpfJ1;K5CHse!pf|wD+ubhK~H3v%%pvUnI2t#iLd&z8a@5aU*f=DfJEv_7b?T2r2kF z*-GcE9>2^YETI{OYrUz!=ibj>T*T-I5CIz;a8u{mfXwbKR}}iXJR>UA5XTm=Ih1 zvJ?|^Za0x9KwgBe_R`$vvZ9rIrwN@dk&}IzQ*ieH-C&c&oiXn#=d3eSz}+qa_Zy2y z6}t8WRuD6$i9J$r7^E)zfjeDCKAOU&J(1M?JBeG~L;osP;ttYE;BnUa)~ghQq@^y%=PHmQkCuuONSr z($pp3lr%oTEX*C$c~Nn?t`QM+inZ05QqB2&_<}qe4l2921Yq=K#eb?$sj$`EH?z$S z&BiN^OdY2VrE^E>MLo00Mc#mPt#2Bo-O+i6NP{eNu{sUxsjX0yzL0HeAyO$sR(N58 zr#>C)q*bts@SJTrb=>09f;Ip0Eju7RH7aDCL=&92?j;h7Z}@OA_kOf;R}~DhkS+cA z(lk+|WKTg`zSl0w@}MT4+C5x@)oGWo)FPvn*`dOp>en19-%Bv1wfnH@Wp}VeROhwu z!h2BR`H?3ticx)&7GAnvpL|K284iW`+4t=&H|Y5dpe5@^_fRW#1b!+=s=n}qz@dnx zV4qU9J(&c845TQ1YfwtM{}SM9X<8WWynKAKByJu+SwdmCs-UQ}$7l=!25pb~Hk=rTNHVeQrRfIH4TqzKZ z9rc<}U7#qrn>C?-`%Vcr)kuRp?PSyEkld;SZWWQjxiD#KrOf+xjJn7&e|5pXCVKh! zMPs_PPBGP}kPOGR{5AnwH+NFxGZp7hg&w$YMD~_6ytI$aFS)yKJ4hwoB&8NwvP4W$HC+KF62J5cF&?qk(2|Jd%qf#m-I&Wd~ zp$((PZjeE%WhYFTHt(8cmpqg_jQ+r{wo+DYv8w$svMH(9M*XgM-;t!b=OLaxU+)_? z|HCT&I$2miQC3m~c+72V^T$cm?BDM?y`2qCwIzht{yM1pt2ysY=JNtPCsmq} zVy$bNfj_f^)W}?NO>zcq{9^P1qJD0D32@;oXABfJ_`WCuJFUFUf&i};-KV}GLY{0P zk(G8Z0Sj!O3m4KbG@k}hHjZIZEVA-VBgNN%F=J@hFdtoWfv50G1+9r;cl^47%iiEx z*$^40(W=|S@HoKbNvKo_sf$n{8BvHX%{VsWVYU%_APN>8s#TdPeKyaC^d5U45>?vQ zWbQl;G&gaK{#bFFbua7^z=exqPE*ntbofHr({f9DXfIJ?#_-wEi&OpY^C;vjzQ|Zm zWXVvZ)MRDf{rYwDkoq7?ev8TZ%$0TUyEHJ&arj8xmwk?6@qo&KWlz%=Wb*#_zV3P^ z5;nZ=L>!;~t_qbmckffhis8eSrP$s(y4CxNIc9ZAxqszOuAFsudEb{KGa9Imx)mVv zb!mDlKD(sZ7G!C$SO{&}W|&%IZ24kVxG;gSCZwa*rY1>bc=7YF?XY&N*r((UhYj#r zN9nLt2;GL{#Lj>^SO2)5uzgQ-;dDoPYCv~;!{cX2zfw6*bM?GYaxqX5ezqCQh{tuH zuGNN9dN%IMAQyB0>Tqf=x-G~pH7dwHl=kNWHGRv77#eWSt_V{ce%0FCsTKe8CiGhY zA7BHzzHM5gIge4b3v5k4P&(a|Djbal`Z)rq_T(=CQ}sT#sD-Ms3^IrD!+e$H;2sI* zQZsDOjFO2!s7pSm zvJS8wlzKgctWnvAemkeby!yOnH>s`q~%EOR7uU)(>I+(3(rYTeYd?qsONO zM+@}yP zoYgL7l{=HXzP*`S%HuuvdOud>Y4@VYw-fZyw&uw7Z1p`t06nwS&L@<+#qQTCBicZM z{!Ze%guI!MH1RqaDML>FVz9Ds!Sdsg_c^Oi=t}azn|uY6R7|(Jt2*DP?Meq4h!fOX zUb$EmSEM#&=`(+oIkdyOGR49*4mqZYe+M~F^_^BUnzmEZ3wAkus|XvhFuw3rHZ@?S zkI8B*ivG2>1FcGBIU5@Z(a#MFES7j9O8Zux#~AE@=0IR$Yr+IpM$rnDuL}1 zFs%2(UIwc9{^9fbIceZdSWUpdt+^*d3kd^Qe#PP>!OW;3R~fX)mu*UrT7>Rp+ir^cV@1lQ=6Ff8^~-(ij152i9nqTP z*9IhQ8(a6Rav#;|!Fe6tZ9C9lU1H9{OdV$EP+wT0J7ae&2(rch*C(uQN5DI<0i?T7 z#bzX@_+`pUoiAGu3A?v-qPM4^=TSbZpr+sc(=`37*+MGXUinLCl6%RY2D|9A4zatt zH#8vdQ-gl&hU95}ctBQGrntkz6Dm7J@Eg*PQ{Rj^<@4K7Fz3^^Aiq+R# z%JHlvCE5Slj`XfiX6hA6LPD!g{Mef50ytlKBtvQU*RORwOFY|jHu{bZ)JzD!#x7i4 zcL|6OL?+y#&EGTHzmsG{|B)O4ucwtV`>{7x5Nxh)b8s;R;$#t;St-LoYn^Y0PxmYY zUes(vv4%bVV%wNKlE9}4?Fx1V?*?zgIA5 zb_sxV3PV)?d@H!S#%Cq%vju#N$R(5GzP~}OB->FJ`0P4==y#r<=a0c)@!-T=mt*%j zu1i4pDknjq1of$^YQe|e+&`S&P+%v5dFyJRZBxJE(D+_ovu6Xl&HMD!m2~8ormyuu zx(qe8wsjk+d#2IpYJ&Mp^pRksj7EwCwhF3LNJ^yiPN41FZpb3A!uL!{VYjH_0Ov5q z&h(q=7Lx*vCu}>WnVsz*F`N_XW>1FQU%bHe!cQHfS+fd+?PkeZ)9^ZWu#Qc=h$HFZ z_fCk+`|1hRWBC}n;*iz+G8{R^+E4)G`vA9U>Xv>#n!_t;UqMx4PG97JDu5|YY5qe< zhm_co)B^$X#f}O%H|$u77JHCiU;k(`fqL~0)y)sXNuOAcOOdaMy9szrD)dpo^jOJX ze`{-Q)Y7M#y@>Cx15fNAoKm*DU!qOnA%Hq_78*}dneqF*2)Ij~Id`!IFl7~2ekkO* zla40dld9b*KXTJCA!k4cq%}z@PDQ>P%spXBx1`7=dd~YF>&qLVuDLrqXKCe6^#k)t z=zNP|`_6;&QFNPb?LY1Mb4I_mEk)neVQ-4{-3lTT$W+gZi*Rn&Y}U7`8>WcIb{SI2+lxgCIV z#LoI!)vCcwAY=rGm#PNLCYN(l{{fmkq>*7_=!y3${CEIYB-E`ZwawbFOVpALhSXcu z#WwD-qnWG9-HPC1*y_<^@h)ERS4kad6dUIerZPoGvTmcn^q=X(YvMmT^;@&*v&mU8 zq3!lU{nLGOImt{XFcU{6^}L7Hvdc;0r5}6SG%Q!>R(h4(G$KpSzZ92TSAaRC2c0u+ z6O0+(4vG(M1?sbX?ej-hc77IUAzo~d{pC5O(%w&w&^okE47^IRnxy0%5KBd8$l7_o zYD?>u4IEW9RDjv))Zz>w5L1qF- +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "unity.h" +#include +#include "esp_log.h" + +#include "esp_camera.h" + +#ifdef CONFIG_IDF_TARGET_ESP32 +#define BOARD_WROVER_KIT 1 +#elif defined CONFIG_IDF_TARGET_ESP32S2 +#define BOARD_CAMERA_MODEL_ESP32S2 1 +#elif defined CONFIG_IDF_TARGET_ESP32S3 +#define BOARD_CAMERA_MODEL_ESP32_S3_EYE 1 +#endif + +// WROVER-KIT PIN Map +#if BOARD_WROVER_KIT + +#define PWDN_GPIO_NUM -1 //power down is not used +#define RESET_GPIO_NUM -1 //software reset will be performed +#define XCLK_GPIO_NUM 21 +#define SIOD_GPIO_NUM 26 +#define SIOC_GPIO_NUM 27 + +#define Y9_GPIO_NUM 35 +#define Y8_GPIO_NUM 34 +#define Y7_GPIO_NUM 39 +#define Y6_GPIO_NUM 36 +#define Y5_GPIO_NUM 19 +#define Y4_GPIO_NUM 18 +#define Y3_GPIO_NUM 5 +#define Y2_GPIO_NUM 4 +#define VSYNC_GPIO_NUM 25 +#define HREF_GPIO_NUM 23 +#define PCLK_GPIO_NUM 22 + +// ESP32Cam (AiThinker) PIN Map +#elif BOARD_ESP32CAM_AITHINKER + +#define PWDN_GPIO_NUM 32 +#define RESET_GPIO_NUM -1 //software reset will be performed +#define XCLK_GPIO_NUM 0 +#define SIOD_GPIO_NUM 26 +#define SIOC_GPIO_NUM 27 + +#define Y9_GPIO_NUM 35 +#define Y8_GPIO_NUM 34 +#define Y7_GPIO_NUM 39 +#define Y6_GPIO_NUM 36 +#define Y5_GPIO_NUM 21 +#define Y4_GPIO_NUM 19 +#define Y3_GPIO_NUM 18 +#define Y2_GPIO_NUM 5 +#define VSYNC_GPIO_NUM 25 +#define HREF_GPIO_NUM 23 +#define PCLK_GPIO_NUM 22 + +#elif BOARD_CAMERA_MODEL_ESP32S2 + +#define PWDN_GPIO_NUM -1 +#define RESET_GPIO_NUM -1 + +#define VSYNC_GPIO_NUM 21 +#define HREF_GPIO_NUM 38 +#define PCLK_GPIO_NUM 11 +#define XCLK_GPIO_NUM 40 + +#define SIOD_GPIO_NUM 17 +#define SIOC_GPIO_NUM 18 + +#define Y9_GPIO_NUM 39 +#define Y8_GPIO_NUM 41 +#define Y7_GPIO_NUM 42 +#define Y6_GPIO_NUM 12 +#define Y5_GPIO_NUM 3 +#define Y4_GPIO_NUM 14 +#define Y3_GPIO_NUM 37 +#define Y2_GPIO_NUM 13 + +#elif BOARD_CAMERA_MODEL_ESP32_S3_EYE + +#define PWDN_GPIO_NUM 43 +#define RESET_GPIO_NUM 44 + +#define VSYNC_GPIO_NUM 6 +#define HREF_GPIO_NUM 7 +#define PCLK_GPIO_NUM 13 +#define XCLK_GPIO_NUM 15 + +#define SIOD_GPIO_NUM 4 +#define SIOC_GPIO_NUM 5 + +#define Y9_GPIO_NUM 16 +#define Y8_GPIO_NUM 17 +#define Y7_GPIO_NUM 18 +#define Y6_GPIO_NUM 12 +#define Y5_GPIO_NUM 11 +#define Y4_GPIO_NUM 10 +#define Y3_GPIO_NUM 9 +#define Y2_GPIO_NUM 8 + +#endif + +static const char *TAG = "test camera"; + +typedef void (*decode_func_t)(uint8_t *jpegbuffer, uint32_t size, uint8_t *outbuffer); + +static esp_err_t init_camera(uint32_t xclk_freq_hz, pixformat_t pixel_format, framesize_t frame_size, uint8_t fb_count) +{ + framesize_t size_bak = frame_size; + if (PIXFORMAT_JPEG == pixel_format && FRAMESIZE_SVGA > frame_size) { + frame_size = FRAMESIZE_HD; + } + camera_config_t camera_config = { + .pin_pwdn = PWDN_GPIO_NUM, + .pin_reset = RESET_GPIO_NUM, + .pin_xclk = XCLK_GPIO_NUM, + .pin_sscb_sda = SIOD_GPIO_NUM, + .pin_sscb_scl = SIOC_GPIO_NUM, + + .pin_d7 = Y9_GPIO_NUM, + .pin_d6 = Y8_GPIO_NUM, + .pin_d5 = Y7_GPIO_NUM, + .pin_d4 = Y6_GPIO_NUM, + .pin_d3 = Y5_GPIO_NUM, + .pin_d2 = Y4_GPIO_NUM, + .pin_d1 = Y3_GPIO_NUM, + .pin_d0 = Y2_GPIO_NUM, + .pin_vsync = VSYNC_GPIO_NUM, + .pin_href = HREF_GPIO_NUM, + .pin_pclk = PCLK_GPIO_NUM, + + //EXPERIMENTAL: Set to 16MHz on ESP32-S2 or ESP32-S3 to enable EDMA mode + .xclk_freq_hz = xclk_freq_hz, + .ledc_timer = LEDC_TIMER_0, + .ledc_channel = LEDC_CHANNEL_0, + + .pixel_format = pixel_format, //YUV422,GRAYSCALE,RGB565,JPEG + .frame_size = frame_size, //QQVGA-UXGA Do not use sizes above QVGA when not JPEG + + .jpeg_quality = 12, //0-63 lower number means higher quality + .fb_count = fb_count, //if more than one, i2s runs in continuous mode. Use only with JPEG + .grab_mode = CAMERA_GRAB_WHEN_EMPTY + }; + + //initialize the camera + esp_err_t ret = esp_camera_init(&camera_config); + + if (ESP_OK == ret && PIXFORMAT_JPEG == pixel_format && FRAMESIZE_SVGA > size_bak) { + sensor_t *s = esp_camera_sensor_get(); + s->set_framesize(s, size_bak); + } + + return ret; +} + +static bool camera_test_fps(uint16_t times, float *fps, uint32_t *size) +{ + *fps = 0.0f; + *size = 0; + uint32_t s = 0; + uint32_t num = 0; + uint64_t total_time = esp_timer_get_time(); + for (size_t i = 0; i < times; i++) { + camera_fb_t *pic = esp_camera_fb_get(); + if (NULL == pic) { + ESP_LOGW(TAG, "fb get failed"); + return 0; + } else { + s += pic->len; + num++; + } + esp_camera_fb_return(pic); + } + total_time = esp_timer_get_time() - total_time; + if (num) { + *fps = num * 1000000.0f / total_time ; + *size = s / num; + } + return 1; +} + +static const char *get_cam_format_name(pixformat_t pixel_format) +{ + switch (pixel_format) { + case PIXFORMAT_JPEG: return "JPEG"; + case PIXFORMAT_RGB565: return "RGB565"; + case PIXFORMAT_RGB888: return "RGB888"; + case PIXFORMAT_YUV422: return "YUV422"; + default: + break; + } + return "UNKNOW"; +} + +static void printf_img_base64(const camera_fb_t *pic) +{ + uint8_t *outbuffer = NULL; + size_t outsize = 0; + if (PIXFORMAT_JPEG != pic->format) { + fmt2jpg(pic->buf, pic->width * pic->height * 2, pic->width, pic->height, pic->format, 50, &outbuffer, &outsize); + } else { + outbuffer = pic->buf; + outsize = pic->len; + } + + uint8_t *base64_buf = calloc(1, outsize * 4); + if (NULL != base64_buf) { + size_t out_len = 0; + mbedtls_base64_encode(base64_buf, outsize * 4, &out_len, outbuffer, outsize); + printf("%s\n", base64_buf); + free(base64_buf); + if (PIXFORMAT_JPEG != pic->format) { + free(outbuffer); + } + } else { + ESP_LOGE(TAG, "malloc for base64 buffer failed"); + } +} + +static void camera_performance_test(uint32_t xclk_freq, uint32_t pic_num) +{ + esp_err_t ret = ESP_OK; + //detect sensor information + TEST_ESP_OK(init_camera(20000000, PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2)); + sensor_t *s = esp_camera_sensor_get(); + camera_sensor_info_t *info = esp_camera_sensor_get_info(&s->id); + TEST_ASSERT_NOT_NULL(info); + TEST_ESP_OK(esp_camera_deinit()); + vTaskDelay(500 / portTICK_RATE_MS); + framesize_t max_size = info->max_size; + pixformat_t all_format[] = {PIXFORMAT_JPEG, PIXFORMAT_RGB565, PIXFORMAT_YUV422, }; + pixformat_t *format_s = &all_format[0]; + pixformat_t *format_e = &all_format[2]; + if (false == info->support_jpeg) { + format_s++; // skip jpeg + } + + struct fps_result { + float fps[FRAMESIZE_INVALID]; + uint32_t size[FRAMESIZE_INVALID]; + }; + struct fps_result results[3] = {0}; + + for (; format_s <= format_e; format_s++) { + for (size_t i = 0; i <= max_size; i++) { + ESP_LOGI(TAG, "\n\n===> Testing format:%s resolution: %d x %d <===", get_cam_format_name(*format_s), resolution[i].width, resolution[i].height); + ret = init_camera(xclk_freq, *format_s, i, 2); + vTaskDelay(100 / portTICK_RATE_MS); + if (ESP_OK != ret) { + ESP_LOGW(TAG, "Testing init failed :-(, skip this item"); + vTaskDelay(500 / portTICK_RATE_MS); + continue; + } + camera_test_fps(pic_num, &results[format_s - all_format].fps[i], &results[format_s - all_format].size[i]); + TEST_ESP_OK(esp_camera_deinit()); + } + } + + printf("FPS Result\n"); + printf("resolution , JPEG fps, JPEG size, RGB565 fps, RGB565 size, YUV422 fps, YUV422 size \n"); + for (size_t i = 0; i <= max_size; i++) { + printf("%4d x %4d , %5.2f, %6d, %5.2f, %7d, %5.2f, %7d \n", + resolution[i].width, resolution[i].height, + results[0].fps[i], results[0].size[i], + results[1].fps[i], results[1].size[i], + results[2].fps[i], results[2].size[i]); + } + printf("----------------------------------------------------------------------------------------\n"); +} + +TEST_CASE("Camera driver init, deinit test", "[camera]") +{ + uint64_t t1 = esp_timer_get_time(); + TEST_ESP_OK(init_camera(20000000, PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2)); + uint64_t t2 = esp_timer_get_time(); + ESP_LOGI(TAG, "Camera init time %llu ms", (t2 - t1) / 1000); + + TEST_ESP_OK(esp_camera_deinit()); +} + +TEST_CASE("Camera driver take RGB565 picture test", "[camera]") +{ + TEST_ESP_OK(init_camera(10000000, PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2)); + vTaskDelay(500 / portTICK_RATE_MS); + ESP_LOGI(TAG, "Taking picture..."); + camera_fb_t *pic = esp_camera_fb_get(); + if (pic) { + ESP_LOGI(TAG, "picture: %d x %d, size: %u", pic->width, pic->height, pic->len); + printf_img_base64(pic); + esp_camera_fb_return(pic); + } + + TEST_ESP_OK(esp_camera_deinit()); + TEST_ASSERT_NOT_NULL(pic); +} + +TEST_CASE("Camera driver take YUV422 picture test", "[camera]") +{ + TEST_ESP_OK(init_camera(10000000, PIXFORMAT_YUV422, FRAMESIZE_QVGA, 2)); + vTaskDelay(500 / portTICK_RATE_MS); + ESP_LOGI(TAG, "Taking picture..."); + camera_fb_t *pic = esp_camera_fb_get(); + if (pic) { + ESP_LOGI(TAG, "picture: %d x %d, size: %u", pic->width, pic->height, pic->len); + printf_img_base64(pic); + esp_camera_fb_return(pic); + } + + TEST_ESP_OK(esp_camera_deinit()); + TEST_ASSERT_NOT_NULL(pic); +} + +TEST_CASE("Camera driver take JPEG picture test", "[camera]") +{ + TEST_ESP_OK(init_camera(20000000, PIXFORMAT_JPEG, FRAMESIZE_QVGA, 2)); + vTaskDelay(500 / portTICK_RATE_MS); + ESP_LOGI(TAG, "Taking picture..."); + camera_fb_t *pic = esp_camera_fb_get(); + if (pic) { + ESP_LOGI(TAG, "picture: %d x %d, size: %u", pic->width, pic->height, pic->len); + printf_img_base64(pic); + esp_camera_fb_return(pic); + } + + TEST_ESP_OK(esp_camera_deinit()); + TEST_ASSERT_NOT_NULL(pic); +} + +TEST_CASE("Camera driver performance test", "[camera]") +{ + camera_performance_test(20 * 1000000, 16); +} + + +static void print_rgb565_img(uint8_t *img, int width, int height) +{ + uint16_t *p = (uint16_t *)img; + const char temp2char[17] = "@MNHQ&#UJ*x7^i;."; + for (size_t j = 0; j < height; j++) { + for (size_t i = 0; i < width; i++) { + uint32_t c = p[j * width + i]; + uint8_t r = c >> 11; + uint8_t g = (c >> 6) & 0x1f; + uint8_t b = c & 0x1f; + c = (r + g + b) / 3; + c >>= 1; + printf("%c", temp2char[15 - c]); + } + printf("\n"); + } +} + +static void print_rgb888_img(uint8_t *img, int width, int height) +{ + uint8_t *p = (uint8_t *)img; + const char temp2char[17] = "@MNHQ&#UJ*x7^i;."; + for (size_t j = 0; j < height; j++) { + for (size_t i = 0; i < width; i++) { + uint8_t *c = p + 3 * (j * width + i); + uint8_t r = *c++; + uint8_t g = *c++; + uint8_t b = *c; + uint32_t v = (r + g + b) / 3; + v >>= 4; + printf("%c", temp2char[15 - v]); + } + printf("\n"); + } +} + +static void tjpgd_decode_rgb565(uint8_t *mjpegbuffer, uint32_t size, uint8_t *outbuffer) +{ + jpg2rgb565(mjpegbuffer, size, outbuffer, JPG_SCALE_NONE); +} + +static void tjpgd_decode_rgb888(uint8_t *mjpegbuffer, uint32_t size, uint8_t *outbuffer) +{ + fmt2rgb888(mjpegbuffer, size, PIXFORMAT_JPEG, outbuffer); +} + +typedef enum { + DECODE_RGB565, + DECODE_RGB888, +} decode_type_t; + +static const decode_func_t g_decode_func[2][2] = { + {tjpgd_decode_rgb565,}, + {tjpgd_decode_rgb888,}, +}; + + +static float jpg_decode_test(uint8_t decoder_index, decode_type_t type, const uint8_t *jpg, uint32_t length, uint32_t img_w, uint32_t img_h, uint32_t times) +{ + uint8_t *jpg_buf = malloc(length); + if (NULL == jpg_buf) { + ESP_LOGE(TAG, "malloc for jpg buffer failed"); + return 0; + } + memcpy(jpg_buf, jpg, length); + + uint8_t *rgb_buf = heap_caps_malloc(img_w * img_h * 3, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); + if (NULL == rgb_buf) { + free(jpg_buf); + ESP_LOGE(TAG, "malloc for rgb buffer failed"); + return 0; + } + decode_func_t decode = g_decode_func[type][decoder_index]; + decode(jpg_buf, length, rgb_buf); + if (DECODE_RGB565 == type) { + ESP_LOGI(TAG, "jpeg decode to rgb565"); + print_rgb565_img(rgb_buf, img_w, img_h); + } else { + ESP_LOGI(TAG, "jpeg decode to rgb888"); + print_rgb888_img(rgb_buf, img_w, img_h); + } + + uint64_t t_decode[times]; + for (size_t i = 0; i < times; i++) { + uint64_t t1 = esp_timer_get_time(); + decode(jpg_buf, length, rgb_buf); + t_decode[i] = esp_timer_get_time() - t1; + } + + printf("resolution , t \n"); + uint64_t t_total = 0; + for (size_t i = 0; i < times; i++) { + t_total += t_decode[i]; + float t = t_decode[i] / 1000.0f; + printf("%4d x %4d , %5.2f ms \n", img_w, img_h, t); + } + + float fps = times / (t_total / 1000000.0f); + printf("Decode FPS Result\n"); + printf("resolution , fps \n"); + printf("%4d x %4d , %5.2f \n", img_w, img_h, fps); + + free(jpg_buf); + heap_caps_free(rgb_buf); + return fps; +} + +static void img_jpeg_decode_test(uint16_t pic_index, uint16_t lib_index) +{ + extern const uint8_t img1_start[] asm("_binary_testimg_jpeg_start"); + extern const uint8_t img1_end[] asm("_binary_testimg_jpeg_end"); + extern const uint8_t img2_start[] asm("_binary_test_inside_jpeg_start"); + extern const uint8_t img2_end[] asm("_binary_test_inside_jpeg_end"); + extern const uint8_t img3_start[] asm("_binary_test_outside_jpeg_start"); + extern const uint8_t img3_end[] asm("_binary_test_outside_jpeg_end"); + + struct img_t { + const uint8_t *buf; + uint32_t length; + uint16_t w, h; + }; + struct img_t imgs[3] = { + { + .buf = img1_start, + .length = img1_end - img1_start, + .w = 227, + .h = 149, + }, + { + .buf = img2_start, + .length = img2_end - img2_start, + .w = 320, + .h = 240, + }, + { + .buf = img3_start, + .length = img3_end - img3_start, + .w = 480, + .h = 320, + }, + }; + + ESP_LOGI(TAG, "pic_index:%d", pic_index); + ESP_LOGI(TAG, "lib_index:%d", lib_index); + jpg_decode_test(lib_index, DECODE_RGB565, imgs[pic_index].buf, imgs[pic_index].length, imgs[pic_index].w, imgs[pic_index].h, 16); +} + +TEST_CASE("Conversions image 227x149 jpeg decode test", "[camera]") +{ + img_jpeg_decode_test(0, 0); +} + +TEST_CASE("Conversions image 320x240 jpeg decode test", "[camera]") +{ + img_jpeg_decode_test(1, 0); +} + +TEST_CASE("Conversions image 480x320 jpeg decode test", "[camera]") +{ + img_jpeg_decode_test(2, 0); +} diff --git a/platformio_tasmota_env32.ini b/platformio_tasmota_env32.ini index bb8cc70d6..c52786497 100644 --- a/platformio_tasmota_env32.ini +++ b/platformio_tasmota_env32.ini @@ -56,7 +56,7 @@ build_flags = ${env:tasmota32_base.build_flags} -DFIRMWARE_TASMOTA32 extends = env:tasmota32_base board = esp32-cam build_flags = ${env:tasmota32_base.build_flags} -DFIRMWARE_WEBCAM -lib_extra_dirs = lib/libesp32 +lib_extra_dirs = lib/libesp32, lib/libesp32_div [env:tasmota32-odroidgo] extends = env:tasmota32_base diff --git a/tasmota/support_esp.ino b/tasmota/support_esp.ino index 81b6ee6f6..27a00e108 100644 --- a/tasmota/support_esp.ino +++ b/tasmota/support_esp.ino @@ -139,7 +139,6 @@ String GetDeviceHardware(void) { bool NvmLoad(const char *sNvsName, const char *sName, void *pSettings, unsigned nSettingsLen) { nvs_handle_t handle; -// noInterrupts(); esp_err_t result = nvs_open(sNvsName, NVS_READONLY, &handle); if (result != ESP_OK) { AddLog(LOG_LEVEL_DEBUG, PSTR("NVS: Error %d"), result); @@ -148,32 +147,33 @@ bool NvmLoad(const char *sNvsName, const char *sName, void *pSettings, unsigned size_t size = nSettingsLen; nvs_get_blob(handle, sName, pSettings, &size); nvs_close(handle); -// interrupts(); return true; } void NvmSave(const char *sNvsName, const char *sName, const void *pSettings, unsigned nSettingsLen) { +#ifdef USE_WEBCAM + WcInterrupt(0); // Stop stream if active to fix TG1WDT_SYS_RESET +#endif nvs_handle_t handle; -// noInterrupts(); esp_err_t result = nvs_open(sNvsName, NVS_READWRITE, &handle); if (result != ESP_OK) { AddLog(LOG_LEVEL_DEBUG, PSTR("NVS: Error %d"), result); - return; + } else { + nvs_set_blob(handle, sName, pSettings, nSettingsLen); + nvs_commit(handle); + nvs_close(handle); } - nvs_set_blob(handle, sName, pSettings, nSettingsLen); - nvs_commit(handle); - nvs_close(handle); -// interrupts(); +#ifdef USE_WEBCAM + WcInterrupt(1); +#endif } int32_t NvmErase(const char *sNvsName) { nvs_handle_t handle; -// noInterrupts(); int32_t result = nvs_open(sNvsName, NVS_READWRITE, &handle); if (ESP_OK == result) { result = nvs_erase_all(handle); } if (ESP_OK == result) { result = nvs_commit(handle); } nvs_close(handle); -// interrupts(); return result; } @@ -232,10 +232,7 @@ void SettingsWrite(const void *pSettings, unsigned nSettingsLen) { #ifdef USE_UFILESYS TfsSaveFile(TASM_FILE_SETTINGS, (const uint8_t*)pSettings, nSettingsLen); #endif -#ifdef USE_WEBCAM - if (!WcStreamActive()) -#endif - NvmSave("main", "Settings", pSettings, nSettingsLen); + NvmSave("main", "Settings", pSettings, nSettingsLen); } void QPCRead(void *pSettings, unsigned nSettingsLen) { diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 872ad6ace..6ebe7d7d2 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -232,8 +232,7 @@ void setup(void) { #ifdef ESP32 #ifdef DISABLE_ESP32_BROWNOUT DisableBrownout(); // Workaround possible weak LDO resulting in brownout detection during Wifi connection -#endif -#endif +#endif // DISABLE_ESP32_BROWNOUT #ifdef CONFIG_IDF_TARGET_ESP32 // restore GPIO16/17 if no PSRAM is found @@ -246,7 +245,9 @@ void setup(void) { gpio_reset_pin(GPIO_NUM_17); } } -#endif +#endif // CONFIG_IDF_TARGET_ESP32 +#endif // ESP32 + RtcPreInit(); SettingsInit(); diff --git a/tasmota/xdrv_50_filesystem.ino b/tasmota/xdrv_50_filesystem.ino index 7150fbd85..0785a7329 100644 --- a/tasmota/xdrv_50_filesystem.ino +++ b/tasmota/xdrv_50_filesystem.ino @@ -287,32 +287,40 @@ bool TfsFileExists(const char *fname){ bool TfsSaveFile(const char *fname, const uint8_t *buf, uint32_t len) { if (!ffs_type) { return false; } - +#ifdef USE_WEBCAM + WcInterrupt(0); // Stop stream if active to fix TG1WDT_SYS_RESET +#endif + bool result = false; File file = ffsp->open(fname, "w"); if (!file) { AddLog(LOG_LEVEL_INFO, PSTR("TFS: Save failed")); - return false; + } else { + // This will timeout on ESP32-webcam + // But now solved with WcInterrupt(0) in support_esp.ino + file.write(buf, len); + /* + // This will still timeout on ESP32-webcam when wcresolution 10 + uint32_t count = len / 512; + uint32_t chunk = len / count; + for (uint32_t i = 0; i < count; i++) { + file.write(buf + (i * chunk), chunk); + // do actually wait a little to allow ESP32 tasks to tick + // fixes task timeout in ESP32Solo1 style unicore code and webcam. + delay(10); + OsWatchLoop(); + } + uint32_t left = len % count; + if (left) { + file.write(buf + (count * chunk), left); + } + */ + file.close(); + result = true; } - -// This will timeout on ESP32-webcam -// file.write(buf, len); - - uint32_t count = len / 512; - uint32_t chunk = len / count; - for (uint32_t i = 0; i < count; i++) { - file.write(buf + (i * chunk), chunk); - // do actually wait a little to allow ESP32 tasks to tick - // fixes task timeout in ESP32Solo1 style unicore code and webcam. - delay(10); - OsWatchLoop(); - } - uint32_t left = len % count; - if (left) { - file.write(buf + (count * chunk), left); - } - - file.close(); - return true; +#ifdef USE_WEBCAM + WcInterrupt(1); +#endif + return result; } bool TfsInitFile(const char *fname, uint32_t len, uint8_t init_value) { diff --git a/tasmota/xdrv_81_esp32_webcam.ino b/tasmota/xdrv_81_esp32_webcam.ino index 273885049..b89bc7930 100644 --- a/tasmota/xdrv_81_esp32_webcam.ino +++ b/tasmota/xdrv_81_esp32_webcam.ino @@ -26,7 +26,7 @@ * {"NAME":"AITHINKER CAM","GPIO":[4992,1,672,1,416,5088,1,1,1,6720,736,704,1,1,5089,5090,0,5091,5184,5152,0,5120,5024,5056,0,0,0,0,4928,1,5094,5095,5092,0,0,5093],"FLAG":0,"BASE":2} * * Supported commands: - * WcStream = Control streaming, 0 = stop, 1 = start + * WcInterrupt = Control streaming, 0 = stop, 1 = start * WcResolution = Set resolution 0 = FRAMESIZE_96X96, // 96x96 1 = FRAMESIZE_QQVGA, // 160x120 @@ -78,6 +78,7 @@ #define XDRV_81 81 +#include "cam_hal.h" #include "esp_camera.h" #include "sensor.h" #include "fb_gfx.h" @@ -162,10 +163,21 @@ struct { #endif // ENABLE_RTSPSERVER } Wc; - - /*********************************************************************************************/ +void WcInterrupt(uint32_t state) { + // Stop camera ISR if active to fix TG1WDT_SYS_RESET + if (!Wc.up) { return; } + + if (state) { + // Re-enable interrupts + cam_start(); + } else { + // Stop interrupts + cam_stop(); + } +} + bool WcPinUsed(void) { bool pin_used = true; for (uint32_t i = 0; i < MAX_WEBCAM_DATA; i++) { @@ -711,7 +723,7 @@ void HandleImageBasic(void) { if (Settings->webcam_config.stream) { if (!Wc.CamServer) { - WcStreamControl(); + WcInterruptControl(); } } @@ -871,19 +883,17 @@ uint32_t WcSetStreamserver(uint32_t flag) { return 0; } -void WcStreamControl() { +void WcInterruptControl() { WcSetStreamserver(Settings->webcam_config.stream); WcSetup(Settings->webcam_config.resolution); } -bool WcStreamActive(void) { - return (Wc.stream_active); -} - /*********************************************************************************************/ void WcLoop(void) { + if (4 == Wc.stream_active) { return; } + if (Wc.CamServer) { Wc.CamServer->handleClient(); if (Wc.stream_active) { HandleWebcamMjpegTask(); } @@ -945,7 +955,7 @@ void WcShowStream(void) { if (Settings->webcam_config.stream) { // if (!Wc.CamServer || !Wc.up) { if (!Wc.CamServer) { - WcStreamControl(); + WcInterruptControl(); delay(50); // Give the webcam webserver some time to prepare the stream } if (Wc.CamServer && Wc.up) { @@ -1018,7 +1028,7 @@ void CmndWebcam(void) { void CmndWebcamStream(void) { if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 1)) { Settings->webcam_config.stream = XdrvMailbox.payload; - if (!Settings->webcam_config.stream) { WcStreamControl(); } // Stop stream + if (!Settings->webcam_config.stream) { WcInterruptControl(); } // Stop stream } ResponseCmndStateText(Settings->webcam_config.stream); } @@ -1072,7 +1082,7 @@ void CmndWebcamContrast(void) { } void CmndWebcamInit(void) { - WcStreamControl(); + WcInterruptControl(); ResponseCmndDone(); } From 394ae4961303ad426262eb8b52cbab215da5ef96 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Fri, 17 Dec 2021 18:54:27 +0100 Subject: [PATCH 96/97] fix c3 compile no webcam --- platformio_tasmota_env32.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/platformio_tasmota_env32.ini b/platformio_tasmota_env32.ini index c52786497..7a686762f 100644 --- a/platformio_tasmota_env32.ini +++ b/platformio_tasmota_env32.ini @@ -102,6 +102,7 @@ lib_ignore = TTGO TWatch Library Micro-RTSP epdiy + esp32-camera [env:tasmota32-AF] extends = env:tasmota32_base From 26a7fad65b00547a4677e13719edcc8f6a87b784 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 17 Dec 2021 19:41:36 +0100 Subject: [PATCH 97/97] Berry C mapping moved to a separate ``berry_mapping`` library --- CHANGELOG.md | 1 + .../default/be_lvgl_ctypes_definitions.c | 2 +- lib/libesp32/berry/default/be_lvgl_glob_lib.c | 81 ++-- lib/libesp32/berry/default/be_lvgl_module.c | 11 +- .../berry/default/embedded/lvgl_glob.be | 11 +- lib/libesp32/berry/include/be_lvgl.h | 40 -- .../berry_mapping/src/be_class_wrapper.c | 406 ++++++++++++++++++ .../berry_mapping/src/be_const_members.c | 64 +++ lib/libesp32/berry_mapping/src/be_mapping.h | 58 ++- .../berry_mapping/src/be_mapping_utils.c | 97 +++++ lib/libesp32/berry_mapping/src/be_raisef.c | 22 + tasmota/berry/include/be_gpio_defines.h | 2 +- tasmota/lvgl_berry/be_lv_c_mapping.h | 119 ++--- tasmota/xdrv_52_1_berry_native.ino | 350 --------------- tasmota/xdrv_52_3_berry_gpio.ino | 2 +- tasmota/xdrv_52_3_berry_light.ino | 32 +- tasmota/xdrv_52_3_berry_lvgl.ino | 175 +------- tasmota/xdrv_52_3_berry_tasmota.ino | 78 ++-- tasmota/xdrv_52_3_berry_webclient.ino | 2 +- tasmota/xdrv_52_3_berry_webserver.ino | 4 +- tools/lv_berry/convert.py | 22 +- tools/lv_gpio/gpio_convert.py | 2 +- 22 files changed, 843 insertions(+), 738 deletions(-) delete mode 100644 lib/libesp32/berry/include/be_lvgl.h create mode 100644 lib/libesp32/berry_mapping/src/be_class_wrapper.c create mode 100644 lib/libesp32/berry_mapping/src/be_const_members.c create mode 100644 lib/libesp32/berry_mapping/src/be_mapping_utils.c create mode 100644 lib/libesp32/berry_mapping/src/be_raisef.c diff --git a/CHANGELOG.md b/CHANGELOG.md index e5d9a8633..6ca69c83c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -893,6 +893,7 @@ All notable changes to this project will be documented in this file. ### Changed - Triple-mode TLS via configuration in a single firmware (TLS AWS IoT, Letsencrypt and No-TLS) +- Berry C mapping moved to a separate ``berry_mapping`` library ### Fixed - ESP32 PWM range diff --git a/lib/libesp32/berry/default/be_lvgl_ctypes_definitions.c b/lib/libesp32/berry/default/be_lvgl_ctypes_definitions.c index bb1ffb65c..74797a760 100644 --- a/lib/libesp32/berry/default/be_lvgl_ctypes_definitions.c +++ b/lib/libesp32/berry/default/be_lvgl_ctypes_definitions.c @@ -6,7 +6,7 @@ #ifdef USE_LVGL #include "lvgl.h" -#include "be_lvgl.h" +#include "be_mapping.h" /******************************************************************** * Generated code, don't edit diff --git a/lib/libesp32/berry/default/be_lvgl_glob_lib.c b/lib/libesp32/berry/default/be_lvgl_glob_lib.c index 06827fc0e..49848e1dc 100644 --- a/lib/libesp32/berry/default/be_lvgl_glob_lib.c +++ b/lib/libesp32/berry/default/be_lvgl_glob_lib.c @@ -249,7 +249,7 @@ be_local_closure(LVGL_glob_register_obj, /* name */ be_local_closure(LVGL_glob_gen_cb, /* name */ be_nested_proto( 8, /* nstack */ - 5, /* argc */ + 4, /* argc */ 0, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -281,56 +281,57 @@ be_local_closure(LVGL_glob_gen_cb, /* name */ ), }), 1, /* has constants */ - ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_str(lv_event_cb), - /* K1 */ be_nested_str(cb_event_closure), - /* K2 */ be_nested_str(event_cb), - /* K3 */ be_nested_str(tasmota), + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str(cb), + /* K1 */ be_nested_str(lv_event_cb), + /* K2 */ be_nested_str(cb_event_closure), + /* K3 */ be_nested_str(event_cb), /* K4 */ be_nested_str(gen_cb), /* K5 */ be_nested_str(register_obj), - /* K6 */ be_nested_str(null_cb), - /* K7 */ be_nested_str(cb_do_nothing), + /* K6 */ be_nested_str(_p), + /* K7 */ be_nested_str(null_cb), + /* K8 */ be_nested_str(cb_do_nothing), }), &be_const_str_gen_cb, &be_const_str_solidified, ( &(const binstruction[41]) { /* code */ - 0x1C140300, // 0000 EQ R5 R1 K0 - 0x78160018, // 0001 JMPF R5 #001B - 0x88140101, // 0002 GETMBR R5 R0 K1 - 0x4C180000, // 0003 LDNIL R6 - 0x1C140A06, // 0004 EQ R5 R5 R6 - 0x78160002, // 0005 JMPF R5 #0009 - 0x60140013, // 0006 GETGBL R5 G19 - 0x7C140000, // 0007 CALL R5 0 - 0x90020205, // 0008 SETMBR R0 K1 R5 - 0x88140102, // 0009 GETMBR R5 R0 K2 - 0x4C180000, // 000A LDNIL R6 - 0x1C140A06, // 000B EQ R5 R5 R6 - 0x78160004, // 000C JMPF R5 #0012 - 0xB8160600, // 000D GETNGBL R5 K3 - 0x8C140B04, // 000E GETMET R5 R5 K4 + 0xA4120000, // 0000 IMPORT R4 K0 + 0x1C140701, // 0001 EQ R5 R3 K1 + 0x78160018, // 0002 JMPF R5 #001C + 0x88140102, // 0003 GETMBR R5 R0 K2 + 0x4C180000, // 0004 LDNIL R6 + 0x1C140A06, // 0005 EQ R5 R5 R6 + 0x78160002, // 0006 JMPF R5 #000A + 0x60140013, // 0007 GETGBL R5 G19 + 0x7C140000, // 0008 CALL R5 0 + 0x90020405, // 0009 SETMBR R0 K2 R5 + 0x88140103, // 000A GETMBR R5 R0 K3 + 0x4C180000, // 000B LDNIL R6 + 0x1C140A06, // 000C EQ R5 R5 R6 + 0x78160003, // 000D JMPF R5 #0012 + 0x8C140904, // 000E GETMET R5 R4 K4 0x841C0000, // 000F CLOSURE R7 P0 0x7C140400, // 0010 CALL R5 2 - 0x90020405, // 0011 SETMBR R0 K2 R5 + 0x90020605, // 0011 SETMBR R0 K3 R5 0x8C140105, // 0012 GETMET R5 R0 K5 - 0x5C1C0600, // 0013 MOVE R7 R3 + 0x5C1C0400, // 0013 MOVE R7 R2 0x7C140400, // 0014 CALL R5 2 - 0x88140101, // 0015 GETMBR R5 R0 K1 - 0x98140802, // 0016 SETIDX R5 R4 R2 - 0x88140102, // 0017 GETMBR R5 R0 K2 - 0xA0000000, // 0018 CLOSE R0 - 0x80040A00, // 0019 RET 1 R5 - 0x7002000B, // 001A JMP #0027 - 0x88140106, // 001B GETMBR R5 R0 K6 - 0x4C180000, // 001C LDNIL R6 - 0x1C140A06, // 001D EQ R5 R5 R6 - 0x78160004, // 001E JMPF R5 #0024 - 0xB8160600, // 001F GETNGBL R5 K3 - 0x8C140B04, // 0020 GETMET R5 R5 K4 - 0x881C0107, // 0021 GETMBR R7 R0 K7 + 0x88140506, // 0015 GETMBR R5 R2 K6 + 0x88180102, // 0016 GETMBR R6 R0 K2 + 0x98180A01, // 0017 SETIDX R6 R5 R1 + 0x88140103, // 0018 GETMBR R5 R0 K3 + 0xA0000000, // 0019 CLOSE R0 + 0x80040A00, // 001A RET 1 R5 + 0x7002000A, // 001B JMP #0027 + 0x88140107, // 001C GETMBR R5 R0 K7 + 0x4C180000, // 001D LDNIL R6 + 0x1C140A06, // 001E EQ R5 R5 R6 + 0x78160003, // 001F JMPF R5 #0024 + 0x8C140904, // 0020 GETMET R5 R4 K4 + 0x881C0108, // 0021 GETMBR R7 R0 K8 0x7C140400, // 0022 CALL R5 2 - 0x90020C05, // 0023 SETMBR R0 K6 R5 - 0x88140106, // 0024 GETMBR R5 R0 K6 + 0x90020E05, // 0023 SETMBR R0 K7 R5 + 0x88140107, // 0024 GETMBR R5 R0 K7 0xA0000000, // 0025 CLOSE R0 0x80040A00, // 0026 RET 1 R5 0xA0000000, // 0027 CLOSE R0 diff --git a/lib/libesp32/berry/default/be_lvgl_module.c b/lib/libesp32/berry/default/be_lvgl_module.c index 890efd2ff..bb9b86e3e 100644 --- a/lib/libesp32/berry/default/be_lvgl_module.c +++ b/lib/libesp32/berry/default/be_lvgl_module.c @@ -9,7 +9,7 @@ #ifdef USE_LVGL #include "lvgl.h" -#include "be_lvgl.h" +#include "be_mapping.h" #include "lv_theme_openhasp.h" extern int lv0_member(bvm *vm); // resolve virtual members @@ -34,7 +34,7 @@ static int lv_get_ver_res(void) { } /* `lv` methods */ -const lvbe_call_c_t lv_func[] = { +const be_ntv_func_def_t lv_func[] = { { "clamp_height", (void*) &lv_clamp_height, "i", "iiii" }, { "clamp_width", (void*) &lv_clamp_width, "i", "iiii" }, @@ -111,12 +111,7 @@ const size_t lv_func_size = sizeof(lv_func) / sizeof(lv_func[0]); -typedef struct be_constint_t { - const char * name; - int32_t value; -} be_constint_t; - -const be_constint_t lv0_constants[] = { +const be_const_member_t lv0_constants[] = { { "ALIGN_BOTTOM_LEFT", LV_ALIGN_BOTTOM_LEFT }, { "ALIGN_BOTTOM_MID", LV_ALIGN_BOTTOM_MID }, diff --git a/lib/libesp32/berry/default/embedded/lvgl_glob.be b/lib/libesp32/berry/default/embedded/lvgl_glob.be index 04250ff54..17a62bf31 100644 --- a/lib/libesp32/berry/default/embedded/lvgl_glob.be +++ b/lib/libesp32/berry/default/embedded/lvgl_glob.be @@ -44,20 +44,21 @@ class LVGL_glob f(obj, event) end - def gen_cb(name, f, obj, ptr) - #print('>> gen_cb', name, obj, ptr) + def gen_cb(f, obj, name) + import cb + # print('>> gen_cb', f, name, obj) # record the object, whatever the callback if name == "lv_event_cb" if self.cb_event_closure == nil self.cb_event_closure = {} end - if self.event_cb == nil self.event_cb = tasmota.gen_cb(/ event_ptr -> self.lvgl_event_dispatch(event_ptr)) end # encapsulate 'self' in closure + if self.event_cb == nil self.event_cb = cb.gen_cb(/ event_ptr -> self.lvgl_event_dispatch(event_ptr)) end # encapsulate 'self' in closure self.register_obj(obj) - self.cb_event_closure[ptr] = f + self.cb_event_closure[obj._p] = f return self.event_cb # elif name == "" else - if self.null_cb == nil self.null_cb = tasmota.gen_cb(self.cb_do_nothing) end + if self.null_cb == nil self.null_cb = cb.gen_cb(self.cb_do_nothing) end return self.null_cb end end diff --git a/lib/libesp32/berry/include/be_lvgl.h b/lib/libesp32/berry/include/be_lvgl.h deleted file mode 100644 index 52b5edc2d..000000000 --- a/lib/libesp32/berry/include/be_lvgl.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************** - * Tasmota LVGL Headers - *******************************************************************/ -#ifndef __BE_LVGL_H__ -#define __BE_LVGL_H__ - -#include "be_constobj.h" - -#ifdef USE_LVGL - -#include "lvgl.h" - -#ifdef __cplusplus -extern "C" { -#endif - // table of functions per class - typedef struct lvbe_call_c_t { - const char * name; - void * func; - const char * return_type; - const char * arg_type; - } lvbe_call_c_t; - - // list of classes and function tables - typedef struct lvbe_call_c_classes_t { - const char * name; - const bclass * cl; - const lvbe_call_c_t * func_table; - size_t size; - } lvbe_call_c_classes_t; - extern const lvbe_call_c_classes_t lv_classes[]; - extern const size_t lv_classes_size; - -#ifdef __cplusplus -} -#endif - -#endif // USE_LVGL - -#endif // __BE_LVGL_H__ \ No newline at end of file diff --git a/lib/libesp32/berry_mapping/src/be_class_wrapper.c b/lib/libesp32/berry_mapping/src/be_class_wrapper.c new file mode 100644 index 000000000..5f71e7da1 --- /dev/null +++ b/lib/libesp32/berry_mapping/src/be_class_wrapper.c @@ -0,0 +1,406 @@ +/*********************************************************************************************\ + * Class wrappers for native objects + * + * These class are simple wrappers (containers) for a pointer of an external object. + * The pointer is stored interanlly by the class. + * + * The constructor of this class must accept the first argument to be `comptr`, + * in such case, the constructor must store the pointer. + * The class is not supposed to free the object at `deinit` time. +\*********************************************************************************************/ + +#include "be_mapping.h" +#include "be_exec.h" +#include + +/*********************************************************************************************\ + * Create an object of `class_name` given an external poinrt `ptr`. + * + * Instanciates the class and calls `init()` with `ptr` wrapped in `comptr` as single arg. + * Both arguments but nost bu NULL. + * + * On return, the created instance is top of stack. +\*********************************************************************************************/ +void be_create_class_wrapper(bvm *vm, const char * class_name, void * ptr) { + if (ptr == NULL) { + be_throw(vm, BE_MALLOC_FAIL); + } + + be_getglobal(vm, class_name); // stack = class + be_call(vm, 0); // instanciate, stack = instance + be_getmember(vm, -1, "init"); // stack = instance, init_func + be_pushvalue(vm, -2); // stack = instance, init_func, instance + be_pushcomptr(vm, ptr); // stack = instance, init_func, instance, ptr + be_call(vm, 2); // stack = instance, ret, instance, ptr + be_pop(vm, 3); // stack = instance +} + + +/*********************************************************************************************\ + * Find an object by global or composite name. + * + * I.e. `lv.lv_object` will check for a global called `lv` and a member `lv_object` + * + * Only supports one level of depth, meaning a class within a module. + * Does not check the type of the object found. + * + * Arguments: + * `name`: can be NULL, in such case considers the member as not found + * + * Case 1: (no dot in name) `lv_wifi_bars` will look for a global variable `lv_wifi_bars` + * Case 2: (dot in name) `lvgl.lv_obj` will get global `lvgl` and look for `lv_obj` within this module + * + * Returns the number of elements pushed on the stack: 1 for module, 2 for instance method, 0 if not found +\*********************************************************************************************/ +int be_find_global_or_module_member(bvm *vm, const char * name) { + char *saveptr; + + if (name == NULL) { + be_pushnil(vm); + return 0; + } + char name_buf[strlen(name)+1]; + strcpy(name_buf, name); + + char * prefix = strtok_r(name_buf, ".", &saveptr); + char * suffix = strtok_r(NULL, ".", &saveptr); + if (suffix) { + if (be_getglobal(vm, prefix)) { + if (be_getmember(vm, -1, suffix)) { + if (be_isinstance(vm, -2)) { // instance, so we need to push method + instance + be_pushvalue(vm, -2); + be_remove(vm, -3); + return 2; + } else { // not instane, so keep only the top object + be_remove(vm, -2); + return 1; + } + } else { + be_pop(vm, 2); + return 0; + } + } + be_pop(vm, 1); // remove nil + return 0; + } else { // no suffix, get the global object + if (be_getglobal(vm, prefix)) { + return 1; + } + be_pop(vm, 1); + return 0; + } +} + + +/*********************************************************************************************\ + * Automatically parse Berry stack and call the C function accordingly + * + * This function takes the n incoming arguments and pushes them as arguments + * on the stack for the C function: + * - be_int -> int32_t + * - be_bool -> int32_t with value 0/1 + * - be_string -> const char * + * - be_instance -> gets the member "_p" and pushes as void* + * + * This works because C silently ignores any unwanted arguments. + * There is a strong requirements that all ints and pointers are 32 bits. + * Float is not supported but could be added. Double cannot be supported because they are 64 bits + * + * Optional argument: + * - return_type: the C function return value is int32_t and is converted to the + * relevant Berry object depending on this char: + * '' (default): nil, no value + * 'i' be_int + * 'b' be_bool + * 's' be_str + * + * - arg_type: optionally check the types of input arguments, or throw an error + * string of argument types, '+' marks optional arguments + * '.' don't care + * 'i' be_int + * 'b' be_bool + * 's' be_string + * 'c' C callback + * '-' ignore and don't send to C function + * 'lv_obj' be_instance of type or subtype + * '^lv_event_cb' callback of a named class - will call `_lvgl.gen_cb(arg_type, closure, self)` and expects a callback address in return + * + * Ex: "oii+s" takes 3 mandatory arguments (obj_instance, int, int) and an optional fourth one [,string] +\*********************************************************************************************/ +// general form of lv_obj_t* function, up to 4 parameters +// We can only send 32 bits arguments (no 64 bits nor double) and we expect pointers to be 32 bits + +// read a single value at stack position idx, convert to int. +// if object instance, get `_p` member and convert it recursively +intptr_t be_convert_single_elt(bvm *vm, int idx, const char * arg_type, const char * gen_cb) { + // berry_log_C("be_convert_single_elt(idx=%i, argtype='%s', gen_cb=%p", idx, arg_type, gen_cb); + int ret = 0; + char provided_type = 0; + idx = be_absindex(vm, idx); // make sure we have an absolute index + + // berry_log_C(">> 0 idx=%i arg_type=%s", idx, arg_type ? arg_type : "NULL"); + if (arg_type == NULL) { arg_type = "."; } // if no type provided, replace with wildchar + size_t arg_type_len = strlen(arg_type); + + // handle callbacks first, since a wrong parameter will always yield to a crash + if (arg_type_len > 1 && arg_type[0] == '^') { // it is a callback + arg_type++; // skip first character + if (be_isclosure(vm, idx)) { + ret = be_find_global_or_module_member(vm, gen_cb); + if (ret) { + be_remove(vm, -3); // stack contains method + instance + be_pushvalue(vm, idx); + be_pushvalue(vm, 1); + be_pushstring(vm, arg_type); + be_call(vm, 2 + ret); + const void * func = be_tocomptr(vm, -(3 + ret)); + be_pop(vm, 3 + ret); + + // berry_log_C("func=%p", func); + return (int32_t) func; + } else { + be_raisef(vm, "type_error", "Can't find callback generator: %s", gen_cb); + } + } else { + be_raise(vm, "type_error", "Closure expected for callback type"); + } + } + + // first convert the value to int32 + if (be_isint(vm, idx)) { ret = be_toint(vm, idx); provided_type = 'i'; } + else if (be_isbool(vm, idx)) { ret = be_tobool(vm, idx); provided_type = 'b'; } + else if (be_isstring(vm, idx)) { ret = (intptr_t) be_tostring(vm, idx); provided_type = 's'; } + else if (be_iscomptr(vm, idx)) { ret = (intptr_t) be_tocomptr(vm, idx); provided_type = 'c'; } + else if (be_isnil(vm, idx)) { ret = 0; provided_type = 'c'; } + + // check if simple type was a match + if (provided_type) { + bbool type_ok = bfalse; + 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) { + be_raisef(vm, "type_error", "Unexpected argument type '%c', expected '%s'", provided_type, arg_type); + } + // berry_log_C("be_convert_single_elt provided type=%i", ret); + return ret; + } + + // berry_log_C("be_convert_single_elt non simple type"); + // non-simple type + if (be_isinstance(vm, idx)) { + // check if the instance is a subclass of `bytes()`` + be_getbuiltin(vm, "bytes"); + if (be_isderived(vm, idx)) { + be_pop(vm, 1); + be_getmember(vm, idx, "_buffer"); + be_pushvalue(vm, idx); + be_call(vm, 1); + int32_t ret = (int32_t) be_tocomptr(vm, -2); + be_pop(vm, 2); + return ret; + } else { + be_pop(vm, 1); + // we accept either `_p` or `.p` attribute to retrieve a pointer + if (!be_getmember(vm, idx, "_p")) { + be_pop(vm, 1); // remove `nil` + be_getmember(vm, idx, ".p"); + } + int32_t ret = be_convert_single_elt(vm, -1, NULL, NULL); // recurse + be_pop(vm, 1); + + if (arg_type_len > 1) { + // Check type + be_classof(vm, idx); + int class_found = be_find_global_or_module_member(vm, arg_type); + // Stack: class_of_idx, class_of_target (or nil) + if (class_found) { + if (!be_isderived(vm, -2)) { + be_raisef(vm, "type_error", "Unexpected class type '%s', expected '%s'", be_classname(vm, idx), arg_type); + } + } else { + be_raisef(vm, "value_error", "Unable to find class '%s' (%d)", arg_type, arg_type_len); + } + be_pop(vm, 2); + } else if (arg_type[0] != '.') { + be_raisef(vm, "value_error", "Unexpected instance type '%s', expected '%s'", be_classname(vm, idx), arg_type); + } + + return ret; + } + } else { + be_raisef(vm, "value_error", "Unexpected '%s'", be_typename(vm, idx)); + } + + return ret; +} + +/*********************************************************************************************\ + * Calling any LVGL function with auto-mapping + * +\*********************************************************************************************/ + +// check input parameters, and create callbacks if needed +// change values in place +// +// Format: +// - either a lowercase character encoding for a simple type +// - 'b': bool +// - 'i': int (int32_t) +// - 's': string (const char *) +// +// - a class name surroungded by parenthesis +// - '(lv_button)' -> lv_button class or derived +// - '[lv_event_cb]' -> callback type, still prefixed with '^' to mark that it is cb +// +void be_check_arg_type(bvm *vm, int arg_start, int argc, const char * arg_type, intptr_t p[8]) { + bbool arg_type_check = (arg_type != NULL); // is type checking activated + int32_t arg_idx = 0; // position in arg_type string + char type_short_name[32]; + + uint32_t p_idx = 0; // index in p[], is incremented with each parameter except '-' + for (uint32_t i = 0; i < argc; i++) { + type_short_name[0] = 0; // clear string + // extract individual type + if (NULL != arg_type) { + switch (arg_type[arg_idx]) { + case '-': + arg_idx++; + continue; // ignore current parameter and advance + case '.': + case 'a'...'z': + type_short_name[0] = arg_type[arg_idx]; + type_short_name[1] = 0; + arg_idx++; + break; + case '(': + case '^': + { + uint32_t prefix = 0; + if (arg_type[arg_idx] == '^') { + type_short_name[0] = '^'; + type_short_name[1] = 0; + prefix = 1; + } + uint32_t offset = 0; + arg_idx++; + while (arg_type[arg_idx + offset] != ')' && arg_type[arg_idx + offset] != '^' && arg_type[arg_idx + offset] != 0 && offset+prefix+1 < sizeof(type_short_name)) { + type_short_name[offset+prefix] = arg_type[arg_idx + offset]; + type_short_name[offset+prefix+1] = 0; + offset++; + } + if (arg_type[arg_idx + offset] == 0) { + arg_type = NULL; // no more parameters, stop iterations + } + arg_idx += offset + 1; + } + break; + case 0: + arg_type = NULL; // stop iterations + break; + } + } + // AddLog(LOG_LEVEL_INFO, ">> be_call_c_func arg %i, type %s", i, arg_type_check ? type_short_name : ""); + p[p_idx++] = be_convert_single_elt(vm, i + arg_start, arg_type_check ? type_short_name : NULL, "_lvgl.gen_cb"); + } + + // check if we are missing arguments + if (arg_type != NULL && arg_type[arg_idx] != 0) { + be_raisef(vm, "value_error", "Missing arguments, remaining type '%s'", &arg_type[arg_idx]); + } +} + +// +// Internal function +// +// Called for constructors, i.e. C function mapped to Berry `init()` +// +// Pre-conditions: +// The instance must be at stack position `1` (default when calling `init()`) +// +// Arguments: +// vm: point to Berry vm (as usual) +// ptr: the C pointer for internal data (can be NULL), will be stored in an instance variable +// name: name of instance variable to store the pointer as `comptr`. +// If NULL, this function does nothing +// the name can be prefixed with `+`, if so first char is ignored. +// Ex: `+_p` stores in instance variable `_p` +static void be_set_ctor_ptr(bvm *vm, void * ptr, const char *name) { + if (name == NULL) return; // do nothing if no name of attribute + if (name[0] == '+') { name++; } // skip prefix '^' if any + if (strlen(name) == 0) return; // do nothing if name is empty + + be_pushcomptr(vm, ptr); + if (be_setmember(vm, 1, name)) { + be_pop(vm, 1); + } else { + be_raisef(vm, "attribute_error", "Missing member '%s' in ctor", name); + } +} + +/*********************************************************************************************\ + * Call a C function with auto-mapping + * + * Arguments: + * vm: pointer to Berry vm (as ususal) + * func: pointer to C function + * return_type: how to convert the result into a Berry type + * arg_type: string describing the optional and mandatory parameters + * + * Note: the C function mapping supports max 8 arguments and does not directly support + * pointers to values (although it is possible to mimick with classes) +\*********************************************************************************************/ +int be_call_c_func(bvm *vm, void * func, const char * return_type, const char * arg_type) { + intptr_t p[8] = {0,0,0,0,0,0,0,0}; + int argc = be_top(vm); // Get the number of arguments + + // the following describe the active payload for the C function (start and count) + // this is because the `init()` constructor first arg is not passed to the C function + int arg_start = 1; // start with standard values + int arg_count = argc; + + // check if we call a constructor, in this case we store the return type into the new object + // check if we call a constructor with a comptr as first arg + if (return_type && return_type[0] == '+') { + if (argc > 1 && be_iscomptr(vm, 2)) { + void * obj = be_tocomptr(vm, 2); + be_set_ctor_ptr(vm, obj, return_type); + be_return_nil(vm); + } else { + // we need to discard the first arg + arg_start++; + arg_count--; + } + } + + fn_any_callable f = (fn_any_callable) func; + be_check_arg_type(vm, arg_start, arg_count, arg_type, p); + intptr_t ret = (*f)(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]); + // berry_log_C("be_call_c_func '%s' -> '%s': (%i,%i,%i,%i,%i,%i) -> %i", return_type, arg_type, p[0], p[1], p[2], p[3], p[4], p[5], ret); + + if ((return_type == NULL) || (strlen(return_type) == 0)) { be_return_nil(vm); } // does not return + else if (return_type[0] == '+') { + void * obj = (void*) ret; + be_set_ctor_ptr(vm, obj, return_type); + be_return_nil(vm); + } + else if (strlen(return_type) == 1) { + switch (return_type[0]) { + case '.': // fallback next + case 'i': be_pushint(vm, ret); break; + case 'b': be_pushbool(vm, ret); break; + case 's': be_pushstring(vm, (const char*) ret); break; + case 'c': be_pushint(vm, ret); break; // TODO missing 'c' general callback type + default: be_raise(vm, "internal_error", "Unsupported return type"); break; + } + be_return(vm); + } else { // class name + be_find_global_or_module_member(vm, return_type); + be_pushcomptr(vm, (void*) ret); // stack = class, ptr + be_pushcomptr(vm, (void*) -1); // stack = class, ptr, -1 + be_call(vm, 2); // instanciate with 2 arguments, stack = instance, -1, ptr + be_pop(vm, 2); // stack = instance + be_return(vm); + } +} diff --git a/lib/libesp32/berry_mapping/src/be_const_members.c b/lib/libesp32/berry_mapping/src/be_const_members.c new file mode 100644 index 000000000..7a1a796df --- /dev/null +++ b/lib/libesp32/berry_mapping/src/be_const_members.c @@ -0,0 +1,64 @@ +/*********************************************************************************************\ + * Add const virtual members to classes and modules from C static tables + * + * This allows to creates hundreds of constant members (integers, strings...) + * stored in a C array instead of explicit berry members. + * + * It has the following advantages: + * - consumes much less flash memory, especially with hundreds of members + * - allows C preprocessor to compute the value at compile time (instead of pure numerical numbers) + * - allows to compute pointer addresses to C structures + * + * Takes a pointer to be_const_member_t array and size + * Returns true if a match was found. In such case the result is on Berry stack + * + * Encoding depend on prefix (which is skipped when matching names): + * 1. `COLOR_WHITE` int value + * 3. `$SYMBOL_OK"` string pointer + * 4. `&seg7_font` comptr +\*********************************************************************************************/ + +#include "be_mapping.h" +#include "be_exec.h" +#include +/*********************************************************************************************\ + * Takes a pointer to be_const_member_t array and size + * Returns true if a match was found. In such case the result is on Berry stack + * + * Can be called directly by `member()` function, takes the name of the member from + * berry stack at position 1. + * + * Encoding depend on prefix (which is skipped when matching names): + * 1. `COLOR_WHITE` int value + * 3. `$SYMBOL_OK"` string pointer + * 4. `&seg7_font` comptr + * + * The array must be lexically sorted, but the sort function must ignore the prefix `$` or `&` +\*********************************************************************************************/ +bbool be_const_member(bvm *vm, const be_const_member_t * definitions, size_t def_len) { + int32_t argc = be_top(vm); // Get the number of arguments + if (argc == 1 && be_isstring(vm, 1)) { + const char * needle = be_tostring(vm, 1); + int32_t idx; + + idx = be_map_bin_search(needle, &definitions[0].name, sizeof(definitions[0]), def_len); + if (idx >= 0) { + // we did have a match + const char * key = definitions[idx].name; + switch (key[0]) { + // switch depending on the first char of the key, indicating the type + case '$': // string + be_pushstring(vm, (const char*) definitions[idx].value); + break; + case '&': // native function + be_pushntvfunction(vm, (bntvfunc) definitions[idx].value); + break; + default: // int + be_pushint(vm, definitions[idx].value); + break; + } + return btrue; + } + } + return bfalse; +} \ No newline at end of file diff --git a/lib/libesp32/berry_mapping/src/be_mapping.h b/lib/libesp32/berry_mapping/src/be_mapping.h index 850cd08c0..108db129b 100644 --- a/lib/libesp32/berry_mapping/src/be_mapping.h +++ b/lib/libesp32/berry_mapping/src/be_mapping.h @@ -3,8 +3,64 @@ #ifndef __BE_MAPPING__ #define __BE_MAPPING__ -// include this header to force compilation fo this module +#ifdef __cplusplus +extern "C" { +#endif +#include "berry.h" + +// include this header to force compilation fo this module #define BE_MAX_CB 20 // max number of callbacks, each callback requires a distinct address +/*********************************************************************************************\ + * Support for Berry int constants + * as virtual members + \*********************************************************************************************/ + +typedef intptr_t (*fn_any_callable)(intptr_t p0, intptr_t p1, intptr_t p2, intptr_t p3, + intptr_t p4, intptr_t p5, intptr_t p6, intptr_t p7); + +typedef struct be_const_member_t { + const char * name; + int value; +} be_const_member_t; + +// table of functions per class +typedef struct be_ntv_func_def_t { + const char * name; + void * func; + const char * return_type; + const char * arg_type; +} be_ntv_func_def_t; + +struct bclass; +// list of classes and function tables +typedef struct be_ntv_class_def_t { + const char * name; + const struct bclass * cl; + const be_ntv_func_def_t * func_table; + size_t size; +} be_ntv_class_def_t; + +void be_raisef(bvm *vm, const char *except, const char *msg, ...); + +extern void be_map_insert_int(bvm *vm, const char *key, bint value); +extern void be_map_insert_bool(bvm *vm, const char *key, bbool value); +extern void be_map_insert_real(bvm *vm, const char *key, breal value); +extern void be_map_insert_str(bvm *vm, const char *key, const char *value); +extern void be_map_insert_list_uint8(bvm *vm, const char *key, const uint8_t *value, size_t size); + +extern int be_map_bin_search(const char * needle, const void * table, size_t elt_size, size_t total_elements); + +extern void be_create_class_wrapper(bvm *vm, const char * class_name, void * ptr); +extern int be_find_global_or_module_member(bvm *vm, const char * cl_name); + +extern bbool be_const_member(bvm *vm, const be_const_member_t * definitions, size_t def_len); +extern intptr_t be_convert_single_elt(bvm *vm, int idx, const char * arg_type, const char * gen_cb); +extern void be_check_arg_type(bvm *vm, int arg_start, int argc, const char * arg_type, intptr_t p[8]);; +extern int be_call_c_func(bvm *vm, void * func, const char * return_type, const char * arg_type); + +#ifdef __cplusplus +} +#endif #endif // __BE_MAPPING__ diff --git a/lib/libesp32/berry_mapping/src/be_mapping_utils.c b/lib/libesp32/berry_mapping/src/be_mapping_utils.c new file mode 100644 index 000000000..e3a2cc6e2 --- /dev/null +++ b/lib/libesp32/berry_mapping/src/be_mapping_utils.c @@ -0,0 +1,97 @@ +#include "be_mapping.h" +#include +#include + +/*********************************************************************************************\ + * Helper functions to create a map with single line calls +\*********************************************************************************************/ +/* Insert an int to a key */ +void be_map_insert_int(bvm *vm, const char *key, bint value) +{ + be_pushstring(vm, key); + be_pushint(vm, value); + be_data_insert(vm, -3); + be_pop(vm, 2); +} +/* Insert an bbool to a key */ +void be_map_insert_bool(bvm *vm, const char *key, bbool value) +{ + be_pushstring(vm, key); + be_pushbool(vm, value); + be_data_insert(vm, -3); + be_pop(vm, 2); +} +/* Insert an real to a key */ +/* if value == NAN, ignore */ +void be_map_insert_real(bvm *vm, const char *key, breal value) +{ + if (!isnan(value)) { + be_pushstring(vm, key); + be_pushreal(vm, value); + be_data_insert(vm, -3); + be_pop(vm, 2); + } +} +/* Insert an C string to a key */ +void be_map_insert_str(bvm *vm, const char *key, const char *value) +{ + be_pushstring(vm, key); + be_pushstring(vm, value); + be_data_insert(vm, -3); + be_pop(vm, 2); +} +/* Insert list of bytes as individual integers to a key */ +void be_map_insert_list_uint8(bvm *vm, const char *key, const uint8_t *value, size_t size) +{ + be_pushstring(vm, key); + + be_newobject(vm, "list"); + for (uint32_t i=0; i < size; i++) { + be_pushint(vm, value[i]); + be_data_push(vm, -2); + be_pop(vm, 1); + } + be_pop(vm, 1); // now list is on top + + be_data_insert(vm, -3); // insert into map, key/value + be_pop(vm, 2); // pop both key and value +} + +/*********************************************************************************************\ + * Binary search for dynamic attributes + * + * Names need to be sorted +\*********************************************************************************************/ +// binary search within an array of sorted strings +// the first 4 bytes are a pointer to a string +// returns 0..total_elements-1 or -1 if not found +// +// This version skips the first character of the string if it's not a letter, +// the first character is used to indicate the type of the value associated to the key +int be_map_bin_search(const char * needle, const void * table, size_t elt_size, size_t total_elements) { + int low = 0; + int high = total_elements - 1; + int mid = (low + high) / 2; + // start a dissect + while (low <= high) { + const char * elt = *(const char **) ( ((uint8_t*)table) + mid * elt_size ); + char first_char = elt[0]; + if ( !(first_char >= 'a' && first_char <='z') && !(first_char >= 'A' && first_char <='Z') ) { + elt++; // skip first char + } + int comp = strcmp(needle, elt); + if (comp < 0) { + high = mid - 1; + } else if (comp > 0) { + low = mid + 1; + } else { + break; + } + mid = (low + high) / 2; + } + if (low <= high) { + return mid; + } else { + return -1; + } +} \ No newline at end of file diff --git a/lib/libesp32/berry_mapping/src/be_raisef.c b/lib/libesp32/berry_mapping/src/be_raisef.c new file mode 100644 index 000000000..6d8451bab --- /dev/null +++ b/lib/libesp32/berry_mapping/src/be_raisef.c @@ -0,0 +1,22 @@ +/*********************************************************************************************\ + * Extended version of be_raise() +\*********************************************************************************************/ + +#include "be_mapping.h" +#include "be_exec.h" +#include +#include +#include + +// variant of be_raise with string format +void be_raisef(bvm *vm, const char *except, const char *msg, ...) { + // To save stack space support logging for max text length of 128 characters + char log_data[128]; + + va_list arg; + va_start(arg, msg); + uint32_t len = vsnprintf(log_data, sizeof(log_data)-3, msg, arg); + va_end(arg); + if (len+3 > sizeof(log_data)) { strcat(log_data, "..."); } // Actual data is more + be_raise(vm, except, log_data); +} diff --git a/tasmota/berry/include/be_gpio_defines.h b/tasmota/berry/include/be_gpio_defines.h index 73f37825e..e40219dc4 100644 --- a/tasmota/berry/include/be_gpio_defines.h +++ b/tasmota/berry/include/be_gpio_defines.h @@ -2,7 +2,7 @@ * Generated code, don't edit *******************************************************************/ -const be_constint_t lv_gpio_constants[] = { +const be_const_member_t lv_gpio_constants[] = { { "A4988_DIR", (int32_t) GPIO_A4988_DIR }, { "A4988_ENA", (int32_t) GPIO_A4988_ENA }, diff --git a/tasmota/lvgl_berry/be_lv_c_mapping.h b/tasmota/lvgl_berry/be_lv_c_mapping.h index 553238373..dd654f5f3 100644 --- a/tasmota/lvgl_berry/be_lv_c_mapping.h +++ b/tasmota/lvgl_berry/be_lv_c_mapping.h @@ -8,9 +8,10 @@ extern "C" { #endif #include "be_ctypes.h" +#include "be_mapping.h" /* `lv_style` methods */ -const lvbe_call_c_t lv_style_func[] = { +const be_ntv_func_def_t lv_style_func[] = { { "set_align", (void*) &lv_style_set_align, "", "(lv.lv_style)i" }, { "set_anim_speed", (void*) &lv_style_set_anim_speed, "", "(lv.lv_style)i" }, { "set_anim_time", (void*) &lv_style_set_anim_time, "", "(lv.lv_style)i" }, @@ -103,20 +104,20 @@ const lvbe_call_c_t lv_style_func[] = { }; /* `lv_font` methods */ -const lvbe_call_c_t lv_font_func[] = { +const be_ntv_func_def_t lv_font_func[] = { }; /* `lv_color` methods */ -const lvbe_call_c_t lv_color_func[] = { +const be_ntv_func_def_t lv_color_func[] = { }; /* `lv_theme` methods */ -const lvbe_call_c_t lv_theme_func[] = { +const be_ntv_func_def_t lv_theme_func[] = { }; /* `lv_img` methods */ #ifdef BE_LV_WIDGET_IMG -const lvbe_call_c_t lv_img_func[] = { +const be_ntv_func_def_t lv_img_func[] = { { "get_angle", (void*) &lv_img_get_angle, "i", "(lv.lv_obj)" }, { "get_antialias", (void*) &lv_img_get_antialias, "b", "(lv.lv_obj)" }, { "get_offset_x", (void*) &lv_img_get_offset_x, "i", "(lv.lv_obj)" }, @@ -136,7 +137,7 @@ const lvbe_call_c_t lv_img_func[] = { #endif // BE_LV_WIDGET_IMG /* `lv_disp` methods */ -const lvbe_call_c_t lv_disp_func[] = { +const be_ntv_func_def_t lv_disp_func[] = { { "clean_dcache", (void*) &lv_disp_clean_dcache, "", "(lv.lv_disp)" }, { "dpx", (void*) &lv_disp_dpx, "i", "(lv.lv_disp)i" }, { "get_inactive_time", (void*) &lv_disp_get_inactive_time, "i", "(lv.lv_disp)" }, @@ -154,7 +155,7 @@ const lvbe_call_c_t lv_disp_func[] = { }; /* `lv_obj` methods */ -const lvbe_call_c_t lv_obj_func[] = { +const be_ntv_func_def_t lv_obj_func[] = { { "add_event_cb", (void*) &lv_obj_add_event_cb, "i", "(lv.lv_obj)^lv_event_cb^i." }, { "add_flag", (void*) &lv_obj_add_flag, "", "(lv.lv_obj)i" }, { "add_state", (void*) &lv_obj_add_state, "", "(lv.lv_obj)i" }, @@ -458,7 +459,7 @@ const lvbe_call_c_t lv_obj_func[] = { }; /* `lv_group` methods */ -const lvbe_call_c_t lv_group_func[] = { +const be_ntv_func_def_t lv_group_func[] = { { "add_obj", (void*) &lv_group_add_obj, "", "(lv.lv_group)(lv.lv_obj)" }, { "del", (void*) &lv_group_del, "", "(lv.lv_group)" }, { "focus_freeze", (void*) &lv_group_focus_freeze, "", "(lv.lv_group)b" }, @@ -481,7 +482,7 @@ const lvbe_call_c_t lv_group_func[] = { }; /* `lv_indev` methods */ -const lvbe_call_c_t lv_indev_func[] = { +const be_ntv_func_def_t lv_indev_func[] = { { "enable", (void*) &lv_indev_enable, "", "(lv.lv_indev)b" }, { "get_gesture_dir", (void*) &lv_indev_get_gesture_dir, "i", "(lv.lv_indev)" }, { "get_key", (void*) &lv_indev_get_key, "i", "(lv.lv_indev)" }, @@ -501,7 +502,7 @@ const lvbe_call_c_t lv_indev_func[] = { /* `lv_chart` methods */ #ifdef BE_LV_WIDGET_CHART -const lvbe_call_c_t lv_chart_func[] = { +const be_ntv_func_def_t lv_chart_func[] = { { "get_cursor_point", (void*) &lv_chart_get_cursor_point, "i", "(lv.lv_obj)(lv.lv_chart_cursor)" }, { "get_point_count", (void*) &lv_chart_get_point_count, "i", "(lv.lv_obj)" }, { "get_point_pos_by_id", (void*) &lv_chart_get_point_pos_by_id, "", "(lv.lv_obj)(lv.lv_chart_series)i(lv.lv_point)" }, @@ -537,7 +538,7 @@ const lvbe_call_c_t lv_chart_func[] = { /* `lv_colorwheel` methods */ #ifdef BE_LV_WIDGET_COLORWHEEL -const lvbe_call_c_t lv_colorwheel_func[] = { +const be_ntv_func_def_t lv_colorwheel_func[] = { { "get_color_mode", (void*) &lv_colorwheel_get_color_mode, "i", "(lv.lv_obj)" }, { "get_color_mode_fixed", (void*) &lv_colorwheel_get_color_mode_fixed, "b", "(lv.lv_obj)" }, { "get_hsv", (void*) &lv_colorwheel_get_hsv, "i", "(lv.lv_obj)" }, @@ -551,14 +552,14 @@ const lvbe_call_c_t lv_colorwheel_func[] = { /* `lv_imgbtn` methods */ #ifdef BE_LV_WIDGET_IMGBTN -const lvbe_call_c_t lv_imgbtn_func[] = { +const be_ntv_func_def_t lv_imgbtn_func[] = { { "set_src", (void*) &lv_imgbtn_set_src, "", "(lv.lv_obj)(lv.lv_imgbtn_state)..." }, }; #endif // BE_LV_WIDGET_IMGBTN /* `lv_led` methods */ #ifdef BE_LV_WIDGET_LED -const lvbe_call_c_t lv_led_func[] = { +const be_ntv_func_def_t lv_led_func[] = { { "get_brightness", (void*) &lv_led_get_brightness, "i", "(lv.lv_obj)" }, { "off", (void*) &lv_led_off, "", "(lv.lv_obj)" }, { "on", (void*) &lv_led_on, "", "(lv.lv_obj)" }, @@ -570,7 +571,7 @@ const lvbe_call_c_t lv_led_func[] = { /* `lv_meter` methods */ #ifdef BE_LV_WIDGET_METER -const lvbe_call_c_t lv_meter_func[] = { +const be_ntv_func_def_t lv_meter_func[] = { { "add_arc", (void*) &lv_meter_add_arc, "lv.lv_meter_indicator", "(lv.lv_obj)(lv.lv_meter_scale)i(lv.lv_color)i" }, { "add_needle_img", (void*) &lv_meter_add_needle_img, "lv.lv_meter_indicator", "(lv.lv_obj)(lv.lv_meter_scale).ii" }, { "add_needle_line", (void*) &lv_meter_add_needle_line, "lv.lv_meter_indicator", "(lv.lv_obj)(lv.lv_meter_scale)i(lv.lv_color)i" }, @@ -587,7 +588,7 @@ const lvbe_call_c_t lv_meter_func[] = { /* `lv_msgbox` methods */ #ifdef BE_LV_WIDGET_MSGBOX -const lvbe_call_c_t lv_msgbox_func[] = { +const be_ntv_func_def_t lv_msgbox_func[] = { { "close", (void*) &lv_msgbox_close, "", "(lv.lv_obj)" }, { "get_active_btn_text", (void*) &lv_msgbox_get_active_btn_text, "s", "(lv.lv_obj)" }, { "get_btns", (void*) &lv_msgbox_get_btns, "lv.lv_obj", "(lv.lv_obj)" }, @@ -599,7 +600,7 @@ const lvbe_call_c_t lv_msgbox_func[] = { /* `lv_spinbox` methods */ #ifdef BE_LV_WIDGET_SPINBOX -const lvbe_call_c_t lv_spinbox_func[] = { +const be_ntv_func_def_t lv_spinbox_func[] = { { "decrement", (void*) &lv_spinbox_decrement, "", "(lv.lv_obj)" }, { "get_rollover", (void*) &lv_spinbox_get_rollover, "b", "(lv.lv_obj)" }, { "get_step", (void*) &lv_spinbox_get_step, "i", "(lv.lv_obj)" }, @@ -617,13 +618,13 @@ const lvbe_call_c_t lv_spinbox_func[] = { /* `lv_spinner` methods */ #ifdef BE_LV_WIDGET_SPINNER -const lvbe_call_c_t lv_spinner_func[] = { +const be_ntv_func_def_t lv_spinner_func[] = { }; #endif // BE_LV_WIDGET_SPINNER /* `lv_arc` methods */ #ifdef BE_LV_WIDGET_ARC -const lvbe_call_c_t lv_arc_func[] = { +const be_ntv_func_def_t lv_arc_func[] = { { "get_angle_end", (void*) &lv_arc_get_angle_end, "i", "(lv.lv_obj)" }, { "get_angle_start", (void*) &lv_arc_get_angle_start, "i", "(lv.lv_obj)" }, { "get_bg_angle_end", (void*) &lv_arc_get_bg_angle_end, "i", "(lv.lv_obj)" }, @@ -648,7 +649,7 @@ const lvbe_call_c_t lv_arc_func[] = { /* `lv_bar` methods */ #ifdef BE_LV_WIDGET_BAR -const lvbe_call_c_t lv_bar_func[] = { +const be_ntv_func_def_t lv_bar_func[] = { { "get_max_value", (void*) &lv_bar_get_max_value, "i", "(lv.lv_obj)" }, { "get_min_value", (void*) &lv_bar_get_min_value, "i", "(lv.lv_obj)" }, { "get_mode", (void*) &lv_bar_get_mode, "i", "(lv.lv_obj)" }, @@ -663,13 +664,13 @@ const lvbe_call_c_t lv_bar_func[] = { /* `lv_btn` methods */ #ifdef BE_LV_WIDGET_BTN -const lvbe_call_c_t lv_btn_func[] = { +const be_ntv_func_def_t lv_btn_func[] = { }; #endif // BE_LV_WIDGET_BTN /* `lv_btnmatrix` methods */ #ifdef BE_LV_WIDGET_BTNMATRIX -const lvbe_call_c_t lv_btnmatrix_func[] = { +const be_ntv_func_def_t lv_btnmatrix_func[] = { { "clear_btn_ctrl", (void*) &lv_btnmatrix_clear_btn_ctrl, "", "(lv.lv_obj)i(lv.lv_btnmatrix_ctrl)" }, { "clear_btn_ctrl_all", (void*) &lv_btnmatrix_clear_btn_ctrl_all, "", "(lv.lv_obj)(lv.lv_btnmatrix_ctrl)" }, { "get_btn_text", (void*) &lv_btnmatrix_get_btn_text, "s", "(lv.lv_obj)i" }, @@ -688,7 +689,7 @@ const lvbe_call_c_t lv_btnmatrix_func[] = { /* `lv_canvas` methods */ #ifdef BE_LV_WIDGET_CANVAS -const lvbe_call_c_t lv_canvas_func[] = { +const be_ntv_func_def_t lv_canvas_func[] = { { "blur_hor", (void*) &lv_canvas_blur_hor, "", "(lv.lv_obj)(lv.lv_area)i" }, { "blur_ver", (void*) &lv_canvas_blur_ver, "", "(lv.lv_obj)(lv.lv_area)i" }, { "copy_buf", (void*) &lv_canvas_copy_buf, "", "(lv.lv_obj).iiii" }, @@ -709,7 +710,7 @@ const lvbe_call_c_t lv_canvas_func[] = { /* `lv_checkbox` methods */ #ifdef BE_LV_WIDGET_CHECKBOX -const lvbe_call_c_t lv_checkbox_func[] = { +const be_ntv_func_def_t lv_checkbox_func[] = { { "get_text", (void*) &lv_checkbox_get_text, "s", "(lv.lv_obj)" }, { "set_text", (void*) &lv_checkbox_set_text, "", "(lv.lv_obj)s" }, { "set_text_static", (void*) &lv_checkbox_set_text_static, "", "(lv.lv_obj)s" }, @@ -718,7 +719,7 @@ const lvbe_call_c_t lv_checkbox_func[] = { /* `lv_dropdown` methods */ #ifdef BE_LV_WIDGET_DROPDOWN -const lvbe_call_c_t lv_dropdown_func[] = { +const be_ntv_func_def_t lv_dropdown_func[] = { { "add_option", (void*) &lv_dropdown_add_option, "", "(lv.lv_obj)si" }, { "clear_options", (void*) &lv_dropdown_clear_options, "", "(lv.lv_obj)" }, { "close", (void*) &lv_dropdown_close, "", "(lv.lv_obj)" }, @@ -744,7 +745,7 @@ const lvbe_call_c_t lv_dropdown_func[] = { /* `lv_label` methods */ #ifdef BE_LV_WIDGET_LABEL -const lvbe_call_c_t lv_label_func[] = { +const be_ntv_func_def_t lv_label_func[] = { { "cut_text", (void*) &lv_label_cut_text, "", "(lv.lv_obj)ii" }, { "get_letter_on", (void*) &lv_label_get_letter_on, "i", "(lv.lv_obj)(lv.lv_point)" }, { "get_letter_pos", (void*) &lv_label_get_letter_pos, "", "(lv.lv_obj)i(lv.lv_point)" }, @@ -767,7 +768,7 @@ const lvbe_call_c_t lv_label_func[] = { /* `lv_line` methods */ #ifdef BE_LV_WIDGET_LINE -const lvbe_call_c_t lv_line_func[] = { +const be_ntv_func_def_t lv_line_func[] = { { "get_y_invert", (void*) &lv_line_get_y_invert, "b", "(lv.lv_obj)" }, { "set_points", (void*) &lv_line_set_points, "", "(lv.lv_obj)ii" }, { "set_y_invert", (void*) &lv_line_set_y_invert, "", "(lv.lv_obj)b" }, @@ -776,7 +777,7 @@ const lvbe_call_c_t lv_line_func[] = { /* `lv_roller` methods */ #ifdef BE_LV_WIDGET_ROLLER -const lvbe_call_c_t lv_roller_func[] = { +const be_ntv_func_def_t lv_roller_func[] = { { "get_option_cnt", (void*) &lv_roller_get_option_cnt, "i", "(lv.lv_obj)" }, { "get_options", (void*) &lv_roller_get_options, "s", "(lv.lv_obj)" }, { "get_selected", (void*) &lv_roller_get_selected, "i", "(lv.lv_obj)" }, @@ -789,7 +790,7 @@ const lvbe_call_c_t lv_roller_func[] = { /* `lv_slider` methods */ #ifdef BE_LV_WIDGET_SLIDER -const lvbe_call_c_t lv_slider_func[] = { +const be_ntv_func_def_t lv_slider_func[] = { { "get_left_value", (void*) &lv_slider_get_left_value, "i", "(lv.lv_obj)" }, { "get_max_value", (void*) &lv_slider_get_max_value, "i", "(lv.lv_obj)" }, { "get_min_value", (void*) &lv_slider_get_min_value, "i", "(lv.lv_obj)" }, @@ -805,13 +806,13 @@ const lvbe_call_c_t lv_slider_func[] = { /* `lv_switch` methods */ #ifdef BE_LV_WIDGET_SWITCH -const lvbe_call_c_t lv_switch_func[] = { +const be_ntv_func_def_t lv_switch_func[] = { }; #endif // BE_LV_WIDGET_SWITCH /* `lv_table` methods */ #ifdef BE_LV_WIDGET_TABLE -const lvbe_call_c_t lv_table_func[] = { +const be_ntv_func_def_t lv_table_func[] = { { "add_cell_ctrl", (void*) &lv_table_add_cell_ctrl, "", "(lv.lv_obj)ii(lv.lv_table_cell_ctrl)" }, { "clear_cell_ctrl", (void*) &lv_table_clear_cell_ctrl, "", "(lv.lv_obj)ii(lv.lv_table_cell_ctrl)" }, { "get_cell_value", (void*) &lv_table_get_cell_value, "s", "(lv.lv_obj)ii" }, @@ -830,7 +831,7 @@ const lvbe_call_c_t lv_table_func[] = { /* `lv_textarea` methods */ #ifdef BE_LV_WIDGET_TEXTAREA -const lvbe_call_c_t lv_textarea_func[] = { +const be_ntv_func_def_t lv_textarea_func[] = { { "add_char", (void*) &lv_textarea_add_char, "", "(lv.lv_obj)i" }, { "add_text", (void*) &lv_textarea_add_text, "", "(lv.lv_obj)s" }, { "clear_selection", (void*) &lv_textarea_clear_selection, "", "(lv.lv_obj)" }, @@ -901,7 +902,7 @@ extern const bclass be_class_lv_theme; // map of clases -const lvbe_call_c_classes_t lv_classes[] = { +const be_ntv_class_def_t lv_classes[] = { #ifdef BE_LV_WIDGET_ARC { "lv_arc", &be_class_lv_arc, lv_arc_func, sizeof(lv_arc_func) / sizeof(lv_arc_func[0]) }, #endif // BE_LV_WIDGET_ARC @@ -988,106 +989,106 @@ const size_t lv_classes_size = sizeof(lv_classes) / sizeof(lv_classes[0]); /* `lv_theme` methods */ /* `lv_img` methods */ #ifdef BE_LV_WIDGET_IMG - int be_ntv_lv_img_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_img_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_img_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_img_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_IMG /* `lv_disp` methods */ /* `lv_obj` methods */ - int be_ntv_lv_obj_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_obj_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_obj_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_obj_create, "+_p", "(lv.lv_obj)"); } /* `lv_group` methods */ - int be_ntv_lv_group_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_group_create, "+", ""); } + int be_ntv_lv_group_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_group_create, "+_p", ""); } /* `lv_indev` methods */ /* `lv_chart` methods */ #ifdef BE_LV_WIDGET_CHART - int be_ntv_lv_chart_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_chart_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_chart_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_chart_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_CHART /* `lv_colorwheel` methods */ #ifdef BE_LV_WIDGET_COLORWHEEL - int be_ntv_lv_colorwheel_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_colorwheel_create, "+", "(lv.lv_obj)b"); } + int be_ntv_lv_colorwheel_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_colorwheel_create, "+_p", "(lv.lv_obj)b"); } #endif // BE_LV_WIDGET_COLORWHEEL /* `lv_imgbtn` methods */ #ifdef BE_LV_WIDGET_IMGBTN - int be_ntv_lv_imgbtn_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_imgbtn_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_imgbtn_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_imgbtn_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_IMGBTN /* `lv_led` methods */ #ifdef BE_LV_WIDGET_LED - int be_ntv_lv_led_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_led_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_led_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_led_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_LED /* `lv_meter` methods */ #ifdef BE_LV_WIDGET_METER - int be_ntv_lv_meter_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_meter_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_meter_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_meter_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_METER /* `lv_msgbox` methods */ #ifdef BE_LV_WIDGET_MSGBOX - int be_ntv_lv_msgbox_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_msgbox_create, "+", "(lv.lv_obj)sssb"); } + int be_ntv_lv_msgbox_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_msgbox_create, "+_p", "(lv.lv_obj)sssb"); } #endif // BE_LV_WIDGET_MSGBOX /* `lv_spinbox` methods */ #ifdef BE_LV_WIDGET_SPINBOX - int be_ntv_lv_spinbox_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_spinbox_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_spinbox_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_spinbox_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_SPINBOX /* `lv_spinner` methods */ #ifdef BE_LV_WIDGET_SPINNER - int be_ntv_lv_spinner_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_spinner_create, "+", "(lv.lv_obj)ii"); } + int be_ntv_lv_spinner_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_spinner_create, "+_p", "(lv.lv_obj)ii"); } #endif // BE_LV_WIDGET_SPINNER /* `lv_arc` methods */ #ifdef BE_LV_WIDGET_ARC - int be_ntv_lv_arc_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_arc_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_arc_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_arc_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_ARC /* `lv_bar` methods */ #ifdef BE_LV_WIDGET_BAR - int be_ntv_lv_bar_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_bar_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_bar_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_bar_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_BAR /* `lv_btn` methods */ #ifdef BE_LV_WIDGET_BTN - int be_ntv_lv_btn_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_btn_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_btn_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_btn_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_BTN /* `lv_btnmatrix` methods */ #ifdef BE_LV_WIDGET_BTNMATRIX - int be_ntv_lv_btnmatrix_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_btnmatrix_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_btnmatrix_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_btnmatrix_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_BTNMATRIX /* `lv_canvas` methods */ #ifdef BE_LV_WIDGET_CANVAS - int be_ntv_lv_canvas_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_canvas_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_canvas_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_canvas_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_CANVAS /* `lv_checkbox` methods */ #ifdef BE_LV_WIDGET_CHECKBOX - int be_ntv_lv_checkbox_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_checkbox_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_checkbox_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_checkbox_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_CHECKBOX /* `lv_dropdown` methods */ #ifdef BE_LV_WIDGET_DROPDOWN - int be_ntv_lv_dropdown_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_dropdown_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_dropdown_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_dropdown_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_DROPDOWN /* `lv_label` methods */ #ifdef BE_LV_WIDGET_LABEL - int be_ntv_lv_label_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_label_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_label_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_label_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_LABEL /* `lv_line` methods */ #ifdef BE_LV_WIDGET_LINE - int be_ntv_lv_line_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_line_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_line_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_line_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_LINE /* `lv_roller` methods */ #ifdef BE_LV_WIDGET_ROLLER - int be_ntv_lv_roller_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_roller_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_roller_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_roller_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_ROLLER /* `lv_slider` methods */ #ifdef BE_LV_WIDGET_SLIDER - int be_ntv_lv_slider_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_slider_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_slider_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_slider_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_SLIDER /* `lv_switch` methods */ #ifdef BE_LV_WIDGET_SWITCH - int be_ntv_lv_switch_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_switch_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_switch_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_switch_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_SWITCH /* `lv_table` methods */ #ifdef BE_LV_WIDGET_TABLE - int be_ntv_lv_table_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_table_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_table_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_table_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_TABLE /* `lv_textarea` methods */ #ifdef BE_LV_WIDGET_TEXTAREA - int be_ntv_lv_textarea_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_textarea_create, "+", "(lv.lv_obj)"); } + int be_ntv_lv_textarea_init(bvm *vm) { return be_call_c_func(vm, (void*) &lv_textarea_create, "+_p", "(lv.lv_obj)"); } #endif // BE_LV_WIDGET_TEXTAREA // create font either empty or from parameter on stack -int lvbe_font_create(bvm *vm) { return be_call_c_func(vm, NULL, "+lv_font", ""); } -int lvbe_theme_create(bvm *vm) { return be_call_c_func(vm, NULL, "+lv_theme", ""); } +int lvbe_font_create(bvm *vm) { return be_call_c_func(vm, NULL, "+_p", ""); } +int lvbe_theme_create(bvm *vm) { return be_call_c_func(vm, NULL, "+_p", ""); } #ifdef __cplusplus diff --git a/tasmota/xdrv_52_1_berry_native.ino b/tasmota/xdrv_52_1_berry_native.ino index 2bf1f152e..4481320d7 100644 --- a/tasmota/xdrv_52_1_berry_native.ino +++ b/tasmota/xdrv_52_1_berry_native.ino @@ -26,19 +26,6 @@ const char kTypeError[] PROGMEM = "type_error"; const char kInternalError[] PROGMEM = "intenal_error"; -extern "C" { - - /*********************************************************************************************\ - * Support for Berry int constants - * as virtual members - \*********************************************************************************************/ - typedef struct be_constint_t { - const char * name; - int32_t value; - } be_constint_t; - -} - /*********************************************************************************************\ * LVGL top level virtual members * @@ -76,65 +63,6 @@ extern "C" { return v; } - // variant of be_raise with string format - [[ noreturn ]] void be_raisef(bvm *vm, const char *except, const char *msg, ...) { - // To save stack space support logging for max text length of 128 characters - char log_data[128]; - - va_list arg; - va_start(arg, msg); - uint32_t len = ext_vsnprintf_P(log_data, sizeof(log_data)-3, msg, arg); - va_end(arg); - if (len+3 > sizeof(log_data)) { strcat(log_data, "..."); } // Actual data is more - be_raise(vm, except, log_data); - } - - static void map_insert_int(bvm *vm, const char *key, int value) - { - be_pushstring(vm, key); - be_pushint(vm, value); - be_data_insert(vm, -3); - be_pop(vm, 2); - } - static void map_insert_bool(bvm *vm, const char *key, bool value) - { - be_pushstring(vm, key); - be_pushbool(vm, value); - be_data_insert(vm, -3); - be_pop(vm, 2); - } - // if value == NAN, ignore - static void map_insert_float(bvm *vm, const char *key, float value) - { - if (!isnan(value)) { - be_pushstring(vm, key); - be_pushreal(vm, value); - be_data_insert(vm, -3); - be_pop(vm, 2); - } - } - static void map_insert_str(bvm *vm, const char *key, const char *value) - { - be_pushstring(vm, key); - be_pushstring(vm, value); - be_data_insert(vm, -3); - be_pop(vm, 2); - } - static void map_insert_list_uint8(bvm *vm, const char *key, const uint8_t *value, size_t size) - { - be_pushstring(vm, key); - - be_newobject(vm, "list"); - for (uint32_t i=0; i < size; i++) { - be_pushint(vm, value[i]); - be_data_push(vm, -2); - be_pop(vm, 1); - } - be_pop(vm, 1); // now list is on top - - be_data_insert(vm, -3); // insert into map, key/value - be_pop(vm, 2); // pop both key and value - } int32_t member_find(bvm *vm, const char *key, int32_t default_value) { int32_t ret = default_value; if (be_getmember(vm, -1, key)) { @@ -171,283 +99,6 @@ extern "C" { be_call(vm, 2); // call wirn 2 parameters (implicit instance and key) be_pop(vm, 2); // pop 2 arguments and return value } - - // create an object from the pointer and a class name - // on return, instance is pushed on the stack - void lv_create_object(bvm *vm, const char * class_name, void * ptr); - void lv_create_object(bvm *vm, const char * class_name, void * ptr) { - if (ptr == nullptr) { - be_throw(vm, BE_MALLOC_FAIL); - } - - be_getglobal(vm, class_name); // stack = class - be_call(vm, 0); // instanciate, stack = instance - be_getmember(vm, -1, "init"); // stack = instance, init_func - be_pushvalue(vm, -2); // stack = instance, init_func, instance - be_pushcomptr(vm, ptr); // stack = instance, init_func, instance, ptr - be_call(vm, 2); // stack = instance, ret, instance, ptr - be_pop(vm, 3); // stack = instance - } - - extern void berry_log_C(const char * berry_buf, ...); - // Create a class given a global name or a name within a module - // Case 1: (no dot in name) `lv_wifi_bars` will look for a global variable `lv_wifi_bars` - // Case 2: (dot in name) `lvgl.lv_obj` will import `lvgl` and look for `lv_obj` within this module - // returns true if successful and result is top of stack, or false if not found and `nil` is at top of stack - bbool be_find_class(bvm *vm, const char * cl_name); - bbool be_find_class(bvm *vm, const char * cl_name) { - char *saveptr; - bbool ret = false; - - if (cl_name == NULL) { - be_pushnil(vm); - return ret; - } - // berry_log_C(">> be_find_class %s", cl_name); - char cl_name_buf[strlen(cl_name)+1]; - strcpy(cl_name_buf, cl_name); - - char * prefix = strtok_r(cl_name_buf, ".", &saveptr); - char * suffix = strtok_r(NULL, ".", &saveptr); - if (suffix) { - // berry_log_C(">> be_find_class %s - %s", prefix, suffix); - be_getmodule(vm, prefix); - ret = be_getmember(vm, -1, suffix); - // berry_log_C(">> be_find_class ret=%i", ret); - be_remove(vm, -2); - } else { - ret = be_getglobal(vm, prefix); - } - return ret; - } -} - -/*********************************************************************************************\ - * Binary search for dynamic attributes - * - * Names need to be sorted -\*********************************************************************************************/ -// binary search within an array of sorted strings -// the first 4 bytes are a pointer to a string -// returns 0..total_elements-1 or -1 if not found -// -// This version skips the first character of the string if it's not a letter, -// the first character is used to indicate the type of the value associated to the key -extern "C" { - int32_t bin_search(const char * needle, const void * table, size_t elt_size, size_t total_elements); - int32_t bin_search(const char * needle, const void * table, size_t elt_size, size_t total_elements) { - int32_t low = 0; - int32_t high = total_elements - 1; - int32_t mid = (low + high) / 2; - // start a dissect - while (low <= high) { - const char * elt = *(const char **) ( ((uint8_t*)table) + mid * elt_size ); - char first_char = elt[0]; - if ( !(first_char >= 'a' && first_char <='z') && !(first_char >= 'A' && first_char <='Z') ) { - elt++; // skip first char - } - int32_t comp = strcmp(needle, elt); - if (comp < 0) { - high = mid - 1; - } else if (comp > 0) { - low = mid + 1; - } else { - break; - } - mid = (low + high) / 2; - } - if (low <= high) { - return mid; - } else { - return -1; - } - } -} - -/*********************************************************************************************\ - * Generalized callbacks - * - * Warning, the following expect all parameters to be 32 bits wide -\*********************************************************************************************/ - -/*********************************************************************************************\ - * Automatically parse Berry stack and call the C function accordingly - * - * This function takes the n incoming arguments and pushes them as arguments - * on the stack for the C function: - * - be_int -> int32_t - * - be_bool -> int32_t with value 0/1 - * - be_string -> const char * - * - be_instance -> gets the member "_p" and pushes as void* - * - * This works because C silently ignores any unwanted arguments. - * There is a strong requirements that all ints and pointers are 32 bits. - * Float is not supported but could be added. Double cannot be supported because they are 64 bits - * - * Optional argument: - * - return_type: the C function return value is int32_t and is converted to the - * relevant Berry object depending on this char: - * '' (default): nil, no value - * 'i' be_int - * 'b' be_bool - * 's' be_str - * - * - arg_type: optionally check the types of input arguments, or throw an error - * string of argument types, '+' marks optional arguments - * '.' don't care - * 'i' be_int - * 'b' be_bool - * 's' be_string - * 'c' C callback - * 'lv_obj' be_instance of type or subtype - * '^lv_event_cb' callback of a named class - will call `_lvgl.gen_cb(arg_type, closure, self, lv native pointer)` and expects a callback address in return - * - * Ex: "oii+s" takes 3 mandatory arguments (obj_instance, int, int) and an optional fourth one [,string] -\*********************************************************************************************/ -// general form of lv_obj_t* function, up to 4 parameters -// We can only send 32 bits arguments (no 64 bits nor double) and we expect pointers to be 32 bits - -#define LVBE_LVGL_GLOB "_lvgl" -#define LVBE_LVGL_CB_GEN "gen_cb" - -// read a single value at stack position idx, convert to int. -// if object instance, get `_p` member and convert it recursively -int32_t be_convert_single_elt(bvm *vm, int32_t idx, const char * arg_type = nullptr, void * lv_obj_cb = nullptr) { - int32_t ret = 0; - char provided_type = 0; - idx = be_absindex(vm, idx); // make sure we have an absolute index - - // berry_log_C(">> 0 idx=%i arg_type=%s", idx, arg_type ? arg_type : "NULL"); - if (arg_type == nullptr) { arg_type = "."; } // if no type provided, replace with wildchar - size_t arg_type_len = strlen(arg_type); - - // handle callbacks first, since a wrong parameter will always yield to a crash - if (arg_type_len > 1 && arg_type[0] == '^') { // it is a callback - arg_type++; // skip first character - if (be_isclosure(vm, idx)) { - be_getglobal(vm, LVBE_LVGL_GLOB); - be_getmethod(vm, -1, LVBE_LVGL_CB_GEN); - be_pushvalue(vm, -2); - be_remove(vm, -3); // stack contains method + instance - be_pushstring(vm, arg_type); - be_pushvalue(vm, idx); - be_pushvalue(vm, 1); - be_pushcomptr(vm, lv_obj_cb); - be_call(vm, 5); - const void * func = be_tocomptr(vm, -6); - be_pop(vm, 6); - - // berry_log_C("func=%p", func); - return (int32_t) func; - } else { - be_raise(vm, kTypeError, "Closure expected for callback type"); - } - } - - // first convert the value to int32 - if (be_isint(vm, idx)) { ret = be_toint(vm, idx); provided_type = 'i'; } - else if (be_isbool(vm, idx)) { ret = be_tobool(vm, idx); provided_type = 'b'; } - else if (be_isstring(vm, idx)) { ret = (int32_t) be_tostring(vm, idx); provided_type = 's'; } - else if (be_iscomptr(vm, idx)) { ret = (int32_t) be_tocomptr(vm, idx); provided_type = 'c'; } - - // check if simple type was a match - if (provided_type) { - 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_C("Unexpected argument type '%c', expected '%s'", provided_type, arg_type); - } - return ret; - } - - // non-simple type - if (be_isinstance(vm, idx)) { - // check if the instance is a subclass of `bytes()`` - be_getbuiltin(vm, "bytes"); // add "list" class - if (be_isderived(vm, idx)) { - be_pop(vm, 1); - be_getmember(vm, idx, "_buffer"); - be_pushvalue(vm, idx); - be_call(vm, 1); - int32_t ret = (int32_t) be_tocomptr(vm, -2); - be_pop(vm, 2); - return ret; - } else { - be_pop(vm, 1); - be_getmember(vm, idx, "_p"); - int32_t ret = be_convert_single_elt(vm, -1, nullptr); // recurse - be_pop(vm, 1); - - if (arg_type_len > 1) { - // Check type - be_classof(vm, idx); - bool class_found = be_find_class(vm, arg_type); - // Stack: class_of_idx, class_of_target (or nil) - if (class_found) { - if (!be_isderived(vm, -2)) { - berry_log_C("Unexpected class type '%s', expected '%s'", be_classname(vm, idx), arg_type); - } - } else { - berry_log_C("Unable to find class '%s' (%d)", arg_type, arg_type_len); - } - be_pop(vm, 2); - } else if (arg_type[0] != '.') { - berry_log_C("Unexpected instance type '%s', expected '%s'", be_classname(vm, idx), arg_type); - } - - return ret; - } - } else { - be_raise(vm, kTypeError, nullptr); - } - - return ret; -} - -extern "C" { - - /*********************************************************************************************\ - * Generalized virtual members for modules - * - * Takes a pointer to be_constint_t array and size - * Returns true if a match was found. In such case the result is on Berry stack - * - * Encoding depend on prefix (which is skipped when matching names): - * 1. `COLOR_WHITE` int value - * 3. `$SYMBOL_OK"` string pointer - * 4. `&seg7_font` comptr - \*********************************************************************************************/ - bool be_module_member(bvm *vm, const be_constint_t * definitions, size_t def_len); - bool be_module_member(bvm *vm, const be_constint_t * definitions, size_t def_len) { - int32_t argc = be_top(vm); // Get the number of arguments - if (argc == 1 && be_isstring(vm, 1)) { - const char * needle = be_tostring(vm, 1); - int32_t idx; - - idx = bin_search(needle, &definitions[0].name, sizeof(definitions[0]), def_len); - if (idx >= 0) { - // we did have a match - const char * key = definitions[idx].name; - switch (key[0]) { - // switch depending on the first char of the key, indicating the type - case '$': // string - be_pushstring(vm, (const char*) definitions[idx].value); - break; - case '&': // native function - be_pushntvfunction(vm, (bntvfunc) definitions[idx].value); - break; - default: // int - be_pushint(vm, definitions[idx].value); - break; - } - return true; - } - } - return false; - } } /*********************************************************************************************\ @@ -459,7 +110,6 @@ void BrTimeoutStart(void) { if (0 == berry.timeout) { berry.timeout = 1; // rare case when value accidentally computes to zero } - } void BrTimeoutYield(void) { diff --git a/tasmota/xdrv_52_3_berry_gpio.ino b/tasmota/xdrv_52_3_berry_gpio.ino index f694b6444..63f29c258 100644 --- a/tasmota/xdrv_52_3_berry_gpio.ino +++ b/tasmota/xdrv_52_3_berry_gpio.ino @@ -39,7 +39,7 @@ extern "C" { // virtual member int gp_member(bvm *vm); int gp_member(bvm *vm) { - if (be_module_member(vm, lv_gpio_constants, lv_gpio_constants_size)) { + if (be_const_member(vm, lv_gpio_constants, lv_gpio_constants_size)) { be_return(vm); } else { be_return_nil(vm); diff --git a/tasmota/xdrv_52_3_berry_light.ino b/tasmota/xdrv_52_3_berry_light.ino index 19aa3cfb6..89ba735e3 100644 --- a/tasmota/xdrv_52_3_berry_light.ino +++ b/tasmota/xdrv_52_3_berry_light.ino @@ -50,11 +50,11 @@ extern "C" { light_controller.calcLevels(channels); uint8_t bri = light_state.getBri(); - // map_insert_int(vm, "_devices_present", TasmotaGlobal.devices_present); - // map_insert_int(vm, "_light_device", Light.device); - // map_insert_int(vm, "_light_subtype", Light.subtype); - // map_insert_int(vm, "_light_multi", Light.pwm_multi_channels); - // map_insert_int(vm, "_light_linked", light_controller.isCTRGBLinked()); + // be_map_insert_int(vm, "_devices_present", TasmotaGlobal.devices_present); + // be_map_insert_int(vm, "_light_device", Light.device); + // be_map_insert_int(vm, "_light_subtype", Light.subtype); + // be_map_insert_int(vm, "_light_multi", Light.pwm_multi_channels); + // be_map_insert_int(vm, "_light_linked", light_controller.isCTRGBLinked()); if (!Light.pwm_multi_channels) { uint32_t subtype = Light.subtype; // virtual sub-type, for SO37 128 @@ -64,7 +64,7 @@ extern "C" { if (light_controller.isCTRGBLinked() && (light_num == 0)) { data_present = true; // valid combination if (subtype >= LST_RGBW) { - map_insert_str(vm, "colormode", (light_state.getColorMode() & LCM_RGB ? "rgb" : "ct")); + be_map_insert_str(vm, "colormode", (light_state.getColorMode() & LCM_RGB ? "rgb" : "ct")); } } if (!light_controller.isCTRGBLinked()) { @@ -83,33 +83,33 @@ extern "C" { if (data_present) { // see ResponseLightState() - map_insert_bool(vm, "power", bitRead(TasmotaGlobal.power, light_num + Light.device - 1)); - map_insert_int(vm, "bri", bri); + be_map_insert_bool(vm, "power", bitRead(TasmotaGlobal.power, light_num + Light.device - 1)); + be_map_insert_int(vm, "bri", bri); if (subtype >= LST_RGB) { uint16_t hue; uint8_t sat, bri; light_state.getHSB(&hue, &sat, &bri); - map_insert_int(vm, "hue", hue); - map_insert_int(vm, "sat", sat); + be_map_insert_int(vm, "hue", hue); + be_map_insert_int(vm, "sat", sat); } if ((LST_COLDWARM == subtype) || (LST_RGBW <= subtype)) { - map_insert_int(vm, "ct", light_state.getCT()); + be_map_insert_int(vm, "ct", light_state.getCT()); } if (subtype >= LST_RGB) { snprintf(s_rgb, sizeof(s_rgb), PSTR("%02X%02X%02X"), channels[0], channels[1], channels[2]); - map_insert_str(vm, "rgb", s_rgb); + be_map_insert_str(vm, "rgb", s_rgb); } if (subtype > LST_NONE) { - map_insert_list_uint8(vm, "channels", &channels[chanidx], subtype); + be_map_insert_list_uint8(vm, "channels", &channels[chanidx], subtype); } } } else { // Light.pwm_multi_channels if ((light_num >= 0) && (light_num < LST_MAX)) { data_present = true; - map_insert_bool(vm, "power", Light.power & (1 << light_num)); - map_insert_int(vm, "bri", Light.current_color[light_num]); - map_insert_list_uint8(vm, "channels", &channels[light_num], 1); + be_map_insert_bool(vm, "power", Light.power & (1 << light_num)); + be_map_insert_int(vm, "bri", Light.current_color[light_num]); + be_map_insert_list_uint8(vm, "channels", &channels[light_num], 1); } } diff --git a/tasmota/xdrv_52_3_berry_lvgl.ino b/tasmota/xdrv_52_3_berry_lvgl.ino index f0cba617a..f86ed7db7 100644 --- a/tasmota/xdrv_52_3_berry_lvgl.ino +++ b/tasmota/xdrv_52_3_berry_lvgl.ino @@ -23,7 +23,7 @@ #include #include "lvgl.h" -#include "be_lvgl.h" +#include "be_mapping.h" #include "be_ctypes.h" #include "Adafruit_LvGL_Glue.h" @@ -35,6 +35,8 @@ // Berry easy logging extern "C" { extern void berry_log_C(const char * berry_buf, ...); + extern const be_ntv_class_def_t lv_classes[]; + extern const size_t lv_classes_size; } extern Adafruit_LvGL_Glue * glue; @@ -99,80 +101,6 @@ LVBE_globals lvbe; extern void start_lvgl(const char * uconfig); extern void lv_ex_get_started_1(void); -/*********************************************************************************************\ - * Calling any LVGL function with auto-mapping - * -\*********************************************************************************************/ - -// check input parameters, and create callbacks if needed -// change values in place -// -// Format: -// - either a lowercase character encoding for a simple type -// - 'b': bool -// - 'i': int (int32_t) -// - 's': string (const char *) -// -// - a class name surroungded by parenthesis -// - '(lv_button)' -> lv_button class or derived -// - '[lv_event_cb]' -> callback type, still prefixed with '^' to mark that it is cb -// -void be_check_arg_type(bvm *vm, int32_t arg_start, int32_t argc, const char * arg_type, int32_t p[8]); -void be_check_arg_type(bvm *vm, int32_t arg_start, int32_t argc, const char * arg_type, int32_t p[8]) { - bool arg_type_check = (arg_type != nullptr); // is type checking activated - int32_t arg_idx = 0; // position in arg_type string - char type_short_name[32]; - - for (uint32_t i = 0; i < argc; i++) { - type_short_name[0] = 0; // clear string - // extract individual type - if (nullptr != arg_type) { - switch (arg_type[arg_idx]) { - case '.': - case 'a'...'z': - type_short_name[0] = arg_type[arg_idx]; - type_short_name[1] = 0; - arg_idx++; - break; - case '(': - case '^': - { - uint32_t prefix = 0; - if (arg_type[arg_idx] == '^') { - type_short_name[0] = '^'; - type_short_name[1] = 0; - prefix = 1; - } - uint32_t offset = 0; - arg_idx++; - while (arg_type[arg_idx + offset] != ')' && arg_type[arg_idx + offset] != '^' && arg_type[arg_idx + offset] != 0 && offset+prefix+1 < sizeof(type_short_name)) { - type_short_name[offset+prefix] = arg_type[arg_idx + offset]; - type_short_name[offset+prefix+1] = 0; - offset++; - } - if (arg_type[arg_idx + offset] == 0) { - arg_type = nullptr; // no more parameters, stop iterations - } - arg_idx += offset + 1; - } - break; - case 0: - arg_type = nullptr; // stop iterations - break; - } - } - // AddLog(LOG_LEVEL_INFO, ">> be_call_c_func arg %i, type %s", i, arg_type_check ? type_short_name : ""); - p[i] = be_convert_single_elt(vm, i + arg_start, arg_type_check ? type_short_name : nullptr, (void*) p[0]); - } - - // check if we are missing arguments - if (arg_type != nullptr && arg_type[arg_idx] != 0) { - berry_log_C("Missing arguments, remaining type '%s'", &arg_type[arg_idx]); - } -} - -typedef int32_t (*fn_any_callable)(int32_t p0, int32_t p1, int32_t p2, int32_t p3, - int32_t p4, int32_t p5, int32_t p6, int32_t p7); extern "C" { void lv_init_set_member(bvm *vm, int index, void * ptr); @@ -205,15 +133,15 @@ extern "C" { // berry_log_C("lvx_member looking for method '%s' of class '%s'", method_name, class_name); // look for class descriptor - int32_t class_idx = bin_search(class_name, &lv_classes[0].name, sizeof(lv_classes[0]), lv_classes_size); + int32_t class_idx = be_map_bin_search(class_name, &lv_classes[0].name, sizeof(lv_classes[0]), lv_classes_size); if (class_idx >= 0) { - const lvbe_call_c_t * methods_calls = lv_classes[class_idx].func_table; + const be_ntv_func_def_t * methods_calls = lv_classes[class_idx].func_table; size_t methods_size = lv_classes[class_idx].size; - int32_t method_idx = bin_search(method_name, methods_calls, sizeof(lvbe_call_c_t), methods_size); + int32_t method_idx = be_map_bin_search(method_name, methods_calls, sizeof(be_ntv_func_def_t), methods_size); if (method_idx >= 0) { // method found - const lvbe_call_c_t * method = &methods_calls[method_idx]; + const be_ntv_func_def_t * method = &methods_calls[method_idx]; // berry_log_C("lvx_member method found func=%p return_type=%s arg_type=%s", method->func, method->return_type, method->arg_type); // push native closure be_pushntvclosure(vm, &lvx_call_c, 3); // 3 upvals @@ -245,63 +173,6 @@ extern "C" { } be_raise(vm, kTypeError, nullptr); } - - int be_call_c_func(bvm *vm, void * func, const char * return_type, const char * arg_type) { - // AddLog(LOG_LEVEL_INFO, ">> be_call_c_func, func=%p, return_type=%s, arg_type=%s", func, return_type ? return_type : "", arg_type ? arg_type : ""); - int32_t p[8] = {0,0,0,0,0,0,0,0}; - int32_t argc = be_top(vm); // Get the number of arguments - - // the following describe the active payload for the C function (start and count) - // this is because the `init()` constructor first arg is not passed to the C function - int32_t arg_start = 1; // start with standard values - int32_t arg_count = argc; - - // check if we call a constructor, in this case we store the return type into the new object - // check if we call a constructor with a comptr as first arg - if (return_type && return_type[0] == '+') { - if (argc > 1 && be_iscomptr(vm, 2)) { - lv_obj_t * obj = (lv_obj_t*) be_tocomptr(vm, 2); - lv_init_set_member(vm, 1, obj); - be_return_nil(vm); - } else { - // we need to discard the first arg - arg_start++; - arg_count--; - } - } - - fn_any_callable f = (fn_any_callable) func; - // AddLog(LOG_LEVEL_INFO, ">> before be_check_arg_type argc=%i - %i", arg_count, arg_start); - be_check_arg_type(vm, arg_start, arg_count, arg_type, p); - // AddLog(LOG_LEVEL_INFO, ">> be_call_c_func(%p) - %p,%p,%p,%p,%p - %s", f, p[0], p[1], p[2], p[3], p[4], return_type ? return_type : "NULL"); - int32_t ret = (*f)(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]); - // AddLog(LOG_LEVEL_INFO, ">> be_call_c_func, ret = %p", ret); - if ((return_type == nullptr) || (strlen(return_type) == 0)) { be_return_nil(vm); } // does not return - else if (return_type[0] == '+') { - lv_obj_t * obj = (lv_obj_t*) ret; - lv_init_set_member(vm, 1, obj); - be_return_nil(vm); - } - else if (strlen(return_type) == 1) { - switch (return_type[0]) { - case '.': // fallback next - case 'i': be_pushint(vm, ret); break; - case 'b': be_pushbool(vm, ret); break; - case 's': be_pushstring(vm, (const char*) ret); break; - case 'c': be_pushint(vm, ret); break; // TODO missing 'c' general callback type - default: be_raise(vm, "internal_error", "Unsupported return type"); break; - } - be_return(vm); - } else { // class name - // AddLog(LOG_LEVEL_INFO, ">> be_call_c_func, create_obj ret=%i return_type=%s", ret, return_type); - be_find_class(vm, return_type); - be_pushcomptr(vm, (void*) ret); // stack = class, ptr - be_pushcomptr(vm, (void*) -1); // stack = class, ptr, -1 - be_call(vm, 2); // instanciate with 2 arguments, stack = instance, -1, ptr - be_pop(vm, 2); // stack = instance - be_return(vm); - } - } } /*********************************************************************************************\ @@ -396,7 +267,7 @@ extern "C" { typedef lv_obj_t* (*fn_lvobj__void)(void); // f() -> newly created lv_obj() int lv0_lvobj__void_call(bvm *vm, fn_lvobj__void func) { lv_obj_t * obj = (*func)(); - be_find_class(vm, "lv.lv_obj"); + be_find_global_or_module_member(vm, "lv.lv_obj"); be_pushcomptr(vm, (void*) -1); // stack = class, -1 be_pushcomptr(vm, (void*) obj); // stack = class, -1, ptr be_call(vm, 2); // instanciate, stack = instance (don't call init() ) @@ -413,7 +284,7 @@ extern "C" { if (argc == 1 && be_isstring(vm, 1)) { lv_font_t * font = lv_font_load(be_tostring(vm, 1)); if (font != nullptr) { - be_find_class(vm, "lv.lv_font"); + be_find_global_or_module_member(vm, "lv.lv_font"); be_pushcomptr(vm, font); be_call(vm, 1); be_pop(vm, 1); @@ -441,7 +312,7 @@ extern "C" { lv_font_t * font = info.font; if (font != nullptr) { - be_find_class(vm, "lv.lv_font"); + be_find_global_or_module_member(vm, "lv.lv_font"); be_pushcomptr(vm, font); be_call(vm, 1); be_pop(vm, 1); @@ -637,7 +508,7 @@ extern "C" { be_raisef(vm, "value_error", "unknown font size '%s-%i'", name, size); } - be_find_class(vm, "lv.lv_font"); + be_find_global_or_module_member(vm, "lv.lv_font"); be_pushcomptr(vm, (void*)font_entry->font); be_call(vm, 1); be_pop(vm, 1); @@ -674,10 +545,10 @@ extern "C" { * Responds to virtual constants \*********************************************************************************************/ - extern const lvbe_call_c_t lv_func[]; + extern const be_ntv_func_def_t lv_func[]; extern const size_t lv_func_size; - extern const be_constint_t lv0_constants[]; + extern const be_const_member_t lv0_constants[]; extern const size_t lv0_constants_size; extern const be_ctypes_class_by_name_t be_ctypes_lvgl_classes[]; @@ -686,7 +557,7 @@ extern "C" { int lv0_member(bvm *vm); int lv0_member(bvm *vm) { // first try the standard way - if (be_module_member(vm, lv0_constants, lv0_constants_size)) { + if (be_const_member(vm, lv0_constants, lv0_constants_size)) { be_return(vm); } // try alternative members @@ -698,9 +569,9 @@ extern "C" { // search for a class with this name char cl_prefixed[32]; snprintf(cl_prefixed, sizeof(cl_prefixed), "lv_%s", needle); // we try both actual name and prefixed with `lv_` so both `lv.obj` and `lv.lv_obj` work - idx = bin_search(cl_prefixed, &lv_classes[0].name, sizeof(lv_classes[0]), lv_classes_size); + idx = be_map_bin_search(cl_prefixed, &lv_classes[0].name, sizeof(lv_classes[0]), lv_classes_size); if (idx < 0) { - idx = bin_search(needle, &lv_classes[0].name, sizeof(lv_classes[0]), lv_classes_size); + idx = be_map_bin_search(needle, &lv_classes[0].name, sizeof(lv_classes[0]), lv_classes_size); } if (idx >= 0) { // we did have a match @@ -708,9 +579,9 @@ extern "C" { be_return(vm); } // same search for ctypes - idx = bin_search(cl_prefixed, &be_ctypes_lvgl_classes[0].name, sizeof(be_ctypes_lvgl_classes[0]), be_ctypes_lvgl_classes_size); + idx = be_map_bin_search(cl_prefixed, &be_ctypes_lvgl_classes[0].name, sizeof(be_ctypes_lvgl_classes[0]), be_ctypes_lvgl_classes_size); if (idx < 0) { - idx = bin_search(needle, &be_ctypes_lvgl_classes[0].name, sizeof(be_ctypes_lvgl_classes[0]), be_ctypes_lvgl_classes_size); + idx = be_map_bin_search(needle, &be_ctypes_lvgl_classes[0].name, sizeof(be_ctypes_lvgl_classes[0]), be_ctypes_lvgl_classes_size); } if (idx >= 0) { // we did have a match @@ -719,9 +590,9 @@ extern "C" { } // search for a method with this name - idx = bin_search(needle, &lv_func[0].name, sizeof(lv_func[0]), lv_func_size); + idx = be_map_bin_search(needle, &lv_func[0].name, sizeof(lv_func[0]), lv_func_size); if (idx >= 0) { - const lvbe_call_c_t * method = &lv_func[idx]; + const be_ntv_func_def_t * method = &lv_func[idx]; // push native closure be_pushntvclosure(vm, &lvx_call_c, 3); // 3 upvals @@ -803,7 +674,7 @@ extern "C" { lv_indev_t * indev = lv_indev_drv_register(&lvbe.indev_drv); lvbe.indev_list.addHead(indev); // keep track of indevs - be_find_class(vm, "lv.lv_indev"); + be_find_global_or_module_member(vm, "lv.lv_indev"); be_pushint(vm, (int32_t) indev); be_call(vm, 1); be_pop(vm, 1); @@ -859,7 +730,7 @@ extern "C" { void * obj = nullptr; int argc = be_top(vm); if (argc > 1) { - obj = (void*) be_convert_single_elt(vm, 2); + obj = (void*) be_convert_single_elt(vm, 2, NULL, NULL); } lv_init_set_member(vm, 1, obj); be_return_nil(vm); @@ -885,7 +756,7 @@ extern "C" { lv_style_t * style = nullptr; if (argc > 1) { - style = (lv_style_t*) be_convert_single_elt(vm, 2); + style = (lv_style_t*) be_convert_single_elt(vm, 2, NULL, NULL); } if (style == nullptr) { style = (lv_style_t*) be_malloc(vm, sizeof(lv_style_t)); diff --git a/tasmota/xdrv_52_3_berry_tasmota.ino b/tasmota/xdrv_52_3_berry_tasmota.ino index a9d0ad734..fdff25f1e 100644 --- a/tasmota/xdrv_52_3_berry_tasmota.ino +++ b/tasmota/xdrv_52_3_berry_tasmota.ino @@ -181,10 +181,10 @@ extern "C" { int32_t top = be_top(vm); // Get the number of arguments if (top == 1) { // no argument (instance only) be_newobject(vm, "map"); - map_insert_int(vm, "utc", Rtc.utc_time); - map_insert_int(vm, "local", Rtc.local_time); - map_insert_int(vm, "restart", Rtc.restart_time); - map_insert_int(vm, "timezone", Rtc.time_timezone); + be_map_insert_int(vm, "utc", Rtc.utc_time); + be_map_insert_int(vm, "local", Rtc.local_time); + be_map_insert_int(vm, "restart", Rtc.restart_time); + be_map_insert_int(vm, "timezone", Rtc.time_timezone); be_pop(vm, 1); be_return(vm); } @@ -198,14 +198,14 @@ extern "C" { int32_t top = be_top(vm); // Get the number of arguments if (top == 1) { // no argument (instance only) be_newobject(vm, "map"); - map_insert_int(vm, "flash", ESP.getFlashChipSize() / 1024); - map_insert_int(vm, "program", ESP_getSketchSize() / 1024); - map_insert_int(vm, "program_free", ESP.getFreeSketchSpace() / 1024); - map_insert_int(vm, "heap_free", ESP_getFreeHeap() / 1024); - map_insert_int(vm, "frag", ESP_getHeapFragmentation()); + be_map_insert_int(vm, "flash", ESP.getFlashChipSize() / 1024); + be_map_insert_int(vm, "program", ESP_getSketchSize() / 1024); + be_map_insert_int(vm, "program_free", ESP.getFreeSketchSpace() / 1024); + be_map_insert_int(vm, "heap_free", ESP_getFreeHeap() / 1024); + be_map_insert_int(vm, "frag", ESP_getHeapFragmentation()); if (UsePSRAM()) { - map_insert_int(vm, "psram", ESP.getPsramSize() / 1024); - map_insert_int(vm, "psram_free", ESP.getFreePsram() / 1024); + be_map_insert_int(vm, "psram", ESP.getPsramSize() / 1024); + be_map_insert_int(vm, "psram_free", ESP.getFreePsram() / 1024); } be_pop(vm, 1); be_return(vm); @@ -222,17 +222,17 @@ extern "C" { be_newobject(vm, "map"); if (Settings->flag4.network_wifi) { int32_t rssi = WiFi.RSSI(); - map_insert_int(vm, "rssi", rssi); - map_insert_int(vm, "quality", WifiGetRssiAsQuality(rssi)); + be_map_insert_int(vm, "rssi", rssi); + be_map_insert_int(vm, "quality", WifiGetRssiAsQuality(rssi)); #if LWIP_IPV6 String ipv6_addr = WifiGetIPv6(); if (ipv6_addr != "") { - map_insert_str(vm, "ip6", ipv6_addr.c_str()); + be_map_insert_str(vm, "ip6", ipv6_addr.c_str()); } #endif if (static_cast(WiFi.localIP()) != 0) { - map_insert_str(vm, "mac", WiFi.macAddress().c_str()); - map_insert_str(vm, "ip", WiFi.localIP().toString().c_str()); + be_map_insert_str(vm, "mac", WiFi.macAddress().c_str()); + be_map_insert_str(vm, "ip", WiFi.localIP().toString().c_str()); } } be_pop(vm, 1); @@ -250,8 +250,8 @@ extern "C" { be_newobject(vm, "map"); #ifdef USE_ETHERNET if (static_cast(EthernetLocalIP()) != 0) { - map_insert_str(vm, "mac", EthernetMacAddress().c_str()); - map_insert_str(vm, "ip", EthernetLocalIP().toString().c_str()); + be_map_insert_str(vm, "mac", EthernetMacAddress().c_str()); + be_map_insert_str(vm, "ip", EthernetLocalIP().toString().c_str()); } #endif be_pop(vm, 1); @@ -262,14 +262,14 @@ extern "C" { static void l_push_time(bvm *vm, struct tm *t, const char *unparsed) { be_newobject(vm, "map"); - map_insert_int(vm, "year", t->tm_year + 1900); - map_insert_int(vm, "month", t->tm_mon + 1); - map_insert_int(vm, "day", t->tm_mday); - map_insert_int(vm, "hour", t->tm_hour); - map_insert_int(vm, "min", t->tm_min); - map_insert_int(vm, "sec", t->tm_sec); - map_insert_int(vm, "weekday", t->tm_wday); - if (unparsed) map_insert_str(vm, "unparsed", unparsed); + be_map_insert_int(vm, "year", t->tm_year + 1900); + be_map_insert_int(vm, "month", t->tm_mon + 1); + be_map_insert_int(vm, "day", t->tm_mday); + be_map_insert_int(vm, "hour", t->tm_hour); + be_map_insert_int(vm, "min", t->tm_min); + be_map_insert_int(vm, "sec", t->tm_sec); + be_map_insert_int(vm, "weekday", t->tm_wday); + if (unparsed) be_map_insert_str(vm, "unparsed", unparsed); be_pop(vm, 1); } @@ -332,27 +332,14 @@ extern "C" { // ESP object int32_t l_yield(bvm *vm); int32_t l_yield(bvm *vm) { - BrTimeoutYield(); // reset timeout - be_return_nil(vm); + return be_call_c_func(vm, (void*) &BrTimeoutYield, NULL, "-"); } // Berry: tasmota.scale_uint(int * 5) -> int // int32_t l_scaleuint(struct bvm *vm); int32_t l_scaleuint(struct bvm *vm) { - int32_t top = be_top(vm); // Get the number of arguments - if (top == 6 && be_isint(vm, 2) && be_isint(vm, 3) && be_isint(vm, 4) && be_isint(vm, 5) && be_isint(vm, 6)) { // only 1 argument of type string accepted - int32_t v = be_toint(vm, 2); - int32_t from1 = be_toint(vm, 3); - int32_t from2 = be_toint(vm, 4); - int32_t to1 = be_toint(vm, 5); - int32_t to2 = be_toint(vm, 6); - - int32_t ret = changeUIntScale(v, from1, from2, to1, to2); - be_pushint(vm, ret); - be_return(vm); - } - be_raise(vm, kTypeError, nullptr); + return be_call_c_func(vm, (void*) &changeUIntScale, "i", "-iiiii"); } int32_t l_respCmnd(bvm *vm); @@ -379,20 +366,17 @@ extern "C" { int32_t l_respCmndDone(bvm *vm); int32_t l_respCmndDone(bvm *vm) { - ResponseCmndDone(); - be_return_nil(vm); + return be_call_c_func(vm, (void*) &ResponseCmndDone, NULL, "-"); } int32_t l_respCmndError(bvm *vm); int32_t l_respCmndError(bvm *vm) { - ResponseCmndError(); - be_return_nil(vm); + return be_call_c_func(vm, (void*) &ResponseCmndError, NULL, "-"); } int32_t l_respCmndFailed(bvm *vm); int32_t l_respCmndFailed(bvm *vm) { - ResponseCmndFailed(); - be_return_nil(vm); + return be_call_c_func(vm, (void*) &ResponseCmndFailed, NULL, "-"); } // update XdrvMailbox.command with actual command diff --git a/tasmota/xdrv_52_3_berry_webclient.ino b/tasmota/xdrv_52_3_berry_webclient.ino index 5c1700ebf..625c54622 100644 --- a/tasmota/xdrv_52_3_berry_webclient.ino +++ b/tasmota/xdrv_52_3_berry_webclient.ino @@ -57,7 +57,7 @@ String wc_UrlEncode(const String& text) { /*********************************************************************************************\ * Int constants *********************************************************************************************/ -// const be_constint_t webserver_constants[] = { +// const be_const_member_t webserver_constants[] = { // { "BUTTON_CONFIGURATION", BUTTON_CONFIGURATION }, // { "BUTTON_INFORMATION", BUTTON_INFORMATION }, // { "BUTTON_MAIN", BUTTON_MAIN }, diff --git a/tasmota/xdrv_52_3_berry_webserver.ino b/tasmota/xdrv_52_3_berry_webserver.ino index 2faa223ba..00f260d5a 100644 --- a/tasmota/xdrv_52_3_berry_webserver.ino +++ b/tasmota/xdrv_52_3_berry_webserver.ino @@ -27,7 +27,7 @@ /*********************************************************************************************\ * Int constants *********************************************************************************************/ -const be_constint_t webserver_constants[] = { +const be_const_member_t webserver_constants[] = { { "BUTTON_CONFIGURATION", BUTTON_CONFIGURATION }, { "BUTTON_INFORMATION", BUTTON_INFORMATION }, { "BUTTON_MAIN", BUTTON_MAIN }, @@ -51,7 +51,7 @@ extern "C" { if (argc == 1 && be_isstring(vm, 1)) { const char * needle = be_tostring(vm, 1); - int32_t constant_idx = bin_search(needle, &webserver_constants[0].name, sizeof(webserver_constants[0]), ARRAY_SIZE(webserver_constants)); + int32_t constant_idx = be_map_bin_search(needle, &webserver_constants[0].name, sizeof(webserver_constants[0]), ARRAY_SIZE(webserver_constants)); if (constant_idx >= 0) { // we did have a match, low == high diff --git a/tools/lv_berry/convert.py b/tools/lv_berry/convert.py index a814af381..86a4b86d4 100644 --- a/tools/lv_berry/convert.py +++ b/tools/lv_berry/convert.py @@ -320,13 +320,14 @@ extern "C" { #endif #include "be_ctypes.h" +#include "be_mapping.h" """) for subtype, flv in lv.items(): print(f"/* `lv_{subtype}` methods */") if subtype in lv_widgets: print(f"#ifdef BE_LV_WIDGET_{subtype.upper()}") - print(f"const lvbe_call_c_t lv_{subtype}_func[] = {{") + print(f"const be_ntv_func_def_t lv_{subtype}_func[] = {{") func_out = {} # used to sort output for f in flv: @@ -361,7 +362,7 @@ print() # print the global map of classes print(f""" // map of clases -const lvbe_call_c_classes_t lv_classes[] = {{""") +const be_ntv_class_def_t lv_classes[] = {{""") for subtype in sorted(lv): # for subtype, flv in lv.items(): @@ -391,7 +392,7 @@ for subtype, flv in lv.items(): if len(c_ret_type) > 1: c_ret_type = "lv." + c_ret_type if c_func_name.endswith("_create"): - c_ret_type = "+" # constructor, init method does not return any value + c_ret_type = "+_p" # constructor, init method does not return any value if subtype in lv_widgets: print(f"#ifdef BE_LV_WIDGET_{subtype.upper()}") print(f" int be_ntv_lv_{subtype}_init(bvm *vm) {{ return be_call_c_func(vm, (void*) &{orig_func_name}, \"{c_ret_type}\", { c_argc if c_argc else 'nullptr'}); }}") @@ -401,8 +402,8 @@ for subtype, flv in lv.items(): print(""" // create font either empty or from parameter on stack -int lvbe_font_create(bvm *vm) { return be_call_c_func(vm, NULL, "+lv_font", ""); } -int lvbe_theme_create(bvm *vm) { return be_call_c_func(vm, NULL, "+lv_theme", ""); } +int lvbe_font_create(bvm *vm) { return be_call_c_func(vm, NULL, "+_p", ""); } +int lvbe_theme_create(bvm *vm) { return be_call_c_func(vm, NULL, "+_p", ""); } """) print() @@ -660,7 +661,7 @@ print("""/******************************************************************** #ifdef USE_LVGL #include "lvgl.h" -#include "be_lvgl.h" +#include "be_mapping.h" #include "lv_theme_openhasp.h" extern int lv0_member(bvm *vm); // resolve virtual members @@ -685,7 +686,7 @@ static int lv_get_ver_res(void) { } /* `lv` methods */ -const lvbe_call_c_t lv_func[] = { +const be_ntv_func_def_t lv_func[] = { """) func_out = {} # used to sort output @@ -728,12 +729,7 @@ const size_t lv_func_size = sizeof(lv_func) / sizeof(lv_func[0]); print(""" -typedef struct be_constint_t { - const char * name; - int32_t value; -} be_constint_t; - -const be_constint_t lv0_constants[] = { +const be_const_member_t lv0_constants[] = { """) lv_module2 = {} diff --git a/tools/lv_gpio/gpio_convert.py b/tools/lv_gpio/gpio_convert.py index dfa3d78f0..6232fd287 100644 --- a/tools/lv_gpio/gpio_convert.py +++ b/tools/lv_gpio/gpio_convert.py @@ -56,7 +56,7 @@ print(" * Generated code, don't edit") print(" *******************************************************************/") print(""" -const be_constint_t lv_gpio_constants[] = { +const be_const_member_t lv_gpio_constants[] = { """) lv_module2 = {}