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.
Referenced by stream_mem_to_mem().
#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 mem_name(), mem_removal(), mem_unload(), memory_2_ram(), ram_2_memory(), sleepmgr_lock_mode(), sleepmgr_unlock_mode(), stream_state(), stream_stop(), uhc_dev_get_string(), uhc_enumeration_step10(), uhc_enumeration_step12(), uhc_enumeration_step13(), uhc_enumeration_step14(), uhc_enumeration_step15(), uhc_enumeration_step6(), uhc_setup_request_callback(), uhi_msc_cbw_rst_stall(), uhi_msc_cbw_sent(), uhi_msc_csw_received(), uhi_msc_data_csw_rst_stall(), uhi_msc_data_transfered(), uhi_msc_enable_step2(), and uhi_msc_enable_step5().
#define unused | ( | v | ) | do { (void)(v); } while(0) |
Marking v as a unused parameter or value.