Add debug mode for adc internal sensor calibration

This commit is contained in:
jflyper 2018-11-11 03:33:41 +09:00
parent b58e8f827f
commit 635f8fc18a
3 changed files with 5 additions and 3 deletions

View File

@ -63,7 +63,6 @@ const char * const debugModeNames[DEBUG_COUNT] = {
"RANGEFINDER",
"RANGEFINDER_QUALITY",
"LIDAR_TF",
"CORE_TEMP",
"RUNAWAY_TAKEOFF",
"SDIO",
"CURRENT_SENSOR",
@ -76,4 +75,5 @@ const char * const debugModeNames[DEBUG_COUNT] = {
"RX_SIGNAL_LOSS",
"RC_SMOOTHING_RATE",
"ANTI_GRAVITY",
"ADC_INTERNAL",
};

View File

@ -81,7 +81,6 @@ typedef enum {
DEBUG_RANGEFINDER,
DEBUG_RANGEFINDER_QUALITY,
DEBUG_LIDAR_TF,
DEBUG_CORE_TEMP,
DEBUG_RUNAWAY_TAKEOFF,
DEBUG_SDIO,
DEBUG_CURRENT,
@ -94,6 +93,7 @@ typedef enum {
DEBUG_RX_SIGNAL_LOSS,
DEBUG_RC_SMOOTHING_RATE,
DEBUG_ANTI_GRAVITY,
DEBUG_ADC_INTERNAL,
DEBUG_COUNT
} debugType_e;

View File

@ -89,7 +89,9 @@ void adcInternalProcess(timeUs_t currentTimeUs)
int32_t adcTempsensorAdjusted = (int32_t)adcTempsensorValue * 3300 / getVrefMv();
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
}