Hi, I tried to work this problem through Segger, but I tried what they said and it still does not work, and Segger referred me to Keil. The following is what I posted on the Segger forum, and their reply. I still have this issue. Thank You.
GUI_PID_StoreState question/problem In a Keil RTX environment I have my own PID driver, for a touch screen. It correctly gets interrupts and correctly retrieves touch information. I want to convey this information to Emwin, so that I can interact with GUI buttons and other controls. In my PID driver, in the interrupt routine, I have the following statements:
GUI_PID_STATE pState;
pState.x = touch.x; pState.y = touch.y; pState.Pressed = touch.pen_state; pState.Layer = 0; GUI_PID_StoreState(&pState);
In a separate RTX task, I have displayed a dialog on the screen with a button. This displays correctly, and I am expecting a "clicked" type of event. The following code gets about 8 messages pertaining to the initial display of the dialog and button, but it never gets any other messages. I would expect WM_NOTIFICATION messages, but there are none. I made the dialog and the button the size of the entire screen, so I know I'm pressing it, and the coordinates in pState are in the button area.
static void _cbDialog(WM_MESSAGE * pMsg) { int Id, NCode;
switch (pMsg->MsgId) { case WM_NOTIFY_PARENT: Id = WM_GetId(pMsg->hWinSrc); NCode = pMsg->Data.v; switch(Id) { case ID_BUTTON_0: // Notifications sent by 'Button' switch(NCode) { case WM_NOTIFICATION_CLICKED: break; case WM_NOTIFICATION_RELEASED: break; } break; } break; default: WM_DefaultProc(pMsg); break; } }
In another RTX task, I call GUI_Exec() periodically, which is supposed to service any window callbacks. (I now have also tried this in the dialog task.)
My touch events/info never interact with my dialog/button. Why not? There are no sources for emwin, so I can't debug this.
Thank You, Chuck
Quote Report Edit SEGGER - Adrian Super Moderator
Date of registration: May 26th 2009 Posts: 151
2 Friday, November 16th 2012, 2:37am Hello,
This actually should work, but in order to trace the problem you can do the following: Try calling GUI_Exec() from the task which creates the dialogs. In case this works, I would like to ask you to send the (working and not working) code which shows this behavior to support@segger.com. In case this does not work, please contact Keil Support. They should be able to debug the code for you.
Best regards, Adrian
Quote Report