diff --git a/lib/libesp32/Berry/generate/be_const_strtab.h b/lib/libesp32/Berry/generate/be_const_strtab.h index 6691c08f6..11b5c6e7f 100644 --- a/lib/libesp32/Berry/generate/be_const_strtab.h +++ b/lib/libesp32/Berry/generate/be_const_strtab.h @@ -414,6 +414,7 @@ extern const bcstring be_const_str_lv_draw_mask_angle_param_cfg; extern const bcstring be_const_str_save; extern const bcstring be_const_str_size; extern const bcstring be_const_str_NONE; +extern const bcstring be_const_str_static; extern const bcstring be_const_str_exp; extern const bcstring be_const_str_on; extern const bcstring be_const_str_BL0940_RX; diff --git a/lib/libesp32/Berry/generate/be_const_strtab_def.h b/lib/libesp32/Berry/generate/be_const_strtab_def.h index 3141a2641..988eca7bc 100644 --- a/lib/libesp32/Berry/generate/be_const_strtab_def.h +++ b/lib/libesp32/Berry/generate/be_const_strtab_def.h @@ -413,7 +413,8 @@ be_define_const_str(asstring, "asstring", 1298225088u, 0, 8, &be_const_str_lv_dr be_define_const_str(lv_draw_mask_angle_param_cfg, "lv_draw_mask_angle_param_cfg", 3599767368u, 0, 28, &be_const_str_save); be_define_const_str(save, "save", 3439296072u, 0, 4, &be_const_str_size); be_define_const_str(size, "size", 597743964u, 0, 4, NULL); -be_define_const_str(NONE, "NONE", 1932136219u, 0, 4, NULL); +be_define_const_str(NONE, "NONE", 1932136219u, 0, 4, &be_const_str_static); +be_define_const_str(static, "static", 3532702267u, 71, 6, NULL); be_define_const_str(exp, "exp", 1923516200u, 0, 3, &be_const_str_on); be_define_const_str(on, "on", 1630810064u, 0, 2, NULL); be_define_const_str(BL0940_RX, "BL0940_RX", 2908993179u, 0, 9, &be_const_str_WIEGAND_D0); diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_bytes.h b/lib/libesp32/Berry/generate/be_fixed_be_class_bytes.h index 968d964fd..80ee78fdd 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_bytes.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_bytes.h @@ -7,7 +7,7 @@ static be_define_const_map_slots(be_class_bytes_map) { { be_const_key(seti, -1), be_const_func(m_set) }, { be_const_key(setitem, -1), be_const_func(m_setitem) }, { be_const_key(item, 18), be_const_func(m_item) }, - { be_const_key(dot_p, 3), be_const_int(0) }, + { be_const_key(dot_p, 3), be_const_var(0) }, { be_const_key(geti, -1), be_const_func(m_geti) }, { be_const_key(opt_connect, -1), be_const_func(m_connect) }, { be_const_key(tostring, -1), be_const_func(m_tostring) }, diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_list.h b/lib/libesp32/Berry/generate/be_fixed_be_class_list.h index 98a52b494..300efcce0 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_list.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_list.h @@ -14,7 +14,7 @@ static be_define_const_map_slots(be_class_list_map) { { be_const_key(tostring, 3), be_const_func(m_tostring) }, { be_const_key(opt_eq, -1), be_const_func(m_equal) }, { be_const_key(init, -1), be_const_func(m_init) }, - { be_const_key(dot_p, 17), be_const_int(0) }, + { be_const_key(dot_p, 17), be_const_var(0) }, { be_const_key(setitem, -1), be_const_func(m_setitem) }, { be_const_key(opt_connect, 4), be_const_func(m_connect) }, { be_const_key(opt_neq, -1), be_const_func(m_nequal) }, diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_arc.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_arc.h index dfa8110f5..d0512204e 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_arc.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_arc.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_arc_map) { { be_const_key(init, 2), be_const_func(lvbe_arc_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_bar.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_bar.h index 2d4336f44..c96c467db 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_bar.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_bar.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_bar_map) { { be_const_key(init, 2), be_const_func(lvbe_bar_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btn.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btn.h index cf8d80833..29590fa55 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btn.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btn.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_btn_map) { { be_const_key(init, 2), be_const_func(lvbe_btn_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btnmatrix.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btnmatrix.h index ec4dc09e0..3a029c9c3 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btnmatrix.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btnmatrix.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_btnmatrix_map) { { be_const_key(init, 2), be_const_func(lvbe_btnmatrix_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_calendar.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_calendar.h index 593c30b69..80f07efb6 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_calendar.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_calendar.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_calendar_map) { { be_const_key(init, 2), be_const_func(lvbe_calendar_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_canvas.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_canvas.h index 74607f0a4..4fd9bb5ea 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_canvas.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_canvas.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_canvas_map) { { be_const_key(init, 2), be_const_func(lvbe_canvas_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_chart.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_chart.h index 0ebc1f578..6b09657c2 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_chart.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_chart.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_chart_map) { { be_const_key(init, 2), be_const_func(lvbe_chart_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_checkbox.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_checkbox.h index f64be0ded..3165be40a 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_checkbox.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_checkbox.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_checkbox_map) { { be_const_key(init, 2), be_const_func(lvbe_checkbox_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_color.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_color.h index 252a6d6ab..1f4f75bfc 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_color.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_color.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_color_map) { { be_const_key(init, -1), be_const_func(lco_init) }, { be_const_key(tostring, 2), be_const_func(lco_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, }; static be_define_const_map( diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cont.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cont.h index 3ab5828ba..609766430 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cont.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cont.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_cont_map) { { be_const_key(init, 2), be_const_func(lvbe_cont_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cpicker.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cpicker.h index 5a91a5708..e9be78a9a 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cpicker.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cpicker.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_cpicker_map) { { be_const_key(init, 2), be_const_func(lvbe_cpicker_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_ctypes.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_ctypes.h index 0f4672d54..0fea061de 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_ctypes.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_ctypes.h @@ -1,7 +1,7 @@ #include "be_constobj.h" static be_define_const_map_slots(be_class_lv_ctypes_map) { - { be_const_key(dot_def, -1), be_const_int(0) }, + { be_const_key(dot_def, -1), be_const_var(0) }, { be_const_key(setmember, -1), be_const_func(be_ctypes_setmember) }, { be_const_key(init, -1), be_const_func(be_ctypes_init) }, { be_const_key(member, 2), be_const_func(be_ctypes_member) }, diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_dropdown.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_dropdown.h index c36d9970e..b5011f491 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_dropdown.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_dropdown.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_dropdown_map) { { be_const_key(init, 2), be_const_func(lvbe_dropdown_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_font.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_font.h index 47cf8975f..1e1ebc351 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_font.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_font.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_font_map) { { be_const_key(init, -1), be_const_func(lvx_init) }, { be_const_key(tostring, 2), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, }; static be_define_const_map( diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_gauge.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_gauge.h index 2e84145b9..cb86f23c3 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_gauge.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_gauge.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_gauge_map) { { be_const_key(init, 2), be_const_func(lvbe_gauge_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_group.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_group.h index 46f29f0c1..f939812a2 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_group.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_group.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_group_map) { { be_const_key(init, 2), be_const_func(lvbe_group_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_img.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_img.h index 6f04c933b..e00cc4a9a 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_img.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_img.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_img_map) { { be_const_key(init, 2), be_const_func(lvbe_img_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_imgbtn.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_imgbtn.h index 2270dfdff..c35b0d8cd 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_imgbtn.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_imgbtn.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_imgbtn_map) { { be_const_key(init, 2), be_const_func(lvbe_imgbtn_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_indev.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_indev.h index 002804d30..591758d8f 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_indev.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_indev.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_indev_map) { { be_const_key(init, 2), be_const_func(lv0_init) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_keyboard.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_keyboard.h index 68d674421..f1ffefb5b 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_keyboard.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_keyboard.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_keyboard_map) { { be_const_key(init, 2), be_const_func(lvbe_keyboard_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_label.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_label.h index 5bcfae692..c05287a03 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_label.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_label.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_label_map) { { be_const_key(init, 2), be_const_func(lvbe_label_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_led.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_led.h index 70bc6b820..e3995f1e0 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_led.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_led.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_led_map) { { be_const_key(init, 2), be_const_func(lvbe_led_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_line.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_line.h index 7c32984a9..e12a41e8b 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_line.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_line.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_line_map) { { be_const_key(init, 2), be_const_func(lvbe_line_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_linemeter.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_linemeter.h index af20fbd2f..72d00f372 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_linemeter.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_linemeter.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_linemeter_map) { { be_const_key(init, 2), be_const_func(lvbe_linemeter_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_list.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_list.h index 56701ea96..ddbf5a12d 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_list.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_list.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_list_map) { { be_const_key(init, 2), be_const_func(lvbe_list_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_msgbox.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_msgbox.h index f60c95fdd..f4402002b 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_msgbox.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_msgbox.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_msgbox_map) { { be_const_key(init, 2), be_const_func(lvbe_msgbox_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_obj.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_obj.h index 5f5328325..242fd7edb 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_obj.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_obj.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_obj_map) { { be_const_key(init, 2), be_const_func(lvbe_obj_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_objmask.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_objmask.h index e0d00517a..76ec1d349 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_objmask.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_objmask.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_objmask_map) { { be_const_key(init, 2), be_const_func(lvbe_objmask_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_page.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_page.h index a345946de..99b08a995 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_page.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_page.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_page_map) { { be_const_key(init, 2), be_const_func(lvbe_page_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_roller.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_roller.h index 82995edf2..32c3b9ec3 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_roller.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_roller.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_roller_map) { { be_const_key(init, 2), be_const_func(lvbe_roller_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_slider.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_slider.h index 10a0a7823..2b5f13dee 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_slider.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_slider.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_slider_map) { { be_const_key(init, 2), be_const_func(lvbe_slider_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinbox.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinbox.h index 14129797d..b511ad385 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinbox.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinbox.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_spinbox_map) { { be_const_key(init, 2), be_const_func(lvbe_spinbox_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinner.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinner.h index 5f5e44912..d4c71b01e 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinner.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinner.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_spinner_map) { { be_const_key(init, 2), be_const_func(lvbe_spinner_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_style.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_style.h index 1ef46979f..0cec3423e 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_style.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_style.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_style_map) { { be_const_key(init, 2), be_const_func(lvs_init) }, { be_const_key(tostring, -1), be_const_func(lvs_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_switch.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_switch.h index 335286fce..c84d70737 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_switch.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_switch.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_switch_map) { { be_const_key(init, 2), be_const_func(lvbe_switch_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_table.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_table.h index 9ad524712..b9449ea7d 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_table.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_table.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_table_map) { { be_const_key(init, 2), be_const_func(lvbe_table_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tabview.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tabview.h index 1c29ebe88..39c793ba8 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tabview.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tabview.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_tabview_map) { { be_const_key(init, 2), be_const_func(lvbe_tabview_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_textarea.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_textarea.h index 0284a9e59..290a439bc 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_textarea.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_textarea.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_textarea_map) { { be_const_key(init, 2), be_const_func(lvbe_textarea_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tileview.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tileview.h index 34111754a..88b478d11 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tileview.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tileview.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_tileview_map) { { be_const_key(init, 2), be_const_func(lvbe_tileview_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_win.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_win.h index 5d65d04e9..edca478bd 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_win.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_win.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_win_map) { { be_const_key(init, 2), be_const_func(lvbe_win_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_map.h b/lib/libesp32/Berry/generate/be_fixed_be_class_map.h index 06c75a050..76e99df82 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_map.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_map.h @@ -1,7 +1,7 @@ #include "be_constobj.h" static be_define_const_map_slots(be_class_map_map) { - { be_const_key(dot_p, 2), be_const_int(0) }, + { be_const_key(dot_p, 2), be_const_var(0) }, { be_const_key(insert, -1), be_const_func(m_insert) }, { be_const_key(remove, -1), be_const_func(m_remove) }, { be_const_key(tostring, -1), be_const_func(m_tostring) }, diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_md5.h b/lib/libesp32/Berry/generate/be_fixed_be_class_md5.h index 59979b2ad..121a8e6ea 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_md5.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_md5.h @@ -2,7 +2,7 @@ static be_define_const_map_slots(be_class_md5_map) { { be_const_key(update, -1), be_const_func(m_md5_update) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(finish, -1), be_const_func(m_md5_finish) }, { be_const_key(init, 1), be_const_func(m_md5_init) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_range.h b/lib/libesp32/Berry/generate/be_fixed_be_class_range.h index fc55c6304..371840af1 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_range.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_range.h @@ -5,9 +5,9 @@ static be_define_const_map_slots(be_class_range_map) { { be_const_key(iter, -1), be_const_func(m_iter) }, { be_const_key(lower, -1), be_const_func(m_lower) }, { be_const_key(init, 4), be_const_func(m_init) }, - { be_const_key(__upper__, -1), be_const_int(0) }, + { be_const_key(__upper__, -1), be_const_var(0) }, { be_const_key(tostring, -1), be_const_func(m_tostring) }, - { be_const_key(__lower__, -1), be_const_int(1) }, + { be_const_key(__lower__, -1), be_const_var(1) }, { be_const_key(upper, 1), be_const_func(m_upper) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h index 34c41ed47..2343a1ae9 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h @@ -10,14 +10,14 @@ static be_define_const_map_slots(be_class_tasmota_map) { { be_const_key(_cmd, -1), be_const_func(l_cmd) }, { be_const_key(web_send, 16), be_const_func(l_webSend) }, { be_const_key(set_timer, -1), be_const_closure(set_timer_closure) }, - { be_const_key(_cb, -1), be_const_int(0) }, + { be_const_key(_cb, -1), be_const_var(0) }, { be_const_key(exec_cmd, -1), be_const_closure(exec_cmd_closure) }, { be_const_key(i2c_enabled, 42), be_const_func(l_i2cenabled) }, { be_const_key(cmd, -1), be_const_closure(cmd_closure) }, { be_const_key(resp_cmnd_done, 28), be_const_func(l_respCmndDone) }, { be_const_key(set_light, 1), be_const_closure(set_light_closure) }, { be_const_key(get_light, -1), be_const_closure(get_light_closure) }, - { be_const_key(_rules, 50), be_const_int(1) }, + { be_const_key(_rules, 50), be_const_var(1) }, { be_const_key(time_reached, -1), be_const_func(l_timereached) }, { be_const_key(web_send_decimal, -1), be_const_func(l_webSendDecimal) }, { be_const_key(load, 22), be_const_closure(load_closure) }, @@ -32,14 +32,14 @@ static be_define_const_map_slots(be_class_tasmota_map) { { be_const_key(get_option, -1), be_const_func(l_getoption) }, { be_const_key(resp_cmnd_str, -1), be_const_func(l_respCmndStr) }, { be_const_key(response_append, -1), be_const_func(l_respAppend) }, - { be_const_key(_timers, -1), be_const_int(2) }, + { be_const_key(_timers, -1), be_const_var(2) }, { be_const_key(try_rule, -1), be_const_closure(try_rule_closure) }, { be_const_key(set_power, 45), be_const_func(l_setpower) }, { be_const_key(resp_cmnd_error, -1), be_const_func(l_respCmndError) }, { be_const_key(publish, -1), be_const_func(l_publish) }, - { be_const_key(_ccmd, 13), be_const_int(3) }, + { be_const_key(_ccmd, 13), be_const_var(3) }, { be_const_key(_get_cb, -1), be_const_func(l_get_cb) }, - { be_const_key(wire1, 15), be_const_int(4) }, + { be_const_key(wire1, 15), be_const_var(4) }, { be_const_key(gen_cb, 6), be_const_closure(gen_cb_closure) }, { be_const_key(rtc, -1), be_const_func(l_rtc) }, { be_const_key(time_dump, -1), be_const_func(l_time_dump) }, @@ -50,13 +50,13 @@ static be_define_const_map_slots(be_class_tasmota_map) { { be_const_key(find_op, 25), be_const_closure(find_op_closure) }, { be_const_key(chars_in_string, -1), be_const_closure(chars_in_string_closure) }, { be_const_key(get_power, -1), be_const_func(l_getpower) }, - { be_const_key(wire2, 8), be_const_int(5) }, + { be_const_key(wire2, 8), be_const_var(5) }, { be_const_key(wire_scan, 55), be_const_closure(wire_scan_closure) }, { be_const_key(resp_cmnd_failed, -1), be_const_func(l_respCmndFailed) }, { be_const_key(exec_rules, -1), be_const_closure(exec_rules_closure) }, { be_const_key(cb_dispatch, -1), be_const_closure(cb_dispatch_closure) }, { be_const_key(resp_cmnd, -1), be_const_func(l_respCmnd) }, - { be_const_key(_drivers, -1), be_const_int(6) }, + { be_const_key(_drivers, -1), be_const_var(6) }, { be_const_key(add_driver, -1), be_const_closure(add_driver_closure) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_driver.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_driver.h index 2e7af22fc..7ad6a4a4a 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_driver.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_driver.h @@ -1,21 +1,21 @@ #include "be_constobj.h" static be_define_const_map_slots(be_class_tasmota_driver_map) { - { be_const_key(every_second, 1), be_const_int(0) }, - { be_const_key(web_add_config_button, -1), be_const_int(1) }, - { be_const_key(web_sensor, 5), be_const_int(2) }, - { be_const_key(web_add_button, 10), be_const_int(3) }, + { be_const_key(every_second, 1), be_const_var(0) }, + { be_const_key(web_add_config_button, -1), be_const_var(1) }, + { be_const_key(web_sensor, 5), be_const_var(2) }, + { be_const_key(web_add_button, 10), be_const_var(3) }, { be_const_key(add_cmd, -1), be_const_closure(add_cmd_closure) }, - { be_const_key(web_add_console_button, 12), be_const_int(4) }, - { be_const_key(web_add_management_button, -1), be_const_int(5) }, - { be_const_key(display, -1), be_const_int(6) }, + { be_const_key(web_add_console_button, 12), be_const_var(4) }, + { be_const_key(web_add_management_button, -1), be_const_var(5) }, + { be_const_key(display, -1), be_const_var(6) }, { be_const_key(get_tasmota, 13), be_const_closure(get_tasmota_closure) }, - { be_const_key(every_100ms, -1), be_const_int(7) }, - { be_const_key(save_before_restart, -1), be_const_int(8) }, - { be_const_key(button_pressed, -1), be_const_int(9) }, - { be_const_key(web_add_handler, -1), be_const_int(10) }, - { be_const_key(web_add_main_button, -1), be_const_int(11) }, - { be_const_key(json_append, 8), be_const_int(12) }, + { be_const_key(every_100ms, -1), be_const_var(7) }, + { be_const_key(save_before_restart, -1), be_const_var(8) }, + { be_const_key(button_pressed, -1), be_const_var(9) }, + { be_const_key(web_add_handler, -1), be_const_var(10) }, + { be_const_key(web_add_main_button, -1), be_const_var(11) }, + { be_const_key(json_append, 8), be_const_var(12) }, }; static be_define_const_map( diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_i2c_driver.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_i2c_driver.h index 0cb3f6fc5..2bc2cdf6a 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_i2c_driver.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_i2c_driver.h @@ -3,13 +3,13 @@ static be_define_const_map_slots(be_class_tasmota_i2c_driver_map) { { be_const_key(read32, -1), be_const_closure(read32_closure) }, { be_const_key(write8, 6), be_const_closure(write8_closure) }, - { be_const_key(name, -1), be_const_int(0) }, - { be_const_key(addr, 10), be_const_int(1) }, + { be_const_key(name, -1), be_const_var(0) }, + { be_const_key(addr, 10), be_const_var(1) }, { be_const_key(read12, -1), be_const_closure(read12_closure) }, { be_const_key(write_bit, 8), be_const_closure(write_bit_closure) }, { be_const_key(read13, -1), be_const_closure(read13_closure) }, { be_const_key(read24, -1), be_const_closure(read24_closure) }, - { be_const_key(wire, -1), be_const_int(2) }, + { be_const_key(wire, -1), be_const_var(2) }, { be_const_key(init, -1), be_const_closure(init_closure) }, { be_const_key(read8, -1), be_const_closure(read8_closure) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_wire.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_wire.h index d43d4aa8e..71ade9f7e 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_wire.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_wire.h @@ -2,7 +2,7 @@ static be_define_const_map_slots(be_class_tasmota_wire_map) { { be_const_key(_end_transmission, 10), be_const_func(b_wire_endtransmission) }, - { be_const_key(bus, -1), be_const_int(0) }, + { be_const_key(bus, -1), be_const_var(0) }, { be_const_key(_read, 7), be_const_func(b_wire_read) }, { be_const_key(read, -1), be_const_func(b_wire_validread) }, { be_const_key(_request_from, -1), be_const_func(b_wire_requestfrom) }, diff --git a/lib/libesp32/Berry/generate/be_fixed_be_lvgl_cb.h b/lib/libesp32/Berry/generate/be_fixed_be_lvgl_cb.h index 7348587a9..433187e60 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_lvgl_cb.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_lvgl_cb.h @@ -1,7 +1,7 @@ #include "be_constobj.h" static be_define_const_map_slots(be_lvgl_cb_map) { - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_var(0) }, { be_const_key(tostring, 2), be_const_func(lvx_tostring) }, { be_const_key(call, -1), be_const_func(lv_cb_call) }, { be_const_key(init, 0), be_const_func(lv0_init) }, diff --git a/lib/libesp32/Berry/src/be_api.c b/lib/libesp32/Berry/src/be_api.c index 14236a5ce..aeb348bbb 100644 --- a/lib/libesp32/Berry/src/be_api.c +++ b/lib/libesp32/Berry/src/be_api.c @@ -36,7 +36,7 @@ static void class_init(bvm *vm, bclass *c, const bnfuncinfo *lib) if (lib->function) { /* method */ be_prim_method_bind(vm, c, s, lib->function); } else { - be_member_bind(vm, c, s); /* member */ + be_member_bind(vm, c, s, btrue); /* member */ } ++lib; } @@ -643,6 +643,9 @@ static int ins_member(bvm *vm, int index, const char *k) if (var_isinstance(o)) { binstance *obj = var_toobj(o); type = be_instance_member(vm, obj, be_newstr(vm, k), top); + if (type == BE_NONE) { + type = BE_NIL; + } } return type; } diff --git a/lib/libesp32/Berry/src/be_bytecode.c b/lib/libesp32/Berry/src/be_bytecode.c index b8242d326..e6d69a0dd 100644 --- a/lib/libesp32/Berry/src/be_bytecode.c +++ b/lib/libesp32/Berry/src/be_bytecode.c @@ -129,7 +129,7 @@ static bstring** save_members(bvm *vm, void *fp, bclass *c, int nvar) } while ((node = be_map_next(members, &iter)) != NULL) { be_assert(var_isstr(&node->key)); - if (var_isint(&node->value)) { /* cache member name */ + if (var_isindex(&node->value)) { /* cache member name */ if (vars == NULL) { return NULL; /* should never be executed */ } @@ -405,7 +405,7 @@ static void load_class(bvm *vm, void *fp, bvalue *v) } for (count = 0; count < nvar; ++count) { /* load member-variable table */ bstring *name = cache_string(vm, fp); - be_member_bind(vm, c, name); + be_member_bind(vm, c, name, btrue); be_stackpop(vm, 1); /* pop the cached string */ } } diff --git a/lib/libesp32/Berry/src/be_class.c b/lib/libesp32/Berry/src/be_class.c index ffb196372..720bba05c 100644 --- a/lib/libesp32/Berry/src/be_class.c +++ b/lib/libesp32/Berry/src/be_class.c @@ -53,18 +53,25 @@ int be_class_attribute(bvm *vm, bclass *c, bstring *attr) } } } - return BE_NIL; + return BE_NONE; } -void be_member_bind(bvm *vm, bclass *c, bstring *name) +void be_member_bind(bvm *vm, bclass *c, bstring *name, bbool var) { bvalue *attr; set_fixed(name); check_members(vm, c); attr = be_map_insertstr(vm, c->members, name, NULL); restore_fixed(name); - attr->v.i = c->nvar++; - attr->type = MT_VARIABLE; + if (var) { + /* this is an instance variable so we set it as MT_VARIABLE */ + attr->v.i = c->nvar++; + attr->type = MT_VARIABLE; + } else { + /* this is a static class constant, leave it as BE_NIL */ + attr->v.i = 0; + attr->type = BE_NIL; + } } void be_method_bind(bvm *vm, bclass *c, bstring *name, bproto *p) @@ -135,6 +142,23 @@ static binstance* instance_member(bvm *vm, return NULL; } +static bclass* class_member(bvm *vm, + bclass *obj, bstring *name, bvalue *dst) +{ + for (; obj; obj = obj->super) { + bmap *members = obj->members; + if (members) { + bvalue *v = be_map_findstr(vm, members, name); + if (v) { + *dst = *v; + return obj; + } + } + } + var_setnil(dst); + return NULL; +} + void be_class_upvalue_init(bvm *vm, bclass *c) { bmap *mbr = c->members; @@ -216,7 +240,24 @@ int be_instance_member(bvm *vm, binstance *obj, bstring *name, bvalue *dst) if (obj && type == MT_VARIABLE) { *dst = obj->members[dst->v.i]; } - return type; + if (obj) { + return type; + } else { + return BE_NONE; + } +} + +int be_class_member(bvm *vm, bclass *obj, bstring *name, bvalue *dst) +{ + int type; + be_assert(name != NULL); + obj = class_member(vm, obj, name, dst); + type = var_type(dst); + if (obj) { + return type; + } else { + return BE_NONE; + } } bbool be_instance_setmember(bvm *vm, binstance *o, bstring *name, bvalue *src) @@ -246,3 +287,15 @@ bbool be_instance_setmember(bvm *vm, binstance *o, bstring *name, bvalue *src) } return bfalse; } + +bbool be_class_setmember(bvm *vm, bclass *o, bstring *name, bvalue *src) +{ + bvalue v; + be_assert(name != NULL); + bclass * obj = class_member(vm, o, name, &v); + if (obj && !var_istype(&v, MT_VARIABLE)) { + be_map_insertstr(vm, obj->members, name, src); + return btrue; + } + return bfalse; +} diff --git a/lib/libesp32/Berry/src/be_class.h b/lib/libesp32/Berry/src/be_class.h index 3b9458013..3186afd66 100644 --- a/lib/libesp32/Berry/src/be_class.h +++ b/lib/libesp32/Berry/src/be_class.h @@ -10,7 +10,7 @@ #include "be_object.h" -#define MT_VARIABLE BE_INT +#define MT_VARIABLE BE_INDEX #define MT_METHOD BE_CLOSURE #define MT_PRIMMETHOD BE_NTVFUNC @@ -52,7 +52,7 @@ struct binstance { bclass* be_newclass(bvm *vm, bstring *name, bclass *super); void be_class_compress(bvm *vm, bclass *c); int be_class_attribute(bvm *vm, bclass *c, bstring *attr); -void be_member_bind(bvm *vm, bclass *c, bstring *name); +void be_member_bind(bvm *vm, bclass *c, bstring *name, bbool var); void be_method_bind(bvm *vm, bclass *c, bstring *name, bproto *p); void be_prim_method_bind(bvm *vm, bclass *c, bstring *name, bntvfunc f); void be_closure_method_bind(bvm *vm, bclass *c, bstring *name, bclosure *cl); @@ -60,6 +60,8 @@ int be_class_closure_count(bclass *c); void be_class_upvalue_init(bvm *vm, bclass *c); bbool be_class_newobj(bvm *vm, bclass *c, bvalue *argv, int argc, int mode); int be_instance_member(bvm *vm, binstance *obj, bstring *name, bvalue *dst); +int be_class_member(bvm *vm, bclass *obj, bstring *name, bvalue *dst); bbool be_instance_setmember(bvm *vm, binstance *obj, bstring *name, bvalue *src); +bbool be_class_setmember(bvm *vm, bclass *obj, bstring *name, bvalue *src); #endif diff --git a/lib/libesp32/Berry/src/be_constobj.h b/lib/libesp32/Berry/src/be_constobj.h index 8efbb0e09..543d6b62a 100644 --- a/lib/libesp32/Berry/src/be_constobj.h +++ b/lib/libesp32/Berry/src/be_constobj.h @@ -42,6 +42,11 @@ extern "C" { .type = BE_INT \ } +#define be_const_var(_val) { \ + .v.i = (bint)(_val), \ + .type = BE_INDEX \ +} + #define be_const_real(_val) { \ .v.r = (breal)(_val), \ .type = BE_REAL \ @@ -140,6 +145,11 @@ const bntvmodule be_native_module(_module) = { \ BE_INT \ } +#define be_const_var(_val) { \ + bvaldata(bint(_val)), \ + BE_INDEX \ +} + #define be_const_real(_val) { \ bvaldata(breal(_val)), \ BE_REAL \ diff --git a/lib/libesp32/Berry/src/be_lexer.c b/lib/libesp32/Berry/src/be_lexer.c index af987113d..c4c736508 100644 --- a/lib/libesp32/Berry/src/be_lexer.c +++ b/lib/libesp32/Berry/src/be_lexer.c @@ -38,7 +38,7 @@ static const char* const kwords_tab[] = { ":", "?", "->", "if", "elif", "else", "while", "for", "def", "end", "class", "break", "continue", "return", "true", "false", "nil", "var", "do", - "import", "as", "try", "except", "raise" + "import", "as", "try", "except", "raise", "static" }; void be_lexerror(blexer *lexer, const char *msg) diff --git a/lib/libesp32/Berry/src/be_lexer.h b/lib/libesp32/Berry/src/be_lexer.h index 09090db6b..467070946 100644 --- a/lib/libesp32/Berry/src/be_lexer.h +++ b/lib/libesp32/Berry/src/be_lexer.h @@ -88,7 +88,8 @@ typedef enum { KeyAs, /* keyword as */ KeyTry, /* keyword try */ KeyExcept, /* keyword except */ - KeyRaise /* keyword raise */ + KeyRaise, /* keyword raise */ + KeyStatic /* keyword static */ } btokentype; struct blexerreader { diff --git a/lib/libesp32/Berry/src/be_object.c b/lib/libesp32/Berry/src/be_object.c index a0da81939..1162cdf8a 100644 --- a/lib/libesp32/Berry/src/be_object.c +++ b/lib/libesp32/Berry/src/be_object.c @@ -29,6 +29,7 @@ const char* be_vtype2str(bvalue *v) case BE_MAP: return "map"; case BE_INSTANCE: return "instance"; case BE_MODULE: return "module"; + case BE_INDEX: return "index"; default: return "invalid type"; } } diff --git a/lib/libesp32/Berry/src/be_object.h b/lib/libesp32/Berry/src/be_object.h index d465138ec..b98718c76 100644 --- a/lib/libesp32/Berry/src/be_object.h +++ b/lib/libesp32/Berry/src/be_object.h @@ -13,12 +13,13 @@ /* basic types, do not change value */ #define BE_NONE (-1) /* unknow type */ #define BE_COMPTR (-2) /* common pointer */ +#define BE_INDEX (-3) /* index for instance variable, previously BE_INT */ #define BE_NIL 0 #define BE_INT 1 #define BE_REAL 2 #define BE_BOOL 3 #define BE_FUNCTION 4 -#define BE_STRING 5 +#define BE_STRING 5 /* from this type can be gced, see BE_GCOBJECT */ #define BE_CLASS 6 #define BE_INSTANCE 7 #define BE_PROTO 8 @@ -207,6 +208,7 @@ typedef const char* (*breader)(void*, size_t*); #define var_islist(_v) var_istype(_v, BE_LIST) #define var_ismap(_v) var_istype(_v, BE_MAP) #define var_ismodule(_v) var_istype(_v, BE_MODULE) +#define var_isindex(_v) var_istype(_v, BE_INDEX) #define var_isnumber(_v) (var_isint(_v) || var_isreal(_v)) #define var_setnil(_v) var_settype(_v, BE_NIL) @@ -223,6 +225,7 @@ typedef const char* (*breader)(void*, size_t*); #define var_setlist(_v, _o) var_setobj(_v, BE_LIST, _o) #define var_setmap(_v, _o) var_setobj(_v, BE_MAP, _o) #define var_setmodule(_v, _o) var_setobj(_v, BE_MODULE, _o) +#define var_setindex(_v, _i) { var_settype(_v, BE_INDEX); (_v)->v.i = (_i); } #define var_setproto(_v, _o) var_setobj(_v, BE_PROTO, _o) #define var_tobool(_v) ((_v)->v.b) diff --git a/lib/libesp32/Berry/src/be_parser.c b/lib/libesp32/Berry/src/be_parser.c index 62df59b85..744d9cecb 100644 --- a/lib/libesp32/Berry/src/be_parser.c +++ b/lib/libesp32/Berry/src/be_parser.c @@ -1208,7 +1208,7 @@ static void return_stmt(bparser *parser) static void check_class_attr(bparser *parser, bclass *c, bstring *attr) { - if (be_class_attribute(parser->vm, c, attr) != BE_NIL) { + if (be_class_attribute(parser->vm, c, attr) != BE_NONE) { push_error(parser, "redefinition of the attribute '%s'", str(attr)); } @@ -1221,11 +1221,11 @@ static void classvar_stmt(bparser *parser, bclass *c) scan_next_token(parser); /* skip 'var' */ if (match_id(parser, name) != NULL) { check_class_attr(parser, c, name); - be_member_bind(parser->vm, c, name); + be_member_bind(parser->vm, c, name, btrue); while (match_skip(parser, OptComma)) { /* ',' */ if (match_id(parser, name) != NULL) { check_class_attr(parser, c, name); - be_member_bind(parser->vm, c, name); + be_member_bind(parser->vm, c, name, btrue); } else { parser_error(parser, "class var error"); } @@ -1235,6 +1235,27 @@ static void classvar_stmt(bparser *parser, bclass *c) } } +static void classstatic_stmt(bparser *parser, bclass *c) +{ + bstring *name; + /* 'static' ID {',' ID} */ + scan_next_token(parser); /* skip 'static' */ + if (match_id(parser, name) != NULL) { + check_class_attr(parser, c, name); + be_member_bind(parser->vm, c, name, bfalse); + while (match_skip(parser, OptComma)) { /* ',' */ + if (match_id(parser, name) != NULL) { + check_class_attr(parser, c, name); + be_member_bind(parser->vm, c, name, bfalse); + } else { + parser_error(parser, "class static error"); + } + } + } else { + parser_error(parser, "class static error"); + } +} + static void classdef_stmt(bparser *parser, bclass *c) { bexpdesc e; @@ -1266,6 +1287,7 @@ static void class_block(bparser *parser, bclass *c) while (block_follow(parser)) { switch (next_type(parser)) { case KeyVar: classvar_stmt(parser, c); break; + case KeyStatic: classstatic_stmt(parser, c); break; case KeyDef: classdef_stmt(parser, c); break; case OptSemic: scan_next_token(parser); break; default: push_error(parser, diff --git a/lib/libesp32/Berry/src/be_solidifylib.c b/lib/libesp32/Berry/src/be_solidifylib.c index 03523c9a8..a6dec57ac 100644 --- a/lib/libesp32/Berry/src/be_solidifylib.c +++ b/lib/libesp32/Berry/src/be_solidifylib.c @@ -38,6 +38,7 @@ static const char * m_type_ktab(int type) switch (type){ case BE_NIL: return "BE_NIL"; case BE_INT: return "BE_INT"; + case BE_INDEX: return "BE_INDEX"; case BE_REAL: return "BE_REAL"; case BE_BOOL: return "BE_BOOL"; case BE_STRING: return "BE_STRING"; @@ -82,7 +83,7 @@ static void m_solidify_proto(bvm *vm, bproto *pr, const char * func_name, int bu logfmt("%*s%d, /* has constants */\n", indent, "", (pr->nconst > 0) ? 1 : 0); if (pr->nconst > 0) { - logfmt("%*s( &(const bvalue[%2d]) { /* upvals */\n", indent, "", pr->nconst); + logfmt("%*s( &(const bvalue[%2d]) { /* constants */\n", indent, "", pr->nconst); for (int k = 0; k < pr->nconst; k++) { int type = pr->ktab[k].type; const char *type_name = m_type_ktab(type); @@ -99,7 +100,7 @@ static void m_solidify_proto(bvm *vm, bproto *pr, const char * func_name, int bu be_raise(vm, "internal_error", "Strings greater than 255 chars not supported yet"); } logfmt("\", %i, %zu) }, %s},\n", be_strhash(pr->ktab[k].v.s), len >= 255 ? 255 : len, type_name); - } else if (type == BE_INT) { + } else if (type == BE_INT || type == BE_INDEX) { logfmt("%*s { { .i=%" BE_INT_FMTLEN "i }, %s},\n", indent, "", pr->ktab[k].v.i, type_name); } else if (type == BE_REAL) { #if BE_USE_SINGLE_FLOAT diff --git a/lib/libesp32/Berry/src/be_strlib.c b/lib/libesp32/Berry/src/be_strlib.c index 67cb528c3..4bef42d10 100644 --- a/lib/libesp32/Berry/src/be_strlib.c +++ b/lib/libesp32/Berry/src/be_strlib.c @@ -80,6 +80,7 @@ static bstring* sim2str(bvm *vm, bvalue *v) case BE_BOOL: strcpy(sbuf, var_tobool(v) ? "true" : "false"); break; + case BE_INDEX: case BE_INT: sprintf(sbuf, BE_INT_FORMAT, var_toint(v)); break; diff --git a/lib/libesp32/Berry/src/be_vm.c b/lib/libesp32/Berry/src/be_vm.c index 97fee645c..92604b6d4 100644 --- a/lib/libesp32/Berry/src/be_vm.c +++ b/lib/libesp32/Berry/src/be_vm.c @@ -228,7 +228,8 @@ static bbool obj2bool(bvm *vm, bvalue *var) binstance *obj = var_toobj(var); bstring *tobool = str_literal(vm, "tobool"); /* get operator method */ - if (be_instance_member(vm, obj, tobool, vm->top)) { + int type = be_instance_member(vm, obj, tobool, vm->top); + if (type != BE_NONE && type != BE_NIL) { vm->top[1] = *var; /* move self to argv[0] */ be_dofunc(vm, vm->top, 1); /* call method 'tobool' */ /* check the return value */ @@ -273,7 +274,7 @@ static int obj_attribute(bvm *vm, bvalue *o, bvalue *c, bvalue *dst) bstring *attr = var_tostr(c); binstance *obj = var_toobj(o); int type = be_instance_member(vm, obj, attr, dst); - if (basetype(type) == BE_NIL) { /* if no method found, try virtual */ + if (type == BE_NONE) { /* if no method found, try virtual */ /* get method 'member' */ int type2 = be_instance_member(vm, obj, str_literal(vm, "member"), vm->top); if (basetype(type2) == BE_FUNCTION) { @@ -287,7 +288,7 @@ static int obj_attribute(bvm *vm, bvalue *o, bvalue *c, bvalue *dst) type = var_type(dst); } } - if (basetype(type) == BE_NIL) { + if (type == BE_NONE) { vm_error(vm, "attribute_error", "the '%s' object has no attribute '%s'", str(be_instance_name(obj)), str(attr)); @@ -295,6 +296,19 @@ static int obj_attribute(bvm *vm, bvalue *o, bvalue *c, bvalue *dst) return type; } +static int class_attribute(bvm *vm, bvalue *o, bvalue *c, bvalue *dst) +{ + bstring *attr = var_tostr(c); + bclass *obj = var_toobj(o); + int type = be_class_member(vm, obj, attr, dst); + if (type == BE_NONE || type == BE_INDEX) { + vm_error(vm, "attribute_error", + "the '%s' class has no static attribute '%s'", + str(obj->name), str(attr)); + } + return type; +} + static bbool object_eqop(bvm *vm, const char *op, bbool iseq, bvalue *a, bvalue *b) { @@ -741,6 +755,9 @@ newframe: /* a new call frame */ if (var_isinstance(b) && var_isstr(c)) { obj_attribute(vm, b, c, a); reg = vm->reg; + } else if (var_isclass(b) && var_isstr(c)) { + class_attribute(vm, b, c, a); + reg = vm->reg; } else if (var_ismodule(b) && var_isstr(c)) { bstring *attr = var_tostr(c); bmodule *module = var_toobj(b); @@ -833,6 +850,16 @@ newframe: /* a new call frame */ } dispatch(); } + if (var_isclass(a) && var_isstr(b)) { + bclass *obj = var_toobj(a); + bstring *attr = var_tostr(b); + if (!be_class_setmember(vm, obj, attr, c)) { + vm_error(vm, "attribute_error", + "class '%s' cannot assign to static attribute '%s'", + str(be_class_name(obj)), str(attr)); + } + dispatch(); + } if (var_ismodule(a) && var_isstr(b)) { bmodule *obj = var_toobj(a); bstring *attr = var_tostr(b); diff --git a/lib/libesp32/Berry/tests/class_const.be b/lib/libesp32/Berry/tests/class_const.be new file mode 100644 index 000000000..a3abef400 --- /dev/null +++ b/lib/libesp32/Berry/tests/class_const.be @@ -0,0 +1,69 @@ +def assert_attribute_error(f) + try + f() + assert(false, 'unexpected execution flow') + except .. as e, m + assert(e == 'attribute_error') + end +end + +class A + static a + def init() self.b = 2 end + def f() end + var b + static c, s, r +end + +assert(A.a == nil) +assert(A.c == nil) +assert(A.s == nil) +assert_attribute_error(/-> A.b) +assert_attribute_error(/-> A.d) + +a = A() +assert(a.b == 2) +assert(a.a == nil) +assert(a.c == nil) + +A.a = 1 +A.c = 3 +A.s = "foo" +A.r = 3.5 +assert(a.a == 1) +assert(a.c == 3) +assert(A.a == 1) +assert(A.c == 3) +import gc gc.collect() +assert(A.s == "foo") +assert(a.s == "foo") +assert(A.r == 3.5) +assert(a.r == 3.5) + +#- test valid or invalid methods and members -# + +def assert_attribute_error(c) + try + compile(c)() + assert(false, 'unexpected execution flow') + except .. as e, m + assert(e == 'attribute_error') + end +end + +class A + var a, g + static h + def init() self.a = 1 end + def f(x, y) return type(self) end +end +a=A() +a.g = def (x, y) return type(x) end +A.h = def (x, y) return type(x) end + +assert(type(a.g) == 'function') +assert(type(a.h) == 'function') + +assert_attribute_error("a.g(1,2)") +assert(a.h(1) == 'instance') +# A.h(1) - error diff --git a/lib/libesp32/Berry/tools/coc/hash_map.cpp b/lib/libesp32/Berry/tools/coc/hash_map.cpp index 988b8a03a..e05ca4677 100755 --- a/lib/libesp32/Berry/tools/coc/hash_map.cpp +++ b/lib/libesp32/Berry/tools/coc/hash_map.cpp @@ -128,7 +128,7 @@ hash_map::entry hash_map::entry_modify(entry entry, int *var_count) { entry.key = coc::escape_operator(entry.key); if (entry.value == "var") { - entry.value = "be_const_int(" + entry.value = "be_const_var(" + std::to_string(*var_count) + ")"; ++(*var_count); } else { diff --git a/lib/libesp32/Berry/tools/coc/str_build.cpp b/lib/libesp32/Berry/tools/coc/str_build.cpp index affd5016e..ebc44301e 100644 --- a/lib/libesp32/Berry/tools/coc/str_build.cpp +++ b/lib/libesp32/Berry/tools/coc/str_build.cpp @@ -46,7 +46,7 @@ void str_build::keywords() { "var", opif + 14 }, { "do", opif + 15 }, { "import", opif + 16 }, { "as", opif + 17 }, { "try", opif + 18 }, { "except", opif + 19 }, - { "raise", opif + 20 } + { "raise", opif + 20 }, { "static", opif + 21 } }; for (auto it : tab) { make_ceil(it.first, it.second);