📄 delay.c
字号:
#include <fx2.h>
#include <fx2regs.h>
void EZUSB_Delay(WORD ms)
{
//
// Adjust the delay based on the CPU clock
// EZUSB_Delay1ms() assumes a 24MHz clock
//
if ((CPUCS & bmCLKSPD) == 0) // 12Mhz
ms = (ms + 1) / 2; // Round up before dividing so we can accept 1.
else if ((CPUCS & bmCLKSPD) == bmCLKSPD1) // 48Mhz
ms = ms * 2;
while(ms--)
EZUSB_Delay1ms();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -