?? stall.c
字號:
// Copyright (c) David Vescovi. All rights reserved.
// Part of Project DrumStix
// Windows Embedded Developers Interest Group (WE-DIG) community project.
// http://www.we-dig.org
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
//
// File: stall.c
//
// This module implements the OALStall.
//
//------------------------------------------------------------------------------
#include <bsp.h>
//------------------------------------------------------------------------------
// Defines
//
//------------------------------------------------------------------------------
// Externs
//
//------------------------------------------------------------------------------
// Global Variables
//------------------------------------------------------------------------------
// Local Variables
//
//------------------------------------------------------------------------------
// Local Functions
//
//------------------------------------------------------------------------------
//
// Function: OALStall
//
// Delays us
//
//------------------------------------------------------------------------------
void OALStall(UINT32 microSeconds)
{
volatile OST_REG_T *pOSTRegs= (volatile OST_REG_T *) OALPAtoVA((PXA255_BASE_REG_PA_OST), FALSE);
UINT32_T expireTime, time;
time = pOSTRegs->OSCR;
expireTime = time + (microSeconds * OEM_TICKS_1US);
//
// Check if we wrapped on the expireTime
// and delay first part until wrap
//
if (expireTime < time)
{
while (time < pOSTRegs->OSCR);
}
while (pOSTRegs->OSCR <= expireTime);
}
//------------------------------------------------------------------------------
//
// Function: OALSpinForever
//
// Never ending loop.
//
//------------------------------------------------------------------------------
void OALSpinForever(void)
{
while (1)
{
;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -