📄 wait.c
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
// File: Wait.c
//
// This file contains delay functions for the bootloader.
//
#include <windows.h>
#include "bulverde_base_regs.h"
#include <oal_memory.h>
#define OSCR_OFFSET 0x10 // OSCR0
void Wait(UINT32 microSeconds)
{
volatile UINT32 *TimerOSCRAddress= (volatile UINT32 *) OALPAtoVA((BULVERDE_BASE_REG_PA_OST + OSCR_OFFSET), FALSE);
UINT32 Value, Time;
Time = *TimerOSCRAddress;
Value = Time + (microSeconds * 4);
if (Value < Time)
{ // test for wrap.
while (Time < *TimerOSCRAddress);
}
while (*TimerOSCRAddress <= Value);
}
void msWait(UINT32 msVal)
{
Wait(msVal*1000);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -