Berry weak strings

This commit is contained in:
Stephan Hadinger 2022-06-06 21:01:12 +02:00
parent 45f499d352
commit ffbc95717a
67 changed files with 5819 additions and 5061 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_AudioFileSource_map) {
{ be_const_key(_X2Ep, -1), be_const_var(0) },
{ be_const_key_weak(_X2Ep, -1), be_const_var(0) },
};
static be_define_const_map(

View File

@ -1,8 +1,8 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_AudioFileSourceFS_map) {
{ be_const_key(deinit, -1), be_const_func(i2s_file_source_fs_deinit) },
{ be_const_key(init, -1), be_const_func(i2s_file_source_fs_init) },
{ be_const_key_weak(deinit, -1), be_const_func(i2s_file_source_fs_deinit) },
{ be_const_key_weak(init, -1), be_const_func(i2s_file_source_fs_init) },
};
static be_define_const_map(

View File

@ -1,7 +1,7 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_AudioGenerator_map) {
{ be_const_key(_X2Ep, -1), be_const_var(0) },
{ be_const_key_weak(_X2Ep, -1), be_const_var(0) },
};
static be_define_const_map(

View File

@ -1,12 +1,12 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_AudioGeneratorMP3_map) {
{ be_const_key(begin, -1), be_const_func(i2s_generator_mp3_begin) },
{ be_const_key(loop, -1), be_const_func(i2s_generator_mp3_loop) },
{ be_const_key(isrunning, -1), be_const_func(i2s_generator_mp3_isrunning) },
{ be_const_key(init, 1), be_const_func(i2s_generator_mp3_init) },
{ be_const_key(deinit, -1), be_const_func(i2s_generator_mp3_deinit) },
{ be_const_key(stop, -1), be_const_func(i2s_generator_mp3_stop) },
{ be_const_key_weak(begin, -1), be_const_func(i2s_generator_mp3_begin) },
{ be_const_key_weak(loop, -1), be_const_func(i2s_generator_mp3_loop) },
{ be_const_key_weak(isrunning, -1), be_const_func(i2s_generator_mp3_isrunning) },
{ be_const_key_weak(init, 1), be_const_func(i2s_generator_mp3_init) },
{ be_const_key_weak(deinit, -1), be_const_func(i2s_generator_mp3_deinit) },
{ be_const_key_weak(stop, -1), be_const_func(i2s_generator_mp3_stop) },
};
static be_define_const_map(

View File

@ -1,12 +1,12 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_AudioGeneratorWAV_map) {
{ be_const_key(begin, -1), be_const_func(i2s_generator_wav_begin) },
{ be_const_key(loop, -1), be_const_func(i2s_generator_wav_loop) },
{ be_const_key(isrunning, -1), be_const_func(i2s_generator_wav_isrunning) },
{ be_const_key(init, 1), be_const_func(i2s_generator_wav_init) },
{ be_const_key(deinit, -1), be_const_func(i2s_generator_wav_deinit) },
{ be_const_key(stop, -1), be_const_func(i2s_generator_wav_stop) },
{ be_const_key_weak(begin, -1), be_const_func(i2s_generator_wav_begin) },
{ be_const_key_weak(loop, -1), be_const_func(i2s_generator_wav_loop) },
{ be_const_key_weak(isrunning, -1), be_const_func(i2s_generator_wav_isrunning) },
{ be_const_key_weak(init, 1), be_const_func(i2s_generator_wav_init) },
{ be_const_key_weak(deinit, -1), be_const_func(i2s_generator_wav_deinit) },
{ be_const_key_weak(stop, -1), be_const_func(i2s_generator_wav_stop) },
};
static be_define_const_map(

View File

@ -1,10 +1,10 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_AudioOpusDecoder_map) {
{ be_const_key(deinit, -1), be_const_func(be_audio_opus_decoder_deinit) },
{ be_const_key(decode, 2), be_const_func(be_audio_opus_decoder_decode) },
{ be_const_key(_X2Ep, -1), be_const_var(0) },
{ be_const_key(init, 1), be_const_func(be_audio_opus_decoder_init) },
{ be_const_key_weak(deinit, -1), be_const_func(be_audio_opus_decoder_deinit) },
{ be_const_key_weak(decode, 2), be_const_func(be_audio_opus_decoder_decode) },
{ be_const_key_weak(_X2Ep, -1), be_const_var(0) },
{ be_const_key_weak(init, 1), be_const_func(be_audio_opus_decoder_init) },
};
static be_define_const_map(

View File

@ -1,18 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_AudioOutput_map) {
{ be_const_key(set_bits_per_sample, -1), be_const_func(be_audio_output_set_bits_per_sample) },
{ be_const_key(flush, -1), be_const_func(be_audio_output_flush) },
{ be_const_key(consume_stereo, -1), be_const_func(be_audio_output_consume_stereo) },
{ be_const_key(init, -1), be_const_func(be_audio_output_init) },
{ be_const_key(consume_mono, -1), be_const_func(be_audio_output_consume_mono) },
{ be_const_key(stop, -1), be_const_func(be_audio_output_stop) },
{ be_const_key(begin, -1), be_const_func(be_audio_output_begin) },
{ be_const_key(_X2Ep, -1), be_const_var(0) },
{ be_const_key(set_channels, -1), be_const_func(be_audio_output_set_channels) },
{ be_const_key(consume_silence, 4), be_const_func(be_audio_output_consume_silence) },
{ be_const_key(set_rate, 2), be_const_func(be_audio_output_set_rate) },
{ be_const_key(set_gain, 0), be_const_func(be_audio_output_set_gain) },
{ be_const_key_weak(set_bits_per_sample, -1), be_const_func(be_audio_output_set_bits_per_sample) },
{ be_const_key_weak(flush, -1), be_const_func(be_audio_output_flush) },
{ be_const_key_weak(consume_stereo, -1), be_const_func(be_audio_output_consume_stereo) },
{ be_const_key_weak(init, -1), be_const_func(be_audio_output_init) },
{ be_const_key_weak(consume_mono, -1), be_const_func(be_audio_output_consume_mono) },
{ be_const_key_weak(stop, -1), be_const_func(be_audio_output_stop) },
{ be_const_key_weak(begin, -1), be_const_func(be_audio_output_begin) },
{ be_const_key_weak(_X2Ep, -1), be_const_var(0) },
{ be_const_key_weak(set_channels, -1), be_const_func(be_audio_output_set_channels) },
{ be_const_key_weak(consume_silence, 4), be_const_func(be_audio_output_consume_silence) },
{ be_const_key_weak(set_rate, 2), be_const_func(be_audio_output_set_rate) },
{ be_const_key_weak(set_gain, 0), be_const_func(be_audio_output_set_gain) },
};
static be_define_const_map(

View File

@ -1,12 +1,12 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_AudioOutputI2S_map) {
{ be_const_key(INTERNAL_PDM, -1), be_const_int(AudioOutputI2S::INTERNAL_PDM) },
{ be_const_key(INTERNAL_DAC, 2), be_const_int(AudioOutputI2S::INTERNAL_DAC) },
{ be_const_key(init, -1), be_const_func(i2s_output_i2s_init) },
{ be_const_key(EXTERNAL_I2S, 1), be_const_int(AudioOutputI2S::EXTERNAL_I2S) },
{ be_const_key(deinit, -1), be_const_func(i2s_output_i2s_deinit) },
{ be_const_key(stop, -1), be_const_func(i2s_output_i2s_stop) },
{ be_const_key_weak(INTERNAL_PDM, -1), be_const_int(AudioOutputI2S::INTERNAL_PDM) },
{ be_const_key_weak(INTERNAL_DAC, 2), be_const_int(AudioOutputI2S::INTERNAL_DAC) },
{ be_const_key_weak(init, -1), be_const_func(i2s_output_i2s_init) },
{ be_const_key_weak(EXTERNAL_I2S, 1), be_const_int(AudioOutputI2S::EXTERNAL_I2S) },
{ be_const_key_weak(deinit, -1), be_const_func(i2s_output_i2s_deinit) },
{ be_const_key_weak(stop, -1), be_const_func(i2s_output_i2s_stop) },
};
static be_define_const_map(

View File

@ -1,14 +1,14 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_BLE_map) {
{ be_const_key(adv_block, -1), be_const_func(be_BLE_adv_block) },
{ be_const_key(conn_cb, -1), be_const_func(be_BLE_reg_conn_cb) },
{ be_const_key(adv_cb, 5), be_const_func(be_BLE_reg_adv_cb) },
{ be_const_key(set_MAC, -1), be_const_func(be_BLE_set_MAC) },
{ be_const_key(adv_watch, -1), be_const_func(be_BLE_adv_watch) },
{ be_const_key(run, -1), be_const_func(be_BLE_run) },
{ be_const_key(set_svc, 4), be_const_func(be_BLE_set_service) },
{ be_const_key(set_chr, 3), be_const_func(be_BLE_set_characteristic) },
{ be_const_key_weak(adv_block, -1), be_const_func(be_BLE_adv_block) },
{ be_const_key_weak(conn_cb, -1), be_const_func(be_BLE_reg_conn_cb) },
{ be_const_key_weak(adv_cb, 5), be_const_func(be_BLE_reg_adv_cb) },
{ be_const_key_weak(set_MAC, -1), be_const_func(be_BLE_set_MAC) },
{ be_const_key_weak(adv_watch, -1), be_const_func(be_BLE_adv_watch) },
{ be_const_key_weak(run, -1), be_const_func(be_BLE_run) },
{ be_const_key_weak(set_svc, 4), be_const_func(be_BLE_set_service) },
{ be_const_key_weak(set_chr, 3), be_const_func(be_BLE_set_characteristic) },
};
static be_define_const_map(

View File

@ -1,18 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_OneWire_map) {
{ be_const_key(reset, -1), be_const_func(b_onewire_reset) },
{ be_const_key(search, 10), be_const_func(b_onewire_search) },
{ be_const_key(depower, -1), be_const_func(b_onewire_depower) },
{ be_const_key(init, 2), be_const_func(b_onewire_init) },
{ be_const_key(deinit, -1), be_const_func(b_onewire_deinit) },
{ be_const_key(reset_search, -1), be_const_func(b_onewire_reset_search) },
{ be_const_key(skip, -1), be_const_func(b_onewire_skip) },
{ be_const_key(_X2Ep, -1), be_const_var(0) },
{ be_const_key(write, -1), be_const_func(b_onewire_write) },
{ be_const_key(read, -1), be_const_func(b_onewire_read) },
{ be_const_key(select, 11), be_const_func(b_onewire_select) },
{ be_const_key(target_search, -1), be_const_func(b_onewire_target_search) },
{ be_const_key_weak(reset, -1), be_const_func(b_onewire_reset) },
{ be_const_key_weak(search, 10), be_const_func(b_onewire_search) },
{ be_const_key_weak(depower, -1), be_const_func(b_onewire_depower) },
{ be_const_key_weak(init, 2), be_const_func(b_onewire_init) },
{ be_const_key_weak(deinit, -1), be_const_func(b_onewire_deinit) },
{ be_const_key_weak(reset_search, -1), be_const_func(b_onewire_reset_search) },
{ be_const_key_weak(skip, -1), be_const_func(b_onewire_skip) },
{ be_const_key_weak(_X2Ep, -1), be_const_var(0) },
{ be_const_key_weak(write, -1), be_const_func(b_onewire_write) },
{ be_const_key_weak(read, -1), be_const_func(b_onewire_read) },
{ be_const_key_weak(select, 11), be_const_func(b_onewire_select) },
{ be_const_key_weak(target_search, -1), be_const_func(b_onewire_target_search) },
};
static be_define_const_map(

View File

@ -1,12 +1,12 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_aes_gcm_map) {
{ be_const_key(encrypt, 4), be_const_func(m_aes_gcm_encryt) },
{ be_const_key(_X2Ep2, -1), be_const_var(0) },
{ be_const_key(decrypt, -1), be_const_func(m_aes_gcm_decryt) },
{ be_const_key(init, -1), be_const_func(m_aes_gcm_init) },
{ be_const_key(_X2Ep1, -1), be_const_var(1) },
{ be_const_key(tag, -1), be_const_func(m_aes_gcm_tag) },
{ be_const_key_weak(encrypt, 4), be_const_func(m_aes_gcm_encryt) },
{ be_const_key_weak(_X2Ep2, -1), be_const_var(0) },
{ be_const_key_weak(decrypt, -1), be_const_func(m_aes_gcm_decryt) },
{ be_const_key_weak(init, -1), be_const_func(m_aes_gcm_init) },
{ be_const_key_weak(_X2Ep1, -1), be_const_var(1) },
{ be_const_key_weak(tag, -1), be_const_func(m_aes_gcm_tag) },
};
static be_define_const_map(

View File

@ -1,8 +1,8 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_ec_c25519_map) {
{ be_const_key(public_key, 1), be_const_func(m_ec_c25519_pubkey) },
{ be_const_key(shared_key, -1), be_const_func(m_ec_c25519_sharedkey) },
{ be_const_key_weak(public_key, 1), be_const_func(m_ec_c25519_pubkey) },
{ be_const_key_weak(shared_key, -1), be_const_func(m_ec_c25519_sharedkey) },
};
static be_define_const_map(

View File

@ -1,13 +1,13 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_zb_coord_ntv_map) {
{ be_const_key(iter, -1), be_const_func(zc_iter) },
{ be_const_key(zcl_frame, -1), be_const_class(be_class_zcl_frame) },
{ be_const_key(zb_device, 3), be_const_class(be_class_zb_device) },
{ be_const_key(info, -1), be_const_func(zc_info) },
{ be_const_key(size, 1), be_const_ctype_func(zc_size) },
{ be_const_key(item, -1), be_const_func(zc_item) },
{ be_const_key(abort, 4), be_const_ctype_func(zc_abort) },
{ be_const_key_weak(iter, -1), be_const_func(zc_iter) },
{ be_const_key_weak(zcl_frame, -1), be_const_class(be_class_zcl_frame) },
{ be_const_key_weak(zb_device, 3), be_const_class(be_class_zb_device) },
{ be_const_key_weak(info, -1), be_const_func(zc_info) },
{ be_const_key_weak(size, 1), be_const_ctype_func(zc_size) },
{ be_const_key_weak(item, -1), be_const_func(zc_item) },
{ be_const_key_weak(abort, 4), be_const_ctype_func(zc_abort) },
};
static be_define_const_map(

View File

@ -1,10 +1,10 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_zb_device_map) {
{ be_const_key(init, -1), be_const_ctype_func(zd_init) },
{ be_const_key(tostring, -1), be_const_closure(zb_device_tostring_closure) },
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(member, 0), be_const_func(zd_member) },
{ be_const_key_weak(init, -1), be_const_ctype_func(zd_init) },
{ be_const_key_weak(tostring, -1), be_const_closure(zb_device_tostring_closure) },
{ be_const_key_weak(_p, -1), be_const_var(0) },
{ be_const_key_weak(member, 0), be_const_func(zd_member) },
};
static be_define_const_map(

View File

@ -1,9 +1,9 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_zcl_frame_ntv_map) {
{ be_const_key(_set_bytes, -1), be_const_ctype_func(zfn_set_bytes) },
{ be_const_key(_def, 2), be_const_comptr(&be_zigbee_zcl_frame_struct) },
{ be_const_key(_get_bytes, -1), be_const_ctype_func(zfn_get_bytes) },
{ be_const_key_weak(_set_bytes, -1), be_const_ctype_func(zfn_set_bytes) },
{ be_const_key_weak(_def, 2), be_const_comptr(&be_zigbee_zcl_frame_struct) },
{ be_const_key_weak(_get_bytes, -1), be_const_ctype_func(zfn_get_bytes) },
};
static be_define_const_map(

View File

@ -1,11 +1,11 @@
#include "be_constobj.h"
static be_define_const_map_slots(m_libdisplay_map) {
{ be_const_key(start, -1), be_const_func(be_ntv_display_start) },
{ be_const_key(started, 0), be_const_ctype_func(be_ntv_display_started) },
{ be_const_key(driver_name, -1), be_const_ctype_func(be_ntv_display_driver_name) },
{ be_const_key(touch_update, 2), be_const_ctype_func(be_ntv_display_touch_update) },
{ be_const_key(dimmer, -1), be_const_func(be_ntv_display_dimmer) },
{ be_const_key_weak(start, -1), be_const_func(be_ntv_display_start) },
{ be_const_key_weak(started, 0), be_const_ctype_func(be_ntv_display_started) },
{ be_const_key_weak(driver_name, -1), be_const_ctype_func(be_ntv_display_driver_name) },
{ be_const_key_weak(touch_update, 2), be_const_ctype_func(be_ntv_display_touch_update) },
{ be_const_key_weak(dimmer, -1), be_const_func(be_ntv_display_dimmer) },
};
static be_define_const_map(

View File

@ -1,19 +1,19 @@
#include "be_constobj.h"
static be_define_const_map_slots(m_liblv_tasmota_map) {
{ be_const_key(load_freetype_font, -1), be_const_func(lv0_load_freetype_font) },
{ be_const_key(seg7_font, -1), be_const_func(lv0_load_seg7_font) },
{ be_const_key(screenshot, 11), be_const_func(lv0_screenshot) },
{ be_const_key(font_seg7, 1), be_const_func(lv0_load_seg7_font) },
{ be_const_key(splash_init, 0), be_const_closure(lv_tasmota_splash_init_closure) },
{ be_const_key(register_button_encoder, -1), be_const_func(lv0_register_button_encoder) },
{ be_const_key(init, 7), be_const_closure(lv_tasmota_init_closure) },
{ be_const_key(splash_remove, -1), be_const_closure(lv_tasmota_splash_remove_closure) },
{ be_const_key(start, -1), be_const_func(lv0_start) },
{ be_const_key(font_montserrat, -1), be_const_func(lv0_load_montserrat_font) },
{ be_const_key(font_embedded, -1), be_const_func(lv0_load_font_embedded) },
{ be_const_key(montserrat_font, -1), be_const_func(lv0_load_montserrat_font) },
{ be_const_key(splash, 10), be_const_closure(lv_tasmota_splash_closure) },
{ be_const_key_weak(load_freetype_font, -1), be_const_func(lv0_load_freetype_font) },
{ be_const_key_weak(seg7_font, -1), be_const_func(lv0_load_seg7_font) },
{ be_const_key_weak(screenshot, 11), be_const_func(lv0_screenshot) },
{ be_const_key_weak(font_seg7, 1), be_const_func(lv0_load_seg7_font) },
{ be_const_key_weak(splash_init, 0), be_const_closure(lv_tasmota_splash_init_closure) },
{ be_const_key_weak(register_button_encoder, -1), be_const_func(lv0_register_button_encoder) },
{ be_const_key_weak(init, 7), be_const_closure(lv_tasmota_init_closure) },
{ be_const_key_weak(splash_remove, -1), be_const_closure(lv_tasmota_splash_remove_closure) },
{ be_const_key_weak(start, -1), be_const_func(lv0_start) },
{ be_const_key_weak(font_montserrat, -1), be_const_func(lv0_load_montserrat_font) },
{ be_const_key_weak(font_embedded, -1), be_const_func(lv0_load_font_embedded) },
{ be_const_key_weak(montserrat_font, -1), be_const_func(lv0_load_montserrat_font) },
{ be_const_key_weak(splash, 10), be_const_closure(lv_tasmota_splash_closure) },
};
static be_define_const_map(

View File

@ -1,7 +1,7 @@
#include "be_constobj.h"
static be_define_const_map_slots(m_libzigbee_map) {
{ be_const_key(init, -1), be_const_func(zigbee_init) },
{ be_const_key_weak(init, -1), be_const_func(zigbee_init) },
};
static be_define_const_map(

View File

@ -27,14 +27,33 @@ extern "C" {
.type = (_t), \
.marked = GC_CONST
#define be_define_const_str_weak(_name, _s, _len) \
const bcstring be_const_str_##_name = { \
.next = NULL, \
.type = BE_STRING, \
.marked = GC_CONST, \
.extra = 0, \
.slen = _len, \
.hash = 0, \
.s = _s \
}
#define be_const_key(_str, _next) { \
.v.c = &be_const_str_##_str, \
.type = BE_STRING, \
.next = (uint32_t)(_next) & 0xFFFFFF \
}
/* try to use the predefined string in strtab, but don't create an instance if none is present */
/* the behavior is exactly the same as `be_const_key()` but it not detected by pycoc */
#define be_const_key_weak(_str, _next) { \
.v.c = &be_const_str_##_str, \
.type = BE_STRING, \
.next = (uint32_t)(_next) & 0xFFFFFF \
}
#define be_const_key_literal(_str, _next) { \
.v.c = be_str_literal(_str), \
.v.c = be_str_literal(#_str), \
.type = BE_STRING, \
.next = (uint32_t)(_next) & 0xFFFFFF \
}
@ -236,6 +255,13 @@ const bntvmodule be_native_module(_module) = { \
BE_STRING \
}
/* variant that does not trigger strtab */
#define be_nested_str_weak(_name_) \
{ \
{ .s=((bstring*)&be_const_str_##_name_) }, \
BE_STRING \
}
#define be_nested_str_literal(_name_) \
{ \
{ .s=(be_nested_const_str(_name_, _hash, sizeof(_name_)-1 ))\
@ -246,6 +272,9 @@ const bntvmodule be_native_module(_module) = { \
#define be_str_literal(_str) \
be_nested_const_str(_str, 0, sizeof(_str)-1 )
#define be_str_weak(_str) \
(bstring*) &be_const_str_##_str
#define be_nested_string(_str, _hash, _len) \
{ \
{ .s=(be_nested_const_str(_str, _hash, _len )) \
@ -262,12 +291,31 @@ const bntvmodule be_native_module(_module) = { \
#else
#define be_define_const_str_weak(_name, _s, _len) \
const bcstring be_const_str_##_name = { \
NULL, \
BE_STRING, \
GC_CONST, \
0, \
_len, \
0, \
_s \
}
#define be_const_key(_str, _next) { \
bvaldata(&be_const_str_##_str), \
BE_STRING, \
uint32_t((_next)&0xFFFFFF) \
}
/* try to use the predefined string in strtab, but don't create an instance if none is present */
/* the behavior is exactly the same as `be_const_key()` but it not detected by pycoc */
#define be_const_key_weak(_str, _next) { \
bvaldata(&be_const_str_##_str), \
BE_STRING, \
uint32_t((_next)&0xFFFFFF) \
}
#define be_const_key_int(_i, _next) { \
bvaldata(i), \
BE_INT, \

View File

@ -170,16 +170,13 @@ static void m_solidify_map(bvm *vm, bbool str_literal, bmap * map, const char *c
if (node->key.type == BE_STRING) {
/* convert the string literal to identifier */
const char * key = str(node->key.v.s);
size_t id_len = toidentifier_length(key);
char id_buf[id_len];
toidentifier(id_buf, key);
if (!str_literal) {
size_t id_len = toidentifier_length(key);
char id_buf[id_len];
toidentifier(id_buf, key);
logfmt(" { be_const_key(%s, %i), ", id_buf, key_next);
} else {
size_t id_len = toliteral_length(key);
char id_buf[id_len];
toliteral(id_buf, key);
logfmt(" { be_const_key_literal(\"%s\", %i), ", id_buf, key_next);
logfmt(" { be_const_key_weak(%s, %i), ", id_buf, key_next);
}
m_solidify_bvalue(vm, str_literal, &node->value, class_name, str(node->key.v.s));
} else if (node->key.type == BE_INT) {
@ -249,16 +246,13 @@ static void m_solidify_bvalue(bvm *vm, bbool str_literal, bvalue * value, const
if (len >= 255) {
be_raise(vm, "internal_error", "Strings greater than 255 chars not supported yet");
}
size_t id_len = toidentifier_length(str);
char id_buf[id_len];
toidentifier(id_buf, str);
if (!str_literal) {
size_t id_len = toidentifier_length(str);
char id_buf[id_len];
toidentifier(id_buf, str);
logfmt("be_nested_str(%s)", id_buf);
} else {
size_t id_len = toliteral_length(str);
char id_buf[id_len];
toliteral(id_buf, str);
logfmt("be_nested_str_literal(\"%s\")", id_buf);
logfmt("be_nested_str_weak(%s)", id_buf);
}
}
break;
@ -392,18 +386,14 @@ static void m_solidify_proto(bvm *vm, bbool str_literal, bproto *pr, const char
}
/* convert the string literal to identifier */
const char * key = str(pr->name);
size_t id_len = toidentifier_length(key);
char id_buf[id_len];
toidentifier(id_buf, key);
if (!str_literal) {
const char * key = str(pr->name);
size_t id_len = toidentifier_length(key);
char id_buf[id_len];
toidentifier(id_buf, key);
logfmt("%*s&be_const_str_%s,\n", indent, "", id_buf);
} else {
const char * key = str(pr->name);
size_t id_len = toliteral_length(key);
char id_buf[id_len];
toliteral(id_buf, key);
logfmt("%*sbe_str_literal(\"%s\"),\n", indent, "", id_buf);
logfmt("%*sbe_str_weak(%s),\n", indent, "", id_buf);
}
// hard-code source as "solidified" for solidified
logfmt("%*s&be_const_str_solidified,\n", indent, "");
@ -507,22 +497,18 @@ static void m_solidify_subclass(bvm *vm, bbool str_literal, bclass *cl, int buil
logfmt(" NULL,\n");
}
size_t id_len = toidentifier_length(class_name);
char id_buf[id_len];
toidentifier(id_buf, class_name);
if (!str_literal) {
size_t id_len = toidentifier_length(class_name);
char id_buf[id_len];
toidentifier(id_buf, class_name);
logfmt(" (bstring*) &be_const_str_%s\n", id_buf);
} else {
size_t id_len = toliteral_length(class_name);
char id_buf[id_len];
toliteral(id_buf, class_name);
logfmt(" be_str_literal(\"%s\")\n", id_buf);
logfmt(" be_str_weak(%s)\n", id_buf);
}
logfmt(");\n");
}
static void m_solidify_class(bvm *vm, bbool str_literal, bclass *cl, int builtins)
{
const char * class_name = str(cl->name);

View File

@ -1,4 +1,5 @@
import copy
import json
from hash_map import *
class block:
@ -21,6 +22,7 @@ class block_builder:
def __init__(self, obj, macro):
self.block = block()
self.strtab = []
self.strtab_weak = []
self.block.name = obj.name
if depend(obj, macro):
@ -28,19 +30,25 @@ class block_builder:
self.block.attr = obj.attr
if "name" in obj.attr:
self.strtab.append(obj.attr["name"])
if not self.get_strings_literal(self.block):
self.strtab.append(obj.attr["name"])
else:
self.strtab_weak.append(obj.attr["name"])
for key in obj.data_ordered:
second = obj.data[key]
if second.depend == None or macro.query(second.depend):
self.block.data[key] = second.value
self.strtab.append(key)
if not self.get_strings_literal(self.block):
self.strtab.append(key)
else:
self.strtab_weak.append(key)
self.block.data_ordered.append(key)
def block_tostring(self, block):
ostr = ""
if block.type == "map":
ostr += self.map_tostring(block, block.name)
ostr += self.map_tostring(block, block.name, False, self.get_strings_literal(block))
elif block.type == "class":
ostr += self.class_tostring(block)
elif block.type == "vartab":
@ -54,7 +62,7 @@ class block_builder:
hmap = hash_map(block.data)
map_name = block.name + "_map"
if len(block.data) > 0:
ostr += self.map_tostring(block, map_name, True) + "\n"
ostr += self.map_tostring(block, map_name, True, self.get_strings_literal(block)) + "\n"
ostr += self.scope(block) + " be_define_const_class(\n "
ostr += block.name + ",\n "
@ -63,12 +71,17 @@ class block_builder:
ostr += self.name(block) + "\n);\n"
return ostr
def map_tostring(self, block, name, local):
def map_tostring(self, block, name, local, literal):
hmap = hash_map(block.data)
entlist = hmap.entry_list()
ostr = "static be_define_const_map_slots(" + name + ") {\n"
ostr = ""
ostr += "static be_define_const_map_slots(" + name + ") {\n"
for ent in entlist:
ostr += " { be_const_key(" + ent.key + ", "
if literal:
ostr += " { be_const_key_weak(" + ent.key + ", "
else:
ostr += " { be_const_key(" + ent.key + ", "
ostr += str(ent.next) + "), " + ent.value + " },\n"
ostr += "};\n\n"
@ -92,7 +105,7 @@ class block_builder:
idxblk.data[key] = "int(" + str(index) + ")"
index += 1
ostr += self.map_tostring(idxblk, block.name + "_map", True) + "\n"
ostr += self.map_tostring(idxblk, block.name + "_map", True, False) + "\n"
ostr += "static const bvalue __vlist_array[] = {\n";
for it in varvec:
ostr += " be_const_" + it + ",\n"
@ -108,7 +121,7 @@ class block_builder:
name = "m_lib" + block.name
map_name = name + "_map"
ostr += self.map_tostring(block, map_name, True) + "\n"
ostr += self.map_tostring(block, map_name, True, self.get_strings_literal(block)) + "\n"
ostr += "static be_define_const_module(\n "
ostr += name + ",\n "
ostr += "\"" + block.name + "\"\n);\n"
@ -131,6 +144,13 @@ class block_builder:
else:
return "NULL"
def get_strings_literal(self, block):
if "strings" in block.attr:
a = block.attr["strings"]
return block.attr["strings"] == "weak"
else:
return False
def name(self, block):
if "name" in block.attr:
return block.attr["name"]

View File

@ -21,12 +21,16 @@ class coc_parser:
"""Parse text file"""
self.objects = []
self.strtab = set()
self.strtab_weak = set()
self.text = text
self.parsers = {
"@const_object_info_begin": self.parse_object,
"be_const_str_": self.parse_string,
"be_const_key(": self.parse_string,
"be_nested_str(": self.parse_string,
"be_const_key_weak(": self.parse_string_weak,
"be_nested_str_weak(": self.parse_string_weak,
"be_str_weak(": self.parse_string_weak,
}
while len(self.text) > 0:
@ -119,6 +123,14 @@ class coc_parser:
self.strtab.add(literal)
# print(f"str '{ident}' -> {literal}")
def parse_string_weak(self):
if not self.text[0].isalnum() and self.text[0] != '_': return # do not proceed, maybe false positive in solidify
ident = self.parse_word()
literal = unescape_operator(ident)
if not literal in self.strtab:
self.strtab_weak.add(literal)
# print(f"str '{ident}' -> {literal}")
#################################################################################
# Parse a block of definition like module, class...
#################################################################################

View File

@ -19,6 +19,7 @@ class builder:
self.config = macro_files
self.macro = None
self.strmap = {}
self.strmap_weak = {}
self.macro = macro_table()
for path in self.config:
@ -27,7 +28,7 @@ class builder:
for d in self.input:
self.scandir(d)
sb = str_build(self.strmap)
sb = str_build(self.strmap, self.strmap_weak)
sb.build(self.output)
def parse_file(self, filename):
@ -40,10 +41,14 @@ class builder:
parser = coc_parser(text)
for s in parser.strtab:
self.strmap[s] = 0
for s in parser.strtab_weak:
self.strmap_weak[s] = 0
for obj in parser.objects:
builder = block_builder(obj, self.macro)
for s in builder.strtab:
self.strmap[s] = 0
for s in builder.strtab_weak:
self.strmap_weak[s] = 0
builder.dumpfile(self.output)
def scandir(self, srcpath):

View File

@ -8,19 +8,28 @@ class str_info:
self.extra = 0
class str_build:
def __init__(self, map):
size = int(len(map) / 2) # voluntarily reduce hash size to half
def __init__(self, map, map_weak):
self.map = map.copy()
self.str_weak = []
size = int(len(self.map) / 2) # voluntarily reduce hash size to half
if size < 4: size = 4
self.buckets = []
for i in range(size):
self.buckets.append([])
self.keywords() # add keywords to self.map
self.make_ceil("", 0) # add empty string as it is always useful
self.count = len(map) + 1 # TODO it is not actually accurate since keywords are not counted
for k in sorted(map.keys()):
self.make_ceil(k, map[k])
self.keywords()
self.count = len(self.map) + 1 # TODO it is not actually accurate since keywords are not counted
for k in sorted(self.map.keys()):
self.make_ceil(k, self.map[k])
# handle weak strings
for k in sorted(map_weak.keys()):
if not k in self.map:
self.str_weak.append(k)
def build(self, path):
prefix = path + "/be_const_strtab"
self.writefile(prefix + "_def.h", self.build_table_def())
@ -47,8 +56,8 @@ class str_build:
"try": opif + 18 , "except": opif + 19 ,
"raise": opif + 20 , "static": opif + 21,
}
for key in sorted(tab.keys()):
self.make_ceil(key, tab[key])
for key, v in tab.items():
self.map[key] = v
def make_ceil(self, name, extra):
info = str_info()
@ -91,6 +100,14 @@ class str_build:
for s in sorted(strings.keys()):
ostr += strings[s]
ostr += "\n"
ostr += "\n/* weak strings */\n"
for k in self.str_weak:
ostr += "be_define_const_str("
ostr += escape_operator(k) + ", " + json.dumps(k) + ", "
ostr += "0u, 0, " + str(len(k)) + ", NULL);\n"
ostr += "\n"
ostr += "static const bstring* const m_string_table[] = {\n"
@ -120,4 +137,9 @@ class str_build:
all.add(escape_operator(info.str))
for s in sorted(all):
ostr += "extern const bcstring be_const_str_" + s + ";\n"
# ostr += "#define BE_CONST_STR_" + s + "\n"
# weak strings
ostr += "\n/* weak strings */\n"
for s in self.str_weak:
ostr += "extern const bcstring be_const_str_" + escape_operator(s) + ";\n"
return ostr

View File

@ -38,7 +38,7 @@ extern int be_BLE_adv_block(bvm *vm);
#include "be_fixed_be_class_BLE.h"
/* @const_object_info_begin
class be_class_BLE (scope: global, name: BLE) {
class be_class_BLE (scope: global, name: BLE, strings: weak) {
conn_cb, func(be_BLE_reg_conn_cb)
set_svc, func(be_BLE_set_service)
run, func(be_BLE_run)

View File

@ -74,7 +74,7 @@ be_local_class(Animate_rotate,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(init, -1), be_const_closure(Animate_rotate_init_closure) },
})),
be_str_literal("Animate_rotate")
be_str_weak(Animate_rotate)
);
/********************************************************************
@ -134,7 +134,7 @@ be_local_class(Animate_from_to,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(init, -1), be_const_closure(Animate_from_to_init_closure) },
})),
be_str_literal("Animate_from_to")
be_str_weak(Animate_from_to)
);
/********************************************************************
@ -215,7 +215,7 @@ be_local_class(Animate_back_forth,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(init, -1), be_const_closure(Animate_back_forth_init_closure) },
})),
be_str_literal("Animate_back_forth")
be_str_weak(Animate_back_forth)
);
/********************************************************************
@ -262,7 +262,7 @@ be_local_class(Animate_ins_goto,
{ be_const_key(pc_abs, -1), be_const_var(1) },
{ be_const_key(init, 2), be_const_closure(Animate_ins_goto_init_closure) },
})),
be_str_literal("Animate_ins_goto")
be_str_weak(Animate_ins_goto)
);
/********************************************************************
@ -309,7 +309,7 @@ be_local_class(Animate_ins_ramp,
{ be_const_key(duration, -1), be_const_var(2) },
{ be_const_key(init, -1), be_const_closure(Animate_ins_ramp_init_closure) },
})),
be_str_literal("Animate_ins_ramp")
be_str_weak(Animate_ins_ramp)
);
/********************************************************************
@ -690,7 +690,7 @@ be_local_class(Animate_engine,
{ be_const_key(closure, -1), be_const_var(1) },
{ be_const_key(ins_time, 9), be_const_var(3) },
})),
be_str_literal("Animate_engine")
be_str_weak(Animate_engine)
);
/********************************************************************

View File

@ -78,7 +78,7 @@ int32_t be_audio_opus_decoder_decode(struct bvm *vm) {
/* @const_object_info_begin
class be_class_AudioOpusDecoder (scope: global, name: AudioOpusDecoder) {
class be_class_AudioOpusDecoder (scope: global, name: AudioOpusDecoder, strings: weak) {
.p, var
init, func(be_audio_opus_decoder_init)
deinit, func(be_audio_opus_decoder_deinit)

View File

@ -1347,7 +1347,7 @@ be_local_class(Autoconf,
{ be_const_key(_error, -1), be_const_var(1) },
{ be_const_key(set_first_time, -1), be_const_closure(Autoconf_set_first_time_closure) },
})),
be_str_literal("Autoconf")
be_str_weak(Autoconf)
);
/********************************************************************

View File

@ -36,7 +36,7 @@ void be_load_crypto_lib(bvm *vm) {
}
/* @const_object_info_begin
class be_class_aes_gcm (scope: global, name: AES_GCM) {
class be_class_aes_gcm (scope: global, name: AES_GCM, strings: weak) {
.p1, var
.p2, var
@ -46,7 +46,7 @@ class be_class_aes_gcm (scope: global, name: AES_GCM) {
tag, func(m_aes_gcm_tag)
}
class be_class_ec_c25519 (scope: global, name: EC_C25519) {
class be_class_ec_c25519 (scope: global, name: EC_C25519, strings: weak) {
public_key, func(m_ec_c25519_pubkey)
shared_key, func(m_ec_c25519_sharedkey)
}

View File

@ -20,7 +20,7 @@ extern const char* be_ntv_display_driver_name(void);
BE_FUNC_CTYPE_DECLARE(be_ntv_display_driver_name, "s", "")
/* @const_object_info_begin
module display (scope: global) {
module display (scope: global, strings: weak) {
start, func(be_ntv_display_start)
started, ctype_func(be_ntv_display_started)
dimmer, func(be_ntv_display_dimmer)

View File

@ -89,7 +89,7 @@ be_local_class(Driver,
{ be_const_key(json_append, -1), be_const_var(10) },
{ be_const_key(web_add_button, -1), be_const_var(3) },
})),
be_str_literal("Driver")
be_str_weak(Driver)
);
/*******************************************************************/

View File

@ -667,7 +667,7 @@ be_local_class(hue_bridge_monad,
{ be_const_key(discover, -1), be_const_closure(hue_bridge_monad_discover_closure) },
{ be_const_key(full_status, 1), be_const_closure(hue_bridge_monad_full_status_closure) },
})),
be_str_literal("hue_bridge_monad")
be_str_weak(hue_bridge_monad)
);
/********************************************************************

View File

@ -980,7 +980,7 @@ be_local_class(AXP192,
{ be_const_key(json_append, -1), be_const_closure(AXP192_json_append_closure) },
{ be_const_key(get_input_power_status, -1), be_const_closure(AXP192_get_input_power_status_closure) },
})),
be_str_literal("AXP192")
be_str_weak(AXP192)
);
/*******************************************************************/

View File

@ -414,7 +414,7 @@ be_local_class(I2C_Driver,
{ be_const_key(init, -1), be_const_closure(I2C_Driver_init_closure) },
{ be_const_key(write_bit, -1), be_const_closure(I2C_Driver_write_bit_closure) },
})),
be_str_literal("I2C_Driver")
be_str_weak(I2C_Driver)
);
/*******************************************************************/

View File

@ -162,7 +162,7 @@ extern "C" {
}
/* @const_object_info_begin
class be_class_AudioOutput (scope: global, name: AudioOutput) {
class be_class_AudioOutput (scope: global, name: AudioOutput, strings: weak) {
.p, var
init, func(be_audio_output_init)
@ -180,15 +180,15 @@ class be_class_AudioOutput (scope: global, name: AudioOutput) {
set_gain, func(be_audio_output_set_gain)
}
class be_class_AudioGenerator (scope: global, name: AudioGenerator) {
class be_class_AudioGenerator (scope: global, name: AudioGenerator, strings: weak) {
.p, var
}
class be_class_AudioFileSource (scope: global, name: AudioFileSource) {
class be_class_AudioFileSource (scope: global, name: AudioFileSource, strings: weak) {
.p, var
}
class be_class_AudioOutputI2S (scope: global, name: AudioOutputI2S, super: be_class_AudioOutput) {
class be_class_AudioOutputI2S (scope: global, name: AudioOutputI2S, super: be_class_AudioOutput, strings: weak) {
EXTERNAL_I2S, int(AudioOutputI2S::EXTERNAL_I2S)
INTERNAL_DAC, int(AudioOutputI2S::INTERNAL_DAC)
INTERNAL_PDM, int(AudioOutputI2S::INTERNAL_PDM)
@ -198,7 +198,7 @@ class be_class_AudioOutputI2S (scope: global, name: AudioOutputI2S, super: be_cl
stop, func(i2s_output_i2s_stop)
}
class be_class_AudioGeneratorWAV (scope: global, name: AudioGeneratorWAV, super: be_class_AudioGenerator) {
class be_class_AudioGeneratorWAV (scope: global, name: AudioGeneratorWAV, super: be_class_AudioGenerator, strings: weak) {
init, func(i2s_generator_wav_init)
deinit, func(i2s_generator_wav_deinit)
begin, func(i2s_generator_wav_begin)
@ -207,7 +207,7 @@ class be_class_AudioGeneratorWAV (scope: global, name: AudioGeneratorWAV, super:
isrunning, func(i2s_generator_wav_isrunning)
}
class be_class_AudioGeneratorMP3 (scope: global, name: AudioGeneratorMP3, super: be_class_AudioGenerator) {
class be_class_AudioGeneratorMP3 (scope: global, name: AudioGeneratorMP3, super: be_class_AudioGenerator, strings: weak) {
init, func(i2s_generator_mp3_init)
deinit, func(i2s_generator_mp3_deinit)
begin, func(i2s_generator_mp3_begin)
@ -216,7 +216,7 @@ class be_class_AudioGeneratorMP3 (scope: global, name: AudioGeneratorMP3, super:
isrunning, func(i2s_generator_mp3_isrunning)
}
class be_class_AudioFileSourceFS (scope: global, name: AudioFileSourceFS, super: be_class_AudioFileSource) {
class be_class_AudioFileSourceFS (scope: global, name: AudioFileSourceFS, super: be_class_AudioFileSource, strings: weak) {
init, func(i2s_file_source_fs_init)
deinit, func(i2s_file_source_fs_deinit)
}

View File

@ -368,7 +368,7 @@ be_local_class(Leds_animator,
{ be_const_key(animators, -1), be_const_var(4) },
{ be_const_key(set_bri, 1), be_const_closure(Leds_animator_set_bri_closure) },
})),
be_str_literal("Leds_animator")
be_str_weak(Leds_animator)
);
/*******************************************************************/

View File

@ -653,7 +653,7 @@ be_local_class(Leds_segment,
{ be_const_key(begin, 6), be_const_closure(Leds_segment_begin_closure) },
{ be_const_key(pixels_buffer, -1), be_const_closure(Leds_segment_pixels_buffer_closure) },
})),
be_str_literal("Leds_segment")
be_str_weak(Leds_segment)
);
/********************************************************************
@ -1314,7 +1314,7 @@ be_local_class(Leds_matrix,
{ be_const_key(is_dirty, -1), be_const_closure(Leds_matrix_is_dirty_closure) },
{ be_const_key(can_show, -1), be_const_closure(Leds_matrix_can_show_closure) },
})),
be_str_literal("Leds_matrix")
be_str_weak(Leds_matrix)
);
/********************************************************************
@ -1904,7 +1904,7 @@ be_local_class(Leds,
{ be_const_key(gamma, -1), be_const_var(0) },
{ be_const_key(can_show, -1), be_const_closure(Leds_can_show_closure) },
})),
be_str_literal("Leds")
be_str_weak(Leds)
);
/*******************************************************************/

View File

@ -36,7 +36,7 @@ be_local_class(Leds_ntv,
{ be_const_key(SK6812_GRBW, 4), be_const_int(2) },
{ be_const_key(WS2812_GRB, -1), be_const_int(1) },
})),
be_str_literal("Leds_ntv")
be_str_weak(Leds_ntv)
);
/*******************************************************************/

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,8 @@ extern int lv0_load_font_embedded(bvm *vm);
extern int lv0_screenshot(bvm *vm);
extern int lv0_load_freetype_font(bvm *vm);
/********************************************************************
** Solidified function: splash_remove
********************************************************************/
@ -31,11 +33,11 @@ be_local_closure(lv_tasmota_splash_remove, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str(lv),
/* K1 */ be_nested_str(_splash),
/* K2 */ be_nested_str(del),
/* K0 */ be_nested_str_weak(lv),
/* K1 */ be_nested_str_weak(_splash),
/* K2 */ be_nested_str_weak(del),
}),
&be_const_str_splash_remove,
be_str_weak(splash_remove),
&be_const_str_solidified,
( &(const binstruction[ 9]) { /* code */
0xB8020000, // 0000 GETNGBL R0 K0
@ -67,10 +69,10 @@ be_local_closure(splash_runner_init, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(tasmota),
/* K1 */ be_nested_str(add_driver),
/* K0 */ be_nested_str_weak(tasmota),
/* K1 */ be_nested_str_weak(add_driver),
}),
&be_const_str_init,
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0xB8060000, // 0000 GETNGBL R1 K0
@ -98,15 +100,15 @@ be_local_closure(splash_runner_display, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str(display),
/* K1 */ be_nested_str(dim),
/* K2 */ be_nested_str(started),
/* K3 */ be_nested_str(tasmota),
/* K4 */ be_nested_str(remove_driver),
/* K5 */ be_nested_str(lv),
/* K6 */ be_nested_str(splash),
/* K0 */ be_nested_str_weak(display),
/* K1 */ be_nested_str_weak(dim),
/* K2 */ be_nested_str_weak(started),
/* K3 */ be_nested_str_weak(tasmota),
/* K4 */ be_nested_str_weak(remove_driver),
/* K5 */ be_nested_str_weak(lv),
/* K6 */ be_nested_str_weak(splash),
}),
&be_const_str_display,
be_str_weak(display),
&be_const_str_solidified,
( &(const binstruction[14]) { /* code */
0xA4160000, // 0000 IMPORT R5 K0
@ -137,10 +139,10 @@ be_local_class(splash_runner,
NULL,
be_nested_map(2,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(display, -1), be_const_closure(splash_runner_display_closure) },
{ be_const_key(init, 0), be_const_closure(splash_runner_init_closure) },
{ be_const_key_weak(display, -1), be_const_closure(splash_runner_display_closure) },
{ be_const_key_weak(init, 0), be_const_closure(splash_runner_init_closure) },
})),
be_str_literal("splash_runner")
be_str_weak(splash_runner)
);
/********************************************************************
@ -157,13 +159,13 @@ be_local_closure(lv_tasmota_splash_init, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str(display),
/* K1 */ be_nested_str(started),
/* K2 */ be_nested_str(lv),
/* K3 */ be_nested_str(splash),
/* K0 */ be_nested_str_weak(display),
/* K1 */ be_nested_str_weak(started),
/* K2 */ be_nested_str_weak(lv),
/* K3 */ be_nested_str_weak(splash),
/* K4 */ be_const_class(be_class_splash_runner),
}),
&be_const_str_splash_init,
be_str_weak(splash_init),
&be_const_str_solidified,
( &(const binstruction[13]) { /* code */
0xA4020000, // 0000 IMPORT R0 K0
@ -199,50 +201,50 @@ be_local_closure(lv_tasmota_splash, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[42]) { /* constants */
/* K0 */ be_nested_str(display),
/* K1 */ be_nested_str(started),
/* K2 */ be_nested_str(lv),
/* K3 */ be_nested_str(start),
/* K4 */ be_nested_str(obj),
/* K5 */ be_nested_str(scr_act),
/* K6 */ be_nested_str(montserrat_font),
/* K7 */ be_nested_str(color),
/* K8 */ be_nested_str(COLOR_WHITE),
/* K9 */ be_nested_str(set_style_bg_color),
/* K0 */ be_nested_str_weak(display),
/* K1 */ be_nested_str_weak(started),
/* K2 */ be_nested_str_weak(lv),
/* K3 */ be_nested_str_weak(start),
/* K4 */ be_nested_str_weak(obj),
/* K5 */ be_nested_str_weak(scr_act),
/* K6 */ be_nested_str_weak(montserrat_font),
/* K7 */ be_nested_str_weak(color),
/* K8 */ be_nested_str_weak(COLOR_WHITE),
/* K9 */ be_nested_str_weak(set_style_bg_color),
/* K10 */ be_const_int(0),
/* K11 */ be_nested_str(set_style_radius),
/* K12 */ be_nested_str(set_style_pad_all),
/* K13 */ be_nested_str(set_style_border_width),
/* K14 */ be_nested_str(set_size),
/* K15 */ be_nested_str(pct),
/* K16 */ be_nested_str(refr_pos),
/* K17 */ be_nested_str(refr_size),
/* K18 */ be_nested_str(set_user_data),
/* K11 */ be_nested_str_weak(set_style_radius),
/* K12 */ be_nested_str_weak(set_style_pad_all),
/* K13 */ be_nested_str_weak(set_style_border_width),
/* K14 */ be_nested_str_weak(set_size),
/* K15 */ be_nested_str_weak(pct),
/* K16 */ be_nested_str_weak(refr_pos),
/* K17 */ be_nested_str_weak(refr_size),
/* K18 */ be_nested_str_weak(set_user_data),
/* K19 */ be_const_int(1399876712),
/* K20 */ be_nested_str(img),
/* K21 */ be_nested_str(set_tasmota_logo),
/* K22 */ be_nested_str(set_zoom),
/* K23 */ be_nested_str(set_style_img_recolor_opa),
/* K24 */ be_nested_str(set_style_img_recolor),
/* K25 */ be_nested_str(set_align),
/* K26 */ be_nested_str(ALIGN_LEFT_MID),
/* K27 */ be_nested_str(set_x),
/* K28 */ be_nested_str(label),
/* K29 */ be_nested_str(set_style_text_color),
/* K30 */ be_nested_str(set_text),
/* K31 */ be_nested_str(TASMOTA),
/* K32 */ be_nested_str(get_hor_res),
/* K33 */ be_nested_str(set_style_text_font),
/* K34 */ be_nested_str(driver_name),
/* K35 */ be_nested_str(ALIGN_BOTTOM_MID),
/* K20 */ be_nested_str_weak(img),
/* K21 */ be_nested_str_weak(set_tasmota_logo),
/* K22 */ be_nested_str_weak(set_zoom),
/* K23 */ be_nested_str_weak(set_style_img_recolor_opa),
/* K24 */ be_nested_str_weak(set_style_img_recolor),
/* K25 */ be_nested_str_weak(set_align),
/* K26 */ be_nested_str_weak(ALIGN_LEFT_MID),
/* K27 */ be_nested_str_weak(set_x),
/* K28 */ be_nested_str_weak(label),
/* K29 */ be_nested_str_weak(set_style_text_color),
/* K30 */ be_nested_str_weak(set_text),
/* K31 */ be_nested_str_weak(TASMOTA),
/* K32 */ be_nested_str_weak(get_hor_res),
/* K33 */ be_nested_str_weak(set_style_text_font),
/* K34 */ be_nested_str_weak(driver_name),
/* K35 */ be_nested_str_weak(ALIGN_BOTTOM_MID),
/* K36 */ be_const_int(16777215),
/* K37 */ be_nested_str(refr_now),
/* K38 */ be_nested_str(_splash),
/* K39 */ be_nested_str(tasmota),
/* K40 */ be_nested_str(set_timer),
/* K41 */ be_nested_str(splash_remove),
/* K37 */ be_nested_str_weak(refr_now),
/* K38 */ be_nested_str_weak(_splash),
/* K39 */ be_nested_str_weak(tasmota),
/* K40 */ be_nested_str_weak(set_timer),
/* K41 */ be_nested_str_weak(splash_remove),
}),
&be_const_str_splash,
be_str_weak(splash),
&be_const_str_solidified,
( &(const binstruction[166]) { /* code */
0xA4020000, // 0000 IMPORT R0 K0
@ -431,41 +433,41 @@ be_local_closure(lv_tasmota_init, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[33]) { /* constants */
/* K0 */ be_nested_str(lv),
/* K1 */ be_nested_str(start),
/* K2 */ be_nested_str(splash_init),
/* K3 */ be_nested_str(splash_remove),
/* K4 */ be_nested_str(splash),
/* K5 */ be_nested_str(_splash),
/* K6 */ be_nested_str(font_montserrat),
/* K7 */ be_nested_str(montserrat_font),
/* K8 */ be_nested_str(font_seg7),
/* K9 */ be_nested_str(seg7_font),
/* K10 */ be_nested_str(font_embedded),
/* K11 */ be_nested_str(load_freetype_font),
/* K12 */ be_nested_str(register_button_encoder),
/* K13 */ be_nested_str(screenshot),
/* K14 */ be_nested_str(clock),
/* K15 */ be_nested_str(lv_clock),
/* K16 */ be_nested_str(clock_icon),
/* K17 */ be_nested_str(lv_clock_icon),
/* K18 */ be_nested_str(signal_arcs),
/* K19 */ be_nested_str(lv_signal_arcs),
/* K20 */ be_nested_str(signal_bars),
/* K21 */ be_nested_str(lv_signal_bars),
/* K22 */ be_nested_str(wifi_arcs_icon),
/* K23 */ be_nested_str(lv_wifi_arcs_icon),
/* K24 */ be_nested_str(wifi_arcs),
/* K25 */ be_nested_str(lv_wifi_arcs),
/* K26 */ be_nested_str(wifi_bars_icon),
/* K27 */ be_nested_str(lv_wifi_bars_icon),
/* K28 */ be_nested_str(wifi_bars),
/* K29 */ be_nested_str(lv_wifi_bars),
/* K30 */ be_nested_str(tasmota),
/* K31 */ be_nested_str(get_option),
/* K0 */ be_nested_str_weak(lv),
/* K1 */ be_nested_str_weak(start),
/* K2 */ be_nested_str_weak(splash_init),
/* K3 */ be_nested_str_weak(splash_remove),
/* K4 */ be_nested_str_weak(splash),
/* K5 */ be_nested_str_weak(_splash),
/* K6 */ be_nested_str_weak(font_montserrat),
/* K7 */ be_nested_str_weak(montserrat_font),
/* K8 */ be_nested_str_weak(font_seg7),
/* K9 */ be_nested_str_weak(seg7_font),
/* K10 */ be_nested_str_weak(font_embedded),
/* K11 */ be_nested_str_weak(load_freetype_font),
/* K12 */ be_nested_str_weak(register_button_encoder),
/* K13 */ be_nested_str_weak(screenshot),
/* K14 */ be_nested_str_weak(clock),
/* K15 */ be_nested_str_weak(lv_clock),
/* K16 */ be_nested_str_weak(clock_icon),
/* K17 */ be_nested_str_weak(lv_clock_icon),
/* K18 */ be_nested_str_weak(signal_arcs),
/* K19 */ be_nested_str_weak(lv_signal_arcs),
/* K20 */ be_nested_str_weak(signal_bars),
/* K21 */ be_nested_str_weak(lv_signal_bars),
/* K22 */ be_nested_str_weak(wifi_arcs_icon),
/* K23 */ be_nested_str_weak(lv_wifi_arcs_icon),
/* K24 */ be_nested_str_weak(wifi_arcs),
/* K25 */ be_nested_str_weak(lv_wifi_arcs),
/* K26 */ be_nested_str_weak(wifi_bars_icon),
/* K27 */ be_nested_str_weak(lv_wifi_bars_icon),
/* K28 */ be_nested_str_weak(wifi_bars),
/* K29 */ be_nested_str_weak(lv_wifi_bars),
/* K30 */ be_nested_str_weak(tasmota),
/* K31 */ be_nested_str_weak(get_option),
/* K32 */ be_const_int(0),
}),
&be_const_str_init,
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[53]) { /* code */
0xA4060000, // 0000 IMPORT R1 K0
@ -527,7 +529,7 @@ be_local_closure(lv_tasmota_init, /* name */
/*******************************************************************/
/* @const_object_info_begin
module lv_tasmota (scope: global) {
module lv_tasmota (scope: global, strings: weak) {
init, closure(lv_tasmota_init_closure)
start, func(lv0_start)

File diff suppressed because it is too large Load Diff

View File

@ -1,131 +0,0 @@
/********************************************************************
* Tasmota LVGL lv_signal_bars widget
*******************************************************************/
#include "be_constobj.h"
#ifdef USE_LVGL
#include "lvgl.h"
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(lv_clock_icon_init, /* name */
be_nested_proto(
10, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[16]) { /* constants */
/* K0 */ be_nested_str(init),
/* K1 */ be_nested_str(get_height),
/* K2 */ be_nested_str(refr_size),
/* K3 */ be_nested_str(get_width),
/* K4 */ be_nested_str(set_y),
/* K5 */ be_const_int(2),
/* K6 */ be_nested_str(get_style_pad_right),
/* K7 */ be_nested_str(lv),
/* K8 */ be_nested_str(PART_MAIN),
/* K9 */ be_nested_str(STATE_DEFAULT),
/* K10 */ be_nested_str(set_x),
/* K11 */ be_const_int(3),
/* K12 */ be_nested_str(set_style_pad_right),
/* K13 */ be_nested_str(set_style_bg_color),
/* K14 */ be_nested_str(color),
/* K15 */ be_nested_str(COLOR_BLACK),
}),
&be_const_str_init,
&be_const_str_solidified,
( &(const binstruction[60]) { /* code */
0x60080003, // 0000 GETGBL R2 G3
0x5C0C0000, // 0001 MOVE R3 R0
0x7C080200, // 0002 CALL R2 1
0x8C080500, // 0003 GETMET R2 R2 K0
0x5C100200, // 0004 MOVE R4 R1
0x7C080400, // 0005 CALL R2 2
0x4C080000, // 0006 LDNIL R2
0x20080202, // 0007 NE R2 R1 R2
0x780A0031, // 0008 JMPF R2 #003B
0x8C080301, // 0009 GETMET R2 R1 K1
0x7C080200, // 000A CALL R2 1
0x8C0C0102, // 000B GETMET R3 R0 K2
0x7C0C0200, // 000C CALL R3 1
0x8C0C0103, // 000D GETMET R3 R0 K3
0x7C0C0200, // 000E CALL R3 1
0x8C100104, // 000F GETMET R4 R0 K4
0x8C180301, // 0010 GETMET R6 R1 K1
0x7C180200, // 0011 CALL R6 1
0x8C1C0101, // 0012 GETMET R7 R0 K1
0x7C1C0200, // 0013 CALL R7 1
0x04180C07, // 0014 SUB R6 R6 R7
0x0C180D05, // 0015 DIV R6 R6 K5
0x7C100400, // 0016 CALL R4 2
0x8C100306, // 0017 GETMET R4 R1 K6
0xB81A0E00, // 0018 GETNGBL R6 K7
0x88180D08, // 0019 GETMBR R6 R6 K8
0xB81E0E00, // 001A GETNGBL R7 K7
0x881C0F09, // 001B GETMBR R7 R7 K9
0x30180C07, // 001C OR R6 R6 R7
0x7C100400, // 001D CALL R4 2
0x8C14010A, // 001E GETMET R5 R0 K10
0x8C1C0303, // 001F GETMET R7 R1 K3
0x7C1C0200, // 0020 CALL R7 1
0x041C0E03, // 0021 SUB R7 R7 R3
0x041C0E04, // 0022 SUB R7 R7 R4
0x041C0F0B, // 0023 SUB R7 R7 K11
0x7C140400, // 0024 CALL R5 2
0x8C14030C, // 0025 GETMET R5 R1 K12
0x001C0803, // 0026 ADD R7 R4 R3
0x54220005, // 0027 LDINT R8 6
0x001C0E08, // 0028 ADD R7 R7 R8
0xB8220E00, // 0029 GETNGBL R8 K7
0x88201108, // 002A GETMBR R8 R8 K8
0xB8260E00, // 002B GETNGBL R9 K7
0x88241309, // 002C GETMBR R9 R9 K9
0x30201009, // 002D OR R8 R8 R9
0x7C140600, // 002E CALL R5 3
0x8C14010D, // 002F GETMET R5 R0 K13
0xB81E0E00, // 0030 GETNGBL R7 K7
0x8C1C0F0E, // 0031 GETMET R7 R7 K14
0xB8260E00, // 0032 GETNGBL R9 K7
0x8824130F, // 0033 GETMBR R9 R9 K15
0x7C1C0400, // 0034 CALL R7 2
0xB8220E00, // 0035 GETNGBL R8 K7
0x88201108, // 0036 GETMBR R8 R8 K8
0xB8260E00, // 0037 GETNGBL R9 K7
0x88241309, // 0038 GETMBR R9 R9 K9
0x30201009, // 0039 OR R8 R8 R9
0x7C140600, // 003A CALL R5 3
0x80000000, // 003B RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_clock_icon
********************************************************************/
extern const bclass be_class_lv_clock;
be_local_class(lv_clock_icon,
0,
&be_class_lv_clock,
be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(init, -1), be_const_closure(lv_clock_icon_init_closure) },
})),
be_str_literal("lv_clock_icon")
);
/*******************************************************************/
void be_load_lv_clock_icon_class(bvm *vm) {
be_pushntvclass(vm, &be_class_lv_clock_icon);
be_setglobal(vm, "lv_clock_icon");
be_pop(vm, 1);
}
#endif // USE_LVGL

View File

@ -1,276 +0,0 @@
/********************************************************************
* Tasmota LVGL lv_signal_bars widget
*******************************************************************/
#include "be_constobj.h"
#ifdef USE_LVGL
#include "lvgl.h"
/********************************************************************
** Solidified function: set_time
********************************************************************/
be_local_closure(lv_clock_set_time, /* name */
be_nested_proto(
11, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[10]) { /* constants */
/* K0 */ be_nested_str(string),
/* K1 */ be_nested_str(hour),
/* K2 */ be_nested_str(minute),
/* K3 */ be_nested_str(sec),
/* K4 */ be_nested_str(format),
/* K5 */ be_nested_str(_X2502d_X25s_X2502d),
/* K6 */ be_const_int(2),
/* K7 */ be_nested_str(_X3A),
/* K8 */ be_nested_str(_X20),
/* K9 */ be_nested_str(set_text),
}),
&be_const_str_set_time,
&be_const_str_solidified,
( &(const binstruction[27]) { /* code */
0xA4120000, // 0000 IMPORT R4 K0
0x88140101, // 0001 GETMBR R5 R0 K1
0x20140205, // 0002 NE R5 R1 R5
0x74160005, // 0003 JMPT R5 #000A
0x88140102, // 0004 GETMBR R5 R0 K2
0x20140405, // 0005 NE R5 R2 R5
0x74160002, // 0006 JMPT R5 #000A
0x88140103, // 0007 GETMBR R5 R0 K3
0x20140605, // 0008 NE R5 R3 R5
0x7816000F, // 0009 JMPF R5 #001A
0x8C140904, // 000A GETMET R5 R4 K4
0x581C0005, // 000B LDCONST R7 K5
0x5C200200, // 000C MOVE R8 R1
0x10240706, // 000D MOD R9 R3 K6
0x78260001, // 000E JMPF R9 #0011
0x58240007, // 000F LDCONST R9 K7
0x70020000, // 0010 JMP #0012
0x58240008, // 0011 LDCONST R9 K8
0x5C280400, // 0012 MOVE R10 R2
0x7C140A00, // 0013 CALL R5 5
0x90020201, // 0014 SETMBR R0 K1 R1
0x90020402, // 0015 SETMBR R0 K2 R2
0x90020603, // 0016 SETMBR R0 K3 R3
0x8C180109, // 0017 GETMET R6 R0 K9
0x5C200A00, // 0018 MOVE R8 R5
0x7C180400, // 0019 CALL R6 2
0x80000000, // 001A RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: every_second
********************************************************************/
be_local_closure(lv_clock_every_second, /* name */
be_nested_proto(
7, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 9]) { /* constants */
/* K0 */ be_nested_str(tasmota),
/* K1 */ be_nested_str(time_dump),
/* K2 */ be_nested_str(rtc),
/* K3 */ be_nested_str(local),
/* K4 */ be_nested_str(year),
/* K5 */ be_nested_str(set_time),
/* K6 */ be_nested_str(hour),
/* K7 */ be_nested_str(min),
/* K8 */ be_nested_str(sec),
}),
&be_const_str_every_second,
&be_const_str_solidified,
( &(const binstruction[17]) { /* code */
0xB8060000, // 0000 GETNGBL R1 K0
0x8C040301, // 0001 GETMET R1 R1 K1
0xB80E0000, // 0002 GETNGBL R3 K0
0x8C0C0702, // 0003 GETMET R3 R3 K2
0x7C0C0200, // 0004 CALL R3 1
0x940C0703, // 0005 GETIDX R3 R3 K3
0x7C040400, // 0006 CALL R1 2
0x94080304, // 0007 GETIDX R2 R1 K4
0x540E07B1, // 0008 LDINT R3 1970
0x20080403, // 0009 NE R2 R2 R3
0x780A0004, // 000A JMPF R2 #0010
0x8C080105, // 000B GETMET R2 R0 K5
0x94100306, // 000C GETIDX R4 R1 K6
0x94140307, // 000D GETIDX R5 R1 K7
0x94180308, // 000E GETIDX R6 R1 K8
0x7C080800, // 000F CALL R2 4
0x80000000, // 0010 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(lv_clock_init, /* name */
be_nested_proto(
8, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
1, /* has sup protos */
( &(const struct bproto*[ 1]) {
be_nested_proto(
2, /* nstack */
0, /* argc */
0, /* varg */
1, /* has upvals */
( &(const bupvaldesc[ 1]) { /* upvals */
be_local_const_upval(1, 0),
}),
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str(before_del),
}),
&be_const_str__X3Clambda_X3E,
&be_const_str_solidified,
( &(const binstruction[ 4]) { /* code */
0x68000000, // 0000 GETUPV R0 U0
0x8C000100, // 0001 GETMET R0 R0 K0
0x7C000200, // 0002 CALL R0 1
0x80040000, // 0003 RET 1 R0
})
),
}),
1, /* has constants */
( &(const bvalue[13]) { /* constants */
/* K0 */ be_nested_str(init),
/* K1 */ be_nested_str(lv),
/* K2 */ be_nested_str(seg7_font),
/* K3 */ be_nested_str(set_style_text_font),
/* K4 */ be_nested_str(PART_MAIN),
/* K5 */ be_nested_str(STATE_DEFAULT),
/* K6 */ be_nested_str(set_text),
/* K7 */ be_nested_str(_X2D_X2D_X3A_X2D_X2D),
/* K8 */ be_nested_str(add_event_cb),
/* K9 */ be_nested_str(EVENT_DELETE),
/* K10 */ be_const_int(0),
/* K11 */ be_nested_str(tasmota),
/* K12 */ be_nested_str(add_driver),
}),
&be_const_str_init,
&be_const_str_solidified,
( &(const binstruction[36]) { /* code */
0x60080003, // 0000 GETGBL R2 G3
0x5C0C0000, // 0001 MOVE R3 R0
0x7C080200, // 0002 CALL R2 1
0x8C080500, // 0003 GETMET R2 R2 K0
0x5C100200, // 0004 MOVE R4 R1
0x7C080400, // 0005 CALL R2 2
0xB80A0200, // 0006 GETNGBL R2 K1
0x8C080502, // 0007 GETMET R2 R2 K2
0x5412000F, // 0008 LDINT R4 16
0x7C080400, // 0009 CALL R2 2
0x4C0C0000, // 000A LDNIL R3
0x200C0403, // 000B NE R3 R2 R3
0x780E0007, // 000C JMPF R3 #0015
0x8C0C0103, // 000D GETMET R3 R0 K3
0x5C140400, // 000E MOVE R5 R2
0xB81A0200, // 000F GETNGBL R6 K1
0x88180D04, // 0010 GETMBR R6 R6 K4
0xB81E0200, // 0011 GETNGBL R7 K1
0x881C0F05, // 0012 GETMBR R7 R7 K5
0x30180C07, // 0013 OR R6 R6 R7
0x7C0C0600, // 0014 CALL R3 3
0x8C0C0106, // 0015 GETMET R3 R0 K6
0x58140007, // 0016 LDCONST R5 K7
0x7C0C0400, // 0017 CALL R3 2
0x8C0C0108, // 0018 GETMET R3 R0 K8
0x84140000, // 0019 CLOSURE R5 P0
0xB81A0200, // 001A GETNGBL R6 K1
0x88180D09, // 001B GETMBR R6 R6 K9
0x581C000A, // 001C LDCONST R7 K10
0x7C0C0800, // 001D CALL R3 4
0xB80E1600, // 001E GETNGBL R3 K11
0x8C0C070C, // 001F GETMET R3 R3 K12
0x5C140000, // 0020 MOVE R5 R0
0x7C0C0400, // 0021 CALL R3 2
0xA0000000, // 0022 CLOSE R0
0x80000000, // 0023 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: before_del
********************************************************************/
be_local_closure(lv_clock_before_del, /* name */
be_nested_proto(
4, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(tasmota),
/* K1 */ be_nested_str(remove_driver),
}),
&be_const_str_before_del,
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0xB8060000, // 0000 GETNGBL R1 K0
0x8C040301, // 0001 GETMET R1 R1 K1
0x5C0C0000, // 0002 MOVE R3 R0
0x7C040400, // 0003 CALL R1 2
0x80000000, // 0004 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_clock
********************************************************************/
extern const bclass be_class_lv_label;
be_local_class(lv_clock,
3,
&be_class_lv_label,
be_nested_map(7,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(sec, -1), be_const_var(2) },
{ be_const_key(hour, -1), be_const_var(0) },
{ be_const_key(before_del, 6), be_const_closure(lv_clock_before_del_closure) },
{ be_const_key(every_second, -1), be_const_closure(lv_clock_every_second_closure) },
{ be_const_key(minute, -1), be_const_var(1) },
{ be_const_key(set_time, 2), be_const_closure(lv_clock_set_time_closure) },
{ be_const_key(init, -1), be_const_closure(lv_clock_init_closure) },
})),
be_str_literal("lv_clock")
);
/*******************************************************************/
void be_load_lv_clock_class(bvm *vm) {
be_pushntvclass(vm, &be_class_lv_clock);
be_setglobal(vm, "lv_clock");
be_pop(vm, 1);
}
#endif // USE_LVGL

View File

@ -1,423 +0,0 @@
/********************************************************************
* Tasmota LVGL lv_signal_bars widget
*******************************************************************/
#include "be_constobj.h"
#ifdef USE_LVGL
#include "lvgl.h"
/********************************************************************
** Solidified function: set_percentage
********************************************************************/
be_local_closure(lv_signal_arcs_set_percentage, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str(percentage),
/* K1 */ be_const_int(0),
/* K2 */ be_nested_str(invalidate),
}),
&be_const_str_set_percentage,
&be_const_str_solidified,
( &(const binstruction[18]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x540E0018, // 0001 LDINT R3 25
0x0C080403, // 0002 DIV R2 R2 R3
0x540E0063, // 0003 LDINT R3 100
0x240C0203, // 0004 GT R3 R1 R3
0x780E0000, // 0005 JMPF R3 #0007
0x54060063, // 0006 LDINT R1 100
0x140C0301, // 0007 LT R3 R1 K1
0x780E0000, // 0008 JMPF R3 #000A
0x58040001, // 0009 LDCONST R1 K1
0x90020001, // 000A SETMBR R0 K0 R1
0x540E0018, // 000B LDINT R3 25
0x0C0C0203, // 000C DIV R3 R1 R3
0x200C0403, // 000D NE R3 R2 R3
0x780E0001, // 000E JMPF R3 #0011
0x8C0C0102, // 000F GETMET R3 R0 K2
0x7C0C0200, // 0010 CALL R3 1
0x80000000, // 0011 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(lv_signal_arcs_init, /* name */
be_nested_proto(
6, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[10]) { /* constants */
/* K0 */ be_nested_str(_lvgl),
/* K1 */ be_nested_str(create_custom_widget),
/* K2 */ be_nested_str(percentage),
/* K3 */ be_nested_str(p1),
/* K4 */ be_nested_str(lv),
/* K5 */ be_nested_str(point),
/* K6 */ be_nested_str(p2),
/* K7 */ be_nested_str(area),
/* K8 */ be_nested_str(arc_dsc),
/* K9 */ be_nested_str(draw_arc_dsc),
}),
&be_const_str_init,
&be_const_str_solidified,
( &(const binstruction[24]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100000, // 0002 MOVE R4 R0
0x5C140200, // 0003 MOVE R5 R1
0x7C080600, // 0004 CALL R2 3
0x540A0063, // 0005 LDINT R2 100
0x90020402, // 0006 SETMBR R0 K2 R2
0xB80A0800, // 0007 GETNGBL R2 K4
0x8C080505, // 0008 GETMET R2 R2 K5
0x7C080200, // 0009 CALL R2 1
0x90020602, // 000A SETMBR R0 K3 R2
0xB80A0800, // 000B GETNGBL R2 K4
0x8C080505, // 000C GETMET R2 R2 K5
0x7C080200, // 000D CALL R2 1
0x90020C02, // 000E SETMBR R0 K6 R2
0xB80A0800, // 000F GETNGBL R2 K4
0x8C080507, // 0010 GETMET R2 R2 K7
0x7C080200, // 0011 CALL R2 1
0x90020E02, // 0012 SETMBR R0 K7 R2
0xB80A0800, // 0013 GETNGBL R2 K4
0x8C080509, // 0014 GETMET R2 R2 K9
0x7C080200, // 0015 CALL R2 1
0x90021002, // 0016 SETMBR R0 K8 R2
0x80000000, // 0017 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: widget_event
********************************************************************/
be_local_closure(lv_signal_arcs_widget_event, /* name */
be_nested_proto(
27, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
1, /* has sup protos */
( &(const struct bproto*[ 1]) {
be_nested_proto(
2, /* nstack */
1, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_const_int(1),
}),
&be_const_str_atleast1,
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
0x28040100, // 0000 GE R1 R0 K0
0x78060001, // 0001 JMPF R1 #0004
0x80040000, // 0002 RET 1 R0
0x70020000, // 0003 JMP #0005
0x80060000, // 0004 RET 1 K0
0x80000000, // 0005 RET 0
})
),
}),
1, /* has constants */
( &(const bvalue[35]) { /* constants */
/* K0 */ be_nested_str(lv),
/* K1 */ be_nested_str(obj_event_base),
/* K2 */ be_nested_str(RES_OK),
/* K3 */ be_nested_str(code),
/* K4 */ be_nested_str(math),
/* K5 */ be_nested_str(get_height),
/* K6 */ be_nested_str(get_width),
/* K7 */ be_const_int(2),
/* K8 */ be_const_int(3),
/* K9 */ be_nested_str(EVENT_DRAW_MAIN),
/* K10 */ be_nested_str(draw_ctx),
/* K11 */ be_nested_str(param),
/* K12 */ be_nested_str(get_coords),
/* K13 */ be_nested_str(area),
/* K14 */ be_nested_str(x1),
/* K15 */ be_nested_str(y1),
/* K16 */ be_nested_str(draw_arc_dsc_init),
/* K17 */ be_nested_str(arc_dsc),
/* K18 */ be_nested_str(init_draw_arc_dsc),
/* K19 */ be_nested_str(PART_MAIN),
/* K20 */ be_nested_str(rounded),
/* K21 */ be_const_int(1),
/* K22 */ be_nested_str(width),
/* K23 */ be_nested_str(get_style_line_color),
/* K24 */ be_nested_str(STATE_DEFAULT),
/* K25 */ be_nested_str(get_style_bg_color),
/* K26 */ be_nested_str(deg),
/* K27 */ be_nested_str(acos),
/* K28 */ be_nested_str(p1),
/* K29 */ be_nested_str(x),
/* K30 */ be_nested_str(y),
/* K31 */ be_nested_str(color),
/* K32 */ be_nested_str(percentage),
/* K33 */ be_nested_str(draw_arc),
/* K34 */ be_const_int(0),
}),
&be_const_str_widget_event,
&be_const_str_solidified,
( &(const binstruction[171]) { /* code */
0xB80E0000, // 0000 GETNGBL R3 K0
0x8C0C0701, // 0001 GETMET R3 R3 K1
0x5C140200, // 0002 MOVE R5 R1
0x5C180400, // 0003 MOVE R6 R2
0x7C0C0600, // 0004 CALL R3 3
0xB8120000, // 0005 GETNGBL R4 K0
0x88100902, // 0006 GETMBR R4 R4 K2
0x200C0604, // 0007 NE R3 R3 R4
0x780E0000, // 0008 JMPF R3 #000A
0x80000600, // 0009 RET 0
0x880C0503, // 000A GETMBR R3 R2 K3
0xA4120800, // 000B IMPORT R4 K4
0x84140000, // 000C CLOSURE R5 P0
0x8C180105, // 000D GETMET R6 R0 K5
0x7C180200, // 000E CALL R6 1
0x8C1C0106, // 000F GETMET R7 R0 K6
0x7C1C0200, // 0010 CALL R7 1
0x5C200A00, // 0011 MOVE R8 R5
0x54260007, // 0012 LDINT R9 8
0x0C240C09, // 0013 DIV R9 R6 R9
0x7C200200, // 0014 CALL R8 1
0x5C240A00, // 0015 MOVE R9 R5
0x08281107, // 0016 MUL R10 R8 K7
0x04280C0A, // 0017 SUB R10 R6 R10
0x0C281508, // 0018 DIV R10 R10 K8
0x7C240200, // 0019 CALL R9 1
0x0C281307, // 001A DIV R10 R9 K7
0xB82E0000, // 001B GETNGBL R11 K0
0x882C1709, // 001C GETMBR R11 R11 K9
0x1C2C060B, // 001D EQ R11 R3 R11
0x782E008A, // 001E JMPF R11 #00AA
0xB82E0000, // 001F GETNGBL R11 K0
0x8C2C170A, // 0020 GETMET R11 R11 K10
0x8834050B, // 0021 GETMBR R13 R2 K11
0x7C2C0400, // 0022 CALL R11 2
0x8C30010C, // 0023 GETMET R12 R0 K12
0x8838010D, // 0024 GETMBR R14 R0 K13
0x7C300400, // 0025 CALL R12 2
0x8830010D, // 0026 GETMBR R12 R0 K13
0x8830190E, // 0027 GETMBR R12 R12 K14
0x8834010D, // 0028 GETMBR R13 R0 K13
0x88341B0F, // 0029 GETMBR R13 R13 K15
0xB83A0000, // 002A GETNGBL R14 K0
0x8C381D10, // 002B GETMET R14 R14 K16
0x88400111, // 002C GETMBR R16 R0 K17
0x7C380400, // 002D CALL R14 2
0x8C380112, // 002E GETMET R14 R0 K18
0xB8420000, // 002F GETNGBL R16 K0
0x88402113, // 0030 GETMBR R16 R16 K19
0x88440111, // 0031 GETMBR R17 R0 K17
0x7C380600, // 0032 CALL R14 3
0x88380111, // 0033 GETMBR R14 R0 K17
0x903A2915, // 0034 SETMBR R14 K20 K21
0x88380111, // 0035 GETMBR R14 R0 K17
0x083C1308, // 0036 MUL R15 R9 K8
0x003C1F15, // 0037 ADD R15 R15 K21
0x54420003, // 0038 LDINT R16 4
0x0C3C1E10, // 0039 DIV R15 R15 R16
0x903A2C0F, // 003A SETMBR R14 K22 R15
0x8C380117, // 003B GETMET R14 R0 K23
0xB8420000, // 003C GETNGBL R16 K0
0x88402113, // 003D GETMBR R16 R16 K19
0xB8460000, // 003E GETNGBL R17 K0
0x88442318, // 003F GETMBR R17 R17 K24
0x30402011, // 0040 OR R16 R16 R17
0x7C380400, // 0041 CALL R14 2
0x8C3C0119, // 0042 GETMET R15 R0 K25
0xB8460000, // 0043 GETNGBL R17 K0
0x88442313, // 0044 GETMBR R17 R17 K19
0xB84A0000, // 0045 GETNGBL R18 K0
0x88482518, // 0046 GETMBR R18 R18 K24
0x30442212, // 0047 OR R17 R17 R18
0x7C3C0400, // 0048 CALL R15 2
0x04400C09, // 0049 SUB R16 R6 R9
0x0C440F07, // 004A DIV R17 R7 K7
0x0444220A, // 004B SUB R17 R17 R10
0x60480009, // 004C GETGBL R18 G9
0x544E0059, // 004D LDINT R19 90
0x8C50091A, // 004E GETMET R20 R4 K26
0x8C58091B, // 004F GETMET R22 R4 K27
0x6060000A, // 0050 GETGBL R24 G10
0x5C642200, // 0051 MOVE R25 R17
0x7C600200, // 0052 CALL R24 1
0x6064000A, // 0053 GETGBL R25 G10
0x5C682000, // 0054 MOVE R26 R16
0x7C640200, // 0055 CALL R25 1
0x0C603019, // 0056 DIV R24 R24 R25
0x7C580400, // 0057 CALL R22 2
0x7C500400, // 0058 CALL R20 2
0x044C2614, // 0059 SUB R19 R19 R20
0x7C480200, // 005A CALL R18 1
0x544E002C, // 005B LDINT R19 45
0x244C2413, // 005C GT R19 R18 R19
0x784E0000, // 005D JMPF R19 #005F
0x544A002C, // 005E LDINT R18 45
0x884C011C, // 005F GETMBR R19 R0 K28
0x0C500F07, // 0060 DIV R20 R7 K7
0x00501814, // 0061 ADD R20 R12 R20
0x904E3A14, // 0062 SETMBR R19 K29 R20
0x884C011C, // 0063 GETMBR R19 R0 K28
0x00501A06, // 0064 ADD R20 R13 R6
0x04502915, // 0065 SUB R20 R20 K21
0x0450280A, // 0066 SUB R20 R20 R10
0x904E3C14, // 0067 SETMBR R19 K30 R20
0x884C0111, // 0068 GETMBR R19 R0 K17
0x88500120, // 0069 GETMBR R20 R0 K32
0x54560018, // 006A LDINT R21 25
0x28502815, // 006B GE R20 R20 R21
0x78520001, // 006C JMPF R20 #006F
0x5C501C00, // 006D MOVE R20 R14
0x70020000, // 006E JMP #0070
0x5C501E00, // 006F MOVE R20 R15
0x904E3E14, // 0070 SETMBR R19 K31 R20
0xB84E0000, // 0071 GETNGBL R19 K0
0x8C4C2721, // 0072 GETMET R19 R19 K33
0x5C541600, // 0073 MOVE R21 R11
0x88580111, // 0074 GETMBR R22 R0 K17
0x885C011C, // 0075 GETMBR R23 R0 K28
0x00601208, // 0076 ADD R24 R9 R8
0x08624418, // 0077 MUL R24 K34 R24
0x0060300A, // 0078 ADD R24 R24 R10
0x58640022, // 0079 LDCONST R25 K34
0x546A0167, // 007A LDINT R26 360
0x7C4C0E00, // 007B CALL R19 7
0x884C0111, // 007C GETMBR R19 R0 K17
0x88500120, // 007D GETMBR R20 R0 K32
0x54560031, // 007E LDINT R21 50
0x28502815, // 007F GE R20 R20 R21
0x78520001, // 0080 JMPF R20 #0083
0x5C501C00, // 0081 MOVE R20 R14
0x70020000, // 0082 JMP #0084
0x5C501E00, // 0083 MOVE R20 R15
0x904E3E14, // 0084 SETMBR R19 K31 R20
0xB84E0000, // 0085 GETNGBL R19 K0
0x8C4C2721, // 0086 GETMET R19 R19 K33
0x5C541600, // 0087 MOVE R21 R11
0x88580111, // 0088 GETMBR R22 R0 K17
0x885C011C, // 0089 GETMBR R23 R0 K28
0x00601208, // 008A ADD R24 R9 R8
0x08622A18, // 008B MUL R24 K21 R24
0x0060300A, // 008C ADD R24 R24 R10
0x04603115, // 008D SUB R24 R24 K21
0x5466010D, // 008E LDINT R25 270
0x04643212, // 008F SUB R25 R25 R18
0x546A010D, // 0090 LDINT R26 270
0x00683412, // 0091 ADD R26 R26 R18
0x7C4C0E00, // 0092 CALL R19 7
0x884C0111, // 0093 GETMBR R19 R0 K17
0x88500120, // 0094 GETMBR R20 R0 K32
0x5456004A, // 0095 LDINT R21 75
0x28502815, // 0096 GE R20 R20 R21
0x78520001, // 0097 JMPF R20 #009A
0x5C501C00, // 0098 MOVE R20 R14
0x70020000, // 0099 JMP #009B
0x5C501E00, // 009A MOVE R20 R15
0x904E3E14, // 009B SETMBR R19 K31 R20
0xB84E0000, // 009C GETNGBL R19 K0
0x8C4C2721, // 009D GETMET R19 R19 K33
0x5C541600, // 009E MOVE R21 R11
0x88580111, // 009F GETMBR R22 R0 K17
0x885C011C, // 00A0 GETMBR R23 R0 K28
0x00601208, // 00A1 ADD R24 R9 R8
0x08620E18, // 00A2 MUL R24 K7 R24
0x0060300A, // 00A3 ADD R24 R24 R10
0x04603107, // 00A4 SUB R24 R24 K7
0x5466010D, // 00A5 LDINT R25 270
0x04643212, // 00A6 SUB R25 R25 R18
0x546A010D, // 00A7 LDINT R26 270
0x00683412, // 00A8 ADD R26 R26 R18
0x7C4C0E00, // 00A9 CALL R19 7
0x80000000, // 00AA RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: get_percentage
********************************************************************/
be_local_closure(lv_signal_arcs_get_percentage, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str(percentage),
}),
&be_const_str_get_percentage,
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x80040200, // 0001 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_signal_arcs
********************************************************************/
extern const bclass be_class_lv_obj;
be_local_class(lv_signal_arcs,
5,
&be_class_lv_obj,
be_nested_map(9,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(percentage, -1), be_const_var(0) },
{ be_const_key(area, 4), be_const_var(3) },
{ be_const_key(p2, -1), be_const_var(2) },
{ be_const_key(get_percentage, -1), be_const_closure(lv_signal_arcs_get_percentage_closure) },
{ be_const_key(p1, -1), be_const_var(1) },
{ be_const_key(arc_dsc, -1), be_const_var(4) },
{ be_const_key(init, 5), be_const_closure(lv_signal_arcs_init_closure) },
{ be_const_key(widget_event, -1), be_const_closure(lv_signal_arcs_widget_event_closure) },
{ be_const_key(set_percentage, 3), be_const_closure(lv_signal_arcs_set_percentage_closure) },
})),
be_str_literal("lv_signal_arcs")
);
/*******************************************************************/
void be_load_lv_signal_arcs_class(bvm *vm) {
be_pushntvclass(vm, &be_class_lv_signal_arcs);
be_setglobal(vm, "lv_signal_arcs");
be_pop(vm, 1);
}
#endif // USE_LVGL

