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

📄 wait.c

📁 Windows CE 6.0 BSP for VOIP sample phone. Intel PXA270 platform.
💻 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.
//
/* Copyright 2000-2001 Intel Corp.  */
/*
 *++
 *  FACILITY:
 *
 *
 *  AUTHORS:
 *
 *      Glen Schaff
 *
 *  MODIFICATIONS:
        gds  10-31-98
 *--
*/
#include <windows.h>
#include <nkintr.h>
#include "timer.h"
#include "bulverde.h"


extern PVOID VirtualAllocCopyPhysical(unsigned size,char *str,PVOID pPhysicalAddress);
static volatile BULVERDE_OST_REG *ost;

void usWait(unsigned usVal)
{
    unsigned Start;
    static unsigned firstCall=1;

    if (firstCall)
    {
        ost = (volatile BULVERDE_OST_REG*)VirtualAllocCopyPhysical(0x80,"Wait OST",(PVOID)(BULVERDE_BASE_REG_PA_OST));
        if (!ost)
        {
            RETAILMSG(TRUE, (TEXT("usWait: Map OST register failed\r\n")));
            return;
        }
        firstCall=0;
    }

    if (usVal != 0)
    {
        Start = ost->oscr0;
        while ((ost->oscr0 - Start) < usVal * TIMERTICK)
        {
            // do nothing
        }
    }
}

void msWait(unsigned msVal)
{
    usWait(msVal*1000);
}

void sWait(unsigned sVal)
{
    msWait(sVal*1000);
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -