Hello,
In my project, there's a requirement for restarting GUI.
My debugging code as follows:
1) In the main UI task:
Display All
2) In the test UI task
3) Background task:
Display All
4) GUI Init custom code:
Display All
It's all okay if I don't use the background task (GUI_X_SINGLE_TASK == 1).
But, the codes always stop at calling the first "GUI_XXX" function in the test UI task when using background task.
So, my question is:
Is deleting background task is the only work to do during restarting GUI?
Am I missing something crucial else?
emWin Version: v5.44b
Also, I use the FreeRTOS.
Any idea or advice? Thanks.
Kenmux
In my project, there's a requirement for restarting GUI.
My debugging code as follows:
1) In the main UI task:
C Source Code
- // Exit task
- EXIT :
- #if (GUI_X_SINGLE_TASK == 0)
- GUI_X_Task_Delete(); //Delete background GUI task
- #endif
- GUI_Exit();
- vTaskDelay(10);
- GUI_Init();
- WM_SelectWindow(WM_GetDesktopWindowEx(0));
- GUI_DrawBitmap(UI_ImageTable[IMG_SPLASH_1_INDEX], 0, 0);
- GUI_Delay(500);
- UI_NotifyFTTask(TASK_EVENT_MISC_RETURN_TO_FT); //Ask test UI task to continue
- vTaskDelete(NULL);
2) In the test UI task
3) Background task:
C Source Code
- #if (GUI_X_SINGLE_TASK == 0)
- /*******************************************************************
- *
- * _GUI_Task
- *
- * This task does the background processing.
- * The MainTask job is to update invalid windows, but other things such as
- * evaluating mouse or touch input may also be done.
- */
- static void _GUI_Task( void *pvParameters ) {
- (void)pvParameters;
- DEBUG_MSG ("<I> _GUI_Task Up\r\n");
- while (1) {
- /* Do the background work */
- GUI_Exec();
- GUI_X_ExecIdle();
- }
- }
- #endif
4) GUI Init custom code:
C Source Code
- /*********************************************************************
- *
- * GUI_X_Init()
- *
- * Note:
- * This routine is called from GUI_Init() in any case whether there
- * is an RTOS or not. You can use it for additional initializations
- * needed.
- */
- void GUI_X_Init(void) {
- #if (GUI_X_SINGLE_TASK == 0)
- BaseType_t result = xTaskCreate(_GUI_Task, "XBKG", configUI_BKG_TASK_STACK_SIZE,
- NULL, mainQUEUE_UI_BG_TASK_PRIORITY, &_pGUITask);
- if (result != pdPASS) for (;;) ;
- #endif
- }
It's all okay if I don't use the background task (GUI_X_SINGLE_TASK == 1).
But, the codes always stop at calling the first "GUI_XXX" function in the test UI task when using background task.
So, my question is:
Is deleting background task is the only work to do during restarting GUI?
Am I missing something crucial else?
emWin Version: v5.44b
Also, I use the FreeRTOS.
Any idea or advice? Thanks.
Kenmux
The post was edited 1 time, last by kenmux ().