Compile time flags __GNUC__ __AVR32_ABI_COMPILER__

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does anyone know how to define the __GNUC__ and __AVR32_ABI_COMPILER__ flags for the IDE so that it recognizes certain types and definitions while writing code?

eg:

bool noise_detect( void )
{
U16 x;
A_ALIGNED dsp16_t signal_in_fft[BUFFER_LENGTH];
A_ALIGNED dsp16_t samples_temp[BUFFER_LENGTH];
...
...
}

in the above snippet the compiler will highlight A_ALIGNED and dsp16_t as they only get defined at compilation time.

from dsp.h:

#ifdef __AVR32_ABI_COMPILER__

#if __ICCAVR32__

/*! \name Compiler Keywords
*
* Port of some keywords from GNU GCC for AVR32 to IAR Embedded Workbench for Atmel AVR32.
*/
//! @{
#ifndef __asm__
# define __asm__ asm
#endif
#ifndef __inline__
# define __inline__ inline
#endif
#ifndef __volatile__
# define __volatile__
#endif
//! @}

#endif

#if (defined __GNUC__)
//! \brief Alignment attribute on 4 bytes for 32-bit or lower microcontroller optimization for GCC compiler
# define A_ALIGNED __attribute__ ((aligned(4)))
//! \brief Packed data attribute for GCC compiler
# define A_PACKED __attribute__ ((__packed__))
#elif __ICCAVR32__
//! \brief Alignment attribute on 4 bytes for 32-bit or lower microcontroller optimization for GCC compiler
# define A_ALIGNED _Pragma("data_alignment=4")
//! \brief Packed data attribute
# define A_PACKED
#else
# error Unknown compiler
#endif

#endif // __AVR32_ABI_COMPILER__

I work with AVR32 Studio 2.7 in a Linux host. Any suggestions welcomed.

Thanks,

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I assume AVR32 Studio was built on Eclipse. Then it is Properties -> C/C++ General -> Path and Symbols.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

of course! Sorry I had brain constipation...