|
@ -85,55 +85,25 @@ extern float current_temperature_bed; |
|
|
//inline so that there is no performance decrease.
|
|
|
//inline so that there is no performance decrease.
|
|
|
//deg=degreeCelsius
|
|
|
//deg=degreeCelsius
|
|
|
|
|
|
|
|
|
FORCE_INLINE float degHotend(uint8_t extruder) { |
|
|
FORCE_INLINE float degHotend(uint8_t extruder) { return current_temperature[extruder]; } |
|
|
return current_temperature[extruder]; |
|
|
FORCE_INLINE float degBed() { return current_temperature_bed; } |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef SHOW_TEMP_ADC_VALUES |
|
|
#ifdef SHOW_TEMP_ADC_VALUES |
|
|
FORCE_INLINE float rawHotendTemp(uint8_t extruder) { |
|
|
FORCE_INLINE float rawHotendTemp(uint8_t extruder) { return current_temperature_raw[extruder]; } |
|
|
return current_temperature_raw[extruder]; |
|
|
FORCE_INLINE float rawBedTemp() { return current_temperature_bed_raw; } |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
FORCE_INLINE float rawBedTemp() { |
|
|
|
|
|
return current_temperature_bed_raw; |
|
|
|
|
|
}; |
|
|
|
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
FORCE_INLINE float degBed() { |
|
|
FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; } |
|
|
return current_temperature_bed; |
|
|
FORCE_INLINE float degTargetBed() { return target_temperature_bed; } |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
FORCE_INLINE float degTargetHotend(uint8_t extruder) { |
|
|
|
|
|
return target_temperature[extruder]; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
FORCE_INLINE float degTargetBed() { |
|
|
|
|
|
return target_temperature_bed; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) { |
|
|
|
|
|
target_temperature[extruder] = celsius; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
FORCE_INLINE void setTargetBed(const float &celsius) { |
|
|
FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) { target_temperature[extruder] = celsius; } |
|
|
target_temperature_bed = celsius; |
|
|
FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; } |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ |
|
|
FORCE_INLINE bool isHeatingHotend(uint8_t extruder) { return target_temperature[extruder] > current_temperature[extruder]; } |
|
|
return target_temperature[extruder] > current_temperature[extruder]; |
|
|
FORCE_INLINE bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; } |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
FORCE_INLINE bool isHeatingBed() { |
|
|
FORCE_INLINE bool isCoolingHotend(uint8_t extruder) { return target_temperature[extruder] < current_temperature[extruder]; } |
|
|
return target_temperature_bed > current_temperature_bed; |
|
|
FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; } |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
FORCE_INLINE bool isCoolingHotend(uint8_t extruder) { |
|
|
|
|
|
return target_temperature[extruder] < current_temperature[extruder]; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
FORCE_INLINE bool isCoolingBed() { |
|
|
|
|
|
return target_temperature_bed < current_temperature_bed; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
#define degHotend0() degHotend(0) |
|
|
#define degHotend0() degHotend(0) |
|
|
#define degTargetHotend0() degTargetHotend(0) |
|
|
#define degTargetHotend0() degTargetHotend(0) |
|
@ -171,8 +141,6 @@ FORCE_INLINE bool isCoolingBed() { |
|
|
#error Invalid number of extruders |
|
|
#error Invalid number of extruders |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int getHeaterPower(int heater); |
|
|
int getHeaterPower(int heater); |
|
|
void disable_heater(); |
|
|
void disable_heater(); |
|
|
void setWatch(); |
|
|
void setWatch(); |
|
@ -191,8 +159,7 @@ static bool thermal_runaway = false; |
|
|
|
|
|
|
|
|
FORCE_INLINE void autotempShutdown() { |
|
|
FORCE_INLINE void autotempShutdown() { |
|
|
#ifdef AUTOTEMP |
|
|
#ifdef AUTOTEMP |
|
|
if(autotemp_enabled) |
|
|
if (autotemp_enabled) { |
|
|
{ |
|
|
|
|
|
autotemp_enabled = false; |
|
|
autotemp_enabled = false; |
|
|
if (degTargetHotend(active_extruder) > autotemp_min) |
|
|
if (degTargetHotend(active_extruder) > autotemp_min) |
|
|
setTargetHotend(0, active_extruder); |
|
|
setTargetHotend(0, active_extruder); |
|
|