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