View File

@ -1,393 +0,0 @@
/********************************************************************
* Tasmota LVGL lv_signal_bars widget
*******************************************************************/
#include "be_constobj.h"
#ifdef USE_LVGL
#include "lvgl.h"
/********************************************************************
** Solidified function: set_percentage
********************************************************************/
be_local_closure(lv_signal_bars_set_percentage, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str(percentage),
/* K1 */ be_const_int(0),
/* K2 */ be_nested_str(invalidate),
}),
&be_const_str_set_percentage,
&be_const_str_solidified,
( &(const binstruction[18]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x540E0013, // 0001 LDINT R3 20
0x0C080403, // 0002 DIV R2 R2 R3
0x540E0063, // 0003 LDINT R3 100
0x240C0203, // 0004 GT R3 R1 R3
0x780E0000, // 0005 JMPF R3 #0007
0x54060063, // 0006 LDINT R1 100
0x140C0301, // 0007 LT R3 R1 K1
0x780E0000, // 0008 JMPF R3 #000A
0x58040001, // 0009 LDCONST R1 K1
0x90020001, // 000A SETMBR R0 K0 R1
0x540E0013, // 000B LDINT R3 20
0x0C0C0203, // 000C DIV R3 R1 R3
0x200C0403, // 000D NE R3 R2 R3
0x780E0001, // 000E JMPF R3 #0011
0x8C0C0102, // 000F GETMET R3 R0 K2
0x7C0C0200, // 0010 CALL R3 1
0x80000000, // 0011 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(lv_signal_bars_init, /* name */
be_nested_proto(
6, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[10]) { /* constants */
/* K0 */ be_nested_str(_lvgl),
/* K1 */ be_nested_str(create_custom_widget),
/* K2 */ be_nested_str(percentage),
/* K3 */ be_nested_str(p1),
/* K4 */ be_nested_str(lv),
/* K5 */ be_nested_str(point),
/* K6 */ be_nested_str(p2),
/* K7 */ be_nested_str(area),
/* K8 */ be_nested_str(line_dsc),
/* K9 */ be_nested_str(draw_line_dsc),
}),
&be_const_str_init,
&be_const_str_solidified,
( &(const binstruction[24]) { /* code */
0xB80A0000, // 0000 GETNGBL R2 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100000, // 0002 MOVE R4 R0
0x5C140200, // 0003 MOVE R5 R1
0x7C080600, // 0004 CALL R2 3
0x540A0063, // 0005 LDINT R2 100
0x90020402, // 0006 SETMBR R0 K2 R2
0xB80A0800, // 0007 GETNGBL R2 K4
0x8C080505, // 0008 GETMET R2 R2 K5
0x7C080200, // 0009 CALL R2 1
0x90020602, // 000A SETMBR R0 K3 R2
0xB80A0800, // 000B GETNGBL R2 K4
0x8C080505, // 000C GETMET R2 R2 K5
0x7C080200, // 000D CALL R2 1
0x90020C02, // 000E SETMBR R0 K6 R2
0xB80A0800, // 000F GETNGBL R2 K4
0x8C080507, // 0010 GETMET R2 R2 K7
0x7C080200, // 0011 CALL R2 1
0x90020E02, // 0012 SETMBR R0 K7 R2
0xB80A0800, // 0013 GETNGBL R2 K4
0x8C080509, // 0014 GETMET R2 R2 K9
0x7C080200, // 0015 CALL R2 1
0x90021002, // 0016 SETMBR R0 K8 R2
0x80000000, // 0017 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: widget_event
********************************************************************/
be_local_closure(lv_signal_bars_widget_event, /* name */
be_nested_proto(
23, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
1, /* has sup protos */
( &(const struct bproto*[ 1]) {
be_nested_proto(
2, /* nstack */
1, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_const_int(1),
}),
&be_const_str_atleast1,
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
0x28040100, // 0000 GE R1 R0 K0
0x78060001, // 0001 JMPF R1 #0004
0x80040000, // 0002 RET 1 R0
0x70020000, // 0003 JMP #0005
0x80060000, // 0004 RET 1 K0
0x80000000, // 0005 RET 0
})
),
}),
1, /* has constants */
( &(const bvalue[38]) { /* constants */
/* K0 */ be_nested_str(lv),
/* K1 */ be_nested_str(obj_event_base),
/* K2 */ be_nested_str(RES_OK),
/* K3 */ be_nested_str(code),
/* K4 */ be_nested_str(get_height),
/* K5 */ be_nested_str(get_width),
/* K6 */ be_const_int(3),
/* K7 */ be_const_int(2),
/* K8 */ be_nested_str(EVENT_DRAW_MAIN),
/* K9 */ be_nested_str(draw_ctx),
/* K10 */ be_nested_str(param),
/* K11 */ be_nested_str(get_coords),
/* K12 */ be_nested_str(area),
/* K13 */ be_nested_str(x1),
/* K14 */ be_nested_str(y1),
/* K15 */ be_nested_str(draw_line_dsc_init),
/* K16 */ be_nested_str(line_dsc),
/* K17 */ be_nested_str(init_draw_line_dsc),
/* K18 */ be_nested_str(PART_MAIN),
/* K19 */ be_nested_str(round_start),
/* K20 */ be_const_int(1),
/* K21 */ be_nested_str(round_end),
/* K22 */ be_nested_str(width),
/* K23 */ be_nested_str(get_style_line_color),
/* K24 */ be_nested_str(STATE_DEFAULT),
/* K25 */ be_nested_str(get_style_bg_color),
/* K26 */ be_nested_str(event_send),
/* K27 */ be_nested_str(EVENT_DRAW_PART_BEGIN),
/* K28 */ be_const_int(0),
/* K29 */ be_nested_str(color),
/* K30 */ be_nested_str(percentage),
/* K31 */ be_nested_str(p1),
/* K32 */ be_nested_str(y),
/* K33 */ be_nested_str(x),
/* K34 */ be_nested_str(p2),
/* K35 */ be_nested_str(draw_line),
/* K36 */ be_nested_str(stop_iteration),
/* K37 */ be_nested_str(EVENT_DRAW_PART_END),
}),
&be_const_str_widget_event,
&be_const_str_solidified,
( &(const binstruction[138]) { /* code */
0xB80E0000, // 0000 GETNGBL R3 K0
0x8C0C0701, // 0001 GETMET R3 R3 K1
0x5C140200, // 0002 MOVE R5 R1
0x5C180400, // 0003 MOVE R6 R2
0x7C0C0600, // 0004 CALL R3 3
0xB8120000, // 0005 GETNGBL R4 K0
0x88100902, // 0006 GETMBR R4 R4 K2
0x200C0604, // 0007 NE R3 R3 R4
0x780E0000, // 0008 JMPF R3 #000A
0x80000600, // 0009 RET 0
0x880C0503, // 000A GETMBR R3 R2 K3
0x84100000, // 000B CLOSURE R4 P0
0x8C140104, // 000C GETMET R5 R0 K4
0x7C140200, // 000D CALL R5 1
0x8C180105, // 000E GETMET R6 R0 K5
0x7C180200, // 000F CALL R6 1
0x5C1C0800, // 0010 MOVE R7 R4
0x5422000E, // 0011 LDINT R8 15
0x0C200C08, // 0012 DIV R8 R6 R8
0x7C1C0200, // 0013 CALL R7 1
0x5C200800, // 0014 MOVE R8 R4
0x08240F06, // 0015 MUL R9 R7 K6
0x04240C09, // 0016 SUB R9 R6 R9
0x542A0003, // 0017 LDINT R10 4
0x0C24120A, // 0018 DIV R9 R9 R10
0x7C200200, // 0019 CALL R8 1
0x0C241107, // 001A DIV R9 R8 K7
0xB82A0000, // 001B GETNGBL R10 K0
0x88281508, // 001C GETMBR R10 R10 K8
0x1C28060A, // 001D EQ R10 R3 R10
0x782A0069, // 001E JMPF R10 #0089
0xB82A0000, // 001F GETNGBL R10 K0
0x8C281509, // 0020 GETMET R10 R10 K9
0x8830050A, // 0021 GETMBR R12 R2 K10
0x7C280400, // 0022 CALL R10 2
0x8C2C010B, // 0023 GETMET R11 R0 K11
0x8834010C, // 0024 GETMBR R13 R0 K12
0x7C2C0400, // 0025 CALL R11 2
0x882C010C, // 0026 GETMBR R11 R0 K12
0x882C170D, // 0027 GETMBR R11 R11 K13
0x8830010C, // 0028 GETMBR R12 R0 K12
0x8830190E, // 0029 GETMBR R12 R12 K14
0xB8360000, // 002A GETNGBL R13 K0
0x8C341B0F, // 002B GETMET R13 R13 K15
0x883C0110, // 002C GETMBR R15 R0 K16
0x7C340400, // 002D CALL R13 2
0x8C340111, // 002E GETMET R13 R0 K17
0xB83E0000, // 002F GETNGBL R15 K0
0x883C1F12, // 0030 GETMBR R15 R15 K18
0x88400110, // 0031 GETMBR R16 R0 K16
0x7C340600, // 0032 CALL R13 3
0x88340110, // 0033 GETMBR R13 R0 K16
0x90362714, // 0034 SETMBR R13 K19 K20
0x88340110, // 0035 GETMBR R13 R0 K16
0x90362B14, // 0036 SETMBR R13 K21 K20
0x88340110, // 0037 GETMBR R13 R0 K16
0x90362C08, // 0038 SETMBR R13 K22 R8
0x8C340117, // 0039 GETMET R13 R0 K23
0xB83E0000, // 003A GETNGBL R15 K0
0x883C1F12, // 003B GETMBR R15 R15 K18
0xB8420000, // 003C GETNGBL R16 K0
0x88402118, // 003D GETMBR R16 R16 K24
0x303C1E10, // 003E OR R15 R15 R16
0x7C340400, // 003F CALL R13 2
0x8C380119, // 0040 GETMET R14 R0 K25
0xB8420000, // 0041 GETNGBL R16 K0
0x88402112, // 0042 GETMBR R16 R16 K18
0xB8460000, // 0043 GETNGBL R17 K0
0x88442318, // 0044 GETMBR R17 R17 K24
0x30402011, // 0045 OR R16 R16 R17
0x7C380400, // 0046 CALL R14 2
0xB83E0000, // 0047 GETNGBL R15 K0
0x8C3C1F1A, // 0048 GETMET R15 R15 K26
0x5C440000, // 0049 MOVE R17 R0
0xB84A0000, // 004A GETNGBL R18 K0
0x8848251B, // 004B GETMBR R18 R18 K27
0x884C0110, // 004C GETMBR R19 R0 K16
0x7C3C0800, // 004D CALL R15 4
0x603C0010, // 004E GETGBL R15 G16
0x40423906, // 004F CONNECT R16 K28 K6
0x7C3C0200, // 0050 CALL R15 1
0xA802002C, // 0051 EXBLK 0 #007F
0x5C401E00, // 0052 MOVE R16 R15
0x7C400000, // 0053 CALL R16 0
0x88440110, // 0054 GETMBR R17 R0 K16
0x8848011E, // 0055 GETMBR R18 R0 K30
0x004C2114, // 0056 ADD R19 R16 K20
0x54520013, // 0057 LDINT R20 20
0x084C2614, // 0058 MUL R19 R19 R20
0x28482413, // 0059 GE R18 R18 R19
0x784A0001, // 005A JMPF R18 #005D
0x5C481A00, // 005B MOVE R18 R13
0x70020000, // 005C JMP #005E
0x5C481C00, // 005D MOVE R18 R14
0x90463A12, // 005E SETMBR R17 K29 R18
0x8844011F, // 005F GETMBR R17 R0 K31
0x00481805, // 0060 ADD R18 R12 R5
0x04482514, // 0061 SUB R18 R18 K20
0x04482409, // 0062 SUB R18 R18 R9
0x90464012, // 0063 SETMBR R17 K32 R18
0x8844011F, // 0064 GETMBR R17 R0 K31
0x00481007, // 0065 ADD R18 R8 R7
0x08482012, // 0066 MUL R18 R16 R18
0x00481612, // 0067 ADD R18 R11 R18
0x00482409, // 0068 ADD R18 R18 R9
0x90464212, // 0069 SETMBR R17 K33 R18
0x88440122, // 006A GETMBR R17 R0 K34
0x044A0C10, // 006B SUB R18 K6 R16
0x044C0A08, // 006C SUB R19 R5 R8
0x08482413, // 006D MUL R18 R18 R19
0x544E0003, // 006E LDINT R19 4
0x0C482413, // 006F DIV R18 R18 R19
0x00481812, // 0070 ADD R18 R12 R18
0x00482409, // 0071 ADD R18 R18 R9
0x90464012, // 0072 SETMBR R17 K32 R18
0x88440122, // 0073 GETMBR R17 R0 K34
0x8848011F, // 0074 GETMBR R18 R0 K31
0x88482521, // 0075 GETMBR R18 R18 K33
0x90464212, // 0076 SETMBR R17 K33 R18
0xB8460000, // 0077 GETNGBL R17 K0
0x8C442323, // 0078 GETMET R17 R17 K35
0x5C4C1400, // 0079 MOVE R19 R10
0x88500110, // 007A GETMBR R20 R0 K16
0x8854011F, // 007B GETMBR R21 R0 K31
0x88580122, // 007C GETMBR R22 R0 K34
0x7C440A00, // 007D CALL R17 5
0x7001FFD2, // 007E JMP #0052
0x583C0024, // 007F LDCONST R15 K36
0xAC3C0200, // 0080 CATCH R15 1 0
0xB0080000, // 0081 RAISE 2 R0 R0
0xB83E0000, // 0082 GETNGBL R15 K0
0x8C3C1F1A, // 0083 GETMET R15 R15 K26
0x5C440000, // 0084 MOVE R17 R0
0xB84A0000, // 0085 GETNGBL R18 K0
0x88482525, // 0086 GETMBR R18 R18 K37
0x884C0110, // 0087 GETMBR R19 R0 K16
0x7C3C0800, // 0088 CALL R15 4
0x80000000, // 0089 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: get_percentage
********************************************************************/
be_local_closure(lv_signal_bars_get_percentage, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str(percentage),
}),
&be_const_str_get_percentage,
&be_const_str_solidified,
( &(const binstruction[ 2]) { /* code */
0x88040100, // 0000 GETMBR R1 R0 K0
0x80040200, // 0001 RET 1 R1
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_signal_bars
********************************************************************/
extern const bclass be_class_lv_obj;
be_local_class(lv_signal_bars,
5,
&be_class_lv_obj,
be_nested_map(9,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(percentage, 4), be_const_var(0) },
{ be_const_key(p1, 5), be_const_var(1) },
{ be_const_key(p2, -1), be_const_var(2) },
{ be_const_key(get_percentage, -1), be_const_closure(lv_signal_bars_get_percentage_closure) },
{ be_const_key(line_dsc, -1), be_const_var(4) },
{ be_const_key(area, -1), be_const_var(3) },
{ be_const_key(init, -1), be_const_closure(lv_signal_bars_init_closure) },
{ be_const_key(widget_event, -1), be_const_closure(lv_signal_bars_widget_event_closure) },
{ be_const_key(set_percentage, 3), be_const_closure(lv_signal_bars_set_percentage_closure) },
})),
be_str_literal("lv_signal_bars")
);
/*******************************************************************/
void be_load_lv_signal_bars_class(bvm *vm) {
be_pushntvclass(vm, &be_class_lv_signal_bars);
be_setglobal(vm, "lv_signal_bars");
be_pop(vm, 1);
}
#endif // USE_LVGL

View File

@ -1,140 +0,0 @@
/********************************************************************
* Tasmota LVGL lv_signal_bars widget
*******************************************************************/
#include "be_constobj.h"
#ifdef USE_LVGL
#include "lvgl.h"
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(lv_wifi_arcs_icon_init, /* name */
be_nested_proto(
10, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[18]) { /* constants */
/* K0 */ be_nested_str(init),
/* K1 */ be_nested_str(set_style_line_color),
/* K2 */ be_nested_str(lv),
/* K3 */ be_nested_str(color),
/* K4 */ be_nested_str(COLOR_WHITE),
/* K5 */ be_nested_str(PART_MAIN),
/* K6 */ be_nested_str(STATE_DEFAULT),
/* K7 */ be_nested_str(set_style_bg_color),
/* K8 */ be_nested_str(COLOR_BLACK),
/* K9 */ be_nested_str(get_height),
/* K10 */ be_nested_str(get_style_pad_right),
/* K11 */ be_nested_str(set_height),
/* K12 */ be_const_int(3),
/* K13 */ be_nested_str(set_width),
/* K14 */ be_nested_str(set_x),
/* K15 */ be_nested_str(get_width),
/* K16 */ be_nested_str(set_style_pad_right),
/* K17 */ be_const_int(1),
}),
&be_const_str_init,
&be_const_str_solidified,
( &(const binstruction[67]) { /* code */
0x60080003, // 0000 GETGBL R2 G3
0x5C0C0000, // 0001 MOVE R3 R0
0x7C080200, // 0002 CALL R2 1
0x8C080500, // 0003 GETMET R2 R2 K0
0x5C100200, // 0004 MOVE R4 R1
0x7C080400, // 0005 CALL R2 2
0x8C080101, // 0006 GETMET R2 R0 K1
0xB8120400, // 0007 GETNGBL R4 K2
0x8C100903, // 0008 GETMET R4 R4 K3
0xB81A0400, // 0009 GETNGBL R6 K2
0x88180D04, // 000A GETMBR R6 R6 K4
0x7C100400, // 000B CALL R4 2
0xB8160400, // 000C GETNGBL R5 K2
0x88140B05, // 000D GETMBR R5 R5 K5
0xB81A0400, // 000E GETNGBL R6 K2
0x88180D06, // 000F GETMBR R6 R6 K6
0x30140A06, // 0010 OR R5 R5 R6
0x7C080600, // 0011 CALL R2 3
0x8C080107, // 0012 GETMET R2 R0 K7
0xB8120400, // 0013 GETNGBL R4 K2
0x8C100903, // 0014 GETMET R4 R4 K3
0xB81A0400, // 0015 GETNGBL R6 K2
0x88180D08, // 0016 GETMBR R6 R6 K8
0x7C100400, // 0017 CALL R4 2
0xB8160400, // 0018 GETNGBL R5 K2
0x88140B05, // 0019 GETMBR R5 R5 K5
0xB81A0400, // 001A GETNGBL R6 K2
0x88180D06, // 001B GETMBR R6 R6 K6
0x30140A06, // 001C OR R5 R5 R6
0x7C080600, // 001D CALL R2 3
0x4C080000, // 001E LDNIL R2
0x20080202, // 001F NE R2 R1 R2
0x780A0020, // 0020 JMPF R2 #0042
0x8C080309, // 0021 GETMET R2 R1 K9
0x7C080200, // 0022 CALL R2 1
0x8C0C030A, // 0023 GETMET R3 R1 K10
0xB8160400, // 0024 GETNGBL R5 K2
0x88140B05, // 0025 GETMBR R5 R5 K5
0xB81A0400, // 0026 GETNGBL R6 K2
0x88180D06, // 0027 GETMBR R6 R6 K6
0x30140A06, // 0028 OR R5 R5 R6
0x7C0C0400, // 0029 CALL R3 2
0x8C10010B, // 002A GETMET R4 R0 K11
0x5C180400, // 002B MOVE R6 R2
0x7C100400, // 002C CALL R4 2
0x54120003, // 002D LDINT R4 4
0x08100404, // 002E MUL R4 R2 R4
0x0C10090C, // 002F DIV R4 R4 K12
0x8C14010D, // 0030 GETMET R5 R0 K13
0x5C1C0800, // 0031 MOVE R7 R4
0x7C140400, // 0032 CALL R5 2
0x8C14010E, // 0033 GETMET R5 R0 K14
0x8C1C030F, // 0034 GETMET R7 R1 K15
0x7C1C0200, // 0035 CALL R7 1
0x041C0E04, // 0036 SUB R7 R7 R4
0x041C0E03, // 0037 SUB R7 R7 R3
0x7C140400, // 0038 CALL R5 2
0x8C140310, // 0039 GETMET R5 R1 K16
0x001C0604, // 003A ADD R7 R3 R4
0x001C0F11, // 003B ADD R7 R7 K17
0xB8220400, // 003C GETNGBL R8 K2
0x88201105, // 003D GETMBR R8 R8 K5
0xB8260400, // 003E GETNGBL R9 K2
0x88241306, // 003F GETMBR R9 R9 K6
0x30201009, // 0040 OR R8 R8 R9
0x7C140600, // 0041 CALL R5 3
0x80000000, // 0042 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_wifi_arcs_icon
********************************************************************/
extern const bclass be_class_lv_wifi_arcs;
be_local_class(lv_wifi_arcs_icon,
0,
&be_class_lv_wifi_arcs,
be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(init, -1), be_const_closure(lv_wifi_arcs_icon_init_closure) },
})),
be_str_literal("lv_wifi_arcs_icon")
);
/*******************************************************************/
void be_load_lv_wifi_arcs_icon_class(bvm *vm) {
be_pushntvclass(vm, &be_class_lv_wifi_arcs_icon);
be_setglobal(vm, "lv_wifi_arcs_icon");
be_pop(vm, 1);
}
#endif // USE_LVGL

