diff --git a/cores/nRF5/Uart.cpp b/cores/nRF5/Uart.cpp index 2c715e5a..5a56c171 100644 --- a/cores/nRF5/Uart.cpp +++ b/cores/nRF5/Uart.cpp @@ -205,10 +205,12 @@ size_t Uart::write(const uint8_t data) return 1; } +Uart SERIAL_PORT_HARDWARE( NRF_UART0, UARTE0_UART0_IRQn, PIN_SERIAL_RX, PIN_SERIAL_TX ); -#define NRF_UART0_IRQn UARTE0_UART0_IRQn - -Uart SERIAL_PORT_HARDWARE( NRF_UART0, NRF_UART0_IRQn, PIN_SERIAL_RX, PIN_SERIAL_TX ); +#ifdef HAVE_HWSERIAL2 +// TODO UART1 is UARTE only, need update class Uart to work +Uart Serial2( NRF_UARTE1, UARTE1_IRQn, PIN_SERIAL2_RX, PIN_SERIAL2_TX ); +#endif extern "C" { diff --git a/cores/nRF5/Uart.h b/cores/nRF5/Uart.h index 4dae03f3..8fd9b86c 100644 --- a/cores/nRF5/Uart.h +++ b/cores/nRF5/Uart.h @@ -93,6 +93,10 @@ class Uart : public HardwareSerial #define SERIAL_PORT_HARDWARE Serial1 #define SERIAL_PORT_HARDWARE_OPEN Serial1 +// TODO need to update class Uart to work with UARTE +//extern Uart Serial2; +//#define HAVE_HWSERIAL2 + #else #define SERIAL_PORT_MONITOR Serial @@ -100,7 +104,4 @@ class Uart : public HardwareSerial #endif - -#ifdef __cplusplus extern Uart SERIAL_PORT_HARDWARE; -#endif diff --git a/variants/pca10056/variant.h b/variants/pca10056/variant.h index 481a3587..3191272d 100644 --- a/variants/pca10056/variant.h +++ b/variants/pca10056/variant.h @@ -84,8 +84,11 @@ static const uint8_t AREF = PIN_AREF; /* * Serial interfaces */ -#define PIN_SERIAL_RX (8) -#define PIN_SERIAL_TX (6) +#define PIN_SERIAL_RX (33) +#define PIN_SERIAL_TX (34) + +#define PIN_SERIAL2_RX (8) +#define PIN_SERIAL2_TX (6) /* * SPI Interfaces