ChipTest/PAN159/PAN159-Template/SampleCode/Template/user_softdelay.c

35 lines
990 B
C
Raw Normal View History

2021-09-26 09:18:47 +00:00
/*******************************************************************************
* @note Copyright (C) 2017 Shanghai Panchip Microelectronics Co., Ltd.
* All rights reserved.
*
* @file user_softdelay.c
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ@48M
*
* @history - V1.0, 2017-10-18, huoweibin, first implementation.
*******************************************************************************/
#include "user_softdelay.h"
void delay_us(uint16_t us)
{
uint16_t i = 0;
while(i < us)
{
__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
i++;
}
}
void delay_ms(uint16_t ms)
{
uint16_t i = 0;
while(i < ms)
{
delay_us(1000);
i++;
}
}