PASII/CandeII_1.4/Driver/delay.c

26 lines
436 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
延时函数文件
作者:北京盛源达科技有限公司
日期2016/7/8
*/
#include "delay.h"
/*
n毫秒延时函数
参数: uint16_t n 要延时的毫秒数 单位1ms 注意时钟 64M
*/
void delay_ms(uint16_t n) {
uint16_t i,j;
for(i=0; i<n; i++)
for(j=0; j<8000; j++);
}
/*
n微秒延时函数
参数: uint16_t n 要延时的微秒数 单位1us 注意时钟 64M
*/
void delay_us(uint16_t n) {
uint16_t i,j;
for(i=0; i<n; i++)
for(j=0; j<8; j++);
}