mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 08:15:17 +03:00
Move __attribute__ ((section(s), used))
macro, and cosmetics in definitions.h. (#5549)
This commit is contained in:
parent
aff40dac8d
commit
38762fb618
2 changed files with 23 additions and 33 deletions
|
@ -23,8 +23,10 @@
|
|||
|
||||
#if defined(SIMU)
|
||||
#define __ALIGNED
|
||||
#define __SECTION_USED(s)
|
||||
#else
|
||||
#define __ALIGNED __attribute__((aligned(32)))
|
||||
#define __SECTION_USED(s) __attribute__ ((section(s), used))
|
||||
#endif
|
||||
|
||||
#if defined(SIMU)
|
||||
|
@ -37,13 +39,9 @@
|
|||
|
||||
#if defined(PCBHORUS) && !defined(SIMU)
|
||||
#define __SDRAM __attribute__((section(".sdram"), aligned(32)))
|
||||
#else
|
||||
#define __SDRAM __DMA
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS) && !defined(SIMU)
|
||||
#define __NOINIT __attribute__((section(".noinit")))
|
||||
#else
|
||||
#define __SDRAM __DMA
|
||||
#define __NOINIT
|
||||
#endif
|
||||
|
||||
|
@ -54,29 +52,27 @@ typedef __int24 int24_t;
|
|||
#endif
|
||||
|
||||
#if __GNUC__
|
||||
#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
|
||||
#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
|
||||
#else
|
||||
#define PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
|
||||
#define PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
|
||||
#endif
|
||||
|
||||
#if defined(SIMU)
|
||||
#if !defined(FORCEINLINE)
|
||||
#define FORCEINLINE inline
|
||||
#endif
|
||||
#if !defined(NOINLINE)
|
||||
#define NOINLINE
|
||||
#endif
|
||||
#define CONVERT_PTR_UINT(x) ((uint32_t)(uint64_t)(x))
|
||||
#define CONVERT_UINT_PTR(x) ((uint32_t*)(uint64_t)(x))
|
||||
#if !defined(FORCEINLINE)
|
||||
#define FORCEINLINE inline
|
||||
#endif
|
||||
#if !defined(NOINLINE)
|
||||
#define NOINLINE
|
||||
#endif
|
||||
#define CONVERT_PTR_UINT(x) ((uint32_t)(uint64_t)(x))
|
||||
#define CONVERT_UINT_PTR(x) ((uint32_t*)(uint64_t)(x))
|
||||
#else
|
||||
#if !defined(_MSC_VER) || (_MSC_VER < 1200)
|
||||
#define FORCEINLINE inline __attribute__ ((always_inline))
|
||||
#endif
|
||||
#define NOINLINE __attribute__ ((noinline))
|
||||
#define SIMU_SLEEP(x)
|
||||
#define SIMU_SLEEP_NORET(x)
|
||||
#define CONVERT_PTR_UINT(x) ((uint32_t)(x))
|
||||
#define CONVERT_UINT_PTR(x) ((uint32_t *)(x))
|
||||
#define NOINLINE __attribute__ ((noinline))
|
||||
#define SIMU_SLEEP(x)
|
||||
#define SIMU_SLEEP_NORET(x)
|
||||
#define CONVERT_PTR_UINT(x) ((uint32_t)(x))
|
||||
#define CONVERT_UINT_PTR(x) ((uint32_t *)(x))
|
||||
#endif
|
||||
|
||||
#endif // _DEFINITIONS_H_
|
||||
|
|
|
@ -51,14 +51,8 @@
|
|||
*/
|
||||
#if defined(STM32)
|
||||
|
||||
#if defined(SIMU)
|
||||
#define ATTRIBUTE_SECTION(s)
|
||||
#else
|
||||
#define ATTRIBUTE_SECTION(s) __attribute__ ((section(s), used))
|
||||
#endif
|
||||
|
||||
ATTRIBUTE_SECTION(".fwversiondata") const char firmware_version[] = "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")";
|
||||
ATTRIBUTE_SECTION(".bootversiondata") const char boot_version[] = "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")";
|
||||
__SECTION_USED(".fwversiondata") const char firmware_version[] = "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")";
|
||||
__SECTION_USED(".bootversiondata") const char boot_version[] = "opentx-" FLAVOUR "-" VERSION " (" GIT_STR ")";
|
||||
|
||||
/**
|
||||
* Tries to find opentx version in the first 1024 byte of either firmware/bootloader (the one not running) or the buffer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue