Reduce code with no heated bed

master
Scott Lahteine 6 years ago
parent 172ea8c71c
commit f36f91dfb5

@ -874,7 +874,7 @@ void Temperature::manage_heater() {
// Derived from RepRap FiveD extruder::getTemperature() // Derived from RepRap FiveD extruder::getTemperature()
// For hot end temperature measurement. // For hot end temperature measurement.
float Temperature::analog2temp(int raw, uint8_t e) { float Temperature::analog2temp(const int raw, const uint8_t e) {
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
if (e > HOTENDS) if (e > HOTENDS)
#else #else
@ -915,9 +915,10 @@ float Temperature::analog2temp(int raw, uint8_t e) {
return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN)) + TEMP_SENSOR_AD595_OFFSET; return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN)) + TEMP_SENSOR_AD595_OFFSET;
} }
// Derived from RepRap FiveD extruder::getTemperature() #if HAS_TEMP_BED
// For bed temperature measurement. // Derived from RepRap FiveD extruder::getTemperature()
float Temperature::analog2tempBed(const int raw) { // For bed temperature measurement.
float Temperature::analog2tempBed(const int raw) {
#if ENABLED(BED_USES_THERMISTOR) #if ENABLED(BED_USES_THERMISTOR)
float celsius = 0; float celsius = 0;
byte i; byte i;
@ -947,7 +948,8 @@ float Temperature::analog2tempBed(const int raw) {
return 0; return 0;
#endif #endif
} }
#endif // HAS_TEMP_BED
/** /**
* Get the raw values into the actual temperatures. * Get the raw values into the actual temperatures.
@ -1234,6 +1236,7 @@ void Temperature::init() {
#endif // HOTENDS > 2 #endif // HOTENDS > 2
#endif // HOTENDS > 1 #endif // HOTENDS > 1
#if HAS_TEMP_BED
#ifdef BED_MINTEMP #ifdef BED_MINTEMP
while (analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { while (analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) {
#if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP
@ -1252,6 +1255,7 @@ void Temperature::init() {
#endif #endif
} }
#endif // BED_MAXTEMP #endif // BED_MAXTEMP
#endif //HAS_TEMP_BED
#if ENABLED(PROBING_HEATERS_OFF) #if ENABLED(PROBING_HEATERS_OFF)
paused = false; paused = false;

@ -293,8 +293,11 @@ class Temperature {
/** /**
* Static (class) methods * Static (class) methods
*/ */
static float analog2temp(int raw, uint8_t e); static float analog2temp(const int raw, const uint8_t e);
static float analog2tempBed(int raw);
#if HAS_TEMP_BED
static float analog2tempBed(const int raw);
#endif
/** /**
* Called from the Temperature ISR * Called from the Temperature ISR

Loading…
Cancel
Save