bug:10415 修复进入network会黑屏一段时间

This commit is contained in:
xiehongyan 2023-12-19 10:06:17 +08:00
parent 1724927f57
commit 453ca794d5
3 changed files with 21 additions and 18 deletions

BIN
BSP/linux-kernel/.48720.tmp Normal file

Binary file not shown.

View File

@ -380,9 +380,9 @@ static void network_scan_task_cb(lv_task_t* task)
int fd = -1; int fd = -1;
int BuffLen; int BuffLen;
unsigned char Buff[1024] = { 0 }; unsigned char Buff[1024] = { 0 };
//lv_label_set_text(plabel, "\n\nSearching...");
lv_obj_t* obj = (lv_obj_t*)task->user_data; lv_obj_t* obj = (lv_obj_t*)task->user_data;
printf("[%s]Check simcard...\n", __FUNCTION__);
if(Countdown) if(Countdown)
{ {
printf("[%s]Countdown:%d\n", __FUNCTION__, Countdown); printf("[%s]Countdown:%d\n", __FUNCTION__, Countdown);
@ -399,7 +399,6 @@ static void network_scan_task_cb(lv_task_t* task)
return; return;
} }
} }
printf("[%s][*x] Check simcard...\n", __FUNCTION__);
if(sf_cardv_4G_status_get() == SF_4G_SEARCHING) if(sf_cardv_4G_status_get() == SF_4G_SEARCHING)
{ {
printf("[%s]Searching...\n", __FUNCTION__); printf("[%s]Searching...\n", __FUNCTION__);
@ -414,10 +413,7 @@ static void network_scan_task_cb(lv_task_t* task)
} }
else if(sf_cardv_get_is_esim() == 0) else if(sf_cardv_get_is_esim() == 0)
{ {
lv_label_set_text(plabel, "Network selection is only available with SIM cards that have multiple networks."); lv_label_set_text(plabel, "\nNetwork selection is only available with SIM cards that have multiple networks.");
float fontHeight = lv_font_get_line_height(LV_FONT_DEFAULT);
float verPad = (50 - fontHeight)/2;
lv_obj_set_style_pad_top(plabel, verPpad, 0);
Countdown = 3; Countdown = 3;
return; return;
} }
@ -556,12 +552,21 @@ void show_Network_Selection_page(lv_obj_t* obj, lv_obj_t* menu_obj)
lv_label_set_long_mode(plabel, LV_LABEL_LONG_BREAK); lv_label_set_long_mode(plabel, LV_LABEL_LONG_BREAK);
//lv_label_set_align(plabel, LV_LABEL_ALIGN_CENTER); //lv_label_set_align(plabel, LV_LABEL_ALIGN_CENTER);
lv_label_set_text(plabel, ""); lv_label_set_text(plabel, "");
lv_obj_set_pos(plabel, 32, 63); lv_obj_set_pos(plabel, 32, 67);
lv_obj_set_width(plabel, 256); lv_obj_set_width(plabel, 256);
lv_obj_add_style(plabel, 0, &gMatrixStylebtn); lv_obj_add_style(plabel, 0, &gMatrixStylebtn);
lv_task_t tas = {
0,
0,
NULL,
NULL,
0,
3,
};
network_scan_task_cb(&tas);
if(network_scan_task == NULL){ if(network_scan_task == NULL){
Countdown = 0; Countdown = 0;
network_scan_task = lv_task_create(network_scan_task_cb, 1000, LV_TASK_PRIO_MID, (void*)obj); network_scan_task = lv_task_create(network_scan_task_cb, 1000, LV_TASK_PRIO_HIGHEST, (void*)obj);
} }
} }

View File

@ -380,9 +380,9 @@ static void network_scan_task_cb(lv_task_t* task)
int fd = -1; int fd = -1;
int BuffLen; int BuffLen;
unsigned char Buff[1024] = { 0 }; unsigned char Buff[1024] = { 0 };
//lv_label_set_text(plabel, "\n\nSearching...");
lv_obj_t* obj = (lv_obj_t*)task->user_data; lv_obj_t* obj = (lv_obj_t*)task->user_data;
printf("[%s][*x] Check simcard...\n", __FUNCTION__);
if(Countdown) if(Countdown)
{ {
printf("[%s]Countdown:%d\n", __FUNCTION__, Countdown); printf("[%s]Countdown:%d\n", __FUNCTION__, Countdown);
@ -399,7 +399,6 @@ static void network_scan_task_cb(lv_task_t* task)
return; return;
} }
} }
printf("[%s][*x] Check simcard...\n", __FUNCTION__);
if(sf_cardv_4G_status_get() == SF_4G_SEARCHING) if(sf_cardv_4G_status_get() == SF_4G_SEARCHING)
{ {
printf("[%s]Searching...\n", __FUNCTION__); printf("[%s]Searching...\n", __FUNCTION__);
@ -414,10 +413,7 @@ static void network_scan_task_cb(lv_task_t* task)
} }
else if(sf_cardv_get_is_esim() == 0) else if(sf_cardv_get_is_esim() == 0)
{ {
lv_label_set_text(plabel, "Network selection is only available with SIM cards that have multiple networks."); lv_label_set_text(plabel, "\nNetwork selection is only available with SIM cards that have multiple networks.");
float fontHeight = lv_font_get_line_height(LV_FONT_DEFAULT);
float verPad = (50 - fontHeight)/2;
lv_obj_set_style_pad_top(plabel, verPpad, 0);
Countdown = 3; Countdown = 3;
return; return;
} }
@ -556,12 +552,14 @@ void show_Network_Selection_page(lv_obj_t* obj, lv_obj_t* menu_obj)
lv_label_set_long_mode(plabel, LV_LABEL_LONG_BREAK); lv_label_set_long_mode(plabel, LV_LABEL_LONG_BREAK);
//lv_label_set_align(plabel, LV_LABEL_ALIGN_CENTER); //lv_label_set_align(plabel, LV_LABEL_ALIGN_CENTER);
lv_label_set_text(plabel, ""); lv_label_set_text(plabel, "");
lv_obj_set_pos(plabel, 32, 63); lv_obj_set_pos(plabel, 32, 67);
lv_obj_set_width(plabel, 256); lv_obj_set_width(plabel, 256);
lv_obj_add_style(plabel, 0, &gMatrixStylebtn); lv_obj_add_style(plabel, 0, &gMatrixStylebtn);
lv_task_t tas = {};
network_scan_task_cb(&tas);
if(network_scan_task == NULL){ if(network_scan_task == NULL){
Countdown = 0; Countdown = 0;
network_scan_task = lv_task_create(network_scan_task_cb, 1000, LV_TASK_PRIO_MID, (void*)obj); network_scan_task = lv_task_create(network_scan_task_cb, 1000, LV_TASK_PRIO_HIGHEST, (void*)obj);
} }
} }