Marlin: M84, M84 Sxxx, M85 Sxxx, and M18 Sxx

Note, M18 Sxx, M84 Sxx, and M85 Sxx have the same implementation.

M84 is different.
This commit is contained in:
Rob Giseburt
2017-02-06 15:18:06 -06:00
parent b50513efe5
commit bca3848b9a
4 changed files with 51 additions and 4 deletions
+29 -1
View File
@@ -31,6 +31,7 @@
#include "temperature.h" // for temperature controls
#include "json_parser.h"
#include "planner.h"
#include "stepper.h" // for MOTOR_TIMEOUT_SECONDS_MIN/MOTOR_TIMEOUT_SECONDS_MAX
#include "MotateTimers.h" // for char definitions
#include "MotateUniqueID.h" // for Motate::UUID
@@ -484,7 +485,7 @@ stat_t marlin_set_fan_speed(const uint8_t fan, float speed)
/*
* marlin_disable_motors() - M84
* marlin_disable_motors() - M84 (without S)
*
*/
@@ -500,6 +501,33 @@ stat_t marlin_disable_motors()
return (STAT_OK);
}
/*
* marlin_set_motor_timeout() - M84 (with S), M85 Sxxx
*
*/
stat_t marlin_set_motor_timeout(float s) // M18 Sxxx, M84 Sxxx, M85 Sxxx
{
if (s < MOTOR_TIMEOUT_SECONDS_MIN) {
return (STAT_INPUT_LESS_THAN_MIN_VALUE);
}
if (s > MOTOR_TIMEOUT_SECONDS_MAX) {
return (STAT_INPUT_EXCEEDS_MAX_VALUE);
}
char buffer[128];
char *str = buffer;
// TODO: support other fans, or remapping output
str_concat(str, "{mt:");
str += floattoa(str, s, 1);
str_concat(str, "}");
cm_json_command(buffer);
return (STAT_OK);
}
/*
* marlin_report_version() - M115