I port Touch_Calibration sample with keil's RTX in my board and find the problem described above,so i rewrite the Touch_Calibration sample in the emwin simulator with multitasking.
The problem is that one task initialize its Background and font colors,and they change if the task schedules out and
The attach file can demonstrate the problem and also be solved with adding a few code: add GUI_Clear(); after GUI_Init(); in the entry function MainTask.
GUI_pContext and _CurrentTaskNo import the bug.
Here GUITASK_SetMaxTask(n) in GUICONF.c, n must be lager than 2 in this sample however only 2 GUI_Context will be used because of debug assert.
GUI_pContext will be valid after GUI_Init() however it becomes useless in multitasking because no task can use it.
The problem is that one task initialize its Background and font colors,and they change if the task schedules out and
schedules in once again. it is really so difficult to trace the issue because stemwin is a precompiled lib and no c code. i spent a week to find out the reason with some help.
The attach file can demonstrate the problem and also be solved with adding a few code: add GUI_Clear(); after GUI_Init(); in the entry function MainTask.
GUI_pContext and _CurrentTaskNo import the bug.
Here GUITASK_SetMaxTask(n) in GUICONF.c, n must be lager than 2 in this sample however only 2 GUI_Context will be used because of debug assert.
GUI_pContext will be valid after GUI_Init() however it becomes useless in multitasking because no task can use it.