📄 helper.cpp
字号:
#include <windows.h>
#include <s3c2440x.h>
#include "bsp_cfg.h"
void Delay(USHORT count)
{
volatile int i, j = 0;
volatile static int loop = S3C2440X_FCLK/100000;
for(;count > 0;count--)
for(i=0;i < loop; i++)
{ j++; }
}
PVOID Cam_RegAlloc(PVOID addr, INT sz)
{
PVOID reg;
reg = (PVOID)VirtualAlloc(0, sz, MEM_RESERVE, PAGE_NOACCESS);
if (reg)
{
if (!VirtualCopy(reg, (PVOID)((UINT32)addr >> 8), sz, PAGE_PHYSICAL | PAGE_READWRITE | PAGE_NOCACHE ))
{
RETAILMSG(1,(TEXT("Virtual copy failed: \r\n")));
VirtualFree(reg, sz, MEM_RELEASE);
reg = NULL;
}
else
{
RETAILMSG(1,(TEXT("Virtual alloc/copy success : \r\n")));
}
}
else
{
RETAILMSG(1,(TEXT("Virtual alloc failed: \r\n")));
}
return reg;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -