From e0f9154986236b9f87d719b61e27d4deb426a8cb Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Mon, 12 Sep 2022 22:02:25 +0200 Subject: [PATCH] Berry automated solidification of code --- .gitignore | 1 + CHANGELOG.md | 1 + lib/libesp32/berry/Makefile | 6 +- lib/libesp32/berry/default/be_modtab.c | 7 +- lib/libesp32/berry/default/be_port.c | 410 +++ .../src => berry/default}/be_re_lib.c | 121 +- lib/libesp32/berry/default/berry.c | 372 +++ lib/libesp32/berry/default/berry_conf.h | 50 +- lib/libesp32/berry/tools/coc/coc | 2 +- lib/libesp32/berry_tasmota/path.be | 2 + lib/libesp32/berry_tasmota/solidify_all.be | 81 + .../berry_tasmota/src/be_animate_lib.c | 707 +---- .../berry_tasmota/src/be_autoconf_lib.c | 1389 +-------- lib/libesp32/berry_tasmota/src/be_driverlib.c | 95 +- lib/libesp32/berry_tasmota/src/be_leds_lib.c | 1910 +----------- .../{Animate.be => animate_module.be} | 1 + .../{autoconf.be => autoconf_module.be} | 3 + .../embedded/{Driver.be => driver_class.be} | 1 + .../berry_tasmota/src/embedded/leds.be | 1 + .../embedded/{Tasmota.be => tasmota_class.be} | 2 + lib/libesp32/berry_tasmota/src/solidify/.keep | 0 .../src/solidify/solidified_animate_module.h | 712 +++++ .../src/solidify/solidified_autoconf_module.h | 1393 +++++++++ .../src/solidify/solidified_driver_class.h | 100 + .../src/solidify/solidified_leds.h | 1915 ++++++++++++ .../src/solidify/solidified_tasmota_class.h | 2733 +++++++++++++++++ lib/libesp32/re1.5/util.c | 5 +- pio-tools/gen-berry-structures.py | 2 +- 28 files changed, 7861 insertions(+), 4161 deletions(-) create mode 100644 lib/libesp32/berry/default/be_port.c rename lib/libesp32/{berry_tasmota/src => berry/default}/be_re_lib.c (71%) create mode 100644 lib/libesp32/berry/default/berry.c mode change 100644 => 100755 lib/libesp32/berry/tools/coc/coc create mode 100644 lib/libesp32/berry_tasmota/path.be create mode 100755 lib/libesp32/berry_tasmota/solidify_all.be rename lib/libesp32/berry_tasmota/src/embedded/{Animate.be => animate_module.be} (99%) rename lib/libesp32/berry_tasmota/src/embedded/{autoconf.be => autoconf_module.be} (99%) rename lib/libesp32/berry_tasmota/src/embedded/{Driver.be => driver_class.be} (96%) rename lib/libesp32/berry_tasmota/src/embedded/{Tasmota.be => tasmota_class.be} (99%) create mode 100644 lib/libesp32/berry_tasmota/src/solidify/.keep create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_animate_module.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_autoconf_module.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_driver_class.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_leds.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h diff --git a/.gitignore b/.gitignore index df3dbb91d..22f113ae2 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ tasmota/tasmota.ino.cpp platformio_override.ini platformio_tasmota_cenv.ini lib/libesp32/berry/generate/* +lib/libesp32/berry/berry ## Visual Studio Code specific ###### .vscode diff --git a/CHANGELOG.md b/CHANGELOG.md index 09350b64f..38b7ce313 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. ## [12.1.1.2] ### Added - Berry has persistent MQTT subscriptions: auto-subscribe at (re)connection +- Berry automated solidification of code ### Changed diff --git a/lib/libesp32/berry/Makefile b/lib/libesp32/berry/Makefile index 2b2f3ad8f..0847eb4b2 100755 --- a/lib/libesp32/berry/Makefile +++ b/lib/libesp32/berry/Makefile @@ -1,4 +1,4 @@ -CFLAGS = -Wall -Wextra -std=c99 -pedantic-errors -O2 +CFLAGS = -Wall -Wextra -std=c99 -O2 -Wno-zero-length-array -Wno-empty-translation-unit DEBUG_FLAGS = -O0 -g -DBE_DEBUG TEST_FLAGS = $(DEBUG_FLAGS) --coverage -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined LIBS = -lm @@ -7,8 +7,8 @@ CC = gcc MKDIR = mkdir LFLAGS = -INCPATH = src default -SRCPATH = src default +INCPATH = src default ../re1.5 +SRCPATH = src default ../re1.5 GENERATE = generate CONFIG = default/berry_conf.h COC = tools/coc/coc diff --git a/lib/libesp32/berry/default/be_modtab.c b/lib/libesp32/berry/default/be_modtab.c index e0ccdc136..672512de6 100644 --- a/lib/libesp32/berry/default/be_modtab.c +++ b/lib/libesp32/berry/default/be_modtab.c @@ -25,7 +25,6 @@ be_extern_native_module(strict); be_extern_native_module(undefined); /* Berry extensions */ -#include "be_mapping.h" be_extern_native_module(cb); /* Tasmota specific */ @@ -111,13 +110,14 @@ BERRY_LOCAL const bntvmodule* const be_module_table[] = { #endif &be_native_module(undefined), + &be_native_module(re), +#ifdef TASMOTA /* 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(mqtt), &be_native_module(persist), @@ -173,6 +173,7 @@ BERRY_LOCAL const bntvmodule* const be_module_table[] = { &be_native_module(MI32), &be_native_module(BLE), #endif //USE_MI_ESP32 +#endif // TASMOTA /* user-defined modules register end */ NULL /* do not remove */ }; @@ -224,6 +225,7 @@ be_extern_native_class(lv_clock_icon); be_extern_native_class(int64); BERRY_LOCAL bclass_array be_class_table = { +#ifdef TASMOTA /* first list are direct classes */ &be_native_class(tasmota), &be_native_class(Trigger), @@ -290,6 +292,7 @@ BERRY_LOCAL bclass_array be_class_table = { #ifdef USE_BERRY_INT64 &be_native_class(int64), #endif +#endif // TASMOTA NULL, /* do not remove */ }; diff --git a/lib/libesp32/berry/default/be_port.c b/lib/libesp32/berry/default/be_port.c new file mode 100644 index 000000000..6d26bd8dd --- /dev/null +++ b/lib/libesp32/berry/default/be_port.c @@ -0,0 +1,410 @@ +/******************************************************************** +** 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 TASMOTA // only when compiling stand-along + +#include "berry.h" +#include "be_mem.h" +#include "be_sys.h" +#include +#include + +/* this file contains configuration for the file system. */ + +/* standard input and output */ + +BERRY_API void be_writebuffer(const char *buffer, size_t length) +{ + be_fwrite(stdout, buffer, length); +} + +BERRY_API char* be_readstring(char *buffer, size_t size) +{ + return be_fgets(stdin, buffer, (int)size); +} + +/* use the standard library implementation file API. */ +#if !defined(USE_FATFS) + +void* be_fopen(const char *filename, const char *modes) +{ + return fopen(filename, modes); +} + +int be_fclose(void *hfile) +{ + return fclose(hfile); +} + +size_t be_fwrite(void *hfile, const void *buffer, size_t length) +{ + return fwrite(buffer, 1, length, hfile); +} + +size_t be_fread(void *hfile, void *buffer, size_t length) +{ + return fread(buffer, 1, length, hfile); +} + +char* be_fgets(void *hfile, void *buffer, int size) +{ + return fgets(buffer, size, hfile); +} + +int be_fseek(void *hfile, long offset) +{ + return fseek(hfile, offset, SEEK_SET); +} + +long int be_ftell(void *hfile) +{ + return ftell(hfile); +} + +long int be_fflush(void *hfile) +{ + return fflush(hfile); +} + +size_t be_fsize(void *hfile) +{ + long int size, offset = be_ftell(hfile); + fseek(hfile, 0L, SEEK_END); + size = ftell(hfile); + fseek(hfile, offset, SEEK_SET); + return size; +} + +#else /* use the FatFs library implementation file API. */ + +#include "ff.h" + +#if FF_FS_RPATH != 2 + #error FatFs check (FF_FS_RPATH == 2) failed. +#endif + +#if FF_USE_STRFUNC < 1 + #error FatFs check (FF_USE_STRFUNC >= 1) failed. +#endif + +void* be_fopen(const char *filename, const char *modes) +{ + BYTE mode = 0; + FIL *fp = be_os_malloc(sizeof(FIL)); + + switch (modes[0]) { + case 'r': mode |= FA_READ; break; + case 'w': mode |= FA_CREATE_ALWAYS | FA_WRITE; break; + case 'a': mode |= FA_OPEN_APPEND | FA_WRITE; break; + default: return NULL; + } + switch (modes[1]) { + case '+': mode |= FA_READ | FA_WRITE; break; + case 't': + case 'b': + case '\0': break; + default: return NULL; + } + if (modes[1] && modes[2] == '+') { + mode |= FA_READ | FA_WRITE; + } + if (fp && f_open(fp, filename, mode) == FR_OK) { + return fp; + } + be_os_free(fp); + return NULL; +} + +int be_fclose(void *hfile) +{ + int res = f_close(hfile) != FR_OK; + be_os_free(hfile); + return res; +} + +size_t be_fwrite(void *hfile, const void *buffer, size_t length) +{ + UINT bw; + if (hfile == stdout || hfile == stderr || hfile == stdin) { + return fwrite(buffer, 1, length, hfile); + } + f_write(hfile, buffer, (UINT)length, &bw); + return bw; +} + +size_t be_fread(void *hfile, void *buffer, size_t length) +{ + UINT br; + if (hfile == stdout || hfile == stderr || hfile == stdin) { + return fread(buffer, 1, length, hfile); + } + f_read(hfile, buffer, (UINT)length, &br); + return br; +} + +char* be_fgets(void *hfile, void *buffer, int size) +{ + if (hfile == stdout || hfile == stderr || hfile == stdin) { + return fgets(buffer, size, hfile); + } + return f_gets(buffer, size, hfile); +} + +int be_fseek(void *hfile, long offset) +{ + return f_lseek(hfile, (FSIZE_t)offset); +} + +long int be_ftell(void *hfile) +{ + return f_tell(hfile); +} + +long int be_fflush(void *hfile) +{ + return f_sync(hfile); +} + +size_t be_fsize(void *hfile) +{ + return f_size(hfile); +} + +#endif /* !defined(USE_FATFS) */ + +#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 */ + +#endif // COMPILE_BERRY_LIB diff --git a/lib/libesp32/berry_tasmota/src/be_re_lib.c b/lib/libesp32/berry/default/be_re_lib.c similarity index 71% rename from lib/libesp32/berry_tasmota/src/be_re_lib.c rename to lib/libesp32/berry/default/be_re_lib.c index 971814a2d..f725b9559 100644 --- a/lib/libesp32/berry_tasmota/src/be_re_lib.c +++ b/lib/libesp32/berry/default/be_re_lib.c @@ -8,7 +8,7 @@ #include "be_constobj.h" #include "be_mem.h" #include "be_object.h" -#include "re1.5.h" +#include "../../re1.5/re1.5.h" /******************************************************************** # Berry skeleton for `re` module @@ -60,15 +60,17 @@ int be_re_compile(bvm *vm) { be_raise(vm, "type_error", NULL); } - -int be_re_match_search_run(bvm *vm, ByteProg *code, const char *hay, bbool is_anchored) { +// pushes either a list if matched, else `nil` +// return index of next offset, or -1 if not found +const char *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_pushnil(vm); + return NULL; // no match } be_newobject(vm, "list"); @@ -81,8 +83,8 @@ int be_re_match_search_run(bvm *vm, ByteProg *code, const char *hay, bbool is_an be_data_push(vm, -2); be_pop(vm, 1); } - be_pop(vm, 1); // remove list - be_return(vm); // return list object + be_pop(vm, 1); // remove list + return sub[1]; } int be_re_match_search(bvm *vm, bbool is_anchored) { @@ -100,7 +102,42 @@ int be_re_match_search(bvm *vm, bbool is_anchored) { if (ret != 0) { be_raise(vm, "internal_error", "error in regex"); } - return be_re_match_search_run(vm, code, hay, is_anchored); + be_re_match_search_run(vm, code, hay, is_anchored); + be_return(vm); + } + be_raise(vm, "type_error", NULL); +} + +int be_re_match_search_all(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 limit = -1; + if (argc >= 3) { + 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"); + } + + be_newobject(vm, "list"); + for (int i = limit; i != 0 && hay != NULL; i--) { + hay = be_re_match_search_run(vm, code, hay, is_anchored); + if (hay != NULL) { + be_data_push(vm, -2); // add sub list to list + } + be_pop(vm, 1); + } + be_pop(vm, 1); + be_return(vm); } be_raise(vm, "type_error", NULL); } @@ -114,6 +151,15 @@ int be_re_search(bvm *vm) { return be_re_match_search(vm, bfalse); } +// Berry: `re.search_all` +int be_re_match_all(bvm *vm) { + return be_re_match_search_all(vm, btrue); +} +// Berry: `re.search_all` +int be_re_search_all(bvm *vm) { + return be_re_match_search_all(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 @@ -121,7 +167,8 @@ int re_pattern_search(bvm *vm) { 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_re_match_search_run(vm, code, hay, bfalse); + be_return(vm); } be_raise(vm, "type_error", NULL); } @@ -133,7 +180,8 @@ int re_pattern_match(bvm *vm) { 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_re_match_search_run(vm, code, hay, btrue); + be_return(vm); } be_raise(vm, "type_error", NULL); } @@ -209,38 +257,25 @@ int be_re_split(bvm *vm) { 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)) -); -/*******************************************************************/ +#include "../generate/be_fixed_re.h" +#include "../generate/be_fixed_be_class_re_pattern.h" +/* +@const_object_info_begin +module re (scope: global) { + compile, func(be_re_compile) + search, func(be_re_search) + searchall, func(be_re_search_all) + match, func(be_re_match) + matchall, func(be_re_match_all) + split, func(be_re_split) +} +@const_object_info_end +@const_object_info_begin +class be_class_re_pattern (scope: global, name: re_pattern) { + _p, var + search, func(re_pattern_search) + match, func(re_pattern_match) + split, func(re_pattern_split) +} +@const_object_info_end */ diff --git a/lib/libesp32/berry/default/berry.c b/lib/libesp32/berry/default/berry.c new file mode 100644 index 000000000..8a63d8ea8 --- /dev/null +++ b/lib/libesp32/berry/default/berry.c @@ -0,0 +1,372 @@ +/******************************************************************** +** 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 TASMOTA // only when compiling stand-along + +#include "berry.h" +#include "be_repl.h" +#include "be_vm.h" +#include +#include +#include + +/* using GNU/readline library */ +#if defined(USE_READLINE_LIB) + #include + #include +#endif + +/* detect operating system name */ +#if defined(__linux) + #define OS_NAME "Linux" +#elif defined(__unix) + #define OS_NAME "Unix" +#elif defined(__APPLE__) + #define OS_NAME "Darwin" +#elif defined(_WIN32) + #define OS_NAME "Windows" +#else + #define OS_NAME "Unknown OS" +#endif + +/* detect compiler name and version */ +#if defined(__clang__) + #define COMPILER "clang " __clang_version__ +#elif defined(__GNUC__) + #define COMPILER "GCC " __VERSION__ +#elif defined(_MSC_VER) + #define COMPILER "MSVC" +#elif defined(__CC_ARM) + #define COMPILER "ARMCC" +#elif defined(__ICCARM__) + #define COMPILER "IAR" +#else + #define COMPILER "Unknown Compiler" +#endif + +#if BE_DEBUG +#define FULL_VERSION "Berry " BERRY_VERSION " (debug)" +#else +#define FULL_VERSION "Berry " BERRY_VERSION +#endif + +/* prompt message when REPL is loaded */ +#define repl_prelude \ + FULL_VERSION " (build in " __DATE__ ", " __TIME__ ")\n" \ + "[" COMPILER "] on " OS_NAME " (default)\n" \ + +/* command help information */ +#define help_information \ + "Usage: berry [options] [script [args]]\n" \ + "Avilable options are:\n" \ + " -i enter interactive mode after executing 'file'\n" \ + " -l all variables in 'file' are parsed as local\n" \ + " -e load 'script' source string and execute\n" \ + " -c compile script 'file' to bytecode file\n" \ + " -o save bytecode to 'file'\n" \ + " -g force named globals in VM\n" \ + " -s force Berry compiler in strict mode\n" \ + " -v show version information\n" \ + " -h show help information\n\n" \ + "For more information, please see:\n" \ + " .\n" + +#define array_count(a) (sizeof(a) / sizeof((a)[0])) + +#define arg_i (1 << 0) +#define arg_c (1 << 1) +#define arg_o (1 << 2) +#define arg_l (1 << 3) +#define arg_h (1 << 4) +#define arg_v (1 << 5) +#define arg_e (1 << 6) +#define arg_g (1 << 7) +#define arg_s (1 << 8) +#define arg_err (1 << 9) + +struct arg_opts { + int idx; + const char *pattern; + const char *optarg; + const char *errarg; + const char *src; + const char *dst; +}; + +/* check if the character is a letter */ +static int is_letter(int ch) +{ + return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'); +} + +/* matching options + * pattern: pattern string, the set of vaild options + * ch: option character to be matched + * */ +static const char* match_opt(const char *pattern, int ch) +{ + int c = '\0'; + if (pattern) { + while ((c = *pattern) != '\0' && c != ch) { + c = *(++pattern); + while (c != '\0' && !is_letter(c)) { + c = *(++pattern); /* skip characters that are not letters */ + } + } + } + return c == ch ? pattern : NULL; +} + +/* read an option from the arguments + * opt: option match state + * argc: the number of arguments + * argv: the arguments list + * */ +static int arg_getopt(struct arg_opts *opt, int argc, char *argv[]) +{ + if (opt->idx < argc) { + char *arg = argv[opt->idx]; + if (arg[0] == '-' && strlen(arg) == 2) { + const char *res = match_opt(opt->pattern, arg[1]); + /* the '?' indicates an optional argument after the option */ + if (++opt->idx < argc && res != NULL + && res[1] == '?' && *argv[opt->idx] != '-') { + opt->optarg = argv[opt->idx++]; /* save the argument */ + return *res; + } + opt->optarg = NULL; + opt->errarg = arg; + return res != NULL ? *res : '?'; + } + } + return 0; +} + +/* portable readline function package */ +static char* get_line(const char *prompt) +{ +#if defined(USE_READLINE_LIB) + char *line = readline(prompt); + if (line && strlen(line)) { + add_history(line); + } + return line; +#else + static char buffer[1000]; + fputs(prompt, stdout); + fflush(stdout); + if (be_readstring(buffer, sizeof(buffer))) { + buffer[strlen(buffer) - 1] = '\0'; + return buffer; + } + return NULL; +#endif +} + +static void free_line(char *ptr) +{ +#if defined(USE_READLINE_LIB) + free(ptr); +#else + (void)ptr; +#endif +} + +static int handle_result(bvm *vm, int res) +{ + switch (res) { + case BE_OK: /* everything is OK */ + return 0; + case BE_EXCEPTION: /* uncatched exception */ + be_dumpexcept(vm); + return 1; + case BE_EXIT: /* return exit code */ + return be_toindex(vm, -1); + case BE_IO_ERROR: + be_writestring("error: "); + be_writestring(be_tostring(vm, -1)); + be_writenewline(); + return -2; + case BE_MALLOC_FAIL: + be_writestring("error: memory allocation failed.\n"); + return -1; + default: /* unkonw result */ + return 2; + } +} + +/* execute a script source or file and output a result or error */ +static int doscript(bvm *vm, const char *name, int args) +{ + /* load string, bytecode file or compile script file */ + int res = args & arg_e ? /* check script source string */ + be_loadstring(vm, name) : be_loadmode(vm, name, args & arg_l); + if (res == BE_OK) { /* parsing succeeded */ + res = be_pcall(vm, 0); /* execute */ + } + return handle_result(vm, res); +} + +/* load a Berry script string or file and execute + * args: the enabled options mask + * */ +static int load_script(bvm *vm, int argc, char *argv[], int args) +{ + int res = 0; + int repl_mode = args & arg_i || (args == 0 && argc == 0); + if (repl_mode) { /* enter the REPL mode after executing the script file */ + be_writestring(repl_prelude); + } + if (argc > 0) { /* check file path or source string argument */ + res = doscript(vm, argv[0], args); + } + if (repl_mode) { /* enter the REPL mode */ + res = be_repl(vm, get_line, free_line); + if (res == -BE_MALLOC_FAIL) { + be_writestring("error: memory allocation failed.\n"); + } + } + return res; +} + +/* compile the source code to a bytecode file */ +static int build_file(bvm *vm, const char *dst, const char *src, int args) +{ + int res = be_loadmode(vm, src, args & arg_l); /* compile script file */ + if (res == BE_OK) { + if (!dst) dst = "a.out"; /* the default output file name */ + res = be_savecode(vm, dst); /* save bytecode file */ + } + return handle_result(vm, res); +} + +static int parse_arg(struct arg_opts *opt, int argc, char *argv[]) +{ + int ch, args = 0; + opt->idx = 1; + while ((ch = arg_getopt(opt, argc, argv)) != '\0') { + switch (ch) { + case 'h': args |= arg_h; break; + case 'v': args |= arg_v; break; + case 'i': args |= arg_i; break; + case 'l': args |= arg_l; break; + case 'e': args |= arg_e; break; + case 'g': args |= arg_g; break; + case 's': args |= arg_s; break; + case '?': return args | arg_err; + case 'c': + args |= arg_c; + opt->src = opt->optarg; + break; + case 'o': + args |= arg_o; + opt->dst = opt->optarg; + break; + default: + break; + } + } + return args; +} + +static void push_args(bvm *vm, int argc, char *argv[]) +{ + be_newobject(vm, "list"); + while (argc--) { + be_pushstring(vm, *argv++); + be_data_push(vm, -2); + be_pop(vm, 1); + } + be_pop(vm, 1); + be_setglobal(vm, "_argv"); + be_pop(vm, 1); +} + +/* + * command format: berry [options] [script [args]] + * command options: + * -i: enter interactive mode after executing 'script' + * -b: load code from bytecode file + * -e: load 'script' source and execute + * command format: berry options + * command options: + * -v: show version information + * -h: show help information + * command format: berry option file [option file] + * command options: + * -c: compile script file to bytecode file + * -o: set the output file name + * */ +static int analysis_args(bvm *vm, int argc, char *argv[]) +{ + int args = 0; + struct arg_opts opt = { 0 }; + opt.pattern = "vhilegsc?o?"; + args = parse_arg(&opt, argc, argv); + argc -= opt.idx; + argv += opt.idx; + if (args & arg_err) { + be_writestring(be_pushfstring(vm, + "error: missing argument to '%s'\n", opt.errarg)); + be_pop(vm, 1); + return -1; + } + if (args & arg_g) { + comp_set_named_gbl(vm); /* forced named global in VM code */ + args &= ~arg_g; /* clear the flag for this option not to interfere with other options */ + } + if (args & arg_s) { + comp_set_strict(vm); /* compiler in strict mode */ + args &= ~arg_s; + } + if (args & arg_v) { + be_writestring(FULL_VERSION "\n"); + } + if (args & arg_h) { + be_writestring(help_information); + } + push_args(vm, argc, argv); + if (args & (arg_c | arg_o)) { + if (!opt.src && argc > 0) { + opt.src = *argv; + } + return build_file(vm, opt.dst, opt.src, args); + } + return load_script(vm, argc, argv, args); +} + +#if defined(_WIN32) +#define BERRY_ROOT "\\Windows\\system32" +static const char *module_paths[] = { + BERRY_ROOT "\\berry\\packages", +}; +#else +#define BERRY_ROOT "/usr/local" +static const char *module_paths[] = { + BERRY_ROOT "/lib/berry/packages", +}; +#endif + +static void berry_paths(bvm * vm) +{ + size_t i; + for (i = 0; i < array_count(module_paths); ++i) { + be_module_path_set(vm, module_paths[i]); + } +} + +int main(int argc, char *argv[]) +{ + int res; + bvm *vm = be_vm_new(); /* create a virtual machine instance */ + berry_paths(vm); + res = analysis_args(vm, argc, argv); + be_vm_delete(vm); /* free all objects and vm */ + return res; +} + +#endif // COMPILE_BERRY_LIB diff --git a/lib/libesp32/berry/default/berry_conf.h b/lib/libesp32/berry/default/berry_conf.h index 4d46eb3df..c3656c2aa 100644 --- a/lib/libesp32/berry/default/berry_conf.h +++ b/lib/libesp32/berry/default/berry_conf.h @@ -131,7 +131,11 @@ * will not be used. * Default: 0 **/ +#ifdef TASMOTA #define BE_USE_FILE_SYSTEM 0 +#else +#define BE_USE_FILE_SYSTEM 1 +#endif /* Macro: BE_USE_SCRIPT_COMPILER * Enable compiler when BE_USE_SCRIPT_COMPILER is not 0, otherwise @@ -197,7 +201,11 @@ * This options tries to move such memory areas to this region. * Default: 0 **/ +#ifdef TASMOTA #define BE_USE_MEM_ALIGNED 1 +#else +#define BE_USE_MEM_ALIGNED 0 +#endif /* Macro: BE_USE_XXX_MODULE * These macros control whether the related module is compiled. @@ -205,20 +213,36 @@ * 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 +#ifdef TASMOTA + #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 +#else + #define BE_USE_STRING_MODULE 1 + #define BE_USE_JSON_MODULE 1 + #define BE_USE_MATH_MODULE 1 + #define BE_USE_TIME_MODULE 1 + #define BE_USE_OS_MODULE 1 + #define BE_USE_GLOBAL_MODULE 1 + #define BE_USE_SYS_MODULE 1 + #define BE_USE_DEBUG_MODULE 1 + #define BE_USE_GC_MODULE 1 + #define BE_USE_SOLIDIFY_MODULE 1 + #define BE_USE_INTROSPECT_MODULE 1 + #define BE_USE_STRICT_MODULE 1 +#endif + +#if defined(USE_BERRY_DEBUG) || !defined(TASMOTA) #undef BE_USE_DEBUG_MODULE #undef BE_USE_SOLIDIFY_MODULE #define BE_USE_DEBUG_MODULE 1 diff --git a/lib/libesp32/berry/tools/coc/coc b/lib/libesp32/berry/tools/coc/coc old mode 100644 new mode 100755 index 2550e428e..2111b1ea2 --- a/lib/libesp32/berry/tools/coc/coc +++ b/lib/libesp32/berry/tools/coc/coc @@ -31,7 +31,7 @@ class builder: sb.build(self.output) def parse_file(self, filename): - if re.search(r"\.(c|cc|cpp)$", filename): + if re.search(r"\.(h|c|cc|cpp)$", filename): # print(f"> parse {filename}") text = "" with open(filename) as f: diff --git a/lib/libesp32/berry_tasmota/path.be b/lib/libesp32/berry_tasmota/path.be new file mode 100644 index 000000000..afba51adc --- /dev/null +++ b/lib/libesp32/berry_tasmota/path.be @@ -0,0 +1,2 @@ +# empty module +# allows stand-alone `import path` diff --git a/lib/libesp32/berry_tasmota/solidify_all.be b/lib/libesp32/berry_tasmota/solidify_all.be new file mode 100755 index 000000000..9511a11b0 --- /dev/null +++ b/lib/libesp32/berry_tasmota/solidify_all.be @@ -0,0 +1,81 @@ +#! ../berry/berry -s -g +# +# Berry solidify files +# +# `../berry/berry -s -g` + +import os +import global +import solidify +import string +import re + +# import sys +# sys.path().push('src/embedded') # allow to import from src/embedded + +# globals that need to exist to make compilation succeed +var globs = "path,ctypes_bytes_dyn,tasmota,ccronexpr,gpio,light,webclient,load" + +var files = ['tasmota_class.be', 'leds.be', 'animate_module.be', 'autoconf_module.be','driver_class.be'] + +for g:string.split(globs, ",") + global.(g) = nil +end + +var prefix_dir = "src/embedded/" +var prefix_out = "src/solidify/" + +def clean_directory(dir) + var file_list = os.listdir(dir) + for f : file_list + if f[0] == '.' continue end # ignore files starting with `.` + os.remove(dir + f) + end +end + +var pattern = "#@\\s*solidify:([A-Za-z0-9_,]+)" + +def parse_file(fname) + print("Parsing: ", fname) + var f = open(prefix_dir + fname) + var src = f.read() + f.close() + # try to compile + var compiled = compile(src) + compiled() # run the compile code to instanciate the classes and modules + # output solidified + var fname_h = string.split(fname, '.be')[0] + '.h' # take whatever is before the first '.be' + var fout = open(prefix_out + "solidified_" + fname_h, "w") + fout.write(string.format("/* Solidification of %s */\n", fname_h)) + fout.write("/********************************************************************\\\n") + fout.write("* Generated code, don't edit *\n") + fout.write("\\********************************************************************/\n") + fout.write('#include "be_constobj.h"\n') + + var directives = re.searchall(pattern, src) + # print(directives) + + for directive : directives + var object_list = string.split(directive[1], ',') + var object_name = object_list[0] + var weak = (object_list.find('weak') != nil) # do we solidify with weak strings? + var o = global.(object_name) + solidify.dump(o, weak, fout) + end + + fout.write("/********************************************************************/\n") + fout.write("/* End of solidification */\n") + fout.close() +end + +clean_directory(prefix_out) + +var src_file_list = os.listdir(prefix_dir) +for src_file : src_file_list + if src_file[0] == '.' continue end +end + +# manual +for f : files + parse_file(f) +end diff --git a/lib/libesp32/berry_tasmota/src/be_animate_lib.c b/lib/libesp32/berry_tasmota/src/be_animate_lib.c index a3dd1ae55..77a88bbc8 100644 --- a/lib/libesp32/berry_tasmota/src/be_animate_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_animate_lib.c @@ -4,709 +4,4 @@ * 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 */ - 2, /* 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_weak(Animate_rotate) -); - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Animate_from_to_init, /* name */ - be_nested_proto( - 12, /* nstack */ - 5, /* argc */ - 2, /* 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_weak(Animate_from_to) -); - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Animate_back_forth_init, /* name */ - be_nested_proto( - 12, /* nstack */ - 5, /* argc */ - 2, /* 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_weak(Animate_back_forth) -); - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Animate_ins_goto_init, /* name */ - be_nested_proto( - 4, /* nstack */ - 4, /* argc */ - 2, /* 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_weak(Animate_ins_goto) -); - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Animate_ins_ramp_init, /* name */ - be_nested_proto( - 4, /* nstack */ - 4, /* argc */ - 2, /* 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_weak(Animate_ins_ramp) -); - -/******************************************************************** -** Solidified function: run -********************************************************************/ -be_local_closure(Animate_engine_run, /* name */ - be_nested_proto( - 6, /* nstack */ - 3, /* argc */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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_weak(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); -/********************************************************************/ +#include "solidify/solidified_animate_module.h" diff --git a/lib/libesp32/berry_tasmota/src/be_autoconf_lib.c b/lib/libesp32/berry_tasmota/src/be_autoconf_lib.c index 686b54474..972aee097 100644 --- a/lib/libesp32/berry_tasmota/src/be_autoconf_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_autoconf_lib.c @@ -4,1391 +4,4 @@ * 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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_X3EAuto_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 */ - 2, /* 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 */ - 2, /* 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(3), - /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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_weak(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); -/********************************************************************/ +#include "solidify/solidified_autoconf_module.h" diff --git a/lib/libesp32/berry_tasmota/src/be_driverlib.c b/lib/libesp32/berry_tasmota/src/be_driverlib.c index 8cdff40a8..8dff73a26 100644 --- a/lib/libesp32/berry_tasmota/src/be_driverlib.c +++ b/lib/libesp32/berry_tasmota/src/be_driverlib.c @@ -4,97 +4,4 @@ * To use: `d = Driver()` * *******************************************************************/ -#include "be_constobj.h" - -/******************************************************************** -** Solidified function: add_cmd -********************************************************************/ -be_local_closure(Driver_add_cmd, /* name */ - be_nested_proto( - 7, /* nstack */ - 3, /* argc */ - 2, /* 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(14, - ( (struct bmapnode*) &(const bmapnode[]) { - { 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_weak(Driver) -); -/*******************************************************************/ - -void be_load_Driver_class(bvm *vm) { - be_pushntvclass(vm, &be_class_Driver); - be_setglobal(vm, "Driver"); - be_pop(vm, 1); -} +#include "solidify/solidified_driver_class.h" diff --git a/lib/libesp32/berry_tasmota/src/be_leds_lib.c b/lib/libesp32/berry_tasmota/src/be_leds_lib.c index c77e10291..293b4d175 100644 --- a/lib/libesp32/berry_tasmota/src/be_leds_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_leds_lib.c @@ -2,1916 +2,8 @@ * Berry class `Leds` * *******************************************************************/ -#include "be_constobj.h" - #ifdef USE_WS2812 -/******************************************************************** -** Solidified function: pixel_count -********************************************************************/ -be_local_closure(Leds_pixel_count, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 2, /* 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: show -********************************************************************/ -be_local_closure(Leds_show, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 2, /* 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: clear_to -********************************************************************/ -be_local_closure(Leds_clear_to, /* name */ - be_nested_proto( - 10, /* nstack */ - 3, /* argc */ - 2, /* 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: set_pixel_color -********************************************************************/ -be_local_closure(Leds_set_pixel_color, /* name */ - be_nested_proto( - 12, /* nstack */ - 4, /* argc */ - 2, /* 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: clear -********************************************************************/ -be_local_closure(Leds_clear, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 2, /* 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: 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: get_pixel_color -********************************************************************/ -be_local_closure(Leds_segment_get_pixel_color, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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_weak(Leds_segment) -); - -/******************************************************************** -** Solidified function: create_segment -********************************************************************/ -be_local_closure(Leds_create_segment, /* name */ - be_nested_proto( - 8, /* nstack */ - 3, /* argc */ - 2, /* 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 function: is_dirty -********************************************************************/ -be_local_closure(Leds_is_dirty, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 2, /* 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: pixel_count -********************************************************************/ -be_local_closure(Leds_matrix_pixel_count, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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 */ - 2, /* 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_weak(Leds_matrix) -); - -/******************************************************************** -** Solidified function: create_matrix -********************************************************************/ -be_local_closure(Leds_create_matrix, /* name */ - be_nested_proto( - 10, /* nstack */ - 4, /* argc */ - 2, /* 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: pixels_buffer -********************************************************************/ -be_local_closure(Leds_pixels_buffer, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 2, /* 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: init -********************************************************************/ -be_local_closure(Leds_init, /* name */ - be_nested_proto( - 11, /* nstack */ - 5, /* argc */ - 2, /* 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(gamma), - /* K1 */ be_nested_str(leds), - /* K2 */ be_nested_str(valuer_error), - /* K3 */ be_nested_str(no_X20GPIO_X20specified_X20for_X20neopixelbus), - /* K4 */ be_nested_str(ctor), - /* K5 */ be_nested_str(_p), - /* K6 */ be_nested_str(internal_error), - /* K7 */ be_nested_str(couldn_X27t_X20not_X20initialize_X20noepixelbus), - /* K8 */ be_nested_str(begin), - }), - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[24]) { /* 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 - 0x78160000, // 0008 JMPF R5 #000A - 0xB0060503, // 0009 RAISE 1 K2 K3 - 0x8C140104, // 000A GETMET R5 R0 K4 - 0x881C0101, // 000B GETMBR R7 R0 K1 - 0x5C200400, // 000C MOVE R8 R2 - 0x5C240600, // 000D MOVE R9 R3 - 0x5C280800, // 000E MOVE R10 R4 - 0x7C140A00, // 000F CALL R5 5 - 0x88140105, // 0010 GETMBR R5 R0 K5 - 0x4C180000, // 0011 LDNIL R6 - 0x1C140A06, // 0012 EQ R5 R5 R6 - 0x78160000, // 0013 JMPF R5 #0015 - 0xB0060D07, // 0014 RAISE 1 K6 K7 - 0x8C140108, // 0015 GETMET R5 R0 K8 - 0x7C140200, // 0016 CALL R5 1 - 0x80000000, // 0017 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: dirty -********************************************************************/ -be_local_closure(Leds_dirty, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 2, /* 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_get_pixel_color, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 2, /* 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: assign_rmt -********************************************************************/ -be_local_closure(Leds_assign_rmt, /* name */ - be_nested_proto( - 8, /* nstack */ - 1, /* 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_const_int(0), - /* K1 */ be_nested_str(value_error), - /* K2 */ be_nested_str(invalid_X20GPIO_X20number), - /* K3 */ be_nested_str(global), - /* K4 */ be_nested_str(contains), - /* K5 */ be_nested_str(_rmt), - /* K6 */ be_nested_str(gpio), - /* K7 */ be_nested_str(MAX_RMT), - /* K8 */ be_const_int(1), - /* K9 */ be_nested_str(push), - /* K10 */ be_nested_str(stop_iteration), - /* K11 */ be_nested_str(pin_used), - /* K12 */ be_nested_str(WS2812), - /* K13 */ be_nested_str(pin), - /* K14 */ be_nested_str(internal_error), - /* K15 */ be_nested_str(no_X20more_X20RMT_X20channel_X20available), - }), - &be_const_str_assign_rmt, - &be_const_str_solidified, - ( &(const binstruction[71]) { /* code */ - 0x60040009, // 0000 GETGBL R1 G9 - 0x5C080000, // 0001 MOVE R2 R0 - 0x7C040200, // 0002 CALL R1 1 - 0x5C000200, // 0003 MOVE R0 R1 - 0x14040100, // 0004 LT R1 R0 K0 - 0x78060000, // 0005 JMPF R1 #0007 - 0xB0060302, // 0006 RAISE 1 K1 K2 - 0xA4060600, // 0007 IMPORT R1 K3 - 0x4C080000, // 0008 LDNIL R2 - 0x8C0C0304, // 0009 GETMET R3 R1 K4 - 0x58140005, // 000A LDCONST R5 K5 - 0x7C0C0400, // 000B CALL R3 2 - 0x740E0021, // 000C JMPT R3 #002F - 0x600C0012, // 000D GETGBL R3 G18 - 0x7C0C0000, // 000E CALL R3 0 - 0x5C080600, // 000F MOVE R2 R3 - 0x90060A02, // 0010 SETMBR R1 K5 R2 - 0x600C0010, // 0011 GETGBL R3 G16 - 0xB8120C00, // 0012 GETNGBL R4 K6 - 0x88100907, // 0013 GETMBR R4 R4 K7 - 0x04100908, // 0014 SUB R4 R4 K8 - 0x40120004, // 0015 CONNECT R4 K0 R4 - 0x7C0C0200, // 0016 CALL R3 1 - 0xA8020005, // 0017 EXBLK 0 #001E - 0x5C100600, // 0018 MOVE R4 R3 - 0x7C100000, // 0019 CALL R4 0 - 0x8C140509, // 001A GETMET R5 R2 K9 - 0x541DFFFE, // 001B LDINT R7 -1 - 0x7C140400, // 001C CALL R5 2 - 0x7001FFF9, // 001D JMP #0018 - 0x580C000A, // 001E LDCONST R3 K10 - 0xAC0C0200, // 001F CATCH R3 1 0 - 0xB0080000, // 0020 RAISE 2 R0 R0 - 0xB80E0C00, // 0021 GETNGBL R3 K6 - 0x8C0C070B, // 0022 GETMET R3 R3 K11 - 0xB8160C00, // 0023 GETNGBL R5 K6 - 0x88140B0C, // 0024 GETMBR R5 R5 K12 - 0x58180000, // 0025 LDCONST R6 K0 - 0x7C0C0600, // 0026 CALL R3 3 - 0x780E0006, // 0027 JMPF R3 #002F - 0xB80E0C00, // 0028 GETNGBL R3 K6 - 0x8C0C070D, // 0029 GETMET R3 R3 K13 - 0xB8160C00, // 002A GETNGBL R5 K6 - 0x88140B0C, // 002B GETMBR R5 R5 K12 - 0x58180000, // 002C LDCONST R6 K0 - 0x7C0C0600, // 002D CALL R3 3 - 0x980A0003, // 002E SETIDX R2 K0 R3 - 0x88080305, // 002F GETMBR R2 R1 K5 - 0x580C0000, // 0030 LDCONST R3 K0 - 0x5411FFFE, // 0031 LDINT R4 -1 - 0xB8160C00, // 0032 GETNGBL R5 K6 - 0x88140B07, // 0033 GETMBR R5 R5 K7 - 0x14140605, // 0034 LT R5 R3 R5 - 0x7816000A, // 0035 JMPF R5 #0041 - 0x94140403, // 0036 GETIDX R5 R2 R3 - 0x1C180A00, // 0037 EQ R6 R5 R0 - 0x781A0000, // 0038 JMPF R6 #003A - 0x80040600, // 0039 RET 1 R3 - 0x14180B00, // 003A LT R6 R5 K0 - 0x781A0002, // 003B JMPF R6 #003F - 0x14180900, // 003C LT R6 R4 K0 - 0x781A0000, // 003D JMPF R6 #003F - 0x5C100600, // 003E MOVE R4 R3 - 0x000C0708, // 003F ADD R3 R3 K8 - 0x7001FFF0, // 0040 JMP #0032 - 0x28140900, // 0041 GE R5 R4 K0 - 0x78160001, // 0042 JMPF R5 #0045 - 0x98080800, // 0043 SETIDX R2 R4 R0 - 0x80040800, // 0044 RET 1 R4 - 0xB0061D0F, // 0045 RAISE 1 K14 K15 - 0x80000000, // 0046 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: pixel_size -********************************************************************/ -be_local_closure(Leds_pixel_size, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 2, /* 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: to_gamma -********************************************************************/ -be_local_closure(Leds_to_gamma, /* name */ - be_nested_proto( - 12, /* nstack */ - 3, /* argc */ - 2, /* 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: begin -********************************************************************/ -be_local_closure(Leds_begin, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 2, /* 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: ctor -********************************************************************/ -be_local_closure(Leds_ctor, /* name */ - be_nested_proto( - 12, /* nstack */ - 5, /* argc */ - 2, /* 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(WS2812_GRB), - /* K1 */ be_nested_str(assign_rmt), - /* K2 */ be_nested_str(call_native), - /* K3 */ be_const_int(0), - }), - &be_const_str_ctor, - &be_const_str_solidified, - ( &(const binstruction[19]) { /* code */ - 0x4C140000, // 0000 LDNIL R5 - 0x1C140605, // 0001 EQ R5 R3 R5 - 0x78160000, // 0002 JMPF R5 #0004 - 0x880C0100, // 0003 GETMBR R3 R0 K0 - 0x4C140000, // 0004 LDNIL R5 - 0x1C140805, // 0005 EQ R5 R4 R5 - 0x78160003, // 0006 JMPF R5 #000B - 0x8C140101, // 0007 GETMET R5 R0 K1 - 0x5C1C0400, // 0008 MOVE R7 R2 - 0x7C140400, // 0009 CALL R5 2 - 0x5C100A00, // 000A MOVE R4 R5 - 0x8C140102, // 000B GETMET R5 R0 K2 - 0x581C0003, // 000C LDCONST R7 K3 - 0x5C200200, // 000D MOVE R8 R1 - 0x5C240400, // 000E MOVE R9 R2 - 0x5C280600, // 000F MOVE R10 R3 - 0x5C2C0800, // 0010 MOVE R11 R4 - 0x7C140C00, // 0011 CALL R5 6 - 0x80000000, // 0012 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: can_show -********************************************************************/ -be_local_closure(Leds_can_show, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 2, /* 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 class: Leds -********************************************************************/ -extern const bclass be_class_Leds_ntv; -be_local_class(Leds, - 2, - &be_class_Leds_ntv, - be_nested_map(21, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(pixel_count, -1), be_const_closure(Leds_pixel_count_closure) }, - { be_const_key(show, -1), be_const_closure(Leds_show_closure) }, - { be_const_key(is_dirty, -1), be_const_closure(Leds_is_dirty_closure) }, - { be_const_key(leds, 17), be_const_var(1) }, - { be_const_key(set_pixel_color, 8), be_const_closure(Leds_set_pixel_color_closure) }, - { be_const_key(clear, -1), be_const_closure(Leds_clear_closure) }, - { be_const_key(matrix, -1), be_const_static_closure(Leds_matrix_closure) }, - { be_const_key(create_segment, -1), be_const_closure(Leds_create_segment_closure) }, - { be_const_key(ctor, 2), be_const_closure(Leds_ctor_closure) }, - { be_const_key(clear_to, 19), be_const_closure(Leds_clear_to_closure) }, - { be_const_key(create_matrix, -1), be_const_closure(Leds_create_matrix_closure) }, - { be_const_key(pixels_buffer, -1), be_const_closure(Leds_pixels_buffer_closure) }, - { be_const_key(init, -1), be_const_closure(Leds_init_closure) }, - { be_const_key(dirty, -1), be_const_closure(Leds_dirty_closure) }, - { be_const_key(get_pixel_color, -1), be_const_closure(Leds_get_pixel_color_closure) }, - { be_const_key(assign_rmt, -1), be_const_static_closure(Leds_assign_rmt_closure) }, - { be_const_key(pixel_size, -1), be_const_closure(Leds_pixel_size_closure) }, - { be_const_key(to_gamma, 16), be_const_closure(Leds_to_gamma_closure) }, - { be_const_key(begin, -1), be_const_closure(Leds_begin_closure) }, - { be_const_key(gamma, -1), be_const_var(0) }, - { be_const_key(can_show, -1), be_const_closure(Leds_can_show_closure) }, - })), - be_str_weak(Leds) -); -/*******************************************************************/ - -void be_load_Leds_class(bvm *vm) { - be_pushntvclass(vm, &be_class_Leds); - be_setglobal(vm, "Leds"); - be_pop(vm, 1); -} +#include "solidify/solidified_leds.h" #endif // USE_WS2812 diff --git a/lib/libesp32/berry_tasmota/src/embedded/Animate.be b/lib/libesp32/berry_tasmota/src/embedded/animate_module.be similarity index 99% rename from lib/libesp32/berry_tasmota/src/embedded/Animate.be rename to lib/libesp32/berry_tasmota/src/embedded/animate_module.be index 279fd39ed..7e913c919 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/Animate.be +++ b/lib/libesp32/berry_tasmota/src/embedded/animate_module.be @@ -182,6 +182,7 @@ class Animate_back_forth : Animate_engine end animate.back_forth = Animate_back_forth +#@ solidify:animate #- a=Animate_back_forth(nil, 0, 100, 5000) diff --git a/lib/libesp32/berry_tasmota/src/embedded/autoconf.be b/lib/libesp32/berry_tasmota/src/embedded/autoconf_module.be similarity index 99% rename from lib/libesp32/berry_tasmota/src/embedded/autoconf.be rename to lib/libesp32/berry_tasmota/src/embedded/autoconf_module.be index 18eb17015..3e279cf71 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/autoconf.be +++ b/lib/libesp32/berry_tasmota/src/embedded/autoconf_module.be @@ -382,8 +382,11 @@ autoconf_module.init = def (m) return Autoconf() # return an instance of this class end +#@ solidify:autoconf_module +#- aa = autoconf_module.init(autoconf_module) import webserver webserver.on('/ac2', / -> aa.page_autoconf_mgr(), webserver.HTTP_GET) return autoconf_module +-# \ No newline at end of file diff --git a/lib/libesp32/berry_tasmota/src/embedded/Driver.be b/lib/libesp32/berry_tasmota/src/embedded/driver_class.be similarity index 96% rename from lib/libesp32/berry_tasmota/src/embedded/Driver.be rename to lib/libesp32/berry_tasmota/src/embedded/driver_class.be index bb365aa29..eb2fadc38 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/Driver.be +++ b/lib/libesp32/berry_tasmota/src/embedded/driver_class.be @@ -1,6 +1,7 @@ #- Native code used for testing and code solidification -# #- Do not use it -# +#@ solidify:Driver class Driver var every_second var every_100ms diff --git a/lib/libesp32/berry_tasmota/src/embedded/leds.be b/lib/libesp32/berry_tasmota/src/embedded/leds.be index be27e56e7..8cacf441c 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/leds.be +++ b/lib/libesp32/berry_tasmota/src/embedded/leds.be @@ -23,6 +23,7 @@ class Leds_ntv end +#@ solidify:Leds class Leds : Leds_ntv var gamma # if true, apply gamma (true is default) var leds # number of leds diff --git a/lib/libesp32/berry_tasmota/src/embedded/Tasmota.be b/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be similarity index 99% rename from lib/libesp32/berry_tasmota/src/embedded/Tasmota.be rename to lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be index 73de423ed..fa99a2ea4 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/Tasmota.be +++ b/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be @@ -1,6 +1,7 @@ #- Native code used for testing and code solidification -# #- Do not use it -# +#@ solidify:Trigger class Trigger var trig, f, id var o # optional object @@ -31,6 +32,7 @@ class Trigger end tasmota = nil +#@ solidify:Tasmota class Tasmota var _fl # list of fast_loop registered closures var _rules diff --git a/lib/libesp32/berry_tasmota/src/solidify/.keep b/lib/libesp32/berry_tasmota/src/solidify/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_module.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_module.h new file mode 100644 index 000000000..30f7a47a0 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_module.h @@ -0,0 +1,712 @@ +/* Solidification of animate_module.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Animate_rotate_init, /* name */ + be_nested_proto( + 12, /* nstack */ + 5, /* argc */ + 2, /* 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) }, + })), + (bstring*) &be_const_str_Animate_rotate +); + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Animate_from_to_init, /* name */ + be_nested_proto( + 12, /* nstack */ + 5, /* argc */ + 2, /* 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) }, + })), + (bstring*) &be_const_str_Animate_from_to +); + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Animate_back_forth_init, /* name */ + be_nested_proto( + 12, /* nstack */ + 5, /* argc */ + 2, /* 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) }, + })), + (bstring*) &be_const_str_Animate_back_forth +); + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Animate_ins_goto_init, /* name */ + be_nested_proto( + 4, /* nstack */ + 4, /* argc */ + 2, /* 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(init, -1), be_const_closure(Animate_ins_goto_init_closure) }, + { be_const_key(pc_abs, 2), be_const_var(1) }, + })), + (bstring*) &be_const_str_Animate_ins_goto +); + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Animate_ins_ramp_init, /* name */ + be_nested_proto( + 4, /* nstack */ + 4, /* argc */ + 2, /* 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) }, + })), + (bstring*) &be_const_str_Animate_ins_ramp +); + +/******************************************************************** +** Solidified function: run +********************************************************************/ +be_local_closure(Animate_engine_run, /* name */ + be_nested_proto( + 6, /* nstack */ + 3, /* argc */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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, 9), be_const_closure(Animate_engine_run_closure) }, + { be_const_key(running, 4), be_const_var(4) }, + { be_const_key(ins_time, 8), be_const_var(3) }, + { be_const_key(closure, 10), be_const_var(1) }, + { be_const_key(value, -1), be_const_var(5) }, + { be_const_key(init, 11), be_const_closure(Animate_engine_init_closure) }, + { be_const_key(pc, -1), be_const_var(2) }, + { be_const_key(animate, -1), be_const_closure(Animate_engine_animate_closure) }, + { be_const_key(autorun, -1), be_const_closure(Animate_engine_autorun_closure) }, + { be_const_key(is_running, -1), be_const_closure(Animate_engine_is_running_closure) }, + { be_const_key(stop, -1), be_const_closure(Animate_engine_stop_closure) }, + { be_const_key(every_50ms, 3), be_const_closure(Animate_engine_every_50ms_closure) }, + })), + (bstring*) &be_const_str_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); +/********************************************************************/ +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_autoconf_module.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_autoconf_module.h new file mode 100644 index 000000000..bbe8644cc --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_autoconf_module.h @@ -0,0 +1,1393 @@ +/* Solidification of autoconf_module.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: page_autoconf_ctl +********************************************************************/ +be_local_closure(Autoconf_page_autoconf_ctl, /* name */ + be_nested_proto( + 13, /* nstack */ + 1, /* argc */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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_X3EAuto_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 */ + 2, /* 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 */ + 2, /* 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(3), + /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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) }, + })), + (bstring*) &be_const_str_Autoconf +); + +/******************************************************************** +** Solidified function: _anonymous_ +********************************************************************/ +be_local_closure(autoconf__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(autoconf__anonymous__closure) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(autoconf); +/********************************************************************/ +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_driver_class.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_driver_class.h new file mode 100644 index 000000000..f36429f81 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_driver_class.h @@ -0,0 +1,100 @@ +/* Solidification of driver_class.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: add_cmd +********************************************************************/ +be_local_closure(Driver_add_cmd, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 2, /* 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(14, + ( (struct bmapnode*) &(const bmapnode[]) { + { 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) }, + })), + (bstring*) &be_const_str_Driver +); +/*******************************************************************/ + +void be_load_Driver_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Driver); + be_setglobal(vm, "Driver"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_leds.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_leds.h new file mode 100644 index 000000000..b872474e4 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_leds.h @@ -0,0 +1,1915 @@ +/* Solidification of leds.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: pixel_count +********************************************************************/ +be_local_closure(Leds_pixel_count, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* 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: show +********************************************************************/ +be_local_closure(Leds_show, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* 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: clear_to +********************************************************************/ +be_local_closure(Leds_clear_to, /* name */ + be_nested_proto( + 10, /* nstack */ + 3, /* argc */ + 2, /* 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: set_pixel_color +********************************************************************/ +be_local_closure(Leds_set_pixel_color, /* name */ + be_nested_proto( + 12, /* nstack */ + 4, /* argc */ + 2, /* 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: clear +********************************************************************/ +be_local_closure(Leds_clear, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* 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: 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: get_pixel_color +********************************************************************/ +be_local_closure(Leds_segment_get_pixel_color, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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) }, + })), + (bstring*) &be_const_str_Leds_segment +); + +/******************************************************************** +** Solidified function: create_segment +********************************************************************/ +be_local_closure(Leds_create_segment, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 2, /* 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 function: is_dirty +********************************************************************/ +be_local_closure(Leds_is_dirty, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* 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: pixel_count +********************************************************************/ +be_local_closure(Leds_matrix_pixel_count, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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 */ + 2, /* 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) }, + })), + (bstring*) &be_const_str_Leds_matrix +); + +/******************************************************************** +** Solidified function: create_matrix +********************************************************************/ +be_local_closure(Leds_create_matrix, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 2, /* 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: pixels_buffer +********************************************************************/ +be_local_closure(Leds_pixels_buffer, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* 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: init +********************************************************************/ +be_local_closure(Leds_init, /* name */ + be_nested_proto( + 11, /* nstack */ + 5, /* argc */ + 2, /* 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(gamma), + /* K1 */ be_nested_str(leds), + /* K2 */ be_nested_str(valuer_error), + /* K3 */ be_nested_str(no_X20GPIO_X20specified_X20for_X20neopixelbus), + /* K4 */ be_nested_str(ctor), + /* K5 */ be_nested_str(_p), + /* K6 */ be_nested_str(internal_error), + /* K7 */ be_nested_str(couldn_X27t_X20not_X20initialize_X20noepixelbus), + /* K8 */ be_nested_str(begin), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[24]) { /* 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 + 0x78160000, // 0008 JMPF R5 #000A + 0xB0060503, // 0009 RAISE 1 K2 K3 + 0x8C140104, // 000A GETMET R5 R0 K4 + 0x881C0101, // 000B GETMBR R7 R0 K1 + 0x5C200400, // 000C MOVE R8 R2 + 0x5C240600, // 000D MOVE R9 R3 + 0x5C280800, // 000E MOVE R10 R4 + 0x7C140A00, // 000F CALL R5 5 + 0x88140105, // 0010 GETMBR R5 R0 K5 + 0x4C180000, // 0011 LDNIL R6 + 0x1C140A06, // 0012 EQ R5 R5 R6 + 0x78160000, // 0013 JMPF R5 #0015 + 0xB0060D07, // 0014 RAISE 1 K6 K7 + 0x8C140108, // 0015 GETMET R5 R0 K8 + 0x7C140200, // 0016 CALL R5 1 + 0x80000000, // 0017 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: dirty +********************************************************************/ +be_local_closure(Leds_dirty, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* 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_get_pixel_color, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* 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: assign_rmt +********************************************************************/ +be_local_closure(Leds_assign_rmt, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* 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_const_int(0), + /* K1 */ be_nested_str(value_error), + /* K2 */ be_nested_str(invalid_X20GPIO_X20number), + /* K3 */ be_nested_str(global), + /* K4 */ be_nested_str(contains), + /* K5 */ be_nested_str(_rmt), + /* K6 */ be_nested_str(gpio), + /* K7 */ be_nested_str(MAX_RMT), + /* K8 */ be_const_int(1), + /* K9 */ be_nested_str(push), + /* K10 */ be_nested_str(stop_iteration), + /* K11 */ be_nested_str(pin_used), + /* K12 */ be_nested_str(WS2812), + /* K13 */ be_nested_str(pin), + /* K14 */ be_nested_str(internal_error), + /* K15 */ be_nested_str(no_X20more_X20RMT_X20channel_X20available), + }), + &be_const_str_assign_rmt, + &be_const_str_solidified, + ( &(const binstruction[71]) { /* code */ + 0x60040009, // 0000 GETGBL R1 G9 + 0x5C080000, // 0001 MOVE R2 R0 + 0x7C040200, // 0002 CALL R1 1 + 0x5C000200, // 0003 MOVE R0 R1 + 0x14040100, // 0004 LT R1 R0 K0 + 0x78060000, // 0005 JMPF R1 #0007 + 0xB0060302, // 0006 RAISE 1 K1 K2 + 0xA4060600, // 0007 IMPORT R1 K3 + 0x4C080000, // 0008 LDNIL R2 + 0x8C0C0304, // 0009 GETMET R3 R1 K4 + 0x58140005, // 000A LDCONST R5 K5 + 0x7C0C0400, // 000B CALL R3 2 + 0x740E0021, // 000C JMPT R3 #002F + 0x600C0012, // 000D GETGBL R3 G18 + 0x7C0C0000, // 000E CALL R3 0 + 0x5C080600, // 000F MOVE R2 R3 + 0x90060A02, // 0010 SETMBR R1 K5 R2 + 0x600C0010, // 0011 GETGBL R3 G16 + 0xB8120C00, // 0012 GETNGBL R4 K6 + 0x88100907, // 0013 GETMBR R4 R4 K7 + 0x04100908, // 0014 SUB R4 R4 K8 + 0x40120004, // 0015 CONNECT R4 K0 R4 + 0x7C0C0200, // 0016 CALL R3 1 + 0xA8020005, // 0017 EXBLK 0 #001E + 0x5C100600, // 0018 MOVE R4 R3 + 0x7C100000, // 0019 CALL R4 0 + 0x8C140509, // 001A GETMET R5 R2 K9 + 0x541DFFFE, // 001B LDINT R7 -1 + 0x7C140400, // 001C CALL R5 2 + 0x7001FFF9, // 001D JMP #0018 + 0x580C000A, // 001E LDCONST R3 K10 + 0xAC0C0200, // 001F CATCH R3 1 0 + 0xB0080000, // 0020 RAISE 2 R0 R0 + 0xB80E0C00, // 0021 GETNGBL R3 K6 + 0x8C0C070B, // 0022 GETMET R3 R3 K11 + 0xB8160C00, // 0023 GETNGBL R5 K6 + 0x88140B0C, // 0024 GETMBR R5 R5 K12 + 0x58180000, // 0025 LDCONST R6 K0 + 0x7C0C0600, // 0026 CALL R3 3 + 0x780E0006, // 0027 JMPF R3 #002F + 0xB80E0C00, // 0028 GETNGBL R3 K6 + 0x8C0C070D, // 0029 GETMET R3 R3 K13 + 0xB8160C00, // 002A GETNGBL R5 K6 + 0x88140B0C, // 002B GETMBR R5 R5 K12 + 0x58180000, // 002C LDCONST R6 K0 + 0x7C0C0600, // 002D CALL R3 3 + 0x980A0003, // 002E SETIDX R2 K0 R3 + 0x88080305, // 002F GETMBR R2 R1 K5 + 0x580C0000, // 0030 LDCONST R3 K0 + 0x5411FFFE, // 0031 LDINT R4 -1 + 0xB8160C00, // 0032 GETNGBL R5 K6 + 0x88140B07, // 0033 GETMBR R5 R5 K7 + 0x14140605, // 0034 LT R5 R3 R5 + 0x7816000A, // 0035 JMPF R5 #0041 + 0x94140403, // 0036 GETIDX R5 R2 R3 + 0x1C180A00, // 0037 EQ R6 R5 R0 + 0x781A0000, // 0038 JMPF R6 #003A + 0x80040600, // 0039 RET 1 R3 + 0x14180B00, // 003A LT R6 R5 K0 + 0x781A0002, // 003B JMPF R6 #003F + 0x14180900, // 003C LT R6 R4 K0 + 0x781A0000, // 003D JMPF R6 #003F + 0x5C100600, // 003E MOVE R4 R3 + 0x000C0708, // 003F ADD R3 R3 K8 + 0x7001FFF0, // 0040 JMP #0032 + 0x28140900, // 0041 GE R5 R4 K0 + 0x78160001, // 0042 JMPF R5 #0045 + 0x98080800, // 0043 SETIDX R2 R4 R0 + 0x80040800, // 0044 RET 1 R4 + 0xB0061D0F, // 0045 RAISE 1 K14 K15 + 0x80000000, // 0046 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: pixel_size +********************************************************************/ +be_local_closure(Leds_pixel_size, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* 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: to_gamma +********************************************************************/ +be_local_closure(Leds_to_gamma, /* name */ + be_nested_proto( + 12, /* nstack */ + 3, /* argc */ + 2, /* 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: begin +********************************************************************/ +be_local_closure(Leds_begin, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* 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: ctor +********************************************************************/ +be_local_closure(Leds_ctor, /* name */ + be_nested_proto( + 12, /* nstack */ + 5, /* argc */ + 2, /* 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(WS2812_GRB), + /* K1 */ be_nested_str(assign_rmt), + /* K2 */ be_nested_str(call_native), + /* K3 */ be_const_int(0), + }), + &be_const_str_ctor, + &be_const_str_solidified, + ( &(const binstruction[19]) { /* code */ + 0x4C140000, // 0000 LDNIL R5 + 0x1C140605, // 0001 EQ R5 R3 R5 + 0x78160000, // 0002 JMPF R5 #0004 + 0x880C0100, // 0003 GETMBR R3 R0 K0 + 0x4C140000, // 0004 LDNIL R5 + 0x1C140805, // 0005 EQ R5 R4 R5 + 0x78160003, // 0006 JMPF R5 #000B + 0x8C140101, // 0007 GETMET R5 R0 K1 + 0x5C1C0400, // 0008 MOVE R7 R2 + 0x7C140400, // 0009 CALL R5 2 + 0x5C100A00, // 000A MOVE R4 R5 + 0x8C140102, // 000B GETMET R5 R0 K2 + 0x581C0003, // 000C LDCONST R7 K3 + 0x5C200200, // 000D MOVE R8 R1 + 0x5C240400, // 000E MOVE R9 R2 + 0x5C280600, // 000F MOVE R10 R3 + 0x5C2C0800, // 0010 MOVE R11 R4 + 0x7C140C00, // 0011 CALL R5 6 + 0x80000000, // 0012 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: can_show +********************************************************************/ +be_local_closure(Leds_can_show, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* 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 class: Leds +********************************************************************/ +extern const bclass be_class_Leds_ntv; +be_local_class(Leds, + 2, + &be_class_Leds_ntv, + be_nested_map(21, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(pixel_count, -1), be_const_closure(Leds_pixel_count_closure) }, + { be_const_key(show, -1), be_const_closure(Leds_show_closure) }, + { be_const_key(is_dirty, -1), be_const_closure(Leds_is_dirty_closure) }, + { be_const_key(leds, 17), be_const_var(1) }, + { be_const_key(set_pixel_color, 8), be_const_closure(Leds_set_pixel_color_closure) }, + { be_const_key(clear, -1), be_const_closure(Leds_clear_closure) }, + { be_const_key(matrix, -1), be_const_static_closure(Leds_matrix_closure) }, + { be_const_key(create_segment, -1), be_const_closure(Leds_create_segment_closure) }, + { be_const_key(ctor, 2), be_const_closure(Leds_ctor_closure) }, + { be_const_key(clear_to, 19), be_const_closure(Leds_clear_to_closure) }, + { be_const_key(create_matrix, -1), be_const_closure(Leds_create_matrix_closure) }, + { be_const_key(pixels_buffer, -1), be_const_closure(Leds_pixels_buffer_closure) }, + { be_const_key(init, -1), be_const_closure(Leds_init_closure) }, + { be_const_key(dirty, -1), be_const_closure(Leds_dirty_closure) }, + { be_const_key(get_pixel_color, -1), be_const_closure(Leds_get_pixel_color_closure) }, + { be_const_key(assign_rmt, -1), be_const_static_closure(Leds_assign_rmt_closure) }, + { be_const_key(pixel_size, -1), be_const_closure(Leds_pixel_size_closure) }, + { be_const_key(to_gamma, 16), be_const_closure(Leds_to_gamma_closure) }, + { be_const_key(begin, -1), be_const_closure(Leds_begin_closure) }, + { be_const_key(gamma, -1), be_const_var(0) }, + { be_const_key(can_show, -1), be_const_closure(Leds_can_show_closure) }, + })), + (bstring*) &be_const_str_Leds +); +/*******************************************************************/ + +void be_load_Leds_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Leds); + be_setglobal(vm, "Leds"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h new file mode 100644 index 000000000..550d2fc3a --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h @@ -0,0 +1,2733 @@ +/* Solidification of tasmota_class.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Trigger_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 5, /* argc */ + 2, /* 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(trig), + /* K1 */ be_nested_str(f), + /* K2 */ be_nested_str(id), + /* K3 */ be_nested_str(o), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x90020403, // 0002 SETMBR R0 K2 R3 + 0x90020604, // 0003 SETMBR R0 K3 R4 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tostring +********************************************************************/ +be_local_closure(Trigger_tostring, /* name */ + be_nested_proto( + 10, /* nstack */ + 1, /* argc */ + 2, /* 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(trig), + /* 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: time_reached +********************************************************************/ +be_local_closure(Trigger_time_reached, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* 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(o), + /* K1 */ be_nested_str(trig), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str(time_reached), + }), + &be_const_str_time_reached, + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x78060007, // 0001 JMPF R1 #000A + 0x88040101, // 0002 GETMBR R1 R0 K1 + 0x24040302, // 0003 GT R1 R1 K2 + 0x78060004, // 0004 JMPF R1 #000A + 0x88040100, // 0005 GETMBR R1 R0 K0 + 0x8C040303, // 0006 GETMET R1 R1 K3 + 0x880C0101, // 0007 GETMBR R3 R0 K1 + 0x7C040400, // 0008 CALL R1 2 + 0x80040200, // 0009 RET 1 R1 + 0x50040000, // 000A LDBOOL R1 0 0 + 0x80040200, // 000B RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: next +********************************************************************/ +be_local_closure(Trigger_next, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* 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(o), + /* K1 */ be_nested_str(next), + }), + &be_const_str_next, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x78060003, // 0001 JMPF R1 #0006 + 0x88040100, // 0002 GETMBR R1 R0 K0 + 0x8C040301, // 0003 GETMET R1 R1 K1 + 0x7C040200, // 0004 CALL R1 1 + 0x80040200, // 0005 RET 1 R1 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Trigger +********************************************************************/ +be_local_class(Trigger, + 4, + NULL, + be_nested_map(8, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(id, 2), be_const_var(2) }, + { be_const_key(f, -1), be_const_var(1) }, + { be_const_key(next, -1), be_const_closure(Trigger_next_closure) }, + { be_const_key(trig, 7), be_const_var(0) }, + { be_const_key(time_reached, -1), be_const_closure(Trigger_time_reached_closure) }, + { be_const_key(tostring, 4), be_const_closure(Trigger_tostring_closure) }, + { be_const_key(o, -1), be_const_var(3) }, + { be_const_key(init, -1), be_const_closure(Trigger_init_closure) }, + })), + (bstring*) &be_const_str_Trigger +); +/*******************************************************************/ + +void be_load_Trigger_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Trigger); + be_setglobal(vm, "Trigger"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified function: time_str +********************************************************************/ +be_local_closure(Tasmota_time_str, /* name */ + be_nested_proto( + 13, /* nstack */ + 2, /* argc */ + 2, /* 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: exec_cmd +********************************************************************/ +be_local_closure(Tasmota_exec_cmd, /* name */ + be_nested_proto( + 12, /* nstack */ + 4, /* argc */ + 2, /* 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: find_key_i +********************************************************************/ +be_local_closure(Tasmota_find_key_i, /* name */ + be_nested_proto( + 10, /* nstack */ + 3, /* argc */ + 2, /* 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: add_cron +********************************************************************/ +be_local_closure(Tasmota_add_cron, /* name */ + be_nested_proto( + 13, /* nstack */ + 4, /* argc */ + 2, /* 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(check_not_method), + /* K1 */ be_nested_str(_crons), + /* K2 */ be_nested_str(ccronexpr), + /* K3 */ be_nested_str(next), + /* K4 */ be_nested_str(push), + /* K5 */ be_nested_str(Trigger), + }), + &be_const_str_add_cron, + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0x8C100100, // 0000 GETMET R4 R0 K0 + 0x5C180400, // 0001 MOVE R6 R2 + 0x7C100400, // 0002 CALL R4 2 + 0x88100101, // 0003 GETMBR R4 R0 K1 + 0x74120002, // 0004 JMPT R4 #0008 + 0x60100012, // 0005 GETGBL R4 G18 + 0x7C100000, // 0006 CALL R4 0 + 0x90020204, // 0007 SETMBR R0 K1 R4 + 0xB8120400, // 0008 GETNGBL R4 K2 + 0x60140008, // 0009 GETGBL R5 G8 + 0x5C180200, // 000A MOVE R6 R1 + 0x7C140200, // 000B CALL R5 1 + 0x7C100200, // 000C CALL R4 1 + 0x8C140903, // 000D GETMET R5 R4 K3 + 0x7C140200, // 000E CALL R5 1 + 0x88180101, // 000F GETMBR R6 R0 K1 + 0x8C180D04, // 0010 GETMET R6 R6 K4 + 0xB8220A00, // 0011 GETNGBL R8 K5 + 0x5C240A00, // 0012 MOVE R9 R5 + 0x5C280400, // 0013 MOVE R10 R2 + 0x5C2C0600, // 0014 MOVE R11 R3 + 0x5C300800, // 0015 MOVE R12 R4 + 0x7C200800, // 0016 CALL R8 4 + 0x7C180400, // 0017 CALL R6 2 + 0x80000000, // 0018 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_timer +********************************************************************/ +be_local_closure(Tasmota_remove_timer, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* 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(_timers), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(size), + /* K3 */ be_nested_str(id), + /* K4 */ be_nested_str(remove), + /* K5 */ be_const_int(1), + }), + &be_const_str_remove_timer, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A000E, // 0001 JMPF R2 #0011 + 0x580C0001, // 0002 LDCONST R3 K1 + 0x8C100502, // 0003 GETMET R4 R2 K2 + 0x7C100200, // 0004 CALL R4 1 + 0x14100604, // 0005 LT R4 R3 R4 + 0x78120009, // 0006 JMPF R4 #0011 + 0x94100403, // 0007 GETIDX R4 R2 R3 + 0x88100903, // 0008 GETMBR R4 R4 K3 + 0x1C100801, // 0009 EQ R4 R4 R1 + 0x78120003, // 000A JMPF R4 #000F + 0x8C100504, // 000B GETMET R4 R2 K4 + 0x5C180600, // 000C MOVE R6 R3 + 0x7C100400, // 000D CALL R4 2 + 0x70020000, // 000E JMP #0010 + 0x000C0705, // 000F ADD R3 R3 K5 + 0x7001FFF1, // 0010 JMP #0003 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: run_deferred +********************************************************************/ +be_local_closure(Tasmota_run_deferred, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 2, /* 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(trig), + /* 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[25]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x78060015, // 0001 JMPF R1 #0018 + 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 + 0x780A000F, // 0007 JMPF R2 #0018 + 0x88080100, // 0008 GETMBR R2 R0 K0 + 0x94080401, // 0009 GETIDX R2 R2 R1 + 0x8C0C0103, // 000A GETMET R3 R0 K3 + 0x88140504, // 000B GETMBR R5 R2 K4 + 0x7C0C0400, // 000C CALL R3 2 + 0x780E0007, // 000D JMPF R3 #0016 + 0x880C0505, // 000E GETMBR R3 R2 K5 + 0x88100100, // 000F GETMBR R4 R0 K0 + 0x8C100906, // 0010 GETMET R4 R4 K6 + 0x5C180200, // 0011 MOVE R6 R1 + 0x7C100400, // 0012 CALL R4 2 + 0x5C100600, // 0013 MOVE R4 R3 + 0x7C100000, // 0014 CALL R4 0 + 0x70020000, // 0015 JMP #0017 + 0x00040307, // 0016 ADD R1 R1 K7 + 0x7001FFEA, // 0017 JMP #0003 + 0x80000000, // 0018 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_fast_loop +********************************************************************/ +be_local_closure(Tasmota_add_fast_loop, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* 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(check_not_method), + /* K1 */ be_nested_str(_fl), + /* K2 */ be_nested_str(function), + /* K3 */ be_nested_str(value_error), + /* K4 */ be_nested_str(argument_X20must_X20be_X20a_X20function), + /* K5 */ be_nested_str(global), + /* K6 */ be_nested_str(fast_loop_enabled), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str(push), + }), + &be_const_str_add_fast_loop, + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 + 0x5C100200, // 0001 MOVE R4 R1 + 0x7C080400, // 0002 CALL R2 2 + 0x88080101, // 0003 GETMBR R2 R0 K1 + 0x740A0002, // 0004 JMPT R2 #0008 + 0x60080012, // 0005 GETGBL R2 G18 + 0x7C080000, // 0006 CALL R2 0 + 0x90020202, // 0007 SETMBR R0 K1 R2 + 0x60080004, // 0008 GETGBL R2 G4 + 0x5C0C0200, // 0009 MOVE R3 R1 + 0x7C080200, // 000A CALL R2 1 + 0x20080502, // 000B NE R2 R2 K2 + 0x780A0000, // 000C JMPF R2 #000E + 0xB0060704, // 000D RAISE 1 K3 K4 + 0x88080105, // 000E GETMBR R2 R0 K5 + 0x900A0D07, // 000F SETMBR R2 K6 K7 + 0x88080101, // 0010 GETMBR R2 R0 K1 + 0x8C080508, // 0011 GETMET R2 R2 K8 + 0x5C100200, // 0012 MOVE R4 R1 + 0x7C080400, // 0013 CALL R2 2 + 0x80000000, // 0014 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: exec_tele +********************************************************************/ +be_local_closure(Tasmota_exec_tele, /* name */ + be_nested_proto( + 12, /* nstack */ + 2, /* argc */ + 2, /* 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(trig), + /* K10 */ be_nested_str(f), + /* 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: load +********************************************************************/ +be_local_closure(Tasmota_load, /* name */ + be_nested_proto( + 27, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 6]) { + 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 + }) + ), + 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[10]) { /* constants */ + /* K0 */ be_nested_str(r), + /* K1 */ be_nested_str(readbytes), + /* K2 */ be_const_int(3), + /* K3 */ be_const_int(1), + /* K4 */ be_nested_str(BECDFE), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str(close), + /* K7 */ be_nested_str(string), + /* K8 */ be_nested_str(format), + /* K9 */ be_nested_str(BRY_X3A_X20failed_X20to_X20load_X20compiled_X20_X27_X25s_X27_X20_X28_X25s_X29), + }), + &be_const_str_try_get_bec_version, + &be_const_str_solidified, + ( &(const binstruction[44]) { /* code */ + 0x4C040000, // 0000 LDNIL R1 + 0xA8020016, // 0001 EXBLK 0 #0019 + 0x60080011, // 0002 GETGBL R2 G17 + 0x5C0C0000, // 0003 MOVE R3 R0 + 0x58100000, // 0004 LDCONST R4 K0 + 0x7C080400, // 0005 CALL R2 2 + 0x5C040400, // 0006 MOVE R1 R2 + 0x8C080301, // 0007 GETMET R2 R1 K1 + 0x58100002, // 0008 LDCONST R4 K2 + 0x7C080400, // 0009 CALL R2 2 + 0x8C0C0301, // 000A GETMET R3 R1 K1 + 0x58140003, // 000B LDCONST R5 K3 + 0x7C0C0400, // 000C CALL R3 2 + 0x60100015, // 000D GETGBL R4 G21 + 0x58140004, // 000E LDCONST R5 K4 + 0x7C100200, // 000F CALL R4 1 + 0x1C100404, // 0010 EQ R4 R2 R4 + 0x78120002, // 0011 JMPF R4 #0015 + 0x94100705, // 0012 GETIDX R4 R3 K5 + 0xA8040001, // 0013 EXBLK 1 1 + 0x80040800, // 0014 RET 1 R4 + 0x8C100306, // 0015 GETMET R4 R1 K6 + 0x7C100200, // 0016 CALL R4 1 + 0xA8040001, // 0017 EXBLK 1 1 + 0x70020010, // 0018 JMP #002A + 0xAC080001, // 0019 CATCH R2 0 1 + 0x7002000D, // 001A JMP #0029 + 0x4C0C0000, // 001B LDNIL R3 + 0x200C0203, // 001C NE R3 R1 R3 + 0x780E0001, // 001D JMPF R3 #0020 + 0x8C0C0306, // 001E GETMET R3 R1 K6 + 0x7C0C0200, // 001F CALL R3 1 + 0xA40E0E00, // 0020 IMPORT R3 K7 + 0x60100001, // 0021 GETGBL R4 G1 + 0x8C140708, // 0022 GETMET R5 R3 K8 + 0x581C0009, // 0023 LDCONST R7 K9 + 0x5C200000, // 0024 MOVE R8 R0 + 0x5C240400, // 0025 MOVE R9 R2 + 0x7C140800, // 0026 CALL R5 4 + 0x7C100200, // 0027 CALL R4 1 + 0x70020000, // 0028 JMP #002A + 0xB0080000, // 0029 RAISE 2 R0 R0 + 0x4C080000, // 002A LDNIL R2 + 0x80040400, // 002B RET 1 R2 + }) + ), + 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(path), + /* K1 */ be_nested_str(remove), + }), + &be_const_str_try_remove_file, + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA8020006, // 0001 EXBLK 0 #0009 + 0x8C080301, // 0002 GETMET R2 R1 K1 + 0x5C100000, // 0003 MOVE R4 R0 + 0x7C080400, // 0004 CALL R2 2 + 0xA8040001, // 0005 EXBLK 1 1 + 0x80040400, // 0006 RET 1 R2 + 0xA8040001, // 0007 EXBLK 1 1 + 0x70020003, // 0008 JMP #000D + 0xAC080000, // 0009 CATCH R2 0 0 + 0x70020000, // 000A JMP #000C + 0x70020000, // 000B JMP #000D + 0xB0080000, // 000C RAISE 2 R0 R0 + 0x50080000, // 000D LDBOOL R2 0 0 + 0x80040400, // 000E RET 1 R2 + }) + ), + 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[ 4]) { /* constants */ + /* K0 */ be_nested_str(file), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(format), + /* K3 */ be_nested_str(BRY_X3A_X20failed_X20to_X20load_X20_X27_X25s_X27_X20_X28_X25s_X20_X2D_X20_X25s_X29), + }), + &be_const_str_try_compile, + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0xA8020007, // 0000 EXBLK 0 #0009 + 0x6004000D, // 0001 GETGBL R1 G13 + 0x5C080000, // 0002 MOVE R2 R0 + 0x580C0000, // 0003 LDCONST R3 K0 + 0x7C040400, // 0004 CALL R1 2 + 0xA8040001, // 0005 EXBLK 1 1 + 0x80040200, // 0006 RET 1 R1 + 0xA8040001, // 0007 EXBLK 1 1 + 0x7002000C, // 0008 JMP #0016 + 0xAC040002, // 0009 CATCH R1 0 2 + 0x70020009, // 000A JMP #0015 + 0xA40E0200, // 000B IMPORT R3 K1 + 0x60100001, // 000C GETGBL R4 G1 + 0x8C140702, // 000D GETMET R5 R3 K2 + 0x581C0003, // 000E LDCONST R7 K3 + 0x5C200000, // 000F MOVE R8 R0 + 0x5C240200, // 0010 MOVE R9 R1 + 0x5C280400, // 0011 MOVE R10 R2 + 0x7C140A00, // 0012 CALL R5 5 + 0x7C100200, // 0013 CALL R4 1 + 0x70020000, // 0014 JMP #0016 + 0xB0080000, // 0015 RAISE 2 R0 R0 + 0x4C040000, // 0016 LDNIL R1 + 0x80040200, // 0017 RET 1 R1 + }) + ), + 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[ 3]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(format), + /* K2 */ be_nested_str(BRY_X3A_X20failed_X20to_X20run_X20compiled_X20code_X20_X27_X25s_X27_X20_X2D_X20_X25s), + }), + &be_const_str_try_run_compiled, + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0x4C040000, // 0000 LDNIL R1 + 0x20040001, // 0001 NE R1 R0 R1 + 0x78060013, // 0002 JMPF R1 #0017 + 0xA8020006, // 0003 EXBLK 0 #000B + 0x5C040000, // 0004 MOVE R1 R0 + 0x7C040000, // 0005 CALL R1 0 + 0x50040200, // 0006 LDBOOL R1 1 0 + 0xA8040001, // 0007 EXBLK 1 1 + 0x80040200, // 0008 RET 1 R1 + 0xA8040001, // 0009 EXBLK 1 1 + 0x7002000B, // 000A JMP #0017 + 0xAC040002, // 000B CATCH R1 0 2 + 0x70020008, // 000C JMP #0016 + 0xA40E0000, // 000D IMPORT R3 K0 + 0x60100001, // 000E GETGBL R4 G1 + 0x8C140701, // 000F GETMET R5 R3 K1 + 0x581C0002, // 0010 LDCONST R7 K2 + 0x5C200200, // 0011 MOVE R8 R1 + 0x5C240400, // 0012 MOVE R9 R2 + 0x7C140800, // 0013 CALL R5 4 + 0x7C100200, // 0014 CALL R4 1 + 0x70020000, // 0015 JMP #0017 + 0xB0080000, // 0016 RAISE 2 R0 R0 + 0x50040000, // 0017 LDBOOL R1 0 0 + 0x80040200, // 0018 RET 1 R1 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[22]) { /* 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(format), + /* K18 */ be_nested_str(BRY_X3A_X20corrupt_X20bytecode_X20_X27_X25s_X27), + /* K19 */ be_nested_str(BRY_X3A_X20bytecode_X20has_X20wrong_X20version_X20_X27_X25s_X27_X20_X28_X25i_X29), + /* K20 */ be_nested_str(save), + /* K21 */ 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[176]) { /* code */ + 0x84080000, // 0000 CLOSURE R2 P0 + 0x840C0001, // 0001 CLOSURE R3 P1 + 0x84100002, // 0002 CLOSURE R4 P2 + 0x84140003, // 0003 CLOSURE R5 P3 + 0x84180004, // 0004 CLOSURE R6 P4 + 0x841C0005, // 0005 CLOSURE R7 P5 + 0xA4220000, // 0006 IMPORT R8 K0 + 0xA4260200, // 0007 IMPORT R9 K1 + 0x6028000C, // 0008 GETGBL R10 G12 + 0x5C2C0200, // 0009 MOVE R11 R1 + 0x7C280200, // 000A CALL R10 1 + 0x1C281502, // 000B EQ R10 R10 K2 + 0x782A0001, // 000C JMPF R10 #000F + 0x50280000, // 000D LDBOOL R10 0 0 + 0x80041400, // 000E RET 1 R10 + 0x94280302, // 000F GETIDX R10 R1 K2 + 0x20281503, // 0010 NE R10 R10 K3 + 0x782A0000, // 0011 JMPF R10 #0013 + 0x00060601, // 0012 ADD R1 K3 R1 + 0x8C281104, // 0013 GETMET R10 R8 K4 + 0x5C300200, // 0014 MOVE R12 R1 + 0x58340005, // 0015 LDCONST R13 K5 + 0x7C280600, // 0016 CALL R10 3 + 0x942C1502, // 0017 GETIDX R11 R10 K2 + 0x5431FFFE, // 0018 LDINT R12 -1 + 0x9430140C, // 0019 GETIDX R12 R10 R12 + 0x6034000C, // 001A GETGBL R13 G12 + 0x5C381400, // 001B MOVE R14 R10 + 0x7C340200, // 001C CALL R13 1 + 0x24341B06, // 001D GT R13 R13 K6 + 0x8C381107, // 001E GETMET R14 R8 K7 + 0x5C401800, // 001F MOVE R16 R12 + 0x58440008, // 0020 LDCONST R17 K8 + 0x7C380600, // 0021 CALL R14 3 + 0x14381D02, // 0022 LT R14 R14 K2 + 0x783A0001, // 0023 JMPF R14 #0026 + 0x00040309, // 0024 ADD R1 R1 K9 + 0x00301909, // 0025 ADD R12 R12 K9 + 0x5439FFFC, // 0026 LDINT R14 -3 + 0x543DFFFE, // 0027 LDINT R15 -1 + 0x40381C0F, // 0028 CONNECT R14 R14 R15 + 0x9438180E, // 0029 GETIDX R14 R12 R14 + 0x1C381D09, // 002A EQ R14 R14 K9 + 0x543DFFFB, // 002B LDINT R15 -4 + 0x5441FFFE, // 002C LDINT R16 -1 + 0x403C1E10, // 002D CONNECT R15 R15 R16 + 0x943C180F, // 002E GETIDX R15 R12 R15 + 0x1C3C1F0A, // 002F EQ R15 R15 K10 + 0x5C401C00, // 0030 MOVE R16 R14 + 0x74420002, // 0031 JMPT R16 #0035 + 0x5C401E00, // 0032 MOVE R16 R15 + 0x74420000, // 0033 JMPT R16 #0035 + 0xB006170C, // 0034 RAISE 1 K11 K12 + 0x8C40130D, // 0035 GETMET R16 R9 K13 + 0x5C480200, // 0036 MOVE R18 R1 + 0x7C400400, // 0037 CALL R16 2 + 0x783E0001, // 0038 JMPF R15 #003B + 0x5C440200, // 0039 MOVE R17 R1 + 0x70020000, // 003A JMP #003C + 0x0044030E, // 003B ADD R17 R1 K14 + 0x783E0005, // 003C JMPF R15 #0043 + 0x4C480000, // 003D LDNIL R18 + 0x1C482012, // 003E EQ R18 R16 R18 + 0x784A0001, // 003F JMPF R18 #0042 + 0x50480000, // 0040 LDBOOL R18 0 0 + 0x80042400, // 0041 RET 1 R18 + 0x70020013, // 0042 JMP #0057 + 0x8C48130D, // 0043 GETMET R18 R9 K13 + 0x5C502200, // 0044 MOVE R20 R17 + 0x7C480400, // 0045 CALL R18 2 + 0x4C4C0000, // 0046 LDNIL R19 + 0x1C4C2013, // 0047 EQ R19 R16 R19 + 0x784E0004, // 0048 JMPF R19 #004E + 0x4C4C0000, // 0049 LDNIL R19 + 0x1C4C2413, // 004A EQ R19 R18 R19 + 0x784E0001, // 004B JMPF R19 #004E + 0x504C0000, // 004C LDBOOL R19 0 0 + 0x80042600, // 004D RET 1 R19 + 0x4C4C0000, // 004E LDNIL R19 + 0x204C2413, // 004F NE R19 R18 R19 + 0x784E0005, // 0050 JMPF R19 #0057 + 0x4C4C0000, // 0051 LDNIL R19 + 0x1C4C2013, // 0052 EQ R19 R16 R19 + 0x744E0001, // 0053 JMPT R19 #0056 + 0x284C2410, // 0054 GE R19 R18 R16 + 0x784E0000, // 0055 JMPF R19 #0057 + 0x503C0200, // 0056 LDBOOL R15 1 0 + 0x78360005, // 0057 JMPF R13 #005E + 0x00481705, // 0058 ADD R18 R11 K5 + 0x90021E12, // 0059 SETMBR R0 K15 R18 + 0x5C480400, // 005A MOVE R18 R2 + 0x884C010F, // 005B GETMBR R19 R0 K15 + 0x7C480200, // 005C CALL R18 1 + 0x70020000, // 005D JMP #005F + 0x90021F10, // 005E SETMBR R0 K15 K16 + 0x4C480000, // 005F LDNIL R18 + 0x783E0025, // 0060 JMPF R15 #0087 + 0x5C4C0800, // 0061 MOVE R19 R4 + 0x5C502200, // 0062 MOVE R20 R17 + 0x7C4C0200, // 0063 CALL R19 1 + 0x50500200, // 0064 LDBOOL R20 1 0 + 0x4C540000, // 0065 LDNIL R21 + 0x1C542615, // 0066 EQ R21 R19 R21 + 0x78560007, // 0067 JMPF R21 #0070 + 0x60540001, // 0068 GETGBL R21 G1 + 0x8C581111, // 0069 GETMET R22 R8 K17 + 0x58600012, // 006A LDCONST R24 K18 + 0x5C642200, // 006B MOVE R25 R17 + 0x7C580600, // 006C CALL R22 3 + 0x7C540200, // 006D CALL R21 1 + 0x50500000, // 006E LDBOOL R20 0 0 + 0x7002000A, // 006F JMP #007B + 0x54560003, // 0070 LDINT R21 4 + 0x20542615, // 0071 NE R21 R19 R21 + 0x78560007, // 0072 JMPF R21 #007B + 0x60540001, // 0073 GETGBL R21 G1 + 0x8C581111, // 0074 GETMET R22 R8 K17 + 0x58600013, // 0075 LDCONST R24 K19 + 0x5C642200, // 0076 MOVE R25 R17 + 0x5C682600, // 0077 MOVE R26 R19 + 0x7C580800, // 0078 CALL R22 4 + 0x7C540200, // 0079 CALL R21 1 + 0x50500000, // 007A LDBOOL R20 0 0 + 0x78520003, // 007B JMPF R20 #0080 + 0x5C540C00, // 007C MOVE R21 R6 + 0x5C582200, // 007D MOVE R22 R17 + 0x7C540200, // 007E CALL R21 1 + 0x5C482A00, // 007F MOVE R18 R21 + 0x4C540000, // 0080 LDNIL R21 + 0x1C542415, // 0081 EQ R21 R18 R21 + 0x78560003, // 0082 JMPF R21 #0087 + 0x5C540A00, // 0083 MOVE R21 R5 + 0x5C582200, // 0084 MOVE R22 R17 + 0x7C540200, // 0085 CALL R21 1 + 0x503C0000, // 0086 LDBOOL R15 0 0 + 0x783A0006, // 0087 JMPF R14 #008F + 0x4C4C0000, // 0088 LDNIL R19 + 0x1C4C2413, // 0089 EQ R19 R18 R19 + 0x784E0003, // 008A JMPF R19 #008F + 0x5C4C0C00, // 008B MOVE R19 R6 + 0x5C500200, // 008C MOVE R20 R1 + 0x7C4C0200, // 008D CALL R19 1 + 0x5C482600, // 008E MOVE R18 R19 + 0x4C4C0000, // 008F LDNIL R19 + 0x204C2413, // 0090 NE R19 R18 R19 + 0x784E0015, // 0091 JMPF R19 #00A8 + 0x5C4C1E00, // 0092 MOVE R19 R15 + 0x744E0013, // 0093 JMPT R19 #00A8 + 0x5C4C1A00, // 0094 MOVE R19 R13 + 0x744E0011, // 0095 JMPT R19 #00A8 + 0xA8020005, // 0096 EXBLK 0 #009D + 0x8C4C0114, // 0097 GETMET R19 R0 K20 + 0x5C542200, // 0098 MOVE R21 R17 + 0x5C582400, // 0099 MOVE R22 R18 + 0x7C4C0600, // 009A CALL R19 3 + 0xA8040001, // 009B EXBLK 1 1 + 0x7002000A, // 009C JMP #00A8 + 0xAC4C0001, // 009D CATCH R19 0 1 + 0x70020007, // 009E JMP #00A7 + 0x60500001, // 009F GETGBL R20 G1 + 0x8C541111, // 00A0 GETMET R21 R8 K17 + 0x585C0015, // 00A1 LDCONST R23 K21 + 0x5C602200, // 00A2 MOVE R24 R17 + 0x5C642600, // 00A3 MOVE R25 R19 + 0x7C540800, // 00A4 CALL R21 4 + 0x7C500200, // 00A5 CALL R20 1 + 0x70020000, // 00A6 JMP #00A8 + 0xB0080000, // 00A7 RAISE 2 R0 R0 + 0x5C4C0E00, // 00A8 MOVE R19 R7 + 0x5C502400, // 00A9 MOVE R20 R18 + 0x7C4C0200, // 00AA CALL R19 1 + 0x78360002, // 00AB JMPF R13 #00AF + 0x5C500600, // 00AC MOVE R20 R3 + 0x00541705, // 00AD ADD R21 R11 K5 + 0x7C500200, // 00AE CALL R20 1 + 0x80042600, // 00AF RET 1 R19 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: try_rule +********************************************************************/ +be_local_closure(Tasmota_try_rule, /* name */ + be_nested_proto( + 15, /* nstack */ + 4, /* argc */ + 2, /* 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: remove_rule +********************************************************************/ +be_local_closure(Tasmota_remove_rule, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 2, /* 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_const_int(0), + /* K2 */ be_nested_str(trig), + /* K3 */ be_nested_str(id), + /* K4 */ be_nested_str(remove), + /* K5 */ be_const_int(1), + }), + &be_const_str_remove_rule, + &be_const_str_solidified, + ( &(const binstruction[26]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x780E0016, // 0001 JMPF R3 #0019 + 0x580C0001, // 0002 LDCONST R3 K1 + 0x6010000C, // 0003 GETGBL R4 G12 + 0x88140100, // 0004 GETMBR R5 R0 K0 + 0x7C100200, // 0005 CALL R4 1 + 0x14100604, // 0006 LT R4 R3 R4 + 0x78120010, // 0007 JMPF R4 #0019 + 0x88100100, // 0008 GETMBR R4 R0 K0 + 0x94100803, // 0009 GETIDX R4 R4 R3 + 0x88100902, // 000A GETMBR R4 R4 K2 + 0x1C100801, // 000B EQ R4 R4 R1 + 0x78120009, // 000C JMPF R4 #0017 + 0x88100100, // 000D GETMBR R4 R0 K0 + 0x94100803, // 000E GETIDX R4 R4 R3 + 0x88100903, // 000F GETMBR R4 R4 K3 + 0x1C100802, // 0010 EQ R4 R4 R2 + 0x78120004, // 0011 JMPF R4 #0017 + 0x88100100, // 0012 GETMBR R4 R0 K0 + 0x8C100904, // 0013 GETMET R4 R4 K4 + 0x5C180600, // 0014 MOVE R6 R3 + 0x7C100400, // 0015 CALL R4 2 + 0x70020000, // 0016 JMP #0018 + 0x000C0705, // 0017 ADD R3 R3 K5 + 0x7001FFE9, // 0018 JMP #0003 + 0x80000000, // 0019 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: cmd +********************************************************************/ +be_local_closure(Tasmota_cmd, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* 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 */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x500C0200, // 0001 LDBOOL R3 1 0 + 0x90020003, // 0002 SETMBR R0 K0 R3 + 0x8C0C0101, // 0003 GETMET R3 R0 K1 + 0x5C140200, // 0004 MOVE R5 R1 + 0x7C0C0400, // 0005 CALL R3 2 + 0x4C0C0000, // 0006 LDNIL R3 + 0x88100100, // 0007 GETMBR R4 R0 K0 + 0x50140200, // 0008 LDBOOL R5 1 0 + 0x20100805, // 0009 NE R4 R4 R5 + 0x78120000, // 000A JMPF R4 #000C + 0x880C0100, // 000B GETMBR R3 R0 K0 + 0x90020002, // 000C SETMBR R0 K0 R2 + 0x80040600, // 000D RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_cron +********************************************************************/ +be_local_closure(Tasmota_remove_cron, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 2, /* 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(_crons), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(size), + /* K3 */ be_nested_str(id), + /* K4 */ be_nested_str(remove), + /* K5 */ be_const_int(1), + }), + &be_const_str_remove_cron, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A000E, // 0001 JMPF R2 #0011 + 0x580C0001, // 0002 LDCONST R3 K1 + 0x8C100502, // 0003 GETMET R4 R2 K2 + 0x7C100200, // 0004 CALL R4 1 + 0x14100604, // 0005 LT R4 R3 R4 + 0x78120009, // 0006 JMPF R4 #0011 + 0x94100403, // 0007 GETIDX R4 R2 R3 + 0x88100903, // 0008 GETMBR R4 R4 K3 + 0x1C100801, // 0009 EQ R4 R4 R1 + 0x78120003, // 000A JMPF R4 #000F + 0x8C100504, // 000B GETMET R4 R2 K4 + 0x5C180600, // 000C MOVE R6 R3 + 0x7C100400, // 000D CALL R4 2 + 0x70020000, // 000E JMP #0010 + 0x000C0705, // 000F ADD R3 R3 K5 + 0x7001FFF1, // 0010 JMP #0003 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: next_cron +********************************************************************/ +be_local_closure(Tasmota_next_cron, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* 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(_crons), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(size), + /* K3 */ be_nested_str(id), + /* K4 */ be_nested_str(trig), + /* K5 */ be_const_int(1), + }), + &be_const_str_next_cron, + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x780A000D, // 0001 JMPF R2 #0010 + 0x580C0001, // 0002 LDCONST R3 K1 + 0x8C100502, // 0003 GETMET R4 R2 K2 + 0x7C100200, // 0004 CALL R4 1 + 0x14100604, // 0005 LT R4 R3 R4 + 0x78120008, // 0006 JMPF R4 #0010 + 0x94100403, // 0007 GETIDX R4 R2 R3 + 0x88100903, // 0008 GETMBR R4 R4 K3 + 0x1C100801, // 0009 EQ R4 R4 R1 + 0x78120002, // 000A JMPF R4 #000E + 0x94100403, // 000B GETIDX R4 R2 R3 + 0x88100904, // 000C GETMBR R4 R4 K4 + 0x80040800, // 000D RET 1 R4 + 0x000C0705, // 000E ADD R3 R3 K5 + 0x7001FFF2, // 000F JMP #0003 + 0x80000000, // 0010 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: hs2rgb +********************************************************************/ +be_local_closure(Tasmota_hs2rgb, /* name */ + be_nested_proto( + 17, /* nstack */ + 3, /* argc */ + 2, /* 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: set_light +********************************************************************/ +be_local_closure(Tasmota_set_light, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 2, /* 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: gc +********************************************************************/ +be_local_closure(Tasmota_gc, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* 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: add_rule +********************************************************************/ +be_local_closure(Tasmota_add_rule, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 2, /* 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(check_not_method), + /* K1 */ be_nested_str(_rules), + /* K2 */ be_nested_str(function), + /* K3 */ be_nested_str(push), + /* K4 */ be_nested_str(Trigger), + /* K5 */ be_nested_str(value_error), + /* K6 */ be_nested_str(the_X20second_X20argument_X20is_X20not_X20a_X20function), + }), + &be_const_str_add_rule, + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0x8C100100, // 0000 GETMET R4 R0 K0 + 0x5C180400, // 0001 MOVE R6 R2 + 0x7C100400, // 0002 CALL R4 2 + 0x88100101, // 0003 GETMBR R4 R0 K1 + 0x74120002, // 0004 JMPT R4 #0008 + 0x60100012, // 0005 GETGBL R4 G18 + 0x7C100000, // 0006 CALL R4 0 + 0x90020204, // 0007 SETMBR R0 K1 R4 + 0x60100004, // 0008 GETGBL R4 G4 + 0x5C140400, // 0009 MOVE R5 R2 + 0x7C100200, // 000A CALL R4 1 + 0x1C100902, // 000B EQ R4 R4 K2 + 0x78120008, // 000C JMPF R4 #0016 + 0x88100101, // 000D GETMBR R4 R0 K1 + 0x8C100903, // 000E GETMET R4 R4 K3 + 0xB81A0800, // 000F GETNGBL R6 K4 + 0x5C1C0200, // 0010 MOVE R7 R1 + 0x5C200400, // 0011 MOVE R8 R2 + 0x5C240600, // 0012 MOVE R9 R3 + 0x7C180600, // 0013 CALL R6 3 + 0x7C100400, // 0014 CALL R4 2 + 0x70020000, // 0015 JMP #0017 + 0xB0060B06, // 0016 RAISE 1 K5 K6 + 0x80000000, // 0017 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: wire_scan +********************************************************************/ +be_local_closure(Tasmota_wire_scan, /* name */ + be_nested_proto( + 6, /* nstack */ + 3, /* argc */ + 2, /* 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 */ + 2, /* 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: event +********************************************************************/ +be_local_closure(Tasmota_event, /* name */ + be_nested_proto( + 21, /* nstack */ + 6, /* argc */ + 2, /* 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(string), + /* K2 */ be_nested_str(every_50ms), + /* K3 */ be_nested_str(run_deferred), + /* K4 */ be_nested_str(every_250ms), + /* K5 */ be_nested_str(run_cron), + /* K6 */ be_nested_str(mqtt_data), + /* K7 */ be_nested_str(cmd), + /* K8 */ be_nested_str(exec_cmd), + /* K9 */ be_nested_str(tele), + /* K10 */ be_nested_str(exec_tele), + /* K11 */ be_nested_str(rule), + /* K12 */ be_nested_str(exec_rules), + /* K13 */ be_nested_str(gc), + /* K14 */ be_nested_str(_drivers), + /* K15 */ be_const_int(0), + /* K16 */ be_nested_str(get), + /* K17 */ be_nested_str(function), + /* K18 */ be_nested_str(format), + /* K19 */ be_nested_str(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s), + /* K20 */ be_nested_str(_debug_present), + /* K21 */ be_nested_str(debug), + /* K22 */ be_nested_str(traceback), + /* K23 */ be_const_int(1), + /* K24 */ be_nested_str(save_before_restart), + /* K25 */ be_nested_str(persist), + /* K26 */ be_nested_str(save), + }), + &be_const_str_event, + &be_const_str_solidified, + ( &(const binstruction[109]) { /* 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 + 0x1C200304, // 0006 EQ R8 R1 K4 + 0x78220001, // 0007 JMPF R8 #000A + 0x8C200105, // 0008 GETMET R8 R0 K5 + 0x7C200200, // 0009 CALL R8 1 + 0x50200000, // 000A LDBOOL R8 0 0 + 0x50240000, // 000B LDBOOL R9 0 0 + 0x1C280306, // 000C EQ R10 R1 K6 + 0x782A0000, // 000D JMPF R10 #000F + 0x50240200, // 000E LDBOOL R9 1 0 + 0x1C280307, // 000F EQ R10 R1 K7 + 0x782A0006, // 0010 JMPF R10 #0018 + 0x8C280108, // 0011 GETMET R10 R0 K8 + 0x5C300400, // 0012 MOVE R12 R2 + 0x5C340600, // 0013 MOVE R13 R3 + 0x5C380800, // 0014 MOVE R14 R4 + 0x7C280800, // 0015 CALL R10 4 + 0x80041400, // 0016 RET 1 R10 + 0x7002004E, // 0017 JMP #0067 + 0x1C280309, // 0018 EQ R10 R1 K9 + 0x782A0004, // 0019 JMPF R10 #001F + 0x8C28010A, // 001A GETMET R10 R0 K10 + 0x5C300800, // 001B MOVE R12 R4 + 0x7C280400, // 001C CALL R10 2 + 0x80041400, // 001D RET 1 R10 + 0x70020047, // 001E JMP #0067 + 0x1C28030B, // 001F EQ R10 R1 K11 + 0x782A0007, // 0020 JMPF R10 #0029 + 0x8C28010C, // 0021 GETMET R10 R0 K12 + 0x5C300800, // 0022 MOVE R12 R4 + 0x60340017, // 0023 GETGBL R13 G23 + 0x5C380600, // 0024 MOVE R14 R3 + 0x7C340200, // 0025 CALL R13 1 + 0x7C280600, // 0026 CALL R10 3 + 0x80041400, // 0027 RET 1 R10 + 0x7002003D, // 0028 JMP #0067 + 0x1C28030D, // 0029 EQ R10 R1 K13 + 0x782A0003, // 002A JMPF R10 #002F + 0x8C28010D, // 002B GETMET R10 R0 K13 + 0x7C280200, // 002C CALL R10 1 + 0x80041400, // 002D RET 1 R10 + 0x70020037, // 002E JMP #0067 + 0x8828010E, // 002F GETMBR R10 R0 K14 + 0x782A0035, // 0030 JMPF R10 #0067 + 0x5828000F, // 0031 LDCONST R10 K15 + 0x602C000C, // 0032 GETGBL R11 G12 + 0x8830010E, // 0033 GETMBR R12 R0 K14 + 0x7C2C0200, // 0034 CALL R11 1 + 0x142C140B, // 0035 LT R11 R10 R11 + 0x782E002F, // 0036 JMPF R11 #0067 + 0x882C010E, // 0037 GETMBR R11 R0 K14 + 0x942C160A, // 0038 GETIDX R11 R11 R10 + 0x8C300D10, // 0039 GETMET R12 R6 K16 + 0x5C381600, // 003A MOVE R14 R11 + 0x5C3C0200, // 003B MOVE R15 R1 + 0x7C300600, // 003C CALL R12 3 + 0x60340004, // 003D GETGBL R13 G4 + 0x5C381800, // 003E MOVE R14 R12 + 0x7C340200, // 003F CALL R13 1 + 0x1C341B11, // 0040 EQ R13 R13 K17 + 0x78360022, // 0041 JMPF R13 #0065 + 0xA8020011, // 0042 EXBLK 0 #0055 + 0x5C341800, // 0043 MOVE R13 R12 + 0x5C381600, // 0044 MOVE R14 R11 + 0x5C3C0400, // 0045 MOVE R15 R2 + 0x5C400600, // 0046 MOVE R16 R3 + 0x5C440800, // 0047 MOVE R17 R4 + 0x5C480A00, // 0048 MOVE R18 R5 + 0x7C340A00, // 0049 CALL R13 5 + 0x74360001, // 004A JMPT R13 #004D + 0x74220000, // 004B JMPT R8 #004D + 0x50200001, // 004C LDBOOL R8 0 1 + 0x50200200, // 004D LDBOOL R8 1 0 + 0x78220003, // 004E JMPF R8 #0053 + 0x5C341200, // 004F MOVE R13 R9 + 0x74360001, // 0050 JMPT R13 #0053 + 0xA8040001, // 0051 EXBLK 1 1 + 0x70020013, // 0052 JMP #0067 + 0xA8040001, // 0053 EXBLK 1 1 + 0x7002000F, // 0054 JMP #0065 + 0xAC340002, // 0055 CATCH R13 0 2 + 0x7002000C, // 0056 JMP #0064 + 0x603C0001, // 0057 GETGBL R15 G1 + 0x8C400F12, // 0058 GETMET R16 R7 K18 + 0x58480013, // 0059 LDCONST R18 K19 + 0x5C4C1A00, // 005A MOVE R19 R13 + 0x5C501C00, // 005B MOVE R20 R14 + 0x7C400800, // 005C CALL R16 4 + 0x7C3C0200, // 005D CALL R15 1 + 0x883C0114, // 005E GETMBR R15 R0 K20 + 0x783E0002, // 005F JMPF R15 #0063 + 0xA43E2A00, // 0060 IMPORT R15 K21 + 0x8C401F16, // 0061 GETMET R16 R15 K22 + 0x7C400200, // 0062 CALL R16 1 + 0x70020000, // 0063 JMP #0065 + 0xB0080000, // 0064 RAISE 2 R0 R0 + 0x00281517, // 0065 ADD R10 R10 K23 + 0x7001FFCA, // 0066 JMP #0032 + 0x1C280318, // 0067 EQ R10 R1 K24 + 0x782A0002, // 0068 JMPF R10 #006C + 0xA42A3200, // 0069 IMPORT R10 K25 + 0x8C2C151A, // 006A GETMET R11 R10 K26 + 0x7C2C0200, // 006B CALL R11 1 + 0x80041000, // 006C RET 1 R8 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: fast_loop +********************************************************************/ +be_local_closure(Tasmota_fast_loop, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 2, /* 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(_fl), + /* K1 */ be_const_int(0), + /* K2 */ be_const_int(1), + }), + &be_const_str_fast_loop, + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x5C080200, // 0001 MOVE R2 R1 + 0x740A0000, // 0002 JMPT R2 #0004 + 0x80000400, // 0003 RET 0 + 0x58080001, // 0004 LDCONST R2 K1 + 0x600C000C, // 0005 GETGBL R3 G12 + 0x5C100200, // 0006 MOVE R4 R1 + 0x7C0C0200, // 0007 CALL R3 1 + 0x140C0403, // 0008 LT R3 R2 R3 + 0x780E0003, // 0009 JMPF R3 #000E + 0x940C0202, // 000A GETIDX R3 R1 R2 + 0x7C0C0000, // 000B CALL R3 0 + 0x00080502, // 000C ADD R2 R2 K2 + 0x7001FFF6, // 000D JMP #0005 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_fast_loop +********************************************************************/ +be_local_closure(Tasmota_remove_fast_loop, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* 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(_fl), + /* K1 */ be_nested_str(find), + /* K2 */ be_nested_str(remove), + }), + &be_const_str_remove_fast_loop, + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x740A0000, // 0001 JMPT R2 #0003 + 0x80000400, // 0002 RET 0 + 0x88080100, // 0003 GETMBR R2 R0 K0 + 0x8C080501, // 0004 GETMET R2 R2 K1 + 0x5C100200, // 0005 MOVE R4 R1 + 0x7C080400, // 0006 CALL R2 2 + 0x4C0C0000, // 0007 LDNIL R3 + 0x200C0403, // 0008 NE R3 R2 R3 + 0x780E0003, // 0009 JMPF R3 #000E + 0x880C0100, // 000A GETMBR R3 R0 K0 + 0x8C0C0702, // 000B GETMET R3 R3 K2 + 0x5C140400, // 000C MOVE R5 R2 + 0x7C0C0400, // 000D CALL R3 2 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: exec_rules +********************************************************************/ +be_local_closure(Tasmota_exec_rules, /* name */ + be_nested_proto( + 14, /* nstack */ + 3, /* argc */ + 2, /* 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(cmd_res), + /* K1 */ be_nested_str(_rules), + /* 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(trig), + /* K10 */ be_nested_str(f), + /* K11 */ be_const_int(1), + }), + &be_const_str_exec_rules, + &be_const_str_solidified, + ( &(const binstruction[50]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x88100101, // 0001 GETMBR R4 R0 K1 + 0x74120002, // 0002 JMPT R4 #0006 + 0x4C100000, // 0003 LDNIL R4 + 0x20100604, // 0004 NE R4 R3 R4 + 0x78120029, // 0005 JMPF R4 #0030 + 0xA4120400, // 0006 IMPORT R4 K2 + 0x4C140000, // 0007 LDNIL R5 + 0x90020005, // 0008 SETMBR R0 K0 R5 + 0x50140000, // 0009 LDBOOL R5 0 0 + 0x8C180903, // 000A GETMET R6 R4 K3 + 0x5C200200, // 000B MOVE R8 R1 + 0x7C180400, // 000C CALL R6 2 + 0x4C1C0000, // 000D LDNIL R7 + 0x1C1C0C07, // 000E EQ R7 R6 R7 + 0x781E0004, // 000F JMPF R7 #0015 + 0x8C1C0104, // 0010 GETMET R7 R0 K4 + 0x00260A01, // 0011 ADD R9 K5 R1 + 0x58280006, // 0012 LDCONST R10 K6 + 0x7C1C0600, // 0013 CALL R7 3 + 0x5C180200, // 0014 MOVE R6 R1 + 0x780A0014, // 0015 JMPF R2 #002B + 0x881C0101, // 0016 GETMBR R7 R0 K1 + 0x781E0012, // 0017 JMPF R7 #002B + 0x581C0007, // 0018 LDCONST R7 K7 + 0x6020000C, // 0019 GETGBL R8 G12 + 0x88240101, // 001A GETMBR R9 R0 K1 + 0x7C200200, // 001B CALL R8 1 + 0x14200E08, // 001C LT R8 R7 R8 + 0x7822000C, // 001D JMPF R8 #002B + 0x88200101, // 001E GETMBR R8 R0 K1 + 0x94201007, // 001F GETIDX R8 R8 R7 + 0x8C240108, // 0020 GETMET R9 R0 K8 + 0x5C2C0C00, // 0021 MOVE R11 R6 + 0x88301109, // 0022 GETMBR R12 R8 K9 + 0x8834110A, // 0023 GETMBR R13 R8 K10 + 0x7C240800, // 0024 CALL R9 4 + 0x74260001, // 0025 JMPT R9 #0028 + 0x74160000, // 0026 JMPT R5 #0028 + 0x50140001, // 0027 LDBOOL R5 0 1 + 0x50140200, // 0028 LDBOOL R5 1 0 + 0x001C0F0B, // 0029 ADD R7 R7 K11 + 0x7001FFED, // 002A JMP #0019 + 0x4C1C0000, // 002B LDNIL R7 + 0x201C0607, // 002C NE R7 R3 R7 + 0x781E0000, // 002D JMPF R7 #002F + 0x90020006, // 002E SETMBR R0 K0 R6 + 0x80040A00, // 002F RET 1 R5 + 0x50100000, // 0030 LDBOOL R4 0 0 + 0x80040800, // 0031 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_cmd +********************************************************************/ +be_local_closure(Tasmota_add_cmd, /* name */ + be_nested_proto( + 6, /* nstack */ + 3, /* argc */ + 2, /* 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(check_not_method), + /* K1 */ be_nested_str(_ccmd), + /* K2 */ be_nested_str(function), + /* K3 */ be_nested_str(value_error), + /* K4 */ be_nested_str(the_X20second_X20argument_X20is_X20not_X20a_X20function), + }), + &be_const_str_add_cmd, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x8C0C0100, // 0000 GETMET R3 R0 K0 + 0x5C140400, // 0001 MOVE R5 R2 + 0x7C0C0400, // 0002 CALL R3 2 + 0x880C0101, // 0003 GETMBR R3 R0 K1 + 0x740E0002, // 0004 JMPT R3 #0008 + 0x600C0013, // 0005 GETGBL R3 G19 + 0x7C0C0000, // 0006 CALL R3 0 + 0x90020203, // 0007 SETMBR R0 K1 R3 + 0x600C0004, // 0008 GETGBL R3 G4 + 0x5C100400, // 0009 MOVE R4 R2 + 0x7C0C0200, // 000A CALL R3 1 + 0x1C0C0702, // 000B EQ R3 R3 K2 + 0x780E0002, // 000C JMPF R3 #0010 + 0x880C0101, // 000D GETMBR R3 R0 K1 + 0x980C0202, // 000E SETIDX R3 R1 R2 + 0x70020000, // 000F JMP #0011 + 0xB0060704, // 0010 RAISE 1 K3 K4 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: run_cron +********************************************************************/ +be_local_closure(Tasmota_run_cron, /* name */ + be_nested_proto( + 9, /* nstack */ + 1, /* argc */ + 2, /* 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(_crons), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(ccronexpr), + /* K3 */ be_nested_str(now), + /* K4 */ be_nested_str(size), + /* K5 */ be_nested_str(trig), + /* K6 */ be_nested_str(next), + /* K7 */ be_nested_str(time_reached), + /* K8 */ be_nested_str(f), + /* K9 */ be_const_int(1), + }), + &be_const_str_run_cron, + &be_const_str_solidified, + ( &(const binstruction[34]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x7806001E, // 0001 JMPF R1 #0021 + 0x58040001, // 0002 LDCONST R1 K1 + 0xB80A0400, // 0003 GETNGBL R2 K2 + 0x8C080503, // 0004 GETMET R2 R2 K3 + 0x7C080200, // 0005 CALL R2 1 + 0x880C0100, // 0006 GETMBR R3 R0 K0 + 0x8C0C0704, // 0007 GETMET R3 R3 K4 + 0x7C0C0200, // 0008 CALL R3 1 + 0x140C0203, // 0009 LT R3 R1 R3 + 0x780E0015, // 000A JMPF R3 #0021 + 0x880C0100, // 000B GETMBR R3 R0 K0 + 0x940C0601, // 000C GETIDX R3 R3 R1 + 0x88100705, // 000D GETMBR R4 R3 K5 + 0x1C100901, // 000E EQ R4 R4 K1 + 0x78120003, // 000F JMPF R4 #0014 + 0x8C100706, // 0010 GETMET R4 R3 K6 + 0x7C100200, // 0011 CALL R4 1 + 0x900E0A04, // 0012 SETMBR R3 K5 R4 + 0x7002000A, // 0013 JMP #001F + 0x8C100707, // 0014 GETMET R4 R3 K7 + 0x7C100200, // 0015 CALL R4 1 + 0x78120007, // 0016 JMPF R4 #001F + 0x88100708, // 0017 GETMBR R4 R3 K8 + 0x8C140706, // 0018 GETMET R5 R3 K6 + 0x7C140200, // 0019 CALL R5 1 + 0x900E0A05, // 001A SETMBR R3 K5 R5 + 0x5C180800, // 001B MOVE R6 R4 + 0x5C1C0400, // 001C MOVE R7 R2 + 0x5C200A00, // 001D MOVE R8 R5 + 0x7C180400, // 001E CALL R6 2 + 0x00040309, // 001F ADD R1 R1 K9 + 0x7001FFE4, // 0020 JMP #0006 + 0x80000000, // 0021 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: check_not_method +********************************************************************/ +be_local_closure(Tasmota_check_not_method, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* 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(introspect), + /* K1 */ be_nested_str(function), + /* K2 */ be_nested_str(type_error), + /* K3 */ be_nested_str(BRY_X3A_X20argument_X20must_X20be_X20a_X20function), + /* K4 */ be_nested_str(ismethod), + /* K5 */ be_nested_str(BRY_X3A_X20method_X20not_X20allowed_X2C_X20use_X20a_X20closure_X20like_X20_X27_X2F_X20args_X20_X2D_X3E_X20obj_X2Efunc_X28args_X29_X27), + }), + &be_const_str_check_not_method, + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x600C0004, // 0001 GETGBL R3 G4 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C0C0200, // 0003 CALL R3 1 + 0x200C0701, // 0004 NE R3 R3 K1 + 0x780E0000, // 0005 JMPF R3 #0007 + 0xB0060503, // 0006 RAISE 1 K2 K3 + 0x8C0C0504, // 0007 GETMET R3 R2 K4 + 0x5C140200, // 0008 MOVE R5 R1 + 0x7C0C0400, // 0009 CALL R3 2 + 0x50100200, // 000A LDBOOL R4 1 0 + 0x1C0C0604, // 000B EQ R3 R3 R4 + 0x780E0000, // 000C JMPF R3 #000E + 0xB0060505, // 000D RAISE 1 K2 K5 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: gen_cb +********************************************************************/ +be_local_closure(Tasmota_gen_cb, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* 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_timer +********************************************************************/ +be_local_closure(Tasmota_set_timer, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 2, /* 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(check_not_method), + /* K1 */ be_nested_str(_timers), + /* K2 */ be_nested_str(push), + /* K3 */ be_nested_str(Trigger), + /* K4 */ be_nested_str(millis), + }), + &be_const_str_set_timer, + &be_const_str_solidified, + ( &(const binstruction[19]) { /* code */ + 0x8C100100, // 0000 GETMET R4 R0 K0 + 0x5C180400, // 0001 MOVE R6 R2 + 0x7C100400, // 0002 CALL R4 2 + 0x88100101, // 0003 GETMBR R4 R0 K1 + 0x74120002, // 0004 JMPT R4 #0008 + 0x60100012, // 0005 GETGBL R4 G18 + 0x7C100000, // 0006 CALL R4 0 + 0x90020204, // 0007 SETMBR R0 K1 R4 + 0x88100101, // 0008 GETMBR R4 R0 K1 + 0x8C100902, // 0009 GETMET R4 R4 K2 + 0xB81A0600, // 000A GETNGBL R6 K3 + 0x8C1C0104, // 000B GETMET R7 R0 K4 + 0x5C240200, // 000C MOVE R9 R1 + 0x7C1C0400, // 000D CALL R7 2 + 0x5C200400, // 000E MOVE R8 R2 + 0x5C240600, // 000F MOVE R9 R3 + 0x7C180600, // 0010 CALL R6 3 + 0x7C100400, // 0011 CALL R4 2 + 0x80000000, // 0012 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: find_op +********************************************************************/ +be_local_closure(Tasmota_find_op, /* name */ + be_nested_proto( + 13, /* nstack */ + 2, /* argc */ + 2, /* 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(_find_op), + /* 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[41]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x580C0001, // 0001 LDCONST R3 K1 + 0x8C100102, // 0002 GETMET R4 R0 K2 + 0x5C180200, // 0003 MOVE R6 R1 + 0x501C0000, // 0004 LDBOOL R7 0 0 + 0x7C100600, // 0005 CALL R4 3 + 0x28140903, // 0006 GE R5 R4 K3 + 0x78160018, // 0007 JMPF R5 #0021 + 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 + 0x502C0200, // 0010 LDBOOL R11 1 0 + 0x7C200600, // 0011 CALL R8 3 + 0x5C101000, // 0012 MOVE R4 R8 + 0x28200903, // 0013 GE R8 R4 K3 + 0x7822000B, // 0014 JMPF R8 #0021 + 0x8C200504, // 0015 GETMET R8 R2 K4 + 0x5C280E00, // 0016 MOVE R10 R7 + 0x5C2C0800, // 0017 MOVE R11 R4 + 0x7C200600, // 0018 CALL R8 3 + 0x94241103, // 0019 GETIDX R9 R8 K3 + 0x94281105, // 001A GETIDX R10 R8 K5 + 0x602C0012, // 001B GETGBL R11 G18 + 0x7C2C0000, // 001C CALL R11 0 + 0x40301606, // 001D CONNECT R12 R11 R6 + 0x40301609, // 001E CONNECT R12 R11 R9 + 0x4030160A, // 001F CONNECT R12 R11 R10 + 0x80041600, // 0020 RET 1 R11 + 0x60140012, // 0021 GETGBL R5 G18 + 0x7C140000, // 0022 CALL R5 0 + 0x40180A01, // 0023 CONNECT R6 R5 R1 + 0x4C180000, // 0024 LDNIL R6 + 0x40180A06, // 0025 CONNECT R6 R5 R6 + 0x4C180000, // 0026 LDNIL R6 + 0x40180A06, // 0027 CONNECT R6 R5 R6 + 0x80040A00, // 0028 RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_driver +********************************************************************/ +be_local_closure(Tasmota_remove_driver, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* 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: get_light +********************************************************************/ +be_local_closure(Tasmota_get_light, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* 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 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_driver +********************************************************************/ +be_local_closure(Tasmota_add_driver, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* 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(instance), + /* K1 */ be_nested_str(value_error), + /* K2 */ be_nested_str(instance_X20required), + /* K3 */ be_nested_str(_drivers), + /* K4 */ be_nested_str(push), + }), + &be_const_str_add_driver, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x60080004, // 0000 GETGBL R2 G4 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x7C080200, // 0002 CALL R2 1 + 0x20080500, // 0003 NE R2 R2 K0 + 0x780A0000, // 0004 JMPF R2 #0006 + 0xB0060302, // 0005 RAISE 1 K1 K2 + 0x88080103, // 0006 GETMBR R2 R0 K3 + 0x780A0004, // 0007 JMPF R2 #000D + 0x88080103, // 0008 GETMBR R2 R0 K3 + 0x8C080504, // 0009 GETMET R2 R2 K4 + 0x5C100200, // 000A MOVE R4 R1 + 0x7C080400, // 000B CALL R2 2 + 0x70020003, // 000C JMP #0011 + 0x60080012, // 000D GETGBL R2 G18 + 0x7C080000, // 000E CALL R2 0 + 0x400C0401, // 000F CONNECT R3 R2 R1 + 0x90020602, // 0010 SETMBR R0 K3 R2 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_cmd +********************************************************************/ +be_local_closure(Tasmota_remove_cmd, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* 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 class: Tasmota +********************************************************************/ +be_local_class(Tasmota, + 13, + NULL, + be_nested_map(47, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(find_key_i, -1), be_const_closure(Tasmota_find_key_i_closure) }, + { be_const_key(exec_cmd, 42), be_const_closure(Tasmota_exec_cmd_closure) }, + { be_const_key(remove_cmd, -1), be_const_closure(Tasmota_remove_cmd_closure) }, + { be_const_key(add_cron, -1), be_const_closure(Tasmota_add_cron_closure) }, + { be_const_key(_timers, -1), be_const_var(2) }, + { be_const_key(remove_timer, 35), be_const_closure(Tasmota_remove_timer_closure) }, + { be_const_key(run_deferred, 20), be_const_closure(Tasmota_run_deferred_closure) }, + { be_const_key(add_fast_loop, -1), be_const_closure(Tasmota_add_fast_loop_closure) }, + { be_const_key(exec_tele, 18), be_const_closure(Tasmota_exec_tele_closure) }, + { be_const_key(load, -1), be_const_closure(Tasmota_load_closure) }, + { be_const_key(add_driver, -1), be_const_closure(Tasmota_add_driver_closure) }, + { be_const_key(remove_rule, 43), be_const_closure(Tasmota_remove_rule_closure) }, + { be_const_key(cmd, 28), be_const_closure(Tasmota_cmd_closure) }, + { be_const_key(remove_cron, 30), be_const_closure(Tasmota_remove_cron_closure) }, + { be_const_key(next_cron, -1), be_const_closure(Tasmota_next_cron_closure) }, + { be_const_key(get_light, -1), be_const_closure(Tasmota_get_light_closure) }, + { be_const_key(set_light, 15), be_const_closure(Tasmota_set_light_closure) }, + { be_const_key(gc, -1), be_const_closure(Tasmota_gc_closure) }, + { be_const_key(remove_driver, -1), be_const_closure(Tasmota_remove_driver_closure) }, + { be_const_key(init, 0), be_const_closure(Tasmota_init_closure) }, + { be_const_key(remove_fast_loop, -1), be_const_closure(Tasmota_remove_fast_loop_closure) }, + { be_const_key(time_str, 19), be_const_closure(Tasmota_time_str_closure) }, + { be_const_key(global, -1), be_const_var(9) }, + { be_const_key(wire2, -1), be_const_var(7) }, + { be_const_key(event, -1), be_const_closure(Tasmota_event_closure) }, + { be_const_key(fast_loop, -1), be_const_closure(Tasmota_fast_loop_closure) }, + { be_const_key(cmd_res, 27), be_const_var(8) }, + { be_const_key(_crons, -1), be_const_var(3) }, + { be_const_key(add_cmd, -1), be_const_closure(Tasmota_add_cmd_closure) }, + { be_const_key(_debug_present, -1), be_const_var(12) }, + { be_const_key(wd, 22), be_const_var(11) }, + { be_const_key(gen_cb, 34), be_const_closure(Tasmota_gen_cb_closure) }, + { be_const_key(check_not_method, -1), be_const_closure(Tasmota_check_not_method_closure) }, + { be_const_key(hs2rgb, 31), be_const_closure(Tasmota_hs2rgb_closure) }, + { be_const_key(_rules, -1), be_const_var(1) }, + { be_const_key(run_cron, -1), be_const_closure(Tasmota_run_cron_closure) }, + { be_const_key(set_timer, -1), be_const_closure(Tasmota_set_timer_closure) }, + { be_const_key(find_op, -1), be_const_closure(Tasmota_find_op_closure) }, + { be_const_key(_drivers, 26), be_const_var(5) }, + { be_const_key(_ccmd, -1), be_const_var(4) }, + { be_const_key(settings, -1), be_const_var(10) }, + { be_const_key(wire1, -1), be_const_var(6) }, + { be_const_key(wire_scan, -1), be_const_closure(Tasmota_wire_scan_closure) }, + { be_const_key(add_rule, -1), be_const_closure(Tasmota_add_rule_closure) }, + { be_const_key(exec_rules, 10), be_const_closure(Tasmota_exec_rules_closure) }, + { be_const_key(try_rule, 2), be_const_closure(Tasmota_try_rule_closure) }, + { be_const_key(_fl, -1), be_const_var(0) }, + })), + (bstring*) &be_const_str_Tasmota +); +/*******************************************************************/ + +void be_load_Tasmota_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Tasmota); + be_setglobal(vm, "Tasmota"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/re1.5/util.c b/lib/libesp32/re1.5/util.c index 9cab94131..d54f29a35 100644 --- a/lib/libesp32/re1.5/util.c +++ b/lib/libesp32/re1.5/util.c @@ -9,8 +9,11 @@ extern void berry_log_C(const char * berry_buf, ...); void re1_5_fatal(const char *msg) { +#ifdef TASMOTA berry_log_C("BRY: regex fatal error: %s", msg); - // fprintf(stderr, "fatal error: %s\n", msg); +#else + fprintf(stderr, "fatal error: %s\n", msg); +#endif exit(2); } diff --git a/pio-tools/gen-berry-structures.py b/pio-tools/gen-berry-structures.py index ad207d31e..ead9a554b 100644 --- a/pio-tools/gen-berry-structures.py +++ b/pio-tools/gen-berry-structures.py @@ -17,6 +17,6 @@ for filePath in fileList: # print("Deleting file : ", filePath) except: print("Error while deleting file : ", filePath) -cmd = (env["PYTHONEXE"],join("tools","coc","coc"),"-o","generate","src","default",join("..","berry_tasmota","src"),join("..","berry_mapping","src"),join("..","berry_int64","src"),join("..","..","libesp32_lvgl","lv_binding_berry","src"),join("..","..","libesp32_lvgl","lv_binding_berry","generate"),"-c",join("default","berry_conf.h")) +cmd = (env["PYTHONEXE"],join("tools","coc","coc"),"-o","generate","src","default",join("..","berry_tasmota","src"),join("..","berry_tasmota","src","solidify"),join("..","berry_mapping","src"),join("..","berry_int64","src"),join("..","..","libesp32_lvgl","lv_binding_berry","src"),join("..","..","libesp32_lvgl","lv_binding_berry","generate"),"-c",join("default","berry_conf.h")) returncode = subprocess.call(cmd, shell=False) os.chdir(CURRENT_DIR)