Make LPC1768 pinmapping not specific to Re-ARM (#8063)

* Merging early because of build failures.  See #8105

* Make LPC1768 pinmapping not specific to Re-ARM

* Add HAL_PIN_TYPE and LPC1768 pin features

* M43 Updates

* Move pin map into pinsDebug_LPC1768.h

* Incorporate comments and M226

* Fix persistent store compilation issues

* Update pin features

* Update MKS SBASE pins

* Use native LPC1768 pin numbers in M42, M43, and M226
This commit is contained in:
Thomas Moore
2017-10-26 13:37:26 -05:00
committed by Roxy-3D
parent e4266d0fde
commit 9e699811d2
49 changed files with 1176 additions and 1338 deletions

View File

@@ -29,16 +29,17 @@
*/
void GcodeSuite::M226() {
if (parser.seen('P')) {
const int pin_number = parser.value_int(),
const int pin_number = PARSED_PIN_INDEX('P', 0),
pin_state = parser.intval('S', -1); // required pin state - default is inverted
const pin_t pin = GET_PIN_MAP_PIN(pin_number);
if (WITHIN(pin_state, -1, 1) && pin_number > -1 && !pin_is_protected(pin_number)) {
if (WITHIN(pin_state, -1, 1) && pin > -1 && !pin_is_protected(pin)) {
int target = LOW;
stepper.synchronize();
pinMode(pin_number, INPUT);
pinMode(pin, INPUT);
switch (pin_state) {
case 1:
target = HIGH;
@@ -47,12 +48,12 @@ void GcodeSuite::M226() {
target = LOW;
break;
case -1:
target = !digitalRead(pin_number);
target = !digitalRead(pin);
break;
}
while (digitalRead(pin_number) != target) idle();
while (digitalRead(pin) != target) idle();
} // pin_state -1 0 1 && pin_number > -1
} // pin_state -1 0 1 && pin > -1
} // parser.seen('P')
}