Hi All,
Tthe recent device packs have include files that use the symbol "BAUD" for a struct member. This makes the 'historic" use of BAUD as a #defined variable incompatible.
/opt/local/bin/avr-gcc -mmcu=atmega4809 -DF_CPU=3333333UL -Os -I.. -I../../ -B/opt/local/avr/packs/mega-1.3.300 -DBAUD=9600UL -c main.c -o main.o
In file included from /opt/local/avr/include/avr/io.h:578,
from main.c:3:
<command-line>: error: expected identifier or '(' before numeric constant
Here is a snip from avr/iom4809.h:
typedef struct USART_struct { register8_t RXDATAL; /* Receive Data Low Byte */ register8_t RXDATAH; /* Receive Data High Byte */ register8_t TXDATAL; /* Transmit Data Low Byte */ register8_t TXDATAH; /* Transmit Data High Byte */ register8_t STATUS; /* Status */ register8_t CTRLA; /* Control A */ register8_t CTRLB; /* Control B */ register8_t CTRLC; /* Control C */ _WORDREGISTER(BAUD); /* Baud Rate */ register8_t CTRLD; /* Control D */ register8_t DBGCTRL; /* Debug Control */ register8_t EVCTRL; /* Event Control */ register8_t TXPLCTRL; /* IRCOM Transmitter Pulse Length Control */ register8_t RXPLCTRL; /* IRCOM Receiver Pulse Length Control */ register8_t reserved_0x0F; } USART_t;
and in my code I use
USART0.BAUD = BAUDRATE;
where I use -DBAUDRATE=9600UL as avr-gcc argument and no longer include util/setbaud.h.
Is there a convention for dealing with this now?