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

22 lines
223 B
C
Raw Normal View History

2022-04-28 02:00:04 +00:00
#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();
}