/********************************************************************* * * emWin * * Function description: * emWin demo application * */ void emWin(const T_choice *aChoice) { T_uezDevice hLCD; U32 FrameBufferSize; T_uezTask hTouchTask; (void)aChoice; FrameBufferSize = UEZ_LCD_DISPLAY_WIDTH * UEZ_LCD_DISPLAY_HEIGHT * GUI_NUM_VIRTUAL_DISPLAYS * GUI_PIXEL_WIDTH; GUI_pMem = (U32*)(GUI_VRAM_BASE_ADDR + FrameBufferSize); GUI_MemSize = (GUI_VRAM_SIZE - FrameBufferSize); memset((void*)GUI_VRAM_BASE_ADDR, 0, GUI_MemSize);//FrameBufferSize); // // Check that frame buffer memory fits into VRAM memory and we have empty memory left // if (GUI_VRAM_SIZE <= FrameBufferSize) { return; // Error, not enough memory } // // Assign memory left to emWin memory // //GUI_pMem = (U32*)(GUI_VRAM_BASE_ADDR + FrameBufferSize); //GUI_MemSize = (GUI_VRAM_SIZE - FrameBufferSize); // // emWin startup // #if EMWIN_LOAD_ONCE if(G_emWinLoaded == EFalse) { WM_SetCreateFlags(WM_CF_MEMDEV); // Enable memory devices GUI_Init(); G_emWinLoaded = ETrue; } #else WM_SetCreateFlags(WM_CF_MEMDEV); // Enable memory devices GUI_Init(); #endif // // Open the LCD // if (UEZLCDOpen("LCD", &hLCD) == UEZ_ERROR_NONE) { // // Create touch screen queue // if (UEZQueueCreate(1, sizeof(T_uezInputEvent), &_hTSQueue) == UEZ_ERROR_NONE) { // // Open touch screen // if (UEZTSOpen("Touchscreen", &_hTouchScreen, &_hTSQueue) == UEZ_ERROR_NONE) { // // Create touch task // if (UEZTaskCreate((T_uezTaskFunction)_TouchTask, "TouchTask", 1024, 0, UEZ_PRIORITY_VERY_HIGH, &hTouchTask) == UEZ_ERROR_NONE) { // // emWin application // GUIDEMO_Main(); _RequestExit = 1; while (_RequestExit == 1) { UEZTaskDelay(1); // Wait for touch task to terminate } } // // Close touch screen // UEZTSClose(_hTouchScreen, _hTSQueue); } UEZQueueDelete(_hTSQueue); } // // Close the LCD // UEZLCDClose(hLCD); } // // emWin cleanup // #if !EMWIN_LOAD_ONCE GUI_Exit(); #endif }
/* **************************************************************************************************** * * ORANGE_MClose * * Description: * ORANGE_MClose * * Parameters: * * Return value: * EPDK_OK * EPDK_FAIL **************************************************************************************************** */ __s32 ORANGE_MClose(__mp *mp) { GUI_Exit(); esMEMS_Pfree(((__orange_t *)mp)->fbaddr[0], 255); return EPDK_OK; }