|
本帖最后由 10xjzheng 于 2014-7-22 21:09 编辑
因为我将野火的emWin+ucos的例程拿去改成自己的东西,就是讲gui任务改了下,结果黑屏,我怀疑是没有进行更新操作的,然后我转向分析demo的代码。任务的伪代码如下,然后我在GUIDEMO_Main();里面一步步进行查找,始终找不到他进行更新的地方。里面老是一些操作,没有什么延时什么的。
所以我想请大家帮忙的就是:
帮忙分析下他的重绘机制,找出他在什么地方跳出去重绘了,谢谢大家。
- void Task_Start(void *p_arg)
- {
- /* 板级初始化 */
- //创建任务LED
- //创建任务GUI
- //创建任务GUI_Touch
- //任务删除自己
- OSTaskDel(&StartUp_TCB,&err);
- }
复制代码 这个就是里面的gui任务
- void Task_GUI(void *p_arg)
- {
- OS_ERR err;
- (void)p_arg;
-
- GUIDEMO_Main();
-
- //延时
- while(1)
- {
- OSTimeDly(1,OS_OPT_TIME_DLY,&err);
- }
- }
复制代码 GUIDEMO_Main();具体内容
- void GUIDEMO_Main(void)
- {
- OS_ERR err;
- FRAMEWIN_SKINFLEX_PROPS Framewin_Props;
- #if GUIDEMO_USE_AUTO_BK
- int NumFreeBytes;
- int BitsPerPixel;
- #endif
- GUI_MEMDEV_SetAnimationCallback(_cbEffect, (void *)&_Pressed);
- WM_SetCallback(WM_HBKWIN, _cbBk);
- BUTTON_SetReactOnLevel();
- FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE);
- Framewin_Props.Radius = 0;
- FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE);
- FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE);
- Framewin_Props.Radius = 0;
- FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE);
- FRAMEWIN_SetDefaultSkin (_FRAMEWIN_DrawSkinFlex);
- PROGBAR_SetDefaultSkin (PROGBAR_SKIN_FLEX);
- BUTTON_SetDefaultSkin (BUTTON_SKIN_FLEX);
- SCROLLBAR_SetDefaultSkin (SCROLLBAR_SKIN_FLEX);
- SLIDER_SetDefaultSkin (SLIDER_SKIN_FLEX);
- HEADER_SetDefaultSkin (HEADER_SKIN_FLEX);
- GUI_SetTextMode (GUI_TM_TRANS);
- GUIDEMO_Config(&_GUIDemoConfig);
- #if GUIDEMO_USE_VNC
- if (GUIDEMO_GetConfFlag(GUIDEMO_CF_USE_VNC)) {
- _GUIDemoConfig.pGUI_VNC_X_StartServer(0, 0);
- }
- #endif
- #if GUIDEMO_USE_AUTO_BK
- //
- // Determine if HW has enough memory to draw the gradient circle as background
- //
- BitsPerPixel = LCD_GetBitsPerPixel();
- if ((BitsPerPixel >= 16) && GUIDEMO_GetConfFlag(GUIDEMO_CF_USE_AUTO_BK)) {
- NumFreeBytes = GUI_ALLOC_GetNumFreeBytes();
- if (NumFreeBytes > NUMBYTES_NEEDED) {
- _pfDrawBk = _DrawBkCircle;
- } else {
- _pfDrawBk = _DrawBk;
- }
- } else
- #endif
- {
- _pfDrawBk = _DrawBkSimple;
- }
- GUIDEMO_SetDrawLogo(1);
- while (1)
- {
- _Main();
- }
- }
复制代码 _Main();的内容
- static void _Main(void)
- {
- OS_ERR err;
- int xSize;
- int ySize;
- WM_SelectWindow(WM_HBKWIN);
- GUI_Clear();
- #if (GUI_SUPPORT_CURSOR | GUI_SUPPORT_TOUCH)
- GUI_CURSOR_Show();
- #endif
- //
- // Create and configure Control and Information window
- //
- xSize = LCD_GetXSize();
- ySize = LCD_GetYSize();
- _hDialogControl = GUI_CreateDialogBox(_aFrameWinControl, GUI_COUNTOF(_aFrameWinControl), &_cbFrameWinControl, WM_HBKWIN, xSize - CONTROL_SIZE_X, ySize - CONTROL_SIZE_Y);
- _hDialogInfo = GUI_CreateDialogBox(_aFrameWinInfo, GUI_COUNTOF(_aFrameWinInfo), &_cbFrameWinInfo, WM_HBKWIN, (xSize >> 1) - 1, 0);
- WM_HideWindow(_hDialogInfo);
- //
- // Show Intro
- //
- WM_InvalidateWindow(_hDialogControl);
- WM_DisableMemdev(WM_HBKWIN);
- GUI_Exec();
- WM_EnableMemdev(WM_HBKWIN);
- GUIDEMO_Intro();
- //
- // Run the demos
- //
- for (_iDemo = 0; _GUIDemoConfig.apFunc[_iDemo]; _iDemo++)
- {
- _ClearHalt();
- while(1)
- {
- OSTimeDly(1,OS_OPT_TIME_DLY,&err);
- }
- GUIDEMO_UpdateControlText();
- (*_GUIDemoConfig.apFunc[_iDemo])();
- _iDemoMinor = 0;
- _Pressed = 0;
- }
- _iDemo = 0;
- //
- // Cleanup
- //
- WM_DeleteWindow(_hDialogControl);
- WM_DeleteWindow(_hDialogInfo);
- #if (GUI_SUPPORT_CURSOR | GUI_SUPPORT_TOUCH)
- GUI_CURSOR_Hide();
- #endif
- }
复制代码
|
阿莫论坛20周年了!感谢大家的支持与爱护!!
该献的血还是要献的。你不献他不献。难道让我去献? --- 出自坛友:lovejp1981
|