diff --git a/src/main/common/sdft.c b/src/main/common/sdft.c index c10bbc341f9..f0b496265b3 100644 --- a/src/main/common/sdft.c +++ b/src/main/common/sdft.c @@ -71,7 +71,7 @@ void sdftInit(sdft_t *sdft, const int startBin, const int endBin, const int numB FAST_CODE void sdftPush(sdft_t *sdft, const float sample) { const float delta = sample - rPowerN * sdft->samples[sdft->idx]; - + sdft->samples[sdft->idx] = sample; sdft->idx = (sdft->idx + 1) % SDFT_SAMPLE_SIZE; diff --git a/src/main/drivers/rx/rx_sx1280.c b/src/main/drivers/rx/rx_sx1280.c index d41d67115dd..e4e8aa36c00 100644 --- a/src/main/drivers/rx/rx_sx1280.c +++ b/src/main/drivers/rx/rx_sx1280.c @@ -76,7 +76,7 @@ bool sx1280IsBusy(void) return IORead(busy); } -FAST_CODE static bool sx1280PollBusy(void) +FAST_CODE_PREF static bool sx1280PollBusy(void) { uint32_t startTime = micros(); while (IORead(busy)) { @@ -89,7 +89,7 @@ FAST_CODE static bool sx1280PollBusy(void) return true; } -FAST_CODE static bool sx1280MarkBusy(void) +FAST_CODE_PREF static bool sx1280MarkBusy(void) { // Check that there isn't already a sequence of accesses to the SX1280 in progress ATOMIC_BLOCK(NVIC_PRIO_MAX) { @@ -109,7 +109,7 @@ static void sx1280ClearBusyFn(void) } // Switch to waiting for busy interrupt -FAST_CODE static bool sx1280EnableBusy(void) +FAST_CODE_PREF static bool sx1280EnableBusy(void) { if (!sx1280MarkBusy()) { return false; diff --git a/src/main/target/STM32F745/target.h b/src/main/target/STM32F745/target.h index d538265759d..4103b370439 100644 --- a/src/main/target/STM32F745/target.h +++ b/src/main/target/STM32F745/target.h @@ -85,3 +85,6 @@ #define USE_EXTI #define FLASH_PAGE_SIZE ((uint32_t)0x8000) // 32K sectors + +// ITCM is in short supply so excluding fast code where preferred, not required. +#define FAST_CODE_PREF diff --git a/src/main/target/STM32F7X2/target.h b/src/main/target/STM32F7X2/target.h index 0693aa16d4a..2accccfe765 100644 --- a/src/main/target/STM32F7X2/target.h +++ b/src/main/target/STM32F7X2/target.h @@ -77,3 +77,6 @@ #define USE_EXTI #define FLASH_PAGE_SIZE ((uint32_t)0x4000) // 16K sectors + +// ITCM is in short supply so excluding fast code where preferred, not required. +#define FAST_CODE_PREF diff --git a/src/main/target/common_post.h b/src/main/target/common_post.h index 1d335136ca4..e4f62ae2ad2 100644 --- a/src/main/target/common_post.h +++ b/src/main/target/common_post.h @@ -51,13 +51,13 @@ #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"))) +// Handle case where we'd prefer code to be in ITCM, but it won't fit on the device +#ifndef FAST_CODE_PREF +#define FAST_CODE_PREF FAST_CODE #endif + #define FAST_CODE_NOINLINE NOINLINE + #else #define FAST_CODE #define FAST_CODE_PREF