|
@@ -519,7 +519,7 @@ static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL
|
519
|
519
|
#define BUZZ(d,f) NOOP
|
520
|
520
|
#endif
|
521
|
521
|
|
522
|
|
-static uint8_t target_extruder;
|
|
522
|
+uint8_t target_extruder;
|
523
|
523
|
|
524
|
524
|
#if HAS_BED_PROBE
|
525
|
525
|
float zprobe_zoffset; // Initialized by settings.load()
|
|
@@ -7570,80 +7570,6 @@ inline void gcode_M104() {
|
7570
|
7570
|
#endif
|
7571
|
7571
|
}
|
7572
|
7572
|
|
7573
|
|
-#if HAS_TEMP_HOTEND || HAS_TEMP_BED
|
7574
|
|
-
|
7575
|
|
- void print_heater_state(const float &c, const float &t,
|
7576
|
|
- #if ENABLED(SHOW_TEMP_ADC_VALUES)
|
7577
|
|
- const float r,
|
7578
|
|
- #endif
|
7579
|
|
- const int8_t e=-2
|
7580
|
|
- ) {
|
7581
|
|
- #if !(HAS_TEMP_BED && HAS_TEMP_HOTEND) && HOTENDS <= 1
|
7582
|
|
- UNUSED(e);
|
7583
|
|
- #endif
|
7584
|
|
-
|
7585
|
|
- SERIAL_PROTOCOLCHAR(' ');
|
7586
|
|
- SERIAL_PROTOCOLCHAR(
|
7587
|
|
- #if HAS_TEMP_BED && HAS_TEMP_HOTEND
|
7588
|
|
- e == -1 ? 'B' : 'T'
|
7589
|
|
- #elif HAS_TEMP_HOTEND
|
7590
|
|
- 'T'
|
7591
|
|
- #else
|
7592
|
|
- 'B'
|
7593
|
|
- #endif
|
7594
|
|
- );
|
7595
|
|
- #if HOTENDS > 1
|
7596
|
|
- if (e >= 0) SERIAL_PROTOCOLCHAR('0' + e);
|
7597
|
|
- #endif
|
7598
|
|
- SERIAL_PROTOCOLCHAR(':');
|
7599
|
|
- SERIAL_PROTOCOL(c);
|
7600
|
|
- SERIAL_PROTOCOLPAIR(" /" , t);
|
7601
|
|
- #if ENABLED(SHOW_TEMP_ADC_VALUES)
|
7602
|
|
- SERIAL_PROTOCOLPAIR(" (", r / OVERSAMPLENR);
|
7603
|
|
- SERIAL_PROTOCOLCHAR(')');
|
7604
|
|
- #endif
|
7605
|
|
- }
|
7606
|
|
-
|
7607
|
|
- void print_heaterstates() {
|
7608
|
|
- #if HAS_TEMP_HOTEND
|
7609
|
|
- print_heater_state(thermalManager.degHotend(target_extruder), thermalManager.degTargetHotend(target_extruder)
|
7610
|
|
- #if ENABLED(SHOW_TEMP_ADC_VALUES)
|
7611
|
|
- , thermalManager.rawHotendTemp(target_extruder)
|
7612
|
|
- #endif
|
7613
|
|
- );
|
7614
|
|
- #endif
|
7615
|
|
- #if HAS_TEMP_BED
|
7616
|
|
- print_heater_state(thermalManager.degBed(), thermalManager.degTargetBed(),
|
7617
|
|
- #if ENABLED(SHOW_TEMP_ADC_VALUES)
|
7618
|
|
- thermalManager.rawBedTemp(),
|
7619
|
|
- #endif
|
7620
|
|
- -1 // BED
|
7621
|
|
- );
|
7622
|
|
- #endif
|
7623
|
|
- #if HOTENDS > 1
|
7624
|
|
- HOTEND_LOOP() print_heater_state(thermalManager.degHotend(e), thermalManager.degTargetHotend(e),
|
7625
|
|
- #if ENABLED(SHOW_TEMP_ADC_VALUES)
|
7626
|
|
- thermalManager.rawHotendTemp(e),
|
7627
|
|
- #endif
|
7628
|
|
- e
|
7629
|
|
- );
|
7630
|
|
- #endif
|
7631
|
|
- SERIAL_PROTOCOLPGM(" @:");
|
7632
|
|
- SERIAL_PROTOCOL(thermalManager.getHeaterPower(target_extruder));
|
7633
|
|
- #if HAS_TEMP_BED
|
7634
|
|
- SERIAL_PROTOCOLPGM(" B@:");
|
7635
|
|
- SERIAL_PROTOCOL(thermalManager.getHeaterPower(-1));
|
7636
|
|
- #endif
|
7637
|
|
- #if HOTENDS > 1
|
7638
|
|
- HOTEND_LOOP() {
|
7639
|
|
- SERIAL_PROTOCOLPAIR(" @", e);
|
7640
|
|
- SERIAL_PROTOCOLCHAR(':');
|
7641
|
|
- SERIAL_PROTOCOL(thermalManager.getHeaterPower(e));
|
7642
|
|
- }
|
7643
|
|
- #endif
|
7644
|
|
- }
|
7645
|
|
-#endif
|
7646
|
|
-
|
7647
|
7573
|
/**
|
7648
|
7574
|
* M105: Read hot end and bed temperature
|
7649
|
7575
|
*/
|
|
@@ -7652,7 +7578,7 @@ inline void gcode_M105() {
|
7652
|
7578
|
|
7653
|
7579
|
#if HAS_TEMP_HOTEND || HAS_TEMP_BED
|
7654
|
7580
|
SERIAL_PROTOCOLPGM(MSG_OK);
|
7655
|
|
- print_heaterstates();
|
|
7581
|
+ thermalManager.print_heaterstates();
|
7656
|
7582
|
#else // !HAS_TEMP_HOTEND && !HAS_TEMP_BED
|
7657
|
7583
|
SERIAL_ERROR_START();
|
7658
|
7584
|
SERIAL_ERRORLNPGM(MSG_ERR_NO_THERMISTORS);
|
|
@@ -7663,26 +7589,12 @@ inline void gcode_M105() {
|
7663
|
7589
|
|
7664
|
7590
|
#if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
|
7665
|
7591
|
|
7666
|
|
- static uint8_t auto_report_temp_interval;
|
7667
|
|
- static millis_t next_temp_report_ms;
|
7668
|
|
-
|
7669
|
7592
|
/**
|
7670
|
7593
|
* M155: Set temperature auto-report interval. M155 S<seconds>
|
7671
|
7594
|
*/
|
7672
|
7595
|
inline void gcode_M155() {
|
7673
|
|
- if (parser.seenval('S')) {
|
7674
|
|
- auto_report_temp_interval = parser.value_byte();
|
7675
|
|
- NOMORE(auto_report_temp_interval, 60);
|
7676
|
|
- next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval;
|
7677
|
|
- }
|
7678
|
|
- }
|
7679
|
|
-
|
7680
|
|
- inline void auto_report_temperatures() {
|
7681
|
|
- if (auto_report_temp_interval && ELAPSED(millis(), next_temp_report_ms)) {
|
7682
|
|
- next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval;
|
7683
|
|
- print_heaterstates();
|
7684
|
|
- SERIAL_EOL();
|
7685
|
|
- }
|
|
7596
|
+ if (parser.seenval('S'))
|
|
7597
|
+ thermalManager.set_auto_report_interval(parser.value_byte());
|
7686
|
7598
|
}
|
7687
|
7599
|
|
7688
|
7600
|
#endif // AUTO_REPORT_TEMPERATURES
|
|
@@ -7851,7 +7763,7 @@ inline void gcode_M109() {
|
7851
|
7763
|
now = millis();
|
7852
|
7764
|
if (ELAPSED(now, next_temp_ms)) { //Print temp & remaining time every 1s while waiting
|
7853
|
7765
|
next_temp_ms = now + 1000UL;
|
7854
|
|
- print_heaterstates();
|
|
7766
|
+ thermalManager.print_heaterstates();
|
7855
|
7767
|
#if TEMP_RESIDENCY_TIME > 0
|
7856
|
7768
|
SERIAL_PROTOCOLPGM(" W:");
|
7857
|
7769
|
if (residency_start_ms)
|
|
@@ -7988,7 +7900,7 @@ inline void gcode_M109() {
|
7988
|
7900
|
now = millis();
|
7989
|
7901
|
if (ELAPSED(now, next_temp_ms)) { //Print Temp Reading every 1 second while heating up.
|
7990
|
7902
|
next_temp_ms = now + 1000UL;
|
7991
|
|
- print_heaterstates();
|
|
7903
|
+ thermalManager.print_heaterstates();
|
7992
|
7904
|
#if TEMP_BED_RESIDENCY_TIME > 0
|
7993
|
7905
|
SERIAL_PROTOCOLPGM(" W:");
|
7994
|
7906
|
if (residency_start_ms)
|
|
@@ -13672,7 +13584,7 @@ void idle(
|
13672
|
13584
|
host_keepalive();
|
13673
|
13585
|
|
13674
|
13586
|
#if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
|
13675
|
|
- auto_report_temperatures();
|
|
13587
|
+ thermalManager.auto_report_temperatures();
|
13676
|
13588
|
#endif
|
13677
|
13589
|
|
13678
|
13590
|
manage_inactivity(
|