Hello,
I am using NXP LPC1768 controller with SSD1963. The lib version is 5.38b. I config Emwin display driver as 'GUIDRV_FlexColor'. The problem is my screen becomes blank when i use the cmd "WM_SetCreateFlags(WM_CF_MEMDEV);"(Line 124). And it is work fine without the cmd,but flickering problems arise.
The memory size I allocate in "GUIConf.c" is 32KB. I simulate the code in Win32 with same memory size ,and is work fine(both with and without the cmd).
I also run the example " MEMDEV_Banding.c "in my board and its work fine.
I don't know where is the problem, is the FlexColor driver do not support memdev? Or soming wrong in my driver?
Here is the code:
Display All
Could you please help me with this problem?
Thanks in advance.
Regards
I am using NXP LPC1768 controller with SSD1963. The lib version is 5.38b. I config Emwin display driver as 'GUIDRV_FlexColor'. The problem is my screen becomes blank when i use the cmd "WM_SetCreateFlags(WM_CF_MEMDEV);"(Line 124). And it is work fine without the cmd,but flickering problems arise.
The memory size I allocate in "GUIConf.c" is 32KB. I simulate the code in Win32 with same memory size ,and is work fine(both with and without the cmd).
I also run the example " MEMDEV_Banding.c "in my board and its work fine.
I don't know where is the problem, is the FlexColor driver do not support memdev? Or soming wrong in my driver?
Here is the code:
C Source Code: emwintask.c
- #include "DIALOG.h"
- //main window widgets
- #define ID_WINDOW_0 (GUI_ID_USER + 0x00)
- #define ID_BUTTON_0 (GUI_ID_USER + 0x01)
- #define ID_BUTTON_1 (GUI_ID_USER + 0x02)
- #define ID_BUTTON_2 (GUI_ID_USER + 0x03)
- #define ID_TEXT_0 (GUI_ID_USER + 0x04)
- #define ID_TEXT_1 (GUI_ID_USER + 0x05)
- #define ID_MENU_0 (GUI_ID_USER + 0x08)
- /*********************************************************************
- *
- * _aDialogCreate
- */
- static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
- { WINDOW_CreateIndirect, "Window", ID_WINDOW_0, 0, 0, 480, 272, 0, 0x0, 0 },
- { BUTTON_CreateIndirect, "Button", ID_BUTTON_0, 320, 200, 50, 50, 0, 0x0, 0 },
- { BUTTON_CreateIndirect, "Button", ID_BUTTON_1, 400, 200, 50, 50, 0, 0x0, 0 },
- { BUTTON_CreateIndirect, "Button", ID_BUTTON_2, 240, 200, 50, 50, 0, 0x0, 0 },
- { TEXT_CreateIndirect, "Text", ID_TEXT_0, 320, 60, 150, 60, 0, 0x64, 0 },
- { TEXT_CreateIndirect, "Text", ID_TEXT_1, 160, 60, 150, 60, 0, 0x64, 0 },
- };
- /*********************************************************************
- *
- * _cbDialog
- */
- int a = 0;
- static void _cbDialog(WM_MESSAGE * pMsg) {
- WM_HWIN hItem;
- int NCode;
- int Id;
- switch (pMsg->MsgId) {
- case WM_INIT_DIALOG:
- hItem = pMsg->hWin;
- WINDOW_SetBkColor(hItem, GUI_MAKE_COLOR(0x00000000));
- //
- // Initialization of 'Button'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
- BUTTON_SetFont(hItem, GUI_FONT_32B_ASCII);
- BUTTON_SetText(hItem, "+");
- //
- // Initialization of 'Button'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1);
- BUTTON_SetFont(hItem, GUI_FONT_32B_ASCII);
- BUTTON_SetText(hItem, "-");
- //
- // Initialization of 'Button'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_2);
- BUTTON_SetFont(hItem, GUI_FONT_32B_ASCII);
- BUTTON_SetText(hItem, "M");
- //
- // Initialization of 'Text'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
- TEXT_SetFont(hItem, GUI_FONT_D36X48);
- TEXT_SetText(hItem, "33");
- TEXT_SetTextColor(hItem, GUI_MAKE_COLOR(0x00FFFFFF));
- //
- // Initialization of 'Text'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_1);
- TEXT_SetFont(hItem, GUI_FONT_D36X48);
- TEXT_SetText(hItem, "11");
- TEXT_SetTextColor(hItem, GUI_MAKE_COLOR(0x00FFFFFF));
- break;
- 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:
- hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
- TEXT_SetText(hItem, "36");
- break;
- case WM_NOTIFICATION_RELEASED:
- break;
- }
- break;
- case ID_BUTTON_1: // Notifications sent by 'Button'
- switch(NCode) {
- case WM_NOTIFICATION_CLICKED:
- hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
- TEXT_SetText(hItem, "30");
- break;
- case WM_NOTIFICATION_RELEASED:
- break;
- }
- break;
- }
- break;
- default:
- WM_DefaultProc(pMsg);
- break;
- }
- }
- /*********************************************************************
- *
- * CreateWindow
- */
- WM_HWIN CreateWindow(void);
- WM_HWIN CreateWindow(void) {
- WM_HWIN hWin;
- hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
- return hWin;
- }
- /*********************************************************************
- *
- * MainTask
- */
- int keys_a = 0;
- WM_HWIN hwin_main,hwin_menu;
- void MainTask(void) {
- WM_SetCreateFlags(WM_CF_MEMDEV); //HERE IS THE PROBLEM
- GUI_Init();
- hwin_main = CreateWindow();
- WM_ShowWindow(hwin_main);
- while(1){
- GUI_Delay(10);
- }
- }
Thanks in advance.
Regards
The post was edited 1 time, last by QuE ().