From efb2423b8810c87ef4b55c7ed62074a688d60ac8 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 24 Apr 2022 10:18:40 +0200 Subject: [PATCH] OpenHASP support for qrcode --- .../berry_tasmota/src/be_lv_openhasp.c | 2142 ++++++++++------- .../openhasp_src/openhasp_core/openhasp.be | 45 +- 2 files changed, 1268 insertions(+), 919 deletions(-) diff --git a/lib/libesp32/berry_tasmota/src/be_lv_openhasp.c b/lib/libesp32/berry_tasmota/src/be_lv_openhasp.c index bac85fe1d..ba32c3bcc 100644 --- a/lib/libesp32/berry_tasmota/src/be_lv_openhasp.c +++ b/lib/libesp32/berry_tasmota/src/be_lv_openhasp.c @@ -39,6 +39,7 @@ extern const bclass be_class_lv_table; extern const bclass be_class_lv_textarea; extern const bclass be_class_lv_theme; extern const bclass be_class_lv_timer; +extern const bclass be_class_lv_qrcode; /******************************************************************** @@ -3655,69 +3656,73 @@ be_local_class(lvh_obj, { be_const_key_literal("set_text_font", 23), be_const_closure(lvh_obj_set_text_font_closure) }, { be_const_key_literal("set_pad_left2", 47), be_const_closure(lvh_obj_set_pad_left2_closure) }, { be_const_key_literal("_attr_map", -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { - be_const_map( * be_nested_map(61, + be_const_map( * be_nested_map(65, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_literal("action", 57), be_const_nil() }, - { be_const_key_literal("text", -1), be_const_nil() }, - { be_const_key_literal("text_color", -1), be_const_nil() }, - { be_const_key_literal("val", 42), be_nested_str_literal("value") }, - { be_const_key_literal("pad_right", -1), be_nested_str_literal("style_pad_right") }, - { be_const_key_literal("pad_left", -1), be_nested_str_literal("style_pad_left") }, - { be_const_key_literal("enabled", -1), be_const_nil() }, - { be_const_key_literal("hidden", -1), be_const_nil() }, - { be_const_key_literal("toggle", 44), be_const_nil() }, - { be_const_key_literal("pad_bottom", -1), be_nested_str_literal("style_pad_bottom") }, - { be_const_key_literal("line_width1", -1), be_const_nil() }, + { be_const_key_literal("x", -1), be_nested_str_literal("x") }, { be_const_key_literal("pad_left2", -1), be_const_nil() }, - { be_const_key_literal("rotation", 36), be_nested_str_literal("rotation") }, - { be_const_key_literal("bg_grad_color", -1), be_nested_str_literal("style_bg_grad_color") }, - { be_const_key_literal("x", 35), be_nested_str_literal("x") }, - { be_const_key_literal("border_side", -1), be_nested_str_literal("style_border_side") }, - { be_const_key_literal("border_width", -1), be_nested_str_literal("style_border_width") }, - { be_const_key_literal("h", 1), be_nested_str_literal("height") }, - { be_const_key_literal("type", 27), be_const_nil() }, - { be_const_key_literal("pad_all2", -1), be_const_nil() }, - { be_const_key_literal("text_rule_format", -1), be_const_nil() }, - { be_const_key_literal("image_recolor_opa", -1), be_nested_str_literal("style_img_recolor_opa") }, - { be_const_key_literal("border_color", -1), be_nested_str_literal("style_border_color") }, - { be_const_key_literal("src", -1), be_nested_str_literal("src") }, - { be_const_key_literal("val_rule_formula", -1), be_const_nil() }, - { be_const_key_literal("mode", -1), be_const_nil() }, - { be_const_key_literal("text_font", 19), be_const_nil() }, - { be_const_key_literal("y", -1), be_nested_str_literal("y") }, - { be_const_key_literal("align", -1), be_const_nil() }, - { be_const_key_literal("pad_bottom2", 41), be_const_nil() }, - { be_const_key_literal("pad_right2", 3), be_const_nil() }, - { be_const_key_literal("line_width", -1), be_const_nil() }, - { be_const_key_literal("bg_grad_dir", 10), be_nested_str_literal("style_bg_grad_dir") }, - { be_const_key_literal("text_rule", -1), be_const_nil() }, - { be_const_key_literal("text_rule_formula", 0), be_const_nil() }, + { be_const_key_literal("end_angle", -1), be_nested_str_literal("bg_end_angle") }, + { be_const_key_literal("rotation", -1), be_nested_str_literal("rotation") }, { be_const_key_literal("radius", -1), be_nested_str_literal("style_radius") }, - { be_const_key_literal("bg_opa", -1), be_nested_str_literal("style_bg_opa") }, - { be_const_key_literal("bg_color", -1), be_nested_str_literal("style_bg_color") }, - { be_const_key_literal("pad_all", -1), be_nested_str_literal("style_pad_all") }, - { be_const_key_literal("pad_top2", -1), be_const_nil() }, - { be_const_key_literal("pad_top", 7), be_nested_str_literal("style_pad_top") }, - { be_const_key_literal("click", 49), be_const_nil() }, - { be_const_key_literal("line_color", -1), be_nested_str_literal("style_line_color") }, - { be_const_key_literal("value_color", -1), be_const_nil() }, - { be_const_key_literal("start_angle", -1), be_nested_str_literal("bg_start_angle") }, - { be_const_key_literal("speed", -1), be_const_nil() }, - { be_const_key_literal("angle", -1), be_const_nil() }, - { be_const_key_literal("asjustable", 51), be_const_nil() }, - { be_const_key_literal("end_angle1", 46), be_nested_str_literal("end_angle") }, - { be_const_key_literal("min", -1), be_const_nil() }, - { be_const_key_literal("end_angle", 21), be_nested_str_literal("bg_end_angle") }, - { be_const_key_literal("start_angle1", -1), be_nested_str_literal("start_angle") }, { be_const_key_literal("value_ofs_y", -1), be_const_nil() }, - { be_const_key_literal("image_recolor", -1), be_nested_str_literal("style_img_recolor") }, - { be_const_key_literal("value_str", 2), be_const_nil() }, - { be_const_key_literal("radius2", 59), be_const_nil() }, + { be_const_key_literal("val", 38), be_nested_str_literal("value") }, + { be_const_key_literal("line_width", -1), be_const_nil() }, + { be_const_key_literal("speed", 57), be_const_nil() }, + { be_const_key_literal("radius2", -1), be_const_nil() }, + { be_const_key_literal("qr_text", -1), be_const_nil() }, + { be_const_key_literal("text_rule_formula", 42), be_const_nil() }, + { be_const_key_literal("bg_grad_dir", -1), be_nested_str_literal("style_bg_grad_dir") }, + { be_const_key_literal("mode", 59), be_const_nil() }, + { be_const_key_literal("bg_opa", -1), be_nested_str_literal("style_bg_opa") }, + { be_const_key_literal("text", -1), be_const_nil() }, + { be_const_key_literal("value_color", -1), be_const_nil() }, + { be_const_key_literal("enabled", 29), be_const_nil() }, + { be_const_key_literal("text_font", -1), be_const_nil() }, + { be_const_key_literal("text_rule_format", -1), be_const_nil() }, + { be_const_key_literal("value_str", 3), be_const_nil() }, + { be_const_key_literal("border_width", 62), be_nested_str_literal("style_border_width") }, + { be_const_key_literal("max", -1), be_const_nil() }, + { be_const_key_literal("angle", -1), be_const_nil() }, + { be_const_key_literal("text_rule", 21), be_const_nil() }, + { be_const_key_literal("min", 19), be_const_nil() }, + { be_const_key_literal("start_angle", 32), be_nested_str_literal("bg_start_angle") }, + { be_const_key_literal("qr_light_color", -1), be_const_nil() }, + { be_const_key_literal("border_side", -1), be_nested_str_literal("style_border_side") }, + { be_const_key_literal("src", -1), be_nested_str_literal("src") }, + { be_const_key_literal("w", 35), be_nested_str_literal("width") }, + { be_const_key_literal("value_font", 18), be_const_nil() }, + { be_const_key_literal("pad_bottom2", -1), be_const_nil() }, { be_const_key_literal("value_ofs_x", -1), be_const_nil() }, - { be_const_key_literal("val_rule", -1), be_const_nil() }, - { be_const_key_literal("w", -1), be_nested_str_literal("width") }, - { be_const_key_literal("value_font", -1), be_const_nil() }, - { be_const_key_literal("max", 11), be_const_nil() }, + { be_const_key_literal("pad_right", 23), be_nested_str_literal("style_pad_right") }, + { be_const_key_literal("pad_left", -1), be_nested_str_literal("style_pad_left") }, + { be_const_key_literal("h", -1), be_nested_str_literal("height") }, + { be_const_key_literal("line_color", 43), be_nested_str_literal("style_line_color") }, + { be_const_key_literal("image_recolor", -1), be_nested_str_literal("style_img_recolor") }, + { be_const_key_literal("qr_dark_color", 22), be_const_nil() }, + { be_const_key_literal("start_angle1", -1), be_nested_str_literal("start_angle") }, + { be_const_key_literal("align", 30), be_const_nil() }, + { be_const_key_literal("text_color", -1), be_const_nil() }, + { be_const_key_literal("y", -1), be_nested_str_literal("y") }, + { be_const_key_literal("val_rule", 15), be_const_nil() }, + { be_const_key_literal("qr_size", 49), be_const_nil() }, + { be_const_key_literal("bg_grad_color", -1), be_nested_str_literal("style_bg_grad_color") }, + { be_const_key_literal("asjustable", 54), be_const_nil() }, + { be_const_key_literal("hidden", 40), be_const_nil() }, + { be_const_key_literal("pad_top2", -1), be_const_nil() }, + { be_const_key_literal("pad_top", -1), be_nested_str_literal("style_pad_top") }, + { be_const_key_literal("end_angle1", 37), be_nested_str_literal("end_angle") }, + { be_const_key_literal("click", -1), be_const_nil() }, + { be_const_key_literal("pad_right2", -1), be_const_nil() }, + { be_const_key_literal("action", -1), be_const_nil() }, + { be_const_key_literal("image_recolor_opa", -1), be_nested_str_literal("style_img_recolor_opa") }, + { be_const_key_literal("border_color", 33), be_nested_str_literal("style_border_color") }, + { be_const_key_literal("toggle", -1), be_const_nil() }, + { be_const_key_literal("pad_all2", -1), be_const_nil() }, + { be_const_key_literal("type", -1), be_const_nil() }, + { be_const_key_literal("line_width1", -1), be_const_nil() }, + { be_const_key_literal("val_rule_formula", -1), be_const_nil() }, + { be_const_key_literal("pad_bottom", -1), be_nested_str_literal("style_pad_bottom") }, + { be_const_key_literal("bg_color", -1), be_nested_str_literal("style_bg_color") }, + { be_const_key_literal("pad_all", 55), be_nested_str_literal("style_pad_all") }, })) ) } )) }, { be_const_key_literal("get_value_ofs_y", -1), be_const_closure(lvh_obj_get_value_ofs_y_closure) }, { be_const_key_literal("_text_rule", -1), be_const_var(8) }, @@ -4635,6 +4640,306 @@ void be_load_lvh_dropdown_class(bvm *vm) { be_pop(vm, 1); } +/******************************************************************** +** Solidified function: get_qr_size +********************************************************************/ +be_local_closure(lvh_qrcode_get_qr_size, /* 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_literal("get_qr_size"), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_qr_size +********************************************************************/ +be_local_closure(lvh_qrcode_set_qr_size, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* 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_literal("set_qr_size"), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_qr_light_color +********************************************************************/ +be_local_closure(lvh_qrcode_get_qr_light_color, /* 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_literal("get_qr_light_color"), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_qr_dark_color +********************************************************************/ +be_local_closure(lvh_qrcode_get_qr_dark_color, /* 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_literal("get_qr_dark_color"), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(lvh_qrcode_init, /* name */ + be_nested_proto( + 13, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str_literal("_page"), + /* K1 */ be_nested_str_literal("find"), + /* K2 */ be_nested_str_literal("qr_size"), + /* K3 */ be_nested_str_literal("parse_color"), + /* K4 */ be_nested_str_literal("qr_dark_color"), + /* K5 */ be_nested_str_literal("#000000"), + /* K6 */ be_nested_str_literal("qr_light_color"), + /* K7 */ be_nested_str_literal("#FFFFFF"), + /* K8 */ be_nested_str_literal("_lv_obj"), + /* K9 */ be_nested_str_literal("lv"), + /* K10 */ be_nested_str_literal("qrcode"), + /* K11 */ be_nested_str_literal("post_init"), + }), + be_str_literal("init"), + &be_const_str_solidified, + ( &(const binstruction[28]) { /* code */ + 0x90020002, // 0000 SETMBR R0 K0 R2 + 0x8C100701, // 0001 GETMET R4 R3 K1 + 0x58180002, // 0002 LDCONST R6 K2 + 0x541E0063, // 0003 LDINT R7 100 + 0x7C100600, // 0004 CALL R4 3 + 0x8C140103, // 0005 GETMET R5 R0 K3 + 0x8C1C0701, // 0006 GETMET R7 R3 K1 + 0x58240004, // 0007 LDCONST R9 K4 + 0x58280005, // 0008 LDCONST R10 K5 + 0x7C1C0600, // 0009 CALL R7 3 + 0x7C140400, // 000A CALL R5 2 + 0x8C180103, // 000B GETMET R6 R0 K3 + 0x8C200701, // 000C GETMET R8 R3 K1 + 0x58280006, // 000D LDCONST R10 K6 + 0x582C0007, // 000E LDCONST R11 K7 + 0x7C200600, // 000F CALL R8 3 + 0x7C180400, // 0010 CALL R6 2 + 0xB81E1200, // 0011 GETNGBL R7 K9 + 0x8C1C0F0A, // 0012 GETMET R7 R7 K10 + 0x5C240200, // 0013 MOVE R9 R1 + 0x5C280800, // 0014 MOVE R10 R4 + 0x5C2C0A00, // 0015 MOVE R11 R5 + 0x5C300C00, // 0016 MOVE R12 R6 + 0x7C1C0A00, // 0017 CALL R7 5 + 0x90021007, // 0018 SETMBR R0 K8 R7 + 0x8C1C010B, // 0019 GETMET R7 R0 K11 + 0x7C1C0200, // 001A CALL R7 1 + 0x80000000, // 001B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_qr_light_color +********************************************************************/ +be_local_closure(lvh_qrcode_set_qr_light_color, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* 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_literal("set_qr_light_color"), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_qr_text +********************************************************************/ +be_local_closure(lvh_qrcode_get_qr_text, /* 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_literal("get_qr_text"), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_qr_dark_color +********************************************************************/ +be_local_closure(lvh_qrcode_set_qr_dark_color, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* 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_literal("set_qr_dark_color"), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_qr_text +********************************************************************/ +be_local_closure(lvh_qrcode_set_qr_text, /* 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_literal("_lv_obj"), + /* K1 */ be_nested_str_literal("update"), + }), + be_str_literal("set_qr_text"), + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x60080008, // 0000 GETGBL R2 G8 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x7C080200, // 0002 CALL R2 1 + 0x5C040400, // 0003 MOVE R1 R2 + 0x88080100, // 0004 GETMBR R2 R0 K0 + 0x8C080501, // 0005 GETMET R2 R2 K1 + 0x5C100200, // 0006 MOVE R4 R1 + 0x6014000C, // 0007 GETGBL R5 G12 + 0x5C180200, // 0008 MOVE R6 R1 + 0x7C140200, // 0009 CALL R5 1 + 0x7C080600, // 000A CALL R2 3 + 0x80000000, // 000B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lvh_qrcode +********************************************************************/ +extern const bclass be_class_lvh_obj; +be_local_class(lvh_qrcode, + 0, + &be_class_lvh_obj, + be_nested_map(10, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_literal("set_qr_text", -1), be_const_closure(lvh_qrcode_set_qr_text_closure) }, + { be_const_key_literal("set_qr_size", -1), be_const_closure(lvh_qrcode_set_qr_size_closure) }, + { be_const_key_literal("get_qr_light_color", 6), be_const_closure(lvh_qrcode_get_qr_light_color_closure) }, + { be_const_key_literal("set_qr_dark_color", -1), be_const_closure(lvh_qrcode_set_qr_dark_color_closure) }, + { be_const_key_literal("get_qr_text", -1), be_const_closure(lvh_qrcode_get_qr_text_closure) }, + { be_const_key_literal("init", -1), be_const_closure(lvh_qrcode_init_closure) }, + { be_const_key_literal("set_qr_light_color", -1), be_const_closure(lvh_qrcode_set_qr_light_color_closure) }, + { be_const_key_literal("_lv_class", 4), be_const_class(be_class_lv_qrcode) }, + { be_const_key_literal("get_qr_dark_color", 3), be_const_closure(lvh_qrcode_get_qr_dark_color_closure) }, + { be_const_key_literal("get_qr_size", 0), be_const_closure(lvh_qrcode_get_qr_size_closure) }, + })), + be_str_literal("lvh_qrcode") +); +/*******************************************************************/ + +void be_load_lvh_qrcode_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lvh_qrcode); + be_setglobal(vm, "lvh_qrcode"); + be_pop(vm, 1); +} + /******************************************************************** ** Solidified function: _anonymous_ ********************************************************************/ @@ -4664,6 +4969,118 @@ be_local_closure(openhasp__anonymous_, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: do_action +********************************************************************/ +be_local_closure(OpenHASP_do_action, /* 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[14]) { /* constants */ + /* K0 */ be_nested_str_literal("lv"), + /* K1 */ be_nested_str_literal("EVENT_CLICKED"), + /* K2 */ be_nested_str_literal("_action"), + /* K3 */ be_nested_str_literal("lvh_pages"), + /* K4 */ be_nested_str_literal("lvh_page_cur_idx"), + /* K5 */ be_nested_str_literal("pages_list_sorted"), + /* K6 */ be_const_int(1), + /* K7 */ be_nested_str_literal("prev"), + /* K8 */ be_nested_str_literal("next"), + /* K9 */ be_nested_str_literal("back"), + /* K10 */ be_nested_str_literal("re_page_target"), + /* K11 */ be_nested_str_literal("match"), + /* K12 */ be_const_int(0), + /* K13 */ be_nested_str_literal("show"), + }), + be_str_literal("do_action"), + &be_const_str_solidified, + ( &(const binstruction[74]) { /* code */ + 0xB80E0000, // 0000 GETNGBL R3 K0 + 0x880C0701, // 0001 GETMBR R3 R3 K1 + 0x200C0403, // 0002 NE R3 R2 R3 + 0x780E0000, // 0003 JMPF R3 #0005 + 0x80000600, // 0004 RET 0 + 0x880C0302, // 0005 GETMBR R3 R1 K2 + 0x88100104, // 0006 GETMBR R4 R0 K4 + 0x88140103, // 0007 GETMBR R5 R0 K3 + 0x94100A04, // 0008 GETIDX R4 R5 R4 + 0x4C140000, // 0009 LDNIL R5 + 0x8C180105, // 000A GETMET R6 R0 K5 + 0x88200104, // 000B GETMBR R8 R0 K4 + 0x7C180400, // 000C CALL R6 2 + 0x601C000C, // 000D GETGBL R7 G12 + 0x5C200C00, // 000E MOVE R8 R6 + 0x7C1C0200, // 000F CALL R7 1 + 0x181C0F06, // 0010 LE R7 R7 K6 + 0x781E0000, // 0011 JMPF R7 #0013 + 0x80000E00, // 0012 RET 0 + 0x1C1C0707, // 0013 EQ R7 R3 K7 + 0x781E0009, // 0014 JMPF R7 #001F + 0x601C0009, // 0015 GETGBL R7 G9 + 0x88200907, // 0016 GETMBR R8 R4 K7 + 0x7C1C0200, // 0017 CALL R7 1 + 0x5C140E00, // 0018 MOVE R5 R7 + 0x4C1C0000, // 0019 LDNIL R7 + 0x1C1C0A07, // 001A EQ R7 R5 R7 + 0x781E0001, // 001B JMPF R7 #001E + 0x541DFFFE, // 001C LDINT R7 -1 + 0x94140C07, // 001D GETIDX R5 R6 R7 + 0x70020020, // 001E JMP #0040 + 0x1C1C0708, // 001F EQ R7 R3 K8 + 0x781E0008, // 0020 JMPF R7 #002A + 0x601C0009, // 0021 GETGBL R7 G9 + 0x88200908, // 0022 GETMBR R8 R4 K8 + 0x7C1C0200, // 0023 CALL R7 1 + 0x5C140E00, // 0024 MOVE R5 R7 + 0x4C1C0000, // 0025 LDNIL R7 + 0x1C1C0A07, // 0026 EQ R7 R5 R7 + 0x781E0000, // 0027 JMPF R7 #0029 + 0x94140D06, // 0028 GETIDX R5 R6 K6 + 0x70020015, // 0029 JMP #0040 + 0x1C1C0709, // 002A EQ R7 R3 K9 + 0x781E0008, // 002B JMPF R7 #0035 + 0x601C0009, // 002C GETGBL R7 G9 + 0x88200909, // 002D GETMBR R8 R4 K9 + 0x7C1C0200, // 002E CALL R7 1 + 0x5C140E00, // 002F MOVE R5 R7 + 0x4C1C0000, // 0030 LDNIL R7 + 0x1C1C0A07, // 0031 EQ R7 R5 R7 + 0x781E0000, // 0032 JMPF R7 #0034 + 0x58140006, // 0033 LDCONST R5 K6 + 0x7002000A, // 0034 JMP #0040 + 0x881C010A, // 0035 GETMBR R7 R0 K10 + 0x8C1C0F0B, // 0036 GETMET R7 R7 K11 + 0x5C240600, // 0037 MOVE R9 R3 + 0x7C1C0400, // 0038 CALL R7 2 + 0x781E0005, // 0039 JMPF R7 #0040 + 0x601C0009, // 003A GETGBL R7 G9 + 0x5421FFFE, // 003B LDINT R8 -1 + 0x40220C08, // 003C CONNECT R8 K6 R8 + 0x94200608, // 003D GETIDX R8 R3 R8 + 0x7C1C0200, // 003E CALL R7 1 + 0x5C140E00, // 003F MOVE R5 R7 + 0x4C1C0000, // 0040 LDNIL R7 + 0x201C0A07, // 0041 NE R7 R5 R7 + 0x781E0005, // 0042 JMPF R7 #0049 + 0x241C0B0C, // 0043 GT R7 R5 K12 + 0x781E0003, // 0044 JMPF R7 #0049 + 0x881C0103, // 0045 GETMBR R7 R0 K3 + 0x941C0E05, // 0046 GETIDX R7 R7 R5 + 0x8C1C0F0D, // 0047 GETMET R7 R7 K13 + 0x7C1C0200, // 0048 CALL R7 1 + 0x80000000, // 0049 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: pages_list_sorted ********************************************************************/ @@ -4744,6 +5161,713 @@ be_local_closure(OpenHASP_pages_list_sorted, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: get_page_cur +********************************************************************/ +be_local_closure(OpenHASP_get_page_cur, /* 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_literal("lvh_pages"), + /* K1 */ be_nested_str_literal("lvh_page_cur_idx"), + }), + be_str_literal("get_page_cur"), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040101, // 0000 GETMBR R1 R0 K1 + 0x88080100, // 0001 GETMBR R2 R0 K0 + 0x94040401, // 0002 GETIDX R1 R2 R1 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start +********************************************************************/ +be_local_closure(OpenHASP_start, /* 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[33]) { /* constants */ + /* K0 */ be_nested_str_literal("path"), + /* K1 */ be_nested_str_literal("def_templ_name"), + /* K2 */ be_nested_str_literal("exists"), + /* K3 */ be_nested_str_literal("file '"), + /* K4 */ be_nested_str_literal("' not found"), + /* K5 */ be_nested_str_literal("io_erorr"), + /* K6 */ be_nested_str_literal("lv"), + /* K7 */ be_nested_str_literal("start"), + /* K8 */ be_nested_str_literal("dark"), + /* K9 */ be_nested_str_literal("hres"), + /* K10 */ be_nested_str_literal("get_hor_res"), + /* K11 */ be_nested_str_literal("vres"), + /* K12 */ be_nested_str_literal("get_ver_res"), + /* K13 */ be_nested_str_literal("scr"), + /* K14 */ be_nested_str_literal("scr_act"), + /* K15 */ be_nested_str_literal("r16"), + /* K16 */ be_nested_str_literal("font_embedded"), + /* K17 */ be_nested_str_literal("robotocondensed"), + /* K18 */ be_nested_str_literal("montserrat"), + /* K19 */ be_nested_str_literal("theme_openhasp_init"), + /* K20 */ be_const_int(0), + /* K21 */ be_nested_str_literal("color"), + /* K22 */ be_const_int(16711935), + /* K23 */ be_const_int(3158064), + /* K24 */ be_nested_str_literal("get_disp"), + /* K25 */ be_nested_str_literal("set_theme"), + /* K26 */ be_nested_str_literal("set_style_bg_color"), + /* K27 */ be_const_int(16777215), + /* K28 */ be_nested_str_literal("theme_apply"), + /* K29 */ be_nested_str_literal("layer_top"), + /* K30 */ be_nested_str_literal("set_style_bg_opa"), + /* K31 */ be_nested_str_literal("lvh_pages"), + /* K32 */ be_nested_str_literal("_load"), + }), + be_str_literal("start"), + &be_const_str_solidified, + ( &(const binstruction[105]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0x4C100000, // 0001 LDNIL R4 + 0x1C100404, // 0002 EQ R4 R2 R4 + 0x78120000, // 0003 JMPF R4 #0005 + 0x88080101, // 0004 GETMBR R2 R0 K1 + 0x8C100702, // 0005 GETMET R4 R3 K2 + 0x5C180400, // 0006 MOVE R6 R2 + 0x7C100400, // 0007 CALL R4 2 + 0x74120002, // 0008 JMPT R4 #000C + 0x00120602, // 0009 ADD R4 K3 R2 + 0x00100904, // 000A ADD R4 R4 K4 + 0xB0060A04, // 000B RAISE 1 K5 R4 + 0xB8120C00, // 000C GETNGBL R4 K6 + 0x8C100907, // 000D GETMET R4 R4 K7 + 0x7C100200, // 000E CALL R4 1 + 0x60100017, // 000F GETGBL R4 G23 + 0x5C140200, // 0010 MOVE R5 R1 + 0x7C100200, // 0011 CALL R4 1 + 0x90021004, // 0012 SETMBR R0 K8 R4 + 0xB8120C00, // 0013 GETNGBL R4 K6 + 0x8C10090A, // 0014 GETMET R4 R4 K10 + 0x7C100200, // 0015 CALL R4 1 + 0x90021204, // 0016 SETMBR R0 K9 R4 + 0xB8120C00, // 0017 GETNGBL R4 K6 + 0x8C10090C, // 0018 GETMET R4 R4 K12 + 0x7C100200, // 0019 CALL R4 1 + 0x90021604, // 001A SETMBR R0 K11 R4 + 0xB8120C00, // 001B GETNGBL R4 K6 + 0x8C10090E, // 001C GETMET R4 R4 K14 + 0x7C100200, // 001D CALL R4 1 + 0x90021A04, // 001E SETMBR R0 K13 R4 + 0xA8020007, // 001F EXBLK 0 #0028 + 0xB8120C00, // 0020 GETNGBL R4 K6 + 0x8C100910, // 0021 GETMET R4 R4 K16 + 0x58180011, // 0022 LDCONST R6 K17 + 0x541E000F, // 0023 LDINT R7 16 + 0x7C100600, // 0024 CALL R4 3 + 0x90021E04, // 0025 SETMBR R0 K15 R4 + 0xA8040001, // 0026 EXBLK 1 1 + 0x70020009, // 0027 JMP #0032 + 0xAC100000, // 0028 CATCH R4 0 0 + 0x70020006, // 0029 JMP #0031 + 0xB8120C00, // 002A GETNGBL R4 K6 + 0x8C100910, // 002B GETMET R4 R4 K16 + 0x58180012, // 002C LDCONST R6 K18 + 0x541E000D, // 002D LDINT R7 14 + 0x7C100600, // 002E CALL R4 3 + 0x90021E04, // 002F SETMBR R0 K15 R4 + 0x70020000, // 0030 JMP #0032 + 0xB0080000, // 0031 RAISE 2 R0 R0 + 0xB8120C00, // 0032 GETNGBL R4 K6 + 0x8C100913, // 0033 GETMET R4 R4 K19 + 0x58180014, // 0034 LDCONST R6 K20 + 0xB81E0C00, // 0035 GETNGBL R7 K6 + 0x8C1C0F15, // 0036 GETMET R7 R7 K21 + 0x58240016, // 0037 LDCONST R9 K22 + 0x7C1C0400, // 0038 CALL R7 2 + 0xB8220C00, // 0039 GETNGBL R8 K6 + 0x8C201115, // 003A GETMET R8 R8 K21 + 0x58280017, // 003B LDCONST R10 K23 + 0x7C200400, // 003C CALL R8 2 + 0x88240108, // 003D GETMBR R9 R0 K8 + 0x8828010F, // 003E GETMBR R10 R0 K15 + 0x7C100C00, // 003F CALL R4 6 + 0x8814010D, // 0040 GETMBR R5 R0 K13 + 0x8C140B18, // 0041 GETMET R5 R5 K24 + 0x7C140200, // 0042 CALL R5 1 + 0x8C140B19, // 0043 GETMET R5 R5 K25 + 0x5C1C0800, // 0044 MOVE R7 R4 + 0x7C140400, // 0045 CALL R5 2 + 0x8814010D, // 0046 GETMBR R5 R0 K13 + 0x8C140B1A, // 0047 GETMET R5 R5 K26 + 0x881C0108, // 0048 GETMBR R7 R0 K8 + 0x781E0004, // 0049 JMPF R7 #004F + 0xB81E0C00, // 004A GETNGBL R7 K6 + 0x8C1C0F15, // 004B GETMET R7 R7 K21 + 0x58240014, // 004C LDCONST R9 K20 + 0x7C1C0400, // 004D CALL R7 2 + 0x70020003, // 004E JMP #0053 + 0xB81E0C00, // 004F GETNGBL R7 K6 + 0x8C1C0F15, // 0050 GETMET R7 R7 K21 + 0x5824001B, // 0051 LDCONST R9 K27 + 0x7C1C0400, // 0052 CALL R7 2 + 0x58200014, // 0053 LDCONST R8 K20 + 0x7C140600, // 0054 CALL R5 3 + 0xB8160C00, // 0055 GETNGBL R5 K6 + 0x8C140B1C, // 0056 GETMET R5 R5 K28 + 0xB81E0C00, // 0057 GETNGBL R7 K6 + 0x8C1C0F1D, // 0058 GETMET R7 R7 K29 + 0x7C1C0200, // 0059 CALL R7 1 + 0x7C140400, // 005A CALL R5 2 + 0xB8160C00, // 005B GETNGBL R5 K6 + 0x8C140B1D, // 005C GETMET R5 R5 K29 + 0x7C140200, // 005D CALL R5 1 + 0x8C140B1E, // 005E GETMET R5 R5 K30 + 0x581C0014, // 005F LDCONST R7 K20 + 0x58200014, // 0060 LDCONST R8 K20 + 0x7C140600, // 0061 CALL R5 3 + 0x60140013, // 0062 GETGBL R5 G19 + 0x7C140000, // 0063 CALL R5 0 + 0x90023E05, // 0064 SETMBR R0 K31 R5 + 0x8C140120, // 0065 GETMET R5 R0 K32 + 0x5C1C0400, // 0066 MOVE R7 R2 + 0x7C140400, // 0067 CALL R5 2 + 0x80000000, // 0068 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(OpenHASP_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[ 4]) { /* constants */ + /* K0 */ be_nested_str_literal("re"), + /* K1 */ be_nested_str_literal("re_page_target"), + /* K2 */ be_nested_str_literal("compile"), + /* K3 */ be_nested_str_literal("p\\d+"), + }), + be_str_literal("init"), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080302, // 0001 GETMET R2 R1 K2 + 0x58100003, // 0002 LDCONST R4 K3 + 0x7C080400, // 0003 CALL R2 2 + 0x90020202, // 0004 SETMBR R0 K1 R2 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: register_event +********************************************************************/ +be_local_closure(OpenHASP_register_event, /* name */ + be_nested_proto( + 13, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_literal("event_dispatch"), + }), + be_str_literal(""), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x68040000, // 0000 GETUPV R1 U0 + 0x8C040300, // 0001 GETMET R1 R1 K0 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C040400, // 0003 CALL R1 2 + 0x80040200, // 0004 RET 1 R1 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str_literal("cb"), + /* K1 */ be_nested_str_literal("introspect"), + /* K2 */ be_nested_str_literal("event_cb"), + /* K3 */ be_nested_str_literal("gen_cb"), + /* K4 */ be_nested_str_literal("_lv_obj"), + /* K5 */ be_nested_str_literal("add_event_cb"), + /* K6 */ be_nested_str_literal("toptr"), + }), + be_str_literal("register_event"), + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0xA4120200, // 0001 IMPORT R4 K1 + 0x88140102, // 0002 GETMBR R5 R0 K2 + 0x4C180000, // 0003 LDNIL R6 + 0x1C140A06, // 0004 EQ R5 R5 R6 + 0x78160003, // 0005 JMPF R5 #000A + 0x8C140703, // 0006 GETMET R5 R3 K3 + 0x841C0000, // 0007 CLOSURE R7 P0 + 0x7C140400, // 0008 CALL R5 2 + 0x90020405, // 0009 SETMBR R0 K2 R5 + 0x88140304, // 000A GETMBR R5 R1 K4 + 0x8C180B05, // 000B GETMET R6 R5 K5 + 0x88200102, // 000C GETMBR R8 R0 K2 + 0x5C240400, // 000D MOVE R9 R2 + 0x8C280906, // 000E GETMET R10 R4 K6 + 0x5C300200, // 000F MOVE R12 R1 + 0x7C280400, // 0010 CALL R10 2 + 0x7C180800, // 0011 CALL R6 4 + 0xA0000000, // 0012 CLOSE R0 + 0x80000000, // 0013 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse_page +********************************************************************/ +be_local_closure(OpenHASP_parse_page, /* 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[14]) { /* constants */ + /* K0 */ be_nested_str_literal("has"), + /* K1 */ be_nested_str_literal("page"), + /* K2 */ be_nested_str_literal("int"), + /* K3 */ be_nested_str_literal("lvh_page_cur_idx"), + /* K4 */ be_nested_str_literal("lvh_pages"), + /* K5 */ be_nested_str_literal("contains"), + /* K6 */ be_nested_str_literal("lvh_page"), + /* K7 */ be_nested_str_literal("find"), + /* K8 */ be_nested_str_literal("id"), + /* K9 */ be_const_int(0), + /* K10 */ be_nested_str_literal("get_page_cur"), + /* K11 */ be_nested_str_literal("prev"), + /* K12 */ be_nested_str_literal("next"), + /* K13 */ be_nested_str_literal("back"), + }), + be_str_literal("parse_page"), + &be_const_str_solidified, + ( &(const binstruction[54]) { /* code */ + 0x8C080300, // 0000 GETMET R2 R1 K0 + 0x58100001, // 0001 LDCONST R4 K1 + 0x7C080400, // 0002 CALL R2 2 + 0x780A0030, // 0003 JMPF R2 #0035 + 0x60080004, // 0004 GETGBL R2 G4 + 0x940C0301, // 0005 GETIDX R3 R1 K1 + 0x7C080200, // 0006 CALL R2 1 + 0x1C080502, // 0007 EQ R2 R2 K2 + 0x780A002B, // 0008 JMPF R2 #0035 + 0x60080009, // 0009 GETGBL R2 G9 + 0x940C0301, // 000A GETIDX R3 R1 K1 + 0x7C080200, // 000B CALL R2 1 + 0x90020602, // 000C SETMBR R0 K3 R2 + 0x880C0104, // 000D GETMBR R3 R0 K4 + 0x8C0C0705, // 000E GETMET R3 R3 K5 + 0x5C140400, // 000F MOVE R5 R2 + 0x7C0C0400, // 0010 CALL R3 2 + 0x740E0006, // 0011 JMPT R3 #0019 + 0x880C0106, // 0012 GETMBR R3 R0 K6 + 0x88100104, // 0013 GETMBR R4 R0 K4 + 0x5C140600, // 0014 MOVE R5 R3 + 0x5C180400, // 0015 MOVE R6 R2 + 0x5C1C0000, // 0016 MOVE R7 R0 + 0x7C140400, // 0017 CALL R5 2 + 0x98100405, // 0018 SETIDX R4 R2 R5 + 0x8C0C0307, // 0019 GETMET R3 R1 K7 + 0x58140008, // 001A LDCONST R5 K8 + 0x7C0C0400, // 001B CALL R3 2 + 0x1C0C0709, // 001C EQ R3 R3 K9 + 0x780E0016, // 001D JMPF R3 #0035 + 0x8C0C010A, // 001E GETMET R3 R0 K10 + 0x7C0C0200, // 001F CALL R3 1 + 0x60100009, // 0020 GETGBL R4 G9 + 0x8C140307, // 0021 GETMET R5 R1 K7 + 0x581C000B, // 0022 LDCONST R7 K11 + 0x4C200000, // 0023 LDNIL R8 + 0x7C140600, // 0024 CALL R5 3 + 0x7C100200, // 0025 CALL R4 1 + 0x900E1604, // 0026 SETMBR R3 K11 R4 + 0x60100009, // 0027 GETGBL R4 G9 + 0x8C140307, // 0028 GETMET R5 R1 K7 + 0x581C000C, // 0029 LDCONST R7 K12 + 0x4C200000, // 002A LDNIL R8 + 0x7C140600, // 002B CALL R5 3 + 0x7C100200, // 002C CALL R4 1 + 0x900E1804, // 002D SETMBR R3 K12 R4 + 0x60100009, // 002E GETGBL R4 G9 + 0x8C140307, // 002F GETMET R5 R1 K7 + 0x581C000D, // 0030 LDCONST R7 K13 + 0x4C200000, // 0031 LDNIL R8 + 0x7C140600, // 0032 CALL R5 3 + 0x7C100200, // 0033 CALL R4 1 + 0x900E1A04, // 0034 SETMBR R3 K13 R4 + 0x80000000, // 0035 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: deinit +********************************************************************/ +be_local_closure(OpenHASP_deinit, /* 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[ 4]) { /* constants */ + /* K0 */ be_nested_str_literal("_val_rule"), + /* K1 */ be_nested_str_literal("tasmota"), + /* K2 */ be_nested_str_literal("remove_rule"), + /* K3 */ be_nested_str_literal("_text_rule"), + }), + be_str_literal("deinit"), + &be_const_str_solidified, + ( &(const binstruction[19]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x4C080000, // 0001 LDNIL R2 + 0x20040202, // 0002 NE R1 R1 R2 + 0x78060004, // 0003 JMPF R1 #0009 + 0xB8060200, // 0004 GETNGBL R1 K1 + 0x8C040302, // 0005 GETMET R1 R1 K2 + 0x880C0100, // 0006 GETMBR R3 R0 K0 + 0x5C100000, // 0007 MOVE R4 R0 + 0x7C040600, // 0008 CALL R1 3 + 0x88040103, // 0009 GETMBR R1 R0 K3 + 0x4C080000, // 000A LDNIL R2 + 0x20040202, // 000B NE R1 R1 R2 + 0x78060004, // 000C JMPF R1 #0012 + 0xB8060200, // 000D GETNGBL R1 K1 + 0x8C040302, // 000E GETMET R1 R1 K2 + 0x880C0103, // 000F GETMBR R3 R0 K3 + 0x5C100000, // 0010 MOVE R4 R0 + 0x7C040600, // 0011 CALL R1 3 + 0x80000000, // 0012 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: page_dir_to +********************************************************************/ +be_local_closure(OpenHASP_page_dir_to, /* 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[ 5]) { /* constants */ + /* K0 */ be_nested_str_literal("pages_list_sorted"), + /* K1 */ be_const_int(0), + /* K2 */ be_const_int(1), + /* K3 */ be_const_int(2), + /* K4 */ be_nested_str_literal("find"), + }), + be_str_literal("page_dir_to"), + &be_const_str_solidified, + ( &(const binstruction[32]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 + 0x58100001, // 0001 LDCONST R4 K1 + 0x7C080400, // 0002 CALL R2 2 + 0x4C0C0000, // 0003 LDNIL R3 + 0x1C0C0403, // 0004 EQ R3 R2 R3 + 0x780E0000, // 0005 JMPF R3 #0007 + 0x80060200, // 0006 RET 1 K1 + 0x600C000C, // 0007 GETGBL R3 G12 + 0x5C100400, // 0008 MOVE R4 R2 + 0x7C0C0200, // 0009 CALL R3 1 + 0x18100702, // 000A LE R4 R3 K2 + 0x78120000, // 000B JMPF R4 #000D + 0x80060200, // 000C RET 1 K1 + 0x1C100703, // 000D EQ R4 R3 K3 + 0x78120000, // 000E JMPF R4 #0010 + 0x80060400, // 000F RET 1 K2 + 0x8C100504, // 0010 GETMET R4 R2 K4 + 0x5C180200, // 0011 MOVE R6 R1 + 0x7C100400, // 0012 CALL R4 2 + 0x4C140000, // 0013 LDNIL R5 + 0x1C140805, // 0014 EQ R5 R4 R5 + 0x78160000, // 0015 JMPF R5 #0017 + 0x80060200, // 0016 RET 1 K1 + 0x00140702, // 0017 ADD R5 R3 K2 + 0x0C140B03, // 0018 DIV R5 R5 K3 + 0x18140805, // 0019 LE R5 R4 R5 + 0x78160001, // 001A JMPF R5 #001D + 0x80060400, // 001B RET 1 K2 + 0x70020001, // 001C JMP #001F + 0x5415FFFE, // 001D LDINT R5 -1 + 0x80040A00, // 001E RET 1 R5 + 0x80000000, // 001F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: _load +********************************************************************/ +be_local_closure(OpenHASP__load, /* name */ + be_nested_proto( + 14, /* 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_literal("string"), + /* K1 */ be_nested_str_literal("json"), + /* K2 */ be_nested_str_literal("lvh_page_cur_idx"), + /* K3 */ be_const_int(1), + /* K4 */ be_nested_str_literal("lvh_page"), + /* K5 */ be_nested_str_literal("lvh_pages"), + /* K6 */ be_nested_str_literal("r"), + /* K7 */ be_nested_str_literal("read"), + /* K8 */ be_nested_str_literal("close"), + /* K9 */ be_nested_str_literal("split"), + /* K10 */ be_nested_str_literal("\n"), + /* K11 */ be_const_int(0), + /* K12 */ be_nested_str_literal("load"), + /* K13 */ be_nested_str_literal("instance"), + /* K14 */ be_nested_str_literal("parse_page"), + /* K15 */ be_nested_str_literal("parse_obj"), + /* K16 */ be_nested_str_literal("remove"), + }), + be_str_literal("_load"), + &be_const_str_solidified, + ( &(const binstruction[54]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0xA40E0200, // 0001 IMPORT R3 K1 + 0x90020503, // 0002 SETMBR R0 K2 K3 + 0x88100104, // 0003 GETMBR R4 R0 K4 + 0x88140105, // 0004 GETMBR R5 R0 K5 + 0x5C180800, // 0005 MOVE R6 R4 + 0x581C0003, // 0006 LDCONST R7 K3 + 0x5C200000, // 0007 MOVE R8 R0 + 0x7C180400, // 0008 CALL R6 2 + 0x98160606, // 0009 SETIDX R5 K3 R6 + 0x60140011, // 000A GETGBL R5 G17 + 0x5C180200, // 000B MOVE R6 R1 + 0x581C0006, // 000C LDCONST R7 K6 + 0x7C140400, // 000D CALL R5 2 + 0x8C180B07, // 000E GETMET R6 R5 K7 + 0x7C180200, // 000F CALL R6 1 + 0x8C1C0B08, // 0010 GETMET R7 R5 K8 + 0x7C1C0200, // 0011 CALL R7 1 + 0x8C1C0509, // 0012 GETMET R7 R2 K9 + 0x5C240C00, // 0013 MOVE R9 R6 + 0x5828000A, // 0014 LDCONST R10 K10 + 0x7C1C0600, // 0015 CALL R7 3 + 0x4C140000, // 0016 LDNIL R5 + 0x4C180000, // 0017 LDNIL R6 + 0x6020000C, // 0018 GETGBL R8 G12 + 0x5C240E00, // 0019 MOVE R9 R7 + 0x7C200200, // 001A CALL R8 1 + 0x2420110B, // 001B GT R8 R8 K11 + 0x78220015, // 001C JMPF R8 #0033 + 0x8C20070C, // 001D GETMET R8 R3 K12 + 0x94280F0B, // 001E GETIDX R10 R7 K11 + 0x7C200400, // 001F CALL R8 2 + 0x60240004, // 0020 GETGBL R9 G4 + 0x5C281000, // 0021 MOVE R10 R8 + 0x7C240200, // 0022 CALL R9 1 + 0x1C24130D, // 0023 EQ R9 R9 K13 + 0x78260008, // 0024 JMPF R9 #002E + 0x8C24010E, // 0025 GETMET R9 R0 K14 + 0x5C2C1000, // 0026 MOVE R11 R8 + 0x7C240400, // 0027 CALL R9 2 + 0x8C24010F, // 0028 GETMET R9 R0 K15 + 0x5C2C1000, // 0029 MOVE R11 R8 + 0x88300102, // 002A GETMBR R12 R0 K2 + 0x88340105, // 002B GETMBR R13 R0 K5 + 0x94301A0C, // 002C GETIDX R12 R13 R12 + 0x7C240600, // 002D CALL R9 3 + 0x4C200000, // 002E LDNIL R8 + 0x8C240F10, // 002F GETMET R9 R7 K16 + 0x582C000B, // 0030 LDCONST R11 K11 + 0x7C240400, // 0031 CALL R9 2 + 0x7001FFE4, // 0032 JMP #0018 + 0x4C1C0000, // 0033 LDNIL R7 + 0x90020503, // 0034 SETMBR R0 K2 K3 + 0x80000000, // 0035 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse +********************************************************************/ +be_local_closure(OpenHASP_parse, /* 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[ 9]) { /* constants */ + /* K0 */ be_nested_str_literal("json"), + /* K1 */ be_nested_str_literal("load"), + /* K2 */ be_nested_str_literal("instance"), + /* K3 */ be_nested_str_literal("parse_page"), + /* K4 */ be_nested_str_literal("parse_obj"), + /* K5 */ be_nested_str_literal("lvh_pages"), + /* K6 */ be_nested_str_literal("lvh_page_cur_idx"), + /* K7 */ be_nested_str_literal("value_error"), + /* K8 */ be_nested_str_literal("unable to parse JSON line"), + }), + be_str_literal("parse"), + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x8C0C0501, // 0001 GETMET R3 R2 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x60100004, // 0004 GETGBL R4 G4 + 0x5C140600, // 0005 MOVE R5 R3 + 0x7C100200, // 0006 CALL R4 1 + 0x1C100902, // 0007 EQ R4 R4 K2 + 0x78120009, // 0008 JMPF R4 #0013 + 0x8C100103, // 0009 GETMET R4 R0 K3 + 0x5C180600, // 000A MOVE R6 R3 + 0x7C100400, // 000B CALL R4 2 + 0x8C100104, // 000C GETMET R4 R0 K4 + 0x5C180600, // 000D MOVE R6 R3 + 0x881C0106, // 000E GETMBR R7 R0 K6 + 0x88200105, // 000F GETMBR R8 R0 K5 + 0x941C1007, // 0010 GETIDX R7 R8 R7 + 0x7C100600, // 0011 CALL R4 3 + 0x70020000, // 0012 JMP #0014 + 0xB0060F08, // 0013 RAISE 1 K7 K8 + 0x80000000, // 0014 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: sort +********************************************************************/ +be_local_closure(OpenHASP_sort, /* 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[ 3]) { /* constants */ + /* K0 */ be_const_int(1), + /* K1 */ be_const_int(0), + /* K2 */ be_nested_str_literal("stop_iteration"), + }), + be_str_literal("sort"), + &be_const_str_solidified, + ( &(const binstruction[29]) { /* code */ + 0x60040010, // 0000 GETGBL R1 G16 + 0x6008000C, // 0001 GETGBL R2 G12 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C080200, // 0003 CALL R2 1 + 0x04080500, // 0004 SUB R2 R2 K0 + 0x400A0002, // 0005 CONNECT R2 K0 R2 + 0x7C040200, // 0006 CALL R1 1 + 0xA8020010, // 0007 EXBLK 0 #0019 + 0x5C080200, // 0008 MOVE R2 R1 + 0x7C080000, // 0009 CALL R2 0 + 0x940C0002, // 000A GETIDX R3 R0 R2 + 0x5C100400, // 000B MOVE R4 R2 + 0x24140901, // 000C GT R5 R4 K1 + 0x78160008, // 000D JMPF R5 #0017 + 0x04140900, // 000E SUB R5 R4 K0 + 0x94140005, // 000F GETIDX R5 R0 R5 + 0x24140A03, // 0010 GT R5 R5 R3 + 0x78160004, // 0011 JMPF R5 #0017 + 0x04140900, // 0012 SUB R5 R4 K0 + 0x94140005, // 0013 GETIDX R5 R0 R5 + 0x98000805, // 0014 SETIDX R0 R4 R5 + 0x04100900, // 0015 SUB R4 R4 K0 + 0x7001FFF4, // 0016 JMP #000C + 0x98000803, // 0017 SETIDX R0 R4 R3 + 0x7001FFEE, // 0018 JMP #0008 + 0x58040002, // 0019 LDCONST R1 K2 + 0xAC040200, // 001A CATCH R1 1 0 + 0xB0080000, // 001B RAISE 2 R0 R0 + 0x80040000, // 001C RET 1 R0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: parse_obj ********************************************************************/ @@ -5058,875 +6182,57 @@ be_local_closure(OpenHASP_event_dispatch, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: page_dir_to -********************************************************************/ -be_local_closure(OpenHASP_page_dir_to, /* 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[ 5]) { /* constants */ - /* K0 */ be_nested_str_literal("pages_list_sorted"), - /* K1 */ be_const_int(0), - /* K2 */ be_const_int(1), - /* K3 */ be_const_int(2), - /* K4 */ be_nested_str_literal("find"), - }), - be_str_literal("page_dir_to"), - &be_const_str_solidified, - ( &(const binstruction[32]) { /* code */ - 0x8C080100, // 0000 GETMET R2 R0 K0 - 0x58100001, // 0001 LDCONST R4 K1 - 0x7C080400, // 0002 CALL R2 2 - 0x4C0C0000, // 0003 LDNIL R3 - 0x1C0C0403, // 0004 EQ R3 R2 R3 - 0x780E0000, // 0005 JMPF R3 #0007 - 0x80060200, // 0006 RET 1 K1 - 0x600C000C, // 0007 GETGBL R3 G12 - 0x5C100400, // 0008 MOVE R4 R2 - 0x7C0C0200, // 0009 CALL R3 1 - 0x18100702, // 000A LE R4 R3 K2 - 0x78120000, // 000B JMPF R4 #000D - 0x80060200, // 000C RET 1 K1 - 0x1C100703, // 000D EQ R4 R3 K3 - 0x78120000, // 000E JMPF R4 #0010 - 0x80060400, // 000F RET 1 K2 - 0x8C100504, // 0010 GETMET R4 R2 K4 - 0x5C180200, // 0011 MOVE R6 R1 - 0x7C100400, // 0012 CALL R4 2 - 0x4C140000, // 0013 LDNIL R5 - 0x1C140805, // 0014 EQ R5 R4 R5 - 0x78160000, // 0015 JMPF R5 #0017 - 0x80060200, // 0016 RET 1 K1 - 0x00140702, // 0017 ADD R5 R3 K2 - 0x0C140B03, // 0018 DIV R5 R5 K3 - 0x18140805, // 0019 LE R5 R4 R5 - 0x78160001, // 001A JMPF R5 #001D - 0x80060400, // 001B RET 1 K2 - 0x70020001, // 001C JMP #001F - 0x5415FFFE, // 001D LDINT R5 -1 - 0x80040A00, // 001E RET 1 R5 - 0x80000000, // 001F RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: deinit -********************************************************************/ -be_local_closure(OpenHASP_deinit, /* 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[ 4]) { /* constants */ - /* K0 */ be_nested_str_literal("_val_rule"), - /* K1 */ be_nested_str_literal("tasmota"), - /* K2 */ be_nested_str_literal("remove_rule"), - /* K3 */ be_nested_str_literal("_text_rule"), - }), - be_str_literal("deinit"), - &be_const_str_solidified, - ( &(const binstruction[19]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x4C080000, // 0001 LDNIL R2 - 0x20040202, // 0002 NE R1 R1 R2 - 0x78060004, // 0003 JMPF R1 #0009 - 0xB8060200, // 0004 GETNGBL R1 K1 - 0x8C040302, // 0005 GETMET R1 R1 K2 - 0x880C0100, // 0006 GETMBR R3 R0 K0 - 0x5C100000, // 0007 MOVE R4 R0 - 0x7C040600, // 0008 CALL R1 3 - 0x88040103, // 0009 GETMBR R1 R0 K3 - 0x4C080000, // 000A LDNIL R2 - 0x20040202, // 000B NE R1 R1 R2 - 0x78060004, // 000C JMPF R1 #0012 - 0xB8060200, // 000D GETNGBL R1 K1 - 0x8C040302, // 000E GETMET R1 R1 K2 - 0x880C0103, // 000F GETMBR R3 R0 K3 - 0x5C100000, // 0010 MOVE R4 R0 - 0x7C040600, // 0011 CALL R1 3 - 0x80000000, // 0012 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: parse_page -********************************************************************/ -be_local_closure(OpenHASP_parse_page, /* 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[14]) { /* constants */ - /* K0 */ be_nested_str_literal("has"), - /* K1 */ be_nested_str_literal("page"), - /* K2 */ be_nested_str_literal("int"), - /* K3 */ be_nested_str_literal("lvh_page_cur_idx"), - /* K4 */ be_nested_str_literal("lvh_pages"), - /* K5 */ be_nested_str_literal("contains"), - /* K6 */ be_nested_str_literal("lvh_page"), - /* K7 */ be_nested_str_literal("find"), - /* K8 */ be_nested_str_literal("id"), - /* K9 */ be_const_int(0), - /* K10 */ be_nested_str_literal("get_page_cur"), - /* K11 */ be_nested_str_literal("prev"), - /* K12 */ be_nested_str_literal("next"), - /* K13 */ be_nested_str_literal("back"), - }), - be_str_literal("parse_page"), - &be_const_str_solidified, - ( &(const binstruction[54]) { /* code */ - 0x8C080300, // 0000 GETMET R2 R1 K0 - 0x58100001, // 0001 LDCONST R4 K1 - 0x7C080400, // 0002 CALL R2 2 - 0x780A0030, // 0003 JMPF R2 #0035 - 0x60080004, // 0004 GETGBL R2 G4 - 0x940C0301, // 0005 GETIDX R3 R1 K1 - 0x7C080200, // 0006 CALL R2 1 - 0x1C080502, // 0007 EQ R2 R2 K2 - 0x780A002B, // 0008 JMPF R2 #0035 - 0x60080009, // 0009 GETGBL R2 G9 - 0x940C0301, // 000A GETIDX R3 R1 K1 - 0x7C080200, // 000B CALL R2 1 - 0x90020602, // 000C SETMBR R0 K3 R2 - 0x880C0104, // 000D GETMBR R3 R0 K4 - 0x8C0C0705, // 000E GETMET R3 R3 K5 - 0x5C140400, // 000F MOVE R5 R2 - 0x7C0C0400, // 0010 CALL R3 2 - 0x740E0006, // 0011 JMPT R3 #0019 - 0x880C0106, // 0012 GETMBR R3 R0 K6 - 0x88100104, // 0013 GETMBR R4 R0 K4 - 0x5C140600, // 0014 MOVE R5 R3 - 0x5C180400, // 0015 MOVE R6 R2 - 0x5C1C0000, // 0016 MOVE R7 R0 - 0x7C140400, // 0017 CALL R5 2 - 0x98100405, // 0018 SETIDX R4 R2 R5 - 0x8C0C0307, // 0019 GETMET R3 R1 K7 - 0x58140008, // 001A LDCONST R5 K8 - 0x7C0C0400, // 001B CALL R3 2 - 0x1C0C0709, // 001C EQ R3 R3 K9 - 0x780E0016, // 001D JMPF R3 #0035 - 0x8C0C010A, // 001E GETMET R3 R0 K10 - 0x7C0C0200, // 001F CALL R3 1 - 0x60100009, // 0020 GETGBL R4 G9 - 0x8C140307, // 0021 GETMET R5 R1 K7 - 0x581C000B, // 0022 LDCONST R7 K11 - 0x4C200000, // 0023 LDNIL R8 - 0x7C140600, // 0024 CALL R5 3 - 0x7C100200, // 0025 CALL R4 1 - 0x900E1604, // 0026 SETMBR R3 K11 R4 - 0x60100009, // 0027 GETGBL R4 G9 - 0x8C140307, // 0028 GETMET R5 R1 K7 - 0x581C000C, // 0029 LDCONST R7 K12 - 0x4C200000, // 002A LDNIL R8 - 0x7C140600, // 002B CALL R5 3 - 0x7C100200, // 002C CALL R4 1 - 0x900E1804, // 002D SETMBR R3 K12 R4 - 0x60100009, // 002E GETGBL R4 G9 - 0x8C140307, // 002F GETMET R5 R1 K7 - 0x581C000D, // 0030 LDCONST R7 K13 - 0x4C200000, // 0031 LDNIL R8 - 0x7C140600, // 0032 CALL R5 3 - 0x7C100200, // 0033 CALL R4 1 - 0x900E1A04, // 0034 SETMBR R3 K13 R4 - 0x80000000, // 0035 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: register_event -********************************************************************/ -be_local_closure(OpenHASP_register_event, /* name */ - be_nested_proto( - 13, /* nstack */ - 3, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 1, /* has sup protos */ - ( &(const struct bproto*[ 1]) { - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 1, /* has upvals */ - ( &(const bupvaldesc[ 1]) { /* upvals */ - be_local_const_upval(1, 0), - }), - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_literal("event_dispatch"), - }), - be_str_literal(""), - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x68040000, // 0000 GETUPV R1 U0 - 0x8C040300, // 0001 GETMET R1 R1 K0 - 0x5C0C0000, // 0002 MOVE R3 R0 - 0x7C040400, // 0003 CALL R1 2 - 0x80040200, // 0004 RET 1 R1 - }) - ), - }), - 1, /* has constants */ - ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_str_literal("cb"), - /* K1 */ be_nested_str_literal("introspect"), - /* K2 */ be_nested_str_literal("event_cb"), - /* K3 */ be_nested_str_literal("gen_cb"), - /* K4 */ be_nested_str_literal("_lv_obj"), - /* K5 */ be_nested_str_literal("add_event_cb"), - /* K6 */ be_nested_str_literal("toptr"), - }), - be_str_literal("register_event"), - &be_const_str_solidified, - ( &(const binstruction[20]) { /* code */ - 0xA40E0000, // 0000 IMPORT R3 K0 - 0xA4120200, // 0001 IMPORT R4 K1 - 0x88140102, // 0002 GETMBR R5 R0 K2 - 0x4C180000, // 0003 LDNIL R6 - 0x1C140A06, // 0004 EQ R5 R5 R6 - 0x78160003, // 0005 JMPF R5 #000A - 0x8C140703, // 0006 GETMET R5 R3 K3 - 0x841C0000, // 0007 CLOSURE R7 P0 - 0x7C140400, // 0008 CALL R5 2 - 0x90020405, // 0009 SETMBR R0 K2 R5 - 0x88140304, // 000A GETMBR R5 R1 K4 - 0x8C180B05, // 000B GETMET R6 R5 K5 - 0x88200102, // 000C GETMBR R8 R0 K2 - 0x5C240400, // 000D MOVE R9 R2 - 0x8C280906, // 000E GETMET R10 R4 K6 - 0x5C300200, // 000F MOVE R12 R1 - 0x7C280400, // 0010 CALL R10 2 - 0x7C180800, // 0011 CALL R6 4 - 0xA0000000, // 0012 CLOSE R0 - 0x80000000, // 0013 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: sort -********************************************************************/ -be_local_closure(OpenHASP_sort, /* 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[ 3]) { /* constants */ - /* K0 */ be_const_int(1), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_str_literal("stop_iteration"), - }), - be_str_literal("sort"), - &be_const_str_solidified, - ( &(const binstruction[29]) { /* code */ - 0x60040010, // 0000 GETGBL R1 G16 - 0x6008000C, // 0001 GETGBL R2 G12 - 0x5C0C0000, // 0002 MOVE R3 R0 - 0x7C080200, // 0003 CALL R2 1 - 0x04080500, // 0004 SUB R2 R2 K0 - 0x400A0002, // 0005 CONNECT R2 K0 R2 - 0x7C040200, // 0006 CALL R1 1 - 0xA8020010, // 0007 EXBLK 0 #0019 - 0x5C080200, // 0008 MOVE R2 R1 - 0x7C080000, // 0009 CALL R2 0 - 0x940C0002, // 000A GETIDX R3 R0 R2 - 0x5C100400, // 000B MOVE R4 R2 - 0x24140901, // 000C GT R5 R4 K1 - 0x78160008, // 000D JMPF R5 #0017 - 0x04140900, // 000E SUB R5 R4 K0 - 0x94140005, // 000F GETIDX R5 R0 R5 - 0x24140A03, // 0010 GT R5 R5 R3 - 0x78160004, // 0011 JMPF R5 #0017 - 0x04140900, // 0012 SUB R5 R4 K0 - 0x94140005, // 0013 GETIDX R5 R0 R5 - 0x98000805, // 0014 SETIDX R0 R4 R5 - 0x04100900, // 0015 SUB R4 R4 K0 - 0x7001FFF4, // 0016 JMP #000C - 0x98000803, // 0017 SETIDX R0 R4 R3 - 0x7001FFEE, // 0018 JMP #0008 - 0x58040002, // 0019 LDCONST R1 K2 - 0xAC040200, // 001A CATCH R1 1 0 - 0xB0080000, // 001B RAISE 2 R0 R0 - 0x80040000, // 001C RET 1 R0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_page_cur -********************************************************************/ -be_local_closure(OpenHASP_get_page_cur, /* 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_literal("lvh_pages"), - /* K1 */ be_nested_str_literal("lvh_page_cur_idx"), - }), - be_str_literal("get_page_cur"), - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040101, // 0000 GETMBR R1 R0 K1 - 0x88080100, // 0001 GETMBR R2 R0 K0 - 0x94040401, // 0002 GETIDX R1 R2 R1 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(OpenHASP_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[ 4]) { /* constants */ - /* K0 */ be_nested_str_literal("re"), - /* K1 */ be_nested_str_literal("re_page_target"), - /* K2 */ be_nested_str_literal("compile"), - /* K3 */ be_nested_str_literal("p\\d+"), - }), - be_str_literal("init"), - &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x8C080302, // 0001 GETMET R2 R1 K2 - 0x58100003, // 0002 LDCONST R4 K3 - 0x7C080400, // 0003 CALL R2 2 - 0x90020202, // 0004 SETMBR R0 K1 R2 - 0x80000000, // 0005 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: do_action -********************************************************************/ -be_local_closure(OpenHASP_do_action, /* 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[14]) { /* constants */ - /* K0 */ be_nested_str_literal("lv"), - /* K1 */ be_nested_str_literal("EVENT_CLICKED"), - /* K2 */ be_nested_str_literal("_action"), - /* K3 */ be_nested_str_literal("lvh_pages"), - /* K4 */ be_nested_str_literal("lvh_page_cur_idx"), - /* K5 */ be_nested_str_literal("pages_list_sorted"), - /* K6 */ be_const_int(1), - /* K7 */ be_nested_str_literal("prev"), - /* K8 */ be_nested_str_literal("next"), - /* K9 */ be_nested_str_literal("back"), - /* K10 */ be_nested_str_literal("re_page_target"), - /* K11 */ be_nested_str_literal("match"), - /* K12 */ be_const_int(0), - /* K13 */ be_nested_str_literal("show"), - }), - be_str_literal("do_action"), - &be_const_str_solidified, - ( &(const binstruction[74]) { /* code */ - 0xB80E0000, // 0000 GETNGBL R3 K0 - 0x880C0701, // 0001 GETMBR R3 R3 K1 - 0x200C0403, // 0002 NE R3 R2 R3 - 0x780E0000, // 0003 JMPF R3 #0005 - 0x80000600, // 0004 RET 0 - 0x880C0302, // 0005 GETMBR R3 R1 K2 - 0x88100104, // 0006 GETMBR R4 R0 K4 - 0x88140103, // 0007 GETMBR R5 R0 K3 - 0x94100A04, // 0008 GETIDX R4 R5 R4 - 0x4C140000, // 0009 LDNIL R5 - 0x8C180105, // 000A GETMET R6 R0 K5 - 0x88200104, // 000B GETMBR R8 R0 K4 - 0x7C180400, // 000C CALL R6 2 - 0x601C000C, // 000D GETGBL R7 G12 - 0x5C200C00, // 000E MOVE R8 R6 - 0x7C1C0200, // 000F CALL R7 1 - 0x181C0F06, // 0010 LE R7 R7 K6 - 0x781E0000, // 0011 JMPF R7 #0013 - 0x80000E00, // 0012 RET 0 - 0x1C1C0707, // 0013 EQ R7 R3 K7 - 0x781E0009, // 0014 JMPF R7 #001F - 0x601C0009, // 0015 GETGBL R7 G9 - 0x88200907, // 0016 GETMBR R8 R4 K7 - 0x7C1C0200, // 0017 CALL R7 1 - 0x5C140E00, // 0018 MOVE R5 R7 - 0x4C1C0000, // 0019 LDNIL R7 - 0x1C1C0A07, // 001A EQ R7 R5 R7 - 0x781E0001, // 001B JMPF R7 #001E - 0x541DFFFE, // 001C LDINT R7 -1 - 0x94140C07, // 001D GETIDX R5 R6 R7 - 0x70020020, // 001E JMP #0040 - 0x1C1C0708, // 001F EQ R7 R3 K8 - 0x781E0008, // 0020 JMPF R7 #002A - 0x601C0009, // 0021 GETGBL R7 G9 - 0x88200908, // 0022 GETMBR R8 R4 K8 - 0x7C1C0200, // 0023 CALL R7 1 - 0x5C140E00, // 0024 MOVE R5 R7 - 0x4C1C0000, // 0025 LDNIL R7 - 0x1C1C0A07, // 0026 EQ R7 R5 R7 - 0x781E0000, // 0027 JMPF R7 #0029 - 0x94140D06, // 0028 GETIDX R5 R6 K6 - 0x70020015, // 0029 JMP #0040 - 0x1C1C0709, // 002A EQ R7 R3 K9 - 0x781E0008, // 002B JMPF R7 #0035 - 0x601C0009, // 002C GETGBL R7 G9 - 0x88200909, // 002D GETMBR R8 R4 K9 - 0x7C1C0200, // 002E CALL R7 1 - 0x5C140E00, // 002F MOVE R5 R7 - 0x4C1C0000, // 0030 LDNIL R7 - 0x1C1C0A07, // 0031 EQ R7 R5 R7 - 0x781E0000, // 0032 JMPF R7 #0034 - 0x58140006, // 0033 LDCONST R5 K6 - 0x7002000A, // 0034 JMP #0040 - 0x881C010A, // 0035 GETMBR R7 R0 K10 - 0x8C1C0F0B, // 0036 GETMET R7 R7 K11 - 0x5C240600, // 0037 MOVE R9 R3 - 0x7C1C0400, // 0038 CALL R7 2 - 0x781E0005, // 0039 JMPF R7 #0040 - 0x601C0009, // 003A GETGBL R7 G9 - 0x5421FFFE, // 003B LDINT R8 -1 - 0x40220C08, // 003C CONNECT R8 K6 R8 - 0x94200608, // 003D GETIDX R8 R3 R8 - 0x7C1C0200, // 003E CALL R7 1 - 0x5C140E00, // 003F MOVE R5 R7 - 0x4C1C0000, // 0040 LDNIL R7 - 0x201C0A07, // 0041 NE R7 R5 R7 - 0x781E0005, // 0042 JMPF R7 #0049 - 0x241C0B0C, // 0043 GT R7 R5 K12 - 0x781E0003, // 0044 JMPF R7 #0049 - 0x881C0103, // 0045 GETMBR R7 R0 K3 - 0x941C0E05, // 0046 GETIDX R7 R7 R5 - 0x8C1C0F0D, // 0047 GETMET R7 R7 K13 - 0x7C1C0200, // 0048 CALL R7 1 - 0x80000000, // 0049 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: _load -********************************************************************/ -be_local_closure(OpenHASP__load, /* name */ - be_nested_proto( - 14, /* 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_literal("string"), - /* K1 */ be_nested_str_literal("json"), - /* K2 */ be_nested_str_literal("lvh_page_cur_idx"), - /* K3 */ be_const_int(1), - /* K4 */ be_nested_str_literal("lvh_page"), - /* K5 */ be_nested_str_literal("lvh_pages"), - /* K6 */ be_nested_str_literal("r"), - /* K7 */ be_nested_str_literal("read"), - /* K8 */ be_nested_str_literal("close"), - /* K9 */ be_nested_str_literal("split"), - /* K10 */ be_nested_str_literal("\n"), - /* K11 */ be_const_int(0), - /* K12 */ be_nested_str_literal("load"), - /* K13 */ be_nested_str_literal("instance"), - /* K14 */ be_nested_str_literal("parse_page"), - /* K15 */ be_nested_str_literal("parse_obj"), - /* K16 */ be_nested_str_literal("remove"), - }), - be_str_literal("_load"), - &be_const_str_solidified, - ( &(const binstruction[54]) { /* code */ - 0xA40A0000, // 0000 IMPORT R2 K0 - 0xA40E0200, // 0001 IMPORT R3 K1 - 0x90020503, // 0002 SETMBR R0 K2 K3 - 0x88100104, // 0003 GETMBR R4 R0 K4 - 0x88140105, // 0004 GETMBR R5 R0 K5 - 0x5C180800, // 0005 MOVE R6 R4 - 0x581C0003, // 0006 LDCONST R7 K3 - 0x5C200000, // 0007 MOVE R8 R0 - 0x7C180400, // 0008 CALL R6 2 - 0x98160606, // 0009 SETIDX R5 K3 R6 - 0x60140011, // 000A GETGBL R5 G17 - 0x5C180200, // 000B MOVE R6 R1 - 0x581C0006, // 000C LDCONST R7 K6 - 0x7C140400, // 000D CALL R5 2 - 0x8C180B07, // 000E GETMET R6 R5 K7 - 0x7C180200, // 000F CALL R6 1 - 0x8C1C0B08, // 0010 GETMET R7 R5 K8 - 0x7C1C0200, // 0011 CALL R7 1 - 0x8C1C0509, // 0012 GETMET R7 R2 K9 - 0x5C240C00, // 0013 MOVE R9 R6 - 0x5828000A, // 0014 LDCONST R10 K10 - 0x7C1C0600, // 0015 CALL R7 3 - 0x4C140000, // 0016 LDNIL R5 - 0x4C180000, // 0017 LDNIL R6 - 0x6020000C, // 0018 GETGBL R8 G12 - 0x5C240E00, // 0019 MOVE R9 R7 - 0x7C200200, // 001A CALL R8 1 - 0x2420110B, // 001B GT R8 R8 K11 - 0x78220015, // 001C JMPF R8 #0033 - 0x8C20070C, // 001D GETMET R8 R3 K12 - 0x94280F0B, // 001E GETIDX R10 R7 K11 - 0x7C200400, // 001F CALL R8 2 - 0x60240004, // 0020 GETGBL R9 G4 - 0x5C281000, // 0021 MOVE R10 R8 - 0x7C240200, // 0022 CALL R9 1 - 0x1C24130D, // 0023 EQ R9 R9 K13 - 0x78260008, // 0024 JMPF R9 #002E - 0x8C24010E, // 0025 GETMET R9 R0 K14 - 0x5C2C1000, // 0026 MOVE R11 R8 - 0x7C240400, // 0027 CALL R9 2 - 0x8C24010F, // 0028 GETMET R9 R0 K15 - 0x5C2C1000, // 0029 MOVE R11 R8 - 0x88300102, // 002A GETMBR R12 R0 K2 - 0x88340105, // 002B GETMBR R13 R0 K5 - 0x94301A0C, // 002C GETIDX R12 R13 R12 - 0x7C240600, // 002D CALL R9 3 - 0x4C200000, // 002E LDNIL R8 - 0x8C240F10, // 002F GETMET R9 R7 K16 - 0x582C000B, // 0030 LDCONST R11 K11 - 0x7C240400, // 0031 CALL R9 2 - 0x7001FFE4, // 0032 JMP #0018 - 0x4C1C0000, // 0033 LDNIL R7 - 0x90020503, // 0034 SETMBR R0 K2 K3 - 0x80000000, // 0035 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: parse -********************************************************************/ -be_local_closure(OpenHASP_parse, /* 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[ 9]) { /* constants */ - /* K0 */ be_nested_str_literal("json"), - /* K1 */ be_nested_str_literal("load"), - /* K2 */ be_nested_str_literal("instance"), - /* K3 */ be_nested_str_literal("parse_page"), - /* K4 */ be_nested_str_literal("parse_obj"), - /* K5 */ be_nested_str_literal("lvh_pages"), - /* K6 */ be_nested_str_literal("lvh_page_cur_idx"), - /* K7 */ be_nested_str_literal("value_error"), - /* K8 */ be_nested_str_literal("unable to parse JSON line"), - }), - be_str_literal("parse"), - &be_const_str_solidified, - ( &(const binstruction[21]) { /* code */ - 0xA40A0000, // 0000 IMPORT R2 K0 - 0x8C0C0501, // 0001 GETMET R3 R2 K1 - 0x5C140200, // 0002 MOVE R5 R1 - 0x7C0C0400, // 0003 CALL R3 2 - 0x60100004, // 0004 GETGBL R4 G4 - 0x5C140600, // 0005 MOVE R5 R3 - 0x7C100200, // 0006 CALL R4 1 - 0x1C100902, // 0007 EQ R4 R4 K2 - 0x78120009, // 0008 JMPF R4 #0013 - 0x8C100103, // 0009 GETMET R4 R0 K3 - 0x5C180600, // 000A MOVE R6 R3 - 0x7C100400, // 000B CALL R4 2 - 0x8C100104, // 000C GETMET R4 R0 K4 - 0x5C180600, // 000D MOVE R6 R3 - 0x881C0106, // 000E GETMBR R7 R0 K6 - 0x88200105, // 000F GETMBR R8 R0 K5 - 0x941C1007, // 0010 GETIDX R7 R8 R7 - 0x7C100600, // 0011 CALL R4 3 - 0x70020000, // 0012 JMP #0014 - 0xB0060F08, // 0013 RAISE 1 K7 K8 - 0x80000000, // 0014 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: start -********************************************************************/ -be_local_closure(OpenHASP_start, /* 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[33]) { /* constants */ - /* K0 */ be_nested_str_literal("path"), - /* K1 */ be_nested_str_literal("def_templ_name"), - /* K2 */ be_nested_str_literal("exists"), - /* K3 */ be_nested_str_literal("file '"), - /* K4 */ be_nested_str_literal("' not found"), - /* K5 */ be_nested_str_literal("io_erorr"), - /* K6 */ be_nested_str_literal("lv"), - /* K7 */ be_nested_str_literal("start"), - /* K8 */ be_nested_str_literal("dark"), - /* K9 */ be_nested_str_literal("hres"), - /* K10 */ be_nested_str_literal("get_hor_res"), - /* K11 */ be_nested_str_literal("vres"), - /* K12 */ be_nested_str_literal("get_ver_res"), - /* K13 */ be_nested_str_literal("scr"), - /* K14 */ be_nested_str_literal("scr_act"), - /* K15 */ be_nested_str_literal("r16"), - /* K16 */ be_nested_str_literal("font_embedded"), - /* K17 */ be_nested_str_literal("robotocondensed"), - /* K18 */ be_nested_str_literal("montserrat"), - /* K19 */ be_nested_str_literal("theme_openhasp_init"), - /* K20 */ be_const_int(0), - /* K21 */ be_nested_str_literal("color"), - /* K22 */ be_const_int(16711935), - /* K23 */ be_const_int(3158064), - /* K24 */ be_nested_str_literal("get_disp"), - /* K25 */ be_nested_str_literal("set_theme"), - /* K26 */ be_nested_str_literal("set_style_bg_color"), - /* K27 */ be_const_int(16777215), - /* K28 */ be_nested_str_literal("theme_apply"), - /* K29 */ be_nested_str_literal("layer_top"), - /* K30 */ be_nested_str_literal("set_style_bg_opa"), - /* K31 */ be_nested_str_literal("lvh_pages"), - /* K32 */ be_nested_str_literal("_load"), - }), - be_str_literal("start"), - &be_const_str_solidified, - ( &(const binstruction[105]) { /* code */ - 0xA40E0000, // 0000 IMPORT R3 K0 - 0x4C100000, // 0001 LDNIL R4 - 0x1C100404, // 0002 EQ R4 R2 R4 - 0x78120000, // 0003 JMPF R4 #0005 - 0x88080101, // 0004 GETMBR R2 R0 K1 - 0x8C100702, // 0005 GETMET R4 R3 K2 - 0x5C180400, // 0006 MOVE R6 R2 - 0x7C100400, // 0007 CALL R4 2 - 0x74120002, // 0008 JMPT R4 #000C - 0x00120602, // 0009 ADD R4 K3 R2 - 0x00100904, // 000A ADD R4 R4 K4 - 0xB0060A04, // 000B RAISE 1 K5 R4 - 0xB8120C00, // 000C GETNGBL R4 K6 - 0x8C100907, // 000D GETMET R4 R4 K7 - 0x7C100200, // 000E CALL R4 1 - 0x60100017, // 000F GETGBL R4 G23 - 0x5C140200, // 0010 MOVE R5 R1 - 0x7C100200, // 0011 CALL R4 1 - 0x90021004, // 0012 SETMBR R0 K8 R4 - 0xB8120C00, // 0013 GETNGBL R4 K6 - 0x8C10090A, // 0014 GETMET R4 R4 K10 - 0x7C100200, // 0015 CALL R4 1 - 0x90021204, // 0016 SETMBR R0 K9 R4 - 0xB8120C00, // 0017 GETNGBL R4 K6 - 0x8C10090C, // 0018 GETMET R4 R4 K12 - 0x7C100200, // 0019 CALL R4 1 - 0x90021604, // 001A SETMBR R0 K11 R4 - 0xB8120C00, // 001B GETNGBL R4 K6 - 0x8C10090E, // 001C GETMET R4 R4 K14 - 0x7C100200, // 001D CALL R4 1 - 0x90021A04, // 001E SETMBR R0 K13 R4 - 0xA8020007, // 001F EXBLK 0 #0028 - 0xB8120C00, // 0020 GETNGBL R4 K6 - 0x8C100910, // 0021 GETMET R4 R4 K16 - 0x58180011, // 0022 LDCONST R6 K17 - 0x541E000F, // 0023 LDINT R7 16 - 0x7C100600, // 0024 CALL R4 3 - 0x90021E04, // 0025 SETMBR R0 K15 R4 - 0xA8040001, // 0026 EXBLK 1 1 - 0x70020009, // 0027 JMP #0032 - 0xAC100000, // 0028 CATCH R4 0 0 - 0x70020006, // 0029 JMP #0031 - 0xB8120C00, // 002A GETNGBL R4 K6 - 0x8C100910, // 002B GETMET R4 R4 K16 - 0x58180012, // 002C LDCONST R6 K18 - 0x541E000D, // 002D LDINT R7 14 - 0x7C100600, // 002E CALL R4 3 - 0x90021E04, // 002F SETMBR R0 K15 R4 - 0x70020000, // 0030 JMP #0032 - 0xB0080000, // 0031 RAISE 2 R0 R0 - 0xB8120C00, // 0032 GETNGBL R4 K6 - 0x8C100913, // 0033 GETMET R4 R4 K19 - 0x58180014, // 0034 LDCONST R6 K20 - 0xB81E0C00, // 0035 GETNGBL R7 K6 - 0x8C1C0F15, // 0036 GETMET R7 R7 K21 - 0x58240016, // 0037 LDCONST R9 K22 - 0x7C1C0400, // 0038 CALL R7 2 - 0xB8220C00, // 0039 GETNGBL R8 K6 - 0x8C201115, // 003A GETMET R8 R8 K21 - 0x58280017, // 003B LDCONST R10 K23 - 0x7C200400, // 003C CALL R8 2 - 0x88240108, // 003D GETMBR R9 R0 K8 - 0x8828010F, // 003E GETMBR R10 R0 K15 - 0x7C100C00, // 003F CALL R4 6 - 0x8814010D, // 0040 GETMBR R5 R0 K13 - 0x8C140B18, // 0041 GETMET R5 R5 K24 - 0x7C140200, // 0042 CALL R5 1 - 0x8C140B19, // 0043 GETMET R5 R5 K25 - 0x5C1C0800, // 0044 MOVE R7 R4 - 0x7C140400, // 0045 CALL R5 2 - 0x8814010D, // 0046 GETMBR R5 R0 K13 - 0x8C140B1A, // 0047 GETMET R5 R5 K26 - 0x881C0108, // 0048 GETMBR R7 R0 K8 - 0x781E0004, // 0049 JMPF R7 #004F - 0xB81E0C00, // 004A GETNGBL R7 K6 - 0x8C1C0F15, // 004B GETMET R7 R7 K21 - 0x58240014, // 004C LDCONST R9 K20 - 0x7C1C0400, // 004D CALL R7 2 - 0x70020003, // 004E JMP #0053 - 0xB81E0C00, // 004F GETNGBL R7 K6 - 0x8C1C0F15, // 0050 GETMET R7 R7 K21 - 0x5824001B, // 0051 LDCONST R9 K27 - 0x7C1C0400, // 0052 CALL R7 2 - 0x58200014, // 0053 LDCONST R8 K20 - 0x7C140600, // 0054 CALL R5 3 - 0xB8160C00, // 0055 GETNGBL R5 K6 - 0x8C140B1C, // 0056 GETMET R5 R5 K28 - 0xB81E0C00, // 0057 GETNGBL R7 K6 - 0x8C1C0F1D, // 0058 GETMET R7 R7 K29 - 0x7C1C0200, // 0059 CALL R7 1 - 0x7C140400, // 005A CALL R5 2 - 0xB8160C00, // 005B GETNGBL R5 K6 - 0x8C140B1D, // 005C GETMET R5 R5 K29 - 0x7C140200, // 005D CALL R5 1 - 0x8C140B1E, // 005E GETMET R5 R5 K30 - 0x581C0014, // 005F LDCONST R7 K20 - 0x58200014, // 0060 LDCONST R8 K20 - 0x7C140600, // 0061 CALL R5 3 - 0x60140013, // 0062 GETGBL R5 G19 - 0x7C140000, // 0063 CALL R5 0 - 0x90023E05, // 0064 SETMBR R0 K31 R5 - 0x8C140120, // 0065 GETMET R5 R0 K32 - 0x5C1C0400, // 0066 MOVE R7 R2 - 0x7C140400, // 0067 CALL R5 2 - 0x80000000, // 0068 RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified class: OpenHASP ********************************************************************/ be_local_class(OpenHASP, 10, NULL, - be_nested_map(42, + be_nested_map(43, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_literal("pages_list_sorted", -1), be_const_closure(OpenHASP_pages_list_sorted_closure) }, - { be_const_key_literal("def_templ_name", -1), be_nested_str_literal("pages.jsonl") }, - { be_const_key_literal("parse_obj", 16), be_const_closure(OpenHASP_parse_obj_closure) }, - { be_const_key_literal("lvh_slider", 37), be_const_class(be_class_lvh_slider) }, - { be_const_key_literal("event_dispatch", 25), be_const_closure(OpenHASP_event_dispatch_closure) }, - { be_const_key_literal("lvh_obj", 29), be_const_class(be_class_lvh_obj) }, - { be_const_key_literal("page_dir_to", -1), be_const_closure(OpenHASP_page_dir_to_closure) }, - { be_const_key_literal("vres", -1), be_const_var(2) }, - { be_const_key_literal("lvh_textarea", -1), be_const_class(be_class_lvh_textarea) }, - { be_const_key_literal("parse", -1), be_const_closure(OpenHASP_parse_closure) }, - { be_const_key_literal("lvh_switch", 8), be_const_class(be_class_lvh_switch) }, - { be_const_key_literal("dark", 13), be_const_var(0) }, - { be_const_key_literal("event", -1), be_const_var(8) }, - { be_const_key_literal("lvh_checkbox", -1), be_const_class(be_class_lvh_checkbox) }, - { be_const_key_literal("lvh_scr", -1), be_const_class(be_class_lvh_scr) }, - { be_const_key_literal("lvh_spinner", -1), be_const_class(be_class_lvh_spinner) }, - { be_const_key_literal("lvh_page_cur_idx", 24), be_const_var(6) }, - { be_const_key_literal("sort", -1), be_const_static_closure(OpenHASP_sort_closure) }, - { be_const_key_literal("r16", -1), be_const_var(4) }, - { be_const_key_literal("do_action", -1), be_const_closure(OpenHASP_do_action_closure) }, - { be_const_key_literal("parse_page", -1), be_const_closure(OpenHASP_parse_page_closure) }, - { be_const_key_literal("register_event", 17), be_const_closure(OpenHASP_register_event_closure) }, - { be_const_key_literal("lvh_dropdown", -1), be_const_class(be_class_lvh_dropdown) }, - { be_const_key_literal("init", -1), be_const_closure(OpenHASP_init_closure) }, - { be_const_key_literal("lvh_roller", 38), be_const_class(be_class_lvh_roller) }, - { be_const_key_literal("lvh_line", -1), be_const_class(be_class_lvh_line) }, - { be_const_key_literal("get_page_cur", -1), be_const_closure(OpenHASP_get_page_cur_closure) }, - { be_const_key_literal("lvh_page", 31), be_const_class(be_class_lvh_page) }, - { be_const_key_literal("lvh_arc", -1), be_const_class(be_class_lvh_arc) }, + { be_const_key_literal("lvh_textarea", 41), be_const_class(be_class_lvh_textarea) }, { be_const_key_literal("scr", -1), be_const_var(3) }, - { be_const_key_literal("re_page_target", -1), be_const_var(7) }, - { be_const_key_literal("lvh_img", 22), be_const_class(be_class_lvh_img) }, - { be_const_key_literal("lvh_btn", -1), be_const_class(be_class_lvh_btn) }, - { be_const_key_literal("lvh_bar", 23), be_const_class(be_class_lvh_bar) }, - { be_const_key_literal("lvh_pages", -1), be_const_var(5) }, - { be_const_key_literal("lvh_btnmatrix", 19), be_const_class(be_class_lvh_btnmatrix) }, - { be_const_key_literal("_load", -1), be_const_closure(OpenHASP__load_closure) }, - { be_const_key_literal("hres", -1), be_const_var(1) }, - { be_const_key_literal("lvh_label", -1), be_const_class(be_class_lvh_label) }, - { be_const_key_literal("event_cb", 12), be_const_var(9) }, - { be_const_key_literal("deinit", 9), be_const_closure(OpenHASP_deinit_closure) }, + { be_const_key_literal("event_dispatch", 16), be_const_closure(OpenHASP_event_dispatch_closure) }, + { be_const_key_literal("lvh_bar", -1), be_const_class(be_class_lvh_bar) }, + { be_const_key_literal("lvh_img", -1), be_const_class(be_class_lvh_img) }, + { be_const_key_literal("event", -1), be_const_var(8) }, + { be_const_key_literal("do_action", 33), be_const_closure(OpenHASP_do_action_closure) }, + { be_const_key_literal("pages_list_sorted", -1), be_const_closure(OpenHASP_pages_list_sorted_closure) }, + { be_const_key_literal("lvh_btnmatrix", 42), be_const_class(be_class_lvh_btnmatrix) }, { be_const_key_literal("start", -1), be_const_closure(OpenHASP_start_closure) }, + { be_const_key_literal("init", 5), be_const_closure(OpenHASP_init_closure) }, + { be_const_key_literal("lvh_scr", -1), be_const_class(be_class_lvh_scr) }, + { be_const_key_literal("parse_page", -1), be_const_closure(OpenHASP_parse_page_closure) }, + { be_const_key_literal("register_event", 24), be_const_closure(OpenHASP_register_event_closure) }, + { be_const_key_literal("lvh_roller", 34), be_const_class(be_class_lvh_roller) }, + { be_const_key_literal("lvh_page", 11), be_const_class(be_class_lvh_page) }, + { be_const_key_literal("lvh_page_cur_idx", -1), be_const_var(6) }, + { be_const_key_literal("lvh_arc", 12), be_const_class(be_class_lvh_arc) }, + { be_const_key_literal("hres", 38), be_const_var(1) }, + { be_const_key_literal("dark", -1), be_const_var(0) }, + { be_const_key_literal("lvh_label", 37), be_const_class(be_class_lvh_label) }, + { be_const_key_literal("deinit", 14), be_const_closure(OpenHASP_deinit_closure) }, + { be_const_key_literal("page_dir_to", -1), be_const_closure(OpenHASP_page_dir_to_closure) }, + { be_const_key_literal("parse_obj", -1), be_const_closure(OpenHASP_parse_obj_closure) }, + { be_const_key_literal("lvh_spinner", -1), be_const_class(be_class_lvh_spinner) }, + { be_const_key_literal("_load", -1), be_const_closure(OpenHASP__load_closure) }, + { be_const_key_literal("lvh_qrcode", -1), be_const_class(be_class_lvh_qrcode) }, + { be_const_key_literal("parse", -1), be_const_closure(OpenHASP_parse_closure) }, + { be_const_key_literal("lvh_pages", 2), be_const_var(5) }, + { be_const_key_literal("lvh_line", -1), be_const_class(be_class_lvh_line) }, + { be_const_key_literal("lvh_switch", -1), be_const_class(be_class_lvh_switch) }, + { be_const_key_literal("re_page_target", -1), be_const_var(7) }, + { be_const_key_literal("r16", -1), be_const_var(4) }, + { be_const_key_literal("def_templ_name", -1), be_nested_str_literal("pages.jsonl") }, + { be_const_key_literal("lvh_obj", 19), be_const_class(be_class_lvh_obj) }, + { be_const_key_literal("sort", 23), be_const_static_closure(OpenHASP_sort_closure) }, + { be_const_key_literal("lvh_dropdown", -1), be_const_class(be_class_lvh_dropdown) }, + { be_const_key_literal("lvh_checkbox", -1), be_const_class(be_class_lvh_checkbox) }, + { be_const_key_literal("lvh_slider", -1), be_const_class(be_class_lvh_slider) }, + { be_const_key_literal("vres", -1), be_const_var(2) }, + { be_const_key_literal("lvh_btn", -1), be_const_class(be_class_lvh_btn) }, + { be_const_key_literal("event_cb", -1), be_const_var(9) }, + { be_const_key_literal("get_page_cur", -1), be_const_closure(OpenHASP_get_page_cur_closure) }, })), be_str_literal("OpenHASP") ); diff --git a/tasmota/berry/openhasp_src/openhasp_core/openhasp.be b/tasmota/berry/openhasp_src/openhasp_core/openhasp.be index cb023fd89..adb259092 100644 --- a/tasmota/berry/openhasp_src/openhasp_core/openhasp.be +++ b/tasmota/berry/openhasp_src/openhasp_core/openhasp.be @@ -17,7 +17,8 @@ var classes = [ "page", "obj", "scr", "btn", "switch", "checkbox", "label", "spinner", "line", "img", "roller", "btnmatrix", - "bar", "slider", "arc", "textarea", "dropdown" + "bar", "slider", "arc", "textarea", "dropdown", + "qrcode" ] for c:classes solidify.dump(openhasp.OpenHASP.("lvh_"+c), true) @@ -132,6 +133,11 @@ class lvh_obj "text_rule": nil, "text_rule_formula": nil, "text_rule_format": nil, + # qrcode + "qr_size": nil, + "qr_dark_color": nil, + "qr_light_color": nil, + "qr_text": nil, } #==================================================================== @@ -308,6 +314,7 @@ class lvh_obj if event_hasp != nil import string + var val = string.format('{"hasp":{"p%ib%i":"%s"}}', self._page._page_id, self.id, event_hasp) # print("val=",val) tasmota.set_timer(0, /-> tasmota.publish_rule(val)) end @@ -925,6 +932,41 @@ class lvh_spinner : lvh_arc def get_speed() end end +#==================================================================== +# qrcode +#==================================================================== +class lvh_qrcode : lvh_obj + static _lv_class = lv.qrcode + + # init + # - create the LVGL encapsulated object + # arg1: parent object + # arg2: json line object + def init(parent, page, jline) + self._page = page + + var size = jline.find("qr_size", 100) + var dark_col = self.parse_color(jline.find("qr_dark_color", "#000000")) + var light_col = self.parse_color(jline.find("qr_light_color", "#FFFFFF")) + + self._lv_obj = lv.qrcode(parent, size, dark_col, light_col) + self.post_init() + end + + # ignore attributes, spinner can't be changed once created + def set_qr_size(t) end + def get_qr_size() end + def set_qr_dark_color(t) end + def get_qr_dark_color() end + def set_qr_light_color(t) end + def get_qr_light_color() end + def set_qr_text(t) + t = str(t) + self._lv_obj.update(t, size(t)) + end + def get_qr_text() end +end + ################################################################################# # # All other subclasses than just map the LVGL object @@ -1118,6 +1160,7 @@ class OpenHASP # static lvh_linemeter = lvh_linemeter # static lvh_gauge = lvh_gauge static lvh_textarea = lvh_textarea # additional? + static lvh_qrcode = lvh_qrcode static def_templ_name = "pages.jsonl" # default template name