GUI_PID_StoreState question/problem

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • 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.


    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
  • 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
  • Well, apparently this was working all along. I had a problem with coordinates and a mismatched LCD screen and touch screen used in development. The way things were, the only active portion of the touch screen was about a 1/8" x 1/8" square in the very corner of the screen, and my fat little fingers never managed to find it. And without source code for emwin I had no way of tracing things to find out what was going on. Anyway this now works for me.

    Thank You,
    Chuck