View File

@ -1,161 +0,0 @@
/********************************************************************
* Tasmota LVGL lv_signal_bars widget
*******************************************************************/
#include "be_constobj.h"
#ifdef USE_LVGL
#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
********************************************************************/
be_local_closure(lv_wifi_arcs_every_second, /* name */
be_nested_proto(
7, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str(tasmota),
/* K1 */ be_nested_str(wifi),
/* K2 */ be_nested_str(find),
/* K3 */ be_nested_str(quality),
/* K4 */ be_nested_str(ip),
/* K5 */ be_nested_str(set_percentage),
/* K6 */ be_const_int(0),
}),
&be_const_str_every_second,
&be_const_str_solidified,
( &(const binstruction[23]) { /* code */
0xB8060000, // 0000 GETNGBL R1 K0
0x8C040301, // 0001 GETMET R1 R1 K1
0x7C040200, // 0002 CALL R1 1
0x8C080302, // 0003 GETMET R2 R1 K2
0x58100003, // 0004 LDCONST R4 K3
0x7C080400, // 0005 CALL R2 2
0x8C0C0302, // 0006 GETMET R3 R1 K2
0x58140004, // 0007 LDCONST R5 K4
0x7C0C0400, // 0008 CALL R3 2
0x4C100000, // 0009 LDNIL R4
0x1C100604, // 000A EQ R4 R3 R4
0x78120003, // 000B JMPF R4 #0010
0x8C100105, // 000C GETMET R4 R0 K5
0x58180006, // 000D LDCONST R6 K6
0x7C100400, // 000E CALL R4 2
0x70020005, // 000F JMP #0016
0x4C100000, // 0010 LDNIL R4
0x20100404, // 0011 NE R4 R2 R4
0x78120002, // 0012 JMPF R4 #0016
0x8C100105, // 0013 GETMET R4 R0 K5
0x5C180400, // 0014 MOVE R6 R2
0x7C100400, // 0015 CALL R4 2
0x80000000, // 0016 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_wifi_arcs
********************************************************************/
extern const bclass be_class_lv_signal_arcs;
be_local_class(lv_wifi_arcs,
0,
&be_class_lv_signal_arcs,
be_nested_map(3,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(before_del, 1), be_const_closure(lv_wifi_arcs_before_del_closure) },
{ be_const_key(every_second, 2), be_const_closure(lv_wifi_arcs_every_second_closure) },
{ be_const_key(init, -1), be_const_closure(lv_wifi_arcs_init_closure) },
})),
be_str_literal("lv_wifi_arcs")
);
/*******************************************************************/
void be_load_lv_wifi_arcs_class(bvm *vm) {
be_pushntvclass(vm, &be_class_lv_wifi_arcs);
be_setglobal(vm, "lv_wifi_arcs");
be_pop(vm, 1);
}
#endif // USE_LVGL

