mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +03:00
Aligned debug mode names with debug enum value names for more fun when debugging.
This commit is contained in:
parent
06f89603bc
commit
118e92c8b2
4 changed files with 9 additions and 8 deletions
|
@ -30,6 +30,7 @@ uint8_t debugMode;
|
||||||
uint32_t sectionTimes[2][4];
|
uint32_t sectionTimes[2][4];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Please ensure that these names are aligned with the enum values defined in 'debug.h'
|
||||||
const char * const debugModeNames[DEBUG_COUNT] = {
|
const char * const debugModeNames[DEBUG_COUNT] = {
|
||||||
"NONE",
|
"NONE",
|
||||||
"CYCLETIME",
|
"CYCLETIME",
|
||||||
|
@ -78,7 +79,7 @@ const char * const debugModeNames[DEBUG_COUNT] = {
|
||||||
"ANTI_GRAVITY",
|
"ANTI_GRAVITY",
|
||||||
"DYN_LPF",
|
"DYN_LPF",
|
||||||
"RX_SPEKTRUM_SPI",
|
"RX_SPEKTRUM_SPI",
|
||||||
"DSHOT_TELEMETRY",
|
"DSHOT_RPM_TELEMETRY",
|
||||||
"RPM_FILTER",
|
"RPM_FILTER",
|
||||||
"D_CUT",
|
"D_CUT",
|
||||||
};
|
};
|
||||||
|
|
|
@ -84,7 +84,7 @@ typedef enum {
|
||||||
DEBUG_ADC_INTERNAL,
|
DEBUG_ADC_INTERNAL,
|
||||||
DEBUG_RUNAWAY_TAKEOFF,
|
DEBUG_RUNAWAY_TAKEOFF,
|
||||||
DEBUG_SDIO,
|
DEBUG_SDIO,
|
||||||
DEBUG_CURRENT,
|
DEBUG_CURRENT_SENSOR,
|
||||||
DEBUG_USB,
|
DEBUG_USB,
|
||||||
DEBUG_SMARTAUDIO,
|
DEBUG_SMARTAUDIO,
|
||||||
DEBUG_RTH,
|
DEBUG_RTH,
|
||||||
|
@ -96,7 +96,7 @@ typedef enum {
|
||||||
DEBUG_ANTI_GRAVITY,
|
DEBUG_ANTI_GRAVITY,
|
||||||
DEBUG_DYN_LPF,
|
DEBUG_DYN_LPF,
|
||||||
DEBUG_RX_SPEKTRUM_SPI,
|
DEBUG_RX_SPEKTRUM_SPI,
|
||||||
DEBUG_RPM_TELEMETRY,
|
DEBUG_DSHOT_RPM_TELEMETRY,
|
||||||
DEBUG_RPM_FILTER,
|
DEBUG_RPM_FILTER,
|
||||||
DEBUG_D_CUT,
|
DEBUG_D_CUT,
|
||||||
DEBUG_COUNT
|
DEBUG_COUNT
|
||||||
|
|
|
@ -267,7 +267,7 @@ void pwmStartDshotMotorUpdate(uint8_t motorCount)
|
||||||
if (value != 0xffff) {
|
if (value != 0xffff) {
|
||||||
dmaMotors[i].dshotTelemetryValue = value;
|
dmaMotors[i].dshotTelemetryValue = value;
|
||||||
if (i < 4) {
|
if (i < 4) {
|
||||||
DEBUG_SET(DEBUG_RPM_TELEMETRY, i, value);
|
DEBUG_SET(DEBUG_DSHOT_RPM_TELEMETRY, i, value);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dshotInvalidPacketCount++;
|
dshotInvalidPacketCount++;
|
||||||
|
|
|
@ -118,8 +118,8 @@ static int32_t currentMeterADCToCentiamps(const uint16_t src)
|
||||||
// y=x/m+b m is scale in (mV/10A) and b is offset in (mA)
|
// y=x/m+b m is scale in (mV/10A) and b is offset in (mA)
|
||||||
int32_t centiAmps = (millivolts * 10000 / (int32_t)config->scale + (int32_t)config->offset) / 10;
|
int32_t centiAmps = (millivolts * 10000 / (int32_t)config->scale + (int32_t)config->offset) / 10;
|
||||||
|
|
||||||
DEBUG_SET(DEBUG_CURRENT, 0, millivolts);
|
DEBUG_SET(DEBUG_CURRENT_SENSOR, 0, millivolts);
|
||||||
DEBUG_SET(DEBUG_CURRENT, 1, centiAmps);
|
DEBUG_SET(DEBUG_CURRENT_SENSOR, 1, centiAmps);
|
||||||
|
|
||||||
return centiAmps; // Returns Centiamps to maintain compatability with the rest of the code
|
return centiAmps; // Returns Centiamps to maintain compatability with the rest of the code
|
||||||
}
|
}
|
||||||
|
@ -167,8 +167,8 @@ void currentMeterADCRead(currentMeter_t *meter)
|
||||||
meter->amperage = currentMeterADCState.amperage;
|
meter->amperage = currentMeterADCState.amperage;
|
||||||
meter->mAhDrawn = currentMeterADCState.mahDrawnState.mAhDrawn;
|
meter->mAhDrawn = currentMeterADCState.mahDrawnState.mAhDrawn;
|
||||||
|
|
||||||
DEBUG_SET(DEBUG_CURRENT, 2, meter->amperageLatest);
|
DEBUG_SET(DEBUG_CURRENT_SENSOR, 2, meter->amperageLatest);
|
||||||
DEBUG_SET(DEBUG_CURRENT, 3, meter->mAhDrawn);
|
DEBUG_SET(DEBUG_CURRENT_SENSOR, 3, meter->mAhDrawn);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue