Hi,
I have a emWin based simple project: display some fluctuating information from internal data structure with updating the screen every second. It is multitasking system with several interrupts etc. I have single window with linked callback function. Everything works fine but in some moment image stucks(image isn't repainted), the device continue working and after some time the image starts to be repainted again. And this situation repeats in cycles. I checked MsgId sequence received by window callback. In general the message seqence is WM_TIMER - WM_PRE_PAINT - WM_PAINT - WM_POST_PAINT and the last received message before stucking is WM_POST_PAINT . It seems like in some moment timer don't expires. What can be a reason of issue?
Here is the callback function:
Display All
PS. i bring my apologises about code formatting, I've tryed several times to make it correct, but I failed every time.
Regards,
Anton
I have a emWin based simple project: display some fluctuating information from internal data structure with updating the screen every second. It is multitasking system with several interrupts etc. I have single window with linked callback function. Everything works fine but in some moment image stucks(image isn't repainted), the device continue working and after some time the image starts to be repainted again. And this situation repeats in cycles. I checked MsgId sequence received by window callback. In general the message seqence is WM_TIMER - WM_PRE_PAINT - WM_PAINT - WM_POST_PAINT and the last received message before stucking is WM_POST_PAINT . It seems like in some moment timer don't expires. What can be a reason of issue?
Here is the callback function:
C Source Code
- static void _cbDebugMenu(WM_MESSAGE * pMsg)
- {
- /* some variables */ switch(pMsg->MsgId){
- case WM_CREATE:
- WM_DefaultProc(pMsg);
- break;case WM_TIMER:
- WM_InvalidateWindow(pMsg->hWin);
- WM_RestartTimer(pMsg->Data.v, 1000);
- break;case WM_PAINT:
- /* data output */
- WM_DefaultProc(pMsg);
- break;case WM_INIT_DIALOG:
- GUI_Clear();
- hItem = pMsg->hWin;
- /* some initializtion */ WM_CreateTimer(pMsg->hWin, 0, 1000, 0);
- WM_DefaultProc(pMsg);
- break;default:
- WM_DefaultProc(pMsg);
- break;
- }
- }
PS. i bring my apologises about code formatting, I've tryed several times to make it correct, but I failed every time.
Regards,
Anton
The post was edited 7 times, last by vard ().