Move heater output to Temperature class
This commit is contained in:
@ -2179,3 +2179,80 @@ void Temperature::isr() {
|
||||
in_temp_isr = false;
|
||||
ENABLE_TEMPERATURE_INTERRUPT(); //re-enable Temperature ISR
|
||||
}
|
||||
|
||||
#if HAS_TEMP_HOTEND || HAS_TEMP_BED
|
||||
|
||||
#include "../gcode/gcode.h"
|
||||
|
||||
void print_heater_state(const float &c, const float &t,
|
||||
#if ENABLED(SHOW_TEMP_ADC_VALUES)
|
||||
const float r,
|
||||
#endif
|
||||
const int8_t e=-2
|
||||
) {
|
||||
#if !(HAS_TEMP_BED && HAS_TEMP_HOTEND) && HOTENDS <= 1
|
||||
UNUSED(e);
|
||||
#endif
|
||||
|
||||
SERIAL_PROTOCOLCHAR(' ');
|
||||
SERIAL_PROTOCOLCHAR(
|
||||
#if HAS_TEMP_BED && HAS_TEMP_HOTEND
|
||||
e == -1 ? 'B' : 'T'
|
||||
#elif HAS_TEMP_HOTEND
|
||||
'T'
|
||||
#else
|
||||
'B'
|
||||
#endif
|
||||
);
|
||||
#if HOTENDS > 1
|
||||
if (e >= 0) SERIAL_PROTOCOLCHAR('0' + e);
|
||||
#endif
|
||||
SERIAL_PROTOCOLCHAR(':');
|
||||
SERIAL_PROTOCOL(c);
|
||||
SERIAL_PROTOCOLPAIR(" /" , t);
|
||||
#if ENABLED(SHOW_TEMP_ADC_VALUES)
|
||||
SERIAL_PROTOCOLPAIR(" (", r / OVERSAMPLENR);
|
||||
SERIAL_PROTOCOLCHAR(')');
|
||||
#endif
|
||||
}
|
||||
|
||||
void Temperature::print_heaterstates() {
|
||||
#if HAS_TEMP_HOTEND
|
||||
print_heater_state(degHotend(gcode.target_extruder), degTargetHotend(gcode.target_extruder)
|
||||
#if ENABLED(SHOW_TEMP_ADC_VALUES)
|
||||
, rawHotendTemp(gcode.target_extruder)
|
||||
#endif
|
||||
);
|
||||
#endif
|
||||
#if HAS_TEMP_BED
|
||||
print_heater_state(degBed(), degTargetBed(),
|
||||
#if ENABLED(SHOW_TEMP_ADC_VALUES)
|
||||
rawBedTemp(),
|
||||
#endif
|
||||
-1 // BED
|
||||
);
|
||||
#endif
|
||||
#if HOTENDS > 1
|
||||
HOTEND_LOOP() print_heater_state(degHotend(e), degTargetHotend(e),
|
||||
#if ENABLED(SHOW_TEMP_ADC_VALUES)
|
||||
rawHotendTemp(e),
|
||||
#endif
|
||||
e
|
||||
);
|
||||
#endif
|
||||
SERIAL_PROTOCOLPGM(" @:");
|
||||
SERIAL_PROTOCOL(getHeaterPower(gcode.target_extruder));
|
||||
#if HAS_TEMP_BED
|
||||
SERIAL_PROTOCOLPGM(" B@:");
|
||||
SERIAL_PROTOCOL(getHeaterPower(-1));
|
||||
#endif
|
||||
#if HOTENDS > 1
|
||||
HOTEND_LOOP() {
|
||||
SERIAL_PROTOCOLPAIR(" @", e);
|
||||
SERIAL_PROTOCOLCHAR(':');
|
||||
SERIAL_PROTOCOL(getHeaterPower(e));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // HAS_TEMP_HOTEND || HAS_TEMP_BED
|
||||
|
@ -525,6 +525,10 @@ class Temperature {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_TEMP_HOTEND || HAS_TEMP_BED
|
||||
static void print_heaterstates();
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
#if ENABLED(FAST_PWM_FAN)
|
||||
|
Reference in New Issue
Block a user