void Delay_Us(uint8_t freq,uint32_t time)
{
uint32_t i;
uint16_t num = 90;
switch(freq)
{
case 240: num = 80;break;
case 160: num = 53;break;
default: printf("delay input freq err...default set 240MHZ us time \r\n ");break;
}
for (i = 0; i < (num)*time; i++)
{
__NOP();
}
}
void Delay_Ms(uint8_t freq,uint32_t time)
{
uint32_t i;
uint16_t num = 90;
switch(freq)
{
case 240: num = 80;break;
case 160: num = 53;break;
default: printf("delay input freq err...default set 240MHZ us time \r\n ");break;
}
for (i = 0; i < (num)*time*1000; i++)
{
__NOP();
}
}