diff --git a/cores/nRF5/Uart.cpp b/cores/nRF5/Uart.cpp index 5a1225f8..0b31d4be 100644 --- a/cores/nRF5/Uart.cpp +++ b/cores/nRF5/Uart.cpp @@ -30,7 +30,6 @@ Uart::Uart(NRF_UART_Type *_nrfUart, IRQn_Type _IRQn, uint8_t _pinRX, uint8_t _pi uc_hwFlow = 0; _mutex = NULL; - _begun = false; } @@ -45,10 +44,15 @@ Uart::Uart(NRF_UART_Type *_nrfUart, IRQn_Type _IRQn, uint8_t _pinRX, uint8_t _pi uc_hwFlow = 1; _mutex = NULL; - _begun = false; } +void Uart::setPins(uint8_t pin_rx, uint8_t pin_tx) +{ + uc_pinRX = pin_rx; + uc_pinTX = pin_tx; +} + void Uart::begin(unsigned long baudrate) { begin(baudrate, (uint8_t)SERIAL_8N1); diff --git a/cores/nRF5/Uart.h b/cores/nRF5/Uart.h index 93460687..d791aab9 100644 --- a/cores/nRF5/Uart.h +++ b/cores/nRF5/Uart.h @@ -32,6 +32,8 @@ class Uart : public HardwareSerial public: Uart(NRF_UART_Type *_nrfUart, IRQn_Type _IRQn, uint8_t _pinRX, uint8_t _pinTX); Uart(NRF_UART_Type *_nrfUart, IRQn_Type _IRQn, uint8_t _pinRX, uint8_t _pinTX, uint8_t _pinCTS, uint8_t _pinRTS ); + + void setPins(uint8_t pin_rx, uint8_t pin_tx); void begin(unsigned long baudRate); void begin(unsigned long baudrate, uint16_t config); void end();