Problems migrating from 5.24 to 5.30

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

  • Problems migrating from 5.24 to 5.30

    I'm using pre-compiled emWin libraries from NXP. In my project, I was using emWin version 5.24 and now I'd like to upgrade to the latest version distributed from NXP that is 5.30c.

    I have some problems with new version. The project is compiled in LPCXpresso and runs in LPC1778 MCU. The touchscreen display is based on ILI9341 controller connected to the MCU through a 16-bits parallel bus.

    It seems the new version redraws some parts of the screen, even if it isn't necessary. This produces a bad flicker effect.

    For example, I have a screen with 5 horizontal buttons. When I touch a button, it changes its background color, so the touched button is redrawn... and this is ok. However all the other buttons are redrawn at the same time, even if they appearence don't change.

    Why this bad behaviour? If you want, I can create a test application that shows this.
  • Hi,

    I can't say what causes this behavior. Best would be, just as you said, if you create a small sample which shows the behavior.

    Also, just in case, if you update from one to another version, please make sure that you update al the the header files, too.

    Regards,
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • After some investigations, I found that the strange behaviour I noticed in version 5.30 is present in 5.24 too, but it is slightly different. I will try to explain.

    I create two buttons and set a custom skin named skinButtonFlat (see at the bottom of the post for source code).
    Just for debug, I added a printf() in the skin function that shows the handle of the button and the command of pDrawItemInfo.

    Now what happens with the old versione 5.24. When I press first button and last pressed button was the second, I see commands for both buttons (so my routine is forced to redraw the second button, even if it is unchanged).
    Of course, if I press second button and last pressed button was the first, I see commands for both buttons.
    If I press always the same button, I see commands only for that button, as I expect.

    This strange behaviour occurs with 5.24 and 5.30.

    Now I create a keypad composed by 4x3 buttons on the screen. Here the behaviour is different between 5.24 and 5.30.

    In 5.24 I have the same behaviour as described with two buttons.
    In 5.30, even if I press always the same button, I see commands for other buttons too!


    C Source Code

    1. int
    2. skinButtonFlat(const WIDGET_ITEM_DRAW_INFO *pDrawItemInfo)
    3. {
    4. WM_HWIN hWin = pDrawItemInfo->hWin;
    5. static int xxx = 0;
    6. printf("%3d: %d %d\n", ++xxx, hWin, pDrawItemInfo->Cmd);
    7. switch (pDrawItemInfo->Cmd) {
    8. case WIDGET_ITEM_DRAW_BACKGROUND: {
    9. char buf[32];
    10. uint16_t xSize = WM_GetWindowSizeX(hWin);
    11. uint16_t ySize = WM_GetWindowSizeY(hWin);
    12. GUI_COLOR txt_col;
    13. GUI_COLOR bkg_col;
    14. const GUI_BITMAP *bmp;
    15. if (!WM_IsEnabled(hWin)) {
    16. bkg_col = BUTTON_GetBkColor(hWin, BUTTON_BI_DISABLED);
    17. txt_col = BUTTON_GetTextColor(hWin, BUTTON_BI_DISABLED);
    18. bmp = BUTTON_GetBitmap(hWin, BUTTON_BI_DISABLED);
    19. } else if (BUTTON_IsPressed(hWin)) {
    20. bkg_col = BUTTON_GetBkColor(hWin, BUTTON_BI_PRESSED);
    21. txt_col = BUTTON_GetTextColor(hWin, BUTTON_BI_PRESSED);
    22. bmp = BUTTON_GetBitmap(hWin, BUTTON_BI_PRESSED);
    23. } else {
    24. bkg_col = BUTTON_GetBkColor(hWin, BUTTON_BI_UNPRESSED);
    25. txt_col = BUTTON_GetTextColor(hWin, BUTTON_BI_UNPRESSED);
    26. bmp = BUTTON_GetBitmap(hWin, BUTTON_BI_UNPRESSED);
    27. }
    28. GUI_SetColor(bkg_col);
    29. GUI_FillRect(0, 0, xSize - 1, ySize - 1);
    30. GUI_SetColor(txt_col);
    31. GUI_SetBkColor(bkg_col);
    32. GUI_SetTextAlign(GUI_TA_HCENTER | GUI_TA_VCENTER);
    33. GUI_SetFont(BUTTON_GetFont(hWin));
    34. BUTTON_GetText(hWin, buf, sizeof(buf));
    35. if (strlen(buf)) {
    36. GUI_DispStringAt(buf, xSize / 2, ySize / 2);
    37. }
    38. if (bmp != NULL) {
    39. GUI_DrawBitmap(bmp, (xSize - bmp->XSize) / 2, (ySize - bmp->YSize) / 2);
    40. }
    41. break;
    42. }
    43. }
    44. return 0;
    45. }
    Display All


    Also, just in case, if you update from one to another version, please make sure that you update al the the header files, too.

    Of course, I updated header files too.