Important: unclear posts may not receive useful answers.
Before posting
- Get familiar with Markdown to format and structure your post
- Be sure to update lvgl from the latest version from the
master
branch.- Be sure you have checked the FAQ and read the relevant part of the documentation.
- If applicable use the Simulator to eliminate hardware related issues.
Delete this section if you read and applied the mentioned points.
Description
What MCU/Processor/Board and compiler are you using?
iMX93 evk
What LVGL version are you using?
8.3.5
What do you want to achieve?
I want to display 5 screen after every 2 mints in loop like screen -1,2,3,1,2,3… and read data from ZMQ dealer thread and display on UI.
What have you tried so far?
I have created one thread for ZMQ dealer and another(data_display_thread) for parsing data received from ZMQ and display on . but ZMQ data received thread reciving data correctly but when I call any LVGL APIs they are not working in “data_display_thread”
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:
/*You code here*/
In event.c
static void main_event_handler (lv_event_t *e)
{
lv_event_code_t code = lv_event_get_code(e);
switch (code) {
case LV_EVENT_SCREEN_LOADED:
{
switch_scr=lv_timer_create(switch_screen, 3000, &guider_ui);
main_init();
break;
}
case LV_EVENT_SCREEN_UNLOAD_START:
{
lv_timer_del(switch_scr);
break;
}
default:
break;
}
}
///////////////////////////////////////////////////////////////////////////////
In Custom.c
void main_init(void)
{
printf("main init \n");
bool status ;
status = pthread_create(&screen_display, NULL,switch_screen_thread, NULL);
status = ZMQ_Rec();
printf("return from ZMQ recive\n");
}
static void *switch_screen_thread(void *arg)
{
printf("In screen display\n");
phase_A.Phase_Voltage=10;phase_B.Phase_Voltage=11;phase_C.Phase_Voltage=12;
while (1)
{
phase_A.Phase_Voltage++;phase_B.Phase_Voltage++;phase_C.Phase_Voltage++;
/* Set the poll item */
pthread_mutex_lock(&mutex); // Acquire the mutex
printf("In Mutex \n");
usleep(10 * 1000);
lv_label_set_text_fmt(guider_ui.Home_PHA_volt, "%d",phase_A.Phase_Voltage);
usleep(10 * 1000); printf("after volt A\n");
lv_label_set_text_fmt(guider_ui.Home_PHB_volt, "%d",phase_B.Phase_Voltage);
usleep(10 * 1000); printf("after volt B \n");
lv_label_set_text_fmt(guider_ui.Home_PHC_volt, "%d",phase_C.Phase_Voltage);
lv_task_handler();
usleep(10 * 1000); printf("after volt C \n");// Sleep for 10ms
// task_meter1 =lv_timer_create(current_meter_timer_cb, 5000, &guider_ui);
pthread_mutex_unlock(&mutex); // Release the mutex
// printf("after Mutex \n");
// lv_timer_del(task_meter1 );
}
return 0;
}
int ZMQ_Rec(void)
{
if( SUCCESS == Display_ZMQInit()){
pthread_join(tid, NULL);
}
pthread_join(screen_display, NULL);
}
In above code all print message are coming but display on screen or change in screen not happing. please help it urgent
## Screenshot and/or video
If possible, add screenshots and/or videos about the current state.