Electrical – AVR compile error – poisoned signal

avr

I have this code from 2002. I had to update the macros but I still get 'poisoned' error messages from the compiler (AVR Cross Compile, MAC OS X) in Eclipse:

Description Resource    Path    Location    Type
attempt to use poisoned "SIG_2WIRE_SERIAL"  test        line 533, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h C/C++ Problem
attempt to use poisoned "SIG_ADC"   test        line 470, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h C/C++ Problem
attempt to use poisoned "SIG_COMPARATOR"    test        line 480, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h C/C++ Problem
attempt to use poisoned "SIG_EEPROM_READY"  test        line 475, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h C/C++ Problem
attempt to use poisoned "SIG_INPUT_CAPTURE1"    test        line 417, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h C/C++ Problem
attempt to use poisoned "SIG_INTERRUPT0"    test        line 367, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h C/C++ Problem
attempt to use poisoned "SIG_INTERRUPT1"    test        line 372, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h C/C++ Problem
attempt to use poisoned "SIG_INTERRUPT2"    test        line 377, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h C/C++ Problem
attempt to use poisoned "SIG_OUTPUT_COMPARE0"   test        line 437, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h C/C++ Problem
attempt to use poisoned "SIG_OUTPUT_COMPARE1A"  test        line 422, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h C/C++ Problem
attempt to use poisoned "SIG_OUTPUT_COMPARE1B"  test        line 427, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h C/C++ Problem
attempt to use poisoned "SIG_OUTPUT_COMPARE2"   test        line 407, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h 
attempt to use poisoned "SIG_OVERFLOW0" test        line 442, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h 
attempt to use poisoned "SIG_OVERFLOW1" test        line 432, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h 
attempt to use poisoned "SIG_OVERFLOW2" test        line 412, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h 
attempt to use poisoned "SIG_SPI"   test        line 447, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h 
attempt to use poisoned "SIG_SPM_READY" test        line 539, external location: /usr/local/CrossPack-AVR-20131216/avr/include/avr/iom128.h 

Here's the full code (Atmel128):

http://pastebin.com/uAnb2R0v

As far as I know, the SIG_ prefix means these are interrupt vectors. While there aren't interrupts in the code, it still complains. Any idea what am I doing wrong?

Best Answer

I'm not sure what command you are using to compile, but I can't replicate the poisoned signal errors.

However in order to get it to compile with avr-gcc, the following changes have to be made:

  1. Replace the 8 occurrences of __elpm_inline with pgm_read_byte_far. Alternatively you could add #define __elpm_inline(x) pgm_read_byte_far(x) to the top of the code, though that is ugly.

  2. Replace your weird use of the address macros as functions. For example you do DDRA(0<<DDA3). That should instead be DDRA &= ~(1<<DDA3) and so forth.

  3. Remove the #include <avr/iom128.h> statement. Though that doesn't stop it compiling, it shouldn't be there.

After that it compiles fine using avr-gcc with flags of -mmcu=atmega128 and -DF_CPU=....