View File

@ -1,136 +0,0 @@
/********************************************************************
* Tasmota LVGL lv_signal_bars widget
*******************************************************************/
#include "be_constobj.h"
#ifdef USE_LVGL
#include "lvgl.h"
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(lv_wifi_bars_icon_init, /* name */
be_nested_proto(
9, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[17]) { /* constants */
/* K0 */ be_nested_str(init),
/* K1 */ be_nested_str(set_style_line_color),
/* K2 */ be_nested_str(lv),
/* K3 */ be_nested_str(color),
/* K4 */ be_nested_str(COLOR_WHITE),
/* K5 */ be_nested_str(PART_MAIN),
/* K6 */ be_nested_str(STATE_DEFAULT),
/* K7 */ be_nested_str(set_style_bg_color),
/* K8 */ be_nested_str(COLOR_BLACK),
/* K9 */ be_nested_str(get_height),
/* K10 */ be_nested_str(get_style_pad_right),
/* K11 */ be_nested_str(set_height),
/* K12 */ be_nested_str(set_width),
/* K13 */ be_nested_str(set_x),
/* K14 */ be_nested_str(get_width),
/* K15 */ be_nested_str(set_style_pad_right),
/* K16 */ be_const_int(1),
}),
&be_const_str_init,
&be_const_str_solidified,
( &(const binstruction[64]) { /* code */
0x60080003, // 0000 GETGBL R2 G3
0x5C0C0000, // 0001 MOVE R3 R0
0x7C080200, // 0002 CALL R2 1
0x8C080500, // 0003 GETMET R2 R2 K0
0x5C100200, // 0004 MOVE R4 R1
0x7C080400, // 0005 CALL R2 2
0x8C080101, // 0006 GETMET R2 R0 K1
0xB8120400, // 0007 GETNGBL R4 K2
0x8C100903, // 0008 GETMET R4 R4 K3
0xB81A0400, // 0009 GETNGBL R6 K2
0x88180D04, // 000A GETMBR R6 R6 K4
0x7C100400, // 000B CALL R4 2
0xB8160400, // 000C GETNGBL R5 K2
0x88140B05, // 000D GETMBR R5 R5 K5
0xB81A0400, // 000E GETNGBL R6 K2
0x88180D06, // 000F GETMBR R6 R6 K6
0x30140A06, // 0010 OR R5 R5 R6
0x7C080600, // 0011 CALL R2 3
0x8C080107, // 0012 GETMET R2 R0 K7
0xB8120400, // 0013 GETNGBL R4 K2
0x8C100903, // 0014 GETMET R4 R4 K3
0xB81A0400, // 0015 GETNGBL R6 K2
0x88180D08, // 0016 GETMBR R6 R6 K8
0x7C100400, // 0017 CALL R4 2
0xB8160400, // 0018 GETNGBL R5 K2
0x88140B05, // 0019 GETMBR R5 R5 K5
0xB81A0400, // 001A GETNGBL R6 K2
0x88180D06, // 001B GETMBR R6 R6 K6
0x30140A06, // 001C OR R5 R5 R6
0x7C080600, // 001D CALL R2 3
0x4C080000, // 001E LDNIL R2
0x20080202, // 001F NE R2 R1 R2
0x780A001D, // 0020 JMPF R2 #003F
0x8C080309, // 0021 GETMET R2 R1 K9
0x7C080200, // 0022 CALL R2 1
0x8C0C030A, // 0023 GETMET R3 R1 K10
0xB8160400, // 0024 GETNGBL R5 K2
0x88140B05, // 0025 GETMBR R5 R5 K5
0xB81A0400, // 0026 GETNGBL R6 K2
0x88180D06, // 0027 GETMBR R6 R6 K6
0x30140A06, // 0028 OR R5 R5 R6
0x7C0C0400, // 0029 CALL R3 2
0x8C10010B, // 002A GETMET R4 R0 K11
0x5C180400, // 002B MOVE R6 R2
0x7C100400, // 002C CALL R4 2
0x8C10010C, // 002D GETMET R4 R0 K12
0x5C180400, // 002E MOVE R6 R2
0x7C100400, // 002F CALL R4 2
0x8C10010D, // 0030 GETMET R4 R0 K13
0x8C18030E, // 0031 GETMET R6 R1 K14
0x7C180200, // 0032 CALL R6 1
0x04180C02, // 0033 SUB R6 R6 R2
0x04180C03, // 0034 SUB R6 R6 R3
0x7C100400, // 0035 CALL R4 2
0x8C10030F, // 0036 GETMET R4 R1 K15
0x00180602, // 0037 ADD R6 R3 R2
0x00180D10, // 0038 ADD R6 R6 K16
0xB81E0400, // 0039 GETNGBL R7 K2
0x881C0F05, // 003A GETMBR R7 R7 K5
0xB8220400, // 003B GETNGBL R8 K2
0x88201106, // 003C GETMBR R8 R8 K6
0x301C0E08, // 003D OR R7 R7 R8
0x7C100600, // 003E CALL R4 3
0x80000000, // 003F RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_wifi_bars_icon
********************************************************************/
extern const bclass be_class_lv_wifi_bars;
be_local_class(lv_wifi_bars_icon,
0,
&be_class_lv_wifi_bars,
be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(init, -1), be_const_closure(lv_wifi_bars_icon_init_closure) },
})),
be_str_literal("lv_wifi_bars_icon")
);
/*******************************************************************/
void be_load_lv_wifi_bars_icon_class(bvm *vm) {
be_pushntvclass(vm, &be_class_lv_wifi_bars_icon);
be_setglobal(vm, "lv_wifi_bars_icon");
be_pop(vm, 1);
}
#endif // USE_LVGL

