Selectively activate MEMDEV for each window

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

    • Selectively activate MEMDEV for each window

      Hi all,

      I have an application that is made of several dialogs.
      My system is STM32F103VET based and connected via FSMC controller / 8080 interface to a 480x272 display, 565 color depth.

      I want to activate MEMDEV for some windows and not on others in order to prevent slow windows update.

      Consider the first dialog created at application start:

      C Source Code

      1. static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
      2. { WINDOW_CreateIndirect, "Window", ID_WINDOW_0, 0, 0, 480, 272, WM_CF_MEMDEV_ON_REDRAW, 0x0, 0 },
      3. { PROGBAR_CreateIndirect, NULL, ID_PROGBAR_0, 10, 200, 460, 45, PROGBAR_CF_HORIZONTAL, 0x0, 0},
      4. { BUTTON_CreateIndirect, NULL, ID_BUTTON_0, 435, 1, 40, 33, 0, 0x0, 0}
      5. };


      Here the MEMDEV is correctly activated for this dialog

      Now, if I create a new dialog with the same function parameter:

      C Source Code

      1. static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
      2. { WINDOW_CreateIndirect, NULL, ID_WINDOW_0, 0, 0, 480, 272, WM_CF_MEMDEV, 0x0, 0},
      3. { LISTWHEEL_CreateIndirect, NULL, ID_LISTWHEEL_0, 86, 70, 30, 93, 0, 0x0, 0 },
      4. { LISTWHEEL_CreateIndirect, NULL, ID_LISTWHEEL_1, 121, 70, 30, 93, 0, 0x0, 0 },
      5. { LISTWHEEL_CreateIndirect, NULL, ID_LISTWHEEL_2, 176, 70, 30, 93, 0, 0x0, 0 },
      6. { LISTWHEEL_CreateIndirect, NULL, ID_LISTWHEEL_3, 210, 70, 100, 93, 0, 0x0, 0 },
      7. { LISTWHEEL_CreateIndirect, NULL, ID_LISTWHEEL_4, 316, 70, 60, 93, 0, 0x0, 0 },
      8. { BUTTON_CreateIndirect, "SAVE", ID_BUTTON_SAVE, 165, 190, 60, 60, 0, 0x0, 0 },
      9. { BUTTON_CreateIndirect, "CANCEL", ID_BUTTON_CANCEL, 245, 190, 60, 60, 0, 0x0, 0 },
      10. };


      Memdev is not activate in this new dialog.

      But if I set the global flag at initialisation:

      C Source Code

      1. void GUITask(void const* argument)
      2. {
      3. WM_SetCreateFlags(WM_CF_MEMDEV);
      4. GUI_Init();
      5. FT5206_Init();
      6. (...)


      It correctly works for all windows and dialogs, so I suppose it is not a memory issue, I also tried to increase the memory allocated for GUI and nothing changes.
      But I do not want MEMDEV on all dialogs.

      What can I do?

      Thanks
    • Hi,

      In the second _aDialogCreate structure you have enabled automatic use of memory devices only for the 'root' window but not for the child windows.

      You have to set the WM_CF_MEMDEV_ flag for all windows you want to use memory devices. Like this:

      C Source Code

      1. static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
      2. { WINDOW_CreateIndirect, NULL, ID_WINDOW_0, 0, 0, 480, 272, WM_CF_MEMDEV, 0x0, 0}, // This window will use memory devices
      3. { LISTWHEEL_CreateIndirect, NULL, ID_LISTWHEEL_0, 86, 70, 30, 93, 0, 0x0, 0 },
      4. { LISTWHEEL_CreateIndirect, NULL, ID_LISTWHEEL_1, 121, 70, 30, 93, 0, 0x0, 0 },
      5. { LISTWHEEL_CreateIndirect, NULL, ID_LISTWHEEL_2, 176, 70, 30, 93, 0, 0x0, 0 },
      6. { LISTWHEEL_CreateIndirect, NULL, ID_LISTWHEEL_3, 210, 70, 100, 93, 0, 0x0, 0 },
      7. { LISTWHEEL_CreateIndirect, NULL, ID_LISTWHEEL_4, 316, 70, 60, 93, WM_CF_MEMDEV, 0x0, 0 }, // This window will also use memory devices
      8. { BUTTON_CreateIndirect, "SAVE", ID_BUTTON_SAVE, 165, 190, 60, 60, 0, 0x0, 0 },
      9. { BUTTON_CreateIndirect, "CANCEL", ID_BUTTON_CANCEL, 245, 190, 60, 60, 0, 0x0, 0 },
      10. };


      With the struct above, only the 'root' window and the fifth LISTWHEEL will use memory devices.

      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.