Ejemplo n.º 1
0
VOID BLMenu()
{
    UINT32 ud, delay;
    WCHAR key = 0;

    // First let user break to menu
    OALLog(L"Hit space to enter LPC32XX bootloader menu.\n\r");
	delay = OALGetTickCount() + (g_bootCfg.boot_to * 1000);
	ud = OALGetTickCount() - 1;
    while (delay > OALGetTickCount())
	{
		if (ud <= OALGetTickCount()) {
			OALLog(L".");
			ud = OALGetTickCount() + 1000;
		}

		key = OALBLMenuReadKey(FALSE);
		if (key == L' ') break;
	}
	OALLog(L"\r\n");
    
    if (key == L' ') {
        OALBLMenuShow(&g_menuRoot);
    }
}
Ejemplo n.º 2
0
//------------------------------------------------------------------------------
//
//  Function:  UpdatePeriod
//
VOID
UpdatePeriod(
    UINT32 periodMSec
    )
{
    UINT32 period, match;
    INT32 delta;
    UINT64 offsetMSec = periodMSec;
    UINT64 tickCount = OALGetTickCount();
    INT nDelay;

    // Calculate count difference
    period = (UINT32)MSEC_TO_TICK(offsetMSec);

    nDelay = min(period, DELTA_TIME);
    // This is compare value
    match = ((UINT32)MSEC_TO_TICK(tickCount)) + nDelay;

    delta = (INT32)(OALTimerGetCount()+ g_oalTimerContext.margin - match);

    // If we are behind, issue interrupt as soon as possible
    if (delta > 0)
    {
        match += MSEC_TO_TICK(1);
    }

    // Save off match value
    g_oalTimerContext.match = match;

    // Set timer match value
    OALTimerSetCompare(match);
}
Ejemplo n.º 3
0
VOID OALBLMenuActivate(UINT32 delay, OAL_BLMENU_ITEM *pMenu)
{
    UINT32 time;
    WCHAR key = 0;
    
    // First let user break to menu
    while (delay > 0 && key != L' ') {
       OALLog(L"Hit space to enter configuration menu %d...\r\n", delay);
       time = OALGetTickCount();
       while ((OALGetTickCount() - time) < 1000) {
          if ((key = OALBLMenuReadKey(FALSE)) == L' ') break;
       }
       delay--;
    }
    
    if (key == L' ') {
#ifdef OAL_BLMENU_PCI
        OALPCIConfig(0, 0, 0, 0, 0, 0, NULL);
#endif
        OALBLMenuShow(pMenu);
    }        
}
VOID BLMenu(BOOL bForced)
{
    UINT32 time, delay = 5;
    WCHAR key = 0;
    BSP_ARGS *pArgs = OALCAtoUA(IMAGE_SHARE_ARGS_CA);
    
    // First let user break to menu
    while (!bForced && (delay > 0 && key != L' ')) {
       OALLog(L"Hit space to enter configuration menu %d...\r\n", delay);
       time = OALGetTickCount();
       while ((OALGetTickCount() - time) < 1000) {
          if ((key = OALBLMenuReadKey(FALSE)) == L' ') break;
       }
       delay--;
    }
    
    if ((bForced == TRUE) || (key == L' ')) 
    {
        OALBLMenuShow(&g_menuRoot);
        // Invalidate arguments to force them to be reinitialized
        // with new config data generated by the boot menu
        pArgs->header.signature = 0;
    }        
}
Ejemplo n.º 5
0
//------------------------------------------------------------------------------
//
//  Function:  OEMEthGetSecs
//
//  This function returns relative time in seconds.
//
DWORD
OEMEthGetSecs(
    )
{
    return OALGetTickCount()/1000;
}