View File

@ -1,161 +0,0 @@
/********************************************************************
* Tasmota LVGL lv_signal_bars widget
*******************************************************************/
#include "be_constobj.h"
#ifdef USE_LVGL
#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
********************************************************************/
be_local_closure(lv_wifi_bars_every_second, /* name */
be_nested_proto(
7, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str(tasmota),
/* K1 */ be_nested_str(wifi),
/* K2 */ be_nested_str(find),
/* K3 */ be_nested_str(quality),
/* K4 */ be_nested_str(ip),
/* K5 */ be_nested_str(set_percentage),
/* K6 */ be_const_int(0),
}),
&be_const_str_every_second,
&be_const_str_solidified,
( &(const binstruction[23]) { /* code */
0xB8060000, // 0000 GETNGBL R1 K0
0x8C040301, // 0001 GETMET R1 R1 K1
0x7C040200, // 0002 CALL R1 1
0x8C080302, // 0003 GETMET R2 R1 K2
0x58100003, // 0004 LDCONST R4 K3
0x7C080400, // 0005 CALL R2 2
0x8C0C0302, // 0006 GETMET R3 R1 K2
0x58140004, // 0007 LDCONST R5 K4
0x7C0C0400, // 0008 CALL R3 2
0x4C100000, // 0009 LDNIL R4
0x1C100604, // 000A EQ R4 R3 R4
0x78120003, // 000B JMPF R4 #0010
0x8C100105, // 000C GETMET R4 R0 K5
0x58180006, // 000D LDCONST R6 K6
0x7C100400, // 000E CALL R4 2
0x70020005, // 000F JMP #0016
0x4C100000, // 0010 LDNIL R4
0x20100404, // 0011 NE R4 R2 R4
0x78120002, // 0012 JMPF R4 #0016
0x8C100105, // 0013 GETMET R4 R0 K5
0x5C180400, // 0014 MOVE R6 R2
0x7C100400, // 0015 CALL R4 2
0x80000000, // 0016 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: lv_wifi_bars
********************************************************************/
extern const bclass be_class_lv_signal_bars;
be_local_class(lv_wifi_bars,
0,
&be_class_lv_signal_bars,
be_nested_map(3,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(before_del, 1), be_const_closure(lv_wifi_bars_before_del_closure) },
{ be_const_key(every_second, 2), be_const_closure(lv_wifi_bars_every_second_closure) },
{ be_const_key(init, -1), be_const_closure(lv_wifi_bars_init_closure) },
})),
be_str_literal("lv_wifi_bars")
);
/*******************************************************************/
void be_load_lv_wifi_bars_class(bvm *vm) {
be_pushntvclass(vm, &be_class_lv_wifi_bars);
be_setglobal(vm, "lv_wifi_bars");
be_pop(vm, 1);
}
#endif // USE_LVGL

