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

@@ -34,21 +34,22 @@ void GcodeSuite::M42() {
if (!parser.seenval('S')) return;
const byte pin_status = parser.value_byte();
const int pin_number = parser.intval('P', LED_PIN);
int pin_number = PARSED_PIN_INDEX('P', GET_PIN_MAP_INDEX(LED_PIN));
if (pin_number < 0) return;
if (pin_is_protected(pin_number)) {
const pin_t pin = GET_PIN_MAP_PIN(pin_number);
if (pin_is_protected(pin)) {
SERIAL_ERROR_START();
SERIAL_ERRORLNPGM(MSG_ERR_PROTECTED_PIN);
return;
}
pinMode(pin_number, OUTPUT);
digitalWrite(pin_number, pin_status);
analogWrite(pin_number, pin_status);
pinMode(pin, OUTPUT);
digitalWrite(pin, pin_status);
analogWrite(pin, pin_status);
#if FAN_COUNT > 0
switch (pin_number) {
switch (pin) {
#if HAS_FAN0
case FAN_PIN: fanSpeeds[0] = pin_status; break;
#endif