35 lines
990 B
C
35 lines
990 B
C
/*******************************************************************************
|
|
* @note Copyright (C) 2017 Shanghai Panchip Microelectronics Co., Ltd.
|
|
* All rights reserved.
|
|
*
|
|
* @file user_softdelay.c
|
|
* @brief Èí¼þÑÓʱ@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++;
|
|
}
|
|
}
|
|
|