初级会员

- 积分
- 74
- 金钱
- 74
- 注册时间
- 2014-4-26
- 在线时间
- 1 小时
|
5金钱
因为我将emWin+ucos的例程拿去改成自己的东西,就是讲gui任务改了下,结果黑屏,我怀疑是没有进行更新操作的,然后我转向分析demo的代码。任务的伪代码如下,然后我在GUIDEMO_Main();里面一步步进行查找,始终找不到他进行更新的地方。里面老是一些操作,没有什么延时什么的。
所以我想请大家帮忙的就是:
帮忙分析下他的重绘机制,找出他在什么地方跳出去重绘了,谢谢大家。
普通浏览复制代码
-
void Task_Start (void *p_arg )
-
 {
-
-
-
-
-
-
 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 );
-
    ROGBAR_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
-
-
-
-
 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
-
-
-
-
 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 );
-
-
-
-
 WM_InvalidateWindow (_hDialogControl );
-
 WM_DisableMemdev (WM_HBKWIN );
-
 GUI_Exec ();
-
 WM_EnableMemdev (WM_HBKWIN );
-
 GUIDEMO_Intro ();
-
-
-
-
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;
-
-
-
-
 WM_DeleteWindow (_hDialogControl );
-
 WM_DeleteWindow (_hDialogInfo );
-
#if (GUI_SUPPORT_CURSOR | GUI_SUPPORT_TOUCH)
-
 GUI_CURSOR_Hide ();
-
#endif
-
 }
|
|