AVRGCC的F_CPU的错误(转载)
1.warning: #warning "F_CPU not defined for <util/delay.h>"
2.warning: "F_CPU" redefined
3.c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h:86:1: warning: this is the location of the previous definition
出现以上三种错误的解决办法是将#define F_CPU 1000000
放在在#include <util/delay.h>语句之前,如下:
#define F_CPU 1000000
#include <avr/io.h>
#include <util/delay.h>
这样的错误 c:/avr/winavr/lib/gcc/../../avr/include/util/delay.h:85:3: warning: #warning "F_CPU not defined for <util/delay.h>"
//一定要定义:在PROJECT===》CONFIGURATION OPTIONS===>GENNRAL===》Frequency===》填写你晶体的频率,就这样,你的问题就可以解决掉了。