IAR编译时报错Error[e46]: Undefined external "_delay_cycles" referred in main

IAR编译时报错Error[e46]: Undefined external “_delay_cycles” referred in main

学习MSP430过程中遇到有如下一个函数

#define CPU_F ((double)8000000)
#define delay_ms(x) _delay_cycles((long)(CPU_F*(double)x/1000.0))
#define delay_us(x) _delay_cycles((long)(CPU_F*(double)x/1000000.0))
编译后报错“Error[e46]: Undefined external “_delay_cycles” referred in main”

解决:“_____delay_cycles”前面的“下划线"需要按住shift键,然后敲击两次"____"

你可能感兴趣的:(IAR编译时报错Error[e46]: Undefined external "_delay_cycles" referred in main)