mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +03:00
Add debug mode for adc internal sensor calibration
This commit is contained in:
parent
b58e8f827f
commit
635f8fc18a
3 changed files with 5 additions and 3 deletions
|
@ -63,7 +63,6 @@ const char * const debugModeNames[DEBUG_COUNT] = {
|
||||||
"RANGEFINDER",
|
"RANGEFINDER",
|
||||||
"RANGEFINDER_QUALITY",
|
"RANGEFINDER_QUALITY",
|
||||||
"LIDAR_TF",
|
"LIDAR_TF",
|
||||||
"CORE_TEMP",
|
|
||||||
"RUNAWAY_TAKEOFF",
|
"RUNAWAY_TAKEOFF",
|
||||||
"SDIO",
|
"SDIO",
|
||||||
"CURRENT_SENSOR",
|
"CURRENT_SENSOR",
|
||||||
|
@ -76,4 +75,5 @@ const char * const debugModeNames[DEBUG_COUNT] = {
|
||||||
"RX_SIGNAL_LOSS",
|
"RX_SIGNAL_LOSS",
|
||||||
"RC_SMOOTHING_RATE",
|
"RC_SMOOTHING_RATE",
|
||||||
"ANTI_GRAVITY",
|
"ANTI_GRAVITY",
|
||||||
|
"ADC_INTERNAL",
|
||||||
};
|
};
|
||||||
|
|
|
@ -81,7 +81,6 @@ typedef enum {
|
||||||
DEBUG_RANGEFINDER,
|
DEBUG_RANGEFINDER,
|
||||||
DEBUG_RANGEFINDER_QUALITY,
|
DEBUG_RANGEFINDER_QUALITY,
|
||||||
DEBUG_LIDAR_TF,
|
DEBUG_LIDAR_TF,
|
||||||
DEBUG_CORE_TEMP,
|
|
||||||
DEBUG_RUNAWAY_TAKEOFF,
|
DEBUG_RUNAWAY_TAKEOFF,
|
||||||
DEBUG_SDIO,
|
DEBUG_SDIO,
|
||||||
DEBUG_CURRENT,
|
DEBUG_CURRENT,
|
||||||
|
@ -94,6 +93,7 @@ typedef enum {
|
||||||
DEBUG_RX_SIGNAL_LOSS,
|
DEBUG_RX_SIGNAL_LOSS,
|
||||||
DEBUG_RC_SMOOTHING_RATE,
|
DEBUG_RC_SMOOTHING_RATE,
|
||||||
DEBUG_ANTI_GRAVITY,
|
DEBUG_ANTI_GRAVITY,
|
||||||
|
DEBUG_ADC_INTERNAL,
|
||||||
DEBUG_COUNT
|
DEBUG_COUNT
|
||||||
} debugType_e;
|
} debugType_e;
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,9 @@ void adcInternalProcess(timeUs_t currentTimeUs)
|
||||||
int32_t adcTempsensorAdjusted = (int32_t)adcTempsensorValue * 3300 / getVrefMv();
|
int32_t adcTempsensorAdjusted = (int32_t)adcTempsensorValue * 3300 / getVrefMv();
|
||||||
coreTemperature = ((adcTempsensorAdjusted - adcTSCAL1) * adcTSSlopeK + 30 * 1000 + 500) / 1000;
|
coreTemperature = ((adcTempsensorAdjusted - adcTSCAL1) * adcTSSlopeK + 30 * 1000 + 500) / 1000;
|
||||||
|
|
||||||
DEBUG_SET(DEBUG_CORE_TEMP, 0, coreTemperature);
|
DEBUG_SET(DEBUG_ADC_INTERNAL, 0, vrefintSample);
|
||||||
|
DEBUG_SET(DEBUG_ADC_INTERNAL, 1, tempsensorSample);
|
||||||
|
DEBUG_SET(DEBUG_ADC_INTERNAL, 2, coreTemperature);
|
||||||
|
|
||||||
adcInternalStartConversion(); // Start next conversion
|
adcInternalStartConversion(); // Start next conversion
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue