From 31c8e4bc4c3857e9546706f599d87e6902b0c157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 19 Jun 2021 13:40:50 +0000 Subject: [PATCH] * Remove redundant externs already included with temperature.h * Add ifdefs in Dcodes.cpp when using extern variables --- Firmware/Dcodes.cpp | 18 ++++++------------ Firmware/temperature.h | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Firmware/Dcodes.cpp b/Firmware/Dcodes.cpp index f9f3c5895..d99a2c890 100644 --- a/Firmware/Dcodes.cpp +++ b/Firmware/Dcodes.cpp @@ -538,26 +538,20 @@ const char* dcode_9_ADC_name(uint8_t i) return 0; } -#ifdef AMBIENT_THERMISTOR -extern int current_temperature_raw_ambient; -#endif //AMBIENT_THERMISTOR - -#ifdef VOLT_PWR_PIN -extern int current_voltage_raw_pwr; -#endif //VOLT_PWR_PIN - -#ifdef VOLT_BED_PIN -extern int current_voltage_raw_bed; -#endif //VOLT_BED_PIN - uint16_t dcode_9_ADC_val(uint8_t i) { switch (i) { +#ifdef SHOW_TEMP_ADC_VALUES case 0: return current_temperature_raw[0]; +#endif //SHOW_TEMP_ADC_VALUES case 1: return 0; +#ifdef SHOW_TEMP_ADC_VALUES case 2: return current_temperature_bed_raw; +#endif //SHOW_TEMP_ADC_VALUES +#ifdef PINDA_THERMISTOR case 3: return current_temperature_raw_pinda; +#endif //PINDA_THERMISTOR #ifdef VOLT_PWR_PIN case 4: return current_voltage_raw_pwr; #endif //VOLT_PWR_PIN diff --git a/Firmware/temperature.h b/Firmware/temperature.h index 0bf944724..f862b1dfe 100755 --- a/Firmware/temperature.h +++ b/Firmware/temperature.h @@ -67,7 +67,7 @@ bool has_temperature_compensation(); #endif #ifdef AMBIENT_THERMISTOR -//extern int current_temperature_raw_ambient; +extern int current_temperature_raw_ambient; extern float current_temperature_ambient; #endif