1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 15:25:36 +03:00

Debug modes cleanup

This commit is contained in:
Štěpán Dalecký 2021-12-04 18:43:05 +01:00
parent 95589e0fc9
commit 564421ce1c
4 changed files with 10 additions and 21 deletions

View file

@ -30,8 +30,6 @@
#include "platform.h"
#include "build/debug.h"
#include "common/axis.h"
#include "common/maths.h"
@ -105,7 +103,6 @@ bool mpu9250SpiWriteRegisterVerify(const extDevice_t *dev, uint8_t reg, uint8_t
if (in == data) {
return true;
} else {
debug[3]++;
mpu9250SpiWriteRegister(dev, reg, data);
delayMicroseconds(100);
}

View file

@ -1295,10 +1295,8 @@ FAST_CODE void taskMainPidLoop(timeUs_t currentTimeUs)
subTaskMotorUpdate(currentTimeUs);
subTaskPidSubprocesses(currentTimeUs);
if (debugMode == DEBUG_CYCLETIME) {
DEBUG_SET(DEBUG_CYCLETIME, 0, getTaskDeltaTimeUs(TASK_SELF));
DEBUG_SET(DEBUG_CYCLETIME, 1, getAverageSystemLoadPercent());
}
DEBUG_SET(DEBUG_CYCLETIME, 0, getTaskDeltaTimeUs(TASK_SELF));
DEBUG_SET(DEBUG_CYCLETIME, 1, getAverageSystemLoadPercent());
}
bool isFlipOverAfterCrashActive(void)

View file

@ -520,12 +520,10 @@ static FAST_CODE void processRcSmoothingFilter(void)
}
// rx frame rate training blackbox debugging
if (debugMode == DEBUG_RC_SMOOTHING_RATE) {
DEBUG_SET(DEBUG_RC_SMOOTHING_RATE, 0, currentRxRefreshRate); // log each rx frame interval
DEBUG_SET(DEBUG_RC_SMOOTHING_RATE, 1, rcSmoothingData.training.count); // log the training step count
DEBUG_SET(DEBUG_RC_SMOOTHING_RATE, 2, rcSmoothingData.averageFrameTimeUs);// the current calculated average
DEBUG_SET(DEBUG_RC_SMOOTHING_RATE, 3, sampleState); // indicates whether guard time is active
}
DEBUG_SET(DEBUG_RC_SMOOTHING_RATE, 0, currentRxRefreshRate); // log each rx frame interval
DEBUG_SET(DEBUG_RC_SMOOTHING_RATE, 1, rcSmoothingData.training.count); // log the training step count
DEBUG_SET(DEBUG_RC_SMOOTHING_RATE, 2, rcSmoothingData.averageFrameTimeUs);// the current calculated average
DEBUG_SET(DEBUG_RC_SMOOTHING_RATE, 3, sampleState); // indicates whether guard time is active
}
// Get new values to be smoothed
for (int i = 0; i < PRIMARY_CHANNEL_COUNT; i++) {

View file

@ -382,9 +382,7 @@ uint32_t baroUpdate(void)
static barometerState_e state = BAROMETER_NEEDS_PRESSURE_START;
timeUs_t sleepTime = 1000; // Wait 1ms between states
if (debugMode == DEBUG_BARO) {
debug[0] = state;
}
DEBUG_SET(DEBUG_BARO, 0, state);
// Tell the scheduler to ignore how long this task takes unless the pressure is being read
// as that takes the longest
@ -447,11 +445,9 @@ uint32_t baroUpdate(void)
state = BAROMETER_NEEDS_TEMPERATURE_START;
}
if (debugMode == DEBUG_BARO) {
debug[1] = baroTemperature;
debug[2] = baroPressure;
debug[3] = baroPressureSum;
}
DEBUG_SET(DEBUG_BARO, 1, baroTemperature);
DEBUG_SET(DEBUG_BARO, 2, baroPressure);
DEBUG_SET(DEBUG_BARO, 3, baroPressureSum);
sleepTime = baro.dev.ut_delay;
break;