Tweak M42 var
This commit is contained in:
parent
cf2c5266ed
commit
3269d8dd62
1 changed files with 3 additions and 3 deletions
|
@ -37,10 +37,10 @@ void GcodeSuite::M42() {
|
|||
if (!parser.seenval('S')) return;
|
||||
const byte pin_status = parser.value_byte();
|
||||
|
||||
int pin_number = PARSED_PIN_INDEX('P', GET_PIN_MAP_INDEX(LED_PIN));
|
||||
if (pin_number < 0) return;
|
||||
const int pin_index = PARSED_PIN_INDEX('P', GET_PIN_MAP_INDEX(LED_PIN));
|
||||
if (pin_index < 0) return;
|
||||
|
||||
const pin_t pin = GET_PIN_MAP_PIN(pin_number);
|
||||
const pin_t pin = GET_PIN_MAP_PIN(pin_index);
|
||||
if (pin_is_protected(pin)) {
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ERRORLNPGM(MSG_ERR_PROTECTED_PIN);
|
||||
|
|
Reference in a new issue