This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/MCU/MCU_6 _UART/delay.c
2022-04-28 10:00:04 +08:00

22 lines
No EOL
223 B
C

#include "delay.h"
#include <intrins.h>
void delay100us()
{
unsigned char i, j;
_nop_();
_nop_();
i = 2;
j = 15;
do
{
while (--j);
} while (--i);
}
void delay(int i)
{
int j = i;
for(;j>0;j--)
delay100us();
}