mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 16:55:20 +03:00
__ALIGNED macro unified
This commit is contained in:
parent
d47c3cedb4
commit
f60733b561
7 changed files with 19 additions and 25 deletions
|
@ -21,27 +21,29 @@
|
|||
#ifndef _DEFINITIONS_H_
|
||||
#define _DEFINITIONS_H_
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#if defined(SIMU) && __GNUC__
|
||||
#define __ALIGNED __attribute__((aligned(32)))
|
||||
#define __ALIGNED(x) __attribute__((aligned(x)))
|
||||
#define __SECTION_USED(s) __attribute__((used))
|
||||
#elif defined(SIMU)
|
||||
#define __ALIGNED
|
||||
#define __ALIGNED(x) __declspec(align(x))
|
||||
#define __SECTION_USED(s)
|
||||
#else
|
||||
#define __ALIGNED __attribute__((aligned(32)))
|
||||
#define __SECTION_USED(s) __attribute__ ((section(s), used))
|
||||
#define __ALIGNED(x) __attribute__((aligned(x)))
|
||||
#define __SECTION_USED(s) __attribute__((section(s), used))
|
||||
#endif
|
||||
|
||||
#if defined(SIMU)
|
||||
#define __DMA
|
||||
#elif (defined(STM32F4) && !defined(BOOT)) || defined(PCBHORUS)
|
||||
#define __DMA __attribute__((section(".ram"), aligned(32)))
|
||||
#elif (defined(STM32F4) && !defined(BOOT)) || defined(SDRAM)
|
||||
#define __DMA __attribute__((section(".ram"), aligned(4)))
|
||||
#else
|
||||
#define __DMA __ALIGNED
|
||||
#define __DMA __ALIGNED(4)
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS) && !defined(SIMU)
|
||||
#define __SDRAM __attribute__((section(".sdram"), aligned(32)))
|
||||
#if defined(SDRAM) && !defined(SIMU)
|
||||
#define __SDRAM __attribute__((section(".sdram"), aligned(4)))
|
||||
#define __NOINIT __attribute__((section(".noinit")))
|
||||
#else
|
||||
#define __SDRAM __DMA
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue