From 22daee620ae3782630c05018775cfb02927aa8bd Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Mon, 4 Oct 2021 13:42:09 +0200 Subject: [PATCH] Fix ctypes for energy and lvgl --- .../default/be_energy_ctypes_definitions.c | 115 ++++---- .../default/be_lvgl_ctypes_definitions.c | 260 +++++++++--------- tasmota/berry/modules/ctypes.be | 10 +- tasmota/berry/modules/energy_ctypes.be | 24 +- 4 files changed, 223 insertions(+), 186 deletions(-) diff --git a/lib/libesp32/Berry/default/be_energy_ctypes_definitions.c b/lib/libesp32/Berry/default/be_energy_ctypes_definitions.c index 90db5c10f..86f84ef64 100644 --- a/lib/libesp32/Berry/default/be_energy_ctypes_definitions.c +++ b/lib/libesp32/Berry/default/be_energy_ctypes_definitions.c @@ -12,76 +12,95 @@ static const char * be_ctypes_instance_mappings[]; /* forward definition */ const be_ctypes_structure_t be_energy_struct = { - 170, /* size in bytes */ - 66, /* number of elements */ + 250, /* size in bytes */ + 85, /* number of elements */ be_ctypes_instance_mappings, - (const be_ctypes_structure_item_t[66]) { + (const be_ctypes_structure_item_t[85]) { { "active_power", 24, 0, 0, ctypes_float, 0 }, { "active_power_2", 28, 0, 0, ctypes_float, 0 }, { "active_power_3", 32, 0, 0, ctypes_float, 0 }, { "apparent_power", 36, 0, 0, ctypes_float, 0 }, { "apparent_power_2", 40, 0, 0, ctypes_float, 0 }, { "apparent_power_3", 44, 0, 0, ctypes_float, 0 }, - { "command_code", 125, 0, 0, ctypes_u8, 0 }, + { "command_code", 205, 0, 0, ctypes_u8, 0 }, { "current", 12, 0, 0, ctypes_float, 0 }, { "current_2", 16, 0, 0, ctypes_float, 0 }, { "current_3", 20, 0, 0, ctypes_float, 0 }, - { "current_available", 135, 0, 0, ctypes_u8, 0 }, - { "daily", 100, 0, 0, ctypes_float, 0 }, - { "data_valid", 126, 0, 0, ctypes_u8, 0 }, - { "data_valid_2", 127, 0, 0, ctypes_u8, 0 }, - { "data_valid_3", 128, 0, 0, ctypes_u8, 0 }, - { "export_active", 84, 0, 0, ctypes_float, 0 }, - { "export_active_2", 88, 0, 0, ctypes_float, 0 }, - { "export_active_3", 92, 0, 0, ctypes_float, 0 }, - { "fifth_second", 124, 0, 0, ctypes_u8, 0 }, + { "current_available", 215, 0, 0, ctypes_u8, 0 }, + { "daily", 120, 0, 0, ctypes_float, 0 }, + { "daily_2", 124, 0, 0, ctypes_float, 0 }, + { "daily_3", 128, 0, 0, ctypes_float, 0 }, + { "daily_sum", 144, 0, 0, ctypes_float, 0 }, + { "data_valid", 206, 0, 0, ctypes_u8, 0 }, + { "data_valid_2", 207, 0, 0, ctypes_u8, 0 }, + { "data_valid_3", 208, 0, 0, ctypes_u8, 0 }, + { "export_active", 96, 0, 0, ctypes_float, 0 }, + { "export_active_2", 100, 0, 0, ctypes_float, 0 }, + { "export_active_3", 104, 0, 0, ctypes_float, 0 }, + { "fifth_second", 204, 0, 0, ctypes_u8, 0 }, { "frequency", 72, 0, 0, ctypes_float, 0 }, { "frequency_2", 76, 0, 0, ctypes_float, 0 }, { "frequency_3", 80, 0, 0, ctypes_float, 0 }, - { "frequency_common", 131, 0, 0, ctypes_u8, 0 }, - { "max_current_flag", 162, 0, 0, ctypes_u8, 0 }, - { "max_energy_state", 169, 0, 0, ctypes_u8, 0 }, - { "max_power_flag", 158, 0, 0, ctypes_u8, 0 }, - { "max_voltage_flag", 160, 0, 0, ctypes_u8, 0 }, - { "min_current_flag", 161, 0, 0, ctypes_u8, 0 }, - { "min_power_flag", 157, 0, 0, ctypes_u8, 0 }, - { "min_voltage_flag", 159, 0, 0, ctypes_u8, 0 }, - { "mplh_counter", 164, 0, 0, ctypes_u16, 0 }, - { "mplr_counter", 168, 0, 0, ctypes_u8, 0 }, - { "mplw_counter", 166, 0, 0, ctypes_u16, 0 }, - { "period", 120, 0, 0, ctypes_u32, 0 }, - { "phase_count", 129, 0, 0, ctypes_u8, 0 }, + { "frequency_common", 211, 0, 0, ctypes_u8, 0 }, + { "import_active", 84, 0, 0, ctypes_float, 0 }, + { "import_active_2", 88, 0, 0, ctypes_float, 0 }, + { "import_active_3", 92, 0, 0, ctypes_float, 0 }, + { "max_current_flag", 242, 0, 0, ctypes_u8, 0 }, + { "max_energy_state", 249, 0, 0, ctypes_u8, 0 }, + { "max_power_flag", 238, 0, 0, ctypes_u8, 0 }, + { "max_voltage_flag", 240, 0, 0, ctypes_u8, 0 }, + { "min_current_flag", 241, 0, 0, ctypes_u8, 0 }, + { "min_power_flag", 237, 0, 0, ctypes_u8, 0 }, + { "min_voltage_flag", 239, 0, 0, ctypes_u8, 0 }, + { "mplh_counter", 244, 0, 0, ctypes_u16, 0 }, + { "mplr_counter", 248, 0, 0, ctypes_u8, 0 }, + { "mplw_counter", 246, 0, 0, ctypes_u16, 0 }, + { "period", 192, 0, 0, ctypes_u32, 0 }, + { "period_2", 196, 0, 0, ctypes_u32, 0 }, + { "period_3", 200, 0, 0, ctypes_u32, 0 }, + { "phase_count", 209, 0, 0, ctypes_u8, 0 }, { "power_factor", 60, 0, 0, ctypes_float, 0 }, { "power_factor_2", 64, 0, 0, ctypes_float, 0 }, { "power_factor_3", 68, 0, 0, ctypes_float, 0 }, - { "power_history_0", 138, 0, 0, ctypes_u16, 0 }, - { "power_history_0_2", 140, 0, 0, ctypes_u16, 0 }, - { "power_history_0_3", 142, 0, 0, ctypes_u16, 0 }, - { "power_history_1", 144, 0, 0, ctypes_u16, 0 }, - { "power_history_1_2", 146, 0, 0, ctypes_u16, 0 }, - { "power_history_1_3", 148, 0, 0, ctypes_u16, 0 }, - { "power_history_2", 150, 0, 0, ctypes_u16, 0 }, - { "power_history_2_2", 152, 0, 0, ctypes_u16, 0 }, - { "power_history_2_3", 154, 0, 0, ctypes_u16, 0 }, - { "power_on", 137, 0, 0, ctypes_u8, 0 }, - { "power_steady_counter", 156, 0, 0, ctypes_u8, 0 }, + { "power_history_0", 218, 0, 0, ctypes_u16, 0 }, + { "power_history_0_2", 220, 0, 0, ctypes_u16, 0 }, + { "power_history_0_3", 222, 0, 0, ctypes_u16, 0 }, + { "power_history_1", 224, 0, 0, ctypes_u16, 0 }, + { "power_history_1_2", 226, 0, 0, ctypes_u16, 0 }, + { "power_history_1_3", 228, 0, 0, ctypes_u16, 0 }, + { "power_history_2", 230, 0, 0, ctypes_u16, 0 }, + { "power_history_2_2", 232, 0, 0, ctypes_u16, 0 }, + { "power_history_2_3", 234, 0, 0, ctypes_u16, 0 }, + { "power_on", 217, 0, 0, ctypes_u8, 0 }, + { "power_steady_counter", 236, 0, 0, ctypes_u8, 0 }, { "reactive_power", 48, 0, 0, ctypes_float, 0 }, { "reactive_power_2", 52, 0, 0, ctypes_float, 0 }, { "reactive_power_3", 56, 0, 0, ctypes_float, 0 }, - { "start_energy", 96, 0, 0, ctypes_float, 0 }, - { "stuff", 163, 0, 0, ctypes_u8, 0 }, - { "today_delta_kwh", 108, 0, 0, ctypes_u32, 0 }, - { "today_kwh", 116, 0, 0, ctypes_u32, 0 }, - { "today_offset_init_kwh", 133, 0, 0, ctypes_u8, 0 }, - { "today_offset_kwh", 112, 0, 0, ctypes_u32, 0 }, - { "total", 104, 0, 0, ctypes_float, 0 }, - { "type_dc", 136, 0, 0, ctypes_u8, 0 }, - { "use_overtemp", 132, 0, 0, ctypes_u8, 0 }, + { "start_energy", 108, 0, 0, ctypes_float, 0 }, + { "start_energy_2", 112, 0, 0, ctypes_float, 0 }, + { "start_energy_3", 116, 0, 0, ctypes_float, 0 }, + { "today_delta_kwh", 156, 0, 0, ctypes_u32, 0 }, + { "today_delta_kwh_2", 160, 0, 0, ctypes_u32, 0 }, + { "today_delta_kwh_3", 164, 0, 0, ctypes_u32, 0 }, + { "today_kwh", 180, 0, 0, ctypes_u32, 0 }, + { "today_kwh_2", 184, 0, 0, ctypes_u32, 0 }, + { "today_kwh_3", 188, 0, 0, ctypes_u32, 0 }, + { "today_offset_init_kwh", 213, 0, 0, ctypes_u8, 0 }, + { "today_offset_kwh", 168, 0, 0, ctypes_u32, 0 }, + { "today_offset_kwh_2", 172, 0, 0, ctypes_u32, 0 }, + { "today_offset_kwh_3", 176, 0, 0, ctypes_u32, 0 }, + { "total", 132, 0, 0, ctypes_float, 0 }, + { "total_2", 136, 0, 0, ctypes_float, 0 }, + { "total_3", 140, 0, 0, ctypes_float, 0 }, + { "total_sum", 148, 0, 0, ctypes_float, 0 }, + { "type_dc", 216, 0, 0, ctypes_u8, 0 }, + { "use_overtemp", 212, 0, 0, ctypes_u8, 0 }, { "voltage", 0, 0, 0, ctypes_float, 0 }, { "voltage_2", 4, 0, 0, ctypes_float, 0 }, { "voltage_3", 8, 0, 0, ctypes_float, 0 }, - { "voltage_available", 134, 0, 0, ctypes_u8, 0 }, - { "voltage_common", 130, 0, 0, ctypes_u8, 0 }, + { "voltage_available", 214, 0, 0, ctypes_u8, 0 }, + { "voltage_common", 210, 0, 0, ctypes_u8, 0 }, + { "yesterday_sum", 152, 0, 0, ctypes_float, 0 }, }}; static const char * be_ctypes_instance_mappings[] = { diff --git a/lib/libesp32/Berry/default/be_lvgl_ctypes_definitions.c b/lib/libesp32/Berry/default/be_lvgl_ctypes_definitions.c index d42b17c19..a964da83b 100644 --- a/lib/libesp32/Berry/default/be_lvgl_ctypes_definitions.c +++ b/lib/libesp32/Berry/default/be_lvgl_ctypes_definitions.c @@ -34,39 +34,39 @@ const be_ctypes_structure_t be_lv_area = { }}; const be_ctypes_structure_t be_lv_draw_rect_dsc = { - 50, /* size in bytes */ + 51, /* size in bytes */ 29, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[29]) { - { "bg_color", 3, 0, 0, ctypes_u16, 1 }, - { "bg_grad_color", 5, 0, 0, ctypes_u16, 1 }, - { "bg_grad_color_stop", 8, 0, 0, ctypes_u8, 0 }, - { "bg_grad_dir", 10, 0, 3, ctypes_bf, 0 }, + { "bg_color", 4, 0, 0, ctypes_u16, 1 }, + { "bg_grad_color", 6, 0, 0, ctypes_u16, 1 }, + { "bg_grad_color_stop", 9, 0, 0, ctypes_u8, 0 }, + { "bg_grad_dir", 11, 0, 3, ctypes_bf, 0 }, { "bg_img_opa", 22, 0, 0, ctypes_u8, 0 }, { "bg_img_recolor", 20, 0, 0, ctypes_u16, 1 }, { "bg_img_recolor_opa", 23, 0, 0, ctypes_u8, 0 }, { "bg_img_src", 12, 0, 0, ctypes_ptr32, 0 }, { "bg_img_symbol_font", 16, 0, 0, ctypes_ptr32, 0 }, { "bg_img_tiled", 24, 0, 0, ctypes_u8, 0 }, - { "bg_main_color_stop", 7, 0, 0, ctypes_u8, 0 }, - { "bg_opa", 9, 0, 0, ctypes_u8, 0 }, + { "bg_main_color_stop", 8, 0, 0, ctypes_u8, 0 }, + { "bg_opa", 10, 0, 0, ctypes_u8, 0 }, { "blend_mode", 2, 0, 0, ctypes_u8, 0 }, - { "border_color", 25, 0, 0, ctypes_u16, 1 }, - { "border_opa", 29, 0, 0, ctypes_u8, 0 }, - { "border_post", 30, 0, 1, ctypes_bf, 0 }, - { "border_side", 30, 1, 5, ctypes_bf, 0 }, - { "border_width", 27, 0, 0, ctypes_i16, 0 }, + { "border_color", 26, 0, 0, ctypes_u16, 1 }, + { "border_opa", 30, 0, 0, ctypes_u8, 0 }, + { "border_post", 31, 0, 1, ctypes_bf, 0 }, + { "border_side", 31, 1, 5, ctypes_bf, 0 }, + { "border_width", 28, 0, 0, ctypes_i16, 0 }, { "outline_color", 32, 0, 0, ctypes_u16, 1 }, { "outline_opa", 38, 0, 0, ctypes_u8, 0 }, { "outline_pad", 36, 0, 0, ctypes_i16, 0 }, { "outline_width", 34, 0, 0, ctypes_i16, 0 }, { "radius", 0, 0, 0, ctypes_i16, 0 }, - { "shadow_color", 39, 0, 0, ctypes_u16, 1 }, - { "shadow_ofs_x", 43, 0, 0, ctypes_i16, 0 }, - { "shadow_ofs_y", 45, 0, 0, ctypes_i16, 0 }, - { "shadow_opa", 49, 0, 0, ctypes_u8, 0 }, - { "shadow_spread", 47, 0, 0, ctypes_i16, 0 }, - { "shadow_width", 41, 0, 0, ctypes_i16, 0 }, + { "shadow_color", 40, 0, 0, ctypes_u16, 1 }, + { "shadow_ofs_x", 44, 0, 0, ctypes_i16, 0 }, + { "shadow_ofs_y", 46, 0, 0, ctypes_i16, 0 }, + { "shadow_opa", 50, 0, 0, ctypes_u8, 0 }, + { "shadow_spread", 48, 0, 0, ctypes_i16, 0 }, + { "shadow_width", 42, 0, 0, ctypes_i16, 0 }, }}; const be_ctypes_structure_t be_lv_draw_line_dsc = { @@ -124,25 +124,25 @@ const be_ctypes_structure_t be_lv_draw_mask_line_param_cfg = { }}; const be_ctypes_structure_t be_lv_draw_mask_line_param = { - 35, /* size in bytes */ + 41, /* size in bytes */ 15, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[15]) { - { "cfg_p1_x", 5, 0, 0, ctypes_i16, 0 }, - { "cfg_p1_y", 7, 0, 0, ctypes_i16, 0 }, - { "cfg_p2_x", 9, 0, 0, ctypes_i16, 0 }, - { "cfg_p2_y", 11, 0, 0, ctypes_i16, 0 }, - { "cfg_side", 13, 0, 2, ctypes_bf, 0 }, + { "cfg_p1_x", 8, 0, 0, ctypes_i16, 0 }, + { "cfg_p1_y", 10, 0, 0, ctypes_i16, 0 }, + { "cfg_p2_x", 12, 0, 0, ctypes_i16, 0 }, + { "cfg_p2_y", 14, 0, 0, ctypes_i16, 0 }, + { "cfg_side", 16, 0, 2, ctypes_bf, 0 }, { "dsc_cb", 0, 0, 0, ctypes_ptr32, 0 }, { "dsc_type", 4, 0, 0, ctypes_u8, 0 }, - { "flat", 34, 0, 1, ctypes_bf, 0 }, - { "inv", 34, 1, 1, ctypes_bf, 0 }, - { "origo_x", 14, 0, 0, ctypes_i16, 0 }, - { "origo_y", 16, 0, 0, ctypes_i16, 0 }, - { "spx", 30, 0, 0, ctypes_i32, 0 }, - { "steep", 26, 0, 0, ctypes_i32, 0 }, - { "xy_steep", 18, 0, 0, ctypes_i32, 0 }, - { "yx_steep", 22, 0, 0, ctypes_i32, 0 }, + { "flat", 40, 0, 1, ctypes_bf, 0 }, + { "inv", 40, 1, 1, ctypes_bf, 0 }, + { "origo_x", 20, 0, 0, ctypes_i16, 0 }, + { "origo_y", 22, 0, 0, ctypes_i16, 0 }, + { "spx", 36, 0, 0, ctypes_i32, 0 }, + { "steep", 32, 0, 0, ctypes_i32, 0 }, + { "xy_steep", 24, 0, 0, ctypes_i32, 0 }, + { "yx_steep", 28, 0, 0, ctypes_i32, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_angle_param_cfg = { @@ -157,47 +157,47 @@ const be_ctypes_structure_t be_lv_draw_mask_angle_param_cfg = { }}; const be_ctypes_structure_t be_lv_draw_mask_angle_param = { - 85, /* size in bytes */ + 104, /* size in bytes */ 37, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[37]) { - { "cfg_end_angle", 11, 0, 0, ctypes_i16, 0 }, - { "cfg_start_angle", 9, 0, 0, ctypes_i16, 0 }, - { "cfg_vertex_p_x", 5, 0, 0, ctypes_i16, 0 }, - { "cfg_vertex_p_y", 7, 0, 0, ctypes_i16, 0 }, - { "delta_deg", 83, 0, 0, ctypes_u16, 0 }, + { "cfg_end_angle", 14, 0, 0, ctypes_i16, 0 }, + { "cfg_start_angle", 12, 0, 0, ctypes_i16, 0 }, + { "cfg_vertex_p_x", 8, 0, 0, ctypes_i16, 0 }, + { "cfg_vertex_p_y", 10, 0, 0, ctypes_i16, 0 }, + { "delta_deg", 102, 0, 0, ctypes_u16, 0 }, { "dsc_cb", 0, 0, 0, ctypes_ptr32, 0 }, { "dsc_type", 4, 0, 0, ctypes_u8, 0 }, - { "end_line_cfg_p1_x", 53, 0, 0, ctypes_i16, 0 }, - { "end_line_cfg_p1_y", 55, 0, 0, ctypes_i16, 0 }, - { "end_line_cfg_p2_x", 57, 0, 0, ctypes_i16, 0 }, - { "end_line_cfg_p2_y", 59, 0, 0, ctypes_i16, 0 }, - { "end_line_cfg_side", 61, 0, 2, ctypes_bf, 0 }, - { "end_line_dsc_cb", 48, 0, 0, ctypes_ptr32, 0 }, - { "end_line_dsc_type", 52, 0, 0, ctypes_u8, 0 }, - { "end_line_flat", 82, 0, 1, ctypes_bf, 0 }, - { "end_line_inv", 82, 1, 1, ctypes_bf, 0 }, - { "end_line_origo_x", 62, 0, 0, ctypes_i16, 0 }, - { "end_line_origo_y", 64, 0, 0, ctypes_i16, 0 }, - { "end_line_spx", 78, 0, 0, ctypes_i32, 0 }, - { "end_line_steep", 74, 0, 0, ctypes_i32, 0 }, - { "end_line_xy_steep", 66, 0, 0, ctypes_i32, 0 }, - { "end_line_yx_steep", 70, 0, 0, ctypes_i32, 0 }, - { "start_line_cfg_p1_x", 18, 0, 0, ctypes_i16, 0 }, - { "start_line_cfg_p1_y", 20, 0, 0, ctypes_i16, 0 }, - { "start_line_cfg_p2_x", 22, 0, 0, ctypes_i16, 0 }, - { "start_line_cfg_p2_y", 24, 0, 0, ctypes_i16, 0 }, - { "start_line_cfg_side", 26, 0, 2, ctypes_bf, 0 }, - { "start_line_dsc_cb", 13, 0, 0, ctypes_ptr32, 0 }, - { "start_line_dsc_type", 17, 0, 0, ctypes_u8, 0 }, - { "start_line_flat", 47, 0, 1, ctypes_bf, 0 }, - { "start_line_inv", 47, 1, 1, ctypes_bf, 0 }, - { "start_line_origo_x", 27, 0, 0, ctypes_i16, 0 }, - { "start_line_origo_y", 29, 0, 0, ctypes_i16, 0 }, - { "start_line_spx", 43, 0, 0, ctypes_i32, 0 }, - { "start_line_steep", 39, 0, 0, ctypes_i32, 0 }, - { "start_line_xy_steep", 31, 0, 0, ctypes_i32, 0 }, - { "start_line_yx_steep", 35, 0, 0, ctypes_i32, 0 }, + { "end_line_cfg_p1_x", 68, 0, 0, ctypes_i16, 0 }, + { "end_line_cfg_p1_y", 70, 0, 0, ctypes_i16, 0 }, + { "end_line_cfg_p2_x", 72, 0, 0, ctypes_i16, 0 }, + { "end_line_cfg_p2_y", 74, 0, 0, ctypes_i16, 0 }, + { "end_line_cfg_side", 76, 0, 2, ctypes_bf, 0 }, + { "end_line_dsc_cb", 60, 0, 0, ctypes_ptr32, 0 }, + { "end_line_dsc_type", 64, 0, 0, ctypes_u8, 0 }, + { "end_line_flat", 100, 0, 1, ctypes_bf, 0 }, + { "end_line_inv", 100, 1, 1, ctypes_bf, 0 }, + { "end_line_origo_x", 80, 0, 0, ctypes_i16, 0 }, + { "end_line_origo_y", 82, 0, 0, ctypes_i16, 0 }, + { "end_line_spx", 96, 0, 0, ctypes_i32, 0 }, + { "end_line_steep", 92, 0, 0, ctypes_i32, 0 }, + { "end_line_xy_steep", 84, 0, 0, ctypes_i32, 0 }, + { "end_line_yx_steep", 88, 0, 0, ctypes_i32, 0 }, + { "start_line_cfg_p1_x", 24, 0, 0, ctypes_i16, 0 }, + { "start_line_cfg_p1_y", 26, 0, 0, ctypes_i16, 0 }, + { "start_line_cfg_p2_x", 28, 0, 0, ctypes_i16, 0 }, + { "start_line_cfg_p2_y", 30, 0, 0, ctypes_i16, 0 }, + { "start_line_cfg_side", 32, 0, 2, ctypes_bf, 0 }, + { "start_line_dsc_cb", 16, 0, 0, ctypes_ptr32, 0 }, + { "start_line_dsc_type", 20, 0, 0, ctypes_u8, 0 }, + { "start_line_flat", 56, 0, 1, ctypes_bf, 0 }, + { "start_line_inv", 56, 1, 1, ctypes_bf, 0 }, + { "start_line_origo_x", 36, 0, 0, ctypes_i16, 0 }, + { "start_line_origo_y", 38, 0, 0, ctypes_i16, 0 }, + { "start_line_spx", 52, 0, 0, ctypes_i32, 0 }, + { "start_line_steep", 48, 0, 0, ctypes_i32, 0 }, + { "start_line_xy_steep", 40, 0, 0, ctypes_i32, 0 }, + { "start_line_yx_steep", 44, 0, 0, ctypes_i32, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_radius_param_cfg = { @@ -223,21 +223,21 @@ const be_ctypes_structure_t be_lv_sqrt_res = { }}; const be_ctypes_structure_t be_lv_draw_mask_radius_param = { - 24, /* size in bytes */ + 28, /* size in bytes */ 11, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[11]) { - { "cfg_outer", 15, 0, 1, ctypes_bf, 0 }, - { "cfg_radius", 13, 0, 0, ctypes_i16, 0 }, - { "cfg_rect_x1", 5, 0, 0, ctypes_i16, 0 }, - { "cfg_rect_x2", 9, 0, 0, ctypes_i16, 0 }, - { "cfg_rect_y1", 7, 0, 0, ctypes_i16, 0 }, - { "cfg_rect_y2", 11, 0, 0, ctypes_i16, 0 }, + { "cfg_outer", 18, 0, 1, ctypes_bf, 0 }, + { "cfg_radius", 16, 0, 0, ctypes_i16, 0 }, + { "cfg_rect_x1", 8, 0, 0, ctypes_i16, 0 }, + { "cfg_rect_x2", 12, 0, 0, ctypes_i16, 0 }, + { "cfg_rect_y1", 10, 0, 0, ctypes_i16, 0 }, + { "cfg_rect_y2", 14, 0, 0, ctypes_i16, 0 }, { "dsc_cb", 0, 0, 0, ctypes_ptr32, 0 }, { "dsc_type", 4, 0, 0, ctypes_u8, 0 }, - { "y_prev", 16, 0, 0, ctypes_i32, 0 }, - { "y_prev_x_f", 22, 0, 0, ctypes_u16, 0 }, - { "y_prev_x_i", 20, 0, 0, ctypes_u16, 0 }, + { "y_prev", 20, 0, 0, ctypes_i32, 0 }, + { "y_prev_x_f", 26, 0, 0, ctypes_u16, 0 }, + { "y_prev_x_i", 24, 0, 0, ctypes_u16, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_fade_param_cfg = { @@ -256,18 +256,18 @@ const be_ctypes_structure_t be_lv_draw_mask_fade_param_cfg = { }}; const be_ctypes_structure_t be_lv_draw_mask_fade_param = { - 19, /* size in bytes */ + 22, /* size in bytes */ 10, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[10]) { - { "cfg_coords_x1", 5, 0, 0, ctypes_i16, 0 }, - { "cfg_coords_x2", 9, 0, 0, ctypes_i16, 0 }, - { "cfg_coords_y1", 7, 0, 0, ctypes_i16, 0 }, - { "cfg_coords_y2", 11, 0, 0, ctypes_i16, 0 }, - { "cfg_opa_bottom", 18, 0, 0, ctypes_u8, 0 }, - { "cfg_opa_top", 17, 0, 0, ctypes_u8, 0 }, - { "cfg_y_bottom", 15, 0, 0, ctypes_i16, 0 }, - { "cfg_y_top", 13, 0, 0, ctypes_i16, 0 }, + { "cfg_coords_x1", 8, 0, 0, ctypes_i16, 0 }, + { "cfg_coords_x2", 12, 0, 0, ctypes_i16, 0 }, + { "cfg_coords_y1", 10, 0, 0, ctypes_i16, 0 }, + { "cfg_coords_y2", 14, 0, 0, ctypes_i16, 0 }, + { "cfg_opa_bottom", 21, 0, 0, ctypes_u8, 0 }, + { "cfg_opa_top", 20, 0, 0, ctypes_u8, 0 }, + { "cfg_y_bottom", 18, 0, 0, ctypes_i16, 0 }, + { "cfg_y_top", 16, 0, 0, ctypes_i16, 0 }, { "dsc_cb", 0, 0, 0, ctypes_ptr32, 0 }, { "dsc_type", 4, 0, 0, ctypes_u8, 0 }, }}; @@ -285,15 +285,15 @@ const be_ctypes_structure_t be_lv_draw_mask_map_param_cfg = { }}; const be_ctypes_structure_t be_lv_draw_mask_map_param = { - 17, /* size in bytes */ + 20, /* size in bytes */ 7, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[7]) { - { "cfg_coords_x1", 5, 0, 0, ctypes_i16, 0 }, - { "cfg_coords_x2", 9, 0, 0, ctypes_i16, 0 }, - { "cfg_coords_y1", 7, 0, 0, ctypes_i16, 0 }, - { "cfg_coords_y2", 11, 0, 0, ctypes_i16, 0 }, - { "cfg_map", 13, 0, 0, ctypes_ptr32, 0 }, + { "cfg_coords_x1", 8, 0, 0, ctypes_i16, 0 }, + { "cfg_coords_x2", 12, 0, 0, ctypes_i16, 0 }, + { "cfg_coords_y1", 10, 0, 0, ctypes_i16, 0 }, + { "cfg_coords_y2", 14, 0, 0, ctypes_i16, 0 }, + { "cfg_map", 16, 0, 0, ctypes_ptr32, 0 }, { "dsc_cb", 0, 0, 0, ctypes_ptr32, 0 }, { "dsc_type", 4, 0, 0, ctypes_u8, 0 }, }}; @@ -330,77 +330,77 @@ const be_ctypes_structure_t be_lv_meter_scale = { }}; const be_ctypes_structure_t be_lv_meter_indicator = { - 17, /* size in bytes */ + 20, /* size in bytes */ 5, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[5]) { - { "end_value", 13, 0, 0, ctypes_i32, 0 }, + { "end_value", 16, 0, 0, ctypes_i32, 0 }, { "opa", 8, 0, 0, ctypes_u8, 0 }, { "scale", 0, 0, 0, ctypes_ptr32, 0 }, - { "start_value", 9, 0, 0, ctypes_i32, 0 }, + { "start_value", 12, 0, 0, ctypes_i32, 0 }, { "type", 4, 0, 0, ctypes_i32, 0 }, }}; const be_ctypes_structure_t be_lv_meter_indicator_needle_img = { - 25, /* size in bytes */ + 28, /* size in bytes */ 8, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[8]) { - { "end_value", 13, 0, 0, ctypes_i32, 0 }, + { "end_value", 16, 0, 0, ctypes_i32, 0 }, { "opa", 8, 0, 0, ctypes_u8, 0 }, - { "pivot_x", 21, 0, 0, ctypes_i16, 0 }, - { "pivot_y", 23, 0, 0, ctypes_i16, 0 }, + { "pivot_x", 24, 0, 0, ctypes_i16, 0 }, + { "pivot_y", 26, 0, 0, ctypes_i16, 0 }, { "scale", 0, 0, 0, ctypes_ptr32, 0 }, - { "src", 17, 0, 0, ctypes_ptr32, 0 }, - { "start_value", 9, 0, 0, ctypes_i32, 0 }, + { "src", 20, 0, 0, ctypes_ptr32, 0 }, + { "start_value", 12, 0, 0, ctypes_i32, 0 }, { "type", 4, 0, 0, ctypes_i32, 0 }, }}; const be_ctypes_structure_t be_lv_meter_indicator_needle_line = { - 23, /* size in bytes */ + 26, /* size in bytes */ 8, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[8]) { - { "color", 21, 0, 0, ctypes_u16, 1 }, - { "end_value", 13, 0, 0, ctypes_i32, 0 }, + { "color", 24, 0, 0, ctypes_u16, 1 }, + { "end_value", 16, 0, 0, ctypes_i32, 0 }, { "opa", 8, 0, 0, ctypes_u8, 0 }, - { "r_mod", 19, 0, 0, ctypes_i16, 0 }, + { "r_mod", 22, 0, 0, ctypes_i16, 0 }, { "scale", 0, 0, 0, ctypes_ptr32, 0 }, - { "start_value", 9, 0, 0, ctypes_i32, 0 }, + { "start_value", 12, 0, 0, ctypes_i32, 0 }, { "type", 4, 0, 0, ctypes_i32, 0 }, - { "width", 17, 0, 0, ctypes_u16, 0 }, + { "width", 20, 0, 0, ctypes_u16, 0 }, }}; const be_ctypes_structure_t be_lv_meter_indicator_arc = { + 32, /* size in bytes */ + 9, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[9]) { + { "color", 28, 0, 0, ctypes_u16, 1 }, + { "end_value", 16, 0, 0, ctypes_i32, 0 }, + { "opa", 8, 0, 0, ctypes_u8, 0 }, + { "r_mod", 30, 0, 0, ctypes_i16, 0 }, + { "scale", 0, 0, 0, ctypes_ptr32, 0 }, + { "src", 24, 0, 0, ctypes_ptr32, 0 }, + { "start_value", 12, 0, 0, ctypes_i32, 0 }, + { "type", 4, 0, 0, ctypes_i32, 0 }, + { "width", 20, 0, 0, ctypes_u16, 0 }, +}}; + +const be_ctypes_structure_t be_lv_meter_indicator_scale_lines = { 27, /* size in bytes */ 9, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[9]) { - { "color", 23, 0, 0, ctypes_u16, 1 }, - { "end_value", 13, 0, 0, ctypes_i32, 0 }, - { "opa", 8, 0, 0, ctypes_u8, 0 }, - { "r_mod", 25, 0, 0, ctypes_i16, 0 }, - { "scale", 0, 0, 0, ctypes_ptr32, 0 }, - { "src", 19, 0, 0, ctypes_ptr32, 0 }, - { "start_value", 9, 0, 0, ctypes_i32, 0 }, - { "type", 4, 0, 0, ctypes_i32, 0 }, - { "width", 17, 0, 0, ctypes_u16, 0 }, -}}; - -const be_ctypes_structure_t be_lv_meter_indicator_scale_lines = { - 24, /* size in bytes */ - 9, /* number of elements */ - be_ctypes_instance_mappings, - (const be_ctypes_structure_item_t[9]) { - { "color_end", 21, 0, 0, ctypes_u16, 1 }, - { "color_start", 19, 0, 0, ctypes_u16, 1 }, - { "end_value", 13, 0, 0, ctypes_i32, 0 }, - { "local_grad", 23, 0, 1, ctypes_bf, 0 }, + { "color_end", 24, 0, 0, ctypes_u16, 1 }, + { "color_start", 22, 0, 0, ctypes_u16, 1 }, + { "end_value", 16, 0, 0, ctypes_i32, 0 }, + { "local_grad", 26, 0, 1, ctypes_bf, 0 }, { "opa", 8, 0, 0, ctypes_u8, 0 }, { "scale", 0, 0, 0, ctypes_ptr32, 0 }, - { "start_value", 9, 0, 0, ctypes_i32, 0 }, + { "start_value", 12, 0, 0, ctypes_i32, 0 }, { "type", 4, 0, 0, ctypes_i32, 0 }, - { "width_mod", 17, 0, 0, ctypes_i16, 0 }, + { "width_mod", 20, 0, 0, ctypes_i16, 0 }, }}; const be_ctypes_structure_t be_lv_obj_class = { diff --git a/tasmota/berry/modules/ctypes.be b/tasmota/berry/modules/ctypes.be index 395558639..929e97ebc 100644 --- a/tasmota/berry/modules/ctypes.be +++ b/tasmota/berry/modules/ctypes.be @@ -358,12 +358,12 @@ class structure #- we are not byte aligned, let's re-aling -# self.cur_offset += 1 self.bit_offset = 0 + end - #- check 2/4 bytes alignment -# - if self.cur_offset % n != 0 - # we are not aligned with current size - self.cur_offset += n - self.cur_offset % n - end + #- check 2/4 bytes alignment -# + if self.cur_offset % n != 0 + # we are not aligned with current size + self.cur_offset += n - self.cur_offset % n end end diff --git a/tasmota/berry/modules/energy_ctypes.be b/tasmota/berry/modules/energy_ctypes.be index a7109e69c..c95d9a593 100644 --- a/tasmota/berry/modules/energy_ctypes.be +++ b/tasmota/berry/modules/energy_ctypes.be @@ -39,19 +39,38 @@ energy_struct = [ [float, "frequency"], [float, "frequency_2"], [float, "frequency_3"], -# relocate SDM630_IMPORT and SDM72_IMPEXP + [float, "import_active"], + [float, "import_active_2"], + [float, "import_active_3"], [float, "export_active"], [float, "export_active_2"], [float, "export_active_3"], - [float, "start_energy"], + [float, "start_energy_2"], + [float, "start_energy_3"], [float, "daily"], + [float, "daily_2"], + [float, "daily_3"], [float, "total"], + [float, "total_2"], + [float, "total_3"], + + [float, "daily_sum"], + [float, "total_sum"], + [float, "yesterday_sum"], [uint32, "today_delta_kwh"], + [uint32, "today_delta_kwh_2"], + [uint32, "today_delta_kwh_3"], [uint32, "today_offset_kwh"], + [uint32, "today_offset_kwh_2"], + [uint32, "today_offset_kwh_3"], [uint32, "today_kwh"], + [uint32, "today_kwh_2"], + [uint32, "today_kwh_3"], [uint32, "period"], + [uint32, "period_2"], + [uint32, "period_3"], [uint8, "fifth_second"], [uint8, "command_code"], @@ -91,7 +110,6 @@ energy_struct = [ [bool, "min_current_flag"], [bool, "max_current_flag"], - [uint8, "stuff"], # #ifdef USE_ENERGY_POWER_LIMIT [uint16, "mplh_counter"], [uint16, "mplw_counter"],