HASPmota exception when clicking on a checkbox (#23022)

This commit is contained in:
s-hadinger 2025-02-17 23:04:04 +01:00 committed by GitHub
parent 9b258cadcf
commit 4306823ba6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 79 additions and 4 deletions

View File

@ -23,6 +23,7 @@ All notable changes to this project will be documented in this file.
- Berry parser error in rare case (#22997)
- ESP32 TasMesh broker MAC address all zeros (#23005)
- Wrong RMT channels for ESP32S3, now depends on `soc_caps.h`
- HASPmota exception when clicking on a checkbox
### Removed

View File

@ -1051,7 +1051,7 @@ class lvh_obj : lvh_root
style_modifier = self.digits_to_style(suffix_digits)
end
end
# print(f">>>: getmember {k=} {style_modifier=}")
#print(f">>>: member {k=} {style_modifier=}")
# if attribute name is in ignore list, abort
if self._attr_ignore.find(k) != nil return end
@ -2537,7 +2537,19 @@ end
#@ solidify:lvh_btn,weak
class lvh_btn : lvh_obj static var _lv_class = lv.button end
#@ solidify:lvh_checkbox,weak
class lvh_checkbox : lvh_obj static var _lv_class = lv.checkbox end
class lvh_checkbox : lvh_obj
static var _lv_class = lv.checkbox
static var _lv_part2_selector = lv.PART_INDICATOR
# static var _EVENTS = EVENTS_ALL
# map val to toggle
def set_val(t)
self._val = t
return self.set_toggle(t)
end
def get_val()
return self.get_toggle()
end
end
# class lvh_textarea : lvh_obj static var _lv_class = lv.textarea end
# special case for scr (which is actually lv_obj)
#@ solidify:lvh_scr,weak

View File

@ -11145,6 +11145,65 @@ be_local_class(lvh_btn,
extern const bclass be_class_lvh_checkbox;
/********************************************************************
** Solidified function: set_val
********************************************************************/
be_local_closure(class_lvh_checkbox_set_val, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str_weak(_val),
/* K1 */ be_nested_str_weak(set_toggle),
}),
be_str_weak(set_val),
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x90020001, // 0000 SETMBR R0 K0 R1
0x8C080101, // 0001 GETMET R2 R0 K1
0x5C100200, // 0002 MOVE R4 R1
0x7C080400, // 0003 CALL R2 2
0x80040400, // 0004 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: get_val
********************************************************************/
be_local_closure(class_lvh_checkbox_get_val, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_weak(get_toggle),
}),
be_str_weak(get_val),
&be_const_str_solidified,
( &(const binstruction[ 3]) { /* code */
0x8C040100, // 0000 GETMET R1 R0 K0
0x7C040200, // 0001 CALL R1 1
0x80040200, // 0002 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: lvh_checkbox
********************************************************************/
@ -11152,9 +11211,12 @@ extern const bclass be_class_lvh_obj;
be_local_class(lvh_checkbox,
0,
&be_class_lvh_obj,
be_nested_map(1,
be_nested_map(4,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(_lv_class, -1), be_const_class(be_class_lv_checkbox) },
{ be_const_key_weak(get_val, 1), be_const_closure(class_lvh_checkbox_get_val_closure) },
{ be_const_key_weak(set_val, -1), be_const_closure(class_lvh_checkbox_set_val_closure) },
{ be_const_key_weak(_lv_part2_selector, -1), be_const_int(131072) },
{ be_const_key_weak(_lv_class, 0), be_const_class(be_class_lv_checkbox) },
})),
be_str_weak(lvh_checkbox)
);