/********************************************************************* * * _InitContext * * Purpose * Initializes the given context. * * Special considerations * Make sure that no GUI functions are called, because locking is * not allowed here (GUITASK_INIT not yet called). */ static void _InitContext(GUI_CONTEXT* pContext) { /* memset(..,0,..) is not required, as this function is called only at startup of the GUI when data is 0 */ #if GUI_SUPPORT_DEVICES pContext->pDeviceAPI = LCD_aAPI[0]; /* &LCD_L0_APIList; */ #endif pContext->pClipRect_HL = &GUI_Context.ClipRect; LCD_L0_GetRect(&pContext->ClipRect); #if GUI_SUPPORT_AA pContext->pLCD_HL = &_HL_APIList; #endif pContext->pAFont = GUI_DEFAULT_FONT; pContext->pClipRect_HL = &GUI_Context.ClipRect; pContext->PenSize = 1; /* Variables in WM module */ #if GUI_WINSUPPORT pContext->hAWin = WM_GetDesktopWindow(); #endif /* Variables in GUI_AA module */ #if GUI_SUPPORT_AA pContext->AA_Factor = 3; #endif pContext->Color = GUI_INVALID_COLOR; pContext->BkColor = GUI_INVALID_COLOR; LCD_SetBkColor(GUI_DEFAULT_BKCOLOR); LCD_SetColor(GUI_DEFAULT_COLOR); #if GUI_SUPPORT_UNICODE pContext->pUC_API = &GUI_UC_None; #endif }
/***************************************************************************** * FUNCTION - ShowErrorMessage_C * DESCRIPTION: Displays an error message. * Further actions (Rebooting or ignoring errors when not debugging) depend * on the caller (or the caller of the caller...). * * Called by embOS\D3018X\OS_Error and Factory::FatalErrorOccured() * ****************************************************************************/ extern "C" void ShowErrorMessage_C(const char* errorDescription = "-") { int i; char sz_msg[250]; WM_HWIN win; WM_HWIN win_next; GUI_RECT rect; WM_SelectWindow(WM_GetDesktopWindow()); win = WM_GetFirstChild(WM_GetDesktopWindow()); while(win != (WM_HWIN) NULL) { win_next = WM_GetNextSibling(win); WM_DeleteWindow(win); win = win_next; } WM_SetStayOnTop(WM_GetDesktopWindow(),1); WM_BringToTop(WM_GetDesktopWindow()); GUI_SetBkColor(GUI_WHITE); GUI_SetColor(GUI_BLACK); GUI_SetFont(&Helvetica_57_13); GUI_Clear(); sprintf(sz_msg, "Fatal error.\n\n %s", errorDescription); rect.x0 = 0; rect.y0 = 10; rect.x1 = 239; rect.y1 = 319; for (i=0; i<5; i++) { GUI_Clear(); GUI_Delay(100); GUI_DispStringInRect(sz_msg,&rect,GUI_TA_VCENTER|GUI_TA_HCENTER); GUI_Delay(500); } }
static void _InitContext(GUI_CONTEXT* pContext) { #if GUI_SUPPORT_MEMDEV GUI_SelectLCD(); #else LCD_SetClipRectMax(); #endif pContext->pLCD_HL = &LCD_HL_APIList; pContext->pAFont = GUI_DEFAULT_FONT; pContext->pClipRect_HL = &GUI_Context.ClipRect; pContext->PenSize = 1; /* Variables in WM module */ #if GUI_WINSUPPORT pContext->hAWin = WM_GetDesktopWindow(); #endif /* Variables in GUI_AA module */ pContext->AA_Factor = 3; LCD_SetBkColor(GUI_DEFAULT_BKCOLOR); LCD_SetColor(GUI_DEFAULT_COLOR); }