From 62fcba4b11c8c4b1010499ca974ae7606e3ca8a3 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 18 Sep 2022 23:12:57 +0200 Subject: [PATCH] Berry more auto-solidification --- lib/libesp32/berry/default/be_modtab.c | 2 + lib/libesp32/berry/src/be_solidifylib.c | 8 +- lib/libesp32/berry_tasmota/solidify_all.be | 27 +- lib/libesp32/berry_tasmota/src/be_energylib.c | 178 +- .../src/be_i2c_axp192_axp202_lib.c | 5 + .../berry_tasmota/src/be_leds_animator_lib.c | 374 +-- lib/libesp32/berry_tasmota/src/be_mqtt_lib.c | 575 +---- .../src/be_partition_core_module.c | 2052 +---------------- .../berry_tasmota/src/be_python_compat.c | 54 +- lib/libesp32/berry_tasmota/src/be_tapp_lib.c | 163 +- .../berry_tasmota/src/be_trigger_class.c | 186 +- lib/libesp32/berry_tasmota/src/be_wire_lib.c | 98 +- lib/libesp32/berry_tasmota/src/be_zigbee.c | 57 +- .../berry_tasmota/src/be_zigbee_zb_coord.c | 221 +- .../src/be_zigbee_zcl_attributes.c | 923 +------- .../berry_tasmota/src/be_zigbee_zcl_frame.c | 234 +- .../berry_tasmota/src/embedded/Wire.be | 2 + .../berry_tasmota/src/embedded/energy.be | 33 + .../berry_tasmota/src/embedded/i2c_axp192.be | 2 + .../berry_tasmota/src/embedded/i2c_axp202.be | 3 +- .../berry_tasmota/src/embedded/i2c_ft3663.be | 5 +- .../src/embedded/leds_animator.be | 1 + .../berry_tasmota/src/embedded/lv_tasmota.be | 1 + .../src/embedded/lv_tasmota_widgets.be | 17 +- .../berry_tasmota/src/embedded/mqtt.be | 2 +- .../src/embedded/python_compat.be | 13 + .../berry_tasmota/src/embedded/tapp.be | 1 + .../src/embedded/tasmota_class.be | 30 +- .../berry_tasmota/src/embedded/test_crypto.be | 2 + .../src/embedded/trigger_class.be | 32 + .../berry_tasmota/src/embedded/zigbee.be | 1 + .../src/embedded/zigbee_zb_coord.be | 1 + .../src/embedded/zigbee_zcl_attribute.be | 3 + .../src/embedded/zigbee_zcl_frame.be | 1 + .../src/solidify/solidified_Wire.h | 100 + .../src/solidify/solidified_energy.h | 127 + .../solidified_i2c_axp192.h} | 13 +- .../src/solidify/solidified_i2c_axp202.h | 911 ++++++++ .../src/solidify/solidified_i2c_ft3663.h | 256 ++ .../src/solidify/solidified_leds_animator.h | 379 +++ .../src/solidify/solidified_lv_tasmota.h | 533 +++++ .../solidify/solidified_lv_tasmota_widgets.h | 1748 ++++++++++++++ .../src/solidify/solidified_mqtt.h | 582 +++++ .../src/solidify/solidified_python_compat.h | 59 + .../src/solidify/solidified_tapp.h | 168 ++ .../src/solidify/solidified_tasmota_class.h | 182 -- .../src/solidify/solidified_test_crypto.h | 7 + .../src/solidify/solidified_trigger_class.h | 189 ++ .../src/solidify/solidified_zigbee.h | 64 + .../src/solidify/solidified_zigbee_zb_coord.h | 220 ++ .../solidified_zigbee_zcl_attribute.h | 1134 +++++++++ .../solidify/solidified_zigbee_zcl_frame.h | 233 ++ 52 files changed, 6889 insertions(+), 5323 deletions(-) create mode 100644 lib/libesp32/berry_tasmota/src/be_i2c_axp192_axp202_lib.c create mode 100644 lib/libesp32/berry_tasmota/src/embedded/energy.be create mode 100644 lib/libesp32/berry_tasmota/src/embedded/python_compat.be create mode 100644 lib/libesp32/berry_tasmota/src/embedded/trigger_class.be create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_Wire.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_energy.h rename lib/libesp32/berry_tasmota/src/{be_i2c_axp192_lib.c => solidify/solidified_i2c_axp192.h} (99%) create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_axp202.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_ft3663.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_leds_animator.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_lv_tasmota.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_lv_tasmota_widgets.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_mqtt.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_python_compat.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_tapp.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_test_crypto.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_trigger_class.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee_zb_coord.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee_zcl_attribute.h create mode 100644 lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee_zcl_frame.h diff --git a/lib/libesp32/berry/default/be_modtab.c b/lib/libesp32/berry/default/be_modtab.c index 672512de6..c02e2ca6d 100644 --- a/lib/libesp32/berry/default/be_modtab.c +++ b/lib/libesp32/berry/default/be_modtab.c @@ -190,6 +190,7 @@ be_extern_native_class(light_state); be_extern_native_class(Wire); be_extern_native_class(I2C_Driver); be_extern_native_class(AXP192); +be_extern_native_class(AXP202); be_extern_native_class(OneWire); be_extern_native_class(Leds_ntv); be_extern_native_class(Leds); @@ -245,6 +246,7 @@ BERRY_LOCAL bclass_array be_class_table = { &be_native_class(Wire), &be_native_class(I2C_Driver), &be_native_class(AXP192), + &be_native_class(AXP202), #endif // USE_I2C &be_native_class(md5), #ifdef USE_WEBCLIENT diff --git a/lib/libesp32/berry/src/be_solidifylib.c b/lib/libesp32/berry/src/be_solidifylib.c index fc8e45d7b..4cec95f99 100644 --- a/lib/libesp32/berry/src/be_solidifylib.c +++ b/lib/libesp32/berry/src/be_solidifylib.c @@ -190,7 +190,7 @@ static void m_solidify_bvalue(bvm *vm, bbool str_literal, bvalue * value, const break; case BE_REAL: #if BE_USE_SINGLE_FLOAT - logfmt("be_const_real_hex(%08" PRIX32 ")", (uint32_t)(uintptr_t)var_toobj(value)); + logfmt("be_const_real_hex(0x%08" PRIX32 ")", (uint32_t)(uintptr_t)var_toobj(value)); #else logfmt("be_const_real_hex(0x%016" PRIx64 ")", (uint64_t)var_toobj(value)); #endif @@ -537,8 +537,12 @@ static int m_dump(bvm *vm) } be_pop(vm, 1); } + const char *classname = NULL; /* allow to specify an explicit prefix */ + if (top >= 4 && be_isstring(vm, 4)) { + classname = be_tostring(vm, 4); + } if (var_isclosure(v)) { - m_solidify_closure(vm, str_literal, var_toobj(v), NULL, fout); + m_solidify_closure(vm, str_literal, var_toobj(v), classname, fout); } else if (var_isclass(v)) { m_solidify_class(vm, str_literal, var_toobj(v), fout); } else if (var_ismodule(v)) { diff --git a/lib/libesp32/berry_tasmota/solidify_all.be b/lib/libesp32/berry_tasmota/solidify_all.be index 5654cc664..5e5204cae 100755 --- a/lib/libesp32/berry_tasmota/solidify_all.be +++ b/lib/libesp32/berry_tasmota/solidify_all.be @@ -14,10 +14,10 @@ import re # 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,MD5,lv,light_state" - -var files = ['tasmota_class.be', 'leds.be', 'animate_module.be', 'autoconf_module.be','driver_class.be', - 'partition_core.be','i2c_driver.be','hue_bridge.be','persist.be','uuid.be'] +var globs = "path,ctypes_bytes_dyn,tasmota,ccronexpr,gpio,light,webclient,load,MD5,lv,light_state," + "lv_clock,lv_clock_icon,lv_signal_arcs,lv_signal_bars,lv_wifi_arcs_icon,lv_wifi_arcs," + "lv_wifi_bars_icon,lv_wifi_bars," + "_lvgl" for g:string.split(globs, ",") global.(g) = nil @@ -34,7 +34,7 @@ def clean_directory(dir) end end -var pattern = "#@\\s*solidify:([A-Za-z0-9_,]+)" +var pattern = "#@\\s*solidify:([A-Za-z0-9_.,]+)" def parse_file(fname) print("Parsing: ", fname) @@ -60,8 +60,15 @@ def parse_file(fname) 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) + var o = global + var cl_name = nil + var obj_name = nil + for subname : string.split(object_name, '.') + o = o.(subname) + cl_name = obj_name + obj_name = subname + end + solidify.dump(o, weak, fout, cl_name) end fout.write("/********************************************************************/\n") @@ -74,9 +81,5 @@ 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) + parse_file(src_file) end diff --git a/lib/libesp32/berry_tasmota/src/be_energylib.c b/lib/libesp32/berry_tasmota/src/be_energylib.c index cbdddbfca..ea3455a6a 100644 --- a/lib/libesp32/berry_tasmota/src/be_energylib.c +++ b/lib/libesp32/berry_tasmota/src/be_energylib.c @@ -10,177 +10,21 @@ #ifdef USE_ENERGY_SENSOR extern struct ENERGY Energy; -/* -_energy = nil # avoid compilation error -energy = module("energy") -energy._ptr = nil +#include "solidify/solidified_energy.h" +#include "be_fixed_energy.h" -def init(m) - import global - global._energy = energy_struct(m._ptr) - return m -end -energy.init = init +/* @const_object_info_begin -def read() - return _energy.tomap() -end -energy.read = read +module energy (scope: global) { + init, closure(energy_init_closure) + _ptr, comptr(&Energy) -def member(k) - return _energy.(k) -end -energy.member = member + read, closure(energy_read_closure) + member, closure(energy_member_closure) + setmember, closure(energy_setmember_closure) +} -def setmember(k, v) - _energy.(k) = v -end -energy.setmember = setmember - -import solidify -solidify.dump(energy) -*/ - - -/******************************************************************** -** Solidified function: member -********************************************************************/ -be_local_closure(energy_member, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str(_energy), - }), - &be_const_str_member, - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0xB8060000, // 0000 GETNGBL R1 K0 - 0x88040200, // 0001 GETMBR R1 R1 R0 - 0x80040200, // 0002 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: setmember -********************************************************************/ -be_local_closure(energy_setmember, /* name */ - be_nested_proto( - 3, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str(_energy), - }), - &be_const_str_setmember, - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0xB80A0000, // 0000 GETNGBL R2 K0 - 0x90080001, // 0001 SETMBR R2 R0 R1 - 0x80000000, // 0002 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: read -********************************************************************/ -be_local_closure(energy_read, /* name */ - be_nested_proto( - 2, /* nstack */ - 0, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str(_energy), - /* K1 */ be_nested_str(tomap), - }), - &be_const_str_read, - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0xB8020000, // 0000 GETNGBL R0 K0 - 0x8C000101, // 0001 GETMET R0 R0 K1 - 0x7C000200, // 0002 CALL R0 1 - 0x80040000, // 0003 RET 1 R0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(energy_init, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str(global), - /* K1 */ be_nested_str(_energy), - /* K2 */ be_nested_str(energy_struct), - /* K3 */ be_nested_str(_ptr), - }), - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0xB80A0400, // 0001 GETNGBL R2 K2 - 0x880C0103, // 0002 GETMBR R3 R0 K3 - 0x7C080200, // 0003 CALL R2 1 - 0x90060202, // 0004 SETMBR R1 K1 R2 - 0x80040000, // 0005 RET 1 R0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified module: energy -********************************************************************/ -be_local_module(energy, - "energy", - be_nested_map(5, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(init, -1), be_const_closure(energy_init_closure) }, - { be_const_key(member, 2), be_const_closure(energy_member_closure) }, - { be_const_key(_ptr, 3), be_const_comptr(&Energy) }, - { be_const_key(setmember, -1), be_const_closure(energy_setmember_closure) }, - { be_const_key(read, -1), be_const_closure(energy_read_closure) }, - })) -); -BE_EXPORT_VARIABLE be_define_const_native_module(energy); -/********************************************************************/ - - -// { be_const_key(_ptr, 3), be_const_comptr(&Energy) }, /* patch */ +@const_object_info_end */ #endif // USE_ENERGY_SENSOR \ No newline at end of file diff --git a/lib/libesp32/berry_tasmota/src/be_i2c_axp192_axp202_lib.c b/lib/libesp32/berry_tasmota/src/be_i2c_axp192_axp202_lib.c new file mode 100644 index 000000000..aec926077 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/be_i2c_axp192_axp202_lib.c @@ -0,0 +1,5 @@ +/******************************************************************** + * Tasmota LVGL lv_signal_bars widget + *******************************************************************/ +#include "solidify/solidified_i2c_axp192.h" +#include "solidify/solidified_i2c_axp202.h" diff --git a/lib/libesp32/berry_tasmota/src/be_leds_animator_lib.c b/lib/libesp32/berry_tasmota/src/be_leds_animator_lib.c index b0d7098bf..2c4f80ee8 100644 --- a/lib/libesp32/berry_tasmota/src/be_leds_animator_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_leds_animator_lib.c @@ -2,380 +2,8 @@ * Berry class `Leds_animator` * *******************************************************************/ -#include "be_constobj.h" - #ifdef USE_WS2812 -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Leds_animator_init, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_str(strip), - /* K1 */ be_nested_str(bri), - /* K2 */ be_nested_str(running), - /* K3 */ be_nested_str(pixel_count), - /* K4 */ be_nested_str(animators), - /* K5 */ be_nested_str(clear), - /* K6 */ be_nested_str(tasmota), - /* K7 */ be_nested_str(add_driver), - }), - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[18]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x540A0031, // 0001 LDINT R2 50 - 0x90020202, // 0002 SETMBR R0 K1 R2 - 0x50080000, // 0003 LDBOOL R2 0 0 - 0x90020402, // 0004 SETMBR R0 K2 R2 - 0x8C080303, // 0005 GETMET R2 R1 K3 - 0x7C080200, // 0006 CALL R2 1 - 0x90020602, // 0007 SETMBR R0 K3 R2 - 0x60080012, // 0008 GETGBL R2 G18 - 0x7C080000, // 0009 CALL R2 0 - 0x90020802, // 000A SETMBR R0 K4 R2 - 0x8C080105, // 000B GETMET R2 R0 K5 - 0x7C080200, // 000C CALL R2 1 - 0xB80A0C00, // 000D GETNGBL R2 K6 - 0x8C080507, // 000E GETMET R2 R2 K7 - 0x5C100000, // 000F MOVE R4 R0 - 0x7C080400, // 0010 CALL R2 2 - 0x80000000, // 0011 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_bri -********************************************************************/ -be_local_closure(Leds_animator_set_bri, /* name */ - be_nested_proto( - 2, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str(bri), - }), - &be_const_str_set_bri, - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x80000000, // 0001 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: stop -********************************************************************/ -be_local_closure(Leds_animator_stop, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str(running), - }), - &be_const_str_stop, - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0x50040000, // 0000 LDBOOL R1 0 0 - 0x90020001, // 0001 SETMBR R0 K0 R1 - 0x80000000, // 0002 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: animate -********************************************************************/ -be_local_closure(Leds_animator_animate, /* name */ - be_nested_proto( - 1, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 0, /* has constants */ - NULL, /* no const */ - &be_const_str_animate, - &be_const_str_solidified, - ( &(const binstruction[ 1]) { /* code */ - 0x80000000, // 0000 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: remove -********************************************************************/ -be_local_closure(Leds_animator_remove, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str(tasmota), - /* K1 */ be_nested_str(remove_driver), - }), - &be_const_str_remove, - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0xB8060000, // 0000 GETNGBL R1 K0 - 0x8C040301, // 0001 GETMET R1 R1 K1 - 0x5C0C0000, // 0002 MOVE R3 R0 - 0x7C040400, // 0003 CALL R1 2 - 0x80000000, // 0004 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: every_50ms -********************************************************************/ -be_local_closure(Leds_animator_every_50ms, /* name */ - be_nested_proto( - 6, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_str(running), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_str(animators), - /* K3 */ be_nested_str(is_running), - /* K4 */ be_nested_str(animate), - /* K5 */ be_const_int(1), - /* K6 */ be_nested_str(remove), - }), - &be_const_str_every_50ms, - &be_const_str_solidified, - ( &(const binstruction[25]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x78060015, // 0001 JMPF R1 #0018 - 0x58040001, // 0002 LDCONST R1 K1 - 0x6008000C, // 0003 GETGBL R2 G12 - 0x880C0102, // 0004 GETMBR R3 R0 K2 - 0x7C080200, // 0005 CALL R2 1 - 0x14080202, // 0006 LT R2 R1 R2 - 0x780A000D, // 0007 JMPF R2 #0016 - 0x88080102, // 0008 GETMBR R2 R0 K2 - 0x94080401, // 0009 GETIDX R2 R2 R1 - 0x8C0C0503, // 000A GETMET R3 R2 K3 - 0x7C0C0200, // 000B CALL R3 1 - 0x780E0003, // 000C JMPF R3 #0011 - 0x8C0C0504, // 000D GETMET R3 R2 K4 - 0x7C0C0200, // 000E CALL R3 1 - 0x00040305, // 000F ADD R1 R1 K5 - 0x70020003, // 0010 JMP #0015 - 0x880C0102, // 0011 GETMBR R3 R0 K2 - 0x8C0C0706, // 0012 GETMET R3 R3 K6 - 0x5C140200, // 0013 MOVE R5 R1 - 0x7C0C0400, // 0014 CALL R3 2 - 0x7001FFEC, // 0015 JMP #0003 - 0x8C080104, // 0016 GETMET R2 R0 K4 - 0x7C080200, // 0017 CALL R2 1 - 0x80000000, // 0018 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_bri -********************************************************************/ -be_local_closure(Leds_animator_get_bri, /* name */ - be_nested_proto( - 3, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str(bri), - }), - &be_const_str_get_bri, - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x80040400, // 0001 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: start -********************************************************************/ -be_local_closure(Leds_animator_start, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str(running), - }), - &be_const_str_start, - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0x50040200, // 0000 LDBOOL R1 1 0 - 0x90020001, // 0001 SETMBR R0 K0 R1 - 0x80000000, // 0002 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: add_anim -********************************************************************/ -be_local_closure(Leds_animator_add_anim, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str(animators), - /* K1 */ be_nested_str(push), - /* K2 */ be_nested_str(run), - }), - &be_const_str_add_anim, - &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x8C080501, // 0001 GETMET R2 R2 K1 - 0x5C100200, // 0002 MOVE R4 R1 - 0x7C080400, // 0003 CALL R2 2 - 0x8C080302, // 0004 GETMET R2 R1 K2 - 0x7C080200, // 0005 CALL R2 1 - 0x80000000, // 0006 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: clear -********************************************************************/ -be_local_closure(Leds_animator_clear, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str(stop), - /* K1 */ be_nested_str(strip), - /* K2 */ be_nested_str(clear), - }), - &be_const_str_clear, - &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0x8C040100, // 0000 GETMET R1 R0 K0 - 0x7C040200, // 0001 CALL R1 1 - 0x88040101, // 0002 GETMBR R1 R0 K1 - 0x8C040302, // 0003 GETMET R1 R1 K2 - 0x7C040200, // 0004 CALL R1 1 - 0x80000000, // 0005 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: Leds_animator -********************************************************************/ -be_local_class(Leds_animator, - 5, - NULL, - be_nested_map(15, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(init, 12), be_const_closure(Leds_animator_init_closure) }, - { be_const_key(clear, -1), be_const_closure(Leds_animator_clear_closure) }, - { be_const_key(stop, -1), be_const_closure(Leds_animator_stop_closure) }, - { be_const_key(strip, 4), be_const_var(0) }, - { be_const_key(pixel_count, 6), be_const_var(1) }, - { be_const_key(animate, -1), be_const_closure(Leds_animator_animate_closure) }, - { be_const_key(add_anim, 13), be_const_closure(Leds_animator_add_anim_closure) }, - { be_const_key(bri, -1), be_const_var(2) }, - { be_const_key(every_50ms, -1), be_const_closure(Leds_animator_every_50ms_closure) }, - { be_const_key(remove, 7), be_const_closure(Leds_animator_remove_closure) }, - { be_const_key(get_bri, -1), be_const_closure(Leds_animator_get_bri_closure) }, - { be_const_key(start, -1), be_const_closure(Leds_animator_start_closure) }, - { be_const_key(running, -1), be_const_var(3) }, - { be_const_key(animators, -1), be_const_var(4) }, - { be_const_key(set_bri, 1), be_const_closure(Leds_animator_set_bri_closure) }, - })), - be_str_weak(Leds_animator) -); -/*******************************************************************/ - -void be_load_Leds_animator_class(bvm *vm) { - be_pushntvclass(vm, &be_class_Leds_animator); - be_setglobal(vm, "Leds_animator"); - be_pop(vm, 1); -} +#include "solidify/solidified_leds_animator.h" #endif // USE_WS2812 diff --git a/lib/libesp32/berry_tasmota/src/be_mqtt_lib.c b/lib/libesp32/berry_tasmota/src/be_mqtt_lib.c index a8ab47b3c..c0237fc07 100644 --- a/lib/libesp32/berry_tasmota/src/be_mqtt_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_mqtt_lib.c @@ -39,577 +39,4 @@ module mqtt (scope: global) { @const_object_info_end */ // private class MQTT -/******************************************************************** -** Solidified function: mqtt_data -********************************************************************/ -be_local_closure(MQTT_mqtt_data, /* name */ - be_nested_proto( - 14, /* 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(topics), - /* K1 */ be_nested_str(closure), - /* K2 */ be_nested_str(mqtt_data), - /* K3 */ be_nested_str(stop_iteration), - }), - &be_const_str_mqtt_data, - &be_const_str_solidified, - ( &(const binstruction[32]) { /* code */ - 0x88140100, // 0000 GETMBR R5 R0 K0 - 0x4C180000, // 0001 LDNIL R6 - 0x1C140A06, // 0002 EQ R5 R5 R6 - 0x78160000, // 0003 JMPF R5 #0005 - 0x80000A00, // 0004 RET 0 - 0x50140000, // 0005 LDBOOL R5 0 0 - 0x60180010, // 0006 GETGBL R6 G16 - 0x881C0100, // 0007 GETMBR R7 R0 K0 - 0x7C180200, // 0008 CALL R6 1 - 0xA8020011, // 0009 EXBLK 0 #001C - 0x5C1C0C00, // 000A MOVE R7 R6 - 0x7C1C0000, // 000B CALL R7 0 - 0x88200F01, // 000C GETMBR R8 R7 K1 - 0x4C240000, // 000D LDNIL R9 - 0x20201009, // 000E NE R8 R8 R9 - 0x7822000A, // 000F JMPF R8 #001B - 0x8C200F02, // 0010 GETMET R8 R7 K2 - 0x5C280200, // 0011 MOVE R10 R1 - 0x5C2C0400, // 0012 MOVE R11 R2 - 0x5C300600, // 0013 MOVE R12 R3 - 0x5C340800, // 0014 MOVE R13 R4 - 0x7C200A00, // 0015 CALL R8 5 - 0x74160001, // 0016 JMPT R5 #0019 - 0x74220000, // 0017 JMPT R8 #0019 - 0x50200001, // 0018 LDBOOL R8 0 1 - 0x50200200, // 0019 LDBOOL R8 1 0 - 0x5C141000, // 001A MOVE R5 R8 - 0x7001FFED, // 001B JMP #000A - 0x58180003, // 001C LDCONST R6 K3 - 0xAC180200, // 001D CATCH R6 1 0 - 0xB0080000, // 001E RAISE 2 R0 R0 - 0x80040A00, // 001F RET 1 R5 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: lazy_init -********************************************************************/ -be_local_closure(MQTT_lazy_init, /* name */ - be_nested_proto( - 5, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 1, /* has sup protos */ - ( &(const struct bproto*[ 1]) { - 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(mqtt_connect), - }), - &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(topics), - /* K1 */ be_nested_str(tasmota), - /* K2 */ be_nested_str(add_driver), - /* K3 */ be_nested_str(add_rule), - /* K4 */ be_nested_str(Mqtt_X23Connected), - }), - &be_const_str_lazy_init, - &be_const_str_solidified, - ( &(const binstruction[18]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x4C080000, // 0001 LDNIL R2 - 0x1C040202, // 0002 EQ R1 R1 R2 - 0x7806000B, // 0003 JMPF R1 #0010 - 0x60040012, // 0004 GETGBL R1 G18 - 0x7C040000, // 0005 CALL R1 0 - 0x90020001, // 0006 SETMBR R0 K0 R1 - 0xB8060200, // 0007 GETNGBL R1 K1 - 0x8C040302, // 0008 GETMET R1 R1 K2 - 0x5C0C0000, // 0009 MOVE R3 R0 - 0x7C040400, // 000A CALL R1 2 - 0xB8060200, // 000B GETNGBL R1 K1 - 0x8C040303, // 000C GETMET R1 R1 K3 - 0x580C0004, // 000D LDCONST R3 K4 - 0x84100000, // 000E CLOSURE R4 P0 - 0x7C040600, // 000F CALL R1 3 - 0xA0000000, // 0010 CLOSE R0 - 0x80000000, // 0011 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: unsubscribe -********************************************************************/ -be_local_closure(MQTT_unsubscribe, /* 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(topics), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_str(fulltopic), - /* K3 */ be_nested_str(_unsubscribe), - /* K4 */ be_nested_str(remove), - /* K5 */ be_const_int(1), - }), - &be_const_str_unsubscribe, - &be_const_str_solidified, - ( &(const binstruction[41]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x4C0C0000, // 0001 LDNIL R3 - 0x1C080403, // 0002 EQ R2 R2 R3 - 0x780A0000, // 0003 JMPF R2 #0005 - 0x80000400, // 0004 RET 0 - 0x58080001, // 0005 LDCONST R2 K1 - 0x600C000C, // 0006 GETGBL R3 G12 - 0x88100100, // 0007 GETMBR R4 R0 K0 - 0x7C0C0200, // 0008 CALL R3 1 - 0x140C0403, // 0009 LT R3 R2 R3 - 0x780E0016, // 000A JMPF R3 #0022 - 0x4C0C0000, // 000B LDNIL R3 - 0x1C0C0203, // 000C EQ R3 R1 R3 - 0x740E0004, // 000D JMPT R3 #0013 - 0x880C0100, // 000E GETMBR R3 R0 K0 - 0x940C0602, // 000F GETIDX R3 R3 R2 - 0x880C0702, // 0010 GETMBR R3 R3 K2 - 0x1C0C0601, // 0011 EQ R3 R3 R1 - 0x780E000C, // 0012 JMPF R3 #0020 - 0x4C0C0000, // 0013 LDNIL R3 - 0x1C0C0203, // 0014 EQ R3 R1 R3 - 0x780E0004, // 0015 JMPF R3 #001B - 0x8C0C0103, // 0016 GETMET R3 R0 K3 - 0x88140100, // 0017 GETMBR R5 R0 K0 - 0x94140A02, // 0018 GETIDX R5 R5 R2 - 0x88140B02, // 0019 GETMBR R5 R5 K2 - 0x7C0C0400, // 001A CALL R3 2 - 0x880C0100, // 001B GETMBR R3 R0 K0 - 0x8C0C0704, // 001C GETMET R3 R3 K4 - 0x5C140400, // 001D MOVE R5 R2 - 0x7C0C0400, // 001E CALL R3 2 - 0x70020000, // 001F JMP #0021 - 0x00080505, // 0020 ADD R2 R2 K5 - 0x7001FFE3, // 0021 JMP #0006 - 0x4C0C0000, // 0022 LDNIL R3 - 0x200C0203, // 0023 NE R3 R1 R3 - 0x780E0002, // 0024 JMPF R3 #0028 - 0x8C0C0103, // 0025 GETMET R3 R0 K3 - 0x5C140200, // 0026 MOVE R5 R1 - 0x7C0C0400, // 0027 CALL R3 2 - 0x80000000, // 0028 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: mqtt_connect -********************************************************************/ -be_local_closure(MQTT_mqtt_connect, /* 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(tasmota), - /* K1 */ be_nested_str(log), - /* K2 */ be_nested_str(BRY_X3A_X20mqtt_X20subscribe_X20all_X20registered_X20topics), - /* K3 */ be_const_int(3), - /* K4 */ be_nested_str(topics), - /* K5 */ be_nested_str(fulltopic), - /* K6 */ be_nested_str(_subscribe), - /* K7 */ be_nested_str(stop_iteration), - }), - &be_const_str_mqtt_connect, - &be_const_str_solidified, - ( &(const binstruction[21]) { /* code */ - 0xB8060000, // 0000 GETNGBL R1 K0 - 0x8C040301, // 0001 GETMET R1 R1 K1 - 0x580C0002, // 0002 LDCONST R3 K2 - 0x58100003, // 0003 LDCONST R4 K3 - 0x7C040600, // 0004 CALL R1 3 - 0x60040010, // 0005 GETGBL R1 G16 - 0x88080104, // 0006 GETMBR R2 R0 K4 - 0x7C040200, // 0007 CALL R1 1 - 0xA8020006, // 0008 EXBLK 0 #0010 - 0x5C080200, // 0009 MOVE R2 R1 - 0x7C080000, // 000A CALL R2 0 - 0x880C0505, // 000B GETMBR R3 R2 K5 - 0x8C100106, // 000C GETMET R4 R0 K6 - 0x5C180600, // 000D MOVE R6 R3 - 0x7C100400, // 000E CALL R4 2 - 0x7001FFF8, // 000F JMP #0009 - 0x58040007, // 0010 LDCONST R1 K7 - 0xAC040200, // 0011 CATCH R1 1 0 - 0xB0080000, // 0012 RAISE 2 R0 R0 - 0x50040000, // 0013 LDBOOL R1 0 0 - 0x80040200, // 0014 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: tostring -********************************************************************/ -be_local_closure(mqtt_listener_tostring, /* 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[ 4]) { /* constants */ - /* K0 */ be_nested_str(string), - /* K1 */ be_nested_str(format), - /* K2 */ be_nested_str(_X3Cinstance_X3A_X20_X25s_X28_X27_X25s_X27_X29_X3E), - /* K3 */ be_nested_str(fulltopic), - }), - &be_const_str_tostring, - &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080301, // 0001 GETMET R2 R1 K1 - 0x58100002, // 0002 LDCONST R4 K2 - 0x60140005, // 0003 GETGBL R5 G5 - 0x5C180000, // 0004 MOVE R6 R0 - 0x7C140200, // 0005 CALL R5 1 - 0x88180103, // 0006 GETMBR R6 R0 K3 - 0x7C080800, // 0007 CALL R2 4 - 0x80040400, // 0008 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(mqtt_listener_init, /* 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[ 6]) { /* constants */ - /* K0 */ be_nested_str(string), - /* K1 */ be_nested_str(fulltopic), - /* K2 */ be_nested_str(topic), - /* K3 */ be_nested_str(split), - /* K4 */ be_nested_str(_X2F), - /* K5 */ be_nested_str(closure), - }), - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0xA40E0000, // 0000 IMPORT R3 K0 - 0x90020201, // 0001 SETMBR R0 K1 R1 - 0x8C100703, // 0002 GETMET R4 R3 K3 - 0x5C180200, // 0003 MOVE R6 R1 - 0x581C0004, // 0004 LDCONST R7 K4 - 0x7C100600, // 0005 CALL R4 3 - 0x90020404, // 0006 SETMBR R0 K2 R4 - 0x90020A02, // 0007 SETMBR R0 K5 R2 - 0x80000000, // 0008 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: mqtt_data -********************************************************************/ -be_local_closure(mqtt_listener_mqtt_data, /* name */ - be_nested_proto( - 17, /* 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(string), - /* K1 */ be_nested_str(split), - /* K2 */ be_nested_str(_X2F), - /* K3 */ be_nested_str(topic), - /* K4 */ be_const_int(0), - /* K5 */ be_nested_str(_X23), - /* K6 */ be_nested_str(_X2B), - /* K7 */ be_const_int(1), - /* K8 */ be_nested_str(closure), - }), - &be_const_str_mqtt_data, - &be_const_str_solidified, - ( &(const binstruction[53]) { /* code */ - 0xA4160000, // 0000 IMPORT R5 K0 - 0x8C180B01, // 0001 GETMET R6 R5 K1 - 0x5C200200, // 0002 MOVE R8 R1 - 0x58240002, // 0003 LDCONST R9 K2 - 0x7C180600, // 0004 CALL R6 3 - 0x601C000C, // 0005 GETGBL R7 G12 - 0x5C200C00, // 0006 MOVE R8 R6 - 0x7C1C0200, // 0007 CALL R7 1 - 0x88200103, // 0008 GETMBR R8 R0 K3 - 0x6024000C, // 0009 GETGBL R9 G12 - 0x5C281000, // 000A MOVE R10 R8 - 0x7C240200, // 000B CALL R9 1 - 0x58280004, // 000C LDCONST R10 K4 - 0x142C1409, // 000D LT R11 R10 R9 - 0x782E0013, // 000E JMPF R11 #0023 - 0x942C100A, // 000F GETIDX R11 R8 R10 - 0x1C301705, // 0010 EQ R12 R11 K5 - 0x78320001, // 0011 JMPF R12 #0014 - 0x7002000F, // 0012 JMP #0023 - 0x7002000C, // 0013 JMP #0021 - 0x28301407, // 0014 GE R12 R10 R7 - 0x78320002, // 0015 JMPF R12 #0019 - 0x50300000, // 0016 LDBOOL R12 0 0 - 0x80041800, // 0017 RET 1 R12 - 0x70020007, // 0018 JMP #0021 - 0x1C301706, // 0019 EQ R12 R11 K6 - 0x78320000, // 001A JMPF R12 #001C - 0x70020004, // 001B JMP #0021 - 0x94300C0A, // 001C GETIDX R12 R6 R10 - 0x2030160C, // 001D NE R12 R11 R12 - 0x78320001, // 001E JMPF R12 #0021 - 0x50300000, // 001F LDBOOL R12 0 0 - 0x80041800, // 0020 RET 1 R12 - 0x00281507, // 0021 ADD R10 R10 K7 - 0x7001FFE9, // 0022 JMP #000D - 0x282C1409, // 0023 GE R11 R10 R9 - 0x782E0003, // 0024 JMPF R11 #0029 - 0x202C1207, // 0025 NE R11 R9 R7 - 0x782E0001, // 0026 JMPF R11 #0029 - 0x502C0000, // 0027 LDBOOL R11 0 0 - 0x80041600, // 0028 RET 1 R11 - 0x882C0108, // 0029 GETMBR R11 R0 K8 - 0x5C301600, // 002A MOVE R12 R11 - 0x5C340200, // 002B MOVE R13 R1 - 0x5C380400, // 002C MOVE R14 R2 - 0x5C3C0600, // 002D MOVE R15 R3 - 0x5C400800, // 002E MOVE R16 R4 - 0x7C300800, // 002F CALL R12 4 - 0x4C340000, // 0030 LDNIL R13 - 0x1C34180D, // 0031 EQ R13 R12 R13 - 0x78360000, // 0032 JMPF R13 #0034 - 0x50300200, // 0033 LDBOOL R12 1 0 - 0x80041800, // 0034 RET 1 R12 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: mqtt_listener -********************************************************************/ -be_local_class(mqtt_listener, - 3, - NULL, - be_nested_map(6, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(mqtt_data, -1), be_const_closure(mqtt_listener_mqtt_data_closure) }, - { be_const_key(tostring, -1), be_const_closure(mqtt_listener_tostring_closure) }, - { be_const_key(topic, -1), be_const_var(0) }, - { be_const_key(init, -1), be_const_closure(mqtt_listener_init_closure) }, - { be_const_key(closure, 0), be_const_var(2) }, - { be_const_key(fulltopic, -1), be_const_var(1) }, - })), - (bstring*) &be_const_str_mqtt_listener -); - -/******************************************************************** -** Solidified function: mqtt_listener_class -********************************************************************/ -be_local_closure(MQTT_mqtt_listener_class, /* 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_const_class(be_class_mqtt_listener), - }), - &be_const_str_mqtt_listener_class, - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0x58040000, // 0000 LDCONST R1 K0 - 0xB4000000, // 0001 CLASS K0 - 0x80040200, // 0002 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: subscribe -********************************************************************/ -be_local_closure(MQTT_subscribe, /* 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[11]) { /* constants */ - /* K0 */ be_nested_str(lazy_init), - /* K1 */ be_nested_str(topics), - /* K2 */ be_nested_str(fulltopic), - /* K3 */ be_nested_str(closure), - /* K4 */ be_nested_str(stop_iteration), - /* K5 */ be_nested_str(mqtt_listener_class), - /* K6 */ be_nested_str(function), - /* K7 */ be_nested_str(tasmota), - /* K8 */ be_nested_str(check_not_method), - /* K9 */ be_nested_str(push), - /* K10 */ be_nested_str(_subscribe), - }), - &be_const_str_subscribe, - &be_const_str_solidified, - ( &(const binstruction[50]) { /* code */ - 0x8C0C0100, // 0000 GETMET R3 R0 K0 - 0x7C0C0200, // 0001 CALL R3 1 - 0x500C0000, // 0002 LDBOOL R3 0 0 - 0x60100010, // 0003 GETGBL R4 G16 - 0x88140101, // 0004 GETMBR R5 R0 K1 - 0x7C100200, // 0005 CALL R4 1 - 0xA802000A, // 0006 EXBLK 0 #0012 - 0x5C140800, // 0007 MOVE R5 R4 - 0x7C140000, // 0008 CALL R5 0 - 0x88180B02, // 0009 GETMBR R6 R5 K2 - 0x1C180C01, // 000A EQ R6 R6 R1 - 0x781A0004, // 000B JMPF R6 #0011 - 0x88180B03, // 000C GETMBR R6 R5 K3 - 0x1C180C02, // 000D EQ R6 R6 R2 - 0x781A0001, // 000E JMPF R6 #0011 - 0xA8040001, // 000F EXBLK 1 1 - 0x80000C00, // 0010 RET 0 - 0x7001FFF4, // 0011 JMP #0007 - 0x58100004, // 0012 LDCONST R4 K4 - 0xAC100200, // 0013 CATCH R4 1 0 - 0xB0080000, // 0014 RAISE 2 R0 R0 - 0x8C100105, // 0015 GETMET R4 R0 K5 - 0x7C100200, // 0016 CALL R4 1 - 0x60140004, // 0017 GETGBL R5 G4 - 0x5C180400, // 0018 MOVE R6 R2 - 0x7C140200, // 0019 CALL R5 1 - 0x1C140B06, // 001A EQ R5 R5 K6 - 0x7816000B, // 001B JMPF R5 #0028 - 0xB8160E00, // 001C GETNGBL R5 K7 - 0x8C140B08, // 001D GETMET R5 R5 K8 - 0x5C1C0400, // 001E MOVE R7 R2 - 0x7C140400, // 001F CALL R5 2 - 0x88140101, // 0020 GETMBR R5 R0 K1 - 0x8C140B09, // 0021 GETMET R5 R5 K9 - 0x5C1C0800, // 0022 MOVE R7 R4 - 0x5C200200, // 0023 MOVE R8 R1 - 0x5C240400, // 0024 MOVE R9 R2 - 0x7C1C0400, // 0025 CALL R7 2 - 0x7C140400, // 0026 CALL R5 2 - 0x70020005, // 0027 JMP #002E - 0x88140101, // 0028 GETMBR R5 R0 K1 - 0x8C140B09, // 0029 GETMET R5 R5 K9 - 0x5C1C0800, // 002A MOVE R7 R4 - 0x5C200200, // 002B MOVE R8 R1 - 0x7C1C0200, // 002C CALL R7 1 - 0x7C140400, // 002D CALL R5 2 - 0x8C14010A, // 002E GETMET R5 R0 K10 - 0x5C1C0200, // 002F MOVE R7 R1 - 0x7C140400, // 0030 CALL R5 2 - 0x80000000, // 0031 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: MQTT -********************************************************************/ -extern const bclass be_class_MQTT_ntv; -be_local_class(MQTT, - 1, - &be_class_MQTT_ntv, - be_nested_map(7, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(mqtt_connect, -1), be_const_closure(MQTT_mqtt_connect_closure) }, - { be_const_key(mqtt_data, -1), be_const_closure(MQTT_mqtt_data_closure) }, - { be_const_key(lazy_init, -1), be_const_closure(MQTT_lazy_init_closure) }, - { be_const_key(unsubscribe, -1), be_const_closure(MQTT_unsubscribe_closure) }, - { be_const_key(topics, 0), be_const_var(0) }, - { be_const_key(mqtt_listener_class, -1), be_const_closure(MQTT_mqtt_listener_class_closure) }, - { be_const_key(subscribe, -1), be_const_closure(MQTT_subscribe_closure) }, - })), - (bstring*) &be_const_str_MQTT -); -/*******************************************************************/ - -void be_load_MQTT_class(bvm *vm) { - be_pushntvclass(vm, &be_class_MQTT); - be_setglobal(vm, "MQTT"); - be_pop(vm, 1); -} +#include "solidify/solidified_mqtt.h" diff --git a/lib/libesp32/berry_tasmota/src/be_partition_core_module.c b/lib/libesp32/berry_tasmota/src/be_partition_core_module.c index 4a12b4dfd..8585cfaef 100644 --- a/lib/libesp32/berry_tasmota/src/be_partition_core_module.c +++ b/lib/libesp32/berry_tasmota/src/be_partition_core_module.c @@ -2,2055 +2,5 @@ * Berry module `partition_core` * * To use: `import partition_core` - * *******************************************************************/ -#include "be_constobj.h" - -/******************************************************************** -** Solidified function: save -********************************************************************/ -be_local_closure(Partition_otadata_save, /* name */ - be_nested_proto( - 11, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[11]) { /* constants */ - /* K0 */ be_nested_str(flash), - /* K1 */ be_nested_str(seq0), - /* K2 */ be_const_int(0), - /* K3 */ be_nested_str(seq1), - /* K4 */ be_const_int(1), - /* K5 */ be_nested_str(offset), - /* K6 */ be_nested_str(add), - /* K7 */ be_nested_str(FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF), - /* K8 */ be_nested_str(crc32_ota_seq), - /* K9 */ be_nested_str(erase), - /* K10 */ be_nested_str(write), - }), - &be_const_str_save, - &be_const_str_solidified, - ( &(const binstruction[53]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x5409FFFE, // 0001 LDINT R2 -1 - 0x540DFFFE, // 0002 LDINT R3 -1 - 0x88100101, // 0003 GETMBR R4 R0 K1 - 0x4C140000, // 0004 LDNIL R5 - 0x20100805, // 0005 NE R4 R4 R5 - 0x78120001, // 0006 JMPF R4 #0009 - 0x880C0101, // 0007 GETMBR R3 R0 K1 - 0x58080002, // 0008 LDCONST R2 K2 - 0x88100103, // 0009 GETMBR R4 R0 K3 - 0x4C140000, // 000A LDNIL R5 - 0x20100805, // 000B NE R4 R4 R5 - 0x78120004, // 000C JMPF R4 #0012 - 0x88100103, // 000D GETMBR R4 R0 K3 - 0x24100803, // 000E GT R4 R4 R3 - 0x78120001, // 000F JMPF R4 #0012 - 0x880C0103, // 0010 GETMBR R3 R0 K3 - 0x58080004, // 0011 LDCONST R2 K4 - 0x14100502, // 0012 LT R4 R2 K2 - 0x78120000, // 0013 JMPF R4 #0015 - 0x58080002, // 0014 LDCONST R2 K2 - 0x14100702, // 0015 LT R4 R3 K2 - 0x78120000, // 0016 JMPF R4 #0018 - 0x580C0004, // 0017 LDCONST R3 K4 - 0x88100105, // 0018 GETMBR R4 R0 K5 - 0x54160FFF, // 0019 LDINT R5 4096 - 0x08140A02, // 001A MUL R5 R5 R2 - 0x00100805, // 001B ADD R4 R4 R5 - 0x60140015, // 001C GETGBL R5 G21 - 0x7C140000, // 001D CALL R5 0 - 0x8C180B06, // 001E GETMET R6 R5 K6 - 0x5C200600, // 001F MOVE R8 R3 - 0x54260003, // 0020 LDINT R9 4 - 0x7C180600, // 0021 CALL R6 3 - 0x60180015, // 0022 GETGBL R6 G21 - 0x581C0007, // 0023 LDCONST R7 K7 - 0x7C180200, // 0024 CALL R6 1 - 0x00140A06, // 0025 ADD R5 R5 R6 - 0x8C180B06, // 0026 GETMET R6 R5 K6 - 0x8C200108, // 0027 GETMET R8 R0 K8 - 0x5C280600, // 0028 MOVE R10 R3 - 0x7C200400, // 0029 CALL R8 2 - 0x54260003, // 002A LDINT R9 4 - 0x7C180600, // 002B CALL R6 3 - 0x8C180309, // 002C GETMET R6 R1 K9 - 0x5C200800, // 002D MOVE R8 R4 - 0x54260FFF, // 002E LDINT R9 4096 - 0x7C180600, // 002F CALL R6 3 - 0x8C18030A, // 0030 GETMET R6 R1 K10 - 0x5C200800, // 0031 MOVE R8 R4 - 0x5C240A00, // 0032 MOVE R9 R5 - 0x7C180600, // 0033 CALL R6 3 - 0x80000000, // 0034 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: tostring -********************************************************************/ -be_local_closure(Partition_otadata_tostring, /* 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(string), - /* K1 */ be_nested_str(format), - /* K2 */ be_nested_str(_X3Cinstance_X3A_X20Partition_otadata_X28ota_active_X3A_X25s_X2C_X20ota_seq_X3D_X5B_X25d_X2C_X25d_X5D_X2C_X20ota_max_X3D_X25d_X29_X3E), - /* K3 */ be_nested_str(active_otadata), - /* K4 */ be_const_int(0), - /* K5 */ be_nested_str(ota_), - /* K6 */ be_nested_str(factory), - /* K7 */ be_nested_str(seq0), - /* K8 */ be_nested_str(seq1), - /* K9 */ be_nested_str(maxota), - }), - &be_const_str_tostring, - &be_const_str_solidified, - ( &(const binstruction[17]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080301, // 0001 GETMET R2 R1 K1 - 0x58100002, // 0002 LDCONST R4 K2 - 0x88140103, // 0003 GETMBR R5 R0 K3 - 0x28140B04, // 0004 GE R5 R5 K4 - 0x78160004, // 0005 JMPF R5 #000B - 0x60140008, // 0006 GETGBL R5 G8 - 0x88180103, // 0007 GETMBR R6 R0 K3 - 0x7C140200, // 0008 CALL R5 1 - 0x00160A05, // 0009 ADD R5 K5 R5 - 0x70020000, // 000A JMP #000C - 0x58140006, // 000B LDCONST R5 K6 - 0x88180107, // 000C GETMBR R6 R0 K7 - 0x881C0108, // 000D GETMBR R7 R0 K8 - 0x88200109, // 000E GETMBR R8 R0 K9 - 0x7C080C00, // 000F CALL R2 6 - 0x80040400, // 0010 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: _validate -********************************************************************/ -be_local_closure(Partition_otadata__validate, /* 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[ 7]) { /* constants */ - /* K0 */ be_nested_str(active_otadata), - /* K1 */ be_nested_str(has_factory), - /* K2 */ be_const_int(0), - /* K3 */ be_nested_str(seq0), - /* K4 */ be_const_int(1), - /* K5 */ be_nested_str(maxota), - /* K6 */ be_nested_str(seq1), - }), - &be_const_str__validate, - &be_const_str_solidified, - ( &(const binstruction[35]) { /* code */ - 0x88040101, // 0000 GETMBR R1 R0 K1 - 0x78060001, // 0001 JMPF R1 #0004 - 0x5405FFFE, // 0002 LDINT R1 -1 - 0x70020000, // 0003 JMP #0005 - 0x58040002, // 0004 LDCONST R1 K2 - 0x90020001, // 0005 SETMBR R0 K0 R1 - 0x88040103, // 0006 GETMBR R1 R0 K3 - 0x4C080000, // 0007 LDNIL R2 - 0x20040202, // 0008 NE R1 R1 R2 - 0x78060005, // 0009 JMPF R1 #0010 - 0x88040103, // 000A GETMBR R1 R0 K3 - 0x04040304, // 000B SUB R1 R1 K4 - 0x88080105, // 000C GETMBR R2 R0 K5 - 0x00080504, // 000D ADD R2 R2 K4 - 0x10040202, // 000E MOD R1 R1 R2 - 0x90020001, // 000F SETMBR R0 K0 R1 - 0x88040106, // 0010 GETMBR R1 R0 K6 - 0x4C080000, // 0011 LDNIL R2 - 0x20040202, // 0012 NE R1 R1 R2 - 0x7806000D, // 0013 JMPF R1 #0022 - 0x88040103, // 0014 GETMBR R1 R0 K3 - 0x4C080000, // 0015 LDNIL R2 - 0x1C040202, // 0016 EQ R1 R1 R2 - 0x74060003, // 0017 JMPT R1 #001C - 0x88040106, // 0018 GETMBR R1 R0 K6 - 0x88080103, // 0019 GETMBR R2 R0 K3 - 0x24040202, // 001A GT R1 R1 R2 - 0x78060005, // 001B JMPF R1 #0022 - 0x88040106, // 001C GETMBR R1 R0 K6 - 0x04040304, // 001D SUB R1 R1 K4 - 0x88080105, // 001E GETMBR R2 R0 K5 - 0x00080504, // 001F ADD R2 R2 K4 - 0x10040202, // 0020 MOD R1 R1 R2 - 0x90020001, // 0021 SETMBR R0 K0 R1 - 0x80000000, // 0022 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_ota_max -********************************************************************/ -be_local_closure(Partition_otadata_set_ota_max, /* 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(maxota), - }), - &be_const_str_set_ota_max, - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x80000000, // 0001 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: load -********************************************************************/ -be_local_closure(Partition_otadata_load, /* 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[ 8]) { /* constants */ - /* K0 */ be_nested_str(flash), - /* K1 */ be_nested_str(read), - /* K2 */ be_nested_str(seq0), - /* K3 */ be_nested_str(get), - /* K4 */ be_const_int(0), - /* K5 */ be_nested_str(seq1), - /* K6 */ be_nested_str(crc32_ota_seq), - /* K7 */ be_nested_str(_validate), - }), - &be_const_str_load, - &be_const_str_solidified, - ( &(const binstruction[46]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080301, // 0001 GETMET R2 R1 K1 - 0x5412DFFF, // 0002 LDINT R4 57344 - 0x5416001F, // 0003 LDINT R5 32 - 0x7C080600, // 0004 CALL R2 3 - 0x8C0C0301, // 0005 GETMET R3 R1 K1 - 0x5416EFFF, // 0006 LDINT R5 61440 - 0x541A001F, // 0007 LDINT R6 32 - 0x7C0C0600, // 0008 CALL R3 3 - 0x8C100503, // 0009 GETMET R4 R2 K3 - 0x58180004, // 000A LDCONST R6 K4 - 0x541E0003, // 000B LDINT R7 4 - 0x7C100600, // 000C CALL R4 3 - 0x90020404, // 000D SETMBR R0 K2 R4 - 0x8C100703, // 000E GETMET R4 R3 K3 - 0x58180004, // 000F LDCONST R6 K4 - 0x541E0003, // 0010 LDINT R7 4 - 0x7C100600, // 0011 CALL R4 3 - 0x90020A04, // 0012 SETMBR R0 K5 R4 - 0x8C100503, // 0013 GETMET R4 R2 K3 - 0x541A001B, // 0014 LDINT R6 28 - 0x541E0003, // 0015 LDINT R7 4 - 0x7C100600, // 0016 CALL R4 3 - 0x8C140106, // 0017 GETMET R5 R0 K6 - 0x881C0102, // 0018 GETMBR R7 R0 K2 - 0x7C140400, // 0019 CALL R5 2 - 0x1C100805, // 001A EQ R4 R4 R5 - 0x8C140703, // 001B GETMET R5 R3 K3 - 0x541E001B, // 001C LDINT R7 28 - 0x54220003, // 001D LDINT R8 4 - 0x7C140600, // 001E CALL R5 3 - 0x8C180106, // 001F GETMET R6 R0 K6 - 0x88200105, // 0020 GETMBR R8 R0 K5 - 0x7C180400, // 0021 CALL R6 2 - 0x1C140A06, // 0022 EQ R5 R5 R6 - 0x5C180800, // 0023 MOVE R6 R4 - 0x741A0001, // 0024 JMPT R6 #0027 - 0x4C180000, // 0025 LDNIL R6 - 0x90020406, // 0026 SETMBR R0 K2 R6 - 0x5C180A00, // 0027 MOVE R6 R5 - 0x741A0001, // 0028 JMPT R6 #002B - 0x4C180000, // 0029 LDNIL R6 - 0x90020A06, // 002A SETMBR R0 K5 R6 - 0x8C180107, // 002B GETMET R6 R0 K7 - 0x7C180200, // 002C CALL R6 1 - 0x80000000, // 002D RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: crc32_ota_seq -********************************************************************/ -be_local_closure(Partition_otadata_crc32_ota_seq, /* name */ - be_nested_proto( - 9, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str(crc), - /* K1 */ be_nested_str(crc32), - /* K2 */ be_nested_str(add), - }), - &be_const_str_crc32_ota_seq, - &be_const_str_solidified, - ( &(const binstruction[11]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080301, // 0001 GETMET R2 R1 K1 - 0x5411FFFE, // 0002 LDINT R4 -1 - 0x60140015, // 0003 GETGBL R5 G21 - 0x7C140000, // 0004 CALL R5 0 - 0x8C140B02, // 0005 GETMET R5 R5 K2 - 0x5C1C0000, // 0006 MOVE R7 R0 - 0x54220003, // 0007 LDINT R8 4 - 0x7C140600, // 0008 CALL R5 3 - 0x7C080600, // 0009 CALL R2 3 - 0x80040400, // 000A RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_active -********************************************************************/ -be_local_closure(Partition_otadata_set_active, /* 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_const_int(0), - /* K1 */ be_nested_str(seq0), - /* K2 */ be_nested_str(seq1), - /* K3 */ be_const_int(1), - /* K4 */ be_nested_str(maxota), - /* K5 */ be_nested_str(_validate), - }), - &be_const_str_set_active, - &be_const_str_solidified, - ( &(const binstruction[41]) { /* code */ - 0x58080000, // 0000 LDCONST R2 K0 - 0x580C0000, // 0001 LDCONST R3 K0 - 0x88100101, // 0002 GETMBR R4 R0 K1 - 0x4C140000, // 0003 LDNIL R5 - 0x20100805, // 0004 NE R4 R4 R5 - 0x78120001, // 0005 JMPF R4 #0008 - 0x88080101, // 0006 GETMBR R2 R0 K1 - 0x580C0000, // 0007 LDCONST R3 K0 - 0x88100102, // 0008 GETMBR R4 R0 K2 - 0x4C140000, // 0009 LDNIL R5 - 0x20100805, // 000A NE R4 R4 R5 - 0x78120004, // 000B JMPF R4 #0011 - 0x88100102, // 000C GETMBR R4 R0 K2 - 0x24100802, // 000D GT R4 R4 R2 - 0x78120001, // 000E JMPF R4 #0011 - 0x88080102, // 000F GETMBR R2 R0 K2 - 0x580C0003, // 0010 LDCONST R3 K3 - 0x04100503, // 0011 SUB R4 R2 K3 - 0x88140104, // 0012 GETMBR R5 R0 K4 - 0x00140B03, // 0013 ADD R5 R5 K3 - 0x10100805, // 0014 MOD R4 R4 R5 - 0x20140801, // 0015 NE R5 R4 R1 - 0x78160010, // 0016 JMPF R5 #0028 - 0x24140204, // 0017 GT R5 R1 R4 - 0x78160002, // 0018 JMPF R5 #001C - 0x04140204, // 0019 SUB R5 R1 R4 - 0x00080405, // 001A ADD R2 R2 R5 - 0x70020004, // 001B JMP #0021 - 0x88140104, // 001C GETMBR R5 R0 K4 - 0x00140B03, // 001D ADD R5 R5 K3 - 0x04140A04, // 001E SUB R5 R5 R4 - 0x00140A01, // 001F ADD R5 R5 R1 - 0x00080405, // 0020 ADD R2 R2 R5 - 0x1C140703, // 0021 EQ R5 R3 K3 - 0x78160001, // 0022 JMPF R5 #0025 - 0x90020202, // 0023 SETMBR R0 K1 R2 - 0x70020000, // 0024 JMP #0026 - 0x90020402, // 0025 SETMBR R0 K2 R2 - 0x8C140105, // 0026 GETMET R5 R0 K5 - 0x7C140200, // 0027 CALL R5 1 - 0x80000000, // 0028 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Partition_otadata_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[ 6]) { /* constants */ - /* K0 */ be_nested_str(maxota), - /* K1 */ be_nested_str(has_factory), - /* K2 */ be_const_int(1), - /* K3 */ be_nested_str(offset), - /* K4 */ be_nested_str(active_otadata), - /* K5 */ be_nested_str(load), - }), - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[19]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x90020202, // 0001 SETMBR R0 K1 R2 - 0x88100100, // 0002 GETMBR R4 R0 K0 - 0x4C140000, // 0003 LDNIL R5 - 0x1C100805, // 0004 EQ R4 R4 R5 - 0x78120000, // 0005 JMPF R4 #0007 - 0x90020102, // 0006 SETMBR R0 K0 K2 - 0x90020603, // 0007 SETMBR R0 K3 R3 - 0x88100103, // 0008 GETMBR R4 R0 K3 - 0x4C140000, // 0009 LDNIL R5 - 0x1C100805, // 000A EQ R4 R4 R5 - 0x78120001, // 000B JMPF R4 #000E - 0x5412DFFF, // 000C LDINT R4 57344 - 0x90020604, // 000D SETMBR R0 K3 R4 - 0x5411FFFE, // 000E LDINT R4 -1 - 0x90020804, // 000F SETMBR R0 K4 R4 - 0x8C100105, // 0010 GETMET R4 R0 K5 - 0x7C100200, // 0011 CALL R4 1 - 0x80000000, // 0012 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: Partition_otadata -********************************************************************/ -be_local_class(Partition_otadata, - 6, - NULL, - be_nested_map(14, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(init, -1), be_const_closure(Partition_otadata_init_closure) }, - { be_const_key(seq1, 13), be_const_var(5) }, - { be_const_key(save, -1), be_const_closure(Partition_otadata_save_closure) }, - { be_const_key(tostring, -1), be_const_closure(Partition_otadata_tostring_closure) }, - { be_const_key(_validate, 6), be_const_closure(Partition_otadata__validate_closure) }, - { be_const_key(set_ota_max, 0), be_const_closure(Partition_otadata_set_ota_max_closure) }, - { be_const_key(has_factory, -1), be_const_var(1) }, - { be_const_key(load, 8), be_const_closure(Partition_otadata_load_closure) }, - { be_const_key(crc32_ota_seq, -1), be_const_static_closure(Partition_otadata_crc32_ota_seq_closure) }, - { be_const_key(active_otadata, 11), be_const_var(3) }, - { be_const_key(offset, 9), be_const_var(2) }, - { be_const_key(seq0, -1), be_const_var(4) }, - { be_const_key(set_active, -1), be_const_closure(Partition_otadata_set_active_closure) }, - { be_const_key(maxota, -1), be_const_var(0) }, - })), - (bstring*) &be_const_str_Partition_otadata -); - -/******************************************************************** -** Solidified function: tobytes -********************************************************************/ -be_local_closure(Partition_tobytes, /* name */ - be_nested_proto( - 6, /* 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(slots), - /* K1 */ be_nested_str(value_error), - /* K2 */ be_nested_str(Too_X20many_X20partiition_X20slots), - /* K3 */ be_nested_str(tobytes), - /* K4 */ be_nested_str(stop_iteration), - /* K5 */ be_nested_str(MD5), - /* K6 */ be_nested_str(update), - /* K7 */ be_nested_str(EBEBFFFFFFFFFFFFFFFFFFFFFFFFFFFF), - /* K8 */ be_nested_str(finish), - }), - &be_const_str_tobytes, - &be_const_str_solidified, - ( &(const binstruction[35]) { /* code */ - 0x6004000C, // 0000 GETGBL R1 G12 - 0x88080100, // 0001 GETMBR R2 R0 K0 - 0x7C040200, // 0002 CALL R1 1 - 0x540A005E, // 0003 LDINT R2 95 - 0x24040202, // 0004 GT R1 R1 R2 - 0x78060000, // 0005 JMPF R1 #0007 - 0xB0060302, // 0006 RAISE 1 K1 K2 - 0x60040015, // 0007 GETGBL R1 G21 - 0x7C040000, // 0008 CALL R1 0 - 0x60080010, // 0009 GETGBL R2 G16 - 0x880C0100, // 000A GETMBR R3 R0 K0 - 0x7C080200, // 000B CALL R2 1 - 0xA8020005, // 000C EXBLK 0 #0013 - 0x5C0C0400, // 000D MOVE R3 R2 - 0x7C0C0000, // 000E CALL R3 0 - 0x8C100703, // 000F GETMET R4 R3 K3 - 0x7C100200, // 0010 CALL R4 1 - 0x00040204, // 0011 ADD R1 R1 R4 - 0x7001FFF9, // 0012 JMP #000D - 0x58080004, // 0013 LDCONST R2 K4 - 0xAC080200, // 0014 CATCH R2 1 0 - 0xB0080000, // 0015 RAISE 2 R0 R0 - 0xB80A0A00, // 0016 GETNGBL R2 K5 - 0x7C080000, // 0017 CALL R2 0 - 0x8C0C0506, // 0018 GETMET R3 R2 K6 - 0x5C140200, // 0019 MOVE R5 R1 - 0x7C0C0400, // 001A CALL R3 2 - 0x600C0015, // 001B GETGBL R3 G21 - 0x58100007, // 001C LDCONST R4 K7 - 0x7C0C0200, // 001D CALL R3 1 - 0x00040203, // 001E ADD R1 R1 R3 - 0x8C0C0508, // 001F GETMET R3 R2 K8 - 0x7C0C0200, // 0020 CALL R3 1 - 0x00040203, // 0021 ADD R1 R1 R3 - 0x80040200, // 0022 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: tostring -********************************************************************/ -be_local_closure(Partition_tostring, /* name */ - be_nested_proto( - 6, /* 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(_X3Cinstance_X3A_X20Partition_X28_X5B_X0A), - /* K1 */ be_nested_str(slots), - /* K2 */ be_nested_str(_X20_X20), - /* K3 */ be_nested_str(tostring), - /* K4 */ be_nested_str(_X0A), - /* K5 */ be_nested_str(stop_iteration), - /* K6 */ be_nested_str(_X5D_X2C_X0A_X20_X20), - /* K7 */ be_nested_str(otadata), - /* K8 */ be_nested_str(_X0A_X29_X3E), - }), - &be_const_str_tostring, - &be_const_str_solidified, - ( &(const binstruction[23]) { /* code */ - 0x58040000, // 0000 LDCONST R1 K0 - 0x60080010, // 0001 GETGBL R2 G16 - 0x880C0101, // 0002 GETMBR R3 R0 K1 - 0x7C080200, // 0003 CALL R2 1 - 0xA8020007, // 0004 EXBLK 0 #000D - 0x5C0C0400, // 0005 MOVE R3 R2 - 0x7C0C0000, // 0006 CALL R3 0 - 0x00040302, // 0007 ADD R1 R1 K2 - 0x8C100703, // 0008 GETMET R4 R3 K3 - 0x7C100200, // 0009 CALL R4 1 - 0x00040204, // 000A ADD R1 R1 R4 - 0x00040304, // 000B ADD R1 R1 K4 - 0x7001FFF7, // 000C JMP #0005 - 0x58080005, // 000D LDCONST R2 K5 - 0xAC080200, // 000E CATCH R2 1 0 - 0xB0080000, // 000F RAISE 2 R0 R0 - 0x00040306, // 0010 ADD R1 R1 K6 - 0x88080107, // 0011 GETMBR R2 R0 K7 - 0x8C080503, // 0012 GETMET R2 R2 K3 - 0x7C080200, // 0013 CALL R2 1 - 0x00040202, // 0014 ADD R1 R1 R2 - 0x00040308, // 0015 ADD R1 R1 K8 - 0x80040200, // 0016 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Partition_init, /* 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[ 4]) { /* constants */ - /* K0 */ be_nested_str(slots), - /* K1 */ be_nested_str(load), - /* K2 */ be_nested_str(parse), - /* K3 */ be_nested_str(load_otadata), - }), - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[10]) { /* code */ - 0x60040012, // 0000 GETGBL R1 G18 - 0x7C040000, // 0001 CALL R1 0 - 0x90020001, // 0002 SETMBR R0 K0 R1 - 0x8C040101, // 0003 GETMET R1 R0 K1 - 0x7C040200, // 0004 CALL R1 1 - 0x8C040102, // 0005 GETMET R1 R0 K2 - 0x7C040200, // 0006 CALL R1 1 - 0x8C040103, // 0007 GETMET R1 R0 K3 - 0x7C040200, // 0008 CALL R1 1 - 0x80000000, // 0009 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_active -********************************************************************/ -be_local_closure(Partition_get_active, /* 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[ 2]) { /* constants */ - /* K0 */ be_nested_str(otadata), - /* K1 */ be_nested_str(active_otadata), - }), - &be_const_str_get_active, - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x88040301, // 0001 GETMBR R1 R1 K1 - 0x80040200, // 0002 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: switch_factory -********************************************************************/ -be_local_closure(Partition_switch_factory, /* 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(flash), - /* K1 */ be_nested_str(factory), - }), - &be_const_str_switch_factory, - &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 - 0x80000000, // 0004 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: invalidate_spiffs -********************************************************************/ -be_local_closure(Partition_invalidate_spiffs, /* name */ - be_nested_proto( - 8, /* 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(flash), - /* K1 */ be_nested_str(slots), - /* K2 */ be_nested_str(is_spiffs), - /* K3 */ be_nested_str(value_error), - /* K4 */ be_nested_str(No_X20SPIFFS_X20partition_X20found), - /* K5 */ be_nested_str(00), - /* K6 */ be_nested_str(write), - /* K7 */ be_nested_str(start), - }), - &be_const_str_invalidate_spiffs, - &be_const_str_solidified, - ( &(const binstruction[22]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x5409FFFE, // 0001 LDINT R2 -1 - 0x880C0101, // 0002 GETMBR R3 R0 K1 - 0x94080602, // 0003 GETIDX R2 R3 R2 - 0x8C100502, // 0004 GETMET R4 R2 K2 - 0x7C100200, // 0005 CALL R4 1 - 0x74120000, // 0006 JMPT R4 #0008 - 0xB0060704, // 0007 RAISE 1 K3 K4 - 0x600C0015, // 0008 GETGBL R3 G21 - 0x58100005, // 0009 LDCONST R4 K5 - 0x7C0C0200, // 000A CALL R3 1 - 0x8C100306, // 000B GETMET R4 R1 K6 - 0x88180507, // 000C GETMBR R6 R2 K7 - 0x5C1C0600, // 000D MOVE R7 R3 - 0x7C100600, // 000E CALL R4 3 - 0x8C100306, // 000F GETMET R4 R1 K6 - 0x88180507, // 0010 GETMBR R6 R2 K7 - 0x541E0FFF, // 0011 LDINT R7 4096 - 0x00180C07, // 0012 ADD R6 R6 R7 - 0x5C1C0600, // 0013 MOVE R7 R3 - 0x7C100600, // 0014 CALL R4 3 - 0x80000000, // 0015 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_active -********************************************************************/ -be_local_closure(Partition_set_active, /* 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[ 7]) { /* constants */ - /* K0 */ be_const_int(0), - /* K1 */ be_nested_str(ota_max), - /* K2 */ be_nested_str(value_error), - /* K3 */ be_nested_str(Invalid_X20ota_X20partition_X20number), - /* K4 */ be_nested_str(otadata), - /* K5 */ be_nested_str(set_ota_max), - /* K6 */ be_nested_str(set_active), - }), - &be_const_str_set_active, - &be_const_str_solidified, - ( &(const binstruction[17]) { /* code */ - 0x14080300, // 0000 LT R2 R1 K0 - 0x740A0003, // 0001 JMPT R2 #0006 - 0x8C080101, // 0002 GETMET R2 R0 K1 - 0x7C080200, // 0003 CALL R2 1 - 0x24080202, // 0004 GT R2 R1 R2 - 0x780A0000, // 0005 JMPF R2 #0007 - 0xB0060503, // 0006 RAISE 1 K2 K3 - 0x88080104, // 0007 GETMBR R2 R0 K4 - 0x8C080505, // 0008 GETMET R2 R2 K5 - 0x8C100101, // 0009 GETMET R4 R0 K1 - 0x7C100200, // 000A CALL R4 1 - 0x7C080400, // 000B CALL R2 2 - 0x88080104, // 000C GETMBR R2 R0 K4 - 0x8C080506, // 000D GETMET R2 R2 K6 - 0x5C100200, // 000E MOVE R4 R1 - 0x7C080400, // 000F CALL R2 2 - 0x80000000, // 0010 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: ota_max -********************************************************************/ -be_local_closure(Partition_ota_max, /* name */ - be_nested_proto( - 6, /* 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(slots), - /* K1 */ be_nested_str(type), - /* K2 */ be_const_int(0), - /* K3 */ be_nested_str(subtype), - /* K4 */ be_nested_str(stop_iteration), - }), - &be_const_str_ota_max, - &be_const_str_solidified, - ( &(const binstruction[32]) { /* code */ - 0x4C040000, // 0000 LDNIL R1 - 0x60080010, // 0001 GETGBL R2 G16 - 0x880C0100, // 0002 GETMBR R3 R0 K0 - 0x7C080200, // 0003 CALL R2 1 - 0xA8020016, // 0004 EXBLK 0 #001C - 0x5C0C0400, // 0005 MOVE R3 R2 - 0x7C0C0000, // 0006 CALL R3 0 - 0x88100701, // 0007 GETMBR R4 R3 K1 - 0x1C100902, // 0008 EQ R4 R4 K2 - 0x78120010, // 0009 JMPF R4 #001B - 0x88100703, // 000A GETMBR R4 R3 K3 - 0x5416000F, // 000B LDINT R5 16 - 0x28100805, // 000C GE R4 R4 R5 - 0x7812000C, // 000D JMPF R4 #001B - 0x88100703, // 000E GETMBR R4 R3 K3 - 0x5416001F, // 000F LDINT R5 32 - 0x14100805, // 0010 LT R4 R4 R5 - 0x78120008, // 0011 JMPF R4 #001B - 0x88100703, // 0012 GETMBR R4 R3 K3 - 0x5416000F, // 0013 LDINT R5 16 - 0x04100805, // 0014 SUB R4 R4 R5 - 0x4C140000, // 0015 LDNIL R5 - 0x1C140205, // 0016 EQ R5 R1 R5 - 0x74160001, // 0017 JMPT R5 #001A - 0x24140801, // 0018 GT R5 R4 R1 - 0x78160000, // 0019 JMPF R5 #001B - 0x5C040800, // 001A MOVE R1 R4 - 0x7001FFE8, // 001B JMP #0005 - 0x58080004, // 001C LDCONST R2 K4 - 0xAC080200, // 001D CATCH R2 1 0 - 0xB0080000, // 001E RAISE 2 R0 R0 - 0x80040200, // 001F RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: parse -********************************************************************/ -be_local_closure(Partition_parse, /* 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[11]) { /* constants */ - /* K0 */ be_const_int(0), - /* K1 */ be_nested_str(raw), - /* K2 */ be_const_int(1), - /* K3 */ be_nested_str(get), - /* K4 */ be_const_int(2), - /* K5 */ be_nested_str(partition_core), - /* K6 */ be_nested_str(Partition_info), - /* K7 */ be_nested_str(slots), - /* K8 */ be_nested_str(push), - /* K9 */ be_nested_str(md5), - /* K10 */ be_nested_str(stop_iteration), - }), - &be_const_str_parse, - &be_const_str_solidified, - ( &(const binstruction[57]) { /* code */ - 0x60040010, // 0000 GETGBL R1 G16 - 0x540A005D, // 0001 LDINT R2 94 - 0x400A0002, // 0002 CONNECT R2 K0 R2 - 0x7C040200, // 0003 CALL R1 1 - 0xA802002F, // 0004 EXBLK 0 #0035 - 0x5C080200, // 0005 MOVE R2 R1 - 0x7C080000, // 0006 CALL R2 0 - 0x540E001F, // 0007 LDINT R3 32 - 0x080C0403, // 0008 MUL R3 R2 R3 - 0x00100502, // 0009 ADD R4 R2 K2 - 0x5416001F, // 000A LDINT R5 32 - 0x08100805, // 000B MUL R4 R4 R5 - 0x04100902, // 000C SUB R4 R4 K2 - 0x400C0604, // 000D CONNECT R3 R3 R4 - 0x88100101, // 000E GETMBR R4 R0 K1 - 0x940C0803, // 000F GETIDX R3 R4 R3 - 0x8C140703, // 0010 GETMET R5 R3 K3 - 0x581C0000, // 0011 LDCONST R7 K0 - 0x58200004, // 0012 LDCONST R8 K4 - 0x7C140600, // 0013 CALL R5 3 - 0x5C100A00, // 0014 MOVE R4 R5 - 0x541650A9, // 0015 LDINT R5 20650 - 0x1C140805, // 0016 EQ R5 R4 R5 - 0x78160008, // 0017 JMPF R5 #0021 - 0xB8160A00, // 0018 GETNGBL R5 K5 - 0x8C140B06, // 0019 GETMET R5 R5 K6 - 0x5C1C0600, // 001A MOVE R7 R3 - 0x7C140400, // 001B CALL R5 2 - 0x88180107, // 001C GETMBR R6 R0 K7 - 0x8C180D08, // 001D GETMET R6 R6 K8 - 0x5C200A00, // 001E MOVE R8 R5 - 0x7C180400, // 001F CALL R6 2 - 0x70020010, // 0020 JMP #0032 - 0x5416EBEA, // 0021 LDINT R5 60395 - 0x1C140805, // 0022 EQ R5 R4 R5 - 0x7816000C, // 0023 JMPF R5 #0031 - 0x5416001F, // 0024 LDINT R5 32 - 0x08140405, // 0025 MUL R5 R2 R5 - 0x541A000F, // 0026 LDINT R6 16 - 0x00140A06, // 0027 ADD R5 R5 R6 - 0x541A0020, // 0028 LDINT R6 33 - 0x08180406, // 0029 MUL R6 R2 R6 - 0x04180D02, // 002A SUB R6 R6 K2 - 0x40140A06, // 002B CONNECT R5 R5 R6 - 0x88180101, // 002C GETMBR R6 R0 K1 - 0x94140C05, // 002D GETIDX R5 R6 R5 - 0x90021205, // 002E SETMBR R0 K9 R5 - 0x70020002, // 002F JMP #0033 - 0x70020000, // 0030 JMP #0032 - 0x70020000, // 0031 JMP #0033 - 0x7001FFD1, // 0032 JMP #0005 - 0xA8040001, // 0033 EXBLK 1 1 - 0x70020002, // 0034 JMP #0038 - 0x5804000A, // 0035 LDCONST R1 K10 - 0xAC040200, // 0036 CATCH R1 1 0 - 0xB0080000, // 0037 RAISE 2 R0 R0 - 0x80000000, // 0038 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: has_factory -********************************************************************/ -be_local_closure(Partition_has_factory, /* 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(get_factory_slot), - }), - &be_const_str_has_factory, - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x8C040100, // 0000 GETMET R1 R0 K0 - 0x7C040200, // 0001 CALL R1 1 - 0x4C080000, // 0002 LDNIL R2 - 0x20040202, // 0003 NE R1 R1 R2 - 0x80040200, // 0004 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_ota_slot -********************************************************************/ -be_local_closure(Partition_get_ota_slot, /* 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(slots), - /* K1 */ be_nested_str(is_ota), - /* K2 */ be_nested_str(stop_iteration), - }), - &be_const_str_get_ota_slot, - &be_const_str_solidified, - ( &(const binstruction[18]) { /* code */ - 0x60080010, // 0000 GETGBL R2 G16 - 0x880C0100, // 0001 GETMBR R3 R0 K0 - 0x7C080200, // 0002 CALL R2 1 - 0xA8020008, // 0003 EXBLK 0 #000D - 0x5C0C0400, // 0004 MOVE R3 R2 - 0x7C0C0000, // 0005 CALL R3 0 - 0x8C100701, // 0006 GETMET R4 R3 K1 - 0x7C100200, // 0007 CALL R4 1 - 0x1C100801, // 0008 EQ R4 R4 R1 - 0x78120001, // 0009 JMPF R4 #000C - 0xA8040001, // 000A EXBLK 1 1 - 0x80040600, // 000B RET 1 R3 - 0x7001FFF6, // 000C JMP #0004 - 0x58080002, // 000D LDCONST R2 K2 - 0xAC080200, // 000E CATCH R2 1 0 - 0xB0080000, // 000F RAISE 2 R0 R0 - 0x4C080000, // 0010 LDNIL R2 - 0x80040400, // 0011 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: save -********************************************************************/ -be_local_closure(Partition_save, /* 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[ 6]) { /* constants */ - /* K0 */ be_nested_str(flash), - /* K1 */ be_nested_str(tobytes), - /* K2 */ be_nested_str(erase), - /* K3 */ be_nested_str(write), - /* K4 */ be_nested_str(otadata), - /* K5 */ be_nested_str(save), - }), - &be_const_str_save, - &be_const_str_solidified, - ( &(const binstruction[15]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080101, // 0001 GETMET R2 R0 K1 - 0x7C080200, // 0002 CALL R2 1 - 0x8C0C0302, // 0003 GETMET R3 R1 K2 - 0x54167FFF, // 0004 LDINT R5 32768 - 0x541A0FFF, // 0005 LDINT R6 4096 - 0x7C0C0600, // 0006 CALL R3 3 - 0x8C0C0303, // 0007 GETMET R3 R1 K3 - 0x54167FFF, // 0008 LDINT R5 32768 - 0x5C180400, // 0009 MOVE R6 R2 - 0x7C0C0600, // 000A CALL R3 3 - 0x880C0104, // 000B GETMBR R3 R0 K4 - 0x8C0C0705, // 000C GETMET R3 R3 K5 - 0x7C0C0200, // 000D CALL R3 1 - 0x80000000, // 000E RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: load_otadata -********************************************************************/ -be_local_closure(Partition_load_otadata, /* name */ - be_nested_proto( - 8, /* nstack */ - 1, /* 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(ota_max), - /* K1 */ be_nested_str(slots), - /* K2 */ be_nested_str(type), - /* K3 */ be_const_int(1), - /* K4 */ be_nested_str(subtype), - /* K5 */ be_const_int(0), - /* K6 */ be_nested_str(start), - /* K7 */ be_nested_str(stop_iteration), - /* K8 */ be_nested_str(otadata), - /* K9 */ be_nested_str(partition_core), - /* K10 */ be_nested_str(Partition_otadata), - /* K11 */ be_nested_str(has_factory), - }), - &be_const_str_load_otadata, - &be_const_str_solidified, - ( &(const binstruction[29]) { /* code */ - 0x5406DFFF, // 0000 LDINT R1 57344 - 0x8C080100, // 0001 GETMET R2 R0 K0 - 0x7C080200, // 0002 CALL R2 1 - 0x600C0010, // 0003 GETGBL R3 G16 - 0x88100101, // 0004 GETMBR R4 R0 K1 - 0x7C0C0200, // 0005 CALL R3 1 - 0xA8020009, // 0006 EXBLK 0 #0011 - 0x5C100600, // 0007 MOVE R4 R3 - 0x7C100000, // 0008 CALL R4 0 - 0x88140902, // 0009 GETMBR R5 R4 K2 - 0x1C140B03, // 000A EQ R5 R5 K3 - 0x78160003, // 000B JMPF R5 #0010 - 0x88140904, // 000C GETMBR R5 R4 K4 - 0x1C140B05, // 000D EQ R5 R5 K5 - 0x78160000, // 000E JMPF R5 #0010 - 0x88040906, // 000F GETMBR R1 R4 K6 - 0x7001FFF5, // 0010 JMP #0007 - 0x580C0007, // 0011 LDCONST R3 K7 - 0xAC0C0200, // 0012 CATCH R3 1 0 - 0xB0080000, // 0013 RAISE 2 R0 R0 - 0xB80E1200, // 0014 GETNGBL R3 K9 - 0x8C0C070A, // 0015 GETMET R3 R3 K10 - 0x5C140400, // 0016 MOVE R5 R2 - 0x8C18010B, // 0017 GETMET R6 R0 K11 - 0x7C180200, // 0018 CALL R6 1 - 0x5C1C0200, // 0019 MOVE R7 R1 - 0x7C0C0800, // 001A CALL R3 4 - 0x90021003, // 001B SETMBR R0 K8 R3 - 0x80000000, // 001C RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: load -********************************************************************/ -be_local_closure(Partition_load, /* name */ - be_nested_proto( - 6, /* 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(flash), - /* K1 */ be_nested_str(raw), - /* K2 */ be_nested_str(read), - }), - &be_const_str_load, - &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080302, // 0001 GETMET R2 R1 K2 - 0x54127FFF, // 0002 LDINT R4 32768 - 0x54160FFF, // 0003 LDINT R5 4096 - 0x7C080600, // 0004 CALL R2 3 - 0x90020202, // 0005 SETMBR R0 K1 R2 - 0x80000000, // 0006 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_factory_slot -********************************************************************/ -be_local_closure(Partition_get_factory_slot, /* 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(slots), - /* K1 */ be_nested_str(is_factory), - /* K2 */ be_nested_str(stop_iteration), - }), - &be_const_str_get_factory_slot, - &be_const_str_solidified, - ( &(const binstruction[16]) { /* code */ - 0x60040010, // 0000 GETGBL R1 G16 - 0x88080100, // 0001 GETMBR R2 R0 K0 - 0x7C040200, // 0002 CALL R1 1 - 0xA8020007, // 0003 EXBLK 0 #000C - 0x5C080200, // 0004 MOVE R2 R1 - 0x7C080000, // 0005 CALL R2 0 - 0x8C0C0501, // 0006 GETMET R3 R2 K1 - 0x7C0C0200, // 0007 CALL R3 1 - 0x780E0001, // 0008 JMPF R3 #000B - 0xA8040001, // 0009 EXBLK 1 1 - 0x80040400, // 000A RET 1 R2 - 0x7001FFF7, // 000B JMP #0004 - 0x58040002, // 000C LDCONST R1 K2 - 0xAC040200, // 000D CATCH R1 1 0 - 0xB0080000, // 000E RAISE 2 R0 R0 - 0x80000000, // 000F RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: Partition -********************************************************************/ -be_local_class(Partition, - 4, - NULL, - be_nested_map(19, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(raw, 3), be_const_var(0) }, - { be_const_key(get_factory_slot, -1), be_const_closure(Partition_get_factory_slot_closure) }, - { be_const_key(tostring, 17), be_const_closure(Partition_tostring_closure) }, - { be_const_key(load, -1), be_const_closure(Partition_load_closure) }, - { be_const_key(get_active, -1), be_const_closure(Partition_get_active_closure) }, - { be_const_key(switch_factory, -1), be_const_closure(Partition_switch_factory_closure) }, - { be_const_key(slots, 18), be_const_var(2) }, - { be_const_key(invalidate_spiffs, -1), be_const_closure(Partition_invalidate_spiffs_closure) }, - { be_const_key(set_active, 11), be_const_closure(Partition_set_active_closure) }, - { be_const_key(ota_max, 1), be_const_closure(Partition_ota_max_closure) }, - { be_const_key(parse, -1), be_const_closure(Partition_parse_closure) }, - { be_const_key(load_otadata, -1), be_const_closure(Partition_load_otadata_closure) }, - { be_const_key(save, -1), be_const_closure(Partition_save_closure) }, - { be_const_key(init, 15), be_const_closure(Partition_init_closure) }, - { be_const_key(tobytes, 12), be_const_closure(Partition_tobytes_closure) }, - { be_const_key(get_ota_slot, 6), be_const_closure(Partition_get_ota_slot_closure) }, - { be_const_key(md5, -1), be_const_var(1) }, - { be_const_key(has_factory, -1), be_const_closure(Partition_has_factory_closure) }, - { be_const_key(otadata, -1), be_const_var(3) }, - })), - (bstring*) &be_const_str_Partition -); - -/******************************************************************** -** Solidified function: is_factory -********************************************************************/ -be_local_closure(Partition_info_is_factory, /* 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[ 3]) { /* constants */ - /* K0 */ be_nested_str(type), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_str(subtype), - }), - &be_const_str_is_factory, - &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x1C040301, // 0001 EQ R1 R1 K1 - 0x78060002, // 0002 JMPF R1 #0006 - 0x88040102, // 0003 GETMBR R1 R0 K2 - 0x1C040301, // 0004 EQ R1 R1 K1 - 0x74060000, // 0005 JMPT R1 #0007 - 0x50040001, // 0006 LDBOOL R1 0 1 - 0x50040200, // 0007 LDBOOL R1 1 0 - 0x80040200, // 0008 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: type_to_string -********************************************************************/ -be_local_closure(Partition_info_type_to_string, /* name */ - be_nested_proto( - 6, /* 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(type), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_str(app), - /* K3 */ be_const_int(1), - /* K4 */ be_nested_str(data), - /* K5 */ be_nested_str(string), - /* K6 */ be_nested_str(format), - /* K7 */ be_nested_str(0x_X2502X), - }), - &be_const_str_type_to_string, - &be_const_str_solidified, - ( &(const binstruction[15]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x1C040301, // 0001 EQ R1 R1 K1 - 0x78060001, // 0002 JMPF R1 #0005 - 0x80060400, // 0003 RET 1 K2 - 0x70020003, // 0004 JMP #0009 - 0x88040100, // 0005 GETMBR R1 R0 K0 - 0x1C040303, // 0006 EQ R1 R1 K3 - 0x78060000, // 0007 JMPF R1 #0009 - 0x80060800, // 0008 RET 1 K4 - 0xA4060A00, // 0009 IMPORT R1 K5 - 0x8C080306, // 000A GETMET R2 R1 K6 - 0x58100007, // 000B LDCONST R4 K7 - 0x88140100, // 000C GETMBR R5 R0 K0 - 0x7C080600, // 000D CALL R2 3 - 0x80040400, // 000E RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Partition_info_init, /* name */ - be_nested_proto( - 8, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[18]) { /* constants */ - /* K0 */ be_nested_str(type), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_str(subtype), - /* K3 */ be_nested_str(start), - /* K4 */ be_nested_str(sz), - /* K5 */ be_nested_str(label), - /* K6 */ be_nested_str(), - /* K7 */ be_nested_str(flags), - /* K8 */ be_nested_str(get), - /* K9 */ be_const_int(2), - /* K10 */ be_const_int(1), - /* K11 */ be_const_int(3), - /* K12 */ be_nested_str(remove_trailing_zeroes), - /* K13 */ be_nested_str(asstring), - /* K14 */ be_nested_str(string), - /* K15 */ be_nested_str(format), - /* K16 */ be_nested_str(invalid_X20magic_X20number_X20_X2502X), - /* K17 */ be_nested_str(internal_error), - }), - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[61]) { /* code */ - 0x90020101, // 0000 SETMBR R0 K0 K1 - 0x90020501, // 0001 SETMBR R0 K2 K1 - 0x90020701, // 0002 SETMBR R0 K3 K1 - 0x90020901, // 0003 SETMBR R0 K4 K1 - 0x90020B06, // 0004 SETMBR R0 K5 K6 - 0x90020F01, // 0005 SETMBR R0 K7 K1 - 0x6008000E, // 0006 GETGBL R2 G14 - 0x600C0015, // 0007 GETGBL R3 G21 - 0x5C100200, // 0008 MOVE R4 R1 - 0x7C080400, // 0009 CALL R2 2 - 0x740A0000, // 000A JMPT R2 #000C - 0x80000400, // 000B RET 0 - 0x8C080308, // 000C GETMET R2 R1 K8 - 0x58100001, // 000D LDCONST R4 K1 - 0x58140009, // 000E LDCONST R5 K9 - 0x7C080600, // 000F CALL R2 3 - 0x540E50A9, // 0010 LDINT R3 20650 - 0x1C0C0403, // 0011 EQ R3 R2 R3 - 0x780E0022, // 0012 JMPF R3 #0036 - 0x8C0C0308, // 0013 GETMET R3 R1 K8 - 0x58140009, // 0014 LDCONST R5 K9 - 0x5818000A, // 0015 LDCONST R6 K10 - 0x7C0C0600, // 0016 CALL R3 3 - 0x90020003, // 0017 SETMBR R0 K0 R3 - 0x8C0C0308, // 0018 GETMET R3 R1 K8 - 0x5814000B, // 0019 LDCONST R5 K11 - 0x5818000A, // 001A LDCONST R6 K10 - 0x7C0C0600, // 001B CALL R3 3 - 0x90020403, // 001C SETMBR R0 K2 R3 - 0x8C0C0308, // 001D GETMET R3 R1 K8 - 0x54160003, // 001E LDINT R5 4 - 0x541A0003, // 001F LDINT R6 4 - 0x7C0C0600, // 0020 CALL R3 3 - 0x90020603, // 0021 SETMBR R0 K3 R3 - 0x8C0C0308, // 0022 GETMET R3 R1 K8 - 0x54160007, // 0023 LDINT R5 8 - 0x541A0003, // 0024 LDINT R6 4 - 0x7C0C0600, // 0025 CALL R3 3 - 0x90020803, // 0026 SETMBR R0 K4 R3 - 0x8C0C010C, // 0027 GETMET R3 R0 K12 - 0x5416000B, // 0028 LDINT R5 12 - 0x541A001A, // 0029 LDINT R6 27 - 0x40140A06, // 002A CONNECT R5 R5 R6 - 0x94140205, // 002B GETIDX R5 R1 R5 - 0x7C0C0400, // 002C CALL R3 2 - 0x8C0C070D, // 002D GETMET R3 R3 K13 - 0x7C0C0200, // 002E CALL R3 1 - 0x90020A03, // 002F SETMBR R0 K5 R3 - 0x8C0C0308, // 0030 GETMET R3 R1 K8 - 0x5416001B, // 0031 LDINT R5 28 - 0x541A0003, // 0032 LDINT R6 4 - 0x7C0C0600, // 0033 CALL R3 3 - 0x90020E03, // 0034 SETMBR R0 K7 R3 - 0x70020005, // 0035 JMP #003C - 0xA40E1C00, // 0036 IMPORT R3 K14 - 0x8C10070F, // 0037 GETMET R4 R3 K15 - 0x58180010, // 0038 LDCONST R6 K16 - 0x5C1C0400, // 0039 MOVE R7 R2 - 0x7C100600, // 003A CALL R4 3 - 0xB0062204, // 003B RAISE 1 K17 R4 - 0x80000000, // 003C RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: subtype_to_string -********************************************************************/ -be_local_closure(Partition_info_subtype_to_string, /* name */ - be_nested_proto( - 6, /* 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(type), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_str(subtype), - /* K3 */ be_nested_str(factory), - /* K4 */ be_nested_str(ota_), - /* K5 */ be_nested_str(test), - /* K6 */ be_const_int(1), - /* K7 */ be_nested_str(otadata), - /* K8 */ be_nested_str(phy), - /* K9 */ be_const_int(2), - /* K10 */ be_nested_str(nvs), - /* K11 */ be_const_int(3), - /* K12 */ be_nested_str(coredump), - /* K13 */ be_nested_str(nvskeys), - /* K14 */ be_nested_str(efuse_em), - /* K15 */ be_nested_str(esphttpd), - /* K16 */ be_nested_str(fat), - /* K17 */ be_nested_str(spiffs), - /* K18 */ be_nested_str(string), - /* K19 */ be_nested_str(format), - /* K20 */ be_nested_str(0x_X2502X), - }), - &be_const_str_subtype_to_string, - &be_const_str_solidified, - ( &(const binstruction[88]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x1C040301, // 0001 EQ R1 R1 K1 - 0x7806001A, // 0002 JMPF R1 #001E - 0x88040102, // 0003 GETMBR R1 R0 K2 - 0x1C040301, // 0004 EQ R1 R1 K1 - 0x78060001, // 0005 JMPF R1 #0008 - 0x80060600, // 0006 RET 1 K3 - 0x70020014, // 0007 JMP #001D - 0x88040102, // 0008 GETMBR R1 R0 K2 - 0x540A000F, // 0009 LDINT R2 16 - 0x28040202, // 000A GE R1 R1 R2 - 0x7806000B, // 000B JMPF R1 #0018 - 0x88040102, // 000C GETMBR R1 R0 K2 - 0x540A001F, // 000D LDINT R2 32 - 0x14040202, // 000E LT R1 R1 R2 - 0x78060007, // 000F JMPF R1 #0018 - 0x60040008, // 0010 GETGBL R1 G8 - 0x88080102, // 0011 GETMBR R2 R0 K2 - 0x540E000F, // 0012 LDINT R3 16 - 0x04080403, // 0013 SUB R2 R2 R3 - 0x7C040200, // 0014 CALL R1 1 - 0x00060801, // 0015 ADD R1 K4 R1 - 0x80040200, // 0016 RET 1 R1 - 0x70020004, // 0017 JMP #001D - 0x88040102, // 0018 GETMBR R1 R0 K2 - 0x540A001F, // 0019 LDINT R2 32 - 0x1C040202, // 001A EQ R1 R1 R2 - 0x78060000, // 001B JMPF R1 #001D - 0x80060A00, // 001C RET 1 K5 - 0x70020033, // 001D JMP #0052 - 0x88040100, // 001E GETMBR R1 R0 K0 - 0x1C040306, // 001F EQ R1 R1 K6 - 0x78060030, // 0020 JMPF R1 #0052 - 0x88040102, // 0021 GETMBR R1 R0 K2 - 0x1C040301, // 0022 EQ R1 R1 K1 - 0x78060001, // 0023 JMPF R1 #0026 - 0x80060E00, // 0024 RET 1 K7 - 0x7002002B, // 0025 JMP #0052 - 0x88040102, // 0026 GETMBR R1 R0 K2 - 0x1C040306, // 0027 EQ R1 R1 K6 - 0x78060001, // 0028 JMPF R1 #002B - 0x80061000, // 0029 RET 1 K8 - 0x70020026, // 002A JMP #0052 - 0x88040102, // 002B GETMBR R1 R0 K2 - 0x1C040309, // 002C EQ R1 R1 K9 - 0x78060001, // 002D JMPF R1 #0030 - 0x80061400, // 002E RET 1 K10 - 0x70020021, // 002F JMP #0052 - 0x88040102, // 0030 GETMBR R1 R0 K2 - 0x1C04030B, // 0031 EQ R1 R1 K11 - 0x78060001, // 0032 JMPF R1 #0035 - 0x80061800, // 0033 RET 1 K12 - 0x7002001C, // 0034 JMP #0052 - 0x88040102, // 0035 GETMBR R1 R0 K2 - 0x540A0003, // 0036 LDINT R2 4 - 0x1C040202, // 0037 EQ R1 R1 R2 - 0x78060001, // 0038 JMPF R1 #003B - 0x80061A00, // 0039 RET 1 K13 - 0x70020016, // 003A JMP #0052 - 0x88040102, // 003B GETMBR R1 R0 K2 - 0x540A0004, // 003C LDINT R2 5 - 0x1C040202, // 003D EQ R1 R1 R2 - 0x78060001, // 003E JMPF R1 #0041 - 0x80061C00, // 003F RET 1 K14 - 0x70020010, // 0040 JMP #0052 - 0x88040102, // 0041 GETMBR R1 R0 K2 - 0x540A007F, // 0042 LDINT R2 128 - 0x1C040202, // 0043 EQ R1 R1 R2 - 0x78060001, // 0044 JMPF R1 #0047 - 0x80061E00, // 0045 RET 1 K15 - 0x7002000A, // 0046 JMP #0052 - 0x88040102, // 0047 GETMBR R1 R0 K2 - 0x540A0080, // 0048 LDINT R2 129 - 0x1C040202, // 0049 EQ R1 R1 R2 - 0x78060001, // 004A JMPF R1 #004D - 0x80062000, // 004B RET 1 K16 - 0x70020004, // 004C JMP #0052 - 0x88040102, // 004D GETMBR R1 R0 K2 - 0x540A0081, // 004E LDINT R2 130 - 0x1C040202, // 004F EQ R1 R1 R2 - 0x78060000, // 0050 JMPF R1 #0052 - 0x80062200, // 0051 RET 1 K17 - 0xA4062400, // 0052 IMPORT R1 K18 - 0x8C080313, // 0053 GETMET R2 R1 K19 - 0x58100014, // 0054 LDCONST R4 K20 - 0x88140102, // 0055 GETMBR R5 R0 K2 - 0x7C080600, // 0056 CALL R2 3 - 0x80040400, // 0057 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: tostring -********************************************************************/ -be_local_closure(Partition_info_tostring, /* 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[14]) { /* constants */ - /* K0 */ be_nested_str(string), - /* K1 */ be_nested_str(type_to_string), - /* K2 */ be_nested_str(subtype_to_string), - /* K3 */ be_nested_str(), - /* K4 */ be_nested_str(_X20_X28), - /* K5 */ be_nested_str(_X29), - /* K6 */ be_nested_str(format), - /* K7 */ be_nested_str(_X3Cinstance_X3A_X20Partition_info_X28_X25d_X25s_X2C_X25d_X25s_X2C0x_X2508X_X2C0x_X2508X_X2C_X27_X25s_X27_X2C0x_X25X_X29_X3E), - /* K8 */ be_nested_str(type), - /* K9 */ be_nested_str(subtype), - /* K10 */ be_nested_str(start), - /* K11 */ be_nested_str(sz), - /* K12 */ be_nested_str(label), - /* K13 */ be_nested_str(flags), - }), - &be_const_str_tostring, - &be_const_str_solidified, - ( &(const binstruction[27]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080101, // 0001 GETMET R2 R0 K1 - 0x7C080200, // 0002 CALL R2 1 - 0x8C0C0102, // 0003 GETMET R3 R0 K2 - 0x7C0C0200, // 0004 CALL R3 1 - 0x20100503, // 0005 NE R4 R2 K3 - 0x78120002, // 0006 JMPF R4 #000A - 0x00120802, // 0007 ADD R4 K4 R2 - 0x00100905, // 0008 ADD R4 R4 K5 - 0x5C080800, // 0009 MOVE R2 R4 - 0x20100703, // 000A NE R4 R3 K3 - 0x78120002, // 000B JMPF R4 #000F - 0x00120803, // 000C ADD R4 K4 R3 - 0x00100905, // 000D ADD R4 R4 K5 - 0x5C0C0800, // 000E MOVE R3 R4 - 0x8C100306, // 000F GETMET R4 R1 K6 - 0x58180007, // 0010 LDCONST R6 K7 - 0x881C0108, // 0011 GETMBR R7 R0 K8 - 0x5C200400, // 0012 MOVE R8 R2 - 0x88240109, // 0013 GETMBR R9 R0 K9 - 0x5C280600, // 0014 MOVE R10 R3 - 0x882C010A, // 0015 GETMBR R11 R0 K10 - 0x8830010B, // 0016 GETMBR R12 R0 K11 - 0x8834010C, // 0017 GETMBR R13 R0 K12 - 0x8838010D, // 0018 GETMBR R14 R0 K13 - 0x7C101400, // 0019 CALL R4 10 - 0x80040800, // 001A RET 1 R4 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: is_ota -********************************************************************/ -be_local_closure(Partition_info_is_ota, /* 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[ 3]) { /* constants */ - /* K0 */ be_nested_str(subtype), - /* K1 */ be_nested_str(type), - /* K2 */ be_const_int(0), - }), - &be_const_str_is_ota, - &be_const_str_solidified, - ( &(const binstruction[14]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x88080101, // 0001 GETMBR R2 R0 K1 - 0x1C080502, // 0002 EQ R2 R2 K2 - 0x780A0008, // 0003 JMPF R2 #000D - 0x540A000F, // 0004 LDINT R2 16 - 0x28080202, // 0005 GE R2 R1 R2 - 0x780A0005, // 0006 JMPF R2 #000D - 0x540A001F, // 0007 LDINT R2 32 - 0x14080202, // 0008 LT R2 R1 R2 - 0x780A0002, // 0009 JMPF R2 #000D - 0x540A000F, // 000A LDINT R2 16 - 0x04080202, // 000B SUB R2 R1 R2 - 0x80040400, // 000C RET 1 R2 - 0x80000000, // 000D RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: tobytes -********************************************************************/ -be_local_closure(Partition_info_tobytes, /* 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[12]) { /* constants */ - /* K0 */ be_nested_str(AA50), - /* K1 */ be_nested_str(resize), - /* K2 */ be_const_int(2), - /* K3 */ be_nested_str(add), - /* K4 */ be_nested_str(type), - /* K5 */ be_const_int(1), - /* K6 */ be_nested_str(subtype), - /* K7 */ be_nested_str(start), - /* K8 */ be_nested_str(sz), - /* K9 */ be_nested_str(fromstring), - /* K10 */ be_nested_str(label), - /* K11 */ be_nested_str(flags), - }), - &be_const_str_tobytes, - &be_const_str_solidified, - ( &(const binstruction[39]) { /* code */ - 0x60040015, // 0000 GETGBL R1 G21 - 0x58080000, // 0001 LDCONST R2 K0 - 0x7C040200, // 0002 CALL R1 1 - 0x8C080301, // 0003 GETMET R2 R1 K1 - 0x5412001F, // 0004 LDINT R4 32 - 0x7C080400, // 0005 CALL R2 2 - 0x8C080501, // 0006 GETMET R2 R2 K1 - 0x58100002, // 0007 LDCONST R4 K2 - 0x7C080400, // 0008 CALL R2 2 - 0x8C080303, // 0009 GETMET R2 R1 K3 - 0x88100104, // 000A GETMBR R4 R0 K4 - 0x58140005, // 000B LDCONST R5 K5 - 0x7C080600, // 000C CALL R2 3 - 0x8C080303, // 000D GETMET R2 R1 K3 - 0x88100106, // 000E GETMBR R4 R0 K6 - 0x58140005, // 000F LDCONST R5 K5 - 0x7C080600, // 0010 CALL R2 3 - 0x8C080303, // 0011 GETMET R2 R1 K3 - 0x88100107, // 0012 GETMBR R4 R0 K7 - 0x54160003, // 0013 LDINT R5 4 - 0x7C080600, // 0014 CALL R2 3 - 0x8C080303, // 0015 GETMET R2 R1 K3 - 0x88100108, // 0016 GETMBR R4 R0 K8 - 0x54160003, // 0017 LDINT R5 4 - 0x7C080600, // 0018 CALL R2 3 - 0x60080015, // 0019 GETGBL R2 G21 - 0x7C080000, // 001A CALL R2 0 - 0x8C080509, // 001B GETMET R2 R2 K9 - 0x8810010A, // 001C GETMBR R4 R0 K10 - 0x7C080400, // 001D CALL R2 2 - 0x8C0C0501, // 001E GETMET R3 R2 K1 - 0x5416000F, // 001F LDINT R5 16 - 0x7C0C0400, // 0020 CALL R3 2 - 0x00040202, // 0021 ADD R1 R1 R2 - 0x8C0C0303, // 0022 GETMET R3 R1 K3 - 0x8814010B, // 0023 GETMBR R5 R0 K11 - 0x541A0003, // 0024 LDINT R6 4 - 0x7C0C0600, // 0025 CALL R3 3 - 0x80040200, // 0026 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: remove_trailing_zeroes -********************************************************************/ -be_local_closure(Partition_info_remove_trailing_zeroes, /* name */ - be_nested_proto( - 7, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_const_int(0), - /* K1 */ be_const_int(1), - /* K2 */ be_nested_str(resize), - }), - &be_const_str_remove_trailing_zeroes, - &be_const_str_solidified, - ( &(const binstruction[23]) { /* code */ - 0x6004000C, // 0000 GETGBL R1 G12 - 0x5C080000, // 0001 MOVE R2 R0 - 0x7C040200, // 0002 CALL R1 1 - 0x58080000, // 0003 LDCONST R2 K0 - 0x140C0401, // 0004 LT R3 R2 R1 - 0x780E0007, // 0005 JMPF R3 #000E - 0x540DFFFE, // 0006 LDINT R3 -1 - 0x040C0602, // 0007 SUB R3 R3 R2 - 0x940C0003, // 0008 GETIDX R3 R0 R3 - 0x200C0700, // 0009 NE R3 R3 K0 - 0x780E0000, // 000A JMPF R3 #000C - 0x70020001, // 000B JMP #000E - 0x00080501, // 000C ADD R2 R2 K1 - 0x7001FFF5, // 000D JMP #0004 - 0x240C0500, // 000E GT R3 R2 K0 - 0x780E0005, // 000F JMPF R3 #0016 - 0x8C0C0102, // 0010 GETMET R3 R0 K2 - 0x6014000C, // 0011 GETGBL R5 G12 - 0x5C180000, // 0012 MOVE R6 R0 - 0x7C140200, // 0013 CALL R5 1 - 0x04140A02, // 0014 SUB R5 R5 R2 - 0x7C0C0400, // 0015 CALL R3 2 - 0x80040000, // 0016 RET 1 R0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: is_spiffs -********************************************************************/ -be_local_closure(Partition_info_is_spiffs, /* 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[ 3]) { /* constants */ - /* K0 */ be_nested_str(type), - /* K1 */ be_const_int(1), - /* K2 */ be_nested_str(subtype), - }), - &be_const_str_is_spiffs, - &be_const_str_solidified, - ( &(const binstruction[10]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x1C040301, // 0001 EQ R1 R1 K1 - 0x78060003, // 0002 JMPF R1 #0007 - 0x88040102, // 0003 GETMBR R1 R0 K2 - 0x540A0081, // 0004 LDINT R2 130 - 0x1C040202, // 0005 EQ R1 R1 R2 - 0x74060000, // 0006 JMPT R1 #0008 - 0x50040001, // 0007 LDBOOL R1 0 1 - 0x50040200, // 0008 LDBOOL R1 1 0 - 0x80040200, // 0009 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_image_size -********************************************************************/ -be_local_closure(Partition_info_get_image_size, /* name */ - be_nested_proto( - 14, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[14]) { /* constants */ - /* K0 */ be_nested_str(flash), - /* K1 */ be_nested_str(is_ota), - /* K2 */ be_nested_str(is_factory), - /* K3 */ be_nested_str(start), - /* K4 */ be_nested_str(sz), - /* K5 */ be_nested_str(read), - /* K6 */ be_const_int(1), - /* K7 */ be_nested_str(get), - /* K8 */ be_const_int(0), - /* K9 */ be_nested_str(tasmota), - /* K10 */ be_nested_str(log), - /* K11 */ be_nested_str(BRY_X3A_X20Exception_X3E_X20_X27), - /* K12 */ be_nested_str(_X27_X20_X2D_X20), - /* K13 */ be_const_int(2), - }), - &be_const_str_get_image_size, - &be_const_str_solidified, - ( &(const binstruction[85]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080101, // 0001 GETMET R2 R0 K1 - 0x7C080200, // 0002 CALL R2 1 - 0x4C0C0000, // 0003 LDNIL R3 - 0x1C080403, // 0004 EQ R2 R2 R3 - 0x780A0004, // 0005 JMPF R2 #000B - 0x8C080102, // 0006 GETMET R2 R0 K2 - 0x7C080200, // 0007 CALL R2 1 - 0x740A0001, // 0008 JMPT R2 #000B - 0x5409FFFE, // 0009 LDINT R2 -1 - 0x80040400, // 000A RET 1 R2 - 0xA802003A, // 000B EXBLK 0 #0047 - 0x88080103, // 000C GETMBR R2 R0 K3 - 0x880C0104, // 000D GETMBR R3 R0 K4 - 0x8C100305, // 000E GETMET R4 R1 K5 - 0x5C180400, // 000F MOVE R6 R2 - 0x581C0006, // 0010 LDCONST R7 K6 - 0x7C100600, // 0011 CALL R4 3 - 0x8C100907, // 0012 GETMET R4 R4 K7 - 0x58180008, // 0013 LDCONST R6 K8 - 0x581C0006, // 0014 LDCONST R7 K6 - 0x7C100600, // 0015 CALL R4 3 - 0x541600E8, // 0016 LDINT R5 233 - 0x20140805, // 0017 NE R5 R4 R5 - 0x78160002, // 0018 JMPF R5 #001C - 0x5415FFFE, // 0019 LDINT R5 -1 - 0xA8040001, // 001A EXBLK 1 1 - 0x80040A00, // 001B RET 1 R5 - 0x8C140305, // 001C GETMET R5 R1 K5 - 0x001C0506, // 001D ADD R7 R2 K6 - 0x58200006, // 001E LDCONST R8 K6 - 0x7C140600, // 001F CALL R5 3 - 0x8C140B07, // 0020 GETMET R5 R5 K7 - 0x581C0008, // 0021 LDCONST R7 K8 - 0x58200006, // 0022 LDCONST R8 K6 - 0x7C140600, // 0023 CALL R5 3 - 0x541A001F, // 0024 LDINT R6 32 - 0x00180406, // 0025 ADD R6 R2 R6 - 0x581C0008, // 0026 LDCONST R7 K8 - 0x14200E05, // 0027 LT R8 R7 R5 - 0x78220017, // 0028 JMPF R8 #0041 - 0x8C200305, // 0029 GETMET R8 R1 K5 - 0x542A0007, // 002A LDINT R10 8 - 0x04280C0A, // 002B SUB R10 R6 R10 - 0x542E0007, // 002C LDINT R11 8 - 0x7C200600, // 002D CALL R8 3 - 0x8C241107, // 002E GETMET R9 R8 K7 - 0x582C0008, // 002F LDCONST R11 K8 - 0x54320003, // 0030 LDINT R12 4 - 0x7C240600, // 0031 CALL R9 3 - 0x8C281107, // 0032 GETMET R10 R8 K7 - 0x54320003, // 0033 LDINT R12 4 - 0x54360003, // 0034 LDINT R13 4 - 0x7C280600, // 0035 CALL R10 3 - 0x542E0007, // 0036 LDINT R11 8 - 0x002C140B, // 0037 ADD R11 R10 R11 - 0x00180C0B, // 0038 ADD R6 R6 R11 - 0x002C0403, // 0039 ADD R11 R2 R3 - 0x282C0C0B, // 003A GE R11 R6 R11 - 0x782E0002, // 003B JMPF R11 #003F - 0x542DFFFE, // 003C LDINT R11 -1 - 0xA8040001, // 003D EXBLK 1 1 - 0x80041600, // 003E RET 1 R11 - 0x001C0F06, // 003F ADD R7 R7 K6 - 0x7001FFE5, // 0040 JMP #0027 - 0x04200C02, // 0041 SUB R8 R6 R2 - 0x00201106, // 0042 ADD R8 R8 K6 - 0xA8040001, // 0043 EXBLK 1 1 - 0x80041000, // 0044 RET 1 R8 - 0xA8040001, // 0045 EXBLK 1 1 - 0x7002000C, // 0046 JMP #0054 - 0xAC080002, // 0047 CATCH R2 0 2 - 0x70020009, // 0048 JMP #0053 - 0xB8121200, // 0049 GETNGBL R4 K9 - 0x8C10090A, // 004A GETMET R4 R4 K10 - 0x001A1602, // 004B ADD R6 K11 R2 - 0x00180D0C, // 004C ADD R6 R6 K12 - 0x00180C03, // 004D ADD R6 R6 R3 - 0x581C000D, // 004E LDCONST R7 K13 - 0x7C100600, // 004F CALL R4 3 - 0x5411FFFE, // 0050 LDINT R4 -1 - 0x80040800, // 0051 RET 1 R4 - 0x70020000, // 0052 JMP #0054 - 0xB0080000, // 0053 RAISE 2 R0 R0 - 0x80000000, // 0054 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: Partition_info -********************************************************************/ -be_local_class(Partition_info, - 6, - NULL, - be_nested_map(16, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(is_factory, -1), be_const_closure(Partition_info_is_factory_closure) }, - { be_const_key(get_image_size, -1), be_const_closure(Partition_info_get_image_size_closure) }, - { be_const_key(is_spiffs, -1), be_const_closure(Partition_info_is_spiffs_closure) }, - { be_const_key(init, -1), be_const_closure(Partition_info_init_closure) }, - { be_const_key(type, 10), be_const_var(0) }, - { be_const_key(tostring, -1), be_const_closure(Partition_info_tostring_closure) }, - { be_const_key(flags, -1), be_const_var(5) }, - { be_const_key(tobytes, -1), be_const_closure(Partition_info_tobytes_closure) }, - { be_const_key(sz, -1), be_const_var(3) }, - { be_const_key(remove_trailing_zeroes, 2), be_const_static_closure(Partition_info_remove_trailing_zeroes_closure) }, - { be_const_key(label, 11), be_const_var(4) }, - { be_const_key(subtype, 14), be_const_var(1) }, - { be_const_key(is_ota, 6), be_const_closure(Partition_info_is_ota_closure) }, - { be_const_key(type_to_string, 4), be_const_closure(Partition_info_type_to_string_closure) }, - { be_const_key(subtype_to_string, -1), be_const_closure(Partition_info_subtype_to_string_closure) }, - { be_const_key(start, 1), be_const_var(2) }, - })), - (bstring*) &be_const_str_Partition_info -); - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(partition_core_init, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str(global), - /* K1 */ be_nested_str(partition_core), - }), - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x90060200, // 0001 SETMBR R1 K1 R0 - 0x80040000, // 0002 RET 1 R0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified module: partition_core -********************************************************************/ -be_local_module(partition_core, - "partition_core", - be_nested_map(4, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(Partition_otadata, -1), be_const_class(be_class_Partition_otadata) }, - { be_const_key(Partition, -1), be_const_class(be_class_Partition) }, - { be_const_key(Partition_info, -1), be_const_class(be_class_Partition_info) }, - { be_const_key(init, -1), be_const_closure(partition_core_init_closure) }, - })) -); -BE_EXPORT_VARIABLE be_define_const_native_module(partition_core); -/********************************************************************/ -/********************************************************************/ -/* End of solidification */ +#include "solidify/solidified_partition_core.h" diff --git a/lib/libesp32/berry_tasmota/src/be_python_compat.c b/lib/libesp32/berry_tasmota/src/be_python_compat.c index 5b3ec64d0..11b08ba4b 100644 --- a/lib/libesp32/berry_tasmota/src/be_python_compat.c +++ b/lib/libesp32/berry_tasmota/src/be_python_compat.c @@ -3,56 +3,4 @@ * * `import python_compat` *******************************************************************/ -#include "be_constobj.h" - -/******************************************************************** -** Solidified function: _anonymous_ -********************************************************************/ -be_local_closure(python_compat__anonymous_, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_str(global), - /* K1 */ be_nested_str(True), - /* K2 */ be_nested_str(False), - /* K3 */ be_nested_str(None), - /* K4 */ be_nested_str(b), - }), - &be_const_str__anonymous_, - &be_const_str_solidified, - ( &(const binstruction[10]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x50080200, // 0001 LDBOOL R2 1 0 - 0x90060202, // 0002 SETMBR R1 K1 R2 - 0x50080000, // 0003 LDBOOL R2 0 0 - 0x90060402, // 0004 SETMBR R1 K2 R2 - 0x4C080000, // 0005 LDNIL R2 - 0x90060602, // 0006 SETMBR R1 K3 R2 - 0x60080015, // 0007 GETGBL R2 G21 - 0x90060802, // 0008 SETMBR R1 K4 R2 - 0x80040000, // 0009 RET 1 R0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified module: python_compat -********************************************************************/ -be_local_module(python_compat, - "python_compat", - be_nested_map(1, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(init, -1), be_const_closure(python_compat__anonymous__closure) }, - })) -); -BE_EXPORT_VARIABLE be_define_const_native_module(python_compat); -/********************************************************************/ +#include "solidify/solidified_python_compat.h" diff --git a/lib/libesp32/berry_tasmota/src/be_tapp_lib.c b/lib/libesp32/berry_tasmota/src/be_tapp_lib.c index 42213338a..10f9f4d51 100644 --- a/lib/libesp32/berry_tasmota/src/be_tapp_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_tapp_lib.c @@ -4,165 +4,4 @@ * To use: `import tapp` * *******************************************************************/ -#include "be_constobj.h" - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Tapp_init, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str(tasmota), - /* K1 */ be_nested_str(add_driver), - }), - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0xB8060000, // 0000 GETNGBL R1 K0 - 0x8C040301, // 0001 GETMET R1 R1 K1 - 0x5C0C0000, // 0002 MOVE R3 R0 - 0x7C040400, // 0003 CALL R1 2 - 0x80000000, // 0004 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: autoexec -********************************************************************/ -be_local_closure(Tapp_autoexec, /* name */ - be_nested_proto( - 12, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[15]) { /* constants */ - /* K0 */ be_nested_str(path), - /* K1 */ be_nested_str(string), - /* K2 */ be_nested_str(listdir), - /* K3 */ be_nested_str(_X2F), - /* K4 */ be_nested_str(find), - /* K5 */ be_nested_str(_X2Etapp), - /* K6 */ be_const_int(0), - /* K7 */ be_nested_str(tasmota), - /* K8 */ be_nested_str(log), - /* K9 */ be_nested_str(format), - /* K10 */ be_nested_str(TAP_X3A_X20Loaded_X20Tasmota_X20App_X20_X27_X25s_X27), - /* K11 */ be_const_int(2), - /* K12 */ be_nested_str(load), - /* K13 */ be_nested_str(_X23autoexec_X2Ebe), - /* K14 */ be_nested_str(stop_iteration), - }), - &be_const_str_autoexec, - &be_const_str_solidified, - ( &(const binstruction[34]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0xA40A0200, // 0001 IMPORT R2 K1 - 0x8C0C0302, // 0002 GETMET R3 R1 K2 - 0x58140003, // 0003 LDCONST R5 K3 - 0x7C0C0400, // 0004 CALL R3 2 - 0x60100010, // 0005 GETGBL R4 G16 - 0x5C140600, // 0006 MOVE R5 R3 - 0x7C100200, // 0007 CALL R4 1 - 0xA8020014, // 0008 EXBLK 0 #001E - 0x5C140800, // 0009 MOVE R5 R4 - 0x7C140000, // 000A CALL R5 0 - 0x8C180504, // 000B GETMET R6 R2 K4 - 0x5C200A00, // 000C MOVE R8 R5 - 0x58240005, // 000D LDCONST R9 K5 - 0x7C180600, // 000E CALL R6 3 - 0x24180D06, // 000F GT R6 R6 K6 - 0x781A000B, // 0010 JMPF R6 #001D - 0xB81A0E00, // 0011 GETNGBL R6 K7 - 0x8C180D08, // 0012 GETMET R6 R6 K8 - 0x8C200509, // 0013 GETMET R8 R2 K9 - 0x5828000A, // 0014 LDCONST R10 K10 - 0x5C2C0A00, // 0015 MOVE R11 R5 - 0x7C200600, // 0016 CALL R8 3 - 0x5824000B, // 0017 LDCONST R9 K11 - 0x7C180600, // 0018 CALL R6 3 - 0xB81A0E00, // 0019 GETNGBL R6 K7 - 0x8C180D0C, // 001A GETMET R6 R6 K12 - 0x00200B0D, // 001B ADD R8 R5 K13 - 0x7C180400, // 001C CALL R6 2 - 0x7001FFEA, // 001D JMP #0009 - 0x5810000E, // 001E LDCONST R4 K14 - 0xAC100200, // 001F CATCH R4 1 0 - 0xB0080000, // 0020 RAISE 2 R0 R0 - 0x80000000, // 0021 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: Tapp -********************************************************************/ -be_local_class(Tapp, - 0, - NULL, - be_nested_map(2, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(autoexec, -1), be_const_closure(Tapp_autoexec_closure) }, - { be_const_key(init, 0), be_const_closure(Tapp_init_closure) }, - })), - be_str_weak(Tapp) -); - -/******************************************************************** -** Solidified function: _anonymous_ -********************************************************************/ -be_local_closure(tapp__anonymous_, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_const_class(be_class_Tapp), - }), - &be_const_str__anonymous_, - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x58040000, // 0000 LDCONST R1 K0 - 0xB4000000, // 0001 CLASS K0 - 0x5C080200, // 0002 MOVE R2 R1 - 0x7C080000, // 0003 CALL R2 0 - 0x80040400, // 0004 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified module: tapp -********************************************************************/ -be_local_module(tapp, - "tapp", - be_nested_map(1, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(init, -1), be_const_closure(tapp__anonymous__closure) }, - })) -); -BE_EXPORT_VARIABLE be_define_const_native_module(tapp); -/********************************************************************/ +#include "solidify/solidified_tapp.h" diff --git a/lib/libesp32/berry_tasmota/src/be_trigger_class.c b/lib/libesp32/berry_tasmota/src/be_trigger_class.c index 43eff94ff..4c18ce760 100644 --- a/lib/libesp32/berry_tasmota/src/be_trigger_class.c +++ b/lib/libesp32/berry_tasmota/src/be_trigger_class.c @@ -1,188 +1,6 @@ /******************************************************************** - * Tasmota lib + * Trigger class * * class Trigger *******************************************************************/ -#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) }, - })), - be_str_weak(Trigger) -); -/*******************************************************************/ - -void be_load_Trigger_class(bvm *vm) { - be_pushntvclass(vm, &be_class_Trigger); - be_setglobal(vm, "Trigger"); - be_pop(vm, 1); -} +#include "solidify/solidified_trigger_class.h" diff --git a/lib/libesp32/berry_tasmota/src/be_wire_lib.c b/lib/libesp32/berry_tasmota/src/be_wire_lib.c index d582fc477..5ae1344e6 100644 --- a/lib/libesp32/berry_tasmota/src/be_wire_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_wire_lib.c @@ -25,99 +25,7 @@ extern int b_wire_validread(bvm *vm); extern int b_wire_detect(bvm *vm); extern int b_wire_enabled(bvm *vm); -/******************************************************************** -** Solidified function: write_bytes -********************************************************************/ -be_local_closure(write_bytes, /* name */ - be_nested_proto( - 7, /* nstack */ - 4, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str(_begin_transmission), - /* K1 */ be_nested_str(_write), - /* K2 */ be_nested_str(_end_transmission), - }), - &be_const_str_write_bytes, - &be_const_str_solidified, - ( &(const binstruction[12]) { /* code */ - 0x8C100100, // 0000 GETMET R4 R0 K0 - 0x5C180200, // 0001 MOVE R6 R1 - 0x7C100400, // 0002 CALL R4 2 - 0x8C100101, // 0003 GETMET R4 R0 K1 - 0x5C180400, // 0004 MOVE R6 R2 - 0x7C100400, // 0005 CALL R4 2 - 0x8C100101, // 0006 GETMET R4 R0 K1 - 0x5C180600, // 0007 MOVE R6 R3 - 0x7C100400, // 0008 CALL R4 2 - 0x8C100102, // 0009 GETMET R4 R0 K2 - 0x7C100200, // 000A CALL R4 1 - 0x80000000, // 000B RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: read_bytes -********************************************************************/ -be_local_closure(read_bytes, /* name */ - be_nested_proto( - 8, /* nstack */ - 4, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_str(_begin_transmission), - /* K1 */ be_nested_str(_write), - /* K2 */ be_nested_str(_end_transmission), - /* K3 */ be_nested_str(_request_from), - /* K4 */ be_nested_str(_available), - /* K5 */ be_nested_str(_read), - }), - &be_const_str_read_bytes, - &be_const_str_solidified, - ( &(const binstruction[24]) { /* code */ - 0x8C100100, // 0000 GETMET R4 R0 K0 - 0x5C180200, // 0001 MOVE R6 R1 - 0x7C100400, // 0002 CALL R4 2 - 0x8C100101, // 0003 GETMET R4 R0 K1 - 0x5C180400, // 0004 MOVE R6 R2 - 0x7C100400, // 0005 CALL R4 2 - 0x8C100102, // 0006 GETMET R4 R0 K2 - 0x50180000, // 0007 LDBOOL R6 0 0 - 0x7C100400, // 0008 CALL R4 2 - 0x8C100103, // 0009 GETMET R4 R0 K3 - 0x5C180200, // 000A MOVE R6 R1 - 0x5C1C0600, // 000B MOVE R7 R3 - 0x7C100600, // 000C CALL R4 3 - 0x60100015, // 000D GETGBL R4 G21 - 0x5C140600, // 000E MOVE R5 R3 - 0x7C100200, // 000F CALL R4 1 - 0x8C140104, // 0010 GETMET R5 R0 K4 - 0x7C140200, // 0011 CALL R5 1 - 0x78160003, // 0012 JMPF R5 #0017 - 0x8C140105, // 0013 GETMET R5 R0 K5 - 0x7C140200, // 0014 CALL R5 1 - 0x40140805, // 0015 CONNECT R5 R4 R5 - 0x7001FFF8, // 0016 JMP #0010 - 0x80040800, // 0017 RET 1 R4 - }) - ) -); -/*******************************************************************/ - - +#include "solidify/solidified_Wire.h" #include "be_fixed_be_class_Wire.h" /* @const_object_info_begin @@ -138,8 +46,8 @@ class be_class_Wire (scope: global, name: Wire) { detect, func(b_wire_detect) enabled, func(b_wire_enabled) - read_bytes, closure(read_bytes_closure) - write_bytes, closure(write_bytes_closure) + read_bytes, closure(Wire_read_bytes_closure) + write_bytes, closure(Wire_write_bytes_closure) } @const_object_info_end */ diff --git a/lib/libesp32/berry_tasmota/src/be_zigbee.c b/lib/libesp32/berry_tasmota/src/be_zigbee.c index c6fab141f..9e10229b8 100644 --- a/lib/libesp32/berry_tasmota/src/be_zigbee.c +++ b/lib/libesp32/berry_tasmota/src/be_zigbee.c @@ -66,62 +66,7 @@ extern const bclass be_class_zcl_attribute_ntv; extern const bclass be_class_zcl_attribute; extern const bclass be_class_zcl_attribute_list; -/******************************************************************** -** Solidified function: tostring -********************************************************************/ -be_local_closure(zb_device_tostring, /* name */ - be_nested_proto( - 14, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[11]) { /* constants */ - /* K0 */ be_nested_str_weak(json), - /* K1 */ be_nested_str_weak(string), - /* K2 */ be_nested_str_weak(longaddr), - /* K3 */ be_nested_str_weak(format), - /* K4 */ be_nested_str_weak(_X3Cinstance_X3A_X20_X25s_X280x_X2504X_X2C_X200x_X2508X_X2508X_X2C_X20name_X3A_X27_X25s_X27_X2C_X20model_X3A_X27_X25s_X27_X2C_X20manufacturer_X3A_X27_X25s_X27_X29_X3E), - /* K5 */ be_nested_str_weak(shortaddr), - /* K6 */ be_nested_str_weak(get), - /* K7 */ be_const_int(0), - /* K8 */ be_nested_str_weak(name), - /* K9 */ be_nested_str_weak(model), - /* K10 */ be_nested_str_weak(manufacturer), - }), - be_str_weak(tostring), - &be_const_str_solidified, - ( &(const binstruction[22]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0xA40A0200, // 0001 IMPORT R2 K1 - 0x880C0102, // 0002 GETMBR R3 R0 K2 - 0x8C100503, // 0003 GETMET R4 R2 K3 - 0x58180004, // 0004 LDCONST R6 K4 - 0x601C0005, // 0005 GETGBL R7 G5 - 0x5C200000, // 0006 MOVE R8 R0 - 0x7C1C0200, // 0007 CALL R7 1 - 0x88200105, // 0008 GETMBR R8 R0 K5 - 0x8C240706, // 0009 GETMET R9 R3 K6 - 0x542E0003, // 000A LDINT R11 4 - 0x54320003, // 000B LDINT R12 4 - 0x7C240600, // 000C CALL R9 3 - 0x8C280706, // 000D GETMET R10 R3 K6 - 0x58300007, // 000E LDCONST R12 K7 - 0x54360003, // 000F LDINT R13 4 - 0x7C280600, // 0010 CALL R10 3 - 0x882C0108, // 0011 GETMBR R11 R0 K8 - 0x88300109, // 0012 GETMBR R12 R0 K9 - 0x8834010A, // 0013 GETMBR R13 R0 K10 - 0x7C101200, // 0014 CALL R4 9 - 0x80040800, // 0015 RET 1 R4 - }) - ) -); -/*******************************************************************/ - +#include "solidify/solidified_zigbee.h" // Module Zigbee extern const bclass be_class_zb_coord; diff --git a/lib/libesp32/berry_tasmota/src/be_zigbee_zb_coord.c b/lib/libesp32/berry_tasmota/src/be_zigbee_zb_coord.c index f1f63c60b..686b64fde 100644 --- a/lib/libesp32/berry_tasmota/src/be_zigbee_zb_coord.c +++ b/lib/libesp32/berry_tasmota/src/be_zigbee_zb_coord.c @@ -4,223 +4,6 @@ *******************************************************************/ #ifdef USE_ZIGBEE -#include "be_constobj.h" +#include "solidify/solidified_zigbee_zb_coord.h" -extern const bclass be_class_zb_coord_ntv; - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(zb_coord_init, /* 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_weak(init), - }), - be_str_weak(init), - &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0x60040003, // 0000 GETGBL R1 G3 - 0x5C080000, // 0001 MOVE R2 R0 - 0x7C040200, // 0002 CALL R1 1 - 0x8C040300, // 0003 GETMET R1 R1 K0 - 0x7C040200, // 0004 CALL R1 1 - 0x80000000, // 0005 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: add_handler -********************************************************************/ -be_local_closure(zb_coord_add_handler, /* 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_weak(instance), - /* K1 */ be_nested_str_weak(value_error), - /* K2 */ be_nested_str_weak(instance_X20required), - /* K3 */ be_nested_str_weak(_handlers), - /* K4 */ be_nested_str_weak(push), - }), - be_str_weak(add_handler), - &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: dispatch -********************************************************************/ -be_local_closure(zb_coord_dispatch, /* name */ - be_nested_proto( - 21, /* nstack */ - 5, /* 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_weak(_handlers), - /* K1 */ be_nested_str_weak(introspect), - /* K2 */ be_nested_str_weak(string), - /* K3 */ be_nested_str_weak(toptr), - /* K4 */ be_const_int(0), - /* K5 */ be_nested_str_weak(zcl_frame), - /* K6 */ be_nested_str_weak(zcl_attribute_list), - /* K7 */ be_nested_str_weak(get), - /* K8 */ be_nested_str_weak(function), - /* K9 */ be_nested_str_weak(format), - /* K10 */ be_nested_str_weak(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s), - /* K11 */ be_nested_str_weak(tasmota), - /* K12 */ be_nested_str_weak(_debug_present), - /* K13 */ be_nested_str_weak(debug), - /* K14 */ be_nested_str_weak(traceback), - /* K15 */ be_const_int(1), - }), - be_str_weak(dispatch), - &be_const_str_solidified, - ( &(const binstruction[71]) { /* code */ - 0x88140100, // 0000 GETMBR R5 R0 K0 - 0x4C180000, // 0001 LDNIL R6 - 0x1C140A06, // 0002 EQ R5 R5 R6 - 0x78160000, // 0003 JMPF R5 #0005 - 0x80000A00, // 0004 RET 0 - 0xA4160200, // 0005 IMPORT R5 K1 - 0xA41A0400, // 0006 IMPORT R6 K2 - 0x4C1C0000, // 0007 LDNIL R7 - 0x4C200000, // 0008 LDNIL R8 - 0x8C240B03, // 0009 GETMET R9 R5 K3 - 0x582C0004, // 000A LDCONST R11 K4 - 0x7C240400, // 000B CALL R9 2 - 0x20280409, // 000C NE R10 R2 R9 - 0x782A0003, // 000D JMPF R10 #0012 - 0x8C280105, // 000E GETMET R10 R0 K5 - 0x5C300400, // 000F MOVE R12 R2 - 0x7C280400, // 0010 CALL R10 2 - 0x5C1C1400, // 0011 MOVE R7 R10 - 0x20280609, // 0012 NE R10 R3 R9 - 0x782A0003, // 0013 JMPF R10 #0018 - 0x8C280106, // 0014 GETMET R10 R0 K6 - 0x5C300600, // 0015 MOVE R12 R3 - 0x7C280400, // 0016 CALL R10 2 - 0x5C201400, // 0017 MOVE R8 R10 - 0x58280004, // 0018 LDCONST R10 K4 - 0x602C000C, // 0019 GETGBL R11 G12 - 0x88300100, // 001A GETMBR R12 R0 K0 - 0x7C2C0200, // 001B CALL R11 1 - 0x142C140B, // 001C LT R11 R10 R11 - 0x782E0027, // 001D JMPF R11 #0046 - 0x882C0100, // 001E GETMBR R11 R0 K0 - 0x942C160A, // 001F GETIDX R11 R11 R10 - 0x8C300B07, // 0020 GETMET R12 R5 K7 - 0x5C381600, // 0021 MOVE R14 R11 - 0x5C3C0200, // 0022 MOVE R15 R1 - 0x7C300600, // 0023 CALL R12 3 - 0x60340004, // 0024 GETGBL R13 G4 - 0x5C381800, // 0025 MOVE R14 R12 - 0x7C340200, // 0026 CALL R13 1 - 0x1C341B08, // 0027 EQ R13 R13 K8 - 0x7836001A, // 0028 JMPF R13 #0044 - 0xA8020008, // 0029 EXBLK 0 #0033 - 0x5C341800, // 002A MOVE R13 R12 - 0x5C381600, // 002B MOVE R14 R11 - 0x5C3C0200, // 002C MOVE R15 R1 - 0x5C400E00, // 002D MOVE R16 R7 - 0x5C441000, // 002E MOVE R17 R8 - 0x5C480800, // 002F MOVE R18 R4 - 0x7C340A00, // 0030 CALL R13 5 - 0xA8040001, // 0031 EXBLK 1 1 - 0x70020010, // 0032 JMP #0044 - 0xAC340002, // 0033 CATCH R13 0 2 - 0x7002000D, // 0034 JMP #0043 - 0x603C0001, // 0035 GETGBL R15 G1 - 0x8C400D09, // 0036 GETMET R16 R6 K9 - 0x5848000A, // 0037 LDCONST R18 K10 - 0x5C4C1A00, // 0038 MOVE R19 R13 - 0x5C501C00, // 0039 MOVE R20 R14 - 0x7C400800, // 003A CALL R16 4 - 0x7C3C0200, // 003B CALL R15 1 - 0xB83E1600, // 003C GETNGBL R15 K11 - 0x883C1F0C, // 003D GETMBR R15 R15 K12 - 0x783E0002, // 003E JMPF R15 #0042 - 0xA43E1A00, // 003F IMPORT R15 K13 - 0x8C401F0E, // 0040 GETMET R16 R15 K14 - 0x7C400200, // 0041 CALL R16 1 - 0x70020000, // 0042 JMP #0044 - 0xB0080000, // 0043 RAISE 2 R0 R0 - 0x0028150F, // 0044 ADD R10 R10 K15 - 0x7001FFD2, // 0045 JMP #0019 - 0x80000000, // 0046 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: zb_coord -********************************************************************/ -extern const bclass be_class_zb_coord_ntv; -be_local_class(zb_coord, - 1, - &be_class_zb_coord_ntv, - be_nested_map(4, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(dispatch, 1), be_const_closure(zb_coord_dispatch_closure) }, - { be_const_key_weak(add_handler, 2), be_const_closure(zb_coord_add_handler_closure) }, - { be_const_key_weak(_handlers, -1), be_const_var(0) }, - { be_const_key_weak(init, 0), be_const_closure(zb_coord_init_closure) }, - })), - be_str_weak(zb_coord) -); -/*******************************************************************/ - -void be_load_zb_coord_class(bvm *vm) { - be_pushntvclass(vm, &be_class_zb_coord); - be_setglobal(vm, "zb_coord"); - be_pop(vm, 1); -} - - -#endif // USE_LIGHT +#endif // USE_ZIGBEE diff --git a/lib/libesp32/berry_tasmota/src/be_zigbee_zcl_attributes.c b/lib/libesp32/berry_tasmota/src/be_zigbee_zcl_attributes.c index b9b9a26a1..2cc9c391a 100644 --- a/lib/libesp32/berry_tasmota/src/be_zigbee_zcl_attributes.c +++ b/lib/libesp32/berry_tasmota/src/be_zigbee_zcl_attributes.c @@ -4,925 +4,6 @@ *******************************************************************/ #ifdef USE_ZIGBEE -#include "be_constobj.h" +#include "solidify/solidified_zigbee_zcl_attribute.h" - -/******************************************************************** -** Solidified function: tomap -********************************************************************/ -be_local_closure(zcl_attribute_tomap, /* 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[ 7]) { /* constants */ - /* K0 */ be_nested_str_weak(tomap), - /* K1 */ be_nested_str_weak(cluster), - /* K2 */ be_nested_str_weak(attr_id), - /* K3 */ be_nested_str_weak(cmd), - /* K4 */ be_nested_str_weak(direction), - /* K5 */ be_nested_str_weak(key), - /* K6 */ be_nested_str_weak(val), - }), - be_str_weak(tomap), - &be_const_str_solidified, - ( &(const binstruction[18]) { /* code */ - 0x60040003, // 0000 GETGBL R1 G3 - 0x5C080000, // 0001 MOVE R2 R0 - 0x7C040200, // 0002 CALL R1 1 - 0x8C040300, // 0003 GETMET R1 R1 K0 - 0x7C040200, // 0004 CALL R1 1 - 0x88080101, // 0005 GETMBR R2 R0 K1 - 0x98060202, // 0006 SETIDX R1 K1 R2 - 0x88080102, // 0007 GETMBR R2 R0 K2 - 0x98060402, // 0008 SETIDX R1 K2 R2 - 0x88080103, // 0009 GETMBR R2 R0 K3 - 0x98060602, // 000A SETIDX R1 K3 R2 - 0x88080104, // 000B GETMBR R2 R0 K4 - 0x98060802, // 000C SETIDX R1 K4 R2 - 0x88080105, // 000D GETMBR R2 R0 K5 - 0x98060A02, // 000E SETIDX R1 K5 R2 - 0x88080106, // 000F GETMBR R2 R0 K6 - 0x98060C02, // 0010 SETIDX R1 K6 R2 - 0x80040200, // 0011 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: key_tostring -********************************************************************/ -be_local_closure(zcl_attribute_key_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[15]) { /* constants */ - /* K0 */ be_nested_str_weak(string), - /* K1 */ be_nested_str_weak(_X3Cundefined_X3E), - /* K2 */ be_nested_str_weak(key), - /* K3 */ be_nested_str_weak(key_suffix), - /* K4 */ be_const_int(1), - /* K5 */ be_nested_str_weak(cluster), - /* K6 */ be_nested_str_weak(attr_id), - /* K7 */ be_nested_str_weak(format), - /* K8 */ be_nested_str_weak(_X2504X_X2F_X2504X), - /* K9 */ be_nested_str_weak(_X2B), - /* K10 */ be_nested_str_weak(cmd), - /* K11 */ be_nested_str_weak(direction), - /* K12 */ be_nested_str_weak(_X2504X_X25s_X2502X), - /* K13 */ be_nested_str_weak(_X3C), - /* K14 */ be_nested_str_weak(_X21), - }), - be_str_weak(key_tostring), - &be_const_str_solidified, - ( &(const binstruction[70]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x58080001, // 0001 LDCONST R2 K1 - 0x880C0102, // 0002 GETMBR R3 R0 K2 - 0x4C100000, // 0003 LDNIL R4 - 0x20100604, // 0004 NE R4 R3 R4 - 0x78120008, // 0005 JMPF R4 #000F - 0x5C080600, // 0006 MOVE R2 R3 - 0x88100103, // 0007 GETMBR R4 R0 K3 - 0x24100904, // 0008 GT R4 R4 K4 - 0x78120003, // 0009 JMPF R4 #000E - 0x60100008, // 000A GETGBL R4 G8 - 0x88140103, // 000B GETMBR R5 R0 K3 - 0x7C100200, // 000C CALL R4 1 - 0x00080404, // 000D ADD R2 R2 R4 - 0x70020035, // 000E JMP #0045 - 0x88100105, // 000F GETMBR R4 R0 K5 - 0x4C140000, // 0010 LDNIL R5 - 0x20100805, // 0011 NE R4 R4 R5 - 0x78120012, // 0012 JMPF R4 #0026 - 0x88100106, // 0013 GETMBR R4 R0 K6 - 0x4C140000, // 0014 LDNIL R5 - 0x20100805, // 0015 NE R4 R4 R5 - 0x7812000E, // 0016 JMPF R4 #0026 - 0x8C100307, // 0017 GETMET R4 R1 K7 - 0x58180008, // 0018 LDCONST R6 K8 - 0x881C0105, // 0019 GETMBR R7 R0 K5 - 0x88200106, // 001A GETMBR R8 R0 K6 - 0x7C100800, // 001B CALL R4 4 - 0x5C080800, // 001C MOVE R2 R4 - 0x88100103, // 001D GETMBR R4 R0 K3 - 0x24100904, // 001E GT R4 R4 K4 - 0x78120004, // 001F JMPF R4 #0025 - 0x60100008, // 0020 GETGBL R4 G8 - 0x88140103, // 0021 GETMBR R5 R0 K3 - 0x7C100200, // 0022 CALL R4 1 - 0x00121204, // 0023 ADD R4 K9 R4 - 0x00080404, // 0024 ADD R2 R2 R4 - 0x7002001E, // 0025 JMP #0045 - 0x88100105, // 0026 GETMBR R4 R0 K5 - 0x4C140000, // 0027 LDNIL R5 - 0x20100805, // 0028 NE R4 R4 R5 - 0x7812001A, // 0029 JMPF R4 #0045 - 0x8810010A, // 002A GETMBR R4 R0 K10 - 0x4C140000, // 002B LDNIL R5 - 0x20100805, // 002C NE R4 R4 R5 - 0x78120016, // 002D JMPF R4 #0045 - 0x8810010B, // 002E GETMBR R4 R0 K11 - 0x4C140000, // 002F LDNIL R5 - 0x20100805, // 0030 NE R4 R4 R5 - 0x78120012, // 0031 JMPF R4 #0045 - 0x8C100307, // 0032 GETMET R4 R1 K7 - 0x5818000C, // 0033 LDCONST R6 K12 - 0x881C0105, // 0034 GETMBR R7 R0 K5 - 0x8820010B, // 0035 GETMBR R8 R0 K11 - 0x78220001, // 0036 JMPF R8 #0039 - 0x5820000D, // 0037 LDCONST R8 K13 - 0x70020000, // 0038 JMP #003A - 0x5820000E, // 0039 LDCONST R8 K14 - 0x8824010A, // 003A GETMBR R9 R0 K10 - 0x7C100A00, // 003B CALL R4 5 - 0x5C080800, // 003C MOVE R2 R4 - 0x88100103, // 003D GETMBR R4 R0 K3 - 0x24100904, // 003E GT R4 R4 K4 - 0x78120004, // 003F JMPF R4 #0045 - 0x60100008, // 0040 GETGBL R4 G8 - 0x88140103, // 0041 GETMBR R5 R0 K3 - 0x7C100200, // 0042 CALL R4 1 - 0x00121204, // 0043 ADD R4 K9 R4 - 0x00080404, // 0044 ADD R2 R2 R4 - 0x80040400, // 0045 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: deinit -********************************************************************/ -be_local_closure(zcl_attribute_deinit, /* 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_weak(ismapped), - /* K1 */ be_nested_str_weak(_deinit), - }), - be_str_weak(deinit), - &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0x8C040100, // 0000 GETMET R1 R0 K0 - 0x7C040200, // 0001 CALL R1 1 - 0x74060001, // 0002 JMPT R1 #0005 - 0x8C040101, // 0003 GETMET R1 R0 K1 - 0x7C040200, // 0004 CALL R1 1 - 0x80000000, // 0005 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: tostring -********************************************************************/ -be_local_closure(zcl_attribute_tostring, /* 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[15]) { /* constants */ - /* K0 */ be_nested_str_weak(introspect), - /* K1 */ be_nested_str_weak(json), - /* K2 */ be_nested_str_weak(string), - /* K3 */ be_nested_str_weak(dump), - /* K4 */ be_nested_str_weak(key_tostring), - /* K5 */ be_nested_str_weak(_X3A), - /* K6 */ be_nested_str_weak(get), - /* K7 */ be_nested_str_weak(val), - /* K8 */ be_nested_str_weak(tojson), - /* K9 */ be_nested_str_weak(cluster), - /* K10 */ be_nested_str_weak(attr_id), - /* K11 */ be_nested_str_weak(key), - /* K12 */ be_nested_str_weak(format), - /* K13 */ be_nested_str_weak(_X28_X25s_X29), - /* K14 */ be_nested_str_weak(_X2C_X25s_X3A_X22_X2504X_X2F_X2504X_X22), - }), - be_str_weak(tostring), - &be_const_str_solidified, - ( &(const binstruction[51]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0xA40A0200, // 0001 IMPORT R2 K1 - 0xA40E0400, // 0002 IMPORT R3 K2 - 0x8C100503, // 0003 GETMET R4 R2 K3 - 0x8C180104, // 0004 GETMET R6 R0 K4 - 0x7C180200, // 0005 CALL R6 1 - 0x7C100400, // 0006 CALL R4 2 - 0x00100905, // 0007 ADD R4 R4 K5 - 0x8C140306, // 0008 GETMET R5 R1 K6 - 0x881C0107, // 0009 GETMBR R7 R0 K7 - 0x58200008, // 000A LDCONST R8 K8 - 0x7C140600, // 000B CALL R5 3 - 0x4C180000, // 000C LDNIL R6 - 0x20140A06, // 000D NE R5 R5 R6 - 0x78160004, // 000E JMPF R5 #0014 - 0x88140107, // 000F GETMBR R5 R0 K7 - 0x8C140B08, // 0010 GETMET R5 R5 K8 - 0x7C140200, // 0011 CALL R5 1 - 0x00100805, // 0012 ADD R4 R4 R5 - 0x70020003, // 0013 JMP #0018 - 0x8C140503, // 0014 GETMET R5 R2 K3 - 0x881C0107, // 0015 GETMBR R7 R0 K7 - 0x7C140400, // 0016 CALL R5 2 - 0x00100805, // 0017 ADD R4 R4 R5 - 0x88140109, // 0018 GETMBR R5 R0 K9 - 0x4C180000, // 0019 LDNIL R6 - 0x20140A06, // 001A NE R5 R5 R6 - 0x78160015, // 001B JMPF R5 #0032 - 0x8814010A, // 001C GETMBR R5 R0 K10 - 0x4C180000, // 001D LDNIL R6 - 0x20140A06, // 001E NE R5 R5 R6 - 0x78160011, // 001F JMPF R5 #0032 - 0x8814010B, // 0020 GETMBR R5 R0 K11 - 0x4C180000, // 0021 LDNIL R6 - 0x20140A06, // 0022 NE R5 R5 R6 - 0x7816000D, // 0023 JMPF R5 #0032 - 0x8C14070C, // 0024 GETMET R5 R3 K12 - 0x581C000D, // 0025 LDCONST R7 K13 - 0x8C200104, // 0026 GETMET R8 R0 K4 - 0x7C200200, // 0027 CALL R8 1 - 0x7C140600, // 0028 CALL R5 3 - 0x8C18070C, // 0029 GETMET R6 R3 K12 - 0x5820000E, // 002A LDCONST R8 K14 - 0x8C240503, // 002B GETMET R9 R2 K3 - 0x5C2C0A00, // 002C MOVE R11 R5 - 0x7C240400, // 002D CALL R9 2 - 0x88280109, // 002E GETMBR R10 R0 K9 - 0x882C010A, // 002F GETMBR R11 R0 K10 - 0x7C180A00, // 0030 CALL R6 5 - 0x00100806, // 0031 ADD R4 R4 R6 - 0x80040800, // 0032 RET 1 R4 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: setmember -********************************************************************/ -be_local_closure(zcl_attribute_setmember, /* 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[16]) { /* constants */ - /* K0 */ be_nested_str_weak(cluster), - /* K1 */ be_nested_str_weak(_cluster), - /* K2 */ be_nested_str_weak(attr_id), - /* K3 */ be_nested_str_weak(_attr_id), - /* K4 */ be_nested_str_weak(_iscmd), - /* K5 */ be_const_int(0), - /* K6 */ be_nested_str_weak(cmd), - /* K7 */ be_nested_str_weak(_cmd), - /* K8 */ be_const_int(1), - /* K9 */ be_nested_str_weak(_direction), - /* K10 */ be_nested_str_weak(direction), - /* K11 */ be_nested_str_weak(val), - /* K12 */ be_nested_str_weak(_set_val), - /* K13 */ be_nested_str_weak(key), - /* K14 */ be_nested_str_weak(_set_key), - /* K15 */ be_nested_str_weak(setmember), - }), - be_str_weak(setmember), - &be_const_str_solidified, - ( &(const binstruction[72]) { /* code */ - 0x1C0C0300, // 0000 EQ R3 R1 K0 - 0x780E0007, // 0001 JMPF R3 #000A - 0x4C0C0000, // 0002 LDNIL R3 - 0x1C0C0403, // 0003 EQ R3 R2 R3 - 0x780E0002, // 0004 JMPF R3 #0008 - 0x540EFFFE, // 0005 LDINT R3 65535 - 0x90020203, // 0006 SETMBR R0 K1 R3 - 0x70020000, // 0007 JMP #0009 - 0x90020202, // 0008 SETMBR R0 K1 R2 - 0x7002003C, // 0009 JMP #0047 - 0x1C0C0302, // 000A EQ R3 R1 K2 - 0x780E0008, // 000B JMPF R3 #0015 - 0x4C0C0000, // 000C LDNIL R3 - 0x1C0C0403, // 000D EQ R3 R2 R3 - 0x780E0002, // 000E JMPF R3 #0012 - 0x540EFFFE, // 000F LDINT R3 65535 - 0x90020603, // 0010 SETMBR R0 K3 R3 - 0x70020001, // 0011 JMP #0014 - 0x90020602, // 0012 SETMBR R0 K3 R2 - 0x90020905, // 0013 SETMBR R0 K4 K5 - 0x70020031, // 0014 JMP #0047 - 0x1C0C0306, // 0015 EQ R3 R1 K6 - 0x780E000D, // 0016 JMPF R3 #0025 - 0x4C0C0000, // 0017 LDNIL R3 - 0x1C0C0403, // 0018 EQ R3 R2 R3 - 0x780E0002, // 0019 JMPF R3 #001D - 0x540E00FE, // 001A LDINT R3 255 - 0x90020E03, // 001B SETMBR R0 K7 R3 - 0x70020006, // 001C JMP #0024 - 0x90020E02, // 001D SETMBR R0 K7 R2 - 0x90020908, // 001E SETMBR R0 K4 K8 - 0x880C0109, // 001F GETMBR R3 R0 K9 - 0x541200FE, // 0020 LDINT R4 255 - 0x1C0C0604, // 0021 EQ R3 R3 R4 - 0x780E0000, // 0022 JMPF R3 #0024 - 0x90021305, // 0023 SETMBR R0 K9 K5 - 0x70020021, // 0024 JMP #0047 - 0x1C0C030A, // 0025 EQ R3 R1 K10 - 0x780E000C, // 0026 JMPF R3 #0034 - 0x4C0C0000, // 0027 LDNIL R3 - 0x1C0C0403, // 0028 EQ R3 R2 R3 - 0x780E0002, // 0029 JMPF R3 #002D - 0x540E00FE, // 002A LDINT R3 255 - 0x90021203, // 002B SETMBR R0 K9 R3 - 0x70020005, // 002C JMP #0033 - 0x780A0001, // 002D JMPF R2 #0030 - 0x580C0008, // 002E LDCONST R3 K8 - 0x70020000, // 002F JMP #0031 - 0x580C0005, // 0030 LDCONST R3 K5 - 0x90021203, // 0031 SETMBR R0 K9 R3 - 0x90020908, // 0032 SETMBR R0 K4 K8 - 0x70020012, // 0033 JMP #0047 - 0x1C0C030B, // 0034 EQ R3 R1 K11 - 0x780E0003, // 0035 JMPF R3 #003A - 0x8C0C010C, // 0036 GETMET R3 R0 K12 - 0x5C140400, // 0037 MOVE R5 R2 - 0x7C0C0400, // 0038 CALL R3 2 - 0x7002000C, // 0039 JMP #0047 - 0x1C0C030D, // 003A EQ R3 R1 K13 - 0x780E0003, // 003B JMPF R3 #0040 - 0x8C0C010E, // 003C GETMET R3 R0 K14 - 0x5C140400, // 003D MOVE R5 R2 - 0x7C0C0400, // 003E CALL R3 2 - 0x70020006, // 003F JMP #0047 - 0x600C0003, // 0040 GETGBL R3 G3 - 0x5C100000, // 0041 MOVE R4 R0 - 0x7C0C0200, // 0042 CALL R3 1 - 0x8C0C070F, // 0043 GETMET R3 R3 K15 - 0x5C140200, // 0044 MOVE R5 R1 - 0x5C180400, // 0045 MOVE R6 R2 - 0x7C0C0600, // 0046 CALL R3 3 - 0x80000000, // 0047 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(zcl_attribute_init, /* 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_weak(init), - /* K1 */ be_nested_str_weak(_init), - }), - be_str_weak(init), - &be_const_str_solidified, - ( &(const binstruction[12]) { /* code */ - 0x60080003, // 0000 GETGBL R2 G3 - 0x5C0C0000, // 0001 MOVE R3 R0 - 0x7C080200, // 0002 CALL R2 1 - 0x8C080500, // 0003 GETMET R2 R2 K0 - 0x5C100200, // 0004 MOVE R4 R1 - 0x7C080400, // 0005 CALL R2 2 - 0x4C080000, // 0006 LDNIL R2 - 0x1C080202, // 0007 EQ R2 R1 R2 - 0x780A0001, // 0008 JMPF R2 #000B - 0x8C080101, // 0009 GETMET R2 R0 K1 - 0x7C080200, // 000A CALL R2 1 - 0x80000000, // 000B RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: member -********************************************************************/ -be_local_closure(zcl_attribute_member, /* 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[16]) { /* constants */ - /* K0 */ be_nested_str_weak(cluster), - /* K1 */ be_nested_str_weak(_cluster), - /* K2 */ be_nested_str_weak(attr_id), - /* K3 */ be_nested_str_weak(_attr_id), - /* K4 */ be_nested_str_weak(_iscmd), - /* K5 */ be_nested_str_weak(cmd), - /* K6 */ be_nested_str_weak(_cmd), - /* K7 */ be_nested_str_weak(direction), - /* K8 */ be_nested_str_weak(_direction), - /* K9 */ be_const_int(1), - /* K10 */ be_nested_str_weak(val), - /* K11 */ be_nested_str_weak(_get_val), - /* K12 */ be_nested_str_weak(tohex), - /* K13 */ be_nested_str_weak(key), - /* K14 */ be_nested_str_weak(_get_key), - /* K15 */ be_nested_str_weak(member), - }), - be_str_weak(member), - &be_const_str_solidified, - ( &(const binstruction[78]) { /* code */ - 0x1C080300, // 0000 EQ R2 R1 K0 - 0x780A0008, // 0001 JMPF R2 #000B - 0x88080101, // 0002 GETMBR R2 R0 K1 - 0x540EFFFE, // 0003 LDINT R3 65535 - 0x200C0403, // 0004 NE R3 R2 R3 - 0x780E0001, // 0005 JMPF R3 #0008 - 0x5C0C0400, // 0006 MOVE R3 R2 - 0x70020000, // 0007 JMP #0009 - 0x4C0C0000, // 0008 LDNIL R3 - 0x80040600, // 0009 RET 1 R3 - 0x70020041, // 000A JMP #004D - 0x1C080302, // 000B EQ R2 R1 K2 - 0x780A000A, // 000C JMPF R2 #0018 - 0x88080103, // 000D GETMBR R2 R0 K3 - 0x540EFFFE, // 000E LDINT R3 65535 - 0x200C0403, // 000F NE R3 R2 R3 - 0x780E0003, // 0010 JMPF R3 #0015 - 0x880C0104, // 0011 GETMBR R3 R0 K4 - 0x740E0001, // 0012 JMPT R3 #0015 - 0x5C0C0400, // 0013 MOVE R3 R2 - 0x70020000, // 0014 JMP #0016 - 0x4C0C0000, // 0015 LDNIL R3 - 0x80040600, // 0016 RET 1 R3 - 0x70020034, // 0017 JMP #004D - 0x1C080305, // 0018 EQ R2 R1 K5 - 0x780A000A, // 0019 JMPF R2 #0025 - 0x88080106, // 001A GETMBR R2 R0 K6 - 0x540E00FE, // 001B LDINT R3 255 - 0x200C0403, // 001C NE R3 R2 R3 - 0x780E0003, // 001D JMPF R3 #0022 - 0x880C0104, // 001E GETMBR R3 R0 K4 - 0x780E0001, // 001F JMPF R3 #0022 - 0x5C0C0400, // 0020 MOVE R3 R2 - 0x70020000, // 0021 JMP #0023 - 0x4C0C0000, // 0022 LDNIL R3 - 0x80040600, // 0023 RET 1 R3 - 0x70020027, // 0024 JMP #004D - 0x1C080307, // 0025 EQ R2 R1 K7 - 0x780A000A, // 0026 JMPF R2 #0032 - 0x88080108, // 0027 GETMBR R2 R0 K8 - 0x540E00FE, // 0028 LDINT R3 255 - 0x200C0403, // 0029 NE R3 R2 R3 - 0x780E0003, // 002A JMPF R3 #002F - 0x880C0104, // 002B GETMBR R3 R0 K4 - 0x780E0001, // 002C JMPF R3 #002F - 0x2C0C0509, // 002D AND R3 R2 K9 - 0x70020000, // 002E JMP #0030 - 0x4C0C0000, // 002F LDNIL R3 - 0x80040600, // 0030 RET 1 R3 - 0x7002001A, // 0031 JMP #004D - 0x1C08030A, // 0032 EQ R2 R1 K10 - 0x780A000B, // 0033 JMPF R2 #0040 - 0x8C08010B, // 0034 GETMET R2 R0 K11 - 0x7C080200, // 0035 CALL R2 1 - 0x600C000F, // 0036 GETGBL R3 G15 - 0x5C100400, // 0037 MOVE R4 R2 - 0x60140015, // 0038 GETGBL R5 G21 - 0x7C0C0400, // 0039 CALL R3 2 - 0x780E0002, // 003A JMPF R3 #003E - 0x8C0C050C, // 003B GETMET R3 R2 K12 - 0x7C0C0200, // 003C CALL R3 1 - 0x5C080600, // 003D MOVE R2 R3 - 0x80040400, // 003E RET 1 R2 - 0x7002000C, // 003F JMP #004D - 0x1C08030D, // 0040 EQ R2 R1 K13 - 0x780A0003, // 0041 JMPF R2 #0046 - 0x8C08010E, // 0042 GETMET R2 R0 K14 - 0x7C080200, // 0043 CALL R2 1 - 0x80040400, // 0044 RET 1 R2 - 0x70020006, // 0045 JMP #004D - 0x60080003, // 0046 GETGBL R2 G3 - 0x5C0C0000, // 0047 MOVE R3 R0 - 0x7C080200, // 0048 CALL R2 1 - 0x8C08050F, // 0049 GETMET R2 R2 K15 - 0x5C100200, // 004A MOVE R4 R1 - 0x7C080400, // 004B CALL R2 2 - 0x80040400, // 004C RET 1 R2 - 0x80000000, // 004D RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: zcl_attribute -********************************************************************/ -extern const bclass be_class_zcl_attribute_ntv; -be_local_class(zcl_attribute, - 0, - &be_class_zcl_attribute_ntv, - be_nested_map(7, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(tomap, -1), be_const_closure(zcl_attribute_tomap_closure) }, - { be_const_key_weak(key_tostring, -1), be_const_closure(zcl_attribute_key_tostring_closure) }, - { be_const_key_weak(setmember, -1), be_const_closure(zcl_attribute_setmember_closure) }, - { be_const_key_weak(tostring, -1), be_const_closure(zcl_attribute_tostring_closure) }, - { be_const_key_weak(init, 2), be_const_closure(zcl_attribute_init_closure) }, - { be_const_key_weak(deinit, 4), be_const_closure(zcl_attribute_deinit_closure) }, - { be_const_key_weak(member, -1), be_const_closure(zcl_attribute_member_closure) }, - })), - be_str_weak(zcl_attribute) -); -/*******************************************************************/ - -void be_load_zcl_attribute_class(bvm *vm) { - be_pushntvclass(vm, &be_class_zcl_attribute); - be_setglobal(vm, "zcl_attribute"); - be_pop(vm, 1); -} - -/******************************************************************** -** Solidified function: member -********************************************************************/ -be_local_closure(zcl_attribute_list_member, /* 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[ 7]) { /* constants */ - /* K0 */ be_nested_str_weak(groupaddr), - /* K1 */ be_nested_str_weak(_groupaddr), - /* K2 */ be_nested_str_weak(src_ep), - /* K3 */ be_nested_str_weak(_src_ep), - /* K4 */ be_nested_str_weak(lqi), - /* K5 */ be_nested_str_weak(_lqi), - /* K6 */ be_nested_str_weak(member), - }), - be_str_weak(member), - &be_const_str_solidified, - ( &(const binstruction[41]) { /* code */ - 0x1C080300, // 0000 EQ R2 R1 K0 - 0x780A0008, // 0001 JMPF R2 #000B - 0x88080101, // 0002 GETMBR R2 R0 K1 - 0x540EFFFE, // 0003 LDINT R3 65535 - 0x200C0403, // 0004 NE R3 R2 R3 - 0x780E0001, // 0005 JMPF R3 #0008 - 0x5C0C0400, // 0006 MOVE R3 R2 - 0x70020000, // 0007 JMP #0009 - 0x4C0C0000, // 0008 LDNIL R3 - 0x80040600, // 0009 RET 1 R3 - 0x7002001C, // 000A JMP #0028 - 0x1C080302, // 000B EQ R2 R1 K2 - 0x780A0008, // 000C JMPF R2 #0016 - 0x88080103, // 000D GETMBR R2 R0 K3 - 0x540E00FE, // 000E LDINT R3 255 - 0x200C0403, // 000F NE R3 R2 R3 - 0x780E0001, // 0010 JMPF R3 #0013 - 0x5C0C0400, // 0011 MOVE R3 R2 - 0x70020000, // 0012 JMP #0014 - 0x4C0C0000, // 0013 LDNIL R3 - 0x80040600, // 0014 RET 1 R3 - 0x70020011, // 0015 JMP #0028 - 0x1C080304, // 0016 EQ R2 R1 K4 - 0x780A0008, // 0017 JMPF R2 #0021 - 0x88080105, // 0018 GETMBR R2 R0 K5 - 0x540E00FE, // 0019 LDINT R3 255 - 0x200C0403, // 001A NE R3 R2 R3 - 0x780E0001, // 001B JMPF R3 #001E - 0x5C0C0400, // 001C MOVE R3 R2 - 0x70020000, // 001D JMP #001F - 0x4C0C0000, // 001E LDNIL R3 - 0x80040600, // 001F RET 1 R3 - 0x70020006, // 0020 JMP #0028 - 0x60080003, // 0021 GETGBL R2 G3 - 0x5C0C0000, // 0022 MOVE R3 R0 - 0x7C080200, // 0023 CALL R2 1 - 0x8C080506, // 0024 GETMET R2 R2 K6 - 0x5C100200, // 0025 MOVE R4 R1 - 0x7C080400, // 0026 CALL R2 2 - 0x80040400, // 0027 RET 1 R2 - 0x80000000, // 0028 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: setmember -********************************************************************/ -be_local_closure(zcl_attribute_list_setmember, /* 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[ 7]) { /* constants */ - /* K0 */ be_nested_str_weak(groupaddr), - /* K1 */ be_nested_str_weak(_groupaddr), - /* K2 */ be_nested_str_weak(src_ep), - /* K3 */ be_nested_str_weak(_src_ep), - /* K4 */ be_nested_str_weak(lqi), - /* K5 */ be_nested_str_weak(_lqi), - /* K6 */ be_nested_str_weak(setmember), - }), - be_str_weak(setmember), - &be_const_str_solidified, - ( &(const binstruction[38]) { /* code */ - 0x1C0C0300, // 0000 EQ R3 R1 K0 - 0x780E0007, // 0001 JMPF R3 #000A - 0x4C0C0000, // 0002 LDNIL R3 - 0x200C0403, // 0003 NE R3 R2 R3 - 0x780E0001, // 0004 JMPF R3 #0007 - 0x5C0C0400, // 0005 MOVE R3 R2 - 0x70020000, // 0006 JMP #0008 - 0x540EFFFE, // 0007 LDINT R3 65535 - 0x90020203, // 0008 SETMBR R0 K1 R3 - 0x7002001A, // 0009 JMP #0025 - 0x1C0C0302, // 000A EQ R3 R1 K2 - 0x780E0007, // 000B JMPF R3 #0014 - 0x4C0C0000, // 000C LDNIL R3 - 0x200C0403, // 000D NE R3 R2 R3 - 0x780E0001, // 000E JMPF R3 #0011 - 0x5C0C0400, // 000F MOVE R3 R2 - 0x70020000, // 0010 JMP #0012 - 0x540E00FE, // 0011 LDINT R3 255 - 0x90020603, // 0012 SETMBR R0 K3 R3 - 0x70020010, // 0013 JMP #0025 - 0x1C0C0304, // 0014 EQ R3 R1 K4 - 0x780E0007, // 0015 JMPF R3 #001E - 0x4C0C0000, // 0016 LDNIL R3 - 0x200C0403, // 0017 NE R3 R2 R3 - 0x780E0001, // 0018 JMPF R3 #001B - 0x5C0C0400, // 0019 MOVE R3 R2 - 0x70020000, // 001A JMP #001C - 0x540E00FE, // 001B LDINT R3 255 - 0x90020A03, // 001C SETMBR R0 K5 R3 - 0x70020006, // 001D JMP #0025 - 0x600C0003, // 001E GETGBL R3 G3 - 0x5C100000, // 001F MOVE R4 R0 - 0x7C0C0200, // 0020 CALL R3 1 - 0x8C0C0706, // 0021 GETMET R3 R3 K6 - 0x5C140200, // 0022 MOVE R5 R1 - 0x5C180400, // 0023 MOVE R6 R2 - 0x7C0C0600, // 0024 CALL R3 3 - 0x80000000, // 0025 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(zcl_attribute_list_init, /* 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_weak(init), - /* K1 */ be_nested_str_weak(_init), - }), - be_str_weak(init), - &be_const_str_solidified, - ( &(const binstruction[12]) { /* code */ - 0x60080003, // 0000 GETGBL R2 G3 - 0x5C0C0000, // 0001 MOVE R3 R0 - 0x7C080200, // 0002 CALL R2 1 - 0x8C080500, // 0003 GETMET R2 R2 K0 - 0x5C100200, // 0004 MOVE R4 R1 - 0x7C080400, // 0005 CALL R2 2 - 0x4C080000, // 0006 LDNIL R2 - 0x1C080202, // 0007 EQ R2 R1 R2 - 0x780A0001, // 0008 JMPF R2 #000B - 0x8C080101, // 0009 GETMET R2 R0 K1 - 0x7C080200, // 000A CALL R2 1 - 0x80000000, // 000B RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: deinit -********************************************************************/ -be_local_closure(zcl_attribute_list_deinit, /* 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_weak(ismapped), - /* K1 */ be_nested_str_weak(_deinit), - }), - be_str_weak(deinit), - &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0x8C040100, // 0000 GETMET R1 R0 K0 - 0x7C040200, // 0001 CALL R1 1 - 0x74060001, // 0002 JMPT R1 #0005 - 0x8C040101, // 0003 GETMET R1 R0 K1 - 0x7C040200, // 0004 CALL R1 1 - 0x80000000, // 0005 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: tostring -********************************************************************/ -be_local_closure(zcl_attribute_list_tostring, /* 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[20]) { /* constants */ - /* K0 */ be_nested_str_weak(string), - /* K1 */ be_nested_str_weak(json), - /* K2 */ be_nested_str_weak(shortaddr), - /* K3 */ be_nested_str_weak(push), - /* K4 */ be_nested_str_weak(format), - /* K5 */ be_nested_str_weak(_X22Device_X22_X3A_X220x_X2504X_X22), - /* K6 */ be_nested_str_weak(groupaddr), - /* K7 */ be_nested_str_weak(_X22Group_X22_X3A_X220x_X2504X_X22), - /* K8 */ be_const_int(0), - /* K9 */ be_nested_str_weak(size), - /* K10 */ be_nested_str_weak(tostring), - /* K11 */ be_const_int(1), - /* K12 */ be_nested_str_weak(src_ep), - /* K13 */ be_nested_str_weak(_X22Endpoint_X22_X3A_X25i), - /* K14 */ be_nested_str_weak(lqi), - /* K15 */ be_nested_str_weak(_X22LinkQuality_X22_X3A_X25i), - /* K16 */ be_nested_str_weak(_X7B), - /* K17 */ be_nested_str_weak(concat), - /* K18 */ be_nested_str_weak(_X2C), - /* K19 */ be_nested_str_weak(_X7D), - }), - be_str_weak(tostring), - &be_const_str_solidified, - ( &(const binstruction[62]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0xA40A0200, // 0001 IMPORT R2 K1 - 0x600C0012, // 0002 GETGBL R3 G18 - 0x7C0C0000, // 0003 CALL R3 0 - 0x88100102, // 0004 GETMBR R4 R0 K2 - 0x4C140000, // 0005 LDNIL R5 - 0x20100805, // 0006 NE R4 R4 R5 - 0x78120005, // 0007 JMPF R4 #000E - 0x8C100703, // 0008 GETMET R4 R3 K3 - 0x8C180304, // 0009 GETMET R6 R1 K4 - 0x58200005, // 000A LDCONST R8 K5 - 0x88240102, // 000B GETMBR R9 R0 K2 - 0x7C180600, // 000C CALL R6 3 - 0x7C100400, // 000D CALL R4 2 - 0x88100106, // 000E GETMBR R4 R0 K6 - 0x4C140000, // 000F LDNIL R5 - 0x20100805, // 0010 NE R4 R4 R5 - 0x78120005, // 0011 JMPF R4 #0018 - 0x8C100703, // 0012 GETMET R4 R3 K3 - 0x8C180304, // 0013 GETMET R6 R1 K4 - 0x58200007, // 0014 LDCONST R8 K7 - 0x88240106, // 0015 GETMBR R9 R0 K6 - 0x7C180600, // 0016 CALL R6 3 - 0x7C100400, // 0017 CALL R4 2 - 0x58100008, // 0018 LDCONST R4 K8 - 0x8C140109, // 0019 GETMET R5 R0 K9 - 0x7C140200, // 001A CALL R5 1 - 0x14180805, // 001B LT R6 R4 R5 - 0x781A0006, // 001C JMPF R6 #0024 - 0x8C180703, // 001D GETMET R6 R3 K3 - 0x94200004, // 001E GETIDX R8 R0 R4 - 0x8C20110A, // 001F GETMET R8 R8 K10 - 0x7C200200, // 0020 CALL R8 1 - 0x7C180400, // 0021 CALL R6 2 - 0x0010090B, // 0022 ADD R4 R4 K11 - 0x7001FFF6, // 0023 JMP #001B - 0x8818010C, // 0024 GETMBR R6 R0 K12 - 0x4C1C0000, // 0025 LDNIL R7 - 0x20180C07, // 0026 NE R6 R6 R7 - 0x781A0005, // 0027 JMPF R6 #002E - 0x8C180703, // 0028 GETMET R6 R3 K3 - 0x8C200304, // 0029 GETMET R8 R1 K4 - 0x5828000D, // 002A LDCONST R10 K13 - 0x882C010C, // 002B GETMBR R11 R0 K12 - 0x7C200600, // 002C CALL R8 3 - 0x7C180400, // 002D CALL R6 2 - 0x8818010E, // 002E GETMBR R6 R0 K14 - 0x4C1C0000, // 002F LDNIL R7 - 0x20180C07, // 0030 NE R6 R6 R7 - 0x781A0005, // 0031 JMPF R6 #0038 - 0x8C180703, // 0032 GETMET R6 R3 K3 - 0x8C200304, // 0033 GETMET R8 R1 K4 - 0x5828000F, // 0034 LDCONST R10 K15 - 0x882C010E, // 0035 GETMBR R11 R0 K14 - 0x7C200600, // 0036 CALL R8 3 - 0x7C180400, // 0037 CALL R6 2 - 0x8C180711, // 0038 GETMET R6 R3 K17 - 0x58200012, // 0039 LDCONST R8 K18 - 0x7C180400, // 003A CALL R6 2 - 0x001A2006, // 003B ADD R6 K16 R6 - 0x00180D13, // 003C ADD R6 R6 K19 - 0x80040C00, // 003D RET 1 R6 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: zcl_attribute_list -********************************************************************/ -extern const bclass be_class_zcl_attribute_list_ntv; -be_local_class(zcl_attribute_list, - 1, - &be_class_zcl_attribute_list_ntv, - be_nested_map(6, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(shortaddr, -1), be_const_var(0) }, - { be_const_key_weak(member, 2), be_const_closure(zcl_attribute_list_member_closure) }, - { be_const_key_weak(tostring, 5), be_const_closure(zcl_attribute_list_tostring_closure) }, - { be_const_key_weak(init, -1), be_const_closure(zcl_attribute_list_init_closure) }, - { be_const_key_weak(deinit, -1), be_const_closure(zcl_attribute_list_deinit_closure) }, - { be_const_key_weak(setmember, -1), be_const_closure(zcl_attribute_list_setmember_closure) }, - })), - be_str_weak(zcl_attribute_list) -); -/*******************************************************************/ - -void be_load_zcl_attribute_list_class(bvm *vm) { - be_pushntvclass(vm, &be_class_zcl_attribute_list); - be_setglobal(vm, "zcl_attribute_list"); - be_pop(vm, 1); -} - -#endif // USE_LIGHT +#endif // USE_ZIGBEE diff --git a/lib/libesp32/berry_tasmota/src/be_zigbee_zcl_frame.c b/lib/libesp32/berry_tasmota/src/be_zigbee_zcl_frame.c index 4d3002433..37a5629fa 100644 --- a/lib/libesp32/berry_tasmota/src/be_zigbee_zcl_frame.c +++ b/lib/libesp32/berry_tasmota/src/be_zigbee_zcl_frame.c @@ -4,236 +4,6 @@ *******************************************************************/ #ifdef USE_ZIGBEE -#include "be_constobj.h" +#include "solidify/solidified_zigbee_zcl_frame.h" -extern const bclass be_class_zcl_frame_ntv; - - -/******************************************************************** -** Solidified function: member -********************************************************************/ -be_local_closure(zcl_frame_member, /* 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[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(payload), - /* K1 */ be_nested_str_weak(_get_bytes), - /* K2 */ be_nested_str_weak(payload_ptr), - /* K3 */ be_nested_str_weak(member), - }), - be_str_weak(member), - &be_const_str_solidified, - ( &(const binstruction[15]) { /* code */ - 0x1C080300, // 0000 EQ R2 R1 K0 - 0x780A0004, // 0001 JMPF R2 #0007 - 0x8C080101, // 0002 GETMET R2 R0 K1 - 0x88100102, // 0003 GETMBR R4 R0 K2 - 0x7C080400, // 0004 CALL R2 2 - 0x80040400, // 0005 RET 1 R2 - 0x70020006, // 0006 JMP #000E - 0x60080003, // 0007 GETGBL R2 G3 - 0x5C0C0000, // 0008 MOVE R3 R0 - 0x7C080200, // 0009 CALL R2 1 - 0x8C080503, // 000A GETMET R2 R2 K3 - 0x5C100200, // 000B MOVE R4 R1 - 0x7C080400, // 000C CALL R2 2 - 0x80040400, // 000D RET 1 R2 - 0x80000000, // 000E RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: setmember -********************************************************************/ -be_local_closure(zcl_frame_setmember, /* 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[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(payload), - /* K1 */ be_nested_str_weak(_set_bytes), - /* K2 */ be_nested_str_weak(payload_ptr), - /* K3 */ be_nested_str_weak(setmember), - }), - be_str_weak(setmember), - &be_const_str_solidified, - ( &(const binstruction[17]) { /* code */ - 0x1C0C0300, // 0000 EQ R3 R1 K0 - 0x780E0005, // 0001 JMPF R3 #0008 - 0x8C0C0101, // 0002 GETMET R3 R0 K1 - 0x88140102, // 0003 GETMBR R5 R0 K2 - 0x5C180400, // 0004 MOVE R6 R2 - 0x7C0C0600, // 0005 CALL R3 3 - 0x80040600, // 0006 RET 1 R3 - 0x70020007, // 0007 JMP #0010 - 0x600C0003, // 0008 GETGBL R3 G3 - 0x5C100000, // 0009 MOVE R4 R0 - 0x7C0C0200, // 000A CALL R3 1 - 0x8C0C0703, // 000B GETMET R3 R3 K3 - 0x5C140200, // 000C MOVE R5 R1 - 0x5C180400, // 000D MOVE R6 R2 - 0x7C0C0600, // 000E CALL R3 3 - 0x80040600, // 000F RET 1 R3 - 0x80000000, // 0010 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(zcl_frame_init, /* 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_weak(init), - /* K1 */ be_nested_str_weak(no_bytes), - }), - be_str_weak(init), - &be_const_str_solidified, - ( &(const binstruction[10]) { /* code */ - 0x60080003, // 0000 GETGBL R2 G3 - 0x5C0C0000, // 0001 MOVE R3 R0 - 0x7C080200, // 0002 CALL R2 1 - 0x8C080500, // 0003 GETMET R2 R2 K0 - 0x5C100200, // 0004 MOVE R4 R1 - 0x7C080400, // 0005 CALL R2 2 - 0x60080015, // 0006 GETGBL R2 G21 - 0x7C080000, // 0007 CALL R2 0 - 0x90020202, // 0008 SETMBR R0 K1 R2 - 0x80000000, // 0009 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: tomap -********************************************************************/ -be_local_closure(zcl_frame_tomap, /* 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[ 7]) { /* constants */ - /* K0 */ be_nested_str_weak(string), - /* K1 */ be_nested_str_weak(tomap), - /* K2 */ be_nested_str_weak(shortaddr_hex), - /* K3 */ be_nested_str_weak(format), - /* K4 */ be_nested_str_weak(0x_X2504X), - /* K5 */ be_nested_str_weak(shortaddr), - /* K6 */ be_nested_str_weak(payload), - }), - be_str_weak(tomap), - &be_const_str_solidified, - ( &(const binstruction[14]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x60080003, // 0001 GETGBL R2 G3 - 0x5C0C0000, // 0002 MOVE R3 R0 - 0x7C080200, // 0003 CALL R2 1 - 0x8C080501, // 0004 GETMET R2 R2 K1 - 0x7C080200, // 0005 CALL R2 1 - 0x8C0C0303, // 0006 GETMET R3 R1 K3 - 0x58140004, // 0007 LDCONST R5 K4 - 0x88180105, // 0008 GETMBR R6 R0 K5 - 0x7C0C0600, // 0009 CALL R3 3 - 0x980A0403, // 000A SETIDX R2 K2 R3 - 0x880C0106, // 000B GETMBR R3 R0 K6 - 0x980A0C03, // 000C SETIDX R2 K6 R3 - 0x80040400, // 000D RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: tostring -********************************************************************/ -be_local_closure(zcl_frame_tostring, /* 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_weak(tomap), - }), - be_str_weak(tostring), - &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0x8C040100, // 0000 GETMET R1 R0 K0 - 0x7C040200, // 0001 CALL R1 1 - 0x60080008, // 0002 GETGBL R2 G8 - 0x5C0C0200, // 0003 MOVE R3 R1 - 0x7C080200, // 0004 CALL R2 1 - 0x80040400, // 0005 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: zcl_frame -********************************************************************/ -extern const bclass be_class_zcl_frame_ntv; -be_local_class(zcl_frame, - 1, - &be_class_zcl_frame_ntv, - be_nested_map(6, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(no_bytes, -1), be_const_var(0) }, - { be_const_key_weak(member, 2), be_const_closure(zcl_frame_member_closure) }, - { be_const_key_weak(tostring, 5), be_const_closure(zcl_frame_tostring_closure) }, - { be_const_key_weak(init, -1), be_const_closure(zcl_frame_init_closure) }, - { be_const_key_weak(tomap, -1), be_const_closure(zcl_frame_tomap_closure) }, - { be_const_key_weak(setmember, -1), be_const_closure(zcl_frame_setmember_closure) }, - })), - be_str_weak(zcl_frame) -); -/*******************************************************************/ - -void be_load_zcl_frame_class(bvm *vm) { - be_pushntvclass(vm, &be_class_zcl_frame); - be_setglobal(vm, "zcl_frame"); - be_pop(vm, 1); -} - - -#endif // USE_LIGHT +#endif // USE_ZIGBEE diff --git a/lib/libesp32/berry_tasmota/src/embedded/Wire.be b/lib/libesp32/berry_tasmota/src/embedded/Wire.be index 38812f9c0..ece8fc3ce 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/Wire.be +++ b/lib/libesp32/berry_tasmota/src/embedded/Wire.be @@ -1,6 +1,8 @@ #- Native code used for testing and code solidification -# #- Do not use it -# +#@ solidify:Wire.read_bytes +#@ solidify:Wire.write_bytes class Wire var bus diff --git a/lib/libesp32/berry_tasmota/src/embedded/energy.be b/lib/libesp32/berry_tasmota/src/embedded/energy.be new file mode 100644 index 000000000..8f1a93006 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/embedded/energy.be @@ -0,0 +1,33 @@ + +_energy = nil # avoid compilation error +energy_struct = nil + +energy = module("energy") +energy._ptr = nil + +def init(m) + import global + global._energy = energy_struct(m._ptr) + return m +end +energy.init = init + +def read() + return _energy.tomap() +end +energy.read = read + +def member(k) + return _energy.(k) +end +energy.member = member + +def setmember(k, v) + _energy.(k) = v +end +energy.setmember = setmember + +#@ solidify:energy.init +#@ solidify:energy.read +#@ solidify:energy.member +#@ solidify:energy.setmember diff --git a/lib/libesp32/berry_tasmota/src/embedded/i2c_axp192.be b/lib/libesp32/berry_tasmota/src/embedded/i2c_axp192.be index 74f70c2bc..ccf0ea770 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/i2c_axp192.be +++ b/lib/libesp32/berry_tasmota/src/embedded/i2c_axp192.be @@ -1,6 +1,8 @@ #------------------------------------------------------------- - Generic driver for AXP192 - solidified -------------------------------------------------------------# + + #@ solidify:AXP192 class AXP192 : I2C_Driver def init() super(self, I2C_Driver).init("AXP192", 0x34) diff --git a/lib/libesp32/berry_tasmota/src/embedded/i2c_axp202.be b/lib/libesp32/berry_tasmota/src/embedded/i2c_axp202.be index 8cad069f8..f2176dfd3 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/i2c_axp202.be +++ b/lib/libesp32/berry_tasmota/src/embedded/i2c_axp202.be @@ -1,7 +1,8 @@ #------------------------------------------------------------- - Generic driver for AXP202 - solidified -------------------------------------------------------------# -class AXP202 : I2C_Driver + #@ solidify:AXP202 + class AXP202 : I2C_Driver def init() super(self, I2C_Driver).init("AXP202", 0x35) end diff --git a/lib/libesp32/berry_tasmota/src/embedded/i2c_ft3663.be b/lib/libesp32/berry_tasmota/src/embedded/i2c_ft3663.be index e29fe5108..41d1666f5 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/i2c_ft3663.be +++ b/lib/libesp32/berry_tasmota/src/embedded/i2c_ft3663.be @@ -1,6 +1,9 @@ #------------------------------------------------------------- - Driver for FT3663 - Capacitive Touch Screen -------------------------------------------------------------# +class I2C_Driver end # for solidification + + #@ solidify:FT3663 class FT3663 : I2C_Driver static gest_id_codes = { 0x00: 0x00, @@ -90,4 +93,4 @@ class FT3663 : I2C_Driver end -ts = FT3663() +#ts = FT3663() diff --git a/lib/libesp32/berry_tasmota/src/embedded/leds_animator.be b/lib/libesp32/berry_tasmota/src/embedded/leds_animator.be index 1ed25b491..16573828b 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/leds_animator.be +++ b/lib/libesp32/berry_tasmota/src/embedded/leds_animator.be @@ -1,5 +1,6 @@ # class Leds_animator +#@ solidify:Leds_animator,weak class Leds_animator var strip # neopixelbus object var pixel_count # number of pixels in the strip diff --git a/lib/libesp32/berry_tasmota/src/embedded/lv_tasmota.be b/lib/libesp32/berry_tasmota/src/embedded/lv_tasmota.be index d0e90855c..fb4c9c42d 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/lv_tasmota.be +++ b/lib/libesp32/berry_tasmota/src/embedded/lv_tasmota.be @@ -3,6 +3,7 @@ #- ------------------------------------------------------------ -# lv_tasmota = module("lv_tasmota") +#@ solidify:lv_tasmota # rename `lv` to `lv_ntv` and replace `lv` with `lv_tasmota` def init(lv_tasmota) import lv diff --git a/lib/libesp32/berry_tasmota/src/embedded/lv_tasmota_widgets.be b/lib/libesp32/berry_tasmota/src/embedded/lv_tasmota_widgets.be index 8aeeac680..8b45423e7 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/lv_tasmota_widgets.be +++ b/lib/libesp32/berry_tasmota/src/embedded/lv_tasmota_widgets.be @@ -19,7 +19,10 @@ solidify.dump(lv_wifi_bars_icon, true) -# -class lv_clock: lv.label +class lv_label end # for solidification + +#@ solidify:lv_clock +class lv_clock: lv_label var hour, minute, sec def init(parent) @@ -57,6 +60,7 @@ class lv_clock: lv.label end end +#@ solidify:lv_clock_icon class lv_clock_icon: lv_clock def init(parent) @@ -80,8 +84,10 @@ class lv_clock_icon: lv_clock end # ########################################################################################## +class lv_obj end # for solidification -class lv_signal_arcs : lv.obj +#@ solidify:lv_signal_arcs +class lv_signal_arcs : lv_obj var percentage # value to display, range 0..100 var p1, p2, area, arc_dsc # instances of objects kept to avoid re-instanciating at each call @@ -169,6 +175,7 @@ class lv_signal_arcs : lv.obj end end +#@ solidify:lv_wifi_arcs class lv_wifi_arcs: lv_signal_arcs def init(parent) super(self).init(parent) @@ -192,6 +199,7 @@ class lv_wifi_arcs: lv_signal_arcs end end +#@ solidify:lv_wifi_arcs_icon class lv_wifi_arcs_icon: lv_wifi_arcs def init(parent) super(self).init(parent) @@ -211,7 +219,8 @@ end # ########################################################################################## -class lv_signal_bars : lv.obj +#@ solidify:lv_signal_bars +class lv_signal_bars : lv_obj var percentage # value to display, range 0..100 var p1, p2, area, line_dsc # instances of objects kept to avoid re-instanciating at each call @@ -286,6 +295,7 @@ class lv_signal_bars : lv.obj end end +#@ solidify:lv_wifi_bars class lv_wifi_bars: lv_signal_bars def init(parent) super(self).init(parent) @@ -309,6 +319,7 @@ class lv_wifi_bars: lv_signal_bars end end +#@ solidify:lv_wifi_bars_icon class lv_wifi_bars_icon: lv_wifi_bars def init(parent) super(self).init(parent) diff --git a/lib/libesp32/berry_tasmota/src/embedded/mqtt.be b/lib/libesp32/berry_tasmota/src/embedded/mqtt.be index d0a3f146d..07d42e86f 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/mqtt.be +++ b/lib/libesp32/berry_tasmota/src/embedded/mqtt.be @@ -17,7 +17,7 @@ print("Ok") class MQTT_ntv end # for solidification only - +#@ solidify:MQTT class MQTT : MQTT_ntv var topics diff --git a/lib/libesp32/berry_tasmota/src/embedded/python_compat.be b/lib/libesp32/berry_tasmota/src/embedded/python_compat.be new file mode 100644 index 000000000..b3801d240 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/embedded/python_compat.be @@ -0,0 +1,13 @@ +# Python compatibility + +python_compat = module('python_compat') + +#@ solidify:python_compat +python_compat.init = def (m) + import global + global.True = true + global.False = false + global.None = nil + global.b = bytes + return m +end diff --git a/lib/libesp32/berry_tasmota/src/embedded/tapp.be b/lib/libesp32/berry_tasmota/src/embedded/tapp.be index d1638bb64..a107f50f6 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/tapp.be +++ b/lib/libesp32/berry_tasmota/src/embedded/tapp.be @@ -3,6 +3,7 @@ var tapp_module = module("tapp") +#@ solidify:tapp_module tapp_module.init = def (m) class Tapp diff --git a/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be b/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be index fa99a2ea4..fac27bc92 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be +++ b/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be @@ -1,35 +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 - def init(trig, f, id, o) - self.trig = trig - self.f = f - self.id = id - self.o = o - end - def tostring() - import string - return string.format(" 0 - return self.o.time_reached(self.trig) - end - return false - end -end +class Trigger end # for compilation tasmota = nil #@ solidify:Tasmota diff --git a/lib/libesp32/berry_tasmota/src/embedded/test_crypto.be b/lib/libesp32/berry_tasmota/src/embedded/test_crypto.be index f2edbfee5..a420df4bb 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/test_crypto.be +++ b/lib/libesp32/berry_tasmota/src/embedded/test_crypto.be @@ -1,3 +1,4 @@ +#- ec = crypto.EC_C25519() # Alice @@ -14,6 +15,7 @@ psk = ec.shared_key(sk_A, pk_B) assert(psk == bytes('4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742')) psk2 = ec.shared_key(sk_B, pk_A) assert(psk2 == bytes('4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742')) +-# #- test vectors from RFC77748 diff --git a/lib/libesp32/berry_tasmota/src/embedded/trigger_class.be b/lib/libesp32/berry_tasmota/src/embedded/trigger_class.be new file mode 100644 index 000000000..419a8178c --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/embedded/trigger_class.be @@ -0,0 +1,32 @@ +#- Native code used for testing and code solidification -# +#- Do not use it -# + +#@ solidify:Trigger +class Trigger + var trig, f, id + var o # optional object + def init(trig, f, id, o) + self.trig = trig + self.f = f + self.id = id + self.o = o + end + def tostring() + import string + return string.format(" 0 + return self.o.time_reached(self.trig) + end + return false + end +end diff --git a/lib/libesp32/berry_tasmota/src/embedded/zigbee.be b/lib/libesp32/berry_tasmota/src/embedded/zigbee.be index 39d4eb227..caf130e3f 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/zigbee.be +++ b/lib/libesp32/berry_tasmota/src/embedded/zigbee.be @@ -1,5 +1,6 @@ # zigbee code +#@ solidify:zb_device.tostring,weak class zb_device def tostring() diff --git a/lib/libesp32/berry_tasmota/src/embedded/zigbee_zb_coord.be b/lib/libesp32/berry_tasmota/src/embedded/zigbee_zb_coord.be index 3bde73d45..aab49d271 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/zigbee_zb_coord.be +++ b/lib/libesp32/berry_tasmota/src/embedded/zigbee_zb_coord.be @@ -4,6 +4,7 @@ class zb_coord_ntv end # fake class replaced with native one #zb_coord_ntv = classof(super(zigbee)) +#@ solidify:zb_coord,weak class zb_coord : zb_coord_ntv var _handlers diff --git a/lib/libesp32/berry_tasmota/src/embedded/zigbee_zcl_attribute.be b/lib/libesp32/berry_tasmota/src/embedded/zigbee_zcl_attribute.be index 700b5c252..16325d176 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/zigbee_zcl_attribute.be +++ b/lib/libesp32/berry_tasmota/src/embedded/zigbee_zcl_attribute.be @@ -6,6 +6,7 @@ class zcl_attribute_ntv end class zcl_attribute_list_ntv end +#@ solidify:zcl_attribute,weak class zcl_attribute : zcl_attribute_ntv def init(ptr) @@ -149,6 +150,7 @@ class zcl_attribute : zcl_attribute_ntv end +#@ solidify:zcl_attribute_list,weak class zcl_attribute_list : zcl_attribute_list_ntv var shortaddr # in the bytes object we have: @@ -238,6 +240,7 @@ class zcl_attribute_list : zcl_attribute_list_ntv end end +#@ solidify:zcl_attributes,weak class zcl_attributes var shortaddr var groupaddr diff --git a/lib/libesp32/berry_tasmota/src/embedded/zigbee_zcl_frame.be b/lib/libesp32/berry_tasmota/src/embedded/zigbee_zcl_frame.be index 73b4b2a30..044ed43f8 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/zigbee_zcl_frame.be +++ b/lib/libesp32/berry_tasmota/src/embedded/zigbee_zcl_frame.be @@ -4,6 +4,7 @@ class zcl_frame_ntv end +#@ solidify:zcl_frame,weak class zcl_frame : zcl_frame_ntv var no_bytes diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_Wire.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_Wire.h new file mode 100644 index 000000000..4c5579d85 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_Wire.h @@ -0,0 +1,100 @@ +/* Solidification of Wire.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: read_bytes +********************************************************************/ +be_local_closure(Wire_read_bytes, /* name */ + be_nested_proto( + 8, /* 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(_begin_transmission), + /* K1 */ be_nested_str(_write), + /* K2 */ be_nested_str(_end_transmission), + /* K3 */ be_nested_str(_request_from), + /* K4 */ be_nested_str(_available), + /* K5 */ be_nested_str(_read), + }), + &be_const_str_read_bytes, + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0x8C100100, // 0000 GETMET R4 R0 K0 + 0x5C180200, // 0001 MOVE R6 R1 + 0x7C100400, // 0002 CALL R4 2 + 0x8C100101, // 0003 GETMET R4 R0 K1 + 0x5C180400, // 0004 MOVE R6 R2 + 0x7C100400, // 0005 CALL R4 2 + 0x8C100102, // 0006 GETMET R4 R0 K2 + 0x50180000, // 0007 LDBOOL R6 0 0 + 0x7C100400, // 0008 CALL R4 2 + 0x8C100103, // 0009 GETMET R4 R0 K3 + 0x5C180200, // 000A MOVE R6 R1 + 0x5C1C0600, // 000B MOVE R7 R3 + 0x7C100600, // 000C CALL R4 3 + 0x60100015, // 000D GETGBL R4 G21 + 0x5C140600, // 000E MOVE R5 R3 + 0x7C100200, // 000F CALL R4 1 + 0x8C140104, // 0010 GETMET R5 R0 K4 + 0x7C140200, // 0011 CALL R5 1 + 0x78160003, // 0012 JMPF R5 #0017 + 0x8C140105, // 0013 GETMET R5 R0 K5 + 0x7C140200, // 0014 CALL R5 1 + 0x40140805, // 0015 CONNECT R5 R4 R5 + 0x7001FFF8, // 0016 JMP #0010 + 0x80040800, // 0017 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: write_bytes +********************************************************************/ +be_local_closure(Wire_write_bytes, /* name */ + be_nested_proto( + 7, /* 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(_begin_transmission), + /* K1 */ be_nested_str(_write), + /* K2 */ be_nested_str(_end_transmission), + }), + &be_const_str_write_bytes, + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x8C100100, // 0000 GETMET R4 R0 K0 + 0x5C180200, // 0001 MOVE R6 R1 + 0x7C100400, // 0002 CALL R4 2 + 0x8C100101, // 0003 GETMET R4 R0 K1 + 0x5C180400, // 0004 MOVE R6 R2 + 0x7C100400, // 0005 CALL R4 2 + 0x8C100101, // 0006 GETMET R4 R0 K1 + 0x5C180600, // 0007 MOVE R6 R3 + 0x7C100400, // 0008 CALL R4 2 + 0x8C100102, // 0009 GETMET R4 R0 K2 + 0x7C100200, // 000A CALL R4 1 + 0x80000000, // 000B RET 0 + }) + ) +); +/*******************************************************************/ + +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_energy.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_energy.h new file mode 100644 index 000000000..8478bf730 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_energy.h @@ -0,0 +1,127 @@ +/* Solidification of energy.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(energy_init, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(global), + /* K1 */ be_nested_str(_energy), + /* K2 */ be_nested_str(energy_struct), + /* K3 */ be_nested_str(_ptr), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xB80A0400, // 0001 GETNGBL R2 K2 + 0x880C0103, // 0002 GETMBR R3 R0 K3 + 0x7C080200, // 0003 CALL R2 1 + 0x90060202, // 0004 SETMBR R1 K1 R2 + 0x80040000, // 0005 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read +********************************************************************/ +be_local_closure(energy_read, /* name */ + be_nested_proto( + 2, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(_energy), + /* K1 */ be_nested_str(tomap), + }), + &be_const_str_read, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0xB8020000, // 0000 GETNGBL R0 K0 + 0x8C000101, // 0001 GETMET R0 R0 K1 + 0x7C000200, // 0002 CALL R0 1 + 0x80040000, // 0003 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: member +********************************************************************/ +be_local_closure(energy_member, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(_energy), + }), + &be_const_str_member, + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x88040200, // 0001 GETMBR R1 R1 R0 + 0x80040200, // 0002 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: setmember +********************************************************************/ +be_local_closure(energy_setmember, /* name */ + be_nested_proto( + 3, /* nstack */ + 2, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(_energy), + }), + &be_const_str_setmember, + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x90080001, // 0001 SETMBR R2 R0 R1 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/be_i2c_axp192_lib.c b/lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_axp192.h similarity index 99% rename from lib/libesp32/berry_tasmota/src/be_i2c_axp192_lib.c rename to lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_axp192.h index a6888bef5..095930baf 100644 --- a/lib/libesp32/berry_tasmota/src/be_i2c_axp192_lib.c +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_axp192.h @@ -1,6 +1,7 @@ -/******************************************************************** - * Tasmota LVGL lv_signal_bars widget - *******************************************************************/ +/* Solidification of i2c_axp192.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ #include "be_constobj.h" /******************************************************************** @@ -69,7 +70,7 @@ be_local_closure(AXP192_get_bat_power, /* name */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ /* K0 */ be_nested_str(read24), - /* K1 */ be_const_real_hex(0x3A102DE1), + /* K1 */ be_const_real_hex(0x3A102DE0), }), &be_const_str_get_bat_power, &be_const_str_solidified, @@ -980,7 +981,7 @@ be_local_class(AXP192, { be_const_key(json_append, -1), be_const_closure(AXP192_json_append_closure) }, { be_const_key(get_input_power_status, -1), be_const_closure(AXP192_get_input_power_status_closure) }, })), - be_str_weak(AXP192) + (bstring*) &be_const_str_AXP192 ); /*******************************************************************/ @@ -989,3 +990,5 @@ void be_load_AXP192_class(bvm *vm) { be_setglobal(vm, "AXP192"); be_pop(vm, 1); } +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_axp202.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_axp202.h new file mode 100644 index 000000000..1ec7a268b --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_axp202.h @@ -0,0 +1,911 @@ +/* Solidification of i2c_axp202.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: set_shutdown_time +********************************************************************/ +be_local_closure(AXP202_set_shutdown_time, /* name */ + be_nested_proto( + 9, /* 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_const_int(0), + /* K1 */ be_const_int(1), + /* K2 */ be_const_int(2), + /* K3 */ be_const_int(3), + /* K4 */ be_nested_str(write8), + /* K5 */ be_nested_str(read8), + }), + &be_const_str_set_shutdown_time, + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0x58080000, // 0000 LDCONST R2 K0 + 0x540E0005, // 0001 LDINT R3 6 + 0x1C0C0203, // 0002 EQ R3 R1 R3 + 0x780E0000, // 0003 JMPF R3 #0005 + 0x58080001, // 0004 LDCONST R2 K1 + 0x540E0007, // 0005 LDINT R3 8 + 0x1C0C0203, // 0006 EQ R3 R1 R3 + 0x780E0000, // 0007 JMPF R3 #0009 + 0x58080002, // 0008 LDCONST R2 K2 + 0x540E0009, // 0009 LDINT R3 10 + 0x1C0C0203, // 000A EQ R3 R1 R3 + 0x780E0000, // 000B JMPF R3 #000D + 0x58080003, // 000C LDCONST R2 K3 + 0x8C0C0104, // 000D GETMET R3 R0 K4 + 0x54160035, // 000E LDINT R5 54 + 0x8C180105, // 000F GETMET R6 R0 K5 + 0x54220035, // 0010 LDINT R8 54 + 0x7C180400, // 0011 CALL R6 2 + 0x541E00FB, // 0012 LDINT R7 252 + 0x2C180C07, // 0013 AND R6 R6 R7 + 0x2C1C0503, // 0014 AND R7 R2 K3 + 0x30180C07, // 0015 OR R6 R6 R7 + 0x7C0C0600, // 0016 CALL R3 3 + 0x80000000, // 0017 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_vbus_current +********************************************************************/ +be_local_closure(AXP202_get_vbus_current, /* 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(read12), + /* K1 */ be_const_real_hex(0x3EC00000), + }), + &be_const_str_get_vbus_current, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E005B, // 0001 LDINT R3 92 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_bat_voltage +********************************************************************/ +be_local_closure(AXP202_get_bat_voltage, /* 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(read12), + /* K1 */ be_const_real_hex(0x3A902DE0), + }), + &be_const_str_get_bat_voltage, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0077, // 0001 LDINT R3 120 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_bat_current +********************************************************************/ +be_local_closure(AXP202_get_bat_current, /* 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[ 2]) { /* constants */ + /* K0 */ be_nested_str(read13), + /* K1 */ be_const_real_hex(0x3F000000), + }), + &be_const_str_get_bat_current, + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0079, // 0001 LDINT R3 122 + 0x7C040400, // 0002 CALL R1 2 + 0x8C080100, // 0003 GETMET R2 R0 K0 + 0x5412007B, // 0004 LDINT R4 124 + 0x7C080400, // 0005 CALL R2 2 + 0x04040202, // 0006 SUB R1 R1 R2 + 0x08040301, // 0007 MUL R1 R1 K1 + 0x80040200, // 0008 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_bat_power +********************************************************************/ +be_local_closure(AXP202_get_bat_power, /* 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(read24), + /* K1 */ be_const_real_hex(0x3A102DE0), + }), + &be_const_str_get_bat_power, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E006F, // 0001 LDINT R3 112 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_aps_voltage +********************************************************************/ +be_local_closure(AXP202_get_aps_voltage, /* 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(read12), + /* K1 */ be_const_real_hex(0x3AB78035), + }), + &be_const_str_get_aps_voltage, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E007D, // 0001 LDINT R3 126 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_vbus_voltage +********************************************************************/ +be_local_closure(AXP202_get_vbus_voltage, /* 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(read12), + /* K1 */ be_const_real_hex(0x3ADED28A), + }), + &be_const_str_get_vbus_voltage, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0059, // 0001 LDINT R3 90 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_ldo_enable +********************************************************************/ +be_local_closure(AXP202_set_ldo_enable, /* 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_const_int(2), + /* K1 */ be_nested_str(write_bit), + /* K2 */ be_const_int(3), + }), + &be_const_str_set_ldo_enable, + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0x1C0C0300, // 0000 EQ R3 R1 K0 + 0x780E0004, // 0001 JMPF R3 #0007 + 0x8C0C0101, // 0002 GETMET R3 R0 K1 + 0x54160011, // 0003 LDINT R5 18 + 0x58180000, // 0004 LDCONST R6 K0 + 0x5C1C0400, // 0005 MOVE R7 R2 + 0x7C0C0800, // 0006 CALL R3 4 + 0x1C0C0302, // 0007 EQ R3 R1 K2 + 0x780E0004, // 0008 JMPF R3 #000E + 0x8C0C0101, // 0009 GETMET R3 R0 K1 + 0x54160011, // 000A LDINT R5 18 + 0x541A0005, // 000B LDINT R6 6 + 0x5C1C0400, // 000C MOVE R7 R2 + 0x7C0C0800, // 000D CALL R3 4 + 0x540E0003, // 000E LDINT R3 4 + 0x1C0C0203, // 000F EQ R3 R1 R3 + 0x780E0004, // 0010 JMPF R3 #0016 + 0x8C0C0101, // 0011 GETMET R3 R0 K1 + 0x54160011, // 0012 LDINT R5 18 + 0x58180002, // 0013 LDCONST R6 K2 + 0x5C1C0400, // 0014 MOVE R7 R2 + 0x7C0C0800, // 0015 CALL R3 4 + 0x80000000, // 0016 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: battery_present +********************************************************************/ +be_local_closure(AXP202_battery_present, /* name */ + be_nested_proto( + 6, /* 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(wire), + /* K1 */ be_nested_str(read), + /* K2 */ be_nested_str(addr), + /* K3 */ be_const_int(1), + }), + &be_const_str_battery_present, + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x58100003, // 0003 LDCONST R4 K3 + 0x58140003, // 0004 LDCONST R5 K3 + 0x7C040800, // 0005 CALL R1 4 + 0x540A001F, // 0006 LDINT R2 32 + 0x2C040202, // 0007 AND R1 R1 R2 + 0x78060002, // 0008 JMPF R1 #000C + 0x50040200, // 0009 LDBOOL R1 1 0 + 0x80040200, // 000A RET 1 R1 + 0x70020001, // 000B JMP #000E + 0x50040000, // 000C LDBOOL R1 0 0 + 0x80040200, // 000D RET 1 R1 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_chg_current_ma +********************************************************************/ +be_local_closure(AXP202_set_chg_current_ma, /* name */ + be_nested_proto( + 9, /* 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(write8), + /* K1 */ be_nested_str(read8), + }), + &be_const_str_set_chg_current_ma, + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x540A012B, // 0000 LDINT R2 300 + 0x04080202, // 0001 SUB R2 R1 R2 + 0x540E0063, // 0002 LDINT R3 100 + 0x0C080403, // 0003 DIV R2 R2 R3 + 0x8C0C0100, // 0004 GETMET R3 R0 K0 + 0x54160032, // 0005 LDINT R5 51 + 0x8C180101, // 0006 GETMET R6 R0 K1 + 0x54220032, // 0007 LDINT R8 51 + 0x7C180400, // 0008 CALL R6 2 + 0x541E00EF, // 0009 LDINT R7 240 + 0x2C180C07, // 000A AND R6 R6 R7 + 0x541E000E, // 000B LDINT R7 15 + 0x2C1C0407, // 000C AND R7 R2 R7 + 0x30180C07, // 000D OR R6 R6 R7 + 0x7C0C0600, // 000E CALL R3 3 + 0x80000000, // 000F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_dcdc_enable +********************************************************************/ +be_local_closure(AXP202_set_dcdc_enable, /* 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[ 4]) { /* constants */ + /* K0 */ be_const_int(2), + /* K1 */ be_nested_str(write_bit), + /* K2 */ be_const_int(3), + /* K3 */ be_const_int(1), + }), + &be_const_str_set_dcdc_enable, + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x1C0C0300, // 0000 EQ R3 R1 K0 + 0x780E0004, // 0001 JMPF R3 #0007 + 0x8C0C0101, // 0002 GETMET R3 R0 K1 + 0x54160011, // 0003 LDINT R5 18 + 0x541A0003, // 0004 LDINT R6 4 + 0x5C1C0400, // 0005 MOVE R7 R2 + 0x7C0C0800, // 0006 CALL R3 4 + 0x1C0C0302, // 0007 EQ R3 R1 K2 + 0x780E0004, // 0008 JMPF R3 #000E + 0x8C0C0101, // 0009 GETMET R3 R0 K1 + 0x54160011, // 000A LDINT R5 18 + 0x58180003, // 000B LDCONST R6 K3 + 0x5C1C0400, // 000C MOVE R7 R2 + 0x7C0C0800, // 000D CALL R3 4 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_chg_led_mode +********************************************************************/ +be_local_closure(AXP202_set_chg_led_mode, /* 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[ 3]) { /* constants */ + /* K0 */ be_nested_str(read8), + /* K1 */ be_const_int(3), + /* K2 */ be_nested_str(write8), + }), + &be_const_str_set_chg_led_mode, + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 + 0x54120031, // 0001 LDINT R4 50 + 0x7C080400, // 0002 CALL R2 2 + 0x540E00CE, // 0003 LDINT R3 207 + 0x2C0C0403, // 0004 AND R3 R2 R3 + 0x54120007, // 0005 LDINT R4 8 + 0x300C0604, // 0006 OR R3 R3 R4 + 0x5C080600, // 0007 MOVE R2 R3 + 0x2C0C0301, // 0008 AND R3 R1 K1 + 0x54120003, // 0009 LDINT R4 4 + 0x380C0604, // 000A SHL R3 R3 R4 + 0x30080403, // 000B OR R2 R2 R3 + 0x8C0C0102, // 000C GETMET R3 R0 K2 + 0x54160031, // 000D LDINT R5 50 + 0x5C180400, // 000E MOVE R6 R2 + 0x7C0C0600, // 000F CALL R3 3 + 0x80000000, // 0010 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(AXP202_init, /* 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(I2C_Driver), + /* K1 */ be_nested_str(init), + /* K2 */ be_nested_str(AXP202), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x60040003, // 0000 GETGBL R1 G3 + 0x5C080000, // 0001 MOVE R2 R0 + 0xB80E0000, // 0002 GETNGBL R3 K0 + 0x7C040400, // 0003 CALL R1 2 + 0x8C040301, // 0004 GETMET R1 R1 K1 + 0x580C0002, // 0005 LDCONST R3 K2 + 0x54120034, // 0006 LDINT R4 53 + 0x7C040600, // 0007 CALL R1 3 + 0x80000000, // 0008 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_exten +********************************************************************/ +be_local_closure(AXP202_set_exten, /* 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[ 2]) { /* constants */ + /* K0 */ be_nested_str(write_bit), + /* K1 */ be_const_int(0), + }), + &be_const_str_set_exten, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 + 0x54120011, // 0001 LDINT R4 18 + 0x58140001, // 0002 LDCONST R5 K1 + 0x5C180200, // 0003 MOVE R6 R1 + 0x7C080800, // 0004 CALL R2 4 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_battery_chargin_status +********************************************************************/ +be_local_closure(AXP202_get_battery_chargin_status, /* name */ + be_nested_proto( + 6, /* 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(wire), + /* K1 */ be_nested_str(read), + /* K2 */ be_nested_str(addr), + /* K3 */ be_const_int(1), + }), + &be_const_str_get_battery_chargin_status, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x58100003, // 0003 LDCONST R4 K3 + 0x58140003, // 0004 LDCONST R5 K3 + 0x7C040800, // 0005 CALL R1 4 + 0x80040200, // 0006 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_dc_voltage +********************************************************************/ +be_local_closure(AXP202_set_dc_voltage, /* name */ + be_nested_proto( + 11, /* 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_const_int(2), + /* K1 */ be_const_int(3), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str(write8), + /* K4 */ be_nested_str(read8), + }), + &be_const_str_set_dc_voltage, + &be_const_str_solidified, + ( &(const binstruction[44]) { /* code */ + 0x140C0300, // 0000 LT R3 R1 K0 + 0x740E0001, // 0001 JMPT R3 #0004 + 0x240C0301, // 0002 GT R3 R1 K1 + 0x780E0000, // 0003 JMPF R3 #0005 + 0x80000600, // 0004 RET 0 + 0x4C0C0000, // 0005 LDNIL R3 + 0x541202BB, // 0006 LDINT R4 700 + 0x14100404, // 0007 LT R4 R2 R4 + 0x78120001, // 0008 JMPF R4 #000B + 0x580C0002, // 0009 LDCONST R3 K2 + 0x70020010, // 000A JMP #001C + 0x54120DAB, // 000B LDINT R4 3500 + 0x24100404, // 000C GT R4 R2 R4 + 0x78120001, // 000D JMPF R4 #0010 + 0x540E006F, // 000E LDINT R3 112 + 0x7002000B, // 000F JMP #001C + 0x1C100300, // 0010 EQ R4 R1 K0 + 0x78120004, // 0011 JMPF R4 #0017 + 0x541208E2, // 0012 LDINT R4 2275 + 0x24100404, // 0013 GT R4 R2 R4 + 0x78120001, // 0014 JMPF R4 #0017 + 0x540E003E, // 0015 LDINT R3 63 + 0x70020004, // 0016 JMP #001C + 0x541202BB, // 0017 LDINT R4 700 + 0x04100404, // 0018 SUB R4 R2 R4 + 0x54160018, // 0019 LDINT R5 25 + 0x0C100805, // 001A DIV R4 R4 R5 + 0x5C0C0800, // 001B MOVE R3 R4 + 0x54120022, // 001C LDINT R4 35 + 0x1C140301, // 001D EQ R5 R1 K1 + 0x78160000, // 001E JMPF R5 #0020 + 0x54120026, // 001F LDINT R4 39 + 0x8C140103, // 0020 GETMET R5 R0 K3 + 0x5C1C0800, // 0021 MOVE R7 R4 + 0x8C200104, // 0022 GETMET R8 R0 K4 + 0x5C280800, // 0023 MOVE R10 R4 + 0x7C200400, // 0024 CALL R8 2 + 0x5426007F, // 0025 LDINT R9 128 + 0x2C201009, // 0026 AND R8 R8 R9 + 0x5426007E, // 0027 LDINT R9 127 + 0x2C240609, // 0028 AND R9 R3 R9 + 0x30201009, // 0029 OR R8 R8 R9 + 0x7C140600, // 002A CALL R5 3 + 0x80000000, // 002B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_bat_charge_current +********************************************************************/ +be_local_closure(AXP202_get_bat_charge_current, /* 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(read13), + /* K1 */ be_const_real_hex(0x3F000000), + }), + &be_const_str_get_bat_charge_current, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E0079, // 0001 LDINT R3 122 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x80040200, // 0004 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_temp +********************************************************************/ +be_local_closure(AXP202_get_temp, /* 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(read12), + /* K1 */ be_const_real_hex(0x3DCCCCCD), + /* K2 */ be_const_real_hex(0x4310B333), + }), + &be_const_str_get_temp, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E005D, // 0001 LDINT R3 94 + 0x7C040400, // 0002 CALL R1 2 + 0x08040301, // 0003 MUL R1 R1 K1 + 0x04040302, // 0004 SUB R1 R1 K2 + 0x80040200, // 0005 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_ldo_voltage +********************************************************************/ +be_local_closure(AXP202_set_ldo_voltage, /* 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[ 3]) { /* constants */ + /* K0 */ be_const_int(2), + /* K1 */ be_nested_str(write8), + /* K2 */ be_nested_str(read8), + }), + &be_const_str_set_ldo_voltage, + &be_const_str_solidified, + ( &(const binstruction[59]) { /* code */ + 0x540E0CE3, // 0000 LDINT R3 3300 + 0x240C0403, // 0001 GT R3 R2 R3 + 0x780E0000, // 0002 JMPF R3 #0004 + 0x540A000E, // 0003 LDINT R2 15 + 0x1C0C0300, // 0004 EQ R3 R1 K0 + 0x740E0002, // 0005 JMPT R3 #0009 + 0x540E0003, // 0006 LDINT R3 4 + 0x1C0C0203, // 0007 EQ R3 R1 R3 + 0x780E0020, // 0008 JMPF R3 #002A + 0x540E0063, // 0009 LDINT R3 100 + 0x0C0C0403, // 000A DIV R3 R2 R3 + 0x54120011, // 000B LDINT R4 18 + 0x040C0604, // 000C SUB R3 R3 R4 + 0x5C080600, // 000D MOVE R2 R3 + 0x1C0C0300, // 000E EQ R3 R1 K0 + 0x780E000D, // 000F JMPF R3 #001E + 0x8C0C0101, // 0010 GETMET R3 R0 K1 + 0x54160027, // 0011 LDINT R5 40 + 0x8C180102, // 0012 GETMET R6 R0 K2 + 0x54220027, // 0013 LDINT R8 40 + 0x7C180400, // 0014 CALL R6 2 + 0x541E000E, // 0015 LDINT R7 15 + 0x2C180C07, // 0016 AND R6 R6 R7 + 0x541E000E, // 0017 LDINT R7 15 + 0x2C1C0407, // 0018 AND R7 R2 R7 + 0x54220003, // 0019 LDINT R8 4 + 0x381C0E08, // 001A SHL R7 R7 R8 + 0x30180C07, // 001B OR R6 R6 R7 + 0x7C0C0600, // 001C CALL R3 3 + 0x7002000A, // 001D JMP #0029 + 0x8C0C0101, // 001E GETMET R3 R0 K1 + 0x54160027, // 001F LDINT R5 40 + 0x8C180102, // 0020 GETMET R6 R0 K2 + 0x54220027, // 0021 LDINT R8 40 + 0x7C180400, // 0022 CALL R6 2 + 0x541E00EF, // 0023 LDINT R7 240 + 0x2C180C07, // 0024 AND R6 R6 R7 + 0x541E000E, // 0025 LDINT R7 15 + 0x2C1C0407, // 0026 AND R7 R2 R7 + 0x30180C07, // 0027 OR R6 R6 R7 + 0x7C0C0600, // 0028 CALL R3 3 + 0x7002000F, // 0029 JMP #003A + 0x540E0018, // 002A LDINT R3 25 + 0x0C0C0403, // 002B DIV R3 R2 R3 + 0x5412001B, // 002C LDINT R4 28 + 0x040C0604, // 002D SUB R3 R3 R4 + 0x5C080600, // 002E MOVE R2 R3 + 0x8C0C0101, // 002F GETMET R3 R0 K1 + 0x54160027, // 0030 LDINT R5 40 + 0x8C180102, // 0031 GETMET R6 R0 K2 + 0x54220028, // 0032 LDINT R8 41 + 0x7C180400, // 0033 CALL R6 2 + 0x541E007F, // 0034 LDINT R7 128 + 0x2C180C07, // 0035 AND R6 R6 R7 + 0x541E007E, // 0036 LDINT R7 127 + 0x2C1C0407, // 0037 AND R7 R2 R7 + 0x30180C07, // 0038 OR R6 R6 R7 + 0x7C0C0600, // 0039 CALL R3 3 + 0x80000000, // 003A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_limiting_off +********************************************************************/ +be_local_closure(AXP202_set_limiting_off, /* 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[ 3]) { /* constants */ + /* K0 */ be_nested_str(write8), + /* K1 */ be_nested_str(read8), + /* K2 */ be_const_int(3), + }), + &be_const_str_set_limiting_off, + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x540E002F, // 0001 LDINT R3 48 + 0x8C100101, // 0002 GETMET R4 R0 K1 + 0x541A002F, // 0003 LDINT R6 48 + 0x7C100400, // 0004 CALL R4 2 + 0x30100902, // 0005 OR R4 R4 K2 + 0x7C040600, // 0006 CALL R1 3 + 0x80000000, // 0007 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_input_power_status +********************************************************************/ +be_local_closure(AXP202_get_input_power_status, /* name */ + be_nested_proto( + 6, /* 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(wire), + /* K1 */ be_nested_str(read), + /* K2 */ be_nested_str(addr), + /* K3 */ be_const_int(0), + /* K4 */ be_const_int(1), + }), + &be_const_str_get_input_power_status, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x58100003, // 0003 LDCONST R4 K3 + 0x58140004, // 0004 LDCONST R5 K4 + 0x7C040800, // 0005 CALL R1 4 + 0x80040200, // 0006 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: AXP202 +********************************************************************/ +extern const bclass be_class_I2C_Driver; +be_local_class(AXP202, + 0, + &be_class_I2C_Driver, + be_nested_map(21, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(set_shutdown_time, -1), be_const_closure(AXP202_set_shutdown_time_closure) }, + { be_const_key(get_vbus_current, -1), be_const_closure(AXP202_get_vbus_current_closure) }, + { be_const_key(get_aps_voltage, -1), be_const_closure(AXP202_get_aps_voltage_closure) }, + { be_const_key(get_bat_current, -1), be_const_closure(AXP202_get_bat_current_closure) }, + { be_const_key(get_bat_power, 2), be_const_closure(AXP202_get_bat_power_closure) }, + { be_const_key(init, -1), be_const_closure(AXP202_init_closure) }, + { be_const_key(get_vbus_voltage, -1), be_const_closure(AXP202_get_vbus_voltage_closure) }, + { be_const_key(set_ldo_voltage, 14), be_const_closure(AXP202_set_ldo_voltage_closure) }, + { be_const_key(battery_present, -1), be_const_closure(AXP202_battery_present_closure) }, + { be_const_key(set_chg_current_ma, -1), be_const_closure(AXP202_set_chg_current_ma_closure) }, + { be_const_key(set_dcdc_enable, -1), be_const_closure(AXP202_set_dcdc_enable_closure) }, + { be_const_key(set_chg_led_mode, 7), be_const_closure(AXP202_set_chg_led_mode_closure) }, + { be_const_key(set_ldo_enable, 5), be_const_closure(AXP202_set_ldo_enable_closure) }, + { be_const_key(set_exten, -1), be_const_closure(AXP202_set_exten_closure) }, + { be_const_key(get_temp, -1), be_const_closure(AXP202_get_temp_closure) }, + { be_const_key(get_bat_voltage, 16), be_const_closure(AXP202_get_bat_voltage_closure) }, + { be_const_key(get_bat_charge_current, 17), be_const_closure(AXP202_get_bat_charge_current_closure) }, + { be_const_key(set_dc_voltage, 18), be_const_closure(AXP202_set_dc_voltage_closure) }, + { be_const_key(get_battery_chargin_status, -1), be_const_closure(AXP202_get_battery_chargin_status_closure) }, + { be_const_key(set_limiting_off, -1), be_const_closure(AXP202_set_limiting_off_closure) }, + { be_const_key(get_input_power_status, -1), be_const_closure(AXP202_get_input_power_status_closure) }, + })), + (bstring*) &be_const_str_AXP202 +); +/*******************************************************************/ + +void be_load_AXP202_class(bvm *vm) { + be_pushntvclass(vm, &be_class_AXP202); + be_setglobal(vm, "AXP202"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_ft3663.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_ft3663.h new file mode 100644 index 000000000..676e5299a --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_ft3663.h @@ -0,0 +1,256 @@ +/* Solidification of i2c_ft3663.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: every_100ms +********************************************************************/ +be_local_closure(FT3663_every_100ms, /* 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(wire), + /* K1 */ be_nested_str(ts_loop), + }), + &be_const_str_every_100ms, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x78060001, // 0001 JMPF R1 #0004 + 0x8C040101, // 0002 GETMET R1 R0 K1 + 0x7C040200, // 0003 CALL R1 1 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(FT3663_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[12]) { /* constants */ + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(FT3663), + /* K2 */ be_nested_str(wire), + /* K3 */ be_nested_str(read8), + /* K4 */ be_nested_str(tasmota), + /* K5 */ be_nested_str(log), + /* K6 */ be_nested_str(I2C_X3A_X20ignoring_X20address_X200x38_X2C_X20not_X20FT3663), + /* K7 */ be_const_int(2), + /* K8 */ be_nested_str(TS_X20_X3A_X20FT3663_X20Touch_X20Screen_X20detected), + /* K9 */ be_nested_str(write8), + /* K10 */ be_const_int(0), + /* K11 */ be_nested_str(add_driver), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[50]) { /* code */ + 0x60040003, // 0000 GETGBL R1 G3 + 0x5C080000, // 0001 MOVE R2 R0 + 0x7C040200, // 0002 CALL R1 1 + 0x8C040300, // 0003 GETMET R1 R1 K0 + 0x580C0001, // 0004 LDCONST R3 K1 + 0x54120037, // 0005 LDINT R4 56 + 0x7C040600, // 0006 CALL R1 3 + 0x88040102, // 0007 GETMBR R1 R0 K2 + 0x78060027, // 0008 JMPF R1 #0031 + 0x8C040103, // 0009 GETMET R1 R0 K3 + 0x540E00A7, // 000A LDINT R3 168 + 0x7C040400, // 000B CALL R1 2 + 0x8C080103, // 000C GETMET R2 R0 K3 + 0x541200A2, // 000D LDINT R4 163 + 0x7C080400, // 000E CALL R2 2 + 0x540E0010, // 000F LDINT R3 17 + 0x200C0203, // 0010 NE R3 R1 R3 + 0x740E0002, // 0011 JMPT R3 #0015 + 0x540E0063, // 0012 LDINT R3 100 + 0x200C0403, // 0013 NE R3 R2 R3 + 0x780E0007, // 0014 JMPF R3 #001D + 0xB80E0800, // 0015 GETNGBL R3 K4 + 0x8C0C0705, // 0016 GETMET R3 R3 K5 + 0x58140006, // 0017 LDCONST R5 K6 + 0x58180007, // 0018 LDCONST R6 K7 + 0x7C0C0600, // 0019 CALL R3 3 + 0x4C0C0000, // 001A LDNIL R3 + 0x90020403, // 001B SETMBR R0 K2 R3 + 0x80000600, // 001C RET 0 + 0xB80E0800, // 001D GETNGBL R3 K4 + 0x8C0C0705, // 001E GETMET R3 R3 K5 + 0x58140008, // 001F LDCONST R5 K8 + 0x7C0C0400, // 0020 CALL R3 2 + 0x8C0C0109, // 0021 GETMET R3 R0 K9 + 0x5814000A, // 0022 LDCONST R5 K10 + 0x5818000A, // 0023 LDCONST R6 K10 + 0x7C0C0600, // 0024 CALL R3 3 + 0x8C0C0109, // 0025 GETMET R3 R0 K9 + 0x5416007F, // 0026 LDINT R5 128 + 0x541A0015, // 0027 LDINT R6 22 + 0x7C0C0600, // 0028 CALL R3 3 + 0x8C0C0109, // 0029 GETMET R3 R0 K9 + 0x54160087, // 002A LDINT R5 136 + 0x541A000D, // 002B LDINT R6 14 + 0x7C0C0600, // 002C CALL R3 3 + 0xB80E0800, // 002D GETNGBL R3 K4 + 0x8C0C070B, // 002E GETMET R3 R3 K11 + 0x5C140000, // 002F MOVE R5 R0 + 0x7C0C0400, // 0030 CALL R3 2 + 0x80000000, // 0031 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: ts_loop +********************************************************************/ +be_local_closure(FT3663_ts_loop, /* name */ + be_nested_proto( + 17, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[11]) { /* constants */ + /* K0 */ be_nested_str(wire), + /* K1 */ be_nested_str(display), + /* K2 */ be_nested_str(read_bytes), + /* K3 */ be_nested_str(addr), + /* K4 */ be_const_int(0), + /* K5 */ be_const_int(2), + /* K6 */ be_const_int(3), + /* K7 */ be_nested_str(gest_id_codes), + /* K8 */ be_nested_str(find), + /* K9 */ be_const_int(1), + /* K10 */ be_nested_str(touch_update), + }), + &be_const_str_ts_loop, + &be_const_str_solidified, + ( &(const binstruction[63]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x74060000, // 0001 JMPT R1 #0003 + 0x80000200, // 0002 RET 0 + 0xA4060200, // 0003 IMPORT R1 K1 + 0x88080100, // 0004 GETMBR R2 R0 K0 + 0x8C080502, // 0005 GETMET R2 R2 K2 + 0x88100103, // 0006 GETMBR R4 R0 K3 + 0x58140004, // 0007 LDCONST R5 K4 + 0x541A000E, // 0008 LDINT R6 15 + 0x7C080800, // 0009 CALL R2 4 + 0x940C0505, // 000A GETIDX R3 R2 K5 + 0x5412000E, // 000B LDINT R4 15 + 0x2C0C0604, // 000C AND R3 R3 R4 + 0x94100506, // 000D GETIDX R4 R2 K6 + 0x5416000E, // 000E LDINT R5 15 + 0x2C100805, // 000F AND R4 R4 R5 + 0x54160007, // 0010 LDINT R5 8 + 0x38100805, // 0011 SHL R4 R4 R5 + 0x54160003, // 0012 LDINT R5 4 + 0x94140405, // 0013 GETIDX R5 R2 R5 + 0x30100805, // 0014 OR R4 R4 R5 + 0x54160004, // 0015 LDINT R5 5 + 0x94140405, // 0016 GETIDX R5 R2 R5 + 0x541A000E, // 0017 LDINT R6 15 + 0x2C140A06, // 0018 AND R5 R5 R6 + 0x541A0007, // 0019 LDINT R6 8 + 0x38140A06, // 001A SHL R5 R5 R6 + 0x541A0005, // 001B LDINT R6 6 + 0x94180406, // 001C GETIDX R6 R2 R6 + 0x30140A06, // 001D OR R5 R5 R6 + 0x541A0006, // 001E LDINT R6 7 + 0x94180406, // 001F GETIDX R6 R2 R6 + 0x941C0506, // 0020 GETIDX R7 R2 K6 + 0x54220008, // 0021 LDINT R8 9 + 0x2C1C0E08, // 0022 AND R7 R7 R8 + 0x54220007, // 0023 LDINT R8 8 + 0x381C0E08, // 0024 SHL R7 R7 R8 + 0x54220009, // 0025 LDINT R8 10 + 0x94200408, // 0026 GETIDX R8 R2 R8 + 0x301C0E08, // 0027 OR R7 R7 R8 + 0x54220004, // 0028 LDINT R8 5 + 0x94200408, // 0029 GETIDX R8 R2 R8 + 0x5426000A, // 002A LDINT R9 11 + 0x2C201009, // 002B AND R8 R8 R9 + 0x54260007, // 002C LDINT R9 8 + 0x38201009, // 002D SHL R8 R8 R9 + 0x5426000B, // 002E LDINT R9 12 + 0x94240409, // 002F GETIDX R9 R2 R9 + 0x30201009, // 0030 OR R8 R8 R9 + 0x5426000C, // 0031 LDINT R9 13 + 0x94240409, // 0032 GETIDX R9 R2 R9 + 0x88280107, // 0033 GETMBR R10 R0 K7 + 0x8C281508, // 0034 GETMET R10 R10 K8 + 0x94300509, // 0035 GETIDX R12 R2 K9 + 0x58340004, // 0036 LDCONST R13 K4 + 0x7C280600, // 0037 CALL R10 3 + 0x8C2C030A, // 0038 GETMET R11 R1 K10 + 0x5C340600, // 0039 MOVE R13 R3 + 0x5C380800, // 003A MOVE R14 R4 + 0x5C3C0A00, // 003B MOVE R15 R5 + 0x5C401400, // 003C MOVE R16 R10 + 0x7C2C0A00, // 003D CALL R11 5 + 0x80000000, // 003E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: FT3663 +********************************************************************/ +extern const bclass be_class_I2C_Driver; +be_local_class(FT3663, + 0, + &be_class_I2C_Driver, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(every_100ms, -1), be_const_closure(FT3663_every_100ms_closure) }, + { be_const_key(ts_loop, 2), be_const_closure(FT3663_ts_loop_closure) }, + { be_const_key(gest_id_codes, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + be_const_map( * be_nested_map(7, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_int(0, 4), be_const_int(0) }, + { be_const_key_int(72, -1), be_const_int(32) }, + { be_const_key_int(16, 1), be_const_int(16) }, + { be_const_key_int(73, 5), be_const_int(33) }, + { be_const_key_int(28, -1), be_const_int(18) }, + { be_const_key_int(24, -1), be_const_int(17) }, + { be_const_key_int(20, -1), be_const_int(19) }, + })) ) } )) }, + { be_const_key(init, 1), be_const_closure(FT3663_init_closure) }, + })), + (bstring*) &be_const_str_FT3663 +); +/*******************************************************************/ + +void be_load_FT3663_class(bvm *vm) { + be_pushntvclass(vm, &be_class_FT3663); + be_setglobal(vm, "FT3663"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_leds_animator.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_leds_animator.h new file mode 100644 index 000000000..1952c41dd --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_leds_animator.h @@ -0,0 +1,379 @@ +/* Solidification of leds_animator.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Leds_animator_init, /* 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[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(strip), + /* K1 */ be_nested_str_weak(bri), + /* K2 */ be_nested_str_weak(running), + /* K3 */ be_nested_str_weak(pixel_count), + /* K4 */ be_nested_str_weak(animators), + /* K5 */ be_nested_str_weak(clear), + /* K6 */ be_nested_str_weak(tasmota), + /* K7 */ be_nested_str_weak(add_driver), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x540A0031, // 0001 LDINT R2 50 + 0x90020202, // 0002 SETMBR R0 K1 R2 + 0x50080000, // 0003 LDBOOL R2 0 0 + 0x90020402, // 0004 SETMBR R0 K2 R2 + 0x8C080303, // 0005 GETMET R2 R1 K3 + 0x7C080200, // 0006 CALL R2 1 + 0x90020602, // 0007 SETMBR R0 K3 R2 + 0x60080012, // 0008 GETGBL R2 G18 + 0x7C080000, // 0009 CALL R2 0 + 0x90020802, // 000A SETMBR R0 K4 R2 + 0x8C080105, // 000B GETMET R2 R0 K5 + 0x7C080200, // 000C CALL R2 1 + 0xB80A0C00, // 000D GETNGBL R2 K6 + 0x8C080507, // 000E GETMET R2 R2 K7 + 0x5C100000, // 000F MOVE R4 R0 + 0x7C080400, // 0010 CALL R2 2 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_bri +********************************************************************/ +be_local_closure(Leds_animator_set_bri, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* argc */ + 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_weak(bri), + }), + be_str_weak(set_bri), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x80000000, // 0001 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: stop +********************************************************************/ +be_local_closure(Leds_animator_stop, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 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_weak(running), + }), + be_str_weak(stop), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x50040000, // 0000 LDBOOL R1 0 0 + 0x90020001, // 0001 SETMBR R0 K0 R1 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: animate +********************************************************************/ +be_local_closure(Leds_animator_animate, /* name */ + be_nested_proto( + 1, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(animate), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove +********************************************************************/ +be_local_closure(Leds_animator_remove, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 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_weak(tasmota), + /* K1 */ be_nested_str_weak(remove_driver), + }), + be_str_weak(remove), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C040400, // 0003 CALL R1 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_50ms +********************************************************************/ +be_local_closure(Leds_animator_every_50ms, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 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_weak(running), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str_weak(animators), + /* K3 */ be_nested_str_weak(is_running), + /* K4 */ be_nested_str_weak(animate), + /* K5 */ be_const_int(1), + /* K6 */ be_nested_str_weak(remove), + }), + be_str_weak(every_50ms), + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x78060015, // 0001 JMPF R1 #0018 + 0x58040001, // 0002 LDCONST R1 K1 + 0x6008000C, // 0003 GETGBL R2 G12 + 0x880C0102, // 0004 GETMBR R3 R0 K2 + 0x7C080200, // 0005 CALL R2 1 + 0x14080202, // 0006 LT R2 R1 R2 + 0x780A000D, // 0007 JMPF R2 #0016 + 0x88080102, // 0008 GETMBR R2 R0 K2 + 0x94080401, // 0009 GETIDX R2 R2 R1 + 0x8C0C0503, // 000A GETMET R3 R2 K3 + 0x7C0C0200, // 000B CALL R3 1 + 0x780E0003, // 000C JMPF R3 #0011 + 0x8C0C0504, // 000D GETMET R3 R2 K4 + 0x7C0C0200, // 000E CALL R3 1 + 0x00040305, // 000F ADD R1 R1 K5 + 0x70020003, // 0010 JMP #0015 + 0x880C0102, // 0011 GETMBR R3 R0 K2 + 0x8C0C0706, // 0012 GETMET R3 R3 K6 + 0x5C140200, // 0013 MOVE R5 R1 + 0x7C0C0400, // 0014 CALL R3 2 + 0x7001FFEC, // 0015 JMP #0003 + 0x8C080104, // 0016 GETMET R2 R0 K4 + 0x7C080200, // 0017 CALL R2 1 + 0x80000000, // 0018 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_bri +********************************************************************/ +be_local_closure(Leds_animator_get_bri, /* name */ + be_nested_proto( + 3, /* nstack */ + 2, /* argc */ + 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_weak(bri), + }), + be_str_weak(get_bri), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x80040400, // 0001 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start +********************************************************************/ +be_local_closure(Leds_animator_start, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 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_weak(running), + }), + be_str_weak(start), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x50040200, // 0000 LDBOOL R1 1 0 + 0x90020001, // 0001 SETMBR R0 K0 R1 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_anim +********************************************************************/ +be_local_closure(Leds_animator_add_anim, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 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_weak(animators), + /* K1 */ be_nested_str_weak(push), + /* K2 */ be_nested_str_weak(run), + }), + be_str_weak(add_anim), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x8C080302, // 0004 GETMET R2 R1 K2 + 0x7C080200, // 0005 CALL R2 1 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: clear +********************************************************************/ +be_local_closure(Leds_animator_clear, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 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_weak(stop), + /* K1 */ be_nested_str_weak(strip), + /* K2 */ be_nested_str_weak(clear), + }), + be_str_weak(clear), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0x88040101, // 0002 GETMBR R1 R0 K1 + 0x8C040302, // 0003 GETMET R1 R1 K2 + 0x7C040200, // 0004 CALL R1 1 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Leds_animator +********************************************************************/ +be_local_class(Leds_animator, + 5, + NULL, + be_nested_map(15, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(init, 12), be_const_closure(Leds_animator_init_closure) }, + { be_const_key_weak(clear, -1), be_const_closure(Leds_animator_clear_closure) }, + { be_const_key_weak(stop, -1), be_const_closure(Leds_animator_stop_closure) }, + { be_const_key_weak(strip, 4), be_const_var(0) }, + { be_const_key_weak(pixel_count, 6), be_const_var(1) }, + { be_const_key_weak(animate, -1), be_const_closure(Leds_animator_animate_closure) }, + { be_const_key_weak(add_anim, 13), be_const_closure(Leds_animator_add_anim_closure) }, + { be_const_key_weak(bri, -1), be_const_var(2) }, + { be_const_key_weak(every_50ms, -1), be_const_closure(Leds_animator_every_50ms_closure) }, + { be_const_key_weak(remove, 7), be_const_closure(Leds_animator_remove_closure) }, + { be_const_key_weak(get_bri, -1), be_const_closure(Leds_animator_get_bri_closure) }, + { be_const_key_weak(start, -1), be_const_closure(Leds_animator_start_closure) }, + { be_const_key_weak(running, -1), be_const_var(3) }, + { be_const_key_weak(animators, -1), be_const_var(4) }, + { be_const_key_weak(set_bri, 1), be_const_closure(Leds_animator_set_bri_closure) }, + })), + be_str_weak(Leds_animator) +); +/*******************************************************************/ + +void be_load_Leds_animator_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Leds_animator); + be_setglobal(vm, "Leds_animator"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_lv_tasmota.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_lv_tasmota.h new file mode 100644 index 000000000..ef165ab11 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_lv_tasmota.h @@ -0,0 +1,533 @@ +/* Solidification of lv_tasmota.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: splash_remove +********************************************************************/ +be_local_closure(lv_tasmota_splash_remove, /* name */ + be_nested_proto( + 3, /* nstack */ + 0, /* 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(lv), + /* K1 */ be_nested_str(_splash), + /* K2 */ be_nested_str(del), + }), + &be_const_str_splash_remove, + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0xB8020000, // 0000 GETNGBL R0 K0 + 0x88000101, // 0001 GETMBR R0 R0 K1 + 0x78020004, // 0002 JMPF R0 #0008 + 0xB8060000, // 0003 GETNGBL R1 K0 + 0x4C080000, // 0004 LDNIL R2 + 0x90060202, // 0005 SETMBR R1 K1 R2 + 0x8C040102, // 0006 GETMET R1 R0 K2 + 0x7C040200, // 0007 CALL R1 1 + 0x80000000, // 0008 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(splash_runner_init, /* 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(tasmota), + /* K1 */ be_nested_str(add_driver), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C040400, // 0003 CALL R1 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: display +********************************************************************/ +be_local_closure(splash_runner_display, /* name */ + be_nested_proto( + 9, /* nstack */ + 5, /* 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(display), + /* K1 */ be_nested_str(dim), + /* K2 */ be_nested_str(started), + /* K3 */ be_nested_str(tasmota), + /* K4 */ be_nested_str(remove_driver), + /* K5 */ be_nested_str(lv), + /* K6 */ be_nested_str(splash), + }), + &be_const_str_display, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0xA4160000, // 0000 IMPORT R5 K0 + 0x1C180301, // 0001 EQ R6 R1 K1 + 0x781A0009, // 0002 JMPF R6 #000D + 0x8C180B02, // 0003 GETMET R6 R5 K2 + 0x7C180200, // 0004 CALL R6 1 + 0x781A0006, // 0005 JMPF R6 #000D + 0xB81A0600, // 0006 GETNGBL R6 K3 + 0x8C180D04, // 0007 GETMET R6 R6 K4 + 0x5C200000, // 0008 MOVE R8 R0 + 0x7C180400, // 0009 CALL R6 2 + 0xB81A0A00, // 000A GETNGBL R6 K5 + 0x8C180D06, // 000B GETMET R6 R6 K6 + 0x7C180200, // 000C CALL R6 1 + 0x80000000, // 000D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: splash_runner +********************************************************************/ +be_local_class(splash_runner, + 0, + NULL, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(display, -1), be_const_closure(splash_runner_display_closure) }, + { be_const_key(init, 0), be_const_closure(splash_runner_init_closure) }, + })), + (bstring*) &be_const_str_splash_runner +); + +/******************************************************************** +** Solidified function: splash_init +********************************************************************/ +be_local_closure(lv_tasmota_splash_init, /* name */ + be_nested_proto( + 3, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(display), + /* K1 */ be_nested_str(started), + /* K2 */ be_nested_str(lv), + /* K3 */ be_nested_str(splash), + /* K4 */ be_const_class(be_class_splash_runner), + }), + &be_const_str_splash_init, + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0xA4020000, // 0000 IMPORT R0 K0 + 0x8C040101, // 0001 GETMET R1 R0 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x78060003, // 0003 JMPF R1 #0008 + 0xB8060400, // 0004 GETNGBL R1 K2 + 0x8C040303, // 0005 GETMET R1 R1 K3 + 0x7C040200, // 0006 CALL R1 1 + 0x70020003, // 0007 JMP #000C + 0x58040004, // 0008 LDCONST R1 K4 + 0xB4000004, // 0009 CLASS K4 + 0x5C080200, // 000A MOVE R2 R1 + 0x7C080000, // 000B CALL R2 0 + 0x80000000, // 000C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: splash +********************************************************************/ +be_local_closure(lv_tasmota_splash, /* name */ + be_nested_proto( + 14, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[42]) { /* constants */ + /* K0 */ be_nested_str(display), + /* K1 */ be_nested_str(started), + /* K2 */ be_nested_str(lv), + /* K3 */ be_nested_str(start), + /* K4 */ be_nested_str(obj), + /* K5 */ be_nested_str(scr_act), + /* K6 */ be_nested_str(montserrat_font), + /* K7 */ be_nested_str(color), + /* K8 */ be_nested_str(COLOR_WHITE), + /* K9 */ be_nested_str(set_style_bg_color), + /* K10 */ be_const_int(0), + /* K11 */ be_nested_str(set_style_radius), + /* K12 */ be_nested_str(set_style_pad_all), + /* K13 */ be_nested_str(set_style_border_width), + /* K14 */ be_nested_str(set_size), + /* K15 */ be_nested_str(pct), + /* K16 */ be_nested_str(refr_pos), + /* K17 */ be_nested_str(refr_size), + /* K18 */ be_nested_str(set_user_data), + /* K19 */ be_const_int(1399876712), + /* K20 */ be_nested_str(img), + /* K21 */ be_nested_str(set_tasmota_logo), + /* K22 */ be_nested_str(set_zoom), + /* K23 */ be_nested_str(set_style_img_recolor_opa), + /* K24 */ be_nested_str(set_style_img_recolor), + /* K25 */ be_nested_str(set_align), + /* K26 */ be_nested_str(ALIGN_LEFT_MID), + /* K27 */ be_nested_str(set_x), + /* K28 */ be_nested_str(label), + /* K29 */ be_nested_str(set_style_text_color), + /* K30 */ be_nested_str(set_text), + /* K31 */ be_nested_str(TASMOTA), + /* K32 */ be_nested_str(get_hor_res), + /* K33 */ be_nested_str(set_style_text_font), + /* K34 */ be_nested_str(driver_name), + /* K35 */ be_nested_str(ALIGN_BOTTOM_MID), + /* K36 */ be_const_int(16777215), + /* K37 */ be_nested_str(refr_now), + /* K38 */ be_nested_str(_splash), + /* K39 */ be_nested_str(tasmota), + /* K40 */ be_nested_str(set_timer), + /* K41 */ be_nested_str(splash_remove), + }), + &be_const_str_splash, + &be_const_str_solidified, + ( &(const binstruction[166]) { /* code */ + 0xA4020000, // 0000 IMPORT R0 K0 + 0x8C040101, // 0001 GETMET R1 R0 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x74060000, // 0003 JMPT R1 #0005 + 0x80000200, // 0004 RET 0 + 0xB8060400, // 0005 GETNGBL R1 K2 + 0x8C040303, // 0006 GETMET R1 R1 K3 + 0x7C040200, // 0007 CALL R1 1 + 0xB8060400, // 0008 GETNGBL R1 K2 + 0x8C040304, // 0009 GETMET R1 R1 K4 + 0xB80E0400, // 000A GETNGBL R3 K2 + 0x8C0C0705, // 000B GETMET R3 R3 K5 + 0x7C0C0200, // 000C CALL R3 1 + 0x7C040400, // 000D CALL R1 2 + 0xB80A0400, // 000E GETNGBL R2 K2 + 0x8C080506, // 000F GETMET R2 R2 K6 + 0x5412001B, // 0010 LDINT R4 28 + 0x7C080400, // 0011 CALL R2 2 + 0xB80E0400, // 0012 GETNGBL R3 K2 + 0x8C0C0706, // 0013 GETMET R3 R3 K6 + 0x54160013, // 0014 LDINT R5 20 + 0x7C0C0400, // 0015 CALL R3 2 + 0xB8120400, // 0016 GETNGBL R4 K2 + 0x8C100907, // 0017 GETMET R4 R4 K7 + 0xB81A0400, // 0018 GETNGBL R6 K2 + 0x88180D08, // 0019 GETMBR R6 R6 K8 + 0x7C100400, // 001A CALL R4 2 + 0x8C140309, // 001B GETMET R5 R1 K9 + 0xB81E0400, // 001C GETNGBL R7 K2 + 0x8C1C0F07, // 001D GETMET R7 R7 K7 + 0x54260065, // 001E LDINT R9 102 + 0x7C1C0400, // 001F CALL R7 2 + 0x5820000A, // 0020 LDCONST R8 K10 + 0x7C140600, // 0021 CALL R5 3 + 0x8C14030B, // 0022 GETMET R5 R1 K11 + 0x581C000A, // 0023 LDCONST R7 K10 + 0x5820000A, // 0024 LDCONST R8 K10 + 0x7C140600, // 0025 CALL R5 3 + 0x8C14030C, // 0026 GETMET R5 R1 K12 + 0x581C000A, // 0027 LDCONST R7 K10 + 0x5820000A, // 0028 LDCONST R8 K10 + 0x7C140600, // 0029 CALL R5 3 + 0x8C14030D, // 002A GETMET R5 R1 K13 + 0x581C000A, // 002B LDCONST R7 K10 + 0x5820000A, // 002C LDCONST R8 K10 + 0x7C140600, // 002D CALL R5 3 + 0x8C14030E, // 002E GETMET R5 R1 K14 + 0xB81E0400, // 002F GETNGBL R7 K2 + 0x8C1C0F0F, // 0030 GETMET R7 R7 K15 + 0x54260063, // 0031 LDINT R9 100 + 0x7C1C0400, // 0032 CALL R7 2 + 0xB8220400, // 0033 GETNGBL R8 K2 + 0x8C20110F, // 0034 GETMET R8 R8 K15 + 0x542A0063, // 0035 LDINT R10 100 + 0x7C200400, // 0036 CALL R8 2 + 0x7C140600, // 0037 CALL R5 3 + 0x8C140310, // 0038 GETMET R5 R1 K16 + 0x7C140200, // 0039 CALL R5 1 + 0x8C140311, // 003A GETMET R5 R1 K17 + 0x7C140200, // 003B CALL R5 1 + 0x8C140312, // 003C GETMET R5 R1 K18 + 0x581C0013, // 003D LDCONST R7 K19 + 0x7C140400, // 003E CALL R5 2 + 0xB8160400, // 003F GETNGBL R5 K2 + 0x8C140B14, // 0040 GETMET R5 R5 K20 + 0x5C1C0200, // 0041 MOVE R7 R1 + 0x7C140400, // 0042 CALL R5 2 + 0x8C180B15, // 0043 GETMET R6 R5 K21 + 0x7C180200, // 0044 CALL R6 1 + 0x8C180B16, // 0045 GETMET R6 R5 K22 + 0x54220095, // 0046 LDINT R8 150 + 0x7C180400, // 0047 CALL R6 2 + 0x8C180B17, // 0048 GETMET R6 R5 K23 + 0x542200FE, // 0049 LDINT R8 255 + 0x5824000A, // 004A LDCONST R9 K10 + 0x7C180600, // 004B CALL R6 3 + 0x8C180B18, // 004C GETMET R6 R5 K24 + 0x5C200800, // 004D MOVE R8 R4 + 0x5824000A, // 004E LDCONST R9 K10 + 0x7C180600, // 004F CALL R6 3 + 0x8C180B19, // 0050 GETMET R6 R5 K25 + 0xB8220400, // 0051 GETNGBL R8 K2 + 0x8820111A, // 0052 GETMBR R8 R8 K26 + 0x7C180400, // 0053 CALL R6 2 + 0x8C180B1B, // 0054 GETMET R6 R5 K27 + 0x5421FFF3, // 0055 LDINT R8 -12 + 0x7C180400, // 0056 CALL R6 2 + 0xB81A0400, // 0057 GETNGBL R6 K2 + 0x8C180D1C, // 0058 GETMET R6 R6 K28 + 0x5C200200, // 0059 MOVE R8 R1 + 0x7C180400, // 005A CALL R6 2 + 0x8C1C0D1D, // 005B GETMET R7 R6 K29 + 0x5C240800, // 005C MOVE R9 R4 + 0x5828000A, // 005D LDCONST R10 K10 + 0x7C1C0600, // 005E CALL R7 3 + 0x8C1C0D1E, // 005F GETMET R7 R6 K30 + 0x5824001F, // 0060 LDCONST R9 K31 + 0x7C1C0400, // 0061 CALL R7 2 + 0xB81E0400, // 0062 GETNGBL R7 K2 + 0x8C1C0F20, // 0063 GETMET R7 R7 K32 + 0x7C1C0200, // 0064 CALL R7 1 + 0x542200C7, // 0065 LDINT R8 200 + 0x281C0E08, // 0066 GE R7 R7 R8 + 0x781E0007, // 0067 JMPF R7 #0070 + 0x4C1C0000, // 0068 LDNIL R7 + 0x201C0407, // 0069 NE R7 R2 R7 + 0x781E0003, // 006A JMPF R7 #006F + 0x8C1C0D21, // 006B GETMET R7 R6 K33 + 0x5C240400, // 006C MOVE R9 R2 + 0x5828000A, // 006D LDCONST R10 K10 + 0x7C1C0600, // 006E CALL R7 3 + 0x70020006, // 006F JMP #0077 + 0x4C1C0000, // 0070 LDNIL R7 + 0x201C0607, // 0071 NE R7 R3 R7 + 0x781E0003, // 0072 JMPF R7 #0077 + 0x8C1C0D21, // 0073 GETMET R7 R6 K33 + 0x5C240600, // 0074 MOVE R9 R3 + 0x5828000A, // 0075 LDCONST R10 K10 + 0x7C1C0600, // 0076 CALL R7 3 + 0x8C1C0D19, // 0077 GETMET R7 R6 K25 + 0xB8260400, // 0078 GETNGBL R9 K2 + 0x8824131A, // 0079 GETMBR R9 R9 K26 + 0x7C1C0400, // 007A CALL R7 2 + 0x8C1C0D1B, // 007B GETMET R7 R6 K27 + 0x54260029, // 007C LDINT R9 42 + 0x7C1C0400, // 007D CALL R7 2 + 0x8C1C0122, // 007E GETMET R7 R0 K34 + 0x7C1C0200, // 007F CALL R7 1 + 0x4C200000, // 0080 LDNIL R8 + 0x6024000C, // 0081 GETGBL R9 G12 + 0x5C280E00, // 0082 MOVE R10 R7 + 0x7C240200, // 0083 CALL R9 1 + 0x2424130A, // 0084 GT R9 R9 K10 + 0x78260012, // 0085 JMPF R9 #0099 + 0xB8260400, // 0086 GETNGBL R9 K2 + 0x8C24131C, // 0087 GETMET R9 R9 K28 + 0x5C2C0200, // 0088 MOVE R11 R1 + 0x7C240400, // 0089 CALL R9 2 + 0x5C201200, // 008A MOVE R8 R9 + 0x8C241119, // 008B GETMET R9 R8 K25 + 0xB82E0400, // 008C GETNGBL R11 K2 + 0x882C1723, // 008D GETMBR R11 R11 K35 + 0x7C240400, // 008E CALL R9 2 + 0x8C24111D, // 008F GETMET R9 R8 K29 + 0xB82E0400, // 0090 GETNGBL R11 K2 + 0x8C2C1707, // 0091 GETMET R11 R11 K7 + 0x58340024, // 0092 LDCONST R13 K36 + 0x7C2C0400, // 0093 CALL R11 2 + 0x5830000A, // 0094 LDCONST R12 K10 + 0x7C240600, // 0095 CALL R9 3 + 0x8C24111E, // 0096 GETMET R9 R8 K30 + 0x5C2C0E00, // 0097 MOVE R11 R7 + 0x7C240400, // 0098 CALL R9 2 + 0xB8260400, // 0099 GETNGBL R9 K2 + 0x8C241325, // 009A GETMET R9 R9 K37 + 0x582C000A, // 009B LDCONST R11 K10 + 0x7C240400, // 009C CALL R9 2 + 0xB8260400, // 009D GETNGBL R9 K2 + 0x90264C01, // 009E SETMBR R9 K38 R1 + 0xB8264E00, // 009F GETNGBL R9 K39 + 0x8C241328, // 00A0 GETMET R9 R9 K40 + 0x542E1387, // 00A1 LDINT R11 5000 + 0xB8320400, // 00A2 GETNGBL R12 K2 + 0x88301929, // 00A3 GETMBR R12 R12 K41 + 0x7C240600, // 00A4 CALL R9 3 + 0x80000000, // 00A5 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_tasmota_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[33]) { /* constants */ + /* K0 */ be_nested_str(lv), + /* K1 */ be_nested_str(start), + /* K2 */ be_nested_str(splash_init), + /* K3 */ be_nested_str(splash_remove), + /* K4 */ be_nested_str(splash), + /* K5 */ be_nested_str(_splash), + /* K6 */ be_nested_str(font_montserrat), + /* K7 */ be_nested_str(montserrat_font), + /* K8 */ be_nested_str(font_seg7), + /* K9 */ be_nested_str(seg7_font), + /* K10 */ be_nested_str(font_embedded), + /* K11 */ be_nested_str(load_freetype_font), + /* K12 */ be_nested_str(register_button_encoder), + /* K13 */ be_nested_str(screenshot), + /* K14 */ be_nested_str(clock), + /* K15 */ be_nested_str(lv_clock), + /* K16 */ be_nested_str(clock_icon), + /* K17 */ be_nested_str(lv_clock_icon), + /* K18 */ be_nested_str(signal_arcs), + /* K19 */ be_nested_str(lv_signal_arcs), + /* K20 */ be_nested_str(signal_bars), + /* K21 */ be_nested_str(lv_signal_bars), + /* K22 */ be_nested_str(wifi_arcs_icon), + /* K23 */ be_nested_str(lv_wifi_arcs_icon), + /* K24 */ be_nested_str(wifi_arcs), + /* K25 */ be_nested_str(lv_wifi_arcs), + /* K26 */ be_nested_str(wifi_bars_icon), + /* K27 */ be_nested_str(lv_wifi_bars_icon), + /* K28 */ be_nested_str(wifi_bars), + /* K29 */ be_nested_str(lv_wifi_bars), + /* K30 */ be_nested_str(tasmota), + /* K31 */ be_nested_str(get_option), + /* K32 */ be_const_int(0), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[53]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x90060202, // 0002 SETMBR R1 K1 R2 + 0x88080102, // 0003 GETMBR R2 R0 K2 + 0x90060402, // 0004 SETMBR R1 K2 R2 + 0x88080103, // 0005 GETMBR R2 R0 K3 + 0x90060602, // 0006 SETMBR R1 K3 R2 + 0x88080104, // 0007 GETMBR R2 R0 K4 + 0x90060802, // 0008 SETMBR R1 K4 R2 + 0x4C080000, // 0009 LDNIL R2 + 0x90060A02, // 000A SETMBR R1 K5 R2 + 0x88080106, // 000B GETMBR R2 R0 K6 + 0x90060C02, // 000C SETMBR R1 K6 R2 + 0x88080106, // 000D GETMBR R2 R0 K6 + 0x90060E02, // 000E SETMBR R1 K7 R2 + 0x88080108, // 000F GETMBR R2 R0 K8 + 0x90061002, // 0010 SETMBR R1 K8 R2 + 0x88080108, // 0011 GETMBR R2 R0 K8 + 0x90061202, // 0012 SETMBR R1 K9 R2 + 0x8808010A, // 0013 GETMBR R2 R0 K10 + 0x90061402, // 0014 SETMBR R1 K10 R2 + 0x8808010B, // 0015 GETMBR R2 R0 K11 + 0x90061602, // 0016 SETMBR R1 K11 R2 + 0x8808010C, // 0017 GETMBR R2 R0 K12 + 0x90061802, // 0018 SETMBR R1 K12 R2 + 0x8808010D, // 0019 GETMBR R2 R0 K13 + 0x90061A02, // 001A SETMBR R1 K13 R2 + 0xB80A1E00, // 001B GETNGBL R2 K15 + 0x90061C02, // 001C SETMBR R1 K14 R2 + 0xB80A2200, // 001D GETNGBL R2 K17 + 0x90062002, // 001E SETMBR R1 K16 R2 + 0xB80A2600, // 001F GETNGBL R2 K19 + 0x90062402, // 0020 SETMBR R1 K18 R2 + 0xB80A2A00, // 0021 GETNGBL R2 K21 + 0x90062802, // 0022 SETMBR R1 K20 R2 + 0xB80A2E00, // 0023 GETNGBL R2 K23 + 0x90062C02, // 0024 SETMBR R1 K22 R2 + 0xB80A3200, // 0025 GETNGBL R2 K25 + 0x90063002, // 0026 SETMBR R1 K24 R2 + 0xB80A3600, // 0027 GETNGBL R2 K27 + 0x90063402, // 0028 SETMBR R1 K26 R2 + 0xB80A3A00, // 0029 GETNGBL R2 K29 + 0x90063802, // 002A SETMBR R1 K28 R2 + 0xB80A3C00, // 002B GETNGBL R2 K30 + 0x8C08051F, // 002C GETMET R2 R2 K31 + 0x54120086, // 002D LDINT R4 135 + 0x7C080400, // 002E CALL R2 2 + 0x1C080520, // 002F EQ R2 R2 K32 + 0x780A0001, // 0030 JMPF R2 #0033 + 0x8C080302, // 0031 GETMET R2 R1 K2 + 0x7C080200, // 0032 CALL R2 1 + 0x4C080000, // 0033 LDNIL R2 + 0x80040400, // 0034 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified module: lv_tasmota +********************************************************************/ +be_local_module(lv_tasmota, + "lv_tasmota", + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(lv_tasmota_init_closure) }, + { be_const_key(splash_init, -1), be_const_closure(lv_tasmota_splash_init_closure) }, + { be_const_key(splash, -1), be_const_closure(lv_tasmota_splash_closure) }, + { be_const_key(splash_remove, 0), be_const_closure(lv_tasmota_splash_remove_closure) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(lv_tasmota); +/********************************************************************/ +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_lv_tasmota_widgets.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_lv_tasmota_widgets.h new file mode 100644 index 000000000..dcd6247f9 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_lv_tasmota_widgets.h @@ -0,0 +1,1748 @@ +/* Solidification of lv_tasmota_widgets.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: set_time +********************************************************************/ +be_local_closure(lv_clock_set_time, /* name */ + be_nested_proto( + 11, /* nstack */ + 4, /* 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(hour), + /* K2 */ be_nested_str(minute), + /* K3 */ be_nested_str(sec), + /* K4 */ be_nested_str(format), + /* K5 */ be_nested_str(_X2502d_X25s_X2502d), + /* K6 */ be_const_int(2), + /* K7 */ be_nested_str(_X3A), + /* K8 */ be_nested_str(_X20), + /* K9 */ be_nested_str(set_text), + }), + &be_const_str_set_time, + &be_const_str_solidified, + ( &(const binstruction[27]) { /* code */ + 0xA4120000, // 0000 IMPORT R4 K0 + 0x88140101, // 0001 GETMBR R5 R0 K1 + 0x20140205, // 0002 NE R5 R1 R5 + 0x74160005, // 0003 JMPT R5 #000A + 0x88140102, // 0004 GETMBR R5 R0 K2 + 0x20140405, // 0005 NE R5 R2 R5 + 0x74160002, // 0006 JMPT R5 #000A + 0x88140103, // 0007 GETMBR R5 R0 K3 + 0x20140605, // 0008 NE R5 R3 R5 + 0x7816000F, // 0009 JMPF R5 #001A + 0x8C140904, // 000A GETMET R5 R4 K4 + 0x581C0005, // 000B LDCONST R7 K5 + 0x5C200200, // 000C MOVE R8 R1 + 0x10240706, // 000D MOD R9 R3 K6 + 0x78260001, // 000E JMPF R9 #0011 + 0x58240007, // 000F LDCONST R9 K7 + 0x70020000, // 0010 JMP #0012 + 0x58240008, // 0011 LDCONST R9 K8 + 0x5C280400, // 0012 MOVE R10 R2 + 0x7C140A00, // 0013 CALL R5 5 + 0x90020201, // 0014 SETMBR R0 K1 R1 + 0x90020402, // 0015 SETMBR R0 K2 R2 + 0x90020603, // 0016 SETMBR R0 K3 R3 + 0x8C180109, // 0017 GETMET R6 R0 K9 + 0x5C200A00, // 0018 MOVE R8 R5 + 0x7C180400, // 0019 CALL R6 2 + 0x80000000, // 001A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(lv_clock_every_second, /* 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[ 9]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(time_dump), + /* K2 */ be_nested_str(rtc), + /* K3 */ be_nested_str(local), + /* K4 */ be_nested_str(year), + /* K5 */ be_nested_str(set_time), + /* K6 */ be_nested_str(hour), + /* K7 */ be_nested_str(min), + /* K8 */ be_nested_str(sec), + }), + &be_const_str_every_second, + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0xB80E0000, // 0002 GETNGBL R3 K0 + 0x8C0C0702, // 0003 GETMET R3 R3 K2 + 0x7C0C0200, // 0004 CALL R3 1 + 0x940C0703, // 0005 GETIDX R3 R3 K3 + 0x7C040400, // 0006 CALL R1 2 + 0x94080304, // 0007 GETIDX R2 R1 K4 + 0x540E07B1, // 0008 LDINT R3 1970 + 0x20080403, // 0009 NE R2 R2 R3 + 0x780A0004, // 000A JMPF R2 #0010 + 0x8C080105, // 000B GETMET R2 R0 K5 + 0x94100306, // 000C GETIDX R4 R1 K6 + 0x94140307, // 000D GETIDX R5 R1 K7 + 0x94180308, // 000E GETIDX R6 R1 K8 + 0x7C080800, // 000F CALL R2 4 + 0x80000000, // 0010 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_clock_init, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + 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(before_del), + }), + &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[13]) { /* constants */ + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(lv), + /* K2 */ be_nested_str(seg7_font), + /* K3 */ be_nested_str(set_style_text_font), + /* K4 */ be_nested_str(PART_MAIN), + /* K5 */ be_nested_str(STATE_DEFAULT), + /* K6 */ be_nested_str(set_text), + /* K7 */ be_nested_str(_X2D_X2D_X3A_X2D_X2D), + /* K8 */ be_nested_str(add_event_cb), + /* K9 */ be_nested_str(EVENT_DELETE), + /* K10 */ be_const_int(0), + /* K11 */ be_nested_str(tasmota), + /* K12 */ be_nested_str(add_driver), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[36]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0xB80A0200, // 0006 GETNGBL R2 K1 + 0x8C080502, // 0007 GETMET R2 R2 K2 + 0x5412000F, // 0008 LDINT R4 16 + 0x7C080400, // 0009 CALL R2 2 + 0x4C0C0000, // 000A LDNIL R3 + 0x200C0403, // 000B NE R3 R2 R3 + 0x780E0007, // 000C JMPF R3 #0015 + 0x8C0C0103, // 000D GETMET R3 R0 K3 + 0x5C140400, // 000E MOVE R5 R2 + 0xB81A0200, // 000F GETNGBL R6 K1 + 0x88180D04, // 0010 GETMBR R6 R6 K4 + 0xB81E0200, // 0011 GETNGBL R7 K1 + 0x881C0F05, // 0012 GETMBR R7 R7 K5 + 0x30180C07, // 0013 OR R6 R6 R7 + 0x7C0C0600, // 0014 CALL R3 3 + 0x8C0C0106, // 0015 GETMET R3 R0 K6 + 0x58140007, // 0016 LDCONST R5 K7 + 0x7C0C0400, // 0017 CALL R3 2 + 0x8C0C0108, // 0018 GETMET R3 R0 K8 + 0x84140000, // 0019 CLOSURE R5 P0 + 0xB81A0200, // 001A GETNGBL R6 K1 + 0x88180D09, // 001B GETMBR R6 R6 K9 + 0x581C000A, // 001C LDCONST R7 K10 + 0x7C0C0800, // 001D CALL R3 4 + 0xB80E1600, // 001E GETNGBL R3 K11 + 0x8C0C070C, // 001F GETMET R3 R3 K12 + 0x5C140000, // 0020 MOVE R5 R0 + 0x7C0C0400, // 0021 CALL R3 2 + 0xA0000000, // 0022 CLOSE R0 + 0x80000000, // 0023 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: before_del +********************************************************************/ +be_local_closure(lv_clock_before_del, /* 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(tasmota), + /* K1 */ be_nested_str(remove_driver), + }), + &be_const_str_before_del, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C040400, // 0003 CALL R1 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_clock +********************************************************************/ +extern const bclass be_class_lv_label; +be_local_class(lv_clock, + 3, + &be_class_lv_label, + be_nested_map(7, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(sec, -1), be_const_var(2) }, + { be_const_key(hour, -1), be_const_var(0) }, + { be_const_key(before_del, 6), be_const_closure(lv_clock_before_del_closure) }, + { be_const_key(every_second, -1), be_const_closure(lv_clock_every_second_closure) }, + { be_const_key(minute, -1), be_const_var(1) }, + { be_const_key(set_time, 2), be_const_closure(lv_clock_set_time_closure) }, + { be_const_key(init, -1), be_const_closure(lv_clock_init_closure) }, + })), + (bstring*) &be_const_str_lv_clock +); +/*******************************************************************/ + +void be_load_lv_clock_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_clock); + be_setglobal(vm, "lv_clock"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_clock_icon_init, /* name */ + be_nested_proto( + 10, /* nstack */ + 2, /* 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(init), + /* K1 */ be_nested_str(get_height), + /* K2 */ be_nested_str(refr_size), + /* K3 */ be_nested_str(get_width), + /* K4 */ be_nested_str(set_y), + /* K5 */ be_const_int(2), + /* K6 */ be_nested_str(get_style_pad_right), + /* K7 */ be_nested_str(lv), + /* K8 */ be_nested_str(PART_MAIN), + /* K9 */ be_nested_str(STATE_DEFAULT), + /* K10 */ be_nested_str(set_x), + /* K11 */ be_const_int(3), + /* K12 */ be_nested_str(set_style_pad_right), + /* K13 */ be_nested_str(set_style_bg_color), + /* K14 */ be_nested_str(color), + /* K15 */ be_nested_str(COLOR_BLACK), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[60]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x4C080000, // 0006 LDNIL R2 + 0x20080202, // 0007 NE R2 R1 R2 + 0x780A0031, // 0008 JMPF R2 #003B + 0x8C080301, // 0009 GETMET R2 R1 K1 + 0x7C080200, // 000A CALL R2 1 + 0x8C0C0102, // 000B GETMET R3 R0 K2 + 0x7C0C0200, // 000C CALL R3 1 + 0x8C0C0103, // 000D GETMET R3 R0 K3 + 0x7C0C0200, // 000E CALL R3 1 + 0x8C100104, // 000F GETMET R4 R0 K4 + 0x8C180301, // 0010 GETMET R6 R1 K1 + 0x7C180200, // 0011 CALL R6 1 + 0x8C1C0101, // 0012 GETMET R7 R0 K1 + 0x7C1C0200, // 0013 CALL R7 1 + 0x04180C07, // 0014 SUB R6 R6 R7 + 0x0C180D05, // 0015 DIV R6 R6 K5 + 0x7C100400, // 0016 CALL R4 2 + 0x8C100306, // 0017 GETMET R4 R1 K6 + 0xB81A0E00, // 0018 GETNGBL R6 K7 + 0x88180D08, // 0019 GETMBR R6 R6 K8 + 0xB81E0E00, // 001A GETNGBL R7 K7 + 0x881C0F09, // 001B GETMBR R7 R7 K9 + 0x30180C07, // 001C OR R6 R6 R7 + 0x7C100400, // 001D CALL R4 2 + 0x8C14010A, // 001E GETMET R5 R0 K10 + 0x8C1C0303, // 001F GETMET R7 R1 K3 + 0x7C1C0200, // 0020 CALL R7 1 + 0x041C0E03, // 0021 SUB R7 R7 R3 + 0x041C0E04, // 0022 SUB R7 R7 R4 + 0x041C0F0B, // 0023 SUB R7 R7 K11 + 0x7C140400, // 0024 CALL R5 2 + 0x8C14030C, // 0025 GETMET R5 R1 K12 + 0x001C0803, // 0026 ADD R7 R4 R3 + 0x54220005, // 0027 LDINT R8 6 + 0x001C0E08, // 0028 ADD R7 R7 R8 + 0xB8220E00, // 0029 GETNGBL R8 K7 + 0x88201108, // 002A GETMBR R8 R8 K8 + 0xB8260E00, // 002B GETNGBL R9 K7 + 0x88241309, // 002C GETMBR R9 R9 K9 + 0x30201009, // 002D OR R8 R8 R9 + 0x7C140600, // 002E CALL R5 3 + 0x8C14010D, // 002F GETMET R5 R0 K13 + 0xB81E0E00, // 0030 GETNGBL R7 K7 + 0x8C1C0F0E, // 0031 GETMET R7 R7 K14 + 0xB8260E00, // 0032 GETNGBL R9 K7 + 0x8824130F, // 0033 GETMBR R9 R9 K15 + 0x7C1C0400, // 0034 CALL R7 2 + 0xB8220E00, // 0035 GETNGBL R8 K7 + 0x88201108, // 0036 GETMBR R8 R8 K8 + 0xB8260E00, // 0037 GETNGBL R9 K7 + 0x88241309, // 0038 GETMBR R9 R9 K9 + 0x30201009, // 0039 OR R8 R8 R9 + 0x7C140600, // 003A CALL R5 3 + 0x80000000, // 003B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_clock_icon +********************************************************************/ +extern const bclass be_class_lv_clock; +be_local_class(lv_clock_icon, + 0, + &be_class_lv_clock, + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(lv_clock_icon_init_closure) }, + })), + (bstring*) &be_const_str_lv_clock_icon +); +/*******************************************************************/ + +void be_load_lv_clock_icon_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_clock_icon); + be_setglobal(vm, "lv_clock_icon"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified function: set_percentage +********************************************************************/ +be_local_closure(lv_signal_arcs_set_percentage, /* 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(percentage), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(invalidate), + }), + &be_const_str_set_percentage, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x540E0018, // 0001 LDINT R3 25 + 0x0C080403, // 0002 DIV R2 R2 R3 + 0x540E0063, // 0003 LDINT R3 100 + 0x240C0203, // 0004 GT R3 R1 R3 + 0x780E0000, // 0005 JMPF R3 #0007 + 0x54060063, // 0006 LDINT R1 100 + 0x140C0301, // 0007 LT R3 R1 K1 + 0x780E0000, // 0008 JMPF R3 #000A + 0x58040001, // 0009 LDCONST R1 K1 + 0x90020001, // 000A SETMBR R0 K0 R1 + 0x540E0018, // 000B LDINT R3 25 + 0x0C0C0203, // 000C DIV R3 R1 R3 + 0x200C0403, // 000D NE R3 R2 R3 + 0x780E0001, // 000E JMPF R3 #0011 + 0x8C0C0102, // 000F GETMET R3 R0 K2 + 0x7C0C0200, // 0010 CALL R3 1 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_signal_arcs_init, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 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(_lvgl), + /* K1 */ be_nested_str(create_custom_widget), + /* K2 */ be_nested_str(percentage), + /* K3 */ be_nested_str(p1), + /* K4 */ be_nested_str(lv), + /* K5 */ be_nested_str(point), + /* K6 */ be_nested_str(p2), + /* K7 */ be_nested_str(area), + /* K8 */ be_nested_str(arc_dsc), + /* K9 */ be_nested_str(draw_arc_dsc), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100000, // 0002 MOVE R4 R0 + 0x5C140200, // 0003 MOVE R5 R1 + 0x7C080600, // 0004 CALL R2 3 + 0x540A0063, // 0005 LDINT R2 100 + 0x90020402, // 0006 SETMBR R0 K2 R2 + 0xB80A0800, // 0007 GETNGBL R2 K4 + 0x8C080505, // 0008 GETMET R2 R2 K5 + 0x7C080200, // 0009 CALL R2 1 + 0x90020602, // 000A SETMBR R0 K3 R2 + 0xB80A0800, // 000B GETNGBL R2 K4 + 0x8C080505, // 000C GETMET R2 R2 K5 + 0x7C080200, // 000D CALL R2 1 + 0x90020C02, // 000E SETMBR R0 K6 R2 + 0xB80A0800, // 000F GETNGBL R2 K4 + 0x8C080507, // 0010 GETMET R2 R2 K7 + 0x7C080200, // 0011 CALL R2 1 + 0x90020E02, // 0012 SETMBR R0 K7 R2 + 0xB80A0800, // 0013 GETNGBL R2 K4 + 0x8C080509, // 0014 GETMET R2 R2 K9 + 0x7C080200, // 0015 CALL R2 1 + 0x90021002, // 0016 SETMBR R0 K8 R2 + 0x80000000, // 0017 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: widget_event +********************************************************************/ +be_local_closure(lv_signal_arcs_widget_event, /* name */ + be_nested_proto( + 27, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_const_int(1), + }), + &be_const_str_atleast1, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x28040100, // 0000 GE R1 R0 K0 + 0x78060001, // 0001 JMPF R1 #0004 + 0x80040000, // 0002 RET 1 R0 + 0x70020000, // 0003 JMP #0005 + 0x80060000, // 0004 RET 1 K0 + 0x80000000, // 0005 RET 0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[35]) { /* constants */ + /* K0 */ be_nested_str(lv), + /* K1 */ be_nested_str(obj_event_base), + /* K2 */ be_nested_str(RES_OK), + /* K3 */ be_nested_str(code), + /* K4 */ be_nested_str(math), + /* K5 */ be_nested_str(get_height), + /* K6 */ be_nested_str(get_width), + /* K7 */ be_const_int(2), + /* K8 */ be_const_int(3), + /* K9 */ be_nested_str(EVENT_DRAW_MAIN), + /* K10 */ be_nested_str(draw_ctx), + /* K11 */ be_nested_str(param), + /* K12 */ be_nested_str(get_coords), + /* K13 */ be_nested_str(area), + /* K14 */ be_nested_str(x1), + /* K15 */ be_nested_str(y1), + /* K16 */ be_nested_str(draw_arc_dsc_init), + /* K17 */ be_nested_str(arc_dsc), + /* K18 */ be_nested_str(init_draw_arc_dsc), + /* K19 */ be_nested_str(PART_MAIN), + /* K20 */ be_nested_str(rounded), + /* K21 */ be_const_int(1), + /* K22 */ be_nested_str(width), + /* K23 */ be_nested_str(get_style_line_color), + /* K24 */ be_nested_str(STATE_DEFAULT), + /* K25 */ be_nested_str(get_style_bg_color), + /* K26 */ be_nested_str(deg), + /* K27 */ be_nested_str(acos), + /* K28 */ be_nested_str(p1), + /* K29 */ be_nested_str(x), + /* K30 */ be_nested_str(y), + /* K31 */ be_nested_str(color), + /* K32 */ be_nested_str(percentage), + /* K33 */ be_nested_str(draw_arc), + /* K34 */ be_const_int(0), + }), + &be_const_str_widget_event, + &be_const_str_solidified, + ( &(const binstruction[171]) { /* code */ + 0xB80E0000, // 0000 GETNGBL R3 K0 + 0x8C0C0701, // 0001 GETMET R3 R3 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x5C180400, // 0003 MOVE R6 R2 + 0x7C0C0600, // 0004 CALL R3 3 + 0xB8120000, // 0005 GETNGBL R4 K0 + 0x88100902, // 0006 GETMBR R4 R4 K2 + 0x200C0604, // 0007 NE R3 R3 R4 + 0x780E0000, // 0008 JMPF R3 #000A + 0x80000600, // 0009 RET 0 + 0x880C0503, // 000A GETMBR R3 R2 K3 + 0xA4120800, // 000B IMPORT R4 K4 + 0x84140000, // 000C CLOSURE R5 P0 + 0x8C180105, // 000D GETMET R6 R0 K5 + 0x7C180200, // 000E CALL R6 1 + 0x8C1C0106, // 000F GETMET R7 R0 K6 + 0x7C1C0200, // 0010 CALL R7 1 + 0x5C200A00, // 0011 MOVE R8 R5 + 0x54260007, // 0012 LDINT R9 8 + 0x0C240C09, // 0013 DIV R9 R6 R9 + 0x7C200200, // 0014 CALL R8 1 + 0x5C240A00, // 0015 MOVE R9 R5 + 0x08281107, // 0016 MUL R10 R8 K7 + 0x04280C0A, // 0017 SUB R10 R6 R10 + 0x0C281508, // 0018 DIV R10 R10 K8 + 0x7C240200, // 0019 CALL R9 1 + 0x0C281307, // 001A DIV R10 R9 K7 + 0xB82E0000, // 001B GETNGBL R11 K0 + 0x882C1709, // 001C GETMBR R11 R11 K9 + 0x1C2C060B, // 001D EQ R11 R3 R11 + 0x782E008A, // 001E JMPF R11 #00AA + 0xB82E0000, // 001F GETNGBL R11 K0 + 0x8C2C170A, // 0020 GETMET R11 R11 K10 + 0x8834050B, // 0021 GETMBR R13 R2 K11 + 0x7C2C0400, // 0022 CALL R11 2 + 0x8C30010C, // 0023 GETMET R12 R0 K12 + 0x8838010D, // 0024 GETMBR R14 R0 K13 + 0x7C300400, // 0025 CALL R12 2 + 0x8830010D, // 0026 GETMBR R12 R0 K13 + 0x8830190E, // 0027 GETMBR R12 R12 K14 + 0x8834010D, // 0028 GETMBR R13 R0 K13 + 0x88341B0F, // 0029 GETMBR R13 R13 K15 + 0xB83A0000, // 002A GETNGBL R14 K0 + 0x8C381D10, // 002B GETMET R14 R14 K16 + 0x88400111, // 002C GETMBR R16 R0 K17 + 0x7C380400, // 002D CALL R14 2 + 0x8C380112, // 002E GETMET R14 R0 K18 + 0xB8420000, // 002F GETNGBL R16 K0 + 0x88402113, // 0030 GETMBR R16 R16 K19 + 0x88440111, // 0031 GETMBR R17 R0 K17 + 0x7C380600, // 0032 CALL R14 3 + 0x88380111, // 0033 GETMBR R14 R0 K17 + 0x903A2915, // 0034 SETMBR R14 K20 K21 + 0x88380111, // 0035 GETMBR R14 R0 K17 + 0x083C1308, // 0036 MUL R15 R9 K8 + 0x003C1F15, // 0037 ADD R15 R15 K21 + 0x54420003, // 0038 LDINT R16 4 + 0x0C3C1E10, // 0039 DIV R15 R15 R16 + 0x903A2C0F, // 003A SETMBR R14 K22 R15 + 0x8C380117, // 003B GETMET R14 R0 K23 + 0xB8420000, // 003C GETNGBL R16 K0 + 0x88402113, // 003D GETMBR R16 R16 K19 + 0xB8460000, // 003E GETNGBL R17 K0 + 0x88442318, // 003F GETMBR R17 R17 K24 + 0x30402011, // 0040 OR R16 R16 R17 + 0x7C380400, // 0041 CALL R14 2 + 0x8C3C0119, // 0042 GETMET R15 R0 K25 + 0xB8460000, // 0043 GETNGBL R17 K0 + 0x88442313, // 0044 GETMBR R17 R17 K19 + 0xB84A0000, // 0045 GETNGBL R18 K0 + 0x88482518, // 0046 GETMBR R18 R18 K24 + 0x30442212, // 0047 OR R17 R17 R18 + 0x7C3C0400, // 0048 CALL R15 2 + 0x04400C09, // 0049 SUB R16 R6 R9 + 0x0C440F07, // 004A DIV R17 R7 K7 + 0x0444220A, // 004B SUB R17 R17 R10 + 0x60480009, // 004C GETGBL R18 G9 + 0x544E0059, // 004D LDINT R19 90 + 0x8C50091A, // 004E GETMET R20 R4 K26 + 0x8C58091B, // 004F GETMET R22 R4 K27 + 0x6060000A, // 0050 GETGBL R24 G10 + 0x5C642200, // 0051 MOVE R25 R17 + 0x7C600200, // 0052 CALL R24 1 + 0x6064000A, // 0053 GETGBL R25 G10 + 0x5C682000, // 0054 MOVE R26 R16 + 0x7C640200, // 0055 CALL R25 1 + 0x0C603019, // 0056 DIV R24 R24 R25 + 0x7C580400, // 0057 CALL R22 2 + 0x7C500400, // 0058 CALL R20 2 + 0x044C2614, // 0059 SUB R19 R19 R20 + 0x7C480200, // 005A CALL R18 1 + 0x544E002C, // 005B LDINT R19 45 + 0x244C2413, // 005C GT R19 R18 R19 + 0x784E0000, // 005D JMPF R19 #005F + 0x544A002C, // 005E LDINT R18 45 + 0x884C011C, // 005F GETMBR R19 R0 K28 + 0x0C500F07, // 0060 DIV R20 R7 K7 + 0x00501814, // 0061 ADD R20 R12 R20 + 0x904E3A14, // 0062 SETMBR R19 K29 R20 + 0x884C011C, // 0063 GETMBR R19 R0 K28 + 0x00501A06, // 0064 ADD R20 R13 R6 + 0x04502915, // 0065 SUB R20 R20 K21 + 0x0450280A, // 0066 SUB R20 R20 R10 + 0x904E3C14, // 0067 SETMBR R19 K30 R20 + 0x884C0111, // 0068 GETMBR R19 R0 K17 + 0x88500120, // 0069 GETMBR R20 R0 K32 + 0x54560018, // 006A LDINT R21 25 + 0x28502815, // 006B GE R20 R20 R21 + 0x78520001, // 006C JMPF R20 #006F + 0x5C501C00, // 006D MOVE R20 R14 + 0x70020000, // 006E JMP #0070 + 0x5C501E00, // 006F MOVE R20 R15 + 0x904E3E14, // 0070 SETMBR R19 K31 R20 + 0xB84E0000, // 0071 GETNGBL R19 K0 + 0x8C4C2721, // 0072 GETMET R19 R19 K33 + 0x5C541600, // 0073 MOVE R21 R11 + 0x88580111, // 0074 GETMBR R22 R0 K17 + 0x885C011C, // 0075 GETMBR R23 R0 K28 + 0x00601208, // 0076 ADD R24 R9 R8 + 0x08624418, // 0077 MUL R24 K34 R24 + 0x0060300A, // 0078 ADD R24 R24 R10 + 0x58640022, // 0079 LDCONST R25 K34 + 0x546A0167, // 007A LDINT R26 360 + 0x7C4C0E00, // 007B CALL R19 7 + 0x884C0111, // 007C GETMBR R19 R0 K17 + 0x88500120, // 007D GETMBR R20 R0 K32 + 0x54560031, // 007E LDINT R21 50 + 0x28502815, // 007F GE R20 R20 R21 + 0x78520001, // 0080 JMPF R20 #0083 + 0x5C501C00, // 0081 MOVE R20 R14 + 0x70020000, // 0082 JMP #0084 + 0x5C501E00, // 0083 MOVE R20 R15 + 0x904E3E14, // 0084 SETMBR R19 K31 R20 + 0xB84E0000, // 0085 GETNGBL R19 K0 + 0x8C4C2721, // 0086 GETMET R19 R19 K33 + 0x5C541600, // 0087 MOVE R21 R11 + 0x88580111, // 0088 GETMBR R22 R0 K17 + 0x885C011C, // 0089 GETMBR R23 R0 K28 + 0x00601208, // 008A ADD R24 R9 R8 + 0x08622A18, // 008B MUL R24 K21 R24 + 0x0060300A, // 008C ADD R24 R24 R10 + 0x04603115, // 008D SUB R24 R24 K21 + 0x5466010D, // 008E LDINT R25 270 + 0x04643212, // 008F SUB R25 R25 R18 + 0x546A010D, // 0090 LDINT R26 270 + 0x00683412, // 0091 ADD R26 R26 R18 + 0x7C4C0E00, // 0092 CALL R19 7 + 0x884C0111, // 0093 GETMBR R19 R0 K17 + 0x88500120, // 0094 GETMBR R20 R0 K32 + 0x5456004A, // 0095 LDINT R21 75 + 0x28502815, // 0096 GE R20 R20 R21 + 0x78520001, // 0097 JMPF R20 #009A + 0x5C501C00, // 0098 MOVE R20 R14 + 0x70020000, // 0099 JMP #009B + 0x5C501E00, // 009A MOVE R20 R15 + 0x904E3E14, // 009B SETMBR R19 K31 R20 + 0xB84E0000, // 009C GETNGBL R19 K0 + 0x8C4C2721, // 009D GETMET R19 R19 K33 + 0x5C541600, // 009E MOVE R21 R11 + 0x88580111, // 009F GETMBR R22 R0 K17 + 0x885C011C, // 00A0 GETMBR R23 R0 K28 + 0x00601208, // 00A1 ADD R24 R9 R8 + 0x08620E18, // 00A2 MUL R24 K7 R24 + 0x0060300A, // 00A3 ADD R24 R24 R10 + 0x04603107, // 00A4 SUB R24 R24 K7 + 0x5466010D, // 00A5 LDINT R25 270 + 0x04643212, // 00A6 SUB R25 R25 R18 + 0x546A010D, // 00A7 LDINT R26 270 + 0x00683412, // 00A8 ADD R26 R26 R18 + 0x7C4C0E00, // 00A9 CALL R19 7 + 0x80000000, // 00AA RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_percentage +********************************************************************/ +be_local_closure(lv_signal_arcs_get_percentage, /* 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(percentage), + }), + &be_const_str_get_percentage, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_signal_arcs +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_signal_arcs, + 5, + &be_class_lv_obj, + be_nested_map(9, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(percentage, -1), be_const_var(0) }, + { be_const_key(area, 4), be_const_var(3) }, + { be_const_key(p2, -1), be_const_var(2) }, + { be_const_key(get_percentage, -1), be_const_closure(lv_signal_arcs_get_percentage_closure) }, + { be_const_key(p1, -1), be_const_var(1) }, + { be_const_key(arc_dsc, -1), be_const_var(4) }, + { be_const_key(init, 5), be_const_closure(lv_signal_arcs_init_closure) }, + { be_const_key(widget_event, -1), be_const_closure(lv_signal_arcs_widget_event_closure) }, + { be_const_key(set_percentage, 3), be_const_closure(lv_signal_arcs_set_percentage_closure) }, + })), + (bstring*) &be_const_str_lv_signal_arcs +); +/*******************************************************************/ + +void be_load_lv_signal_arcs_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_signal_arcs); + be_setglobal(vm, "lv_signal_arcs"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified function: before_del +********************************************************************/ +be_local_closure(lv_wifi_arcs_before_del, /* 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(tasmota), + /* K1 */ be_nested_str(remove_driver), + }), + &be_const_str_before_del, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C040400, // 0003 CALL R1 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_wifi_arcs_init, /* 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(init), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(add_driver), + /* K3 */ be_nested_str(set_percentage), + /* K4 */ be_const_int(0), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0xB80A0200, // 0006 GETNGBL R2 K1 + 0x8C080502, // 0007 GETMET R2 R2 K2 + 0x5C100000, // 0008 MOVE R4 R0 + 0x7C080400, // 0009 CALL R2 2 + 0x8C080103, // 000A GETMET R2 R0 K3 + 0x58100004, // 000B LDCONST R4 K4 + 0x7C080400, // 000C CALL R2 2 + 0x80000000, // 000D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(lv_wifi_arcs_every_second, /* 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[ 7]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(wifi), + /* K2 */ be_nested_str(find), + /* K3 */ be_nested_str(quality), + /* K4 */ be_nested_str(ip), + /* K5 */ be_nested_str(set_percentage), + /* K6 */ be_const_int(0), + }), + &be_const_str_every_second, + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x8C080302, // 0003 GETMET R2 R1 K2 + 0x58100003, // 0004 LDCONST R4 K3 + 0x7C080400, // 0005 CALL R2 2 + 0x8C0C0302, // 0006 GETMET R3 R1 K2 + 0x58140004, // 0007 LDCONST R5 K4 + 0x7C0C0400, // 0008 CALL R3 2 + 0x4C100000, // 0009 LDNIL R4 + 0x1C100604, // 000A EQ R4 R3 R4 + 0x78120003, // 000B JMPF R4 #0010 + 0x8C100105, // 000C GETMET R4 R0 K5 + 0x58180006, // 000D LDCONST R6 K6 + 0x7C100400, // 000E CALL R4 2 + 0x70020005, // 000F JMP #0016 + 0x4C100000, // 0010 LDNIL R4 + 0x20100404, // 0011 NE R4 R2 R4 + 0x78120002, // 0012 JMPF R4 #0016 + 0x8C100105, // 0013 GETMET R4 R0 K5 + 0x5C180400, // 0014 MOVE R6 R2 + 0x7C100400, // 0015 CALL R4 2 + 0x80000000, // 0016 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_wifi_arcs +********************************************************************/ +extern const bclass be_class_lv_signal_arcs; +be_local_class(lv_wifi_arcs, + 0, + &be_class_lv_signal_arcs, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(before_del, 1), be_const_closure(lv_wifi_arcs_before_del_closure) }, + { be_const_key(every_second, 2), be_const_closure(lv_wifi_arcs_every_second_closure) }, + { be_const_key(init, -1), be_const_closure(lv_wifi_arcs_init_closure) }, + })), + (bstring*) &be_const_str_lv_wifi_arcs +); +/*******************************************************************/ + +void be_load_lv_wifi_arcs_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_wifi_arcs); + be_setglobal(vm, "lv_wifi_arcs"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_wifi_arcs_icon_init, /* name */ + be_nested_proto( + 10, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[18]) { /* constants */ + /* K0 */ be_nested_str(init), + /* K1 */ be_nested_str(set_style_line_color), + /* K2 */ be_nested_str(lv), + /* K3 */ be_nested_str(color), + /* K4 */ be_nested_str(COLOR_WHITE), + /* K5 */ be_nested_str(PART_MAIN), + /* K6 */ be_nested_str(STATE_DEFAULT), + /* K7 */ be_nested_str(set_style_bg_color), + /* K8 */ be_nested_str(COLOR_BLACK), + /* K9 */ be_nested_str(get_height), + /* K10 */ be_nested_str(get_style_pad_right), + /* K11 */ be_nested_str(set_height), + /* K12 */ be_const_int(3), + /* K13 */ be_nested_str(set_width), + /* K14 */ be_nested_str(set_x), + /* K15 */ be_nested_str(get_width), + /* K16 */ be_nested_str(set_style_pad_right), + /* K17 */ be_const_int(1), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[67]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x8C080101, // 0006 GETMET R2 R0 K1 + 0xB8120400, // 0007 GETNGBL R4 K2 + 0x8C100903, // 0008 GETMET R4 R4 K3 + 0xB81A0400, // 0009 GETNGBL R6 K2 + 0x88180D04, // 000A GETMBR R6 R6 K4 + 0x7C100400, // 000B CALL R4 2 + 0xB8160400, // 000C GETNGBL R5 K2 + 0x88140B05, // 000D GETMBR R5 R5 K5 + 0xB81A0400, // 000E GETNGBL R6 K2 + 0x88180D06, // 000F GETMBR R6 R6 K6 + 0x30140A06, // 0010 OR R5 R5 R6 + 0x7C080600, // 0011 CALL R2 3 + 0x8C080107, // 0012 GETMET R2 R0 K7 + 0xB8120400, // 0013 GETNGBL R4 K2 + 0x8C100903, // 0014 GETMET R4 R4 K3 + 0xB81A0400, // 0015 GETNGBL R6 K2 + 0x88180D08, // 0016 GETMBR R6 R6 K8 + 0x7C100400, // 0017 CALL R4 2 + 0xB8160400, // 0018 GETNGBL R5 K2 + 0x88140B05, // 0019 GETMBR R5 R5 K5 + 0xB81A0400, // 001A GETNGBL R6 K2 + 0x88180D06, // 001B GETMBR R6 R6 K6 + 0x30140A06, // 001C OR R5 R5 R6 + 0x7C080600, // 001D CALL R2 3 + 0x4C080000, // 001E LDNIL R2 + 0x20080202, // 001F NE R2 R1 R2 + 0x780A0020, // 0020 JMPF R2 #0042 + 0x8C080309, // 0021 GETMET R2 R1 K9 + 0x7C080200, // 0022 CALL R2 1 + 0x8C0C030A, // 0023 GETMET R3 R1 K10 + 0xB8160400, // 0024 GETNGBL R5 K2 + 0x88140B05, // 0025 GETMBR R5 R5 K5 + 0xB81A0400, // 0026 GETNGBL R6 K2 + 0x88180D06, // 0027 GETMBR R6 R6 K6 + 0x30140A06, // 0028 OR R5 R5 R6 + 0x7C0C0400, // 0029 CALL R3 2 + 0x8C10010B, // 002A GETMET R4 R0 K11 + 0x5C180400, // 002B MOVE R6 R2 + 0x7C100400, // 002C CALL R4 2 + 0x54120003, // 002D LDINT R4 4 + 0x08100404, // 002E MUL R4 R2 R4 + 0x0C10090C, // 002F DIV R4 R4 K12 + 0x8C14010D, // 0030 GETMET R5 R0 K13 + 0x5C1C0800, // 0031 MOVE R7 R4 + 0x7C140400, // 0032 CALL R5 2 + 0x8C14010E, // 0033 GETMET R5 R0 K14 + 0x8C1C030F, // 0034 GETMET R7 R1 K15 + 0x7C1C0200, // 0035 CALL R7 1 + 0x041C0E04, // 0036 SUB R7 R7 R4 + 0x041C0E03, // 0037 SUB R7 R7 R3 + 0x7C140400, // 0038 CALL R5 2 + 0x8C140310, // 0039 GETMET R5 R1 K16 + 0x001C0604, // 003A ADD R7 R3 R4 + 0x001C0F11, // 003B ADD R7 R7 K17 + 0xB8220400, // 003C GETNGBL R8 K2 + 0x88201105, // 003D GETMBR R8 R8 K5 + 0xB8260400, // 003E GETNGBL R9 K2 + 0x88241306, // 003F GETMBR R9 R9 K6 + 0x30201009, // 0040 OR R8 R8 R9 + 0x7C140600, // 0041 CALL R5 3 + 0x80000000, // 0042 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_wifi_arcs_icon +********************************************************************/ +extern const bclass be_class_lv_wifi_arcs; +be_local_class(lv_wifi_arcs_icon, + 0, + &be_class_lv_wifi_arcs, + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(lv_wifi_arcs_icon_init_closure) }, + })), + (bstring*) &be_const_str_lv_wifi_arcs_icon +); +/*******************************************************************/ + +void be_load_lv_wifi_arcs_icon_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_wifi_arcs_icon); + be_setglobal(vm, "lv_wifi_arcs_icon"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified function: set_percentage +********************************************************************/ +be_local_closure(lv_signal_bars_set_percentage, /* 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(percentage), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(invalidate), + }), + &be_const_str_set_percentage, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x540E0013, // 0001 LDINT R3 20 + 0x0C080403, // 0002 DIV R2 R2 R3 + 0x540E0063, // 0003 LDINT R3 100 + 0x240C0203, // 0004 GT R3 R1 R3 + 0x780E0000, // 0005 JMPF R3 #0007 + 0x54060063, // 0006 LDINT R1 100 + 0x140C0301, // 0007 LT R3 R1 K1 + 0x780E0000, // 0008 JMPF R3 #000A + 0x58040001, // 0009 LDCONST R1 K1 + 0x90020001, // 000A SETMBR R0 K0 R1 + 0x540E0013, // 000B LDINT R3 20 + 0x0C0C0203, // 000C DIV R3 R1 R3 + 0x200C0403, // 000D NE R3 R2 R3 + 0x780E0001, // 000E JMPF R3 #0011 + 0x8C0C0102, // 000F GETMET R3 R0 K2 + 0x7C0C0200, // 0010 CALL R3 1 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_signal_bars_init, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 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(_lvgl), + /* K1 */ be_nested_str(create_custom_widget), + /* K2 */ be_nested_str(percentage), + /* K3 */ be_nested_str(p1), + /* K4 */ be_nested_str(lv), + /* K5 */ be_nested_str(point), + /* K6 */ be_nested_str(p2), + /* K7 */ be_nested_str(area), + /* K8 */ be_nested_str(line_dsc), + /* K9 */ be_nested_str(draw_line_dsc), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0xB80A0000, // 0000 GETNGBL R2 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100000, // 0002 MOVE R4 R0 + 0x5C140200, // 0003 MOVE R5 R1 + 0x7C080600, // 0004 CALL R2 3 + 0x540A0063, // 0005 LDINT R2 100 + 0x90020402, // 0006 SETMBR R0 K2 R2 + 0xB80A0800, // 0007 GETNGBL R2 K4 + 0x8C080505, // 0008 GETMET R2 R2 K5 + 0x7C080200, // 0009 CALL R2 1 + 0x90020602, // 000A SETMBR R0 K3 R2 + 0xB80A0800, // 000B GETNGBL R2 K4 + 0x8C080505, // 000C GETMET R2 R2 K5 + 0x7C080200, // 000D CALL R2 1 + 0x90020C02, // 000E SETMBR R0 K6 R2 + 0xB80A0800, // 000F GETNGBL R2 K4 + 0x8C080507, // 0010 GETMET R2 R2 K7 + 0x7C080200, // 0011 CALL R2 1 + 0x90020E02, // 0012 SETMBR R0 K7 R2 + 0xB80A0800, // 0013 GETNGBL R2 K4 + 0x8C080509, // 0014 GETMET R2 R2 K9 + 0x7C080200, // 0015 CALL R2 1 + 0x90021002, // 0016 SETMBR R0 K8 R2 + 0x80000000, // 0017 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: widget_event +********************************************************************/ +be_local_closure(lv_signal_bars_widget_event, /* name */ + be_nested_proto( + 23, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_const_int(1), + }), + &be_const_str_atleast1, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x28040100, // 0000 GE R1 R0 K0 + 0x78060001, // 0001 JMPF R1 #0004 + 0x80040000, // 0002 RET 1 R0 + 0x70020000, // 0003 JMP #0005 + 0x80060000, // 0004 RET 1 K0 + 0x80000000, // 0005 RET 0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[38]) { /* constants */ + /* K0 */ be_nested_str(lv), + /* K1 */ be_nested_str(obj_event_base), + /* K2 */ be_nested_str(RES_OK), + /* K3 */ be_nested_str(code), + /* K4 */ be_nested_str(get_height), + /* K5 */ be_nested_str(get_width), + /* K6 */ be_const_int(3), + /* K7 */ be_const_int(2), + /* K8 */ be_nested_str(EVENT_DRAW_MAIN), + /* K9 */ be_nested_str(draw_ctx), + /* K10 */ be_nested_str(param), + /* K11 */ be_nested_str(get_coords), + /* K12 */ be_nested_str(area), + /* K13 */ be_nested_str(x1), + /* K14 */ be_nested_str(y1), + /* K15 */ be_nested_str(draw_line_dsc_init), + /* K16 */ be_nested_str(line_dsc), + /* K17 */ be_nested_str(init_draw_line_dsc), + /* K18 */ be_nested_str(PART_MAIN), + /* K19 */ be_nested_str(round_start), + /* K20 */ be_const_int(1), + /* K21 */ be_nested_str(round_end), + /* K22 */ be_nested_str(width), + /* K23 */ be_nested_str(get_style_line_color), + /* K24 */ be_nested_str(STATE_DEFAULT), + /* K25 */ be_nested_str(get_style_bg_color), + /* K26 */ be_nested_str(event_send), + /* K27 */ be_nested_str(EVENT_DRAW_PART_BEGIN), + /* K28 */ be_const_int(0), + /* K29 */ be_nested_str(color), + /* K30 */ be_nested_str(percentage), + /* K31 */ be_nested_str(p1), + /* K32 */ be_nested_str(y), + /* K33 */ be_nested_str(x), + /* K34 */ be_nested_str(p2), + /* K35 */ be_nested_str(draw_line), + /* K36 */ be_nested_str(stop_iteration), + /* K37 */ be_nested_str(EVENT_DRAW_PART_END), + }), + &be_const_str_widget_event, + &be_const_str_solidified, + ( &(const binstruction[138]) { /* code */ + 0xB80E0000, // 0000 GETNGBL R3 K0 + 0x8C0C0701, // 0001 GETMET R3 R3 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x5C180400, // 0003 MOVE R6 R2 + 0x7C0C0600, // 0004 CALL R3 3 + 0xB8120000, // 0005 GETNGBL R4 K0 + 0x88100902, // 0006 GETMBR R4 R4 K2 + 0x200C0604, // 0007 NE R3 R3 R4 + 0x780E0000, // 0008 JMPF R3 #000A + 0x80000600, // 0009 RET 0 + 0x880C0503, // 000A GETMBR R3 R2 K3 + 0x84100000, // 000B CLOSURE R4 P0 + 0x8C140104, // 000C GETMET R5 R0 K4 + 0x7C140200, // 000D CALL R5 1 + 0x8C180105, // 000E GETMET R6 R0 K5 + 0x7C180200, // 000F CALL R6 1 + 0x5C1C0800, // 0010 MOVE R7 R4 + 0x5422000E, // 0011 LDINT R8 15 + 0x0C200C08, // 0012 DIV R8 R6 R8 + 0x7C1C0200, // 0013 CALL R7 1 + 0x5C200800, // 0014 MOVE R8 R4 + 0x08240F06, // 0015 MUL R9 R7 K6 + 0x04240C09, // 0016 SUB R9 R6 R9 + 0x542A0003, // 0017 LDINT R10 4 + 0x0C24120A, // 0018 DIV R9 R9 R10 + 0x7C200200, // 0019 CALL R8 1 + 0x0C241107, // 001A DIV R9 R8 K7 + 0xB82A0000, // 001B GETNGBL R10 K0 + 0x88281508, // 001C GETMBR R10 R10 K8 + 0x1C28060A, // 001D EQ R10 R3 R10 + 0x782A0069, // 001E JMPF R10 #0089 + 0xB82A0000, // 001F GETNGBL R10 K0 + 0x8C281509, // 0020 GETMET R10 R10 K9 + 0x8830050A, // 0021 GETMBR R12 R2 K10 + 0x7C280400, // 0022 CALL R10 2 + 0x8C2C010B, // 0023 GETMET R11 R0 K11 + 0x8834010C, // 0024 GETMBR R13 R0 K12 + 0x7C2C0400, // 0025 CALL R11 2 + 0x882C010C, // 0026 GETMBR R11 R0 K12 + 0x882C170D, // 0027 GETMBR R11 R11 K13 + 0x8830010C, // 0028 GETMBR R12 R0 K12 + 0x8830190E, // 0029 GETMBR R12 R12 K14 + 0xB8360000, // 002A GETNGBL R13 K0 + 0x8C341B0F, // 002B GETMET R13 R13 K15 + 0x883C0110, // 002C GETMBR R15 R0 K16 + 0x7C340400, // 002D CALL R13 2 + 0x8C340111, // 002E GETMET R13 R0 K17 + 0xB83E0000, // 002F GETNGBL R15 K0 + 0x883C1F12, // 0030 GETMBR R15 R15 K18 + 0x88400110, // 0031 GETMBR R16 R0 K16 + 0x7C340600, // 0032 CALL R13 3 + 0x88340110, // 0033 GETMBR R13 R0 K16 + 0x90362714, // 0034 SETMBR R13 K19 K20 + 0x88340110, // 0035 GETMBR R13 R0 K16 + 0x90362B14, // 0036 SETMBR R13 K21 K20 + 0x88340110, // 0037 GETMBR R13 R0 K16 + 0x90362C08, // 0038 SETMBR R13 K22 R8 + 0x8C340117, // 0039 GETMET R13 R0 K23 + 0xB83E0000, // 003A GETNGBL R15 K0 + 0x883C1F12, // 003B GETMBR R15 R15 K18 + 0xB8420000, // 003C GETNGBL R16 K0 + 0x88402118, // 003D GETMBR R16 R16 K24 + 0x303C1E10, // 003E OR R15 R15 R16 + 0x7C340400, // 003F CALL R13 2 + 0x8C380119, // 0040 GETMET R14 R0 K25 + 0xB8420000, // 0041 GETNGBL R16 K0 + 0x88402112, // 0042 GETMBR R16 R16 K18 + 0xB8460000, // 0043 GETNGBL R17 K0 + 0x88442318, // 0044 GETMBR R17 R17 K24 + 0x30402011, // 0045 OR R16 R16 R17 + 0x7C380400, // 0046 CALL R14 2 + 0xB83E0000, // 0047 GETNGBL R15 K0 + 0x8C3C1F1A, // 0048 GETMET R15 R15 K26 + 0x5C440000, // 0049 MOVE R17 R0 + 0xB84A0000, // 004A GETNGBL R18 K0 + 0x8848251B, // 004B GETMBR R18 R18 K27 + 0x884C0110, // 004C GETMBR R19 R0 K16 + 0x7C3C0800, // 004D CALL R15 4 + 0x603C0010, // 004E GETGBL R15 G16 + 0x40423906, // 004F CONNECT R16 K28 K6 + 0x7C3C0200, // 0050 CALL R15 1 + 0xA802002C, // 0051 EXBLK 0 #007F + 0x5C401E00, // 0052 MOVE R16 R15 + 0x7C400000, // 0053 CALL R16 0 + 0x88440110, // 0054 GETMBR R17 R0 K16 + 0x8848011E, // 0055 GETMBR R18 R0 K30 + 0x004C2114, // 0056 ADD R19 R16 K20 + 0x54520013, // 0057 LDINT R20 20 + 0x084C2614, // 0058 MUL R19 R19 R20 + 0x28482413, // 0059 GE R18 R18 R19 + 0x784A0001, // 005A JMPF R18 #005D + 0x5C481A00, // 005B MOVE R18 R13 + 0x70020000, // 005C JMP #005E + 0x5C481C00, // 005D MOVE R18 R14 + 0x90463A12, // 005E SETMBR R17 K29 R18 + 0x8844011F, // 005F GETMBR R17 R0 K31 + 0x00481805, // 0060 ADD R18 R12 R5 + 0x04482514, // 0061 SUB R18 R18 K20 + 0x04482409, // 0062 SUB R18 R18 R9 + 0x90464012, // 0063 SETMBR R17 K32 R18 + 0x8844011F, // 0064 GETMBR R17 R0 K31 + 0x00481007, // 0065 ADD R18 R8 R7 + 0x08482012, // 0066 MUL R18 R16 R18 + 0x00481612, // 0067 ADD R18 R11 R18 + 0x00482409, // 0068 ADD R18 R18 R9 + 0x90464212, // 0069 SETMBR R17 K33 R18 + 0x88440122, // 006A GETMBR R17 R0 K34 + 0x044A0C10, // 006B SUB R18 K6 R16 + 0x044C0A08, // 006C SUB R19 R5 R8 + 0x08482413, // 006D MUL R18 R18 R19 + 0x544E0003, // 006E LDINT R19 4 + 0x0C482413, // 006F DIV R18 R18 R19 + 0x00481812, // 0070 ADD R18 R12 R18 + 0x00482409, // 0071 ADD R18 R18 R9 + 0x90464012, // 0072 SETMBR R17 K32 R18 + 0x88440122, // 0073 GETMBR R17 R0 K34 + 0x8848011F, // 0074 GETMBR R18 R0 K31 + 0x88482521, // 0075 GETMBR R18 R18 K33 + 0x90464212, // 0076 SETMBR R17 K33 R18 + 0xB8460000, // 0077 GETNGBL R17 K0 + 0x8C442323, // 0078 GETMET R17 R17 K35 + 0x5C4C1400, // 0079 MOVE R19 R10 + 0x88500110, // 007A GETMBR R20 R0 K16 + 0x8854011F, // 007B GETMBR R21 R0 K31 + 0x88580122, // 007C GETMBR R22 R0 K34 + 0x7C440A00, // 007D CALL R17 5 + 0x7001FFD2, // 007E JMP #0052 + 0x583C0024, // 007F LDCONST R15 K36 + 0xAC3C0200, // 0080 CATCH R15 1 0 + 0xB0080000, // 0081 RAISE 2 R0 R0 + 0xB83E0000, // 0082 GETNGBL R15 K0 + 0x8C3C1F1A, // 0083 GETMET R15 R15 K26 + 0x5C440000, // 0084 MOVE R17 R0 + 0xB84A0000, // 0085 GETNGBL R18 K0 + 0x88482525, // 0086 GETMBR R18 R18 K37 + 0x884C0110, // 0087 GETMBR R19 R0 K16 + 0x7C3C0800, // 0088 CALL R15 4 + 0x80000000, // 0089 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_percentage +********************************************************************/ +be_local_closure(lv_signal_bars_get_percentage, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 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(percentage), + }), + &be_const_str_get_percentage, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_signal_bars +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_signal_bars, + 5, + &be_class_lv_obj, + be_nested_map(9, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(percentage, 4), be_const_var(0) }, + { be_const_key(p1, 5), be_const_var(1) }, + { be_const_key(p2, -1), be_const_var(2) }, + { be_const_key(get_percentage, -1), be_const_closure(lv_signal_bars_get_percentage_closure) }, + { be_const_key(line_dsc, -1), be_const_var(4) }, + { be_const_key(area, -1), be_const_var(3) }, + { be_const_key(init, -1), be_const_closure(lv_signal_bars_init_closure) }, + { be_const_key(widget_event, -1), be_const_closure(lv_signal_bars_widget_event_closure) }, + { be_const_key(set_percentage, 3), be_const_closure(lv_signal_bars_set_percentage_closure) }, + })), + (bstring*) &be_const_str_lv_signal_bars +); +/*******************************************************************/ + +void be_load_lv_signal_bars_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_signal_bars); + be_setglobal(vm, "lv_signal_bars"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified function: before_del +********************************************************************/ +be_local_closure(lv_wifi_bars_before_del, /* 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(tasmota), + /* K1 */ be_nested_str(remove_driver), + }), + &be_const_str_before_del, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C040400, // 0003 CALL R1 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_wifi_bars_init, /* 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(init), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(add_driver), + /* K3 */ be_nested_str(set_percentage), + /* K4 */ be_const_int(0), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0xB80A0200, // 0006 GETNGBL R2 K1 + 0x8C080502, // 0007 GETMET R2 R2 K2 + 0x5C100000, // 0008 MOVE R4 R0 + 0x7C080400, // 0009 CALL R2 2 + 0x8C080103, // 000A GETMET R2 R0 K3 + 0x58100004, // 000B LDCONST R4 K4 + 0x7C080400, // 000C CALL R2 2 + 0x80000000, // 000D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(lv_wifi_bars_every_second, /* 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[ 7]) { /* constants */ + /* K0 */ be_nested_str(tasmota), + /* K1 */ be_nested_str(wifi), + /* K2 */ be_nested_str(find), + /* K3 */ be_nested_str(quality), + /* K4 */ be_nested_str(ip), + /* K5 */ be_nested_str(set_percentage), + /* K6 */ be_const_int(0), + }), + &be_const_str_every_second, + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x8C080302, // 0003 GETMET R2 R1 K2 + 0x58100003, // 0004 LDCONST R4 K3 + 0x7C080400, // 0005 CALL R2 2 + 0x8C0C0302, // 0006 GETMET R3 R1 K2 + 0x58140004, // 0007 LDCONST R5 K4 + 0x7C0C0400, // 0008 CALL R3 2 + 0x4C100000, // 0009 LDNIL R4 + 0x1C100604, // 000A EQ R4 R3 R4 + 0x78120003, // 000B JMPF R4 #0010 + 0x8C100105, // 000C GETMET R4 R0 K5 + 0x58180006, // 000D LDCONST R6 K6 + 0x7C100400, // 000E CALL R4 2 + 0x70020005, // 000F JMP #0016 + 0x4C100000, // 0010 LDNIL R4 + 0x20100404, // 0011 NE R4 R2 R4 + 0x78120002, // 0012 JMPF R4 #0016 + 0x8C100105, // 0013 GETMET R4 R0 K5 + 0x5C180400, // 0014 MOVE R6 R2 + 0x7C100400, // 0015 CALL R4 2 + 0x80000000, // 0016 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_wifi_bars +********************************************************************/ +extern const bclass be_class_lv_signal_bars; +be_local_class(lv_wifi_bars, + 0, + &be_class_lv_signal_bars, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(before_del, 1), be_const_closure(lv_wifi_bars_before_del_closure) }, + { be_const_key(every_second, 2), be_const_closure(lv_wifi_bars_every_second_closure) }, + { be_const_key(init, -1), be_const_closure(lv_wifi_bars_init_closure) }, + })), + (bstring*) &be_const_str_lv_wifi_bars +); +/*******************************************************************/ + +void be_load_lv_wifi_bars_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_wifi_bars); + be_setglobal(vm, "lv_wifi_bars"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lv_wifi_bars_icon_init, /* name */ + be_nested_proto( + 9, /* nstack */ + 2, /* 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(init), + /* K1 */ be_nested_str(set_style_line_color), + /* K2 */ be_nested_str(lv), + /* K3 */ be_nested_str(color), + /* K4 */ be_nested_str(COLOR_WHITE), + /* K5 */ be_nested_str(PART_MAIN), + /* K6 */ be_nested_str(STATE_DEFAULT), + /* K7 */ be_nested_str(set_style_bg_color), + /* K8 */ be_nested_str(COLOR_BLACK), + /* K9 */ be_nested_str(get_height), + /* K10 */ be_nested_str(get_style_pad_right), + /* K11 */ be_nested_str(set_height), + /* K12 */ be_nested_str(set_width), + /* K13 */ be_nested_str(set_x), + /* K14 */ be_nested_str(get_width), + /* K15 */ be_nested_str(set_style_pad_right), + /* K16 */ be_const_int(1), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[64]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x8C080101, // 0006 GETMET R2 R0 K1 + 0xB8120400, // 0007 GETNGBL R4 K2 + 0x8C100903, // 0008 GETMET R4 R4 K3 + 0xB81A0400, // 0009 GETNGBL R6 K2 + 0x88180D04, // 000A GETMBR R6 R6 K4 + 0x7C100400, // 000B CALL R4 2 + 0xB8160400, // 000C GETNGBL R5 K2 + 0x88140B05, // 000D GETMBR R5 R5 K5 + 0xB81A0400, // 000E GETNGBL R6 K2 + 0x88180D06, // 000F GETMBR R6 R6 K6 + 0x30140A06, // 0010 OR R5 R5 R6 + 0x7C080600, // 0011 CALL R2 3 + 0x8C080107, // 0012 GETMET R2 R0 K7 + 0xB8120400, // 0013 GETNGBL R4 K2 + 0x8C100903, // 0014 GETMET R4 R4 K3 + 0xB81A0400, // 0015 GETNGBL R6 K2 + 0x88180D08, // 0016 GETMBR R6 R6 K8 + 0x7C100400, // 0017 CALL R4 2 + 0xB8160400, // 0018 GETNGBL R5 K2 + 0x88140B05, // 0019 GETMBR R5 R5 K5 + 0xB81A0400, // 001A GETNGBL R6 K2 + 0x88180D06, // 001B GETMBR R6 R6 K6 + 0x30140A06, // 001C OR R5 R5 R6 + 0x7C080600, // 001D CALL R2 3 + 0x4C080000, // 001E LDNIL R2 + 0x20080202, // 001F NE R2 R1 R2 + 0x780A001D, // 0020 JMPF R2 #003F + 0x8C080309, // 0021 GETMET R2 R1 K9 + 0x7C080200, // 0022 CALL R2 1 + 0x8C0C030A, // 0023 GETMET R3 R1 K10 + 0xB8160400, // 0024 GETNGBL R5 K2 + 0x88140B05, // 0025 GETMBR R5 R5 K5 + 0xB81A0400, // 0026 GETNGBL R6 K2 + 0x88180D06, // 0027 GETMBR R6 R6 K6 + 0x30140A06, // 0028 OR R5 R5 R6 + 0x7C0C0400, // 0029 CALL R3 2 + 0x8C10010B, // 002A GETMET R4 R0 K11 + 0x5C180400, // 002B MOVE R6 R2 + 0x7C100400, // 002C CALL R4 2 + 0x8C10010C, // 002D GETMET R4 R0 K12 + 0x5C180400, // 002E MOVE R6 R2 + 0x7C100400, // 002F CALL R4 2 + 0x8C10010D, // 0030 GETMET R4 R0 K13 + 0x8C18030E, // 0031 GETMET R6 R1 K14 + 0x7C180200, // 0032 CALL R6 1 + 0x04180C02, // 0033 SUB R6 R6 R2 + 0x04180C03, // 0034 SUB R6 R6 R3 + 0x7C100400, // 0035 CALL R4 2 + 0x8C10030F, // 0036 GETMET R4 R1 K15 + 0x00180602, // 0037 ADD R6 R3 R2 + 0x00180D10, // 0038 ADD R6 R6 K16 + 0xB81E0400, // 0039 GETNGBL R7 K2 + 0x881C0F05, // 003A GETMBR R7 R7 K5 + 0xB8220400, // 003B GETNGBL R8 K2 + 0x88201106, // 003C GETMBR R8 R8 K6 + 0x301C0E08, // 003D OR R7 R7 R8 + 0x7C100600, // 003E CALL R4 3 + 0x80000000, // 003F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_wifi_bars_icon +********************************************************************/ +extern const bclass be_class_lv_wifi_bars; +be_local_class(lv_wifi_bars_icon, + 0, + &be_class_lv_wifi_bars, + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(lv_wifi_bars_icon_init_closure) }, + })), + (bstring*) &be_const_str_lv_wifi_bars_icon +); +/*******************************************************************/ + +void be_load_lv_wifi_bars_icon_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_wifi_bars_icon); + be_setglobal(vm, "lv_wifi_bars_icon"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_mqtt.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_mqtt.h new file mode 100644 index 000000000..e1ec4506a --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_mqtt.h @@ -0,0 +1,582 @@ +/* Solidification of mqtt.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: mqtt_data +********************************************************************/ +be_local_closure(MQTT_mqtt_data, /* name */ + be_nested_proto( + 14, /* 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(topics), + /* K1 */ be_nested_str(closure), + /* K2 */ be_nested_str(mqtt_data), + /* K3 */ be_nested_str(stop_iteration), + }), + &be_const_str_mqtt_data, + &be_const_str_solidified, + ( &(const binstruction[32]) { /* code */ + 0x88140100, // 0000 GETMBR R5 R0 K0 + 0x4C180000, // 0001 LDNIL R6 + 0x1C140A06, // 0002 EQ R5 R5 R6 + 0x78160000, // 0003 JMPF R5 #0005 + 0x80000A00, // 0004 RET 0 + 0x50140000, // 0005 LDBOOL R5 0 0 + 0x60180010, // 0006 GETGBL R6 G16 + 0x881C0100, // 0007 GETMBR R7 R0 K0 + 0x7C180200, // 0008 CALL R6 1 + 0xA8020011, // 0009 EXBLK 0 #001C + 0x5C1C0C00, // 000A MOVE R7 R6 + 0x7C1C0000, // 000B CALL R7 0 + 0x88200F01, // 000C GETMBR R8 R7 K1 + 0x4C240000, // 000D LDNIL R9 + 0x20201009, // 000E NE R8 R8 R9 + 0x7822000A, // 000F JMPF R8 #001B + 0x8C200F02, // 0010 GETMET R8 R7 K2 + 0x5C280200, // 0011 MOVE R10 R1 + 0x5C2C0400, // 0012 MOVE R11 R2 + 0x5C300600, // 0013 MOVE R12 R3 + 0x5C340800, // 0014 MOVE R13 R4 + 0x7C200A00, // 0015 CALL R8 5 + 0x74160001, // 0016 JMPT R5 #0019 + 0x74220000, // 0017 JMPT R8 #0019 + 0x50200001, // 0018 LDBOOL R8 0 1 + 0x50200200, // 0019 LDBOOL R8 1 0 + 0x5C141000, // 001A MOVE R5 R8 + 0x7001FFED, // 001B JMP #000A + 0x58180003, // 001C LDCONST R6 K3 + 0xAC180200, // 001D CATCH R6 1 0 + 0xB0080000, // 001E RAISE 2 R0 R0 + 0x80040A00, // 001F RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: lazy_init +********************************************************************/ +be_local_closure(MQTT_lazy_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + 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(mqtt_connect), + }), + &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(topics), + /* K1 */ be_nested_str(tasmota), + /* K2 */ be_nested_str(add_driver), + /* K3 */ be_nested_str(add_rule), + /* K4 */ be_nested_str(Mqtt_X23Connected), + }), + &be_const_str_lazy_init, + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x4C080000, // 0001 LDNIL R2 + 0x1C040202, // 0002 EQ R1 R1 R2 + 0x7806000B, // 0003 JMPF R1 #0010 + 0x60040012, // 0004 GETGBL R1 G18 + 0x7C040000, // 0005 CALL R1 0 + 0x90020001, // 0006 SETMBR R0 K0 R1 + 0xB8060200, // 0007 GETNGBL R1 K1 + 0x8C040302, // 0008 GETMET R1 R1 K2 + 0x5C0C0000, // 0009 MOVE R3 R0 + 0x7C040400, // 000A CALL R1 2 + 0xB8060200, // 000B GETNGBL R1 K1 + 0x8C040303, // 000C GETMET R1 R1 K3 + 0x580C0004, // 000D LDCONST R3 K4 + 0x84100000, // 000E CLOSURE R4 P0 + 0x7C040600, // 000F CALL R1 3 + 0xA0000000, // 0010 CLOSE R0 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: unsubscribe +********************************************************************/ +be_local_closure(MQTT_unsubscribe, /* 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(topics), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str(fulltopic), + /* K3 */ be_nested_str(_unsubscribe), + /* K4 */ be_nested_str(remove), + /* K5 */ be_const_int(1), + }), + &be_const_str_unsubscribe, + &be_const_str_solidified, + ( &(const binstruction[41]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0x1C080403, // 0002 EQ R2 R2 R3 + 0x780A0000, // 0003 JMPF R2 #0005 + 0x80000400, // 0004 RET 0 + 0x58080001, // 0005 LDCONST R2 K1 + 0x600C000C, // 0006 GETGBL R3 G12 + 0x88100100, // 0007 GETMBR R4 R0 K0 + 0x7C0C0200, // 0008 CALL R3 1 + 0x140C0403, // 0009 LT R3 R2 R3 + 0x780E0016, // 000A JMPF R3 #0022 + 0x4C0C0000, // 000B LDNIL R3 + 0x1C0C0203, // 000C EQ R3 R1 R3 + 0x740E0004, // 000D JMPT R3 #0013 + 0x880C0100, // 000E GETMBR R3 R0 K0 + 0x940C0602, // 000F GETIDX R3 R3 R2 + 0x880C0702, // 0010 GETMBR R3 R3 K2 + 0x1C0C0601, // 0011 EQ R3 R3 R1 + 0x780E000C, // 0012 JMPF R3 #0020 + 0x4C0C0000, // 0013 LDNIL R3 + 0x1C0C0203, // 0014 EQ R3 R1 R3 + 0x780E0004, // 0015 JMPF R3 #001B + 0x8C0C0103, // 0016 GETMET R3 R0 K3 + 0x88140100, // 0017 GETMBR R5 R0 K0 + 0x94140A02, // 0018 GETIDX R5 R5 R2 + 0x88140B02, // 0019 GETMBR R5 R5 K2 + 0x7C0C0400, // 001A CALL R3 2 + 0x880C0100, // 001B GETMBR R3 R0 K0 + 0x8C0C0704, // 001C GETMET R3 R3 K4 + 0x5C140400, // 001D MOVE R5 R2 + 0x7C0C0400, // 001E CALL R3 2 + 0x70020000, // 001F JMP #0021 + 0x00080505, // 0020 ADD R2 R2 K5 + 0x7001FFE3, // 0021 JMP #0006 + 0x4C0C0000, // 0022 LDNIL R3 + 0x200C0203, // 0023 NE R3 R1 R3 + 0x780E0002, // 0024 JMPF R3 #0028 + 0x8C0C0103, // 0025 GETMET R3 R0 K3 + 0x5C140200, // 0026 MOVE R5 R1 + 0x7C0C0400, // 0027 CALL R3 2 + 0x80000000, // 0028 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: mqtt_connect +********************************************************************/ +be_local_closure(MQTT_mqtt_connect, /* 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(tasmota), + /* K1 */ be_nested_str(log), + /* K2 */ be_nested_str(BRY_X3A_X20mqtt_X20subscribe_X20all_X20registered_X20topics), + /* K3 */ be_const_int(3), + /* K4 */ be_nested_str(topics), + /* K5 */ be_nested_str(fulltopic), + /* K6 */ be_nested_str(_subscribe), + /* K7 */ be_nested_str(stop_iteration), + }), + &be_const_str_mqtt_connect, + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x580C0002, // 0002 LDCONST R3 K2 + 0x58100003, // 0003 LDCONST R4 K3 + 0x7C040600, // 0004 CALL R1 3 + 0x60040010, // 0005 GETGBL R1 G16 + 0x88080104, // 0006 GETMBR R2 R0 K4 + 0x7C040200, // 0007 CALL R1 1 + 0xA8020006, // 0008 EXBLK 0 #0010 + 0x5C080200, // 0009 MOVE R2 R1 + 0x7C080000, // 000A CALL R2 0 + 0x880C0505, // 000B GETMBR R3 R2 K5 + 0x8C100106, // 000C GETMET R4 R0 K6 + 0x5C180600, // 000D MOVE R6 R3 + 0x7C100400, // 000E CALL R4 2 + 0x7001FFF8, // 000F JMP #0009 + 0x58040007, // 0010 LDCONST R1 K7 + 0xAC040200, // 0011 CATCH R1 1 0 + 0xB0080000, // 0012 RAISE 2 R0 R0 + 0x50040000, // 0013 LDBOOL R1 0 0 + 0x80040200, // 0014 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tostring +********************************************************************/ +be_local_closure(mqtt_listener_tostring, /* 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[ 4]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(format), + /* K2 */ be_nested_str(_X3Cinstance_X3A_X20_X25s_X28_X27_X25s_X27_X29_X3E), + /* K3 */ be_nested_str(fulltopic), + }), + &be_const_str_tostring, + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080301, // 0001 GETMET R2 R1 K1 + 0x58100002, // 0002 LDCONST R4 K2 + 0x60140005, // 0003 GETGBL R5 G5 + 0x5C180000, // 0004 MOVE R6 R0 + 0x7C140200, // 0005 CALL R5 1 + 0x88180103, // 0006 GETMBR R6 R0 K3 + 0x7C080800, // 0007 CALL R2 4 + 0x80040400, // 0008 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(mqtt_listener_init, /* 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[ 6]) { /* constants */ + /* K0 */ be_nested_str(string), + /* K1 */ be_nested_str(fulltopic), + /* K2 */ be_nested_str(topic), + /* K3 */ be_nested_str(split), + /* K4 */ be_nested_str(_X2F), + /* K5 */ be_nested_str(closure), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0x90020201, // 0001 SETMBR R0 K1 R1 + 0x8C100703, // 0002 GETMET R4 R3 K3 + 0x5C180200, // 0003 MOVE R6 R1 + 0x581C0004, // 0004 LDCONST R7 K4 + 0x7C100600, // 0005 CALL R4 3 + 0x90020404, // 0006 SETMBR R0 K2 R4 + 0x90020A02, // 0007 SETMBR R0 K5 R2 + 0x80000000, // 0008 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: mqtt_data +********************************************************************/ +be_local_closure(mqtt_listener_mqtt_data, /* name */ + be_nested_proto( + 17, /* 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(string), + /* K1 */ be_nested_str(split), + /* K2 */ be_nested_str(_X2F), + /* K3 */ be_nested_str(topic), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str(_X23), + /* K6 */ be_nested_str(_X2B), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str(closure), + }), + &be_const_str_mqtt_data, + &be_const_str_solidified, + ( &(const binstruction[53]) { /* code */ + 0xA4160000, // 0000 IMPORT R5 K0 + 0x8C180B01, // 0001 GETMET R6 R5 K1 + 0x5C200200, // 0002 MOVE R8 R1 + 0x58240002, // 0003 LDCONST R9 K2 + 0x7C180600, // 0004 CALL R6 3 + 0x601C000C, // 0005 GETGBL R7 G12 + 0x5C200C00, // 0006 MOVE R8 R6 + 0x7C1C0200, // 0007 CALL R7 1 + 0x88200103, // 0008 GETMBR R8 R0 K3 + 0x6024000C, // 0009 GETGBL R9 G12 + 0x5C281000, // 000A MOVE R10 R8 + 0x7C240200, // 000B CALL R9 1 + 0x58280004, // 000C LDCONST R10 K4 + 0x142C1409, // 000D LT R11 R10 R9 + 0x782E0013, // 000E JMPF R11 #0023 + 0x942C100A, // 000F GETIDX R11 R8 R10 + 0x1C301705, // 0010 EQ R12 R11 K5 + 0x78320001, // 0011 JMPF R12 #0014 + 0x7002000F, // 0012 JMP #0023 + 0x7002000C, // 0013 JMP #0021 + 0x28301407, // 0014 GE R12 R10 R7 + 0x78320002, // 0015 JMPF R12 #0019 + 0x50300000, // 0016 LDBOOL R12 0 0 + 0x80041800, // 0017 RET 1 R12 + 0x70020007, // 0018 JMP #0021 + 0x1C301706, // 0019 EQ R12 R11 K6 + 0x78320000, // 001A JMPF R12 #001C + 0x70020004, // 001B JMP #0021 + 0x94300C0A, // 001C GETIDX R12 R6 R10 + 0x2030160C, // 001D NE R12 R11 R12 + 0x78320001, // 001E JMPF R12 #0021 + 0x50300000, // 001F LDBOOL R12 0 0 + 0x80041800, // 0020 RET 1 R12 + 0x00281507, // 0021 ADD R10 R10 K7 + 0x7001FFE9, // 0022 JMP #000D + 0x282C1409, // 0023 GE R11 R10 R9 + 0x782E0003, // 0024 JMPF R11 #0029 + 0x202C1207, // 0025 NE R11 R9 R7 + 0x782E0001, // 0026 JMPF R11 #0029 + 0x502C0000, // 0027 LDBOOL R11 0 0 + 0x80041600, // 0028 RET 1 R11 + 0x882C0108, // 0029 GETMBR R11 R0 K8 + 0x5C301600, // 002A MOVE R12 R11 + 0x5C340200, // 002B MOVE R13 R1 + 0x5C380400, // 002C MOVE R14 R2 + 0x5C3C0600, // 002D MOVE R15 R3 + 0x5C400800, // 002E MOVE R16 R4 + 0x7C300800, // 002F CALL R12 4 + 0x4C340000, // 0030 LDNIL R13 + 0x1C34180D, // 0031 EQ R13 R12 R13 + 0x78360000, // 0032 JMPF R13 #0034 + 0x50300200, // 0033 LDBOOL R12 1 0 + 0x80041800, // 0034 RET 1 R12 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: mqtt_listener +********************************************************************/ +be_local_class(mqtt_listener, + 3, + NULL, + be_nested_map(6, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(mqtt_data, -1), be_const_closure(mqtt_listener_mqtt_data_closure) }, + { be_const_key(tostring, -1), be_const_closure(mqtt_listener_tostring_closure) }, + { be_const_key(topic, -1), be_const_var(0) }, + { be_const_key(init, -1), be_const_closure(mqtt_listener_init_closure) }, + { be_const_key(closure, 0), be_const_var(2) }, + { be_const_key(fulltopic, -1), be_const_var(1) }, + })), + (bstring*) &be_const_str_mqtt_listener +); + +/******************************************************************** +** Solidified function: mqtt_listener_class +********************************************************************/ +be_local_closure(MQTT_mqtt_listener_class, /* 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_const_class(be_class_mqtt_listener), + }), + &be_const_str_mqtt_listener_class, + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x58040000, // 0000 LDCONST R1 K0 + 0xB4000000, // 0001 CLASS K0 + 0x80040200, // 0002 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: subscribe +********************************************************************/ +be_local_closure(MQTT_subscribe, /* 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[11]) { /* constants */ + /* K0 */ be_nested_str(lazy_init), + /* K1 */ be_nested_str(topics), + /* K2 */ be_nested_str(fulltopic), + /* K3 */ be_nested_str(closure), + /* K4 */ be_nested_str(stop_iteration), + /* K5 */ be_nested_str(mqtt_listener_class), + /* K6 */ be_nested_str(function), + /* K7 */ be_nested_str(tasmota), + /* K8 */ be_nested_str(check_not_method), + /* K9 */ be_nested_str(push), + /* K10 */ be_nested_str(_subscribe), + }), + &be_const_str_subscribe, + &be_const_str_solidified, + ( &(const binstruction[50]) { /* code */ + 0x8C0C0100, // 0000 GETMET R3 R0 K0 + 0x7C0C0200, // 0001 CALL R3 1 + 0x500C0000, // 0002 LDBOOL R3 0 0 + 0x60100010, // 0003 GETGBL R4 G16 + 0x88140101, // 0004 GETMBR R5 R0 K1 + 0x7C100200, // 0005 CALL R4 1 + 0xA802000A, // 0006 EXBLK 0 #0012 + 0x5C140800, // 0007 MOVE R5 R4 + 0x7C140000, // 0008 CALL R5 0 + 0x88180B02, // 0009 GETMBR R6 R5 K2 + 0x1C180C01, // 000A EQ R6 R6 R1 + 0x781A0004, // 000B JMPF R6 #0011 + 0x88180B03, // 000C GETMBR R6 R5 K3 + 0x1C180C02, // 000D EQ R6 R6 R2 + 0x781A0001, // 000E JMPF R6 #0011 + 0xA8040001, // 000F EXBLK 1 1 + 0x80000C00, // 0010 RET 0 + 0x7001FFF4, // 0011 JMP #0007 + 0x58100004, // 0012 LDCONST R4 K4 + 0xAC100200, // 0013 CATCH R4 1 0 + 0xB0080000, // 0014 RAISE 2 R0 R0 + 0x8C100105, // 0015 GETMET R4 R0 K5 + 0x7C100200, // 0016 CALL R4 1 + 0x60140004, // 0017 GETGBL R5 G4 + 0x5C180400, // 0018 MOVE R6 R2 + 0x7C140200, // 0019 CALL R5 1 + 0x1C140B06, // 001A EQ R5 R5 K6 + 0x7816000B, // 001B JMPF R5 #0028 + 0xB8160E00, // 001C GETNGBL R5 K7 + 0x8C140B08, // 001D GETMET R5 R5 K8 + 0x5C1C0400, // 001E MOVE R7 R2 + 0x7C140400, // 001F CALL R5 2 + 0x88140101, // 0020 GETMBR R5 R0 K1 + 0x8C140B09, // 0021 GETMET R5 R5 K9 + 0x5C1C0800, // 0022 MOVE R7 R4 + 0x5C200200, // 0023 MOVE R8 R1 + 0x5C240400, // 0024 MOVE R9 R2 + 0x7C1C0400, // 0025 CALL R7 2 + 0x7C140400, // 0026 CALL R5 2 + 0x70020005, // 0027 JMP #002E + 0x88140101, // 0028 GETMBR R5 R0 K1 + 0x8C140B09, // 0029 GETMET R5 R5 K9 + 0x5C1C0800, // 002A MOVE R7 R4 + 0x5C200200, // 002B MOVE R8 R1 + 0x7C1C0200, // 002C CALL R7 1 + 0x7C140400, // 002D CALL R5 2 + 0x8C14010A, // 002E GETMET R5 R0 K10 + 0x5C1C0200, // 002F MOVE R7 R1 + 0x7C140400, // 0030 CALL R5 2 + 0x80000000, // 0031 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: MQTT +********************************************************************/ +extern const bclass be_class_MQTT_ntv; +be_local_class(MQTT, + 1, + &be_class_MQTT_ntv, + be_nested_map(7, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(mqtt_connect, -1), be_const_closure(MQTT_mqtt_connect_closure) }, + { be_const_key(mqtt_data, -1), be_const_closure(MQTT_mqtt_data_closure) }, + { be_const_key(lazy_init, -1), be_const_closure(MQTT_lazy_init_closure) }, + { be_const_key(unsubscribe, -1), be_const_closure(MQTT_unsubscribe_closure) }, + { be_const_key(topics, 0), be_const_var(0) }, + { be_const_key(mqtt_listener_class, -1), be_const_closure(MQTT_mqtt_listener_class_closure) }, + { be_const_key(subscribe, -1), be_const_closure(MQTT_subscribe_closure) }, + })), + (bstring*) &be_const_str_MQTT +); +/*******************************************************************/ + +void be_load_MQTT_class(bvm *vm) { + be_pushntvclass(vm, &be_class_MQTT); + be_setglobal(vm, "MQTT"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_python_compat.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_python_compat.h new file mode 100644 index 000000000..89d5d5990 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_python_compat.h @@ -0,0 +1,59 @@ +/* Solidification of python_compat.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: _anonymous_ +********************************************************************/ +be_local_closure(python_compat__anonymous_, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str(global), + /* K1 */ be_nested_str(True), + /* K2 */ be_nested_str(False), + /* K3 */ be_nested_str(None), + /* K4 */ be_nested_str(b), + }), + &be_const_str__anonymous_, + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x50080200, // 0001 LDBOOL R2 1 0 + 0x90060202, // 0002 SETMBR R1 K1 R2 + 0x50080000, // 0003 LDBOOL R2 0 0 + 0x90060402, // 0004 SETMBR R1 K2 R2 + 0x4C080000, // 0005 LDNIL R2 + 0x90060602, // 0006 SETMBR R1 K3 R2 + 0x60080015, // 0007 GETGBL R2 G21 + 0x90060802, // 0008 SETMBR R1 K4 R2 + 0x80040000, // 0009 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified module: python_compat +********************************************************************/ +be_local_module(python_compat, + "python_compat", + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(python_compat__anonymous__closure) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(python_compat); +/********************************************************************/ +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_tapp.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_tapp.h new file mode 100644 index 000000000..573d08b6d --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_tapp.h @@ -0,0 +1,168 @@ +/* Solidification of tapp.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Tapp_init, /* 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(tasmota), + /* K1 */ be_nested_str(add_driver), + }), + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C040400, // 0003 CALL R1 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: autoexec +********************************************************************/ +be_local_closure(Tapp_autoexec, /* name */ + be_nested_proto( + 12, /* nstack */ + 1, /* argc */ + 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(path), + /* K1 */ be_nested_str(string), + /* K2 */ be_nested_str(listdir), + /* K3 */ be_nested_str(_X2F), + /* K4 */ be_nested_str(find), + /* K5 */ be_nested_str(_X2Etapp), + /* K6 */ be_const_int(0), + /* K7 */ be_nested_str(tasmota), + /* K8 */ be_nested_str(log), + /* K9 */ be_nested_str(format), + /* K10 */ be_nested_str(TAP_X3A_X20Loaded_X20Tasmota_X20App_X20_X27_X25s_X27), + /* K11 */ be_const_int(2), + /* K12 */ be_nested_str(load), + /* K13 */ be_nested_str(_X23autoexec_X2Ebe), + /* K14 */ be_nested_str(stop_iteration), + }), + &be_const_str_autoexec, + &be_const_str_solidified, + ( &(const binstruction[34]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x8C0C0302, // 0002 GETMET R3 R1 K2 + 0x58140003, // 0003 LDCONST R5 K3 + 0x7C0C0400, // 0004 CALL R3 2 + 0x60100010, // 0005 GETGBL R4 G16 + 0x5C140600, // 0006 MOVE R5 R3 + 0x7C100200, // 0007 CALL R4 1 + 0xA8020014, // 0008 EXBLK 0 #001E + 0x5C140800, // 0009 MOVE R5 R4 + 0x7C140000, // 000A CALL R5 0 + 0x8C180504, // 000B GETMET R6 R2 K4 + 0x5C200A00, // 000C MOVE R8 R5 + 0x58240005, // 000D LDCONST R9 K5 + 0x7C180600, // 000E CALL R6 3 + 0x24180D06, // 000F GT R6 R6 K6 + 0x781A000B, // 0010 JMPF R6 #001D + 0xB81A0E00, // 0011 GETNGBL R6 K7 + 0x8C180D08, // 0012 GETMET R6 R6 K8 + 0x8C200509, // 0013 GETMET R8 R2 K9 + 0x5828000A, // 0014 LDCONST R10 K10 + 0x5C2C0A00, // 0015 MOVE R11 R5 + 0x7C200600, // 0016 CALL R8 3 + 0x5824000B, // 0017 LDCONST R9 K11 + 0x7C180600, // 0018 CALL R6 3 + 0xB81A0E00, // 0019 GETNGBL R6 K7 + 0x8C180D0C, // 001A GETMET R6 R6 K12 + 0x00200B0D, // 001B ADD R8 R5 K13 + 0x7C180400, // 001C CALL R6 2 + 0x7001FFEA, // 001D JMP #0009 + 0x5810000E, // 001E LDCONST R4 K14 + 0xAC100200, // 001F CATCH R4 1 0 + 0xB0080000, // 0020 RAISE 2 R0 R0 + 0x80000000, // 0021 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: Tapp +********************************************************************/ +be_local_class(Tapp, + 0, + NULL, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(autoexec, -1), be_const_closure(Tapp_autoexec_closure) }, + { be_const_key(init, 0), be_const_closure(Tapp_init_closure) }, + })), + (bstring*) &be_const_str_Tapp +); + +/******************************************************************** +** Solidified function: _anonymous_ +********************************************************************/ +be_local_closure(tapp__anonymous_, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_const_class(be_class_Tapp), + }), + &be_const_str__anonymous_, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x58040000, // 0000 LDCONST R1 K0 + 0xB4000000, // 0001 CLASS K0 + 0x5C080200, // 0002 MOVE R2 R1 + 0x7C080000, // 0003 CALL R2 0 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified module: tapp +********************************************************************/ +be_local_module(tapp, + "tapp", + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(tapp__anonymous__closure) }, + })) +); +BE_EXPORT_VARIABLE be_define_const_native_module(tapp); +/********************************************************************/ +/********************************************************************/ +/* 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 index 550d2fc3a..3e11cc170 100644 --- a/lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h @@ -4,188 +4,6 @@ \********************************************************************/ #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 ********************************************************************/ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_test_crypto.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_test_crypto.h new file mode 100644 index 000000000..2091c19a4 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_test_crypto.h @@ -0,0 +1,7 @@ +/* Solidification of test_crypto.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_trigger_class.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_trigger_class.h new file mode 100644 index 000000000..f86aaa349 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_trigger_class.h @@ -0,0 +1,189 @@ +/* Solidification of trigger_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); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee.h new file mode 100644 index 000000000..04e8bf1dd --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee.h @@ -0,0 +1,64 @@ +/* Solidification of zigbee.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: tostring +********************************************************************/ +be_local_closure(zb_device_tostring, /* name */ + be_nested_proto( + 14, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[11]) { /* constants */ + /* K0 */ be_nested_str_weak(json), + /* K1 */ be_nested_str_weak(string), + /* K2 */ be_nested_str_weak(longaddr), + /* K3 */ be_nested_str_weak(format), + /* K4 */ be_nested_str_weak(_X3Cinstance_X3A_X20_X25s_X280x_X2504X_X2C_X200x_X2508X_X2508X_X2C_X20name_X3A_X27_X25s_X27_X2C_X20model_X3A_X27_X25s_X27_X2C_X20manufacturer_X3A_X27_X25s_X27_X29_X3E), + /* K5 */ be_nested_str_weak(shortaddr), + /* K6 */ be_nested_str_weak(get), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str_weak(name), + /* K9 */ be_nested_str_weak(model), + /* K10 */ be_nested_str_weak(manufacturer), + }), + be_str_weak(tostring), + &be_const_str_solidified, + ( &(const binstruction[22]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x8C100503, // 0003 GETMET R4 R2 K3 + 0x58180004, // 0004 LDCONST R6 K4 + 0x601C0005, // 0005 GETGBL R7 G5 + 0x5C200000, // 0006 MOVE R8 R0 + 0x7C1C0200, // 0007 CALL R7 1 + 0x88200105, // 0008 GETMBR R8 R0 K5 + 0x8C240706, // 0009 GETMET R9 R3 K6 + 0x542E0003, // 000A LDINT R11 4 + 0x54320003, // 000B LDINT R12 4 + 0x7C240600, // 000C CALL R9 3 + 0x8C280706, // 000D GETMET R10 R3 K6 + 0x58300007, // 000E LDCONST R12 K7 + 0x54360003, // 000F LDINT R13 4 + 0x7C280600, // 0010 CALL R10 3 + 0x882C0108, // 0011 GETMBR R11 R0 K8 + 0x88300109, // 0012 GETMBR R12 R0 K9 + 0x8834010A, // 0013 GETMBR R13 R0 K10 + 0x7C101200, // 0014 CALL R4 9 + 0x80040800, // 0015 RET 1 R4 + }) + ) +); +/*******************************************************************/ + +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee_zb_coord.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee_zb_coord.h new file mode 100644 index 000000000..fb16c25e2 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee_zb_coord.h @@ -0,0 +1,220 @@ +/* Solidification of zigbee_zb_coord.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(zb_coord_init, /* 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_weak(init), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x60040003, // 0000 GETGBL R1 G3 + 0x5C080000, // 0001 MOVE R2 R0 + 0x7C040200, // 0002 CALL R1 1 + 0x8C040300, // 0003 GETMET R1 R1 K0 + 0x7C040200, // 0004 CALL R1 1 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_handler +********************************************************************/ +be_local_closure(zb_coord_add_handler, /* 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_weak(instance), + /* K1 */ be_nested_str_weak(value_error), + /* K2 */ be_nested_str_weak(instance_X20required), + /* K3 */ be_nested_str_weak(_handlers), + /* K4 */ be_nested_str_weak(push), + }), + be_str_weak(add_handler), + &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: dispatch +********************************************************************/ +be_local_closure(zb_coord_dispatch, /* name */ + be_nested_proto( + 21, /* nstack */ + 5, /* 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_weak(_handlers), + /* K1 */ be_nested_str_weak(introspect), + /* K2 */ be_nested_str_weak(string), + /* K3 */ be_nested_str_weak(toptr), + /* K4 */ be_const_int(0), + /* K5 */ be_nested_str_weak(zcl_frame), + /* K6 */ be_nested_str_weak(zcl_attribute_list), + /* K7 */ be_nested_str_weak(get), + /* K8 */ be_nested_str_weak(function), + /* K9 */ be_nested_str_weak(format), + /* K10 */ be_nested_str_weak(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s), + /* K11 */ be_nested_str_weak(tasmota), + /* K12 */ be_nested_str_weak(_debug_present), + /* K13 */ be_nested_str_weak(debug), + /* K14 */ be_nested_str_weak(traceback), + /* K15 */ be_const_int(1), + }), + be_str_weak(dispatch), + &be_const_str_solidified, + ( &(const binstruction[71]) { /* code */ + 0x88140100, // 0000 GETMBR R5 R0 K0 + 0x4C180000, // 0001 LDNIL R6 + 0x1C140A06, // 0002 EQ R5 R5 R6 + 0x78160000, // 0003 JMPF R5 #0005 + 0x80000A00, // 0004 RET 0 + 0xA4160200, // 0005 IMPORT R5 K1 + 0xA41A0400, // 0006 IMPORT R6 K2 + 0x4C1C0000, // 0007 LDNIL R7 + 0x4C200000, // 0008 LDNIL R8 + 0x8C240B03, // 0009 GETMET R9 R5 K3 + 0x582C0004, // 000A LDCONST R11 K4 + 0x7C240400, // 000B CALL R9 2 + 0x20280409, // 000C NE R10 R2 R9 + 0x782A0003, // 000D JMPF R10 #0012 + 0x8C280105, // 000E GETMET R10 R0 K5 + 0x5C300400, // 000F MOVE R12 R2 + 0x7C280400, // 0010 CALL R10 2 + 0x5C1C1400, // 0011 MOVE R7 R10 + 0x20280609, // 0012 NE R10 R3 R9 + 0x782A0003, // 0013 JMPF R10 #0018 + 0x8C280106, // 0014 GETMET R10 R0 K6 + 0x5C300600, // 0015 MOVE R12 R3 + 0x7C280400, // 0016 CALL R10 2 + 0x5C201400, // 0017 MOVE R8 R10 + 0x58280004, // 0018 LDCONST R10 K4 + 0x602C000C, // 0019 GETGBL R11 G12 + 0x88300100, // 001A GETMBR R12 R0 K0 + 0x7C2C0200, // 001B CALL R11 1 + 0x142C140B, // 001C LT R11 R10 R11 + 0x782E0027, // 001D JMPF R11 #0046 + 0x882C0100, // 001E GETMBR R11 R0 K0 + 0x942C160A, // 001F GETIDX R11 R11 R10 + 0x8C300B07, // 0020 GETMET R12 R5 K7 + 0x5C381600, // 0021 MOVE R14 R11 + 0x5C3C0200, // 0022 MOVE R15 R1 + 0x7C300600, // 0023 CALL R12 3 + 0x60340004, // 0024 GETGBL R13 G4 + 0x5C381800, // 0025 MOVE R14 R12 + 0x7C340200, // 0026 CALL R13 1 + 0x1C341B08, // 0027 EQ R13 R13 K8 + 0x7836001A, // 0028 JMPF R13 #0044 + 0xA8020008, // 0029 EXBLK 0 #0033 + 0x5C341800, // 002A MOVE R13 R12 + 0x5C381600, // 002B MOVE R14 R11 + 0x5C3C0200, // 002C MOVE R15 R1 + 0x5C400E00, // 002D MOVE R16 R7 + 0x5C441000, // 002E MOVE R17 R8 + 0x5C480800, // 002F MOVE R18 R4 + 0x7C340A00, // 0030 CALL R13 5 + 0xA8040001, // 0031 EXBLK 1 1 + 0x70020010, // 0032 JMP #0044 + 0xAC340002, // 0033 CATCH R13 0 2 + 0x7002000D, // 0034 JMP #0043 + 0x603C0001, // 0035 GETGBL R15 G1 + 0x8C400D09, // 0036 GETMET R16 R6 K9 + 0x5848000A, // 0037 LDCONST R18 K10 + 0x5C4C1A00, // 0038 MOVE R19 R13 + 0x5C501C00, // 0039 MOVE R20 R14 + 0x7C400800, // 003A CALL R16 4 + 0x7C3C0200, // 003B CALL R15 1 + 0xB83E1600, // 003C GETNGBL R15 K11 + 0x883C1F0C, // 003D GETMBR R15 R15 K12 + 0x783E0002, // 003E JMPF R15 #0042 + 0xA43E1A00, // 003F IMPORT R15 K13 + 0x8C401F0E, // 0040 GETMET R16 R15 K14 + 0x7C400200, // 0041 CALL R16 1 + 0x70020000, // 0042 JMP #0044 + 0xB0080000, // 0043 RAISE 2 R0 R0 + 0x0028150F, // 0044 ADD R10 R10 K15 + 0x7001FFD2, // 0045 JMP #0019 + 0x80000000, // 0046 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: zb_coord +********************************************************************/ +extern const bclass be_class_zb_coord_ntv; +be_local_class(zb_coord, + 1, + &be_class_zb_coord_ntv, + be_nested_map(4, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(dispatch, 1), be_const_closure(zb_coord_dispatch_closure) }, + { be_const_key_weak(add_handler, 2), be_const_closure(zb_coord_add_handler_closure) }, + { be_const_key_weak(_handlers, -1), be_const_var(0) }, + { be_const_key_weak(init, 0), be_const_closure(zb_coord_init_closure) }, + })), + be_str_weak(zb_coord) +); +/*******************************************************************/ + +void be_load_zb_coord_class(bvm *vm) { + be_pushntvclass(vm, &be_class_zb_coord); + be_setglobal(vm, "zb_coord"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee_zcl_attribute.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee_zcl_attribute.h new file mode 100644 index 000000000..bbe87c457 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee_zcl_attribute.h @@ -0,0 +1,1134 @@ +/* Solidification of zigbee_zcl_attribute.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: tomap +********************************************************************/ +be_local_closure(zcl_attribute_tomap, /* 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[ 7]) { /* constants */ + /* K0 */ be_nested_str_weak(tomap), + /* K1 */ be_nested_str_weak(cluster), + /* K2 */ be_nested_str_weak(attr_id), + /* K3 */ be_nested_str_weak(cmd), + /* K4 */ be_nested_str_weak(direction), + /* K5 */ be_nested_str_weak(key), + /* K6 */ be_nested_str_weak(val), + }), + be_str_weak(tomap), + &be_const_str_solidified, + ( &(const binstruction[18]) { /* code */ + 0x60040003, // 0000 GETGBL R1 G3 + 0x5C080000, // 0001 MOVE R2 R0 + 0x7C040200, // 0002 CALL R1 1 + 0x8C040300, // 0003 GETMET R1 R1 K0 + 0x7C040200, // 0004 CALL R1 1 + 0x88080101, // 0005 GETMBR R2 R0 K1 + 0x98060202, // 0006 SETIDX R1 K1 R2 + 0x88080102, // 0007 GETMBR R2 R0 K2 + 0x98060402, // 0008 SETIDX R1 K2 R2 + 0x88080103, // 0009 GETMBR R2 R0 K3 + 0x98060602, // 000A SETIDX R1 K3 R2 + 0x88080104, // 000B GETMBR R2 R0 K4 + 0x98060802, // 000C SETIDX R1 K4 R2 + 0x88080105, // 000D GETMBR R2 R0 K5 + 0x98060A02, // 000E SETIDX R1 K5 R2 + 0x88080106, // 000F GETMBR R2 R0 K6 + 0x98060C02, // 0010 SETIDX R1 K6 R2 + 0x80040200, // 0011 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: key_tostring +********************************************************************/ +be_local_closure(zcl_attribute_key_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[15]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(_X3Cundefined_X3E), + /* K2 */ be_nested_str_weak(key), + /* K3 */ be_nested_str_weak(key_suffix), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(cluster), + /* K6 */ be_nested_str_weak(attr_id), + /* K7 */ be_nested_str_weak(format), + /* K8 */ be_nested_str_weak(_X2504X_X2F_X2504X), + /* K9 */ be_nested_str_weak(_X2B), + /* K10 */ be_nested_str_weak(cmd), + /* K11 */ be_nested_str_weak(direction), + /* K12 */ be_nested_str_weak(_X2504X_X25s_X2502X), + /* K13 */ be_nested_str_weak(_X3C), + /* K14 */ be_nested_str_weak(_X21), + }), + be_str_weak(key_tostring), + &be_const_str_solidified, + ( &(const binstruction[70]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x58080001, // 0001 LDCONST R2 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x4C100000, // 0003 LDNIL R4 + 0x20100604, // 0004 NE R4 R3 R4 + 0x78120008, // 0005 JMPF R4 #000F + 0x5C080600, // 0006 MOVE R2 R3 + 0x88100103, // 0007 GETMBR R4 R0 K3 + 0x24100904, // 0008 GT R4 R4 K4 + 0x78120003, // 0009 JMPF R4 #000E + 0x60100008, // 000A GETGBL R4 G8 + 0x88140103, // 000B GETMBR R5 R0 K3 + 0x7C100200, // 000C CALL R4 1 + 0x00080404, // 000D ADD R2 R2 R4 + 0x70020035, // 000E JMP #0045 + 0x88100105, // 000F GETMBR R4 R0 K5 + 0x4C140000, // 0010 LDNIL R5 + 0x20100805, // 0011 NE R4 R4 R5 + 0x78120012, // 0012 JMPF R4 #0026 + 0x88100106, // 0013 GETMBR R4 R0 K6 + 0x4C140000, // 0014 LDNIL R5 + 0x20100805, // 0015 NE R4 R4 R5 + 0x7812000E, // 0016 JMPF R4 #0026 + 0x8C100307, // 0017 GETMET R4 R1 K7 + 0x58180008, // 0018 LDCONST R6 K8 + 0x881C0105, // 0019 GETMBR R7 R0 K5 + 0x88200106, // 001A GETMBR R8 R0 K6 + 0x7C100800, // 001B CALL R4 4 + 0x5C080800, // 001C MOVE R2 R4 + 0x88100103, // 001D GETMBR R4 R0 K3 + 0x24100904, // 001E GT R4 R4 K4 + 0x78120004, // 001F JMPF R4 #0025 + 0x60100008, // 0020 GETGBL R4 G8 + 0x88140103, // 0021 GETMBR R5 R0 K3 + 0x7C100200, // 0022 CALL R4 1 + 0x00121204, // 0023 ADD R4 K9 R4 + 0x00080404, // 0024 ADD R2 R2 R4 + 0x7002001E, // 0025 JMP #0045 + 0x88100105, // 0026 GETMBR R4 R0 K5 + 0x4C140000, // 0027 LDNIL R5 + 0x20100805, // 0028 NE R4 R4 R5 + 0x7812001A, // 0029 JMPF R4 #0045 + 0x8810010A, // 002A GETMBR R4 R0 K10 + 0x4C140000, // 002B LDNIL R5 + 0x20100805, // 002C NE R4 R4 R5 + 0x78120016, // 002D JMPF R4 #0045 + 0x8810010B, // 002E GETMBR R4 R0 K11 + 0x4C140000, // 002F LDNIL R5 + 0x20100805, // 0030 NE R4 R4 R5 + 0x78120012, // 0031 JMPF R4 #0045 + 0x8C100307, // 0032 GETMET R4 R1 K7 + 0x5818000C, // 0033 LDCONST R6 K12 + 0x881C0105, // 0034 GETMBR R7 R0 K5 + 0x8820010B, // 0035 GETMBR R8 R0 K11 + 0x78220001, // 0036 JMPF R8 #0039 + 0x5820000D, // 0037 LDCONST R8 K13 + 0x70020000, // 0038 JMP #003A + 0x5820000E, // 0039 LDCONST R8 K14 + 0x8824010A, // 003A GETMBR R9 R0 K10 + 0x7C100A00, // 003B CALL R4 5 + 0x5C080800, // 003C MOVE R2 R4 + 0x88100103, // 003D GETMBR R4 R0 K3 + 0x24100904, // 003E GT R4 R4 K4 + 0x78120004, // 003F JMPF R4 #0045 + 0x60100008, // 0040 GETGBL R4 G8 + 0x88140103, // 0041 GETMBR R5 R0 K3 + 0x7C100200, // 0042 CALL R4 1 + 0x00121204, // 0043 ADD R4 K9 R4 + 0x00080404, // 0044 ADD R2 R2 R4 + 0x80040400, // 0045 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: setmember +********************************************************************/ +be_local_closure(zcl_attribute_setmember, /* 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[16]) { /* constants */ + /* K0 */ be_nested_str_weak(cluster), + /* K1 */ be_nested_str_weak(_cluster), + /* K2 */ be_nested_str_weak(attr_id), + /* K3 */ be_nested_str_weak(_attr_id), + /* K4 */ be_nested_str_weak(_iscmd), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(cmd), + /* K7 */ be_nested_str_weak(_cmd), + /* K8 */ be_const_int(1), + /* K9 */ be_nested_str_weak(_direction), + /* K10 */ be_nested_str_weak(direction), + /* K11 */ be_nested_str_weak(val), + /* K12 */ be_nested_str_weak(_set_val), + /* K13 */ be_nested_str_weak(key), + /* K14 */ be_nested_str_weak(_set_key), + /* K15 */ be_nested_str_weak(setmember), + }), + be_str_weak(setmember), + &be_const_str_solidified, + ( &(const binstruction[72]) { /* code */ + 0x1C0C0300, // 0000 EQ R3 R1 K0 + 0x780E0007, // 0001 JMPF R3 #000A + 0x4C0C0000, // 0002 LDNIL R3 + 0x1C0C0403, // 0003 EQ R3 R2 R3 + 0x780E0002, // 0004 JMPF R3 #0008 + 0x540EFFFE, // 0005 LDINT R3 65535 + 0x90020203, // 0006 SETMBR R0 K1 R3 + 0x70020000, // 0007 JMP #0009 + 0x90020202, // 0008 SETMBR R0 K1 R2 + 0x7002003C, // 0009 JMP #0047 + 0x1C0C0302, // 000A EQ R3 R1 K2 + 0x780E0008, // 000B JMPF R3 #0015 + 0x4C0C0000, // 000C LDNIL R3 + 0x1C0C0403, // 000D EQ R3 R2 R3 + 0x780E0002, // 000E JMPF R3 #0012 + 0x540EFFFE, // 000F LDINT R3 65535 + 0x90020603, // 0010 SETMBR R0 K3 R3 + 0x70020001, // 0011 JMP #0014 + 0x90020602, // 0012 SETMBR R0 K3 R2 + 0x90020905, // 0013 SETMBR R0 K4 K5 + 0x70020031, // 0014 JMP #0047 + 0x1C0C0306, // 0015 EQ R3 R1 K6 + 0x780E000D, // 0016 JMPF R3 #0025 + 0x4C0C0000, // 0017 LDNIL R3 + 0x1C0C0403, // 0018 EQ R3 R2 R3 + 0x780E0002, // 0019 JMPF R3 #001D + 0x540E00FE, // 001A LDINT R3 255 + 0x90020E03, // 001B SETMBR R0 K7 R3 + 0x70020006, // 001C JMP #0024 + 0x90020E02, // 001D SETMBR R0 K7 R2 + 0x90020908, // 001E SETMBR R0 K4 K8 + 0x880C0109, // 001F GETMBR R3 R0 K9 + 0x541200FE, // 0020 LDINT R4 255 + 0x1C0C0604, // 0021 EQ R3 R3 R4 + 0x780E0000, // 0022 JMPF R3 #0024 + 0x90021305, // 0023 SETMBR R0 K9 K5 + 0x70020021, // 0024 JMP #0047 + 0x1C0C030A, // 0025 EQ R3 R1 K10 + 0x780E000C, // 0026 JMPF R3 #0034 + 0x4C0C0000, // 0027 LDNIL R3 + 0x1C0C0403, // 0028 EQ R3 R2 R3 + 0x780E0002, // 0029 JMPF R3 #002D + 0x540E00FE, // 002A LDINT R3 255 + 0x90021203, // 002B SETMBR R0 K9 R3 + 0x70020005, // 002C JMP #0033 + 0x780A0001, // 002D JMPF R2 #0030 + 0x580C0008, // 002E LDCONST R3 K8 + 0x70020000, // 002F JMP #0031 + 0x580C0005, // 0030 LDCONST R3 K5 + 0x90021203, // 0031 SETMBR R0 K9 R3 + 0x90020908, // 0032 SETMBR R0 K4 K8 + 0x70020012, // 0033 JMP #0047 + 0x1C0C030B, // 0034 EQ R3 R1 K11 + 0x780E0003, // 0035 JMPF R3 #003A + 0x8C0C010C, // 0036 GETMET R3 R0 K12 + 0x5C140400, // 0037 MOVE R5 R2 + 0x7C0C0400, // 0038 CALL R3 2 + 0x7002000C, // 0039 JMP #0047 + 0x1C0C030D, // 003A EQ R3 R1 K13 + 0x780E0003, // 003B JMPF R3 #0040 + 0x8C0C010E, // 003C GETMET R3 R0 K14 + 0x5C140400, // 003D MOVE R5 R2 + 0x7C0C0400, // 003E CALL R3 2 + 0x70020006, // 003F JMP #0047 + 0x600C0003, // 0040 GETGBL R3 G3 + 0x5C100000, // 0041 MOVE R4 R0 + 0x7C0C0200, // 0042 CALL R3 1 + 0x8C0C070F, // 0043 GETMET R3 R3 K15 + 0x5C140200, // 0044 MOVE R5 R1 + 0x5C180400, // 0045 MOVE R6 R2 + 0x7C0C0600, // 0046 CALL R3 3 + 0x80000000, // 0047 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tostring +********************************************************************/ +be_local_closure(zcl_attribute_tostring, /* 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[15]) { /* constants */ + /* K0 */ be_nested_str_weak(introspect), + /* K1 */ be_nested_str_weak(json), + /* K2 */ be_nested_str_weak(string), + /* K3 */ be_nested_str_weak(dump), + /* K4 */ be_nested_str_weak(key_tostring), + /* K5 */ be_nested_str_weak(_X3A), + /* K6 */ be_nested_str_weak(get), + /* K7 */ be_nested_str_weak(val), + /* K8 */ be_nested_str_weak(tojson), + /* K9 */ be_nested_str_weak(cluster), + /* K10 */ be_nested_str_weak(attr_id), + /* K11 */ be_nested_str_weak(key), + /* K12 */ be_nested_str_weak(format), + /* K13 */ be_nested_str_weak(_X28_X25s_X29), + /* K14 */ be_nested_str_weak(_X2C_X25s_X3A_X22_X2504X_X2F_X2504X_X22), + }), + be_str_weak(tostring), + &be_const_str_solidified, + ( &(const binstruction[51]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0xA40E0400, // 0002 IMPORT R3 K2 + 0x8C100503, // 0003 GETMET R4 R2 K3 + 0x8C180104, // 0004 GETMET R6 R0 K4 + 0x7C180200, // 0005 CALL R6 1 + 0x7C100400, // 0006 CALL R4 2 + 0x00100905, // 0007 ADD R4 R4 K5 + 0x8C140306, // 0008 GETMET R5 R1 K6 + 0x881C0107, // 0009 GETMBR R7 R0 K7 + 0x58200008, // 000A LDCONST R8 K8 + 0x7C140600, // 000B CALL R5 3 + 0x4C180000, // 000C LDNIL R6 + 0x20140A06, // 000D NE R5 R5 R6 + 0x78160004, // 000E JMPF R5 #0014 + 0x88140107, // 000F GETMBR R5 R0 K7 + 0x8C140B08, // 0010 GETMET R5 R5 K8 + 0x7C140200, // 0011 CALL R5 1 + 0x00100805, // 0012 ADD R4 R4 R5 + 0x70020003, // 0013 JMP #0018 + 0x8C140503, // 0014 GETMET R5 R2 K3 + 0x881C0107, // 0015 GETMBR R7 R0 K7 + 0x7C140400, // 0016 CALL R5 2 + 0x00100805, // 0017 ADD R4 R4 R5 + 0x88140109, // 0018 GETMBR R5 R0 K9 + 0x4C180000, // 0019 LDNIL R6 + 0x20140A06, // 001A NE R5 R5 R6 + 0x78160015, // 001B JMPF R5 #0032 + 0x8814010A, // 001C GETMBR R5 R0 K10 + 0x4C180000, // 001D LDNIL R6 + 0x20140A06, // 001E NE R5 R5 R6 + 0x78160011, // 001F JMPF R5 #0032 + 0x8814010B, // 0020 GETMBR R5 R0 K11 + 0x4C180000, // 0021 LDNIL R6 + 0x20140A06, // 0022 NE R5 R5 R6 + 0x7816000D, // 0023 JMPF R5 #0032 + 0x8C14070C, // 0024 GETMET R5 R3 K12 + 0x581C000D, // 0025 LDCONST R7 K13 + 0x8C200104, // 0026 GETMET R8 R0 K4 + 0x7C200200, // 0027 CALL R8 1 + 0x7C140600, // 0028 CALL R5 3 + 0x8C18070C, // 0029 GETMET R6 R3 K12 + 0x5820000E, // 002A LDCONST R8 K14 + 0x8C240503, // 002B GETMET R9 R2 K3 + 0x5C2C0A00, // 002C MOVE R11 R5 + 0x7C240400, // 002D CALL R9 2 + 0x88280109, // 002E GETMBR R10 R0 K9 + 0x882C010A, // 002F GETMBR R11 R0 K10 + 0x7C180A00, // 0030 CALL R6 5 + 0x00100806, // 0031 ADD R4 R4 R6 + 0x80040800, // 0032 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(zcl_attribute_init, /* 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_weak(init), + /* K1 */ be_nested_str_weak(_init), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x4C080000, // 0006 LDNIL R2 + 0x1C080202, // 0007 EQ R2 R1 R2 + 0x780A0001, // 0008 JMPF R2 #000B + 0x8C080101, // 0009 GETMET R2 R0 K1 + 0x7C080200, // 000A CALL R2 1 + 0x80000000, // 000B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: deinit +********************************************************************/ +be_local_closure(zcl_attribute_deinit, /* 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_weak(ismapped), + /* K1 */ be_nested_str_weak(_deinit), + }), + be_str_weak(deinit), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0x74060001, // 0002 JMPT R1 #0005 + 0x8C040101, // 0003 GETMET R1 R0 K1 + 0x7C040200, // 0004 CALL R1 1 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: member +********************************************************************/ +be_local_closure(zcl_attribute_member, /* 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[16]) { /* constants */ + /* K0 */ be_nested_str_weak(cluster), + /* K1 */ be_nested_str_weak(_cluster), + /* K2 */ be_nested_str_weak(attr_id), + /* K3 */ be_nested_str_weak(_attr_id), + /* K4 */ be_nested_str_weak(_iscmd), + /* K5 */ be_nested_str_weak(cmd), + /* K6 */ be_nested_str_weak(_cmd), + /* K7 */ be_nested_str_weak(direction), + /* K8 */ be_nested_str_weak(_direction), + /* K9 */ be_const_int(1), + /* K10 */ be_nested_str_weak(val), + /* K11 */ be_nested_str_weak(_get_val), + /* K12 */ be_nested_str_weak(tohex), + /* K13 */ be_nested_str_weak(key), + /* K14 */ be_nested_str_weak(_get_key), + /* K15 */ be_nested_str_weak(member), + }), + be_str_weak(member), + &be_const_str_solidified, + ( &(const binstruction[78]) { /* code */ + 0x1C080300, // 0000 EQ R2 R1 K0 + 0x780A0008, // 0001 JMPF R2 #000B + 0x88080101, // 0002 GETMBR R2 R0 K1 + 0x540EFFFE, // 0003 LDINT R3 65535 + 0x200C0403, // 0004 NE R3 R2 R3 + 0x780E0001, // 0005 JMPF R3 #0008 + 0x5C0C0400, // 0006 MOVE R3 R2 + 0x70020000, // 0007 JMP #0009 + 0x4C0C0000, // 0008 LDNIL R3 + 0x80040600, // 0009 RET 1 R3 + 0x70020041, // 000A JMP #004D + 0x1C080302, // 000B EQ R2 R1 K2 + 0x780A000A, // 000C JMPF R2 #0018 + 0x88080103, // 000D GETMBR R2 R0 K3 + 0x540EFFFE, // 000E LDINT R3 65535 + 0x200C0403, // 000F NE R3 R2 R3 + 0x780E0003, // 0010 JMPF R3 #0015 + 0x880C0104, // 0011 GETMBR R3 R0 K4 + 0x740E0001, // 0012 JMPT R3 #0015 + 0x5C0C0400, // 0013 MOVE R3 R2 + 0x70020000, // 0014 JMP #0016 + 0x4C0C0000, // 0015 LDNIL R3 + 0x80040600, // 0016 RET 1 R3 + 0x70020034, // 0017 JMP #004D + 0x1C080305, // 0018 EQ R2 R1 K5 + 0x780A000A, // 0019 JMPF R2 #0025 + 0x88080106, // 001A GETMBR R2 R0 K6 + 0x540E00FE, // 001B LDINT R3 255 + 0x200C0403, // 001C NE R3 R2 R3 + 0x780E0003, // 001D JMPF R3 #0022 + 0x880C0104, // 001E GETMBR R3 R0 K4 + 0x780E0001, // 001F JMPF R3 #0022 + 0x5C0C0400, // 0020 MOVE R3 R2 + 0x70020000, // 0021 JMP #0023 + 0x4C0C0000, // 0022 LDNIL R3 + 0x80040600, // 0023 RET 1 R3 + 0x70020027, // 0024 JMP #004D + 0x1C080307, // 0025 EQ R2 R1 K7 + 0x780A000A, // 0026 JMPF R2 #0032 + 0x88080108, // 0027 GETMBR R2 R0 K8 + 0x540E00FE, // 0028 LDINT R3 255 + 0x200C0403, // 0029 NE R3 R2 R3 + 0x780E0003, // 002A JMPF R3 #002F + 0x880C0104, // 002B GETMBR R3 R0 K4 + 0x780E0001, // 002C JMPF R3 #002F + 0x2C0C0509, // 002D AND R3 R2 K9 + 0x70020000, // 002E JMP #0030 + 0x4C0C0000, // 002F LDNIL R3 + 0x80040600, // 0030 RET 1 R3 + 0x7002001A, // 0031 JMP #004D + 0x1C08030A, // 0032 EQ R2 R1 K10 + 0x780A000B, // 0033 JMPF R2 #0040 + 0x8C08010B, // 0034 GETMET R2 R0 K11 + 0x7C080200, // 0035 CALL R2 1 + 0x600C000F, // 0036 GETGBL R3 G15 + 0x5C100400, // 0037 MOVE R4 R2 + 0x60140015, // 0038 GETGBL R5 G21 + 0x7C0C0400, // 0039 CALL R3 2 + 0x780E0002, // 003A JMPF R3 #003E + 0x8C0C050C, // 003B GETMET R3 R2 K12 + 0x7C0C0200, // 003C CALL R3 1 + 0x5C080600, // 003D MOVE R2 R3 + 0x80040400, // 003E RET 1 R2 + 0x7002000C, // 003F JMP #004D + 0x1C08030D, // 0040 EQ R2 R1 K13 + 0x780A0003, // 0041 JMPF R2 #0046 + 0x8C08010E, // 0042 GETMET R2 R0 K14 + 0x7C080200, // 0043 CALL R2 1 + 0x80040400, // 0044 RET 1 R2 + 0x70020006, // 0045 JMP #004D + 0x60080003, // 0046 GETGBL R2 G3 + 0x5C0C0000, // 0047 MOVE R3 R0 + 0x7C080200, // 0048 CALL R2 1 + 0x8C08050F, // 0049 GETMET R2 R2 K15 + 0x5C100200, // 004A MOVE R4 R1 + 0x7C080400, // 004B CALL R2 2 + 0x80040400, // 004C RET 1 R2 + 0x80000000, // 004D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: zcl_attribute +********************************************************************/ +extern const bclass be_class_zcl_attribute_ntv; +be_local_class(zcl_attribute, + 0, + &be_class_zcl_attribute_ntv, + be_nested_map(7, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(tomap, -1), be_const_closure(zcl_attribute_tomap_closure) }, + { be_const_key_weak(key_tostring, -1), be_const_closure(zcl_attribute_key_tostring_closure) }, + { be_const_key_weak(init, -1), be_const_closure(zcl_attribute_init_closure) }, + { be_const_key_weak(tostring, -1), be_const_closure(zcl_attribute_tostring_closure) }, + { be_const_key_weak(deinit, 2), be_const_closure(zcl_attribute_deinit_closure) }, + { be_const_key_weak(setmember, 4), be_const_closure(zcl_attribute_setmember_closure) }, + { be_const_key_weak(member, -1), be_const_closure(zcl_attribute_member_closure) }, + })), + be_str_weak(zcl_attribute) +); +/*******************************************************************/ + +void be_load_zcl_attribute_class(bvm *vm) { + be_pushntvclass(vm, &be_class_zcl_attribute); + be_setglobal(vm, "zcl_attribute"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified function: member +********************************************************************/ +be_local_closure(zcl_attribute_list_member, /* 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[ 7]) { /* constants */ + /* K0 */ be_nested_str_weak(groupaddr), + /* K1 */ be_nested_str_weak(_groupaddr), + /* K2 */ be_nested_str_weak(src_ep), + /* K3 */ be_nested_str_weak(_src_ep), + /* K4 */ be_nested_str_weak(lqi), + /* K5 */ be_nested_str_weak(_lqi), + /* K6 */ be_nested_str_weak(member), + }), + be_str_weak(member), + &be_const_str_solidified, + ( &(const binstruction[41]) { /* code */ + 0x1C080300, // 0000 EQ R2 R1 K0 + 0x780A0008, // 0001 JMPF R2 #000B + 0x88080101, // 0002 GETMBR R2 R0 K1 + 0x540EFFFE, // 0003 LDINT R3 65535 + 0x200C0403, // 0004 NE R3 R2 R3 + 0x780E0001, // 0005 JMPF R3 #0008 + 0x5C0C0400, // 0006 MOVE R3 R2 + 0x70020000, // 0007 JMP #0009 + 0x4C0C0000, // 0008 LDNIL R3 + 0x80040600, // 0009 RET 1 R3 + 0x7002001C, // 000A JMP #0028 + 0x1C080302, // 000B EQ R2 R1 K2 + 0x780A0008, // 000C JMPF R2 #0016 + 0x88080103, // 000D GETMBR R2 R0 K3 + 0x540E00FE, // 000E LDINT R3 255 + 0x200C0403, // 000F NE R3 R2 R3 + 0x780E0001, // 0010 JMPF R3 #0013 + 0x5C0C0400, // 0011 MOVE R3 R2 + 0x70020000, // 0012 JMP #0014 + 0x4C0C0000, // 0013 LDNIL R3 + 0x80040600, // 0014 RET 1 R3 + 0x70020011, // 0015 JMP #0028 + 0x1C080304, // 0016 EQ R2 R1 K4 + 0x780A0008, // 0017 JMPF R2 #0021 + 0x88080105, // 0018 GETMBR R2 R0 K5 + 0x540E00FE, // 0019 LDINT R3 255 + 0x200C0403, // 001A NE R3 R2 R3 + 0x780E0001, // 001B JMPF R3 #001E + 0x5C0C0400, // 001C MOVE R3 R2 + 0x70020000, // 001D JMP #001F + 0x4C0C0000, // 001E LDNIL R3 + 0x80040600, // 001F RET 1 R3 + 0x70020006, // 0020 JMP #0028 + 0x60080003, // 0021 GETGBL R2 G3 + 0x5C0C0000, // 0022 MOVE R3 R0 + 0x7C080200, // 0023 CALL R2 1 + 0x8C080506, // 0024 GETMET R2 R2 K6 + 0x5C100200, // 0025 MOVE R4 R1 + 0x7C080400, // 0026 CALL R2 2 + 0x80040400, // 0027 RET 1 R2 + 0x80000000, // 0028 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: setmember +********************************************************************/ +be_local_closure(zcl_attribute_list_setmember, /* 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[ 7]) { /* constants */ + /* K0 */ be_nested_str_weak(groupaddr), + /* K1 */ be_nested_str_weak(_groupaddr), + /* K2 */ be_nested_str_weak(src_ep), + /* K3 */ be_nested_str_weak(_src_ep), + /* K4 */ be_nested_str_weak(lqi), + /* K5 */ be_nested_str_weak(_lqi), + /* K6 */ be_nested_str_weak(setmember), + }), + be_str_weak(setmember), + &be_const_str_solidified, + ( &(const binstruction[38]) { /* code */ + 0x1C0C0300, // 0000 EQ R3 R1 K0 + 0x780E0007, // 0001 JMPF R3 #000A + 0x4C0C0000, // 0002 LDNIL R3 + 0x200C0403, // 0003 NE R3 R2 R3 + 0x780E0001, // 0004 JMPF R3 #0007 + 0x5C0C0400, // 0005 MOVE R3 R2 + 0x70020000, // 0006 JMP #0008 + 0x540EFFFE, // 0007 LDINT R3 65535 + 0x90020203, // 0008 SETMBR R0 K1 R3 + 0x7002001A, // 0009 JMP #0025 + 0x1C0C0302, // 000A EQ R3 R1 K2 + 0x780E0007, // 000B JMPF R3 #0014 + 0x4C0C0000, // 000C LDNIL R3 + 0x200C0403, // 000D NE R3 R2 R3 + 0x780E0001, // 000E JMPF R3 #0011 + 0x5C0C0400, // 000F MOVE R3 R2 + 0x70020000, // 0010 JMP #0012 + 0x540E00FE, // 0011 LDINT R3 255 + 0x90020603, // 0012 SETMBR R0 K3 R3 + 0x70020010, // 0013 JMP #0025 + 0x1C0C0304, // 0014 EQ R3 R1 K4 + 0x780E0007, // 0015 JMPF R3 #001E + 0x4C0C0000, // 0016 LDNIL R3 + 0x200C0403, // 0017 NE R3 R2 R3 + 0x780E0001, // 0018 JMPF R3 #001B + 0x5C0C0400, // 0019 MOVE R3 R2 + 0x70020000, // 001A JMP #001C + 0x540E00FE, // 001B LDINT R3 255 + 0x90020A03, // 001C SETMBR R0 K5 R3 + 0x70020006, // 001D JMP #0025 + 0x600C0003, // 001E GETGBL R3 G3 + 0x5C100000, // 001F MOVE R4 R0 + 0x7C0C0200, // 0020 CALL R3 1 + 0x8C0C0706, // 0021 GETMET R3 R3 K6 + 0x5C140200, // 0022 MOVE R5 R1 + 0x5C180400, // 0023 MOVE R6 R2 + 0x7C0C0600, // 0024 CALL R3 3 + 0x80000000, // 0025 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(zcl_attribute_list_init, /* 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_weak(init), + /* K1 */ be_nested_str_weak(_init), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x4C080000, // 0006 LDNIL R2 + 0x1C080202, // 0007 EQ R2 R1 R2 + 0x780A0001, // 0008 JMPF R2 #000B + 0x8C080101, // 0009 GETMET R2 R0 K1 + 0x7C080200, // 000A CALL R2 1 + 0x80000000, // 000B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: deinit +********************************************************************/ +be_local_closure(zcl_attribute_list_deinit, /* 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_weak(ismapped), + /* K1 */ be_nested_str_weak(_deinit), + }), + be_str_weak(deinit), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0x74060001, // 0002 JMPT R1 #0005 + 0x8C040101, // 0003 GETMET R1 R0 K1 + 0x7C040200, // 0004 CALL R1 1 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tostring +********************************************************************/ +be_local_closure(zcl_attribute_list_tostring, /* 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[20]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(json), + /* K2 */ be_nested_str_weak(shortaddr), + /* K3 */ be_nested_str_weak(push), + /* K4 */ be_nested_str_weak(format), + /* K5 */ be_nested_str_weak(_X22Device_X22_X3A_X220x_X2504X_X22), + /* K6 */ be_nested_str_weak(groupaddr), + /* K7 */ be_nested_str_weak(_X22Group_X22_X3A_X220x_X2504X_X22), + /* K8 */ be_const_int(0), + /* K9 */ be_nested_str_weak(size), + /* K10 */ be_nested_str_weak(tostring), + /* K11 */ be_const_int(1), + /* K12 */ be_nested_str_weak(src_ep), + /* K13 */ be_nested_str_weak(_X22Endpoint_X22_X3A_X25i), + /* K14 */ be_nested_str_weak(lqi), + /* K15 */ be_nested_str_weak(_X22LinkQuality_X22_X3A_X25i), + /* K16 */ be_nested_str_weak(_X7B), + /* K17 */ be_nested_str_weak(concat), + /* K18 */ be_nested_str_weak(_X2C), + /* K19 */ be_nested_str_weak(_X7D), + }), + be_str_weak(tostring), + &be_const_str_solidified, + ( &(const binstruction[62]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x600C0012, // 0002 GETGBL R3 G18 + 0x7C0C0000, // 0003 CALL R3 0 + 0x88100102, // 0004 GETMBR R4 R0 K2 + 0x4C140000, // 0005 LDNIL R5 + 0x20100805, // 0006 NE R4 R4 R5 + 0x78120005, // 0007 JMPF R4 #000E + 0x8C100703, // 0008 GETMET R4 R3 K3 + 0x8C180304, // 0009 GETMET R6 R1 K4 + 0x58200005, // 000A LDCONST R8 K5 + 0x88240102, // 000B GETMBR R9 R0 K2 + 0x7C180600, // 000C CALL R6 3 + 0x7C100400, // 000D CALL R4 2 + 0x88100106, // 000E GETMBR R4 R0 K6 + 0x4C140000, // 000F LDNIL R5 + 0x20100805, // 0010 NE R4 R4 R5 + 0x78120005, // 0011 JMPF R4 #0018 + 0x8C100703, // 0012 GETMET R4 R3 K3 + 0x8C180304, // 0013 GETMET R6 R1 K4 + 0x58200007, // 0014 LDCONST R8 K7 + 0x88240106, // 0015 GETMBR R9 R0 K6 + 0x7C180600, // 0016 CALL R6 3 + 0x7C100400, // 0017 CALL R4 2 + 0x58100008, // 0018 LDCONST R4 K8 + 0x8C140109, // 0019 GETMET R5 R0 K9 + 0x7C140200, // 001A CALL R5 1 + 0x14180805, // 001B LT R6 R4 R5 + 0x781A0006, // 001C JMPF R6 #0024 + 0x8C180703, // 001D GETMET R6 R3 K3 + 0x94200004, // 001E GETIDX R8 R0 R4 + 0x8C20110A, // 001F GETMET R8 R8 K10 + 0x7C200200, // 0020 CALL R8 1 + 0x7C180400, // 0021 CALL R6 2 + 0x0010090B, // 0022 ADD R4 R4 K11 + 0x7001FFF6, // 0023 JMP #001B + 0x8818010C, // 0024 GETMBR R6 R0 K12 + 0x4C1C0000, // 0025 LDNIL R7 + 0x20180C07, // 0026 NE R6 R6 R7 + 0x781A0005, // 0027 JMPF R6 #002E + 0x8C180703, // 0028 GETMET R6 R3 K3 + 0x8C200304, // 0029 GETMET R8 R1 K4 + 0x5828000D, // 002A LDCONST R10 K13 + 0x882C010C, // 002B GETMBR R11 R0 K12 + 0x7C200600, // 002C CALL R8 3 + 0x7C180400, // 002D CALL R6 2 + 0x8818010E, // 002E GETMBR R6 R0 K14 + 0x4C1C0000, // 002F LDNIL R7 + 0x20180C07, // 0030 NE R6 R6 R7 + 0x781A0005, // 0031 JMPF R6 #0038 + 0x8C180703, // 0032 GETMET R6 R3 K3 + 0x8C200304, // 0033 GETMET R8 R1 K4 + 0x5828000F, // 0034 LDCONST R10 K15 + 0x882C010E, // 0035 GETMBR R11 R0 K14 + 0x7C200600, // 0036 CALL R8 3 + 0x7C180400, // 0037 CALL R6 2 + 0x8C180711, // 0038 GETMET R6 R3 K17 + 0x58200012, // 0039 LDCONST R8 K18 + 0x7C180400, // 003A CALL R6 2 + 0x001A2006, // 003B ADD R6 K16 R6 + 0x00180D13, // 003C ADD R6 R6 K19 + 0x80040C00, // 003D RET 1 R6 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: zcl_attribute_list +********************************************************************/ +extern const bclass be_class_zcl_attribute_list_ntv; +be_local_class(zcl_attribute_list, + 1, + &be_class_zcl_attribute_list_ntv, + be_nested_map(6, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(shortaddr, -1), be_const_var(0) }, + { be_const_key_weak(member, 2), be_const_closure(zcl_attribute_list_member_closure) }, + { be_const_key_weak(tostring, 5), be_const_closure(zcl_attribute_list_tostring_closure) }, + { be_const_key_weak(init, -1), be_const_closure(zcl_attribute_list_init_closure) }, + { be_const_key_weak(deinit, -1), be_const_closure(zcl_attribute_list_deinit_closure) }, + { be_const_key_weak(setmember, -1), be_const_closure(zcl_attribute_list_setmember_closure) }, + })), + be_str_weak(zcl_attribute_list) +); +/*******************************************************************/ + +void be_load_zcl_attribute_list_class(bvm *vm) { + be_pushntvclass(vm, &be_class_zcl_attribute_list); + be_setglobal(vm, "zcl_attribute_list"); + be_pop(vm, 1); +} + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(zcl_attributes_init, /* name */ + be_nested_proto( + 9, /* nstack */ + 6, /* 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_weak(shortaddr), + /* K1 */ be_nested_str_weak(groupaddr), + /* K2 */ be_nested_str_weak(lqi), + /* K3 */ be_nested_str_weak(src_ep), + /* K4 */ be_nested_str_weak(attr_list), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* 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 + 0x6018000F, // 0004 GETGBL R6 G15 + 0x881C0104, // 0005 GETMBR R7 R0 K4 + 0x60200012, // 0006 GETGBL R8 G18 + 0x7C180400, // 0007 CALL R6 2 + 0x781A0001, // 0008 JMPF R6 #000B + 0x90020805, // 0009 SETMBR R0 K4 R5 + 0x70020002, // 000A JMP #000E + 0x60180012, // 000B GETGBL R6 G18 + 0x7C180000, // 000C CALL R6 0 + 0x90020806, // 000D SETMBR R0 K4 R6 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tostring +********************************************************************/ +be_local_closure(zcl_attributes_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[19]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(json), + /* K2 */ be_nested_str_weak(shortaddr), + /* K3 */ be_nested_str_weak(push), + /* K4 */ be_nested_str_weak(format), + /* K5 */ be_nested_str_weak(_X22Device_X22_X3A_X220x_X2504X_X22), + /* K6 */ be_nested_str_weak(_X22Group_X22_X3A_X220x_X2504X_X22), + /* K7 */ be_nested_str_weak(groupaddr), + /* K8 */ be_nested_str_weak(attr_list), + /* K9 */ be_nested_str_weak(tostring), + /* K10 */ be_nested_str_weak(stop_iteration), + /* K11 */ be_nested_str_weak(src_ep), + /* K12 */ be_nested_str_weak(_X22Endpoint_X22_X3A_X25i), + /* K13 */ be_nested_str_weak(lqi), + /* K14 */ be_nested_str_weak(_X22LinkQuality_X22_X3A_X25i), + /* K15 */ be_nested_str_weak(_X7B), + /* K16 */ be_nested_str_weak(concat), + /* K17 */ be_nested_str_weak(_X2C), + /* K18 */ be_nested_str_weak(_X7D), + }), + be_str_weak(tostring), + &be_const_str_solidified, + ( &(const binstruction[64]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x600C0012, // 0002 GETGBL R3 G18 + 0x7C0C0000, // 0003 CALL R3 0 + 0x88100102, // 0004 GETMBR R4 R0 K2 + 0x4C140000, // 0005 LDNIL R5 + 0x20100805, // 0006 NE R4 R4 R5 + 0x78120005, // 0007 JMPF R4 #000E + 0x8C100703, // 0008 GETMET R4 R3 K3 + 0x8C180304, // 0009 GETMET R6 R1 K4 + 0x58200005, // 000A LDCONST R8 K5 + 0x88240102, // 000B GETMBR R9 R0 K2 + 0x7C180600, // 000C CALL R6 3 + 0x7C100400, // 000D CALL R4 2 + 0x88100102, // 000E GETMBR R4 R0 K2 + 0x4C140000, // 000F LDNIL R5 + 0x20100805, // 0010 NE R4 R4 R5 + 0x78120005, // 0011 JMPF R4 #0018 + 0x8C100703, // 0012 GETMET R4 R3 K3 + 0x8C180304, // 0013 GETMET R6 R1 K4 + 0x58200006, // 0014 LDCONST R8 K6 + 0x88240107, // 0015 GETMBR R9 R0 K7 + 0x7C180600, // 0016 CALL R6 3 + 0x7C100400, // 0017 CALL R4 2 + 0x60100010, // 0018 GETGBL R4 G16 + 0x88140108, // 0019 GETMBR R5 R0 K8 + 0x7C100200, // 001A CALL R4 1 + 0xA8020006, // 001B EXBLK 0 #0023 + 0x5C140800, // 001C MOVE R5 R4 + 0x7C140000, // 001D CALL R5 0 + 0x8C180703, // 001E GETMET R6 R3 K3 + 0x8C200B09, // 001F GETMET R8 R5 K9 + 0x7C200200, // 0020 CALL R8 1 + 0x7C180400, // 0021 CALL R6 2 + 0x7001FFF8, // 0022 JMP #001C + 0x5810000A, // 0023 LDCONST R4 K10 + 0xAC100200, // 0024 CATCH R4 1 0 + 0xB0080000, // 0025 RAISE 2 R0 R0 + 0x8810010B, // 0026 GETMBR R4 R0 K11 + 0x4C140000, // 0027 LDNIL R5 + 0x20100805, // 0028 NE R4 R4 R5 + 0x78120005, // 0029 JMPF R4 #0030 + 0x8C100703, // 002A GETMET R4 R3 K3 + 0x8C180304, // 002B GETMET R6 R1 K4 + 0x5820000C, // 002C LDCONST R8 K12 + 0x8824010B, // 002D GETMBR R9 R0 K11 + 0x7C180600, // 002E CALL R6 3 + 0x7C100400, // 002F CALL R4 2 + 0x8810010D, // 0030 GETMBR R4 R0 K13 + 0x4C140000, // 0031 LDNIL R5 + 0x20100805, // 0032 NE R4 R4 R5 + 0x78120005, // 0033 JMPF R4 #003A + 0x8C100703, // 0034 GETMET R4 R3 K3 + 0x8C180304, // 0035 GETMET R6 R1 K4 + 0x5820000E, // 0036 LDCONST R8 K14 + 0x8824010D, // 0037 GETMBR R9 R0 K13 + 0x7C180600, // 0038 CALL R6 3 + 0x7C100400, // 0039 CALL R4 2 + 0x8C100710, // 003A GETMET R4 R3 K16 + 0x58180011, // 003B LDCONST R6 K17 + 0x7C100400, // 003C CALL R4 2 + 0x00121E04, // 003D ADD R4 K15 R4 + 0x00100912, // 003E ADD R4 R4 K18 + 0x80040800, // 003F RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: push +********************************************************************/ +be_local_closure(zcl_attributes_push, /* 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_weak(attr_list), + /* K1 */ be_nested_str_weak(push), + }), + be_str_weak(push), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: zcl_attributes +********************************************************************/ +be_local_class(zcl_attributes, + 5, + NULL, + be_nested_map(8, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(groupaddr, 6), be_const_var(1) }, + { be_const_key_weak(push, 4), be_const_closure(zcl_attributes_push_closure) }, + { be_const_key_weak(shortaddr, -1), be_const_var(0) }, + { be_const_key_weak(init, -1), be_const_closure(zcl_attributes_init_closure) }, + { be_const_key_weak(tostring, -1), be_const_closure(zcl_attributes_tostring_closure) }, + { be_const_key_weak(lqi, 1), be_const_var(2) }, + { be_const_key_weak(attr_list, -1), be_const_var(4) }, + { be_const_key_weak(src_ep, 0), be_const_var(3) }, + })), + be_str_weak(zcl_attributes) +); +/*******************************************************************/ + +void be_load_zcl_attributes_class(bvm *vm) { + be_pushntvclass(vm, &be_class_zcl_attributes); + be_setglobal(vm, "zcl_attributes"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */ diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee_zcl_frame.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee_zcl_frame.h new file mode 100644 index 000000000..1e10ccc93 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_zigbee_zcl_frame.h @@ -0,0 +1,233 @@ +/* Solidification of zigbee_zcl_frame.h */ +/********************************************************************\ +* Generated code, don't edit * +\********************************************************************/ +#include "be_constobj.h" + +/******************************************************************** +** Solidified function: member +********************************************************************/ +be_local_closure(zcl_frame_member, /* 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[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(payload), + /* K1 */ be_nested_str_weak(_get_bytes), + /* K2 */ be_nested_str_weak(payload_ptr), + /* K3 */ be_nested_str_weak(member), + }), + be_str_weak(member), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x1C080300, // 0000 EQ R2 R1 K0 + 0x780A0004, // 0001 JMPF R2 #0007 + 0x8C080101, // 0002 GETMET R2 R0 K1 + 0x88100102, // 0003 GETMBR R4 R0 K2 + 0x7C080400, // 0004 CALL R2 2 + 0x80040400, // 0005 RET 1 R2 + 0x70020006, // 0006 JMP #000E + 0x60080003, // 0007 GETGBL R2 G3 + 0x5C0C0000, // 0008 MOVE R3 R0 + 0x7C080200, // 0009 CALL R2 1 + 0x8C080503, // 000A GETMET R2 R2 K3 + 0x5C100200, // 000B MOVE R4 R1 + 0x7C080400, // 000C CALL R2 2 + 0x80040400, // 000D RET 1 R2 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: setmember +********************************************************************/ +be_local_closure(zcl_frame_setmember, /* 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[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(payload), + /* K1 */ be_nested_str_weak(_set_bytes), + /* K2 */ be_nested_str_weak(payload_ptr), + /* K3 */ be_nested_str_weak(setmember), + }), + be_str_weak(setmember), + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0x1C0C0300, // 0000 EQ R3 R1 K0 + 0x780E0005, // 0001 JMPF R3 #0008 + 0x8C0C0101, // 0002 GETMET R3 R0 K1 + 0x88140102, // 0003 GETMBR R5 R0 K2 + 0x5C180400, // 0004 MOVE R6 R2 + 0x7C0C0600, // 0005 CALL R3 3 + 0x80040600, // 0006 RET 1 R3 + 0x70020007, // 0007 JMP #0010 + 0x600C0003, // 0008 GETGBL R3 G3 + 0x5C100000, // 0009 MOVE R4 R0 + 0x7C0C0200, // 000A CALL R3 1 + 0x8C0C0703, // 000B GETMET R3 R3 K3 + 0x5C140200, // 000C MOVE R5 R1 + 0x5C180400, // 000D MOVE R6 R2 + 0x7C0C0600, // 000E CALL R3 3 + 0x80040600, // 000F RET 1 R3 + 0x80000000, // 0010 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(zcl_frame_init, /* 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_weak(init), + /* K1 */ be_nested_str_weak(no_bytes), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0x60080003, // 0000 GETGBL R2 G3 + 0x5C0C0000, // 0001 MOVE R3 R0 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080500, // 0003 GETMET R2 R2 K0 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x60080015, // 0006 GETGBL R2 G21 + 0x7C080000, // 0007 CALL R2 0 + 0x90020202, // 0008 SETMBR R0 K1 R2 + 0x80000000, // 0009 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tomap +********************************************************************/ +be_local_closure(zcl_frame_tomap, /* 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[ 7]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(tomap), + /* K2 */ be_nested_str_weak(shortaddr_hex), + /* K3 */ be_nested_str_weak(format), + /* K4 */ be_nested_str_weak(0x_X2504X), + /* K5 */ be_nested_str_weak(shortaddr), + /* K6 */ be_nested_str_weak(payload), + }), + be_str_weak(tomap), + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x60080003, // 0001 GETGBL R2 G3 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C080200, // 0003 CALL R2 1 + 0x8C080501, // 0004 GETMET R2 R2 K1 + 0x7C080200, // 0005 CALL R2 1 + 0x8C0C0303, // 0006 GETMET R3 R1 K3 + 0x58140004, // 0007 LDCONST R5 K4 + 0x88180105, // 0008 GETMBR R6 R0 K5 + 0x7C0C0600, // 0009 CALL R3 3 + 0x980A0403, // 000A SETIDX R2 K2 R3 + 0x880C0106, // 000B GETMBR R3 R0 K6 + 0x980A0C03, // 000C SETIDX R2 K6 R3 + 0x80040400, // 000D RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: tostring +********************************************************************/ +be_local_closure(zcl_frame_tostring, /* 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_weak(tomap), + }), + be_str_weak(tostring), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0x60080008, // 0002 GETGBL R2 G8 + 0x5C0C0200, // 0003 MOVE R3 R1 + 0x7C080200, // 0004 CALL R2 1 + 0x80040400, // 0005 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: zcl_frame +********************************************************************/ +extern const bclass be_class_zcl_frame_ntv; +be_local_class(zcl_frame, + 1, + &be_class_zcl_frame_ntv, + be_nested_map(6, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(no_bytes, -1), be_const_var(0) }, + { be_const_key_weak(member, 2), be_const_closure(zcl_frame_member_closure) }, + { be_const_key_weak(tostring, 5), be_const_closure(zcl_frame_tostring_closure) }, + { be_const_key_weak(init, -1), be_const_closure(zcl_frame_init_closure) }, + { be_const_key_weak(tomap, -1), be_const_closure(zcl_frame_tomap_closure) }, + { be_const_key_weak(setmember, -1), be_const_closure(zcl_frame_setmember_closure) }, + })), + be_str_weak(zcl_frame) +); +/*******************************************************************/ + +void be_load_zcl_frame_class(bvm *vm) { + be_pushntvclass(vm, &be_class_zcl_frame); + be_setglobal(vm, "zcl_frame"); + be_pop(vm, 1); +} +/********************************************************************/ +/* End of solidification */