View File

@ -28,7 +28,7 @@ extern int b_onewire_search(bvm *vm);
/* @const_object_info_begin
class be_class_OneWire (scope: global, name: OneWire) {
class be_class_OneWire (scope: global, name: OneWire, strings: weak) {
.p, var
init, func(b_onewire_init)

View File

@ -656,7 +656,7 @@ be_local_class(Persist,
{ be_const_key(_dirty, -1), be_const_var(2) },
{ be_const_key(member, -1), be_const_closure(Persist_member_closure) },
})),
be_str_literal("Persist")
be_str_weak(Persist)
);
/********************************************************************

View File

@ -121,7 +121,7 @@ be_local_class(Tapp,
{ be_const_key(autoexec, -1), be_const_closure(Tapp_autoexec_closure) },
{ be_const_key(init, 0), be_const_closure(Tapp_init_closure) },
})),
be_str_literal("Tapp")
be_str_weak(Tapp)
);
/********************************************************************

View File

@ -177,7 +177,7 @@ be_local_class(Trigger,
{ be_const_key(o, -1), be_const_var(3) },
{ be_const_key(init, -1), be_const_closure(Trigger_init_closure) },
})),
be_str_literal("Trigger")
be_str_weak(Trigger)
);
/*******************************************************************/

View File

@ -76,19 +76,19 @@ be_local_closure(zb_device_tostring, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[11]) { /* constants */
/* K0 */ be_nested_str_literal("json"),
/* K1 */ be_nested_str_literal("string"),
/* K2 */ be_nested_str_literal("longaddr"),
/* K3 */ be_nested_str_literal("format"),
/* K4 */ be_nested_str_literal("<instance: %s(0x%04X, 0x%08X%08X, name:'%s', model:'%s', manufacturer:'%s')>"),
/* K5 */ be_nested_str_literal("shortaddr"),
/* K6 */ be_nested_str_literal("get"),
/* K0 */ be_nested_str_weak(json),
/* K1 */ be_nested_str_weak(string),
/* K2 */ be_nested_str_weak(longaddr),
/* K3 */ be_nested_str_weak(format),
/* K4 */ be_nested_str_weak(_X3Cinstance_X3A_X20_X25s_X280x_X2504X_X2C_X200x_X2508X_X2508X_X2C_X20name_X3A_X27_X25s_X27_X2C_X20model_X3A_X27_X25s_X27_X2C_X20manufacturer_X3A_X27_X25s_X27_X29_X3E),
/* K5 */ be_nested_str_weak(shortaddr),
/* K6 */ be_nested_str_weak(get),
/* K7 */ be_const_int(0),
/* K8 */ be_nested_str_literal("name"),
/* K9 */ be_nested_str_literal("model"),
/* K10 */ be_nested_str_literal("manufacturer"),
/* K8 */ be_nested_str_weak(name),
/* K9 */ be_nested_str_weak(model),
/* K10 */ be_nested_str_weak(manufacturer),
}),
be_str_literal("tostring"),
be_str_weak(tostring),
&be_const_str_solidified,
( &(const binstruction[22]) { /* code */
0xA4060000, // 0000 IMPORT R1 K0
@ -143,7 +143,7 @@ BE_FUNC_CTYPE_DECLARE(zfn_set_bytes, "", "-c(bytes)~");
#include "be_fixed_zigbee.h"
/* @const_object_info_begin
class be_class_zb_device (scope: global, name: zb_device) {
class be_class_zb_device (scope: global, name: zb_device, strings: weak) {
_p, var
init, ctype_func(zd_init)
@ -154,7 +154,7 @@ class be_class_zb_device (scope: global, name: zb_device) {
@const_object_info_end */
/* @const_object_info_begin
class be_class_zb_coord_ntv (scope: global, name: zb_coord_ntv) {
class be_class_zb_coord_ntv (scope: global, name: zb_coord_ntv, strings: weak) {
zcl_frame, class(be_class_zcl_frame)
zb_device, class(be_class_zb_device)
@ -169,7 +169,7 @@ class be_class_zb_coord_ntv (scope: global, name: zb_coord_ntv) {
/* @const_object_info_begin
class be_class_zcl_frame_ntv (scope: global, name: zcl_frame_ntv, super: be_class_ctypes_bytes) {
class be_class_zcl_frame_ntv (scope: global, name: zcl_frame_ntv, super: be_class_ctypes_bytes, strings: weak) {
_def, comptr(&be_zigbee_zcl_frame_struct)
_get_bytes, ctype_func(zfn_get_bytes)
@ -178,7 +178,7 @@ class be_class_zcl_frame_ntv (scope: global, name: zcl_frame_ntv, super: be_clas
@const_object_info_end */
/* @const_object_info_begin
module zigbee (scope: global) {
module zigbee (scope: global, strings: weak) {
init, func(zigbee_init)
}
@const_object_info_end */

View File

@ -23,9 +23,9 @@ be_local_closure(zb_coord_init, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_literal("init"),
/* K0 */ be_nested_str_weak(init),
}),
be_str_literal("init"),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
0x60040003, // 0000 GETGBL R1 G3
@ -54,13 +54,13 @@ be_local_closure(zb_coord_add_handler, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str_literal("instance"),
/* K1 */ be_nested_str_literal("value_error"),
/* K2 */ be_nested_str_literal("instance required"),
/* K3 */ be_nested_str_literal("_handlers"),
/* K4 */ be_nested_str_literal("push"),
/* K0 */ be_nested_str_weak(instance),
/* K1 */ be_nested_str_weak(value_error),
/* K2 */ be_nested_str_weak(instance_X20required),
/* K3 */ be_nested_str_weak(_handlers),
/* K4 */ be_nested_str_weak(push),
}),
be_str_literal("add_handler"),
be_str_weak(add_handler),
&be_const_str_solidified,
( &(const binstruction[18]) { /* code */
0x60080004, // 0000 GETGBL R2 G4
@ -101,22 +101,22 @@ be_local_closure(zb_coord_dispatch, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[14]) { /* constants */
/* K0 */ be_nested_str_literal("_handlers"),
/* K1 */ be_nested_str_literal("introspect"),
/* K2 */ be_nested_str_literal("string"),
/* K3 */ be_nested_str_literal("zcl_frame"),
/* K0 */ be_nested_str_weak(_handlers),
/* K1 */ be_nested_str_weak(introspect),
/* K2 */ be_nested_str_weak(string),
/* K3 */ be_nested_str_weak(zcl_frame),
/* K4 */ be_const_int(0),
/* K5 */ be_nested_str_literal("get"),
/* K6 */ be_nested_str_literal("function"),
/* K7 */ be_nested_str_literal("format"),
/* K8 */ be_nested_str_literal("BRY: Exception> '%s' - %s"),
/* K9 */ be_nested_str_literal("tasmota"),
/* K10 */ be_nested_str_literal("_debug_present"),
/* K11 */ be_nested_str_literal("debug"),
/* K12 */ be_nested_str_literal("traceback"),
/* K5 */ be_nested_str_weak(get),
/* K6 */ be_nested_str_weak(function),
/* K7 */ be_nested_str_weak(format),
/* K8 */ be_nested_str_weak(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s),
/* K9 */ be_nested_str_weak(tasmota),
/* K10 */ be_nested_str_weak(_debug_present),
/* K11 */ be_nested_str_weak(debug),
/* K12 */ be_nested_str_weak(traceback),
/* K13 */ be_const_int(1),
}),
be_str_literal("dispatch"),
be_str_weak(dispatch),
&be_const_str_solidified,
( &(const binstruction[61]) { /* code */
0x88140100, // 0000 GETMBR R5 R0 K0
@ -195,12 +195,12 @@ be_local_class(zb_coord,
&be_class_zb_coord_ntv,
be_nested_map(4,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_literal("dispatch", 1), be_const_closure(zb_coord_dispatch_closure) },
{ be_const_key_literal("add_handler", 2), be_const_closure(zb_coord_add_handler_closure) },
{ be_const_key_literal("_handlers", -1), be_const_var(0) },
{ be_const_key_literal("init", 0), be_const_closure(zb_coord_init_closure) },
{ be_const_key_weak(dispatch, 1), be_const_closure(zb_coord_dispatch_closure) },
{ be_const_key_weak(add_handler, 2), be_const_closure(zb_coord_add_handler_closure) },
{ be_const_key_weak(_handlers, -1), be_const_var(0) },
{ be_const_key_weak(init, 0), be_const_closure(zb_coord_init_closure) },
})),
be_str_literal("zb_coord")
be_str_weak(zb_coord)
);
/*******************************************************************/

