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>

原文

posted @ 2012-05-25 10:01  Han Gang  阅读(561)  评论(0编辑  收藏  举报