mirror of https://github.com/arendst/Tasmota.git
Fix crash when deleting custom widgets
This commit is contained in:
parent
3e555873f8
commit
0cde972703
|
@ -37,6 +37,7 @@ extern const bcstring be_const_str_CFG_X3A_X20skipping_X20_X27display_X2Eini_X27
|
||||||
extern const bcstring be_const_str_COLOR_BLACK;
|
extern const bcstring be_const_str_COLOR_BLACK;
|
||||||
extern const bcstring be_const_str_COLOR_WHITE;
|
extern const bcstring be_const_str_COLOR_WHITE;
|
||||||
extern const bcstring be_const_str_EC_C25519;
|
extern const bcstring be_const_str_EC_C25519;
|
||||||
|
extern const bcstring be_const_str_EVENT_DELETE;
|
||||||
extern const bcstring be_const_str_EVENT_DRAW_MAIN;
|
extern const bcstring be_const_str_EVENT_DRAW_MAIN;
|
||||||
extern const bcstring be_const_str_EVENT_DRAW_PART_BEGIN;
|
extern const bcstring be_const_str_EVENT_DRAW_PART_BEGIN;
|
||||||
extern const bcstring be_const_str_EVENT_DRAW_PART_END;
|
extern const bcstring be_const_str_EVENT_DRAW_PART_END;
|
||||||
|
@ -210,6 +211,7 @@ extern const bcstring be_const_str_add;
|
||||||
extern const bcstring be_const_str_add_anim;
|
extern const bcstring be_const_str_add_anim;
|
||||||
extern const bcstring be_const_str_add_cmd;
|
extern const bcstring be_const_str_add_cmd;
|
||||||
extern const bcstring be_const_str_add_driver;
|
extern const bcstring be_const_str_add_driver;
|
||||||
|
extern const bcstring be_const_str_add_event_cb;
|
||||||
extern const bcstring be_const_str_add_fast_loop;
|
extern const bcstring be_const_str_add_fast_loop;
|
||||||
extern const bcstring be_const_str_add_handler;
|
extern const bcstring be_const_str_add_handler;
|
||||||
extern const bcstring be_const_str_add_header;
|
extern const bcstring be_const_str_add_header;
|
||||||
|
@ -242,6 +244,7 @@ extern const bcstring be_const_str_b;
|
||||||
extern const bcstring be_const_str_back_forth;
|
extern const bcstring be_const_str_back_forth;
|
||||||
extern const bcstring be_const_str_base_class;
|
extern const bcstring be_const_str_base_class;
|
||||||
extern const bcstring be_const_str_battery_present;
|
extern const bcstring be_const_str_battery_present;
|
||||||
|
extern const bcstring be_const_str_before_del;
|
||||||
extern const bcstring be_const_str_begin;
|
extern const bcstring be_const_str_begin;
|
||||||
extern const bcstring be_const_str_begin_multicast;
|
extern const bcstring be_const_str_begin_multicast;
|
||||||
extern const bcstring be_const_str_bool;
|
extern const bcstring be_const_str_bool;
|
||||||
|
@ -321,7 +324,6 @@ extern const bcstring be_const_str_decrypt;
|
||||||
extern const bcstring be_const_str_def;
|
extern const bcstring be_const_str_def;
|
||||||
extern const bcstring be_const_str_deg;
|
extern const bcstring be_const_str_deg;
|
||||||
extern const bcstring be_const_str_deinit;
|
extern const bcstring be_const_str_deinit;
|
||||||
extern const bcstring be_const_str_del;
|
|
||||||
extern const bcstring be_const_str_delay;
|
extern const bcstring be_const_str_delay;
|
||||||
extern const bcstring be_const_str_delete_all_configs;
|
extern const bcstring be_const_str_delete_all_configs;
|
||||||
extern const bcstring be_const_str_depower;
|
extern const bcstring be_const_str_depower;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -14,7 +14,7 @@ be_local_closure(lv_clock_icon_set_time, /* name */
|
||||||
be_nested_proto(
|
be_nested_proto(
|
||||||
11, /* nstack */
|
11, /* nstack */
|
||||||
4, /* argc */
|
4, /* argc */
|
||||||
0, /* varg */
|
2, /* varg */
|
||||||
0, /* has upvals */
|
0, /* has upvals */
|
||||||
NULL, /* no upvals */
|
NULL, /* no upvals */
|
||||||
0, /* has sup protos */
|
0, /* has sup protos */
|
||||||
|
@ -75,7 +75,7 @@ be_local_closure(lv_clock_icon_every_second, /* name */
|
||||||
be_nested_proto(
|
be_nested_proto(
|
||||||
7, /* nstack */
|
7, /* nstack */
|
||||||
1, /* argc */
|
1, /* argc */
|
||||||
0, /* varg */
|
2, /* varg */
|
||||||
0, /* has upvals */
|
0, /* has upvals */
|
||||||
NULL, /* no upvals */
|
NULL, /* no upvals */
|
||||||
0, /* has sup protos */
|
0, /* has sup protos */
|
||||||
|
@ -125,13 +125,37 @@ be_local_closure(lv_clock_icon_init, /* name */
|
||||||
be_nested_proto(
|
be_nested_proto(
|
||||||
11, /* nstack */
|
11, /* nstack */
|
||||||
2, /* argc */
|
2, /* argc */
|
||||||
0, /* varg */
|
2, /* varg */
|
||||||
0, /* has upvals */
|
0, /* has upvals */
|
||||||
NULL, /* no upvals */
|
NULL, /* no upvals */
|
||||||
0, /* has sup protos */
|
1, /* has sup protos */
|
||||||
NULL, /* no sub 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 */
|
1, /* has constants */
|
||||||
( &(const bvalue[22]) { /* constants */
|
( &(const bvalue[25]) { /* constants */
|
||||||
/* K0 */ be_nested_str(init),
|
/* K0 */ be_nested_str(init),
|
||||||
/* K1 */ be_nested_str(lv),
|
/* K1 */ be_nested_str(lv),
|
||||||
/* K2 */ be_nested_str(seg7_font),
|
/* K2 */ be_nested_str(seg7_font),
|
||||||
|
@ -152,12 +176,15 @@ be_local_closure(lv_clock_icon_init, /* name */
|
||||||
/* K17 */ be_nested_str(set_style_bg_color),
|
/* K17 */ be_nested_str(set_style_bg_color),
|
||||||
/* K18 */ be_nested_str(color),
|
/* K18 */ be_nested_str(color),
|
||||||
/* K19 */ be_nested_str(COLOR_BLACK),
|
/* K19 */ be_nested_str(COLOR_BLACK),
|
||||||
/* K20 */ be_nested_str(tasmota),
|
/* K20 */ be_nested_str(add_event_cb),
|
||||||
/* K21 */ be_nested_str(add_driver),
|
/* K21 */ be_nested_str(EVENT_DELETE),
|
||||||
|
/* K22 */ be_const_int(0),
|
||||||
|
/* K23 */ be_nested_str(tasmota),
|
||||||
|
/* K24 */ be_nested_str(add_driver),
|
||||||
}),
|
}),
|
||||||
&be_const_str_init,
|
&be_const_str_init,
|
||||||
&be_const_str_solidified,
|
&be_const_str_solidified,
|
||||||
( &(const binstruction[82]) { /* code */
|
( &(const binstruction[89]) { /* code */
|
||||||
0x60080003, // 0000 GETGBL R2 G3
|
0x60080003, // 0000 GETGBL R2 G3
|
||||||
0x5C0C0000, // 0001 MOVE R3 R0
|
0x5C0C0000, // 0001 MOVE R3 R0
|
||||||
0x7C080200, // 0002 CALL R2 1
|
0x7C080200, // 0002 CALL R2 1
|
||||||
|
@ -235,11 +262,18 @@ be_local_closure(lv_clock_icon_init, /* name */
|
||||||
0x88281505, // 004A GETMBR R10 R10 K5
|
0x88281505, // 004A GETMBR R10 R10 K5
|
||||||
0x3024120A, // 004B OR R9 R9 R10
|
0x3024120A, // 004B OR R9 R9 R10
|
||||||
0x7C180600, // 004C CALL R6 3
|
0x7C180600, // 004C CALL R6 3
|
||||||
0xB80E2800, // 004D GETNGBL R3 K20
|
0x8C0C0114, // 004D GETMET R3 R0 K20
|
||||||
0x8C0C0715, // 004E GETMET R3 R3 K21
|
0x84140000, // 004E CLOSURE R5 P0
|
||||||
0x5C140000, // 004F MOVE R5 R0
|
0xB81A0200, // 004F GETNGBL R6 K1
|
||||||
0x7C0C0400, // 0050 CALL R3 2
|
0x88180D15, // 0050 GETMBR R6 R6 K21
|
||||||
0x80000000, // 0051 RET 0
|
0x581C0016, // 0051 LDCONST R7 K22
|
||||||
|
0x7C0C0800, // 0052 CALL R3 4
|
||||||
|
0xB80E2E00, // 0053 GETNGBL R3 K23
|
||||||
|
0x8C0C0718, // 0054 GETMET R3 R3 K24
|
||||||
|
0x5C140000, // 0055 MOVE R5 R0
|
||||||
|
0x7C0C0400, // 0056 CALL R3 2
|
||||||
|
0xA0000000, // 0057 CLOSE R0
|
||||||
|
0x80000000, // 0058 RET 0
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -247,36 +281,30 @@ be_local_closure(lv_clock_icon_init, /* name */
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
** Solidified function: del
|
** Solidified function: before_del
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
be_local_closure(lv_clock_icon_del, /* name */
|
be_local_closure(lv_clock_icon_before_del, /* name */
|
||||||
be_nested_proto(
|
be_nested_proto(
|
||||||
4, /* nstack */
|
4, /* nstack */
|
||||||
1, /* argc */
|
1, /* argc */
|
||||||
0, /* varg */
|
2, /* varg */
|
||||||
0, /* has upvals */
|
0, /* has upvals */
|
||||||
NULL, /* no upvals */
|
NULL, /* no upvals */
|
||||||
0, /* has sup protos */
|
0, /* has sup protos */
|
||||||
NULL, /* no sub protos */
|
NULL, /* no sub protos */
|
||||||
1, /* has constants */
|
1, /* has constants */
|
||||||
( &(const bvalue[ 3]) { /* constants */
|
( &(const bvalue[ 2]) { /* constants */
|
||||||
/* K0 */ be_nested_str(del),
|
/* K0 */ be_nested_str(tasmota),
|
||||||
/* K1 */ be_nested_str(tasmota),
|
/* K1 */ be_nested_str(remove_driver),
|
||||||
/* K2 */ be_nested_str(remove_driver),
|
|
||||||
}),
|
}),
|
||||||
&be_const_str_del,
|
&be_const_str_before_del,
|
||||||
&be_const_str_solidified,
|
&be_const_str_solidified,
|
||||||
( &(const binstruction[10]) { /* code */
|
( &(const binstruction[ 5]) { /* code */
|
||||||
0x60040003, // 0000 GETGBL R1 G3
|
0xB8060000, // 0000 GETNGBL R1 K0
|
||||||
0x5C080000, // 0001 MOVE R2 R0
|
0x8C040301, // 0001 GETMET R1 R1 K1
|
||||||
0x7C040200, // 0002 CALL R1 1
|
0x5C0C0000, // 0002 MOVE R3 R0
|
||||||
0x8C040300, // 0003 GETMET R1 R1 K0
|
0x7C040400, // 0003 CALL R1 2
|
||||||
0x7C040200, // 0004 CALL R1 1
|
0x80000000, // 0004 RET 0
|
||||||
0xB8060200, // 0005 GETNGBL R1 K1
|
|
||||||
0x8C040302, // 0006 GETMET R1 R1 K2
|
|
||||||
0x5C0C0000, // 0007 MOVE R3 R0
|
|
||||||
0x7C040400, // 0008 CALL R1 2
|
|
||||||
0x80000000, // 0009 RET 0
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -294,11 +322,11 @@ be_local_class(lv_clock_icon,
|
||||||
( (struct bmapnode*) &(const bmapnode[]) {
|
( (struct bmapnode*) &(const bmapnode[]) {
|
||||||
{ be_const_key(sec, -1), be_const_var(2) },
|
{ be_const_key(sec, -1), be_const_var(2) },
|
||||||
{ be_const_key(hour, -1), be_const_var(0) },
|
{ be_const_key(hour, -1), be_const_var(0) },
|
||||||
{ be_const_key(set_time, 6), be_const_closure(lv_clock_icon_set_time_closure) },
|
{ be_const_key(before_del, 6), be_const_closure(lv_clock_icon_before_del_closure) },
|
||||||
{ be_const_key(every_second, -1), be_const_closure(lv_clock_icon_every_second_closure) },
|
{ be_const_key(every_second, -1), be_const_closure(lv_clock_icon_every_second_closure) },
|
||||||
{ be_const_key(minute, -1), be_const_var(1) },
|
{ be_const_key(minute, -1), be_const_var(1) },
|
||||||
{ be_const_key(init, 2), be_const_closure(lv_clock_icon_init_closure) },
|
{ be_const_key(set_time, 2), be_const_closure(lv_clock_icon_set_time_closure) },
|
||||||
{ be_const_key(del, -1), be_const_closure(lv_clock_icon_del_closure) },
|
{ be_const_key(init, -1), be_const_closure(lv_clock_icon_init_closure) },
|
||||||
})),
|
})),
|
||||||
be_str_literal("lv_clock_icon")
|
be_str_literal("lv_clock_icon")
|
||||||
);
|
);
|
||||||
|
|
|
@ -7,6 +7,80 @@
|
||||||
|
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
|
|
||||||
|
/********************************************************************
|
||||||
|
** 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
|
** Solidified function: every_second
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
@ -14,7 +88,7 @@ be_local_closure(lv_wifi_arcs_every_second, /* name */
|
||||||
be_nested_proto(
|
be_nested_proto(
|
||||||
7, /* nstack */
|
7, /* nstack */
|
||||||
1, /* argc */
|
1, /* argc */
|
||||||
0, /* varg */
|
2, /* varg */
|
||||||
0, /* has upvals */
|
0, /* has upvals */
|
||||||
NULL, /* no upvals */
|
NULL, /* no upvals */
|
||||||
0, /* has sup protos */
|
0, /* has sup protos */
|
||||||
|
@ -61,86 +135,6 @@ be_local_closure(lv_wifi_arcs_every_second, /* name */
|
||||||
/*******************************************************************/
|
/*******************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************
|
|
||||||
** Solidified function: init
|
|
||||||
********************************************************************/
|
|
||||||
be_local_closure(lv_wifi_arcs_init, /* name */
|
|
||||||
be_nested_proto(
|
|
||||||
5, /* nstack */
|
|
||||||
2, /* argc */
|
|
||||||
0, /* varg */
|
|
||||||
0, /* has upvals */
|
|
||||||
NULL, /* no upvals */
|
|
||||||
0, /* has sup protos */
|
|
||||||
NULL, /* no sub protos */
|
|
||||||
1, /* has constants */
|
|
||||||
( &(const bvalue[ 5]) { /* constants */
|
|
||||||
/* K0 */ be_nested_str(init),
|
|
||||||
/* K1 */ be_nested_str(tasmota),
|
|
||||||
/* K2 */ be_nested_str(add_driver),
|
|
||||||
/* K3 */ be_nested_str(set_percentage),
|
|
||||||
/* K4 */ be_const_int(0),
|
|
||||||
}),
|
|
||||||
&be_const_str_init,
|
|
||||||
&be_const_str_solidified,
|
|
||||||
( &(const binstruction[14]) { /* code */
|
|
||||||
0x60080003, // 0000 GETGBL R2 G3
|
|
||||||
0x5C0C0000, // 0001 MOVE R3 R0
|
|
||||||
0x7C080200, // 0002 CALL R2 1
|
|
||||||
0x8C080500, // 0003 GETMET R2 R2 K0
|
|
||||||
0x5C100200, // 0004 MOVE R4 R1
|
|
||||||
0x7C080400, // 0005 CALL R2 2
|
|
||||||
0xB80A0200, // 0006 GETNGBL R2 K1
|
|
||||||
0x8C080502, // 0007 GETMET R2 R2 K2
|
|
||||||
0x5C100000, // 0008 MOVE R4 R0
|
|
||||||
0x7C080400, // 0009 CALL R2 2
|
|
||||||
0x8C080103, // 000A GETMET R2 R0 K3
|
|
||||||
0x58100004, // 000B LDCONST R4 K4
|
|
||||||
0x7C080400, // 000C CALL R2 2
|
|
||||||
0x80000000, // 000D RET 0
|
|
||||||
})
|
|
||||||
)
|
|
||||||
);
|
|
||||||
/*******************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************
|
|
||||||
** Solidified function: del
|
|
||||||
********************************************************************/
|
|
||||||
be_local_closure(lv_wifi_arcs_del, /* name */
|
|
||||||
be_nested_proto(
|
|
||||||
4, /* nstack */
|
|
||||||
1, /* argc */
|
|
||||||
0, /* varg */
|
|
||||||
0, /* has upvals */
|
|
||||||
NULL, /* no upvals */
|
|
||||||
0, /* has sup protos */
|
|
||||||
NULL, /* no sub protos */
|
|
||||||
1, /* has constants */
|
|
||||||
( &(const bvalue[ 3]) { /* constants */
|
|
||||||
/* K0 */ be_nested_str(del),
|
|
||||||
/* K1 */ be_nested_str(tasmota),
|
|
||||||
/* K2 */ be_nested_str(remove_driver),
|
|
||||||
}),
|
|
||||||
&be_const_str_del,
|
|
||||||
&be_const_str_solidified,
|
|
||||||
( &(const binstruction[10]) { /* code */
|
|
||||||
0x60040003, // 0000 GETGBL R1 G3
|
|
||||||
0x5C080000, // 0001 MOVE R2 R0
|
|
||||||
0x7C040200, // 0002 CALL R1 1
|
|
||||||
0x8C040300, // 0003 GETMET R1 R1 K0
|
|
||||||
0x7C040200, // 0004 CALL R1 1
|
|
||||||
0xB8060200, // 0005 GETNGBL R1 K1
|
|
||||||
0x8C040302, // 0006 GETMET R1 R1 K2
|
|
||||||
0x5C0C0000, // 0007 MOVE R3 R0
|
|
||||||
0x7C040400, // 0008 CALL R1 2
|
|
||||||
0x80000000, // 0009 RET 0
|
|
||||||
})
|
|
||||||
)
|
|
||||||
);
|
|
||||||
/*******************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
** Solidified class: lv_wifi_arcs
|
** Solidified class: lv_wifi_arcs
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
@ -150,9 +144,9 @@ be_local_class(lv_wifi_arcs,
|
||||||
&be_class_lv_signal_arcs,
|
&be_class_lv_signal_arcs,
|
||||||
be_nested_map(3,
|
be_nested_map(3,
|
||||||
( (struct bmapnode*) &(const bmapnode[]) {
|
( (struct bmapnode*) &(const bmapnode[]) {
|
||||||
{ be_const_key(every_second, 1), be_const_closure(lv_wifi_arcs_every_second_closure) },
|
{ 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) },
|
{ be_const_key(init, -1), be_const_closure(lv_wifi_arcs_init_closure) },
|
||||||
{ be_const_key(del, -1), be_const_closure(lv_wifi_arcs_del_closure) },
|
|
||||||
})),
|
})),
|
||||||
be_str_literal("lv_wifi_arcs")
|
be_str_literal("lv_wifi_arcs")
|
||||||
);
|
);
|
||||||
|
|
|
@ -7,6 +7,80 @@
|
||||||
|
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
|
|
||||||
|
/********************************************************************
|
||||||
|
** 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
|
** Solidified function: every_second
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
@ -14,7 +88,7 @@ be_local_closure(lv_wifi_bars_every_second, /* name */
|
||||||
be_nested_proto(
|
be_nested_proto(
|
||||||
7, /* nstack */
|
7, /* nstack */
|
||||||
1, /* argc */
|
1, /* argc */
|
||||||
0, /* varg */
|
2, /* varg */
|
||||||
0, /* has upvals */
|
0, /* has upvals */
|
||||||
NULL, /* no upvals */
|
NULL, /* no upvals */
|
||||||
0, /* has sup protos */
|
0, /* has sup protos */
|
||||||
|
@ -61,86 +135,6 @@ be_local_closure(lv_wifi_bars_every_second, /* name */
|
||||||
/*******************************************************************/
|
/*******************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************
|
|
||||||
** Solidified function: init
|
|
||||||
********************************************************************/
|
|
||||||
be_local_closure(lv_wifi_bars_init, /* name */
|
|
||||||
be_nested_proto(
|
|
||||||
5, /* nstack */
|
|
||||||
2, /* argc */
|
|
||||||
0, /* varg */
|
|
||||||
0, /* has upvals */
|
|
||||||
NULL, /* no upvals */
|
|
||||||
0, /* has sup protos */
|
|
||||||
NULL, /* no sub protos */
|
|
||||||
1, /* has constants */
|
|
||||||
( &(const bvalue[ 5]) { /* constants */
|
|
||||||
/* K0 */ be_nested_str(init),
|
|
||||||
/* K1 */ be_nested_str(tasmota),
|
|
||||||
/* K2 */ be_nested_str(add_driver),
|
|
||||||
/* K3 */ be_nested_str(set_percentage),
|
|
||||||
/* K4 */ be_const_int(0),
|
|
||||||
}),
|
|
||||||
&be_const_str_init,
|
|
||||||
&be_const_str_solidified,
|
|
||||||
( &(const binstruction[14]) { /* code */
|
|
||||||
0x60080003, // 0000 GETGBL R2 G3
|
|
||||||
0x5C0C0000, // 0001 MOVE R3 R0
|
|
||||||
0x7C080200, // 0002 CALL R2 1
|
|
||||||
0x8C080500, // 0003 GETMET R2 R2 K0
|
|
||||||
0x5C100200, // 0004 MOVE R4 R1
|
|
||||||
0x7C080400, // 0005 CALL R2 2
|
|
||||||
0xB80A0200, // 0006 GETNGBL R2 K1
|
|
||||||
0x8C080502, // 0007 GETMET R2 R2 K2
|
|
||||||
0x5C100000, // 0008 MOVE R4 R0
|
|
||||||
0x7C080400, // 0009 CALL R2 2
|
|
||||||
0x8C080103, // 000A GETMET R2 R0 K3
|
|
||||||
0x58100004, // 000B LDCONST R4 K4
|
|
||||||
0x7C080400, // 000C CALL R2 2
|
|
||||||
0x80000000, // 000D RET 0
|
|
||||||
})
|
|
||||||
)
|
|
||||||
);
|
|
||||||
/*******************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************
|
|
||||||
** Solidified function: del
|
|
||||||
********************************************************************/
|
|
||||||
be_local_closure(lv_wifi_bars_del, /* name */
|
|
||||||
be_nested_proto(
|
|
||||||
4, /* nstack */
|
|
||||||
1, /* argc */
|
|
||||||
0, /* varg */
|
|
||||||
0, /* has upvals */
|
|
||||||
NULL, /* no upvals */
|
|
||||||
0, /* has sup protos */
|
|
||||||
NULL, /* no sub protos */
|
|
||||||
1, /* has constants */
|
|
||||||
( &(const bvalue[ 3]) { /* constants */
|
|
||||||
/* K0 */ be_nested_str(del),
|
|
||||||
/* K1 */ be_nested_str(tasmota),
|
|
||||||
/* K2 */ be_nested_str(remove_driver),
|
|
||||||
}),
|
|
||||||
&be_const_str_del,
|
|
||||||
&be_const_str_solidified,
|
|
||||||
( &(const binstruction[10]) { /* code */
|
|
||||||
0x60040003, // 0000 GETGBL R1 G3
|
|
||||||
0x5C080000, // 0001 MOVE R2 R0
|
|
||||||
0x7C040200, // 0002 CALL R1 1
|
|
||||||
0x8C040300, // 0003 GETMET R1 R1 K0
|
|
||||||
0x7C040200, // 0004 CALL R1 1
|
|
||||||
0xB8060200, // 0005 GETNGBL R1 K1
|
|
||||||
0x8C040302, // 0006 GETMET R1 R1 K2
|
|
||||||
0x5C0C0000, // 0007 MOVE R3 R0
|
|
||||||
0x7C040400, // 0008 CALL R1 2
|
|
||||||
0x80000000, // 0009 RET 0
|
|
||||||
})
|
|
||||||
)
|
|
||||||
);
|
|
||||||
/*******************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
** Solidified class: lv_wifi_bars
|
** Solidified class: lv_wifi_bars
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
@ -150,9 +144,9 @@ be_local_class(lv_wifi_bars,
|
||||||
&be_class_lv_signal_bars,
|
&be_class_lv_signal_bars,
|
||||||
be_nested_map(3,
|
be_nested_map(3,
|
||||||
( (struct bmapnode*) &(const bmapnode[]) {
|
( (struct bmapnode*) &(const bmapnode[]) {
|
||||||
{ be_const_key(every_second, 1), be_const_closure(lv_wifi_bars_every_second_closure) },
|
{ 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) },
|
{ be_const_key(init, -1), be_const_closure(lv_wifi_bars_init_closure) },
|
||||||
{ be_const_key(del, -1), be_const_closure(lv_wifi_bars_del_closure) },
|
|
||||||
})),
|
})),
|
||||||
be_str_literal("lv_wifi_bars")
|
be_str_literal("lv_wifi_bars")
|
||||||
);
|
);
|
||||||
|
|
|
@ -25,6 +25,8 @@ class lv_clock_icon: lv.label
|
||||||
self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT)
|
self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self.add_event_cb(/->self.before_del(), lv.EVENT_DELETE, 0) # register `before_del` to be called when object is deleted
|
||||||
|
|
||||||
tasmota.add_driver(self)
|
tasmota.add_driver(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -47,8 +49,7 @@ class lv_clock_icon: lv.label
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def del()
|
def before_del()
|
||||||
super(self).del()
|
|
||||||
tasmota.remove_driver(self)
|
tasmota.remove_driver(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -109,8 +109,7 @@ class lv_wifi_arcs: lv_signal_arcs
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def del()
|
def before_del() # called when the widget is being deleted
|
||||||
super(self).del()
|
|
||||||
tasmota.remove_driver(self)
|
tasmota.remove_driver(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -95,8 +95,7 @@ class lv_wifi_bars: lv_signal_bars
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def del()
|
def before_del() # called when the widget is being deleted
|
||||||
super(self).del()
|
|
||||||
tasmota.remove_driver(self)
|
tasmota.remove_driver(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -631,7 +631,6 @@ be_local_closure(LVGL_glob_init, /* name */
|
||||||
/*******************************************************************/
|
/*******************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
** Solidified function: widget_event_impl
|
** Solidified function: widget_event_impl
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
@ -639,13 +638,13 @@ be_local_closure(LVGL_glob_widget_event_impl, /* name */
|
||||||
be_nested_proto(
|
be_nested_proto(
|
||||||
12, /* nstack */
|
12, /* nstack */
|
||||||
3, /* argc */
|
3, /* argc */
|
||||||
0, /* varg */
|
2, /* varg */
|
||||||
0, /* has upvals */
|
0, /* has upvals */
|
||||||
NULL, /* no upvals */
|
NULL, /* no upvals */
|
||||||
0, /* has sup protos */
|
0, /* has sup protos */
|
||||||
NULL, /* no sub protos */
|
NULL, /* no sub protos */
|
||||||
1, /* has constants */
|
1, /* has constants */
|
||||||
( &(const bvalue[ 9]) { /* constants */
|
( &(const bvalue[12]) { /* constants */
|
||||||
/* K0 */ be_nested_str(introspect),
|
/* K0 */ be_nested_str(introspect),
|
||||||
/* K1 */ be_nested_str(lv),
|
/* K1 */ be_nested_str(lv),
|
||||||
/* K2 */ be_nested_str(lv_obj_class),
|
/* K2 */ be_nested_str(lv_obj_class),
|
||||||
|
@ -653,12 +652,15 @@ be_local_closure(LVGL_glob_widget_event_impl, /* name */
|
||||||
/* K4 */ be_nested_str(target),
|
/* K4 */ be_nested_str(target),
|
||||||
/* K5 */ be_nested_str(get_object_from_ptr),
|
/* K5 */ be_nested_str(get_object_from_ptr),
|
||||||
/* K6 */ be_nested_str(instance),
|
/* K6 */ be_nested_str(instance),
|
||||||
/* K7 */ be_nested_str(get),
|
/* K7 */ be_nested_str(code),
|
||||||
/* K8 */ be_nested_str(widget_event),
|
/* K8 */ be_nested_str(EVENT_DELETE),
|
||||||
|
/* K9 */ be_nested_str(get),
|
||||||
|
/* K10 */ be_nested_str(before_del),
|
||||||
|
/* K11 */ be_nested_str(widget_event),
|
||||||
}),
|
}),
|
||||||
&be_const_str_widget_event_impl,
|
&be_const_str_widget_event_impl,
|
||||||
&be_const_str_solidified,
|
&be_const_str_solidified,
|
||||||
( &(const binstruction[28]) { /* code */
|
( &(const binstruction[43]) { /* code */
|
||||||
0xA40E0000, // 0000 IMPORT R3 K0
|
0xA40E0000, // 0000 IMPORT R3 K0
|
||||||
0xB8120200, // 0001 GETNGBL R4 K1
|
0xB8120200, // 0001 GETNGBL R4 K1
|
||||||
0x8C100902, // 0002 GETMET R4 R4 K2
|
0x8C100902, // 0002 GETMET R4 R4 K2
|
||||||
|
@ -676,17 +678,32 @@ be_local_closure(LVGL_glob_widget_event_impl, /* name */
|
||||||
0x5C240E00, // 000E MOVE R9 R7
|
0x5C240E00, // 000E MOVE R9 R7
|
||||||
0x7C200200, // 000F CALL R8 1
|
0x7C200200, // 000F CALL R8 1
|
||||||
0x1C201106, // 0010 EQ R8 R8 K6
|
0x1C201106, // 0010 EQ R8 R8 K6
|
||||||
0x78220008, // 0011 JMPF R8 #001B
|
0x78220017, // 0011 JMPF R8 #002A
|
||||||
0x8C200707, // 0012 GETMET R8 R3 K7
|
0x88200B07, // 0012 GETMBR R8 R5 K7
|
||||||
0x5C280E00, // 0013 MOVE R10 R7
|
0xB8260200, // 0013 GETNGBL R9 K1
|
||||||
0x582C0008, // 0014 LDCONST R11 K8
|
0x88241308, // 0014 GETMBR R9 R9 K8
|
||||||
0x7C200600, // 0015 CALL R8 3
|
0x1C201009, // 0015 EQ R8 R8 R9
|
||||||
0x78220003, // 0016 JMPF R8 #001B
|
0x78220009, // 0016 JMPF R8 #0021
|
||||||
0x8C200F08, // 0017 GETMET R8 R7 K8
|
0x8C200709, // 0017 GETMET R8 R3 K9
|
||||||
0x5C280800, // 0018 MOVE R10 R4
|
0x5C280E00, // 0018 MOVE R10 R7
|
||||||
0x5C2C0A00, // 0019 MOVE R11 R5
|
0x582C000A, // 0019 LDCONST R11 K10
|
||||||
0x7C200600, // 001A CALL R8 3
|
0x7C200600, // 001A CALL R8 3
|
||||||
0x80000000, // 001B RET 0
|
0x78220004, // 001B JMPF R8 #0021
|
||||||
|
0x8C200F0A, // 001C GETMET R8 R7 K10
|
||||||
|
0x5C280800, // 001D MOVE R10 R4
|
||||||
|
0x5C2C0A00, // 001E MOVE R11 R5
|
||||||
|
0x7C200600, // 001F CALL R8 3
|
||||||
|
0x70020008, // 0020 JMP #002A
|
||||||
|
0x8C200709, // 0021 GETMET R8 R3 K9
|
||||||
|
0x5C280E00, // 0022 MOVE R10 R7
|
||||||
|
0x582C000B, // 0023 LDCONST R11 K11
|
||||||
|
0x7C200600, // 0024 CALL R8 3
|
||||||
|
0x78220003, // 0025 JMPF R8 #002A
|
||||||
|
0x8C200F0B, // 0026 GETMET R8 R7 K11
|
||||||
|
0x5C280800, // 0027 MOVE R10 R4
|
||||||
|
0x5C2C0A00, // 0028 MOVE R11 R5
|
||||||
|
0x7C200600, // 0029 CALL R8 3
|
||||||
|
0x80000000, // 002A RET 0
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
@ -101,8 +101,12 @@ class LVGL_glob
|
||||||
var event = lv.lv_event(e_ptr)
|
var event = lv.lv_event(e_ptr)
|
||||||
var obj_ptr = event.target
|
var obj_ptr = event.target
|
||||||
var obj = self.get_object_from_ptr(obj_ptr)
|
var obj = self.get_object_from_ptr(obj_ptr)
|
||||||
if type(obj) == 'instance' && introspect.get(obj, 'widget_event')
|
if type(obj) == 'instance'
|
||||||
obj.widget_event(cl, event)
|
if event.code == lv.EVENT_DELETE && introspect.get(obj, 'before_del')
|
||||||
|
obj.before_del(cl, event)
|
||||||
|
elif introspect.get(obj, 'widget_event')
|
||||||
|
obj.widget_event(cl, event)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
# print("widget_event_impl", cl, obj_ptr, obj, event)
|
# print("widget_event_impl", cl, obj_ptr, obj, event)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue