|
@@ -390,11 +390,23 @@ static int saved_fanSpeed = 0;
|
|
|
|
|
|
static int saved_feedmultiply_mm = 100;
|
|
|
|
|
|
-#ifdef AUTO_REPORT_TEMPERATURES
|
|
|
-static LongTimer auto_report_temp_timer;
|
|
|
-static uint8_t auto_report_temp_period = 0;
|
|
|
+#if defined(AUTO_REPORT_ALL) || defined(AUTO_REPORT_TEMPERATURES) || defined(AUTO_REPORT_FANS) || defined(AUTO_REPORT_POSITION)
|
|
|
+static LongTimer auto_report_timer;
|
|
|
+static uint8_t auto_report_period = 0;
|
|
|
+#endif
|
|
|
+
|
|
|
+#if defined(AUTO_REPORT_TEMPERATURES) || defined(AUTO_REPORT_ALL)
|
|
|
+static bool auto_report_temp_active = false;
|
|
|
#endif
|
|
|
|
|
|
+#if defined(AUTO_REPORT_FANS) || defined(AUTO_REPORT_ALL)
|
|
|
+static bool auto_report_fans_active = false;
|
|
|
+#endif
|
|
|
+
|
|
|
+#if defined(AUTO_REPORT_POSITION) || defined(AUTO_REPORT_ALL)
|
|
|
+static bool auto_report_position_active = false;
|
|
|
+#endif
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1731,16 +1743,29 @@ void host_keepalive() {
|
|
|
if (farm_mode) return;
|
|
|
long ms = _millis();
|
|
|
|
|
|
-#ifdef AUTO_REPORT_TEMPERATURES
|
|
|
- if (auto_report_temp_timer.running())
|
|
|
+#if defined(AUTO_REPORT_ALL) || defined(AUTO_REPORT_TEMPERATURES) || defined(AUTO_REPORT_FANS) || defined(AUTO_REPORT_POSITION)
|
|
|
+ if (auto_report_timer.running())
|
|
|
{
|
|
|
- if (auto_report_temp_timer.expired(auto_report_temp_period * 1000ul))
|
|
|
+ if (auto_report_timer.expired(auto_report_period * 1000ul))
|
|
|
{
|
|
|
- gcode_M105(active_extruder);
|
|
|
- auto_report_temp_timer.start();
|
|
|
+ if(auto_report_temp_active){
|
|
|
+ gcode_M105(active_extruder);
|
|
|
+ }
|
|
|
+#if defined(AUTO_REPORT_ALL) || defined(AUTO_REPORT_FANS) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
|
|
|
+ if(auto_report_fans_active){
|
|
|
+ gcode_M123();
|
|
|
+ }
|
|
|
+#endif
|
|
|
+#if defined(AUTO_REPORT_ALL) || defined(AUTO_REPORT_POSITION)
|
|
|
+ if(auto_report_position_active){
|
|
|
+ gcode_M114();
|
|
|
+ }
|
|
|
+#endif
|
|
|
+ auto_report_timer.start();
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
+
|
|
|
|
|
|
if (host_keepalive_interval && busy_state != NOT_BUSY) {
|
|
|
if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return;
|
|
@@ -3167,10 +3192,12 @@ void gcode_M114()
|
|
|
SERIAL_PROTOCOLLN("");
|
|
|
}
|
|
|
|
|
|
+#if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
|
|
|
void gcode_M123()
|
|
|
{
|
|
|
printf_P(_N("E0:%d RPM PRN1:%d RPM E0@:%u PRN1@:%d\n"), 60*fan_speed[active_extruder], 60*fan_speed[1], newFanSpeed, fanSpeed);
|
|
|
}
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
@@ -3521,7 +3548,14 @@ static void cap_line(const char* name, bool ena = false) {
|
|
|
|
|
|
static void extended_capabilities_report()
|
|
|
{
|
|
|
- cap_line(PSTR("AUTOREPORT_TEMP"), ENABLED(AUTO_REPORT_TEMPERATURES));
|
|
|
+
|
|
|
+ cap_line(PSTR("AUTOREPORT_TEMP"), (ENABLED(AUTO_REPORT_TEMPERATURES)) || ENABLED(AUTO_REPORT_ALL));
|
|
|
+#if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
|
|
|
+
|
|
|
+ cap_line(PSTR("AUTOREPORT_FANS"), (ENABLED(AUTO_REPORT_FANS) || ENABLED(AUTO_REPORT_ALL)));
|
|
|
+#endif
|
|
|
+
|
|
|
+ cap_line(PSTR("AUTOREPORT_POSITION"), (ENABLED(AUTO_REPORT_POSITION) || ENABLED(AUTO_REPORT_ALL)));
|
|
|
|
|
|
}
|
|
|
#endif
|
|
@@ -3619,7 +3653,7 @@ extern uint8_t st_backlash_y;
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -6413,31 +6447,75 @@ Sigma_Exit:
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
-#ifdef AUTO_REPORT_TEMPERATURES
|
|
|
+#if defined(AUTO_REPORT_ALL) || defined(AUTO_REPORT_TEMPERATURES) || defined(AUTO_REPORT_FANS) || defined(AUTO_REPORT_POSITION)
|
|
|
|
|
|
- ### M155 - Automatically send temperatures <a href="https://reprap.org/wiki/G-code#M155:_Automatically_send_temperatures">M155: Automatically send temperatures</a>
|
|
|
+ ### M155 - Automatically send status <a href="https://reprap.org/wiki/G-code#M155:_Automatically_send_temperatures">M155: Automatically send temperatures</a>
|
|
|
#### Usage
|
|
|
|
|
|
- M155 [ S ]
|
|
|
+ M155 [ S ] [ C ]
|
|
|
|
|
|
#### Parameters
|
|
|
|
|
|
- - `S` - Set temperature autoreporting interval in seconds. 0 to disable. Maximum: 255
|
|
|
-
|
|
|
- */
|
|
|
+ - `S` - Set autoreporting interval in seconds. 0 to disable. Maximum: 255
|
|
|
+ - `C` - Activate auto-report function. Default is temperature.
|
|
|
+
|
|
|
+ bit 0 = Auto-report temperatures
|
|
|
+ bit 1 = Auto-report fans
|
|
|
+ bit 2 = Auto-report position
|
|
|
+ bit 3 = free
|
|
|
+ bit 4 = free
|
|
|
+ bit 5 = free
|
|
|
+ bit 6 = free
|
|
|
+ bit 7 = free
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ union {
|
|
|
+ struct
|
|
|
+ {
|
|
|
+ uint8_t ar_temp_active : 1;
|
|
|
+ uint8_t ar_fans_active : 1;
|
|
|
+ uint8_t ar_pos_active : 1;
|
|
|
+ uint8_t ar_4_active : 1;
|
|
|
+ uint8_t ar_5_active : 1;
|
|
|
+ uint8_t ar_6_active : 1;
|
|
|
+ uint8_t ar_7_active : 1;
|
|
|
+ } __attribute__((packed)) bits;
|
|
|
+ uint8_t byte;
|
|
|
+ } arFunctionsActive;
|
|
|
case 155:
|
|
|
{
|
|
|
- if (code_seen('S'))
|
|
|
- {
|
|
|
- auto_report_temp_period = code_value_uint8();
|
|
|
- if (auto_report_temp_period != 0)
|
|
|
- auto_report_temp_timer.start();
|
|
|
- else
|
|
|
- auto_report_temp_timer.stop();
|
|
|
+ if (code_seen('S'))
|
|
|
+ {
|
|
|
+ auto_report_period = code_value_uint8();
|
|
|
+ if (auto_report_period != 0){
|
|
|
+ auto_report_timer.start();
|
|
|
}
|
|
|
- }
|
|
|
+ else{
|
|
|
+ auto_report_timer.stop();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (code_seen('C'))
|
|
|
+ {
|
|
|
+ arFunctionsActive.byte = code_value();
|
|
|
+
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ arFunctionsActive.byte = 1;
|
|
|
+ }
|
|
|
+#if defined(AUTO_REPORT_ALL) || defined(AUTO_REPORT_TEMPERATURES)
|
|
|
+ auto_report_temp_active = arFunctionsActive.bits.ar_temp_active;
|
|
|
+#endif
|
|
|
+#if defined(AUTO_REPORT_ALL) || defined(AUTO_REPORT_FANS)
|
|
|
+ auto_report_fans_active = arFunctionsActive.bits.ar_fans_active;
|
|
|
+#endif
|
|
|
+#if defined(AUTO_REPORT_ALL) || defined(AUTO_REPORT_POSITION)
|
|
|
+ auto_report_position_active = arFunctionsActive.bits.ar_pos_active;
|
|
|
+ #endif
|
|
|
+ }
|
|
|
break;
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
### M109 - Wait for extruder temperature <a href="https://reprap.org/wiki/G-code#M109:_Set_Extruder_Temperature_and_Wait">M109: Set Extruder Temperature and Wait</a>
|
|
@@ -6973,13 +7051,29 @@ Sigma_Exit:
|
|
|
break;
|
|
|
|
|
|
|
|
|
+#if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
|
|
|
|
|
|
### M123 - Tachometer value <a href="https://www.reprap.org/wiki/G-code#M123:_Tachometer_value_.28RepRap.29">M123: Tachometer value</a>
|
|
|
+ This command is used to report fan speeds and fan pwm values.
|
|
|
+ #### Usage
|
|
|
+
|
|
|
+ M123
|
|
|
+
|
|
|
+ - E0: - Hotend fan speed in RPM
|
|
|
+ - PRN1: - Part cooling fans speed in RPM
|
|
|
+ - E0@: - Hotend fan PWM value
|
|
|
+ - PRN1@: -Part cooling fan PWM value
|
|
|
+
|
|
|
+ _Example:_
|
|
|
+
|
|
|
+ E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255
|
|
|
+
|
|
|
*/
|
|
|
+
|
|
|
case 123:
|
|
|
gcode_M123();
|
|
|
break;
|
|
|
-
|
|
|
+#endif
|
|
|
|
|
|
#ifdef BLINKM
|
|
|
|