#ifdef __PICCPRO__
/****************************************************************/
/* Built-in delay routine */
/****************************************************************/
#pragma intrinsic(_delay)
extern __nonreentrant void _delay(unsigned long);
#pragma intrinsic(_delaywdt)
extern __nonreentrant void _delaywdt(unsigned long);
#if defined(_PIC14E) || defined(_PIC14EX)
#pragma intrinsic(_delay3)
extern __nonreentrant void _delay3(unsigned char);
#endif
// NOTE: To use the macros below, YOU must have previously defined _XTAL_FREQ
#define __delay_us(x) _delay((unsigned long)((x)*(_XTAL_FREQ/4000000.0)))
#define __delay_ms(x) _delay((unsigned long)((x)*(_XTAL_FREQ/4000.0)))
#endif
如何查看delay函数的C代码呢,自己写个延迟函数各种问题 |