View File

@ -23,12 +23,12 @@ be_local_closure(zcl_frame_member, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str_literal("payload"),
/* K1 */ be_nested_str_literal("_get_bytes"),
/* K2 */ be_nested_str_literal("payload_ptr"),
/* K3 */ be_nested_str_literal("member"),
/* K0 */ be_nested_str_weak(payload),
/* K1 */ be_nested_str_weak(_get_bytes),
/* K2 */ be_nested_str_weak(payload_ptr),
/* K3 */ be_nested_str_weak(member),
}),
be_str_literal("member"),
be_str_weak(member),
&be_const_str_solidified,
( &(const binstruction[15]) { /* code */
0x1C080300, // 0000 EQ R2 R1 K0
@ -66,12 +66,12 @@ be_local_closure(zcl_frame_setmember, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str_literal("payload"),
/* K1 */ be_nested_str_literal("_set_bytes"),
/* K2 */ be_nested_str_literal("payload_ptr"),
/* K3 */ be_nested_str_literal("setmember"),
/* K0 */ be_nested_str_weak(payload),
/* K1 */ be_nested_str_weak(_set_bytes),
/* K2 */ be_nested_str_weak(payload_ptr),
/* K3 */ be_nested_str_weak(setmember),
}),
be_str_literal("setmember"),
be_str_weak(setmember),
&be_const_str_solidified,
( &(const binstruction[17]) { /* code */
0x1C0C0300, // 0000 EQ R3 R1 K0
@ -111,10 +111,10 @@ be_local_closure(zcl_frame_init, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str_literal("init"),
/* K1 */ be_nested_str_literal("no_bytes"),
/* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(no_bytes),
}),
be_str_literal("init"),
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[10]) { /* code */
0x60080003, // 0000 GETGBL R2 G3
@ -147,15 +147,15 @@ be_local_closure(zcl_frame_tomap, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str_literal("string"),
/* K1 */ be_nested_str_literal("tomap"),
/* K2 */ be_nested_str_literal("shortaddr_hex"),
/* K3 */ be_nested_str_literal("format"),
/* K4 */ be_nested_str_literal("0x%04X"),
/* K5 */ be_nested_str_literal("shortaddr"),
/* K6 */ be_nested_str_literal("payload"),
/* K0 */ be_nested_str_weak(string),
/* K1 */ be_nested_str_weak(tomap),
/* K2 */ be_nested_str_weak(shortaddr_hex),
/* K3 */ be_nested_str_weak(format),
/* K4 */ be_nested_str_weak(0x_X2504X),
/* K5 */ be_nested_str_weak(shortaddr),
/* K6 */ be_nested_str_weak(payload),
}),
be_str_literal("tomap"),
be_str_weak(tomap),
&be_const_str_solidified,
( &(const binstruction[14]) { /* code */
0xA4060000, // 0000 IMPORT R1 K0
@ -192,9 +192,9 @@ be_local_closure(zcl_frame_tostring, /* name */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str_literal("tomap"),
/* K0 */ be_nested_str_weak(tomap),
}),
be_str_literal("tostring"),
be_str_weak(tostring),
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
0x8C040100, // 0000 GETMET R1 R0 K0
@ -218,14 +218,14 @@ be_local_class(zcl_frame,
&be_class_zcl_frame_ntv,
be_nested_map(6,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_literal("no_bytes", -1), be_const_var(0) },
{ be_const_key_literal("member", 2), be_const_closure(zcl_frame_member_closure) },
{ be_const_key_literal("tostring", 5), be_const_closure(zcl_frame_tostring_closure) },
{ be_const_key_literal("init", -1), be_const_closure(zcl_frame_init_closure) },
{ be_const_key_literal("tomap", -1), be_const_closure(zcl_frame_tomap_closure) },
{ be_const_key_literal("setmember", -1), be_const_closure(zcl_frame_setmember_closure) },
{ be_const_key_weak(no_bytes, -1), be_const_var(0) },
{ be_const_key_weak(member, 2), be_const_closure(zcl_frame_member_closure) },
{ be_const_key_weak(tostring, 5), be_const_closure(zcl_frame_tostring_closure) },
{ be_const_key_weak(init, -1), be_const_closure(zcl_frame_init_closure) },
{ be_const_key_weak(tomap, -1), be_const_closure(zcl_frame_tomap_closure) },
{ be_const_key_weak(setmember, -1), be_const_closure(zcl_frame_setmember_closure) },
})),
be_str_literal("zcl_frame")
be_str_weak(zcl_frame)
);
/*******************************************************************/

View File

@ -21,6 +21,7 @@
# 22 : ShiftLeft (rot:int [, first:int, last:int]) -> void
# 23 : ShiftRight (rot:int [, first:int, last:int]) -> void
class Leds_ntv end
class Leds : Leds_ntv
var gamma # if true, apply gamma (true is default)

View File

@ -1,63 +0,0 @@
#- LVGL lv_clock_icon
-
--#
class lv_clock: lv.label
var hour, minute, sec
def init(parent)
super(self).init(parent)
var f_s7_16 = lv.seg7_font(16)
if f_s7_16 != nil self.set_style_text_font(f_s7_16, lv.PART_MAIN | lv.STATE_DEFAULT) end
self.set_text("--:--")
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)
end
def set_time(hour, minute, sec)
import string
if hour != self.hour || minute != self.minute || sec != self.sec
var txt = string.format("%02d%s%02d", hour, sec % 2 ? ":" : " ", minute)
self.hour = hour
self.minute = minute
self.sec = sec
#if txt[0] == '0' txt = '!' .. string.split(txt,1)[1] end # replace first char with '!'
self.set_text(txt)
end
end
def every_second()
var now = tasmota.time_dump(tasmota.rtc()['local'])
if now['year'] != 1970
self.set_time(now['hour'], now['min'], now['sec'])
end
end
def before_del()
tasmota.remove_driver(self)
end
end
class lv_clock_icon: lv_clock
def init(parent)
super(self).init(parent)
if parent != nil
var parent_height = parent.get_height()
self.refr_size()
var w = self.get_width()
self.set_y((parent.get_height() - self.get_height()) / 2) # center vertically
var pad_right = parent.get_style_pad_right(lv.PART_MAIN | lv.STATE_DEFAULT)
self.set_x(parent.get_width() - w - pad_right - 3)
parent.set_style_pad_right(pad_right + w + 6, lv.PART_MAIN | lv.STATE_DEFAULT)
self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT)
end
end
end

View File

@ -1,131 +0,0 @@
#- LVGL lv_signal_bars and lv_wifi_bars
-
--#
class lv_signal_arcs : lv.obj
var percentage # value to display, range 0..100
var p1, p2, area, arc_dsc # instances of objects kept to avoid re-instanciating at each call
def init(parent)
# init custom widget (don't call super constructor)
_lvgl.create_custom_widget(self, parent)
# own values
self.percentage = 100
# pre-allocate buffers
self.p1 = lv.point()
self.p2 = lv.point()
self.area = lv.area()
self.arc_dsc = lv.draw_arc_dsc()
end
def widget_event(cl, event)
# Call the ancestor's event handler
if lv.obj_event_base(cl, event) != lv.RES_OK return end
var code = event.code
import math
def atleast1(x) if x >= 1 return x else return 1 end end
# the model is that we have 4 bars and inter-bar (1/4 of width)
var height = self.get_height()
var width = self.get_width()
var inter_bar = atleast1(height / 8)
var bar = atleast1((height - inter_bar * 2) / 3)
var bar_offset = bar / 2
#print("inter_bar", inter_bar, "bar", bar, "bar_offset", bar_offset)
if code == lv.EVENT_DRAW_MAIN
var draw_ctx = lv.draw_ctx(event.param)
# get coordinates of object
self.get_coords(self.area)
var x_ofs = self.area.x1
var y_ofs = self.area.y1
lv.draw_arc_dsc_init(self.arc_dsc) # initialize lv.draw_line_dsc structure
self.init_draw_arc_dsc(lv.PART_MAIN, self.arc_dsc) # copy the current values
self.arc_dsc.rounded = 1
self.arc_dsc.width = (bar * 3 + 1) / 4
var on_color = self.get_style_line_color(lv.PART_MAIN | lv.STATE_DEFAULT)
var off_color = self.get_style_bg_color(lv.PART_MAIN | lv.STATE_DEFAULT)
# initial calculation, but does not take into account bounding box
# var angle = int(math.deg(math.atan2(width / 2, height)))
# better calculation
var hypotenuse = height - bar # center if at bar/2 from bottom and circle stops at bar/2 from top
var adjacent = width / 2 - bar_offset # stop at bar_offset from side
var angle = int(90 - math.deg(math.acos(real(adjacent) / real(hypotenuse))))
if (angle > 45) angle = 45 end
# print("hypotenuse",hypotenuse,"adjacent",adjacent,"angle",angle)
self.p1.x = x_ofs + width / 2
self.p1.y = y_ofs + height - 1 - bar_offset
self.arc_dsc.color = self.percentage >= 25 ? on_color : off_color
lv.draw_arc(draw_ctx, self.arc_dsc, self.p1, 0 * (bar + inter_bar) + bar_offset, 0, 360)
self.arc_dsc.color = self.percentage >= 50 ? on_color : off_color
lv.draw_arc(draw_ctx, self.arc_dsc, self.p1, 1 * (bar + inter_bar) + bar_offset - 1, 270 - angle, 270 + angle)
self.arc_dsc.color = self.percentage >= 75 ? on_color : off_color
lv.draw_arc(draw_ctx, self.arc_dsc, self.p1, 2 * (bar + inter_bar) + bar_offset - 2, 270 - angle, 270 + angle)
#elif mode == lv.DESIGN_DRAW_POST # commented since we don't want a frame around this object
# self.ancestor_design.call(self, clip_area, mode)
end
end
def set_percentage(v)
var old_bars = self.percentage / 25
if v > 100 v = 100 end
if v < 0 v = 0 end
self.percentage = v
if old_bars != v / 25
self.invalidate() # be frugal and avoid updating the widget if it's not needed
end
end
def get_percentage()
return self.percentage
end
end
class lv_wifi_arcs: lv_signal_arcs
def init(parent)
super(self).init(parent)
tasmota.add_driver(self)
self.set_percentage(0) # we generally start with 0, meaning not connected
end
def every_second()
var wifi = tasmota.wifi()
var quality = wifi.find("quality")
var ip = wifi.find("ip")
if ip == nil
self.set_percentage(0)
elif quality != nil
self.set_percentage(quality)
end
end
def before_del() # called when the widget is being deleted
tasmota.remove_driver(self)
end
end
class lv_wifi_arcs_icon: lv_wifi_arcs
def init(parent)
super(self).init(parent)
self.set_style_line_color(lv.color(lv.COLOR_WHITE), lv.PART_MAIN | lv.STATE_DEFAULT)
self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT)
if parent != nil
var parent_height = parent.get_height()
var pad_right = parent.get_style_pad_right(lv.PART_MAIN | lv.STATE_DEFAULT)
self.set_height(parent_height)
var w = (parent_height*4)/3
self.set_width(w) # 130%
self.set_x(parent.get_width() - w - pad_right)
parent.set_style_pad_right(pad_right + w + 1, lv.PART_MAIN | lv.STATE_DEFAULT)
end
end
end

View File

@ -1,117 +0,0 @@
#- LVGL lv_signal_bars and lv_wifi_bars
-
--#
class lv_signal_bars : lv.obj
var percentage # value to display, range 0..100
var p1, p2, area, line_dsc # instances of objects kept to avoid re-instanciating at each call
def init(parent)
# init custom widget (don't call super constructor)
_lvgl.create_custom_widget(self, parent)
# own values
self.percentage = 100
# pre-allocate buffers
self.p1 = lv.point()
self.p2 = lv.point()
self.area = lv.area()
self.line_dsc = lv.draw_line_dsc()
end
def widget_event(cl, event)
# Call the ancestor's event handler
if lv.obj_event_base(cl, event) != lv.RES_OK return end
var code = event.code
def atleast1(x) if x >= 1 return x else return 1 end end
# the model is that we have 4 bars and inter-bar (1/4 of width)
var height = self.get_height()
var width = self.get_width()
var inter_bar = atleast1(width / 15)
var bar = atleast1((width - inter_bar * 3) / 4)
var bar_offset = bar / 2
if code == lv.EVENT_DRAW_MAIN
var draw_ctx = lv.draw_ctx(event.param)
# get coordinates of object
self.get_coords(self.area)
var x_ofs = self.area.x1
var y_ofs = self.area.y1
lv.draw_line_dsc_init(self.line_dsc) # initialize lv_draw_line_dsc structure
self.init_draw_line_dsc(lv.PART_MAIN, self.line_dsc) # copy the current values
self.line_dsc.round_start = 1
self.line_dsc.round_end = 1
self.line_dsc.width = bar
var on_color = self.get_style_line_color(lv.PART_MAIN | lv.STATE_DEFAULT)
var off_color = self.get_style_bg_color(lv.PART_MAIN | lv.STATE_DEFAULT)
lv.event_send(self, lv.EVENT_DRAW_PART_BEGIN, self.line_dsc)
for i:0..3 # 4 bars
self.line_dsc.color = self.percentage >= (i+1)*20 ? on_color : off_color
self.p1.y = y_ofs + height - 1 - bar_offset
self.p1.x = x_ofs + i * (bar + inter_bar) + bar_offset
self.p2.y = y_ofs + ((3 - i) * (height - bar)) / 4 + bar_offset
self.p2.x = self.p1.x
lv.draw_line(draw_ctx, self.line_dsc, self.p1, self.p2)
end
lv.event_send(self, lv.EVENT_DRAW_PART_END, self.line_dsc)
end
end
def set_percentage(v)
var old_bars = self.percentage / 20
if v > 100 v = 100 end
if v < 0 v = 0 end
self.percentage = v
if old_bars != v / 20
self.invalidate() # be frugal and avoid updating the widget if it's not needed
end
end
def get_percentage()
return self.percentage
end
end
class lv_wifi_bars: lv_signal_bars
def init(parent)
super(self).init(parent)
tasmota.add_driver(self)
self.set_percentage(0) # we generally start with 0, meaning not connected
end
def every_second()
var wifi = tasmota.wifi()
var quality = wifi.find("quality")
var ip = wifi.find("ip")
if ip == nil
self.set_percentage(0)
elif quality != nil
self.set_percentage(quality)
end
end
def before_del() # called when the widget is being deleted
tasmota.remove_driver(self)
end
end
class lv_wifi_bars_icon: lv_wifi_bars
def init(parent)
super(self).init(parent)
self.set_style_line_color(lv.color(lv.COLOR_WHITE), lv.PART_MAIN | lv.STATE_DEFAULT)
self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT)
if parent != nil
var parent_height = parent.get_height()
var pad_right = parent.get_style_pad_right(lv.PART_MAIN | lv.STATE_DEFAULT)
self.set_height(parent_height)
self.set_width(parent_height)
self.set_x(parent.get_width() - parent_height - pad_right)
parent.set_style_pad_right(pad_right + parent_height + 1, lv.PART_MAIN | lv.STATE_DEFAULT)
end
end
end

View File

@ -0,0 +1,326 @@
# LVGL lv_clock_icon
# LVGL lv_signal_bars and lv_wifi_bars
# LVGL lv_signal_bars and lv_wifi_bars
#
#-
import path
path.remove("lv_tasmota_widgets.bec")
load('lv_tasmota_widgets.be')
solidify.dump(lv_clock, true)
solidify.dump(lv_clock_icon, true)
solidify.dump(lv_signal_arcs, true)
solidify.dump(lv_wifi_arcs, true)
solidify.dump(lv_wifi_arcs_icon, true)
solidify.dump(lv_signal_bars, true)
solidify.dump(lv_wifi_bars, true)
solidify.dump(lv_wifi_bars_icon, true)
-#
class lv_clock: lv.label
var hour, minute, sec
def init(parent)
super(self).init(parent)
var f_s7_16 = lv.seg7_font(16)
if f_s7_16 != nil self.set_style_text_font(f_s7_16, lv.PART_MAIN | lv.STATE_DEFAULT) end
self.set_text("--:--")
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)
end
def set_time(hour, minute, sec)
import string
if hour != self.hour || minute != self.minute || sec != self.sec
var txt = string.format("%02d%s%02d", hour, sec % 2 ? ":" : " ", minute)
self.hour = hour
self.minute = minute
self.sec = sec
#if txt[0] == '0' txt = '!' .. string.split(txt,1)[1] end # replace first char with '!'
self.set_text(txt)
end
end
def every_second()
var now = tasmota.time_dump(tasmota.rtc()['local'])
if now['year'] != 1970
self.set_time(now['hour'], now['min'], now['sec'])
end
end
def before_del()
tasmota.remove_driver(self)
end
end
class lv_clock_icon: lv_clock
def init(parent)
super(self).init(parent)
if parent != nil
var parent_height = parent.get_height()
self.refr_size()
var w = self.get_width()
self.set_y((parent.get_height() - self.get_height()) / 2) # center vertically
var pad_right = parent.get_style_pad_right(lv.PART_MAIN | lv.STATE_DEFAULT)
self.set_x(parent.get_width() - w - pad_right - 3)
parent.set_style_pad_right(pad_right + w + 6, lv.PART_MAIN | lv.STATE_DEFAULT)
self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT)
end
end
end
# ##########################################################################################
class lv_signal_arcs : lv.obj
var percentage # value to display, range 0..100
var p1, p2, area, arc_dsc # instances of objects kept to avoid re-instanciating at each call
def init(parent)
# init custom widget (don't call super constructor)
_lvgl.create_custom_widget(self, parent)
# own values
self.percentage = 100
# pre-allocate buffers
self.p1 = lv.point()
self.p2 = lv.point()
self.area = lv.area()
self.arc_dsc = lv.draw_arc_dsc()
end
def widget_event(cl, event)
# Call the ancestor's event handler
if lv.obj_event_base(cl, event) != lv.RES_OK return end
var code = event.code
import math
def atleast1(x) if x >= 1 return x else return 1 end end
# the model is that we have 4 bars and inter-bar (1/4 of width)
var height = self.get_height()
var width = self.get_width()
var inter_bar = atleast1(height / 8)
var bar = atleast1((height - inter_bar * 2) / 3)
var bar_offset = bar / 2
#print("inter_bar", inter_bar, "bar", bar, "bar_offset", bar_offset)
if code == lv.EVENT_DRAW_MAIN
var draw_ctx = lv.draw_ctx(event.param)
# get coordinates of object
self.get_coords(self.area)
var x_ofs = self.area.x1
var y_ofs = self.area.y1
lv.draw_arc_dsc_init(self.arc_dsc) # initialize lv.draw_line_dsc structure
self.init_draw_arc_dsc(lv.PART_MAIN, self.arc_dsc) # copy the current values
self.arc_dsc.rounded = 1
self.arc_dsc.width = (bar * 3 + 1) / 4
var on_color = self.get_style_line_color(lv.PART_MAIN | lv.STATE_DEFAULT)
var off_color = self.get_style_bg_color(lv.PART_MAIN | lv.STATE_DEFAULT)
# initial calculation, but does not take into account bounding box
# var angle = int(math.deg(math.atan2(width / 2, height)))
# better calculation
var hypotenuse = height - bar # center if at bar/2 from bottom and circle stops at bar/2 from top
var adjacent = width / 2 - bar_offset # stop at bar_offset from side
var angle = int(90 - math.deg(math.acos(real(adjacent) / real(hypotenuse))))
if (angle > 45) angle = 45 end
# print("hypotenuse",hypotenuse,"adjacent",adjacent,"angle",angle)
self.p1.x = x_ofs + width / 2
self.p1.y = y_ofs + height - 1 - bar_offset
self.arc_dsc.color = self.percentage >= 25 ? on_color : off_color
lv.draw_arc(draw_ctx, self.arc_dsc, self.p1, 0 * (bar + inter_bar) + bar_offset, 0, 360)
self.arc_dsc.color = self.percentage >= 50 ? on_color : off_color
lv.draw_arc(draw_ctx, self.arc_dsc, self.p1, 1 * (bar + inter_bar) + bar_offset - 1, 270 - angle, 270 + angle)
self.arc_dsc.color = self.percentage >= 75 ? on_color : off_color
lv.draw_arc(draw_ctx, self.arc_dsc, self.p1, 2 * (bar + inter_bar) + bar_offset - 2, 270 - angle, 270 + angle)
#elif mode == lv.DESIGN_DRAW_POST # commented since we don't want a frame around this object
# self.ancestor_design.call(self, clip_area, mode)
end
end
def set_percentage(v)
var old_bars = self.percentage / 25
if v > 100 v = 100 end
if v < 0 v = 0 end
self.percentage = v
if old_bars != v / 25
self.invalidate() # be frugal and avoid updating the widget if it's not needed
end
end
def get_percentage()
return self.percentage
end
end
class lv_wifi_arcs: lv_signal_arcs
def init(parent)
super(self).init(parent)
tasmota.add_driver(self)
self.set_percentage(0) # we generally start with 0, meaning not connected
end
def every_second()
var wifi = tasmota.wifi()
var quality = wifi.find("quality")
var ip = wifi.find("ip")
if ip == nil
self.set_percentage(0)
elif quality != nil
self.set_percentage(quality)
end
end
def before_del() # called when the widget is being deleted
tasmota.remove_driver(self)
end
end
class lv_wifi_arcs_icon: lv_wifi_arcs
def init(parent)
super(self).init(parent)
self.set_style_line_color(lv.color(lv.COLOR_WHITE), lv.PART_MAIN | lv.STATE_DEFAULT)
self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT)
if parent != nil
var parent_height = parent.get_height()
var pad_right = parent.get_style_pad_right(lv.PART_MAIN | lv.STATE_DEFAULT)
self.set_height(parent_height)
var w = (parent_height*4)/3
self.set_width(w) # 130%
self.set_x(parent.get_width() - w - pad_right)
parent.set_style_pad_right(pad_right + w + 1, lv.PART_MAIN | lv.STATE_DEFAULT)
end
end
end
# ##########################################################################################
class lv_signal_bars : lv.obj
var percentage # value to display, range 0..100
var p1, p2, area, line_dsc # instances of objects kept to avoid re-instanciating at each call
def init(parent)
# init custom widget (don't call super constructor)
_lvgl.create_custom_widget(self, parent)
# own values
self.percentage = 100
# pre-allocate buffers
self.p1 = lv.point()
self.p2 = lv.point()
self.area = lv.area()
self.line_dsc = lv.draw_line_dsc()
end
def widget_event(cl, event)
# Call the ancestor's event handler
if lv.obj_event_base(cl, event) != lv.RES_OK return end
var code = event.code
def atleast1(x) if x >= 1 return x else return 1 end end
# the model is that we have 4 bars and inter-bar (1/4 of width)
var height = self.get_height()
var width = self.get_width()
var inter_bar = atleast1(width / 15)
var bar = atleast1((width - inter_bar * 3) / 4)
var bar_offset = bar / 2
if code == lv.EVENT_DRAW_MAIN
var draw_ctx = lv.draw_ctx(event.param)
# get coordinates of object
self.get_coords(self.area)
var x_ofs = self.area.x1
var y_ofs = self.area.y1
lv.draw_line_dsc_init(self.line_dsc) # initialize lv_draw_line_dsc structure
self.init_draw_line_dsc(lv.PART_MAIN, self.line_dsc) # copy the current values
self.line_dsc.round_start = 1
self.line_dsc.round_end = 1
self.line_dsc.width = bar
var on_color = self.get_style_line_color(lv.PART_MAIN | lv.STATE_DEFAULT)
var off_color = self.get_style_bg_color(lv.PART_MAIN | lv.STATE_DEFAULT)
lv.event_send(self, lv.EVENT_DRAW_PART_BEGIN, self.line_dsc)
for i:0..3 # 4 bars
self.line_dsc.color = self.percentage >= (i+1)*20 ? on_color : off_color
self.p1.y = y_ofs + height - 1 - bar_offset
self.p1.x = x_ofs + i * (bar + inter_bar) + bar_offset
self.p2.y = y_ofs + ((3 - i) * (height - bar)) / 4 + bar_offset
self.p2.x = self.p1.x
lv.draw_line(draw_ctx, self.line_dsc, self.p1, self.p2)
end
lv.event_send(self, lv.EVENT_DRAW_PART_END, self.line_dsc)
end
end
def set_percentage(v)
var old_bars = self.percentage / 20
if v > 100 v = 100 end
if v < 0 v = 0 end
self.percentage = v
if old_bars != v / 20
self.invalidate() # be frugal and avoid updating the widget if it's not needed
end
end
def get_percentage()
return self.percentage
end
end
class lv_wifi_bars: lv_signal_bars
def init(parent)
super(self).init(parent)
tasmota.add_driver(self)
self.set_percentage(0) # we generally start with 0, meaning not connected
end
def every_second()
var wifi = tasmota.wifi()
var quality = wifi.find("quality")
var ip = wifi.find("ip")
if ip == nil
self.set_percentage(0)
elif quality != nil
self.set_percentage(quality)
end
end
def before_del() # called when the widget is being deleted
tasmota.remove_driver(self)
end
end
class lv_wifi_bars_icon: lv_wifi_bars
def init(parent)
super(self).init(parent)
self.set_style_line_color(lv.color(lv.COLOR_WHITE), lv.PART_MAIN | lv.STATE_DEFAULT)
self.set_style_bg_color(lv.color(lv.COLOR_BLACK), lv.PART_MAIN | lv.STATE_DEFAULT)
if parent != nil
var parent_height = parent.get_height()
var pad_right = parent.get_style_pad_right(lv.PART_MAIN | lv.STATE_DEFAULT)
self.set_height(parent_height)
self.set_width(parent_height)
self.set_x(parent.get_width() - parent_height - pad_right)
parent.set_style_pad_right(pad_right + parent_height + 1, lv.PART_MAIN | lv.STATE_DEFAULT)
end
end
end

View File

@ -1028,7 +1028,7 @@ be_local_class(lv_style,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, 0), be_const_func(lv_be_style_init) },
})),
(be_str_literal("lv_style"))
(be_str_weak(lv_style))
);
/*******************************************************************/
@ -1046,7 +1046,7 @@ be_local_class(lv_obj,
{ be_const_key(tostring, 4), be_const_func(lv_x_tostring) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_obj_init) },
})),
(be_str_literal("lv_obj"))
(be_str_weak(lv_obj))
);
/*******************************************************************/
@ -1063,7 +1063,7 @@ be_local_class(lv_group,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, 0), be_const_func(be_ntv_lv_group_init) },
})),
(be_str_literal("lv_group"))
(be_str_weak(lv_group))
);
/*******************************************************************/
@ -1080,7 +1080,7 @@ be_local_class(lv_indev,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, 0), be_const_func(lv0_init) },
})),
(be_str_literal("lv_indev"))
(be_str_weak(lv_indev))
);
/*******************************************************************/
@ -1097,7 +1097,7 @@ be_local_class(lv_disp,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, 0), be_const_func(lv0_init) },
})),
(be_str_literal("lv_disp"))
(be_str_weak(lv_disp))
);
/*******************************************************************/
@ -1114,7 +1114,7 @@ be_local_class(lv_timer,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, 0), be_const_func(lv0_init) },
})),
be_str_literal("lv_timer")
be_str_weak(lv_timer)
);
/*******************************************************************/
@ -1131,7 +1131,7 @@ be_local_class(lv_anim,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, 0), be_const_func(lv_be_anim_init) },
})),
be_str_literal("lv_anim")
be_str_weak(lv_anim)
);
/*******************************************************************/
@ -1147,7 +1147,7 @@ be_local_class(lv_font,
{ be_const_key(tostring, -1), be_const_func(lv_x_tostring) },
{ be_const_key(_p, -1), be_const_var(0) },
})),
(be_str_literal("lv_font"))
(be_str_weak(lv_font))
);
/*******************************************************************/
@ -1163,7 +1163,7 @@ be_local_class(lv_theme,
{ be_const_key(tostring, -1), be_const_func(lv_x_tostring) },
{ be_const_key(_p, -1), be_const_var(0) },
})),
(be_str_literal("lv_theme"))
(be_str_weak(lv_theme))
);
/*******************************************************************/
@ -1180,7 +1180,7 @@ be_local_class(lv_color,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, -1), be_const_func(lco_init) },
})),
(be_str_literal("lv_color"))
(be_str_weak(lv_color))
);
/*******************************************************************/
@ -1196,7 +1196,7 @@ be_local_class(lv_img,
{ be_const_key(_class, -1), be_const_comptr(&lv_img_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_img_init) },
})),
(be_str_literal("lv_img"))
(be_str_weak(lv_img))
);
/*******************************************************************/
@ -1212,7 +1212,7 @@ be_local_class(lv_qrcode,
{ be_const_key(_class, -1), be_const_comptr(&lv_qrcode_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_qrcode_init) },
})),
(be_str_literal("lv_qrcode"))
(be_str_weak(lv_qrcode))
);
/*******************************************************************/
@ -1228,7 +1228,7 @@ be_local_class(lv_chart,
{ be_const_key(_class, -1), be_const_comptr(&lv_chart_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_chart_init) },
})),
(be_str_literal("lv_chart"))
(be_str_weak(lv_chart))
);
/*******************************************************************/
@ -1244,7 +1244,7 @@ be_local_class(lv_colorwheel,
{ be_const_key(_class, -1), be_const_comptr(&lv_colorwheel_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_colorwheel_init) },
})),
(be_str_literal("lv_colorwheel"))
(be_str_weak(lv_colorwheel))
);
/*******************************************************************/
@ -1260,7 +1260,7 @@ be_local_class(lv_imgbtn,
{ be_const_key(_class, -1), be_const_comptr(&lv_imgbtn_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_imgbtn_init) },
})),
(be_str_literal("lv_imgbtn"))
(be_str_weak(lv_imgbtn))
);
/*******************************************************************/
@ -1276,7 +1276,7 @@ be_local_class(lv_led,
{ be_const_key(_class, -1), be_const_comptr(&lv_led_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_led_init) },
})),
(be_str_literal("lv_led"))
(be_str_weak(lv_led))
);
/*******************************************************************/
@ -1292,7 +1292,7 @@ be_local_class(lv_meter,
{ be_const_key(_class, -1), be_const_comptr(&lv_meter_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_meter_init) },
})),
(be_str_literal("lv_meter"))
(be_str_weak(lv_meter))
);
/*******************************************************************/
@ -1308,7 +1308,7 @@ be_local_class(lv_msgbox,
{ be_const_key(_class, -1), be_const_comptr(&lv_msgbox_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_msgbox_init) },
})),
(be_str_literal("lv_msgbox"))
(be_str_weak(lv_msgbox))
);
/*******************************************************************/
@ -1324,7 +1324,7 @@ be_local_class(lv_spinbox,
{ be_const_key(_class, -1), be_const_comptr(&lv_spinbox_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_spinbox_init) },
})),
(be_str_literal("lv_spinbox"))
(be_str_weak(lv_spinbox))
);
/*******************************************************************/
@ -1340,7 +1340,7 @@ be_local_class(lv_spinner,
{ be_const_key(_class, -1), be_const_comptr(&lv_spinner_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_spinner_init) },
})),
(be_str_literal("lv_spinner"))
(be_str_weak(lv_spinner))
);
/*******************************************************************/
@ -1356,7 +1356,7 @@ be_local_class(lv_arc,
{ be_const_key(_class, -1), be_const_comptr(&lv_arc_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_arc_init) },
})),
(be_str_literal("lv_arc"))
(be_str_weak(lv_arc))
);
/*******************************************************************/
@ -1372,7 +1372,7 @@ be_local_class(lv_bar,
{ be_const_key(_class, -1), be_const_comptr(&lv_bar_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_bar_init) },
})),
(be_str_literal("lv_bar"))
(be_str_weak(lv_bar))
);
/*******************************************************************/
@ -1388,7 +1388,7 @@ be_local_class(lv_btn,
{ be_const_key(_class, -1), be_const_comptr(&lv_btn_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_btn_init) },
})),
(be_str_literal("lv_btn"))
(be_str_weak(lv_btn))
);
/*******************************************************************/
@ -1404,7 +1404,7 @@ be_local_class(lv_btnmatrix,
{ be_const_key(_class, -1), be_const_comptr(&lv_btnmatrix_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_btnmatrix_init) },
})),
(be_str_literal("lv_btnmatrix"))
(be_str_weak(lv_btnmatrix))
);
/*******************************************************************/
@ -1420,7 +1420,7 @@ be_local_class(lv_canvas,
{ be_const_key(_class, -1), be_const_comptr(&lv_canvas_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_canvas_init) },
})),
(be_str_literal("lv_canvas"))
(be_str_weak(lv_canvas))
);
/*******************************************************************/
@ -1436,7 +1436,7 @@ be_local_class(lv_checkbox,
{ be_const_key(_class, -1), be_const_comptr(&lv_checkbox_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_checkbox_init) },
})),
(be_str_literal("lv_checkbox"))
(be_str_weak(lv_checkbox))
);
/*******************************************************************/
@ -1452,7 +1452,7 @@ be_local_class(lv_dropdown,
{ be_const_key(_class, -1), be_const_comptr(&lv_dropdown_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_dropdown_init) },
})),
(be_str_literal("lv_dropdown"))
(be_str_weak(lv_dropdown))
);
/*******************************************************************/
@ -1468,7 +1468,7 @@ be_local_class(lv_label,
{ be_const_key(_class, -1), be_const_comptr(&lv_label_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_label_init) },
})),
(be_str_literal("lv_label"))
(be_str_weak(lv_label))
);
/*******************************************************************/
@ -1484,7 +1484,7 @@ be_local_class(lv_line,
{ be_const_key(_class, -1), be_const_comptr(&lv_line_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_line_init) },
})),
(be_str_literal("lv_line"))
(be_str_weak(lv_line))
);
/*******************************************************************/
@ -1500,7 +1500,7 @@ be_local_class(lv_roller,
{ be_const_key(_class, -1), be_const_comptr(&lv_roller_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_roller_init) },
})),
(be_str_literal("lv_roller"))
(be_str_weak(lv_roller))
);
/*******************************************************************/
@ -1516,7 +1516,7 @@ be_local_class(lv_slider,
{ be_const_key(_class, -1), be_const_comptr(&lv_slider_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_slider_init) },
})),
(be_str_literal("lv_slider"))
(be_str_weak(lv_slider))
);
/*******************************************************************/
@ -1532,7 +1532,7 @@ be_local_class(lv_switch,
{ be_const_key(_class, -1), be_const_comptr(&lv_switch_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_switch_init) },
})),
(be_str_literal("lv_switch"))
(be_str_weak(lv_switch))
);
/*******************************************************************/
@ -1548,7 +1548,7 @@ be_local_class(lv_table,
{ be_const_key(_class, -1), be_const_comptr(&lv_table_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_table_init) },
})),
(be_str_literal("lv_table"))
(be_str_weak(lv_table))
);
/*******************************************************************/
@ -1564,7 +1564,7 @@ be_local_class(lv_textarea,
{ be_const_key(_class, -1), be_const_comptr(&lv_textarea_class) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_textarea_init) },
})),
(be_str_literal("lv_textarea"))
(be_str_weak(lv_textarea))
);
/*******************************************************************/

View File

@ -213,7 +213,7 @@ be_local_class(lv_coord_arr,
{ be_const_key(item, -1), be_const_closure(lv_coord_arr_item_closure) },
{ be_const_key(setitem, -1), be_const_closure(lv_coord_arr_setitem_closure) },
})),
be_str_literal("lv_coord_arr")
be_str_weak(lv_coord_arr)
);
/********************************************************************
@ -315,7 +315,7 @@ be_local_class(lv_point_arr,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(init, -1), be_const_closure(lv_point_arr_init_closure) },
})),
be_str_literal("lv_point_arr")
be_str_weak(lv_point_arr)
);
/********************************************************************
@ -397,7 +397,7 @@ be_local_class(lv_style_prop_arr,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(init, -1), be_const_closure(lv_style_prop_arr_init_closure) },
})),
be_str_literal("lv_style_prop_arr")
be_str_weak(lv_style_prop_arr)
);
/********************************************************************

View File

@ -1157,6 +1157,6 @@ be_local_class(LVGL_glob,
{ be_const_key(widget_struct_by_class, 1), be_const_var(10) },
{ be_const_key(widget_cb, 0), be_const_closure(LVGL_glob_widget_cb_closure) },
})),
be_str_literal("LVGL_glob")
be_str_weak(LVGL_glob)
);
/*******************************************************************/

View File

@ -546,7 +546,7 @@ be_local_class(lv_style,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, 0), be_const_func(lv_be_style_init) },
})),
(be_str_literal("lv_style"))
(be_str_weak(lv_style))
);
/*******************************************************************/
@ -564,7 +564,7 @@ be_local_class(lv_obj,
{ be_const_key(tostring, 4), be_const_func(lv_x_tostring) },
{ be_const_key(init, -1), be_const_func(be_ntv_lv_obj_init) },
})),
(be_str_literal("lv_obj"))
(be_str_weak(lv_obj))
);
/*******************************************************************/
@ -581,7 +581,7 @@ be_local_class(lv_group,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, 0), be_const_func(be_ntv_lv_group_init) },
})),
(be_str_literal("lv_group"))
(be_str_weak(lv_group))
);
/*******************************************************************/
@ -598,7 +598,7 @@ be_local_class(lv_indev,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, 0), be_const_func(lv0_init) },
})),
(be_str_literal("lv_indev"))
(be_str_weak(lv_indev))
);
/*******************************************************************/
@ -615,7 +615,7 @@ be_local_class(lv_disp,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, 0), be_const_func(lv0_init) },
})),
(be_str_literal("lv_disp"))
(be_str_weak(lv_disp))
);
/*******************************************************************/
@ -632,7 +632,7 @@ be_local_class(lv_timer,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, 0), be_const_func(lv0_init) },
})),
be_str_literal("lv_timer")
be_str_weak(lv_timer)
);
/*******************************************************************/
@ -649,7 +649,7 @@ be_local_class(lv_anim,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, 0), be_const_func(lv_be_anim_init) },
})),
be_str_literal("lv_anim")
be_str_weak(lv_anim)
);
/*******************************************************************/
@ -665,7 +665,7 @@ be_local_class(lv_font,
{ be_const_key(tostring, -1), be_const_func(lv_x_tostring) },
{ be_const_key(_p, -1), be_const_var(0) },
})),
(be_str_literal("lv_font"))
(be_str_weak(lv_font))
);
/*******************************************************************/
@ -681,7 +681,7 @@ be_local_class(lv_theme,
{ be_const_key(tostring, -1), be_const_func(lv_x_tostring) },
{ be_const_key(_p, -1), be_const_var(0) },
})),
(be_str_literal("lv_theme"))
(be_str_weak(lv_theme))
);
/*******************************************************************/
@ -698,7 +698,7 @@ be_local_class(lv_color,
{ be_const_key(_p, -1), be_const_var(0) },
{ be_const_key(init, -1), be_const_func(lco_init) },
})),
(be_str_literal("lv_color"))
(be_str_weak(lv_color))
);
/*******************************************************************/
""")
@ -720,7 +720,7 @@ be_local_class(lv_{subtype},
{{ be_const_key(_class, -1), be_const_comptr(&lv_{subtype}_class) }},
{{ be_const_key(init, -1), be_const_func(be_ntv_lv_{subtype}_init) }},
}})),
(be_str_literal("lv_{subtype}"))
(be_str_weak(lv_{subtype}))
);
/*******************************************************************/
""")