Saturday, February 24th 2018, 2:55am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

danilotto

Beginner

Date of registration: Jun 9th 2017

Posts: 4

1

Monday, January 29th 2018, 10:55pm

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/C++ Source code

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


Here the MEMDEV is correctly activated for this dialog

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

C/C++ Source code

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


Memdev is not activate in this new dialog.

But if I set the global flag at initialisation:

C/C++ Source code

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

        (...)


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

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 496

2

Monday, February 5th 2018, 2:08pm

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/C++ Source code

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


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

Regards
Sven