Move M155 to cpp, auto-report to Temperature

This commit is contained in:
Scott Lahteine
2017-09-16 13:05:01 -05:00
parent df031ab100
commit df0432c7c8
5 changed files with 41 additions and 28 deletions

View File

@ -144,7 +144,6 @@ extern void gcode_M140();
extern void gcode_M145();
extern void gcode_M149();
extern void gcode_M150();
extern void gcode_M155();
extern void gcode_M163();
extern void gcode_M164();
extern void gcode_M165();
@ -495,9 +494,7 @@ void GcodeSuite::process_next_command() {
return; // "ok" already printed
#if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
case 155: // M155: Set temperature auto-report interval
gcode_M155();
break;
case 155: M155(); break; // M155: Set temperature auto-report interval
#endif
#if HAS_TEMP_BED

View File

@ -20,13 +20,21 @@
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
#include "../gcode.h"
#include "../../module/temperature.h"
/**
* M155: Set temperature auto-report interval. M155 S<seconds>
*/
void gcode_M155() {
if (parser.seenval('S')) {
auto_report_temp_interval = parser.value_byte();
NOMORE(auto_report_temp_interval, 60);
next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval;
}
void GcodeSuite::M155() {
if (parser.seenval('S'))
thermalManager.set_auto_report_interval(parser.value_byte());
}
#endif // AUTO_REPORT_TEMPERATURES && (HAS_TEMP_HOTEND || HAS_TEMP_BED)