Secure STM32F1 servo code and M280 detach (#14085)
This commit is contained in:
committed by
Scott Lahteine
parent
a49919396a
commit
24b1818245
@ -34,8 +34,13 @@ void GcodeSuite::M280() {
|
||||
if (!parser.seen('P')) return;
|
||||
const int servo_index = parser.value_int();
|
||||
if (WITHIN(servo_index, 0, NUM_SERVOS - 1)) {
|
||||
if (parser.seen('S'))
|
||||
MOVE_SERVO(servo_index, parser.value_int());
|
||||
if (parser.seen('S')) {
|
||||
const int a = parser.value_int();
|
||||
if (a == -1)
|
||||
servo[servo_index].detach();
|
||||
else
|
||||
MOVE_SERVO(servo_index, a);
|
||||
}
|
||||
else {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPAIR(" Servo ", servo_index);
|
||||
|
Reference in New Issue
Block a user