1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 20:10:18 +03:00

Merge pull request #7071 from jflyper/bfdev-add-adc-internal-sensor-debug

[ADC] Add debug mode for adc internal sensor calibration
This commit is contained in:
Michael Keller 2018-11-12 22:13:00 +13:00 committed by GitHub
commit 00e53dbc46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -63,7 +63,7 @@ const char * const debugModeNames[DEBUG_COUNT] = {
"RANGEFINDER",
"RANGEFINDER_QUALITY",
"LIDAR_TF",
"CORE_TEMP",
"ADC_INTERNAL",
"RUNAWAY_TAKEOFF",
"SDIO",
"CURRENT_SENSOR",

View file

@ -81,7 +81,7 @@ typedef enum {
DEBUG_RANGEFINDER,
DEBUG_RANGEFINDER_QUALITY,
DEBUG_LIDAR_TF,
DEBUG_CORE_TEMP,
DEBUG_ADC_INTERNAL,
DEBUG_RUNAWAY_TAKEOFF,
DEBUG_SDIO,
DEBUG_CURRENT,

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, coreTemperature);
DEBUG_SET(DEBUG_ADC_INTERNAL, 1, vrefintSample);
DEBUG_SET(DEBUG_ADC_INTERNAL, 2, tempsensorSample);
adcInternalStartConversion(); // Start next conversion
}