From 2c02c14a1dcfea4eabda9b55b0fe9c6961f1135e Mon Sep 17 00:00:00 2001 From: Thorsten Laux Date: Sun, 27 May 2018 09:33:20 +0200 Subject: [PATCH] debug log only roll and pitch, but separately --- src/main/flight/pid.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index 367e6c559a..63a2022cdb 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -631,8 +631,11 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, const rollAndPitchT if (itermRelax) { const float gyroTargetLow = pt1FilterApply(&windupLpf[axis][0], currentPidSetpoint); const float gyroTargetHigh = pt1FilterApply(&windupLpf[axis][1], currentPidSetpoint); - DEBUG_SET(DEBUG_ITERM_RELAX, 0, gyroTargetHigh); - DEBUG_SET(DEBUG_ITERM_RELAX, 1, gyroTargetLow); + if (axis < FD_YAW) { + int itemOffset = (axis << 1); + DEBUG_SET(DEBUG_ITERM_RELAX, itemOffset++, gyroTargetHigh); + DEBUG_SET(DEBUG_ITERM_RELAX, itemOffset, gyroTargetLow); + } const float gmax = MAX(gyroTargetHigh, gyroTargetLow); const float gmin = MIN(gyroTargetHigh, gyroTargetLow); if (gyroRate >= gmin && gyroRate <= gmax) {