Compiler abstraction layer and code utilities for 32-bit AVR.
This module provides various abstraction layers and utilities to make code compatible between different compilers.
Modules | |
Preprocessor - Macro Repeat | |
Preprocessor - Stringize | |
Preprocessor - Token Paste | |
Status Codes | |
Macros | |
#define | barrier() asm volatile("" ::: "memory") |
Memory barrier. More... | |
#define | COMPILER_ALIGNED(a) __attribute__((__aligned__(a))) |
Set aligned boundary. More... | |
#define | COMPILER_PACK_RESET() COMPILER_PRAGMA(pack()) |
Set default alignment for subsequent struct and union definitions. More... | |
#define | COMPILER_PACK_SET(alignment) COMPILER_PRAGMA(pack(alignment)) |
Set maximum alignment for subsequent struct and union definitions to alignment. More... | |
#define | COMPILER_PRAGMA(arg) _Pragma(#arg) |
Emit the compiler pragma arg. More... | |
#define | COMPILER_WORD_ALIGNED __attribute__((__aligned__(4))) |
Set word-aligned boundary. More... | |
#define | Get_system_register(reg) sysreg_read(reg) |
#define | Set_system_register(reg, val) sysreg_write(reg, val) |
#define | sysreg_write(reg, val) __builtin_mtsr(reg, val) |
Set value of system register. More... | |
#define | UNUSED(v) (void)(v) |
Marking v as a unused parameter or value. More... | |
#define | unused(v) do { (void)(v); } while(0) |
Marking v as a unused parameter or value. More... | |
System Register Access | |
#define | sysreg_read(reg) __builtin_mfsr(reg) |
Get value of system register. More... | |
Tag functions as deprecated | |
Tagging a function as deprecated will produce a warning when and only when the function is called. Usage is to add the DEPRECATED symbol before the function definition. E.g.: DEPRECATED uint8_t some_deprecated_function (void) { ... }
| |
#define | __DEPRECATED__ __attribute__((__deprecated__)) |
#define __DEPRECATED__ __attribute__((__deprecated__)) |
#define barrier | ( | ) | asm volatile("" ::: "memory") |
Memory barrier.
Referenced by cpu_irq_restore().
#define COMPILER_ALIGNED | ( | a | ) | __attribute__((__aligned__(a))) |
Set aligned boundary.
#define COMPILER_PACK_RESET | ( | ) | COMPILER_PRAGMA(pack()) |
Set default alignment for subsequent struct and union definitions.
#define COMPILER_PACK_SET | ( | alignment | ) | COMPILER_PRAGMA(pack(alignment)) |
Set maximum alignment for subsequent struct and union definitions to alignment.
#define COMPILER_PRAGMA | ( | arg | ) | _Pragma(#arg) |
Emit the compiler pragma arg.
arg | The pragma directive as it would appear after #pragma (i.e. not stringified). |
#define COMPILER_WORD_ALIGNED __attribute__((__aligned__(4))) |
Set word-aligned boundary.
#define Get_system_register | ( | reg | ) | sysreg_read(reg) |
Referenced by gpio_local_init().
#define Set_system_register | ( | reg, | |
val | |||
) | sysreg_write(reg, val) |
Referenced by gpio_local_init().
#define sysreg_read | ( | reg | ) | __builtin_mfsr(reg) |
Get value of system register.
reg | Address of the system register of which to get the value. |
Referenced by cpu_irq_save().
#define sysreg_write | ( | reg, | |
val | |||
) | __builtin_mtsr(reg, val) |
Set value of system register.
reg | Address of the system register of which to set the value. |
val | Value to set the system register reg to. |
#define UNUSED | ( | v | ) | (void)(v) |
Marking v as a unused parameter or value.
Referenced by run_usb_cdc_test(), sleepmgr_lock_mode(), sleepmgr_unlock_mode(), udi_cdc_data_sent(), udi_cdc_line_coding_received(), and udi_cdc_serial_state_msg_sent().
#define unused | ( | v | ) | do { (void)(v); } while(0) |
Marking v as a unused parameter or value.