void screen_init(lv_obj_t *parent)
{
ta_best_load_ratio_val_1 = lv_textarea_create(guider_ui.ECO_page_container_eco_page_cont);
lv_obj_set_pos(ta_best_load_ratio_val_1, 279, 134);
lv_obj_set_size(ta_best_load_ratio_val_1, 104, 30);
lv_obj_set_style_bg_color(ta_best_load_ratio_val_1, lv_color_hex(0xE8E8E8), 0);
lv_obj_set_style_text_font(ta_best_load_ratio_val_1, &lv_font_NotoSans_Regular_18, 0);
lv_obj_add_event_cb(ta_best_load_ratio_val_1, ta_focus_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_best_load_ratio_val_1, ta_done_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_best_load_ratio_val_1, textarea_event_cb, LV_EVENT_ALL, NULL);
lv_obj_clear_flag(ta_best_load_ratio_val_1, LV_OBJ_FLAG_SCROLLABLE);
lv_textarea_set_cursor_pos(ta_best_load_ratio_val_1, -1);
lv_textarea_set_one_line(ta_best_load_ratio_val_1, true);
ta_eco_cycle_period_val_1 = lv_textarea_create(guider_ui.ECO_page_container_eco_page_cont);
lv_obj_set_pos(ta_eco_cycle_period_val_1, 279, 180);
lv_obj_set_size(ta_eco_cycle_period_val_1, 104, 30);
lv_obj_set_style_bg_color(ta_eco_cycle_period_val_1, lv_color_hex(0xD8D8D8), 0);
lv_obj_set_style_text_font(ta_eco_cycle_period_val_1, &lv_font_NotoSans_Regular_18, 0);
lv_obj_add_event_cb(ta_eco_cycle_period_val_1, ta_focus_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_eco_cycle_period_val_1, ta_done_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_eco_cycle_period_val_1, textarea_event_cb, LV_EVENT_ALL, NULL);
lv_obj_clear_flag(ta_eco_cycle_period_val_1, LV_OBJ_FLAG_SCROLLABLE);
lv_textarea_set_cursor_pos(ta_eco_cycle_period_val_1, -1);
lv_textarea_set_one_line(ta_eco_cycle_period_val_1, true);
ta_eco_min_module_no_val_1 = lv_textarea_create(guider_ui.ECO_page_container_eco_page_cont);
lv_obj_set_pos(ta_eco_min_module_no_val_1, 693, 88);
lv_obj_set_size(ta_eco_min_module_no_val_1, 104, 30);
lv_obj_set_style_bg_color(ta_eco_min_module_no_val_1, lv_color_hex(0xD8D8D8), 0);
lv_obj_set_style_text_font(ta_eco_min_module_no_val_1, &lv_font_NotoSans_Regular_18, 0);
lv_obj_add_event_cb(ta_eco_min_module_no_val_1, ta_focus_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_eco_min_module_no_val_1, ta_done_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_eco_min_module_no_val_1, textarea_event_cb, LV_EVENT_ALL, NULL);
lv_obj_clear_flag(ta_eco_min_module_no_val_1, LV_OBJ_FLAG_SCROLLABLE);
lv_textarea_set_cursor_pos(ta_eco_min_module_no_val_1, -1);
lv_textarea_set_one_line(ta_eco_min_module_no_val_1, true);
ta_rect_save_stop_val_1 = lv_textarea_create(guider_ui.ECO_page_container_eco_page_cont);
lv_obj_set_pos(ta_rect_save_stop_val_1, 693, 134);
lv_obj_set_size(ta_rect_save_stop_val_1, 104, 30);
lv_obj_set_style_bg_color(ta_rect_save_stop_val_1, lv_color_hex(0xE8E8E8), 0);
lv_obj_set_style_text_font(ta_rect_save_stop_val_1, &lv_font_NotoSans_Regular_18, 0);
lv_obj_add_event_cb(ta_rect_save_stop_val_1, ta_focus_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_rect_save_stop_val_1, ta_done_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_rect_save_stop_val_1, textarea_event_cb, LV_EVENT_ALL, NULL);
lv_obj_clear_flag(ta_rect_save_stop_val_1, LV_OBJ_FLAG_SCROLLABLE);
lv_textarea_set_cursor_pos(ta_rect_save_stop_val_1, -1);
lv_textarea_set_one_line(ta_rect_save_stop_val_1, true);
ta_dry_time_val_1 = lv_textarea_create(guider_ui.ECO_page_container_eco_page_cont);
lv_obj_set_pos(ta_dry_time_val_1, 693, 180);
lv_obj_set_size(ta_dry_time_val_1, 104, 30);
lv_obj_set_style_bg_color(ta_dry_time_val_1, lv_color_hex(0xD8D8D8), 0);
lv_obj_set_style_text_font(ta_dry_time_val_1, &lv_font_NotoSans_Regular_18, 0);
lv_obj_add_event_cb(ta_dry_time_val_1, ta_focus_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_dry_time_val_1, ta_done_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_dry_time_val_1, textarea_event_cb, LV_EVENT_ALL, NULL);
lv_obj_clear_flag(ta_dry_time_val_1, LV_OBJ_FLAG_SCROLLABLE);
lv_textarea_set_cursor_pos(ta_dry_time_val_1, -1);
lv_textarea_set_one_line(ta_dry_time_val_1, true);
ta_best_load_ratio_val_2 = lv_textarea_create(guider_ui.ECO_page_container_eco_page_cont);
lv_obj_set_pos(ta_best_load_ratio_val_2, 279, 303);
lv_obj_set_size(ta_best_load_ratio_val_2, 104, 30);
lv_obj_set_style_bg_color(ta_best_load_ratio_val_2, lv_color_hex(0xE8E8E8), 0);
lv_obj_set_style_text_font(ta_best_load_ratio_val_2, &lv_font_NotoSans_Regular_18, 0);
lv_obj_add_event_cb(ta_best_load_ratio_val_2, ta_focus_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_best_load_ratio_val_2, ta_done_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_best_load_ratio_val_2, textarea_event_cb, LV_EVENT_ALL, NULL);
lv_obj_clear_flag(ta_best_load_ratio_val_2, LV_OBJ_FLAG_SCROLLABLE);
lv_textarea_set_cursor_pos(ta_best_load_ratio_val_2, -1);
lv_textarea_set_one_line(ta_best_load_ratio_val_2, true);
ta_eco_cycle_period_val_2 = lv_textarea_create(guider_ui.ECO_page_container_eco_page_cont);
lv_obj_set_pos(ta_eco_cycle_period_val_2, 279, 349);
lv_obj_set_size(ta_eco_cycle_period_val_2, 104, 30);
lv_obj_set_style_bg_color(ta_eco_cycle_period_val_2, lv_color_hex(0xD8D8D8), 0);
lv_obj_set_style_text_font(ta_eco_cycle_period_val_2, &lv_font_NotoSans_Regular_18, 0);
lv_obj_add_event_cb(ta_eco_cycle_period_val_2, ta_focus_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_eco_cycle_period_val_2, ta_done_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_eco_cycle_period_val_2, textarea_event_cb, LV_EVENT_ALL, NULL);
lv_obj_clear_flag(ta_eco_cycle_period_val_2, LV_OBJ_FLAG_SCROLLABLE);
lv_textarea_set_cursor_pos(ta_eco_cycle_period_val_2, -1);
lv_textarea_set_one_line(ta_eco_cycle_period_val_2, true);
ta_eco_min_module_no_val_2 = lv_textarea_create(guider_ui.ECO_page_container_eco_page_cont);
lv_obj_set_pos(ta_eco_min_module_no_val_2, 693, 257);
lv_obj_set_size(ta_eco_min_module_no_val_2, 104, 30);
lv_obj_set_style_bg_color(ta_eco_min_module_no_val_2, lv_color_hex(0xD8D8D8), 0);
lv_obj_set_style_text_font(ta_eco_min_module_no_val_2, &lv_font_NotoSans_Regular_18, 0);
lv_obj_add_event_cb(ta_eco_min_module_no_val_2, ta_focus_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_eco_min_module_no_val_2, ta_done_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_eco_min_module_no_val_2, textarea_event_cb, LV_EVENT_ALL, NULL);
lv_obj_clear_flag(ta_eco_min_module_no_val_2, LV_OBJ_FLAG_SCROLLABLE);
lv_textarea_set_one_line(ta_eco_min_module_no_val_2, true);
lv_textarea_set_max_length(ta_eco_min_module_no_val_2, 5);
lv_textarea_set_cursor_pos(ta_eco_min_module_no_val_2, -1);
ta_dcdc_save_stop_val_2 = lv_textarea_create(guider_ui.ECO_page_container_eco_page_cont);
lv_obj_set_pos(ta_dcdc_save_stop_val_2, 693, 303);
lv_obj_set_size(ta_dcdc_save_stop_val_2, 104, 30);
lv_obj_set_style_bg_color(ta_dcdc_save_stop_val_2, lv_color_hex(0xE8E8E8), 0);
lv_obj_set_style_text_font(ta_dcdc_save_stop_val_2, &lv_font_NotoSans_Regular_18, 0);
lv_obj_add_event_cb(ta_dcdc_save_stop_val_2, ta_focus_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_dcdc_save_stop_val_2, ta_done_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_dcdc_save_stop_val_2, textarea_event_cb, LV_EVENT_ALL, NULL);
lv_textarea_set_one_line(ta_dcdc_save_stop_val_2, true);
lv_obj_clear_flag(ta_dcdc_save_stop_val_2, LV_OBJ_FLAG_SCROLLABLE);
lv_textarea_set_cursor_pos(ta_dcdc_save_stop_val_2, -1);
ta_dry_time_val_2 = lv_textarea_create(guider_ui.ECO_page_container_eco_page_cont);
lv_obj_set_pos(ta_dry_time_val_2, 693, 349);
lv_obj_set_size(ta_dry_time_val_2, 104, 30);
lv_obj_set_style_bg_color(ta_dry_time_val_2, lv_color_hex(0xD8D8D8), 0);
lv_obj_set_style_text_font(ta_dry_time_val_2, &lv_font_NotoSans_Regular_18, 0);
lv_obj_add_event_cb(ta_dry_time_val_2, ta_focus_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_dry_time_val_2, ta_done_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_dry_time_val_2, textarea_event_cb, LV_EVENT_ALL, NULL);
lv_textarea_set_one_line(ta_dry_time_val_2, true);
lv_obj_clear_flag(ta_dry_time_val_2, LV_OBJ_FLAG_SCROLLABLE);
lv_textarea_set_cursor_pos(ta_dry_time_val_2, -1);
ta_ipv4_addr = lv_textarea_create(guider_ui.network_setting_page_network_setting_cont);
lv_obj_set_pos(ta_ipv4_addr, 234, 105); // adjust position
lv_obj_set_size(ta_ipv4_addr, 200, 30); // adjust size
lv_obj_set_style_bg_color(ta_ipv4_addr, lv_color_hex(0xE8E8E8), 0);
lv_obj_set_style_text_font(ta_ipv4_addr, &lv_font_NotoSans_Regular_18, 0);
lv_textarea_set_placeholder_text(ta_ipv4_addr, "IPv4 Address");
lv_obj_add_event_cb(ta_ipv4_addr, ta_focus_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_ipv4_addr, ta_done_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_ipv4_addr, textarea_event_cb, LV_EVENT_ALL, NULL);
lv_obj_clear_flag(ta_ipv4_addr, LV_OBJ_FLAG_SCROLLABLE);
lv_textarea_set_cursor_pos(ta_ipv4_addr, -1);
lv_textarea_set_one_line(ta_ipv4_addr, true);
// IPv4 Subnet Mask
ta_ipv4_mask = lv_textarea_create(guider_ui.network_setting_page_network_setting_cont);
lv_obj_set_pos(ta_ipv4_mask, 234, 152);
lv_obj_set_size(ta_ipv4_mask, 200, 30);
lv_obj_set_style_bg_color(ta_ipv4_mask, lv_color_hex(0xD8D8D8), 0);
lv_obj_set_style_text_font(ta_ipv4_mask, &lv_font_NotoSans_Regular_18, 0);
lv_textarea_set_placeholder_text(ta_ipv4_mask, "Subnet Mask");
lv_obj_add_event_cb(ta_ipv4_mask, ta_focus_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_ipv4_mask, ta_done_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_ipv4_mask, textarea_event_cb, LV_EVENT_ALL, NULL);
lv_obj_clear_flag(ta_ipv4_mask, LV_OBJ_FLAG_SCROLLABLE);
lv_textarea_set_cursor_pos(ta_ipv4_mask, -1);
lv_textarea_set_one_line(ta_ipv4_mask, true);
// IPv4 Gateway
ta_ipv4_gw = lv_textarea_create(guider_ui.network_setting_page_network_setting_cont);
lv_obj_set_pos(ta_ipv4_gw, 234, 199);
lv_obj_set_size(ta_ipv4_gw, 200, 30);
lv_obj_set_style_bg_color(ta_ipv4_gw, lv_color_hex(0xE8E8E8), 0);
lv_obj_set_style_text_font(ta_ipv4_gw, &lv_font_NotoSans_Regular_18, 0);
lv_textarea_set_placeholder_text(ta_ipv4_gw, "Gateway");
lv_obj_add_event_cb(ta_ipv4_gw, ta_focus_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_ipv4_gw, ta_done_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta_ipv4_gw, textarea_event_cb, LV_EVENT_ALL, NULL);
lv_obj_clear_flag(ta_ipv4_gw, LV_OBJ_FLAG_SCROLLABLE);
lv_textarea_set_cursor_pos(ta_ipv4_gw, -1);
lv_textarea_set_one_line(ta_ipv4_gw, true);
/* 1) Create one keyboard */
kb = lv_keyboard_create(parent);
lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN);
lv_obj_set_size(kb, LV_PCT(100), LV_PCT(40));
// lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_TEXT_LOWER);
lv_obj_align(kb, LV_ALIGN_BOTTOM_MID, 0, 0);
// lv_keyboard_set_cursor_manage(kb, true);
}
this i am calling at event handler as
static void menu_page_eco_btn_event_handler (lv_event_t *e)
{
lv_event_code_t code = lv_event_get_code(e);
switch (code) {
case LV_EVENT_CLICKED:
{
ui_load_scr_animation(&guider_ui, &guider_ui.ECO_page_container, guider_ui.ECO_page_container_del, &guider_ui.menu_page_del, setup_scr_ECO_page_container, LV_SCR_LOAD_ANIM_FADE_ON, 200, 200, true, false);
create_alarm_bar(guider_ui.ECO_page_container_eco_page_cont);
// Ensure it's visible when Overview page is loaded
lv_obj_clear_flag(alarm_bar, LV_OBJ_FLAG_HIDDEN);
screen_init(guider_ui.ECO_page_container);
break;
}
default:
break;
}
}
and i am including free memory of current screen so in the backend a thread in which a client is trying to update values to the above created text areas will be running when this backend is including at that time only seg fault is coming but upon clicking just frontend without any backend which access text areas by creating upon clicking eco btn no seg fault is noticed.
Is there any specific method of accessing textareas created by above init function in click event handler.
Also the
LcdHandler_Init(); function for text areas updating is being called at
int main(void)
{
/* Initialize LVGL */
lv_init();
/* Initialize the HAL (display, input devices) for LVGL */
hal_init();
/* Create a GUI-Guider app */
setup_ui(&guider_ui);
events_init(&guider_ui);
custom_init(&guider_ui);
// Initialize the LCD handler and DBus connection
LcdHandler_Init();
#if LV_USE_VIDEO
pthread_create(&video_thread, NULL, videoPlayThread, NULL);
#endif
/* Handle LVGL tasks */
#if LV_USE_WAYLAND
bool completed;
while (1) {
completed = lv_wayland_timer_handler();
if (completed) {
/* wait only if the cycle was completed */
usleep(LV_DEF_REFR_PERIOD * 1000);
}
/* Run until the last window closes */
if (!lv_wayland_window_is_open(NULL)) {
break;
}
}
#else
uint32_t idle_time;
while(1) {
/* Return the time to the next timer execution */
idle_time = lv_timer_handler();
usleep(idle_time * 1000);
}
#endif
return 0;
}
Also the memory size we allocated is 1535998 kb
Please look into meta layer where custom files are being added
please reach out with quick response as soon as possible.
It's very critical team,