Merge pull request #5941 from DieHertz/noinline-and-fastcode-only

Apply NOINLINE conditionally on ITCM presence
This commit is contained in:
Michael Keller 2018-05-24 09:35:40 +12:00 committed by GitHub
commit a07b4987aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 12 additions and 8 deletions

View File

@ -886,7 +886,7 @@ static void subTaskPidController(timeUs_t currentTimeUs)
#endif #endif
} }
static NOINLINE void subTaskMainSubprocesses(timeUs_t currentTimeUs) static FAST_CODE_NOINLINE void subTaskMainSubprocesses(timeUs_t currentTimeUs)
{ {
uint32_t startTime = 0; uint32_t startTime = 0;
if (debugMode == DEBUG_PIDLOOP) { if (debugMode == DEBUG_PIDLOOP) {

View File

@ -180,7 +180,7 @@ static void checkForThrottleErrorResetState(uint16_t rxRefreshRate)
} }
} }
FAST_CODE NOINLINE void processRcCommand(void) FAST_CODE FAST_CODE_NOINLINE void processRcCommand(void)
{ {
static float rcCommandInterp[4]; static float rcCommandInterp[4];
static float rcStepSize[4]; static float rcStepSize[4];
@ -266,7 +266,7 @@ FAST_CODE NOINLINE void processRcCommand(void)
} }
} }
FAST_CODE NOINLINE void updateRcCommands(void) FAST_CODE FAST_CODE_NOINLINE void updateRcCommands(void)
{ {
// PITCH & ROLL only dynamic PID adjustment, depending on throttle value // PITCH & ROLL only dynamic PID adjustment, depending on throttle value
int32_t prop; int32_t prop;

View File

@ -735,7 +735,7 @@ float applyThrottleLimit(float throttle)
return throttle; return throttle;
} }
NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensation) FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensation)
{ {
if (isFlipOverAfterCrashMode()) { if (isFlipOverAfterCrashMode()) {
applyFlipOverAfterCrashModeToMotors(); applyFlipOverAfterCrashModeToMotors();

View File

@ -38,7 +38,7 @@ int main(void)
return 0; return 0;
} }
void FAST_CODE NOINLINE run(void) void FAST_CODE FAST_CODE_NOINLINE run(void)
{ {
while (true) { while (true) {
scheduler(); scheduler();

View File

@ -972,7 +972,7 @@ FAST_CODE int32_t gyroSlewLimiter(gyroSensor_t *gyroSensor, int axis)
#endif #endif
#ifdef USE_GYRO_OVERFLOW_CHECK #ifdef USE_GYRO_OVERFLOW_CHECK
static NOINLINE void handleOverflow(gyroSensor_t *gyroSensor, timeUs_t currentTimeUs) static FAST_CODE_NOINLINE void handleOverflow(gyroSensor_t *gyroSensor, timeUs_t currentTimeUs)
{ {
const float gyroOverflowResetRate = GYRO_OVERFLOW_RESET_THRESHOLD * gyroSensor->gyroDev.scale; const float gyroOverflowResetRate = GYRO_OVERFLOW_RESET_THRESHOLD * gyroSensor->gyroDev.scale;
if ((abs(gyro.gyroADCf[X]) < gyroOverflowResetRate) if ((abs(gyro.gyroADCf[X]) < gyroOverflowResetRate)
@ -1024,7 +1024,7 @@ static FAST_CODE void checkForOverflow(gyroSensor_t *gyroSensor, timeUs_t curren
#endif // USE_GYRO_OVERFLOW_CHECK #endif // USE_GYRO_OVERFLOW_CHECK
#ifdef USE_YAW_SPIN_RECOVERY #ifdef USE_YAW_SPIN_RECOVERY
static NOINLINE void handleYawSpin(gyroSensor_t *gyroSensor, timeUs_t currentTimeUs) static FAST_CODE_NOINLINE void handleYawSpin(gyroSensor_t *gyroSensor, timeUs_t currentTimeUs)
{ {
const float yawSpinResetRate = gyroConfig()->yaw_spin_threshold - 100.0f; const float yawSpinResetRate = gyroConfig()->yaw_spin_threshold - 100.0f;
if (abs(gyro.gyroADCf[Z]) < yawSpinResetRate) { if (abs(gyro.gyroADCf[Z]) < yawSpinResetRate) {
@ -1062,7 +1062,7 @@ static FAST_CODE void checkForYawSpin(gyroSensor_t *gyroSensor, timeUs_t current
} }
#endif // USE_YAW_SPIN_RECOVERY #endif // USE_YAW_SPIN_RECOVERY
static FAST_CODE NOINLINE void gyroUpdateSensor(gyroSensor_t *gyroSensor, timeUs_t currentTimeUs) static FAST_CODE FAST_CODE_NOINLINE void gyroUpdateSensor(gyroSensor_t *gyroSensor, timeUs_t currentTimeUs)
{ {
if (!gyroSensor->gyroDev.readFn(&gyroSensor->gyroDev)) { if (!gyroSensor->gyroDev.readFn(&gyroSensor->gyroDev)) {
return; return;

View File

@ -96,8 +96,10 @@
#ifdef USE_ITCM_RAM #ifdef USE_ITCM_RAM
#define FAST_CODE __attribute__((section(".tcm_code"))) #define FAST_CODE __attribute__((section(".tcm_code")))
#define FAST_CODE_NOINLINE NOINLINE
#else #else
#define FAST_CODE #define FAST_CODE
#define FAST_CODE_NOINLINE
#endif // USE_ITCM_RAM #endif // USE_ITCM_RAM
#ifdef USE_FAST_RAM #ifdef USE_FAST_RAM

View File

@ -60,6 +60,7 @@
#endif #endif
#define FAST_CODE #define FAST_CODE
#define FAST_CODE_NOINLINE
#define FAST_RAM_ZERO_INIT #define FAST_RAM_ZERO_INIT
#define FAST_RAM #define FAST_RAM

View File

@ -27,6 +27,7 @@
#define NOINLINE #define NOINLINE
#define FAST_CODE #define FAST_CODE
#define FAST_CODE_NOINLINE
#define FAST_RAM_ZERO_INIT #define FAST_RAM_ZERO_INIT
#define FAST_RAM #define FAST_RAM