From 44abae2965da1440b9f8759469b5236e9a217b41 Mon Sep 17 00:00:00 2001 From: J Blackman Date: Thu, 16 Feb 2023 13:58:11 +1100 Subject: [PATCH] FIX: Poor performance due to platform movements. (#12373) --- src/main/target/common_post.h | 39 +++++++++++++++++++++++++++++++++++ src/main/target/common_pre.h | 39 ----------------------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/main/target/common_post.h b/src/main/target/common_post.h index b49ddbb1d3..b98b9a1e2e 100644 --- a/src/main/target/common_post.h +++ b/src/main/target/common_post.h @@ -39,6 +39,45 @@ */ +#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) +#define DEFAULT_AUX_CHANNEL_COUNT MAX_AUX_CHANNEL_COUNT +#else +#define DEFAULT_AUX_CHANNEL_COUNT 6 +#endif + +#ifdef USE_ITCM_RAM +#if defined(ITCM_RAM_OPTIMISATION) && !defined(DEBUG) +#define FAST_CODE __attribute__((section(".tcm_code"))) __attribute__((optimize(ITCM_RAM_OPTIMISATION))) +#else +#define FAST_CODE __attribute__((section(".tcm_code"))) +#endif +// Handle case where we'd prefer code to be in ITCM, but it won't fit on the F745 +#ifdef STM32F745xx +#define FAST_CODE_PREF +#else +#define FAST_CODE_PREF __attribute__((section(".tcm_code"))) +#endif +#define FAST_CODE_NOINLINE NOINLINE +#else +#define FAST_CODE +#define FAST_CODE_PREF +#define FAST_CODE_NOINLINE +#endif // USE_ITCM_RAM + +#ifdef USE_CCM_CODE +#define CCM_CODE __attribute__((section(".ccm_code"))) +#else +#define CCM_CODE +#endif + +#ifdef USE_FAST_DATA +#define FAST_DATA_ZERO_INIT __attribute__ ((section(".fastram_bss"), aligned(4))) +#define FAST_DATA __attribute__ ((section(".fastram_data"), aligned(4))) +#else +#define FAST_DATA_ZERO_INIT +#define FAST_DATA +#endif // USE_FAST_DATA + /* BEGIN HARDWARE INCLUSIONS diff --git a/src/main/target/common_pre.h b/src/main/target/common_pre.h index 7b2231f4f9..3e5a348ddd 100644 --- a/src/main/target/common_pre.h +++ b/src/main/target/common_pre.h @@ -59,45 +59,6 @@ #define USE_DSHOT_TELEMETRY_STATS #endif -#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) -#define DEFAULT_AUX_CHANNEL_COUNT MAX_AUX_CHANNEL_COUNT -#else -#define DEFAULT_AUX_CHANNEL_COUNT 6 -#endif - -#ifdef USE_ITCM_RAM -#if defined(ITCM_RAM_OPTIMISATION) && !defined(DEBUG) -#define FAST_CODE __attribute__((section(".tcm_code"))) __attribute__((optimize(ITCM_RAM_OPTIMISATION))) -#else -#define FAST_CODE __attribute__((section(".tcm_code"))) -#endif -// Handle case where we'd prefer code to be in ITCM, but it won't fit on the F745 -#ifdef STM32F745xx -#define FAST_CODE_PREF -#else -#define FAST_CODE_PREF __attribute__((section(".tcm_code"))) -#endif -#define FAST_CODE_NOINLINE NOINLINE -#else -#define FAST_CODE -#define FAST_CODE_PREF -#define FAST_CODE_NOINLINE -#endif // USE_ITCM_RAM - -#ifdef USE_CCM_CODE -#define CCM_CODE __attribute__((section(".ccm_code"))) -#else -#define CCM_CODE -#endif - -#ifdef USE_FAST_DATA -#define FAST_DATA_ZERO_INIT __attribute__ ((section(".fastram_bss"), aligned(4))) -#define FAST_DATA __attribute__ ((section(".fastram_data"), aligned(4))) -#else -#define FAST_DATA_ZERO_INIT -#define FAST_DATA -#endif // USE_FAST_DATA - #define USE_MOTOR #define USE_DMA #define USE_TIMER