⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stall.c

📁 老外的一个开源项目
💻 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 + -