How to solve this problem “Error: _lv_style_list_get_opa (lv_style.c #854 _lv_style_list_get_opa()) ”

Description

qualcomm msm8909

What LVGL version are you using?

“version”: “6.1.1”,

What do you want to achieve?

  • I want to make a FCT test page

What have you tried so far?

I tried to keep initializing style and keep adding style, but the problem remained *

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*********************
 *      INCLUDES
 *********************/
#include "./lv_examples/lv_examples.h"
#include "lv_ui_design.h"
#include "./lvgl/lvgl.h"
#include "common.h"
#include "module.h"
#include "func_map.h"
#include "mmi.h"
#include "utils.h"
#if LV_USE_DEMO_WIDGETS

/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/

/**********************
 *  STATIC PROTOTYPES
 **********************/
#if LV_USE_THEME_MATERIAL
static void color_chg_event_cb(lv_obj_t * sw, lv_event_t e);
#endif
#if LV_DEMO_WIDGETS_SLIDESHOW
static void tab_content_anim_create(lv_obj_t * parent);
static void tab_changer_task_cb(lv_task_t * task);
#endif

/******************************************
 *  banson add the definiton for ui design
 *****************************************/
#define LISTVIEW_W 600
#define LISTVIEW_H 1000
#define BUF_SIZE 1024
#define MCAMERA_PREVIEW_CMD "gst-launch-1.0 quectelmipisrc device=/dev/video0 ! 'video/x-raw, width=640, height=480,format=NV12' ! videoconvert! fbdevsink device=/dev/fb0"
#define FCAMERA_PREVIEW_CMD "gst-launch-1.0 quectelmipisrc device=/dev/video1 ! 'video/x-raw, width=640, height=480,format=NV12' ! videoconvert! fbdevsink device=/dev/fb0"

static lv_obj_t * list_t = NULL;
static char item_name[64] = {0};
static int item_num;
static pthread_t close_testwindow_tid = 0;
static pthread_t run_all_tid = 0;
static pthread_t camera_preview_tid = 0;
static pthread_t info_view_tid = 0;
static pthread_t monitor_key_tid = 0;
static pthread_mutex_t res_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t thread_mutex = PTHREAD_MUTEX_INITIALIZER;
static lv_obj_t* mainwindows=NULL;
static lv_obj_t* testwindows=NULL;
static lv_obj_t* btn_home = NULL;
static lv_obj_t* btn_menu = NULL;
static lv_obj_t* btn_back = NULL;
static lv_obj_t* btn_vol_up = NULL;
static lv_obj_t* btn_vol_down = NULL;
static lv_obj_t* label_result=NULL;
static lv_obj_t* btn_runall;
static lv_obj_t* btn_up;
static lv_obj_t* btn_down;
static lv_obj_t* btn_reset;
static lv_obj_t* btn_version;
static lv_obj_t* label;
static lv_obj_t* btn_img;
static bool btn_click=false;     //This variable is to be placed into the callback twice 
static int loop_state = 0;

static void lv_list_handler(lv_obj_t *obj, lv_event_t event);
static void lv_add_listview(lv_obj_t * parent);
static void count_result(lv_obj_t * parent)
{
    int pass_num=0;
    int fail_num=0;
    int all_num=0;
    char buf[128]={0};
    if(label_result == NULL)
    {
        label_result = lv_label_create(parent, NULL);
        lv_obj_set_width(label_result, 720);
        lv_label_set_recolor(label_result, true);
        lv_obj_align(label_result, NULL, LV_ALIGN_IN_TOP_LEFT, 30, 80);
        lv_obj_set_style_local_text_font(label_result, LV_LABEL_PART_MAIN,
				LV_STATE_DEFAULT, lv_theme_get_font_subtitle());
    }

    list < module_info * >::iterator iter;
    for(iter = g_ordered_modules.begin(); iter != g_ordered_modules.end(); iter++) 
    {
        module_info *mod = (module_info *) (*iter);
        if(mod != NULL &&  (!mod->config_list[KEY_ENABLE].compare("1")) )
        {
            all_num++;
            if(mod->result==SUCCESS)
            {
                pass_num++;
            }
            else if(mod->result==FAILED)
            {
                fail_num++;
            }
        }
    }
    sprintf(buf,"ALL=%d  PASS=%d  FAIL=%d  NULL=%d",all_num,pass_num,fail_num,all_num-pass_num-fail_num);
    lv_label_set_text(label_result, buf);
}
static void btn_pass_handler(lv_obj_t *obj, lv_event_t event)
{
  //  if(btn_click == false)
    {
        if(event == LV_EVENT_CLICKED) 
        {
            if(obj != NULL)         //This judgment is very important
            {
                //btn_click=true;
                //lv_obj_t *test_win = lv_obj_get_parent(obj);
                if(testwindows){
                    lv_obj_del(testwindows);
                }
                testwindows = NULL;
                module_info *mod = NULL;
                mod = get_module_by_name(item_name);
                module_cleanup(mod);
                process_exit(mod,SUCCESS);
                if(strcmp(item_name,"CAMERA MAIN")==0 || strcmp(item_name,"CAMERA FRONT")==0){
                    pid_t pid = 0;
                    getPidByName(&pid, "gst-launch-1.0");
                    printf("kill the camera preview thread \n");
                    kill_proc(pid);   
                }
            }
        }
    }
}

static void btn_fail_handler(lv_obj_t *obj, lv_event_t event)
{
    //if(btn_click == false)
    {
        if(event == LV_EVENT_CLICKED)    
        {
            if(obj != NULL)          //This judgment is very important
            {
             //   btn_click=true;
                if(testwindows){
                    lv_obj_del(testwindows);
                }
                testwindows = NULL;
                module_info *mod = NULL;
                mod = get_module_by_name(item_name);
                module_cleanup(mod);
                process_exit(mod,FAILED);
                if(strcmp(item_name,"CAMERA MAIN")==0 || strcmp(item_name,"CAMERA FRONT")==0){
                    pid_t pid = 0;
                    getPidByName(&pid, "gst-launch-1.0");
                    printf("kill the camera preview thread \n");
                    kill_proc(pid);   
                }
            }
        }
    }
}

static void *run_all_thread(void *)
{
    int cnt=0;
    list < module_info * >::iterator iter;
    for(iter = g_ordered_modules.begin(); iter != g_ordered_modules.end(); iter++) 
    {
        module_info *mod = (module_info *) (*iter);
        if(mod != NULL &&  (!mod->config_list[KEY_ENABLE].compare("1")) )
        {
            /* global item_name ?  */ 
            memset(item_name,0, sizeof(item_name));
            strcpy(item_name,mod->module);
            item_num=cnt;
            lv_list_handler(NULL,LV_EVENT_CLICKED);
            if(close_testwindow_tid) {
                pthread_join(close_testwindow_tid, NULL);
                close_testwindow_tid = 0;
            }
 
            usleep(1000 * 1000); 
            cnt++;
        }
    }
    lv_btn_set_state(btn_runall, LV_BTN_STATE_RELEASED);
    lv_btn_set_state(btn_reset, LV_BTN_STATE_RELEASED);
    lv_btn_set_state(btn_version, LV_BTN_STATE_RELEASED);
}

static void btn_runall_handler(lv_obj_t *obj, lv_event_t event)
{
    if(event == LV_EVENT_CLICKED){
        lv_btn_set_state(btn_runall, LV_BTN_STATE_DISABLED);
        lv_btn_set_state(btn_reset, LV_BTN_STATE_DISABLED);
        lv_btn_set_state(btn_version, LV_BTN_STATE_DISABLED);
        if(run_all_tid){
            pthread_cancel(run_all_tid);
            pthread_join(run_all_tid, NULL);
            run_all_tid = 0;
        }
        /* bad idea to use pthread */
        pthread_create(&run_all_tid, NULL, run_all_thread, NULL);
    }
}

static void btn_up_handler(lv_obj_t *obj, lv_event_t event)
{
    if(event == LV_EVENT_CLICKED)
        return lv_list_down(list_t);
}

static void btn_down_handler(lv_obj_t *obj, lv_event_t event)
{
    if(event == LV_EVENT_CLICKED) 
        return lv_list_up(list_t);
}

static void mbox_event_handler(lv_obj_t * obj, lv_event_t event)
{
    if(event == LV_EVENT_VALUE_CHANGED)
    { 
        lv_msgbox_stop_auto_close(obj);   
    }
}

static void btn_reset_handler(lv_obj_t *obj, lv_event_t event)
{
    if(event == LV_EVENT_CLICKED) 
    {
        list < module_info * >::iterator iter;
        for(iter = g_ordered_modules.begin(); iter != g_ordered_modules.end(); iter++)
        {
            module_info *mod = (module_info *) (*iter);
            mod->result = ERR_UNKNOW;
            mod->start_time = 0;
            mod->duration = 0;
            memset(mod->data, 0, sizeof(mod->data));
        }
        flush_result();
        lv_list_clean(list_t);
        usleep(1000 *200);
        lv_add_listview(mainwindows);
    }
}

static void btn_version_handler(lv_obj_t *obj, lv_event_t event)
{
/*     static const char * btns[] ={"OK", ""};
    lv_obj_t * mbox_version = lv_msgbox_create(mainwindows, NULL);
    lv_msgbox_set_text(mbox_version, "A message box with one buttons.");
	lv_msgbox_add_btns(mbox_version, btns);
    lv_obj_set_width(mbox_version, 200);
    lv_obj_set_event_cb(mbox_version, mbox_event_handler);
    lv_obj_align(mbox_version, NULL, LV_ALIGN_CENTER, 0, 0);  */
}

static void lv_add_mainwindow_button(lv_obj_t * parent)
{
  

    btn_runall = lv_btn_create(parent, NULL);
    lv_obj_set_size(btn_runall,200,100);
    lv_obj_align(btn_runall, parent, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);//配置btn_runall在父类显示位置
	lv_obj_set_event_cb(btn_runall, btn_runall_handler);
    label = lv_label_create(btn_runall,NULL);
    lv_label_set_text(label, "RUN_ALL");  
    btn_img = lv_img_create(btn_runall,NULL);
    lv_img_set_src(btn_img,LV_SYMBOL_PLAY);

    btn_up = lv_btn_create(parent, NULL);
    lv_obj_set_size(btn_up,120,200);
    lv_obj_align(btn_up, parent, LV_ALIGN_IN_RIGHT_MID, 0, -200);
	lv_obj_set_event_cb(btn_up, btn_up_handler);
    label = lv_label_create(btn_up,NULL);
    lv_label_set_text(label, "UP"); 
    btn_img = lv_img_create(btn_up,NULL);
    lv_img_set_src(btn_img,LV_SYMBOL_UP);

    btn_down = lv_btn_create(parent, NULL);
    lv_obj_set_size(btn_down,120,200);
    lv_obj_align(btn_down, parent, LV_ALIGN_IN_RIGHT_MID, 0, 200);
	lv_obj_set_event_cb(btn_down, btn_down_handler);
    label = lv_label_create(btn_down,NULL);
    lv_label_set_text(label, "DOWN");
    btn_img = lv_img_create(btn_down,NULL);
    lv_img_set_src(btn_img,LV_SYMBOL_DOWN);

    btn_reset = lv_btn_create(parent, NULL);
    lv_obj_set_size(btn_reset,200,100);
    lv_obj_align(btn_reset, parent, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
	lv_obj_set_event_cb(btn_reset, btn_reset_handler);
    label = lv_label_create(btn_reset,NULL);
    lv_label_set_text(label, "RESET");
    btn_img = lv_img_create(btn_reset,NULL);
    lv_img_set_src(btn_img,LV_SYMBOL_REFRESH);

    btn_version = lv_btn_create(parent, NULL);
    lv_obj_set_size(btn_version,200,100);
    lv_obj_align(btn_version, parent, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
	lv_obj_set_event_cb(btn_version, btn_version_handler);
    label = lv_label_create(btn_version,NULL);
    lv_label_set_text(label, "VERSION");
    btn_img = lv_img_create(btn_version,NULL);
    lv_img_set_src(btn_img,LV_SYMBOL_DIRECTORY);
}

static void *info_view_thread(void *)
{
   // signal(SIGUSR1, signal_handler);
    lv_obj_t * label_info;
    label_info = lv_label_create(testwindows, NULL);
    lv_obj_set_width(label_info, 720);
	lv_label_set_recolor(label_info, true);
    lv_obj_align(label_info, NULL, LV_ALIGN_CENTER, -200, -10);
	loop_state = 1;
    while(loop_state == 1)
    {
        if(strstr(label_view,"the light") !=NULL)
            lv_label_set_text(label_info, label_view);
        usleep(1000 *300);
    }
	loop_state = 0;
}

static void *monitor_key_thread(void *)
{
	char label_tmp[20]={0};
    //signal(SIGUSR1, signal_handler);
	loop_state = 1;
    while(loop_state == 1)
    {
        if(label_view!=NULL && strlen(label_view) > 0)
        {
			snprintf(label_tmp, sizeof(label_tmp), "%s", label_view);
            if(strcmp(label_tmp,"home")==0)
            {
                lv_btn_set_state(btn_home, LV_BTN_STATE_PRESSED);
            }
            if(strcmp(label_tmp,"menu")==0)
            {
                lv_btn_set_state(btn_menu, LV_BTN_STATE_PRESSED);
            }
            if(strcmp(label_tmp,"back")==0)
            {
                lv_btn_set_state(btn_back, LV_BTN_STATE_PRESSED);
            }
            if(strcmp(label_tmp,"vol_up")==0)
            {
                lv_btn_set_state(btn_vol_up, LV_BTN_STATE_PRESSED);
            }
            if(strcmp(label_tmp,"vol_down")==0)
            {
                lv_btn_set_state(btn_vol_down, LV_BTN_STATE_PRESSED);
            }
			memset(label_view, 0, sizeof(label_view));
        } else
			usleep(1000*200);
    }
	loop_state = 0;
}

static void lv_add_keytest(lv_obj_t * parent)
{
   lv_obj_t * label;
   lv_obj_t * btn_img;

   btn_home = lv_btn_create(parent, NULL);
   lv_btn_set_state(btn_home, LV_BTN_STATE_RELEASED);
   lv_obj_set_size(btn_home,300,100);
   lv_obj_align(btn_home, parent, LV_ALIGN_CENTER,0, -300);
   label = lv_label_create(btn_home,NULL);
   lv_label_set_text(label, "HOME");
   btn_img = lv_img_create(btn_home,NULL);
   lv_img_set_src(btn_img,LV_SYMBOL_HOME);

   btn_vol_up = lv_btn_create(parent, NULL);
   lv_btn_set_state(btn_vol_up, LV_BTN_STATE_RELEASED);
   lv_obj_set_size(btn_vol_up,300,100);
   lv_obj_align(btn_vol_up, parent, LV_ALIGN_CENTER, 0, -150);
   label = lv_label_create(btn_vol_up,NULL);
   lv_label_set_text(label, "VOL_UP");
   btn_img = lv_img_create(btn_vol_up,NULL);
   lv_img_set_src(btn_img,LV_SYMBOL_VOLUME_MAX);

   btn_vol_down = lv_btn_create(parent, NULL);
   lv_btn_set_state(btn_vol_down, LV_BTN_STATE_RELEASED);
   lv_obj_set_size(btn_vol_down,300,100);
   lv_obj_align(btn_vol_down, parent, LV_ALIGN_CENTER, 0, 0);
   label = lv_label_create(btn_vol_down,NULL);
   lv_label_set_text(label, "VOL_DOWN");
   btn_img = lv_img_create(btn_vol_down,NULL);
   lv_img_set_src(btn_img,LV_SYMBOL_VOLUME_MID);

   btn_menu = lv_btn_create(parent, NULL);
   lv_btn_set_state(btn_menu, LV_BTN_STATE_RELEASED);
   lv_obj_set_size(btn_menu,300,100);
   lv_obj_align(btn_menu, parent, LV_ALIGN_CENTER, 0, 150);
   label = lv_label_create(btn_menu,NULL);
   lv_label_set_text(label, "MENU");
   btn_img = lv_img_create(btn_menu,NULL);
   lv_img_set_src(btn_img,LV_SYMBOL_MINUS);

   btn_back = lv_btn_create(parent, NULL);
   lv_btn_set_state(btn_back, LV_BTN_STATE_RELEASED);
   lv_obj_set_size(btn_back,300,100);
   lv_obj_align(btn_back, parent, LV_ALIGN_CENTER, 0, 300);
   label = lv_label_create(btn_back,NULL);
   lv_label_set_text(label, "BACK");
   btn_img = lv_img_create(btn_back,NULL);
   lv_img_set_src(btn_img,LV_SYMBOL_BACKSPACE);

	pthread_mutex_lock(&thread_mutex);
   if(monitor_key_tid && loop_state == 1){
	   loop_state = 0;

	   if (0) {
		   pthread_cancel(monitor_key_tid);
		   pthread_join(monitor_key_tid, NULL);
		   usleep(10000);
	   }
       monitor_key_tid = 0;
   }
	pthread_mutex_unlock(&thread_mutex);
	usleep(10000);
	pthread_mutex_lock(&thread_mutex);
   pthread_create(&monitor_key_tid, NULL, monitor_key_thread, NULL);
	pthread_mutex_unlock(&thread_mutex);
}

static void *camera_preview_thread(void *)
{
   // signal(SIGUSR1, signal_handler);
    if(strcmp(item_name,"CAMERA MAIN")==0)
        system(MCAMERA_PREVIEW_CMD);
    else if(strcmp(item_name,"CAMERA FRONT")==0)
        system(FCAMERA_PREVIEW_CMD);
}

static void lv_add_testwindow(lv_obj_t * parent)
{
    lv_obj_t * btn_pass;
    lv_obj_t * btn_fail;
    lv_obj_t * label;
    lv_obj_t * label_title;
    lv_obj_t * label_img;
    label_title = lv_label_create(parent, NULL);
    lv_obj_set_width(label_title, 720);
    lv_obj_align(label_title, NULL, LV_ALIGN_IN_TOP_LEFT,(LV_HOR_RES_MAX-strlen(item_name)*30)/2, 10);
    lv_obj_set_style_local_text_font(label_title, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_theme_get_font_title());
    lv_label_set_text(label_title, item_name);

    if(strcmp(item_name,"LIGHT SENSOR")==0) {
        if(info_view_tid){
            pthread_cancel(info_view_tid);
            pthread_join(info_view_tid, NULL);
            info_view_tid = 0;
        }
        pthread_create(&info_view_tid, NULL, info_view_thread, NULL);
    }

    if(strcmp(item_name,"KEY")==0) {
        lv_add_keytest(parent);
    }

    if(strcmp(item_name,"CAMERA MAIN")==0 || strcmp(item_name,"CAMERA FRONT")==0) {
        pid_t pid = 0;
        getPidByName(&pid, "gst-launch-1.0");
        printf("kill the camera preview thread \n");
        kill_proc(pid);   
        if(camera_preview_tid){
            pthread_cancel(camera_preview_tid);
            pthread_join(camera_preview_tid, NULL);
            camera_preview_tid = 0;
			usleep(20000);
        }
        pthread_create(&camera_preview_tid, NULL, camera_preview_thread, NULL);
    }

    btn_pass = lv_btn_create(parent, NULL);
    lv_obj_set_size(btn_pass,360,150);
    lv_obj_align(btn_pass, parent, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
    if(item_num < 9)                  //if the module auto return result,it does not set button callback
	    lv_obj_set_event_cb(btn_pass, btn_pass_handler);   
    label = lv_label_create(btn_pass,NULL);
    label_img = lv_img_create(btn_pass,NULL);
    lv_label_set_text(label, "PASS");
    lv_img_set_src(label_img,LV_SYMBOL_OK);

    btn_fail = lv_btn_create(parent, NULL);
    lv_obj_set_size(btn_fail,360,150);
    lv_obj_align(btn_fail, parent, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
    if(item_num < 9)                 //if the module auto return result,it does not set button callback
	    lv_obj_set_event_cb(btn_fail, btn_fail_handler);
    label = lv_label_create(btn_fail,NULL);
    label_img = lv_img_create(btn_fail,NULL);
    lv_label_set_text(label, "FAIL");
    lv_img_set_src(label_img,LV_SYMBOL_WARNING);
}

static void *wait_closewindows_thread(void *)
{
	int i = 0;
    pid_t pid = -1;
    lv_obj_t * label_result;
    sem_wait(&g_sem_mod_complete);                //wait for module test complete
    usleep(1000);
    if(strcmp(item_name,"CAMERA MAIN")==0 || strcmp(item_name,"CAMERA FRONT")==0)
    {
        getPidByName(&pid, "gst-launch-1.0");
        printf("kill the camera preview thread \n");
        kill_proc(pid);                       
       // pthread_kill(camera_preview_tid,SIGUSR1);
        if(camera_preview_tid){
            pthread_cancel(camera_preview_tid);
            pthread_join(camera_preview_tid, NULL);
            camera_preview_tid = 0;
        }

        usleep(1000 *200);
    }
    if(strcmp(item_name,"LIGHT SENSOR")==0 )
    {        
        //pthread_kill(info_view_tid,SIGUSR1); 
        if(info_view_tid){
            pthread_cancel(info_view_tid);
            pthread_join(info_view_tid, NULL);
            info_view_tid = 0;
        }

        usleep(1000 *200);
    }
    if(strcmp(item_name,"KEY")==0 )
    {        
       // pthread_kill(monitor_key_tid,SIGUSR1); 
		pthread_mutex_lock(&thread_mutex);
        if(monitor_key_tid && loop_state == 1){
		   loop_state = 0;
			if (0) {
				pthread_cancel(monitor_key_tid);
				pthread_join(monitor_key_tid, NULL);
				usleep(20000);
			}
            monitor_key_tid = 0;
        }
		pthread_mutex_unlock(&thread_mutex);
 
        usleep(1000 *200);
    }
    if(item_num > 8)             //auto return result,so the ui will display "detect" or "no detect"
    {   
        if(is_return_result==1)
        {
            label_result = lv_label_create(testwindows, NULL);
            lv_obj_set_width(label_result, 720);
	        lv_label_set_recolor(label_result, true);
            lv_obj_align(label_result, NULL, LV_ALIGN_CENTER, 0, 0);
            lv_label_set_text(label_result, strcat(item_name," = detect"));
        }
        else if(is_return_result==0)
        {
            label_result = lv_label_create(testwindows, NULL);
            lv_obj_set_width(label_result, 720);
	        lv_label_set_recolor(label_result, true);
            lv_obj_align(label_result, NULL, LV_ALIGN_CENTER, 0, 0);
            lv_label_set_text(label_result, strcat(item_name," = no detect"));
        }
        usleep(1000 *1000);
    }
    else 
    {
        usleep(1000 *100);
    }

	memset(item_name, 0, sizeof(item_name));

    if(testwindows != NULL) {
        lv_obj_del(testwindows);
        testwindows = NULL;
	}
    usleep(1000 *100);
    //lv_list_clean(list_t);

    //btn_click=false;
   // usleep(1000 *100);
    count_result(mainwindows);
    lv_add_listview(mainwindows);
    //pthread_exit(NULL);
}

int close_testwindow(char *item_name)
{
    pid_t pid = -1;

	if (item_name == NULL) {
		ALOGI("[%s:%d] item_name is NULL", __func__, __LINE__);
		return -1;
	}

	loop_state = 0;
    if(strcmp(item_name,"CAMERA MAIN") == 0 ||
			strcmp(item_name,"CAMERA FRONT") == 0) {
        getPidByName(&pid, "gst-launch-1.0");
        printf("kill the camera preview thread \n");
        kill_proc(pid);
       // pthread_kill(camera_preview_tid,SIGUSR1);
        if(camera_preview_tid){
            pthread_cancel(camera_preview_tid);
            pthread_join(camera_preview_tid, NULL);
            camera_preview_tid = 0;
        }
    }

    if(strcmp(item_name,"LIGHT SENSOR") == 0){
        //pthread_kill(info_view_tid,SIGUSR1);
        if(info_view_tid && loop_state == 1){
			loop_state = 0;
            pthread_cancel(info_view_tid);
            pthread_join(info_view_tid, NULL);
            info_view_tid = 0;
        }
    }

    if(strcmp(item_name,"KEY") == 0) {
		pthread_mutex_lock(&thread_mutex);
        if(monitor_key_tid && loop_state == 1){
		   loop_state = 0;
            monitor_key_tid = 0;
        }
		pthread_mutex_unlock(&thread_mutex);
    }

    if(testwindows != NULL) {
        lv_obj_del(testwindows);
        testwindows = NULL;
	}

    lv_list_clean(list_t);

    count_result(mainwindows);
    lv_add_listview(mainwindows);

	return 0;
}

static void lv_list_handler(lv_obj_t *obj, lv_event_t event)
{
    if(event == LV_EVENT_CLICKED) 
    {
        if(obj == NULL)               //run all modules test
        {
            if (testwindows == NULL)
            {
                module_info *mod = NULL;
                testwindows = lv_obj_create(lv_scr_act(),NULL);
                lv_obj_set_size(testwindows, LV_HOR_RES_MAX, LV_VER_RES_MAX);
                lv_add_testwindow(testwindows);
                mod = get_module_by_name(item_name);
                switch_module(mod);
                if(close_testwindow_tid){
                    pthread_join(close_testwindow_tid, NULL);
                    close_testwindow_tid = 0;
                }
                pthread_create(&close_testwindow_tid, NULL, wait_closewindows_thread, NULL);
                return;
            }
        }
        else                        //single module test
        {
            list < module_info * >::iterator iter;
            int cnt=0;
            for(iter = g_ordered_modules.begin(); iter != g_ordered_modules.end(); iter++) 
            {
                module_info *mod = (module_info *) (*iter);
                if(mod != NULL &&  (!mod->config_list[KEY_ENABLE].compare("1")) )
                {
                    cnt++;
                    if(strstr(lv_list_get_btn_text(obj),mod->module)!=NULL)    //find the module name
                    {
                        if (testwindows == NULL)
                        {
                            memset(item_name, 0, sizeof(item_name));
                            strcpy(item_name,mod->module);
                            item_num=cnt-1;
                            testwindows = lv_obj_create(lv_scr_act(),NULL);
                            lv_obj_set_size(testwindows, LV_HOR_RES_MAX, LV_VER_RES_MAX);
                            lv_add_testwindow(testwindows);
                            switch_module(mod);
                            if(close_testwindow_tid){
                                pthread_join(close_testwindow_tid, NULL);
                                close_testwindow_tid = 0;
                            }
                            //pthread_create(&close_testwindow_tid, NULL, wait_closewindows_thread, NULL);
							//ALOGI("[%s:%d] fulinux", __func__, __LINE__);
                            break;
                        }
                    }
                }
            }
        }
	} 
}

static void lv_add_listview(lv_obj_t * parent) 
{
    if(list_t == NULL){
        list_t = lv_list_create(parent, NULL);
    }
    else {
        lv_list_clean(list_t);
    }
    lv_obj_t * btn;
    char buf[64] = {0};
    int cnt=0;
    lv_list_set_scroll_propagation(list_t, false);
    lv_obj_set_size(list_t, LISTVIEW_W, LISTVIEW_H);
    lv_obj_align(list_t, parent, LV_ALIGN_IN_LEFT_MID, 0, 20);

    list < module_info * >::iterator iter;
    for(iter = g_ordered_modules.begin(); iter != g_ordered_modules.end(); iter++) 
    {
        module_info *mod = (module_info *) (*iter);
        if(mod != NULL &&  (!mod->config_list[KEY_ENABLE].compare("1")) )
        {
            cnt++;
            sprintf(buf,"%d %s",cnt,mod->module);
            if(mod->result==SUCCESS)
                btn = lv_list_add_btn(list_t,LV_SYMBOL_OK,buf);
            else if(mod->result==FAILED)
                btn = lv_list_add_btn(list_t,LV_SYMBOL_WARNING,buf);
            else 
                btn = lv_list_add_btn(list_t,NULL,buf);
            lv_obj_set_event_cb(btn, lv_list_handler);    
        }
    }
}

/**********************
 *   GLOBAL FUNCTIONS
 **********************/

void lv_add_mainwindow(void)
{
    mainwindows = lv_obj_create(lv_scr_act(), NULL);
    lv_obj_set_size(mainwindows, LV_HOR_RES_MAX, LV_VER_RES_MAX);
    LV_THEME_DEFAULT_INIT(lv_theme_get_color_primary(), lv_theme_get_color_primary(),
                LV_THEME_MATERIAL_FLAG_DARK,
                lv_theme_get_font_small(), lv_theme_get_font_normal(), lv_theme_get_font_subtitle(), lv_theme_get_font_title());
    lv_add_mainwindow_button(mainwindows);
    lv_add_listview(mainwindows);
    count_result(mainwindows);
    lv_obj_t * label_title;
    label_title = lv_label_create(mainwindows, NULL);
    lv_obj_set_width(label_title, 720);
    lv_obj_set_height(label_title,100);
    lv_obj_set_style_local_text_font(label_title, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_theme_get_font_subtitle());
	lv_label_set_recolor(label_title, true);
    lv_obj_align(label_title, NULL, LV_ALIGN_IN_TOP_LEFT, 40, 10);
    lv_label_set_text(label_title, "QUECTEL SC20X FACTORY TEST");
}


#endif

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.