[2.0.x] LPC1768: Fix: Serial pins disabled correctly when in use (#9193)

This commit is contained in:
Chris Pepper 2018-01-22 07:54:41 +00:00 committed by Scott Lahteine
parent ab8a1a2a0d
commit f875f49caa
3 changed files with 13 additions and 12 deletions

View file

@ -65,9 +65,9 @@ extern "C" volatile uint32_t _millis;
#include "HAL_timers.h"
#include "HardwareSerial.h"
#define ST7920_DELAY_1 DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP
#define ST7920_DELAY_2 DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP
#define ST7920_DELAY_3 DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP;DELAY_5_NOP
#define ST7920_DELAY_1 DELAY_20_NOP;DELAY_20_NOP;DELAY_20_NOP
#define ST7920_DELAY_2 DELAY_20_NOP;DELAY_20_NOP;DELAY_20_NOP;DELAY_10_NOP;DELAY_5_NOP
#define ST7920_DELAY_3 DELAY_20_NOP;DELAY_20_NOP;DELAY_20_NOP;DELAY_10_NOP;DELAY_5_NOP
extern HalSerial usb_serial;

View file

@ -109,11 +109,11 @@ constexpr int8_t LPC1768_PIN_ADC(const pin_t pin) { return (int8_t)((pin >> 10)
// ******************
#define P_NC -1
#if SERIAL_PORT != 3
#if SERIAL_PORT != 3 && SERIAL_PORT_2 != 3
#define P0_00 LPC1768_PIN(PORT(0), PIN( 0), INTERRUPT(1), PWM(0), ADC_NONE)
#define P0_01 LPC1768_PIN(PORT(0), PIN( 1), INTERRUPT(1), PWM(0), ADC_NONE)
#endif
#if SERIAL_PORT != 0
#if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0
#define P0_02 LPC1768_PIN(PORT(0), PIN( 2), INTERRUPT(1), PWM(0), ADC_CHAN(7))
#define P0_03 LPC1768_PIN(PORT(0), PIN( 3), INTERRUPT(1), PWM(0), ADC_CHAN(6))
#endif
@ -123,11 +123,11 @@ constexpr int8_t LPC1768_PIN_ADC(const pin_t pin) { return (int8_t)((pin >> 10)
#define P0_07 LPC1768_PIN(PORT(0), PIN( 7), INTERRUPT(1), PWM(0), ADC_NONE)
#define P0_08 LPC1768_PIN(PORT(0), PIN( 8), INTERRUPT(1), PWM(0), ADC_NONE)
#define P0_09 LPC1768_PIN(PORT(0), PIN( 9), INTERRUPT(1), PWM(0), ADC_NONE)
#if SERIAL_PORT != 2
#if SERIAL_PORT != 2 && SERIAL_PORT_2 != 2
#define P0_10 LPC1768_PIN(PORT(0), PIN(10), INTERRUPT(1), PWM(0), ADC_NONE)
#define P0_11 LPC1768_PIN(PORT(0), PIN(11), INTERRUPT(1), PWM(0), ADC_NONE)
#endif
#if SERIAL_PORT != 1
#if SERIAL_PORT != 1 && SERIAL_PORT_2 != 1
#define P0_15 LPC1768_PIN(PORT(0), PIN(15), INTERRUPT(1), PWM(0), ADC_NONE)
#define P0_16 LPC1768_PIN(PORT(0), PIN(16), INTERRUPT(1), PWM(0), ADC_NONE)
#endif
@ -190,25 +190,25 @@ constexpr int8_t LPC1768_PIN_ADC(const pin_t pin) { return (int8_t)((pin >> 10)
// Pin index for M43 and M226
constexpr pin_t pin_map[] = {
#if SERIAL_PORT != 3
#if SERIAL_PORT != 3 && SERIAL_PORT_2 != 3
P0_00, P0_01,
#else
P_NC, P_NC,
#endif
#if SERIAL_PORT != 0
#if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0
P0_02, P0_03,
#else
P_NC, P_NC,
#endif
P0_04, P0_05, P0_06, P0_07,
P0_08, P0_09,
#if SERIAL_PORT != 2
#if SERIAL_PORT != 2 && SERIAL_PORT_2 != 2
P0_10, P0_11,
#else
P_NC, P_NC,
#endif
P_NC, P_NC, P_NC,
#if SERIAL_PORT != 1
#if SERIAL_PORT != 1 && SERIAL_PORT_2 != 1
P0_15,
P0_16,
#else
@ -243,7 +243,7 @@ constexpr uint8_t NUM_DIGITAL_PINS = COUNT(pin_map);
constexpr pin_t adc_pin_table[] = {
P0_23, P0_24, P0_25, P0_26, P1_30, P1_31,
#if SERIAL_PORT != 0
#if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0
P0_03, P0_02
#endif
};

View file

@ -195,6 +195,7 @@
#define SPINDLE_DIR_PIN P1_19 // (5)
#endif
#endif
//
// Průša i3 MK2 Multiplexer Support
//