[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] __builtin_avr_delay_cycles expects an integer constant.

From: Victor Aprea
Subject: [avr-gcc-list] __builtin_avr_delay_cycles expects an integer constant.
Date: Wed, 2 May 2012 21:38:25 -0400

Hi folks-

I'm (at long last) trying to switch from using Windows to using Ubuntu for my AVR development. I'm using AVR-GCC 4.5.3 on Ubuntu 12.04. I'm using the Eclipse IDE with the AVR-GCC plugin. I'm getting the following error trace from the compiler:

In file included from ../soft_uart.c:16:0:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h: In function ‘soft_uart_init’:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h:153:28: error: __builtin_avr_delay_cycles expects an integer constant.
/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h: In function ‘delay_bit_time’:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h:230:28: error: __builtin_avr_delay_cycles expects an integer constant.

line 16 of soft_uart.c is just the #include <util/delay.h> line.

I use _delay_ms and _delay_us in exactly six lines of code. The first two are:

_delay_ms(BIT_TIME_US * 2);

which both depend on the following definitions:

#define BAUD_RATE   2400
#define BIT_TIME_US (1000000.0 / BAUD_RATE)

and then also the following four lines:


I've read this thread on avr-freaks and also this bug-report, but nothing jumps out at me as being relevant. Obviously, my arguments are all well defined constants at compile-time. The same error message shows up as long as at least one of those six lines is not commented out.

Every single avr-gcc call issued by Eclipse contains the argument -DF_CPU=3686400UL so F_CPU is also a well defined constant. What the heck is going on here?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]