Skip to content

Commit

Permalink
noinline the functions to reduce ITCM impact
Browse files Browse the repository at this point in the history
  • Loading branch information
ctzsnooze committed May 5, 2024
1 parent 975178a commit a5ef022
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/flight/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,15 +744,14 @@ float pidGetAirmodeThrottleOffset(void)
#endif



// ezLanding stuff
static bool applyEzLandingLimiting = false;
static float ezLandingLimit = PIDSUM_LIMIT;
static float maxDeflectionAbs = 1.0f;

// EzLanding factors are updated only when new Rx data is received in rc.c
// this will cause steps in PID as the limiting value changes
void calcEzLandingLimit(float maxRcDeflectionAbs)
FAST_CODE_NOINLINE void calcEzLandingLimit(float maxRcDeflectionAbs)
{
if (pidRuntime.useEzLanding && !isFlipOverAfterCrashActive()) {
maxDeflectionAbs = fmaxf(maxRcDeflectionAbs, mixerGetRcThrottle());
Expand All @@ -768,8 +767,7 @@ void calcEzLandingLimit(float maxRcDeflectionAbs)
DEBUG_SET(DEBUG_EZLANDING, 1, maxDeflectionAbs * 100);
}


static void disarmOnImpact(void)
static FAST_CODE_NOINLINE void disarmOnImpact(void)
{
// if both sticks are within 5% of center, check acc magnitude for impacts
// at half the impact threshold, force iTerm to zero, to attenuate iTerm-mediated bouncing
Expand All @@ -789,7 +787,6 @@ static void disarmOnImpact(void)
}
}


#ifdef USE_LAUNCH_CONTROL
#define LAUNCH_CONTROL_MAX_RATE 100.0f
#define LAUNCH_CONTROL_MIN_RATE 5.0f
Expand Down

0 comments on commit a5ef022

Please sign in to comment.