__ALIGNED macro unified
This commit is contained in:
+11
-9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user