Message ID | 20140730071917.GA1287@atmel.com |
---|---|
State | New |
Headers | show |
2014-07-30 11:19 GMT+04:00 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>: > On Mon, Jul 28, 2014 at 08:09:28PM +0200, Georg-Johann Lay wrote: >> Senthil Kumar Selvaraj schrieb: >> >The below patch adds a new preprocessor define for the device name >> >(__AVR_DEVICE_NAME__) that was passed to the compiler. >> > >> >While the device name macro (say __AVR_ATmega128__) can be used to check >> >for a specific device, there is no way right now for code to get the >> >device name it is being compiled against (without checking >> >for every possible device). >> >> Shouldn't this also be added to the documentation? >> There's a section "AVR Built-in Macros" in the manual. > > Thanks for reminding me, Johann. Here's the patch - if ok, could someone > commit please? > > Regards > Senthil > > 2014-07-30 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> > > * doc/invoke.texi (AVR Options): Add documentation about > __AVR_DEVICE_NAME__ built-in macro. > Committed. Denis.
diff --git gcc/doc/invoke.texi gcc/doc/invoke.texi index 7cebb9e..e201496 100644 --- gcc/doc/invoke.texi +++ gcc/doc/invoke.texi @@ -13114,6 +13114,14 @@ the device name as from the AVR user manual. The difference between If @var{device} is not a device but only a core architecture like @code{avr51}, this macro will not be defined. +@item __AVR_DEVICE_NAME__ +Setting @code{-mmcu=@var{device}} defines this built-in macro to +the device's name. For example, with @code{-mmcu=atmega8} the macro +will be defined to @code{atmega8}. + +If @var{device} is not a device but only a core architecture like +@code{avr51}, this macro will not be defined. + @item __AVR_XMEGA__ The device / architecture belongs to the XMEGA family of devices.