@@ -26,12 +26,12 @@ void serialEventRun(void)
2626{
2727 if (serialEvent && Serial.available () ) serialEvent ();
2828
29- #ifndef NRF52832_XXAA // 832 only has 1 UART for Serial
29+ #if defined(PIN_SERIAL1_RX) && defined(PIN_SERIAL1_TX)
3030 if (serialEvent1 && Serial1.available () ) serialEvent1 ();
31+ #endif
3132
32- #if SERIAL_INTERFACES_COUNT >= 2
33+ #if defined(PIN_SERIAL2_RX) && defined(PIN_SERIAL2_TX)
3334 if (serialEvent2 && Serial2.available () ) serialEvent2 ();
34- #endif
3535#endif
3636}
3737
@@ -241,7 +241,11 @@ size_t Uart::write(const uint8_t *buffer, size_t size)
241241}
242242
243243// ------------- Serial1 (or Serial in case of nRF52832) -------------//
244- Uart SERIAL_PORT_HARDWARE ( NRF_UARTE0, UARTE0_UART0_IRQn, PIN_SERIAL1_RX, PIN_SERIAL1_TX );
244+ #ifdef NRF52832_XXAA
245+ Uart Serial ( NRF_UARTE0, UARTE0_UART0_IRQn, PIN_SERIAL_RX, PIN_SERIAL_TX );
246+ #else
247+ Uart Serial1 ( NRF_UARTE0, UARTE0_UART0_IRQn, PIN_SERIAL1_RX, PIN_SERIAL1_TX );
248+ #endif
245249
246250extern " C"
247251{
@@ -252,7 +256,7 @@ extern "C"
252256}
253257
254258// ------------- Serial2 -------------//
255- #if SERIAL_INTERFACES_COUNT >= 2
259+ #if defined(PIN_SERIAL2_RX) && defined(PIN_SERIAL2_TX)
256260Uart Serial2 ( NRF_UARTE1, UARTE1_IRQn, PIN_SERIAL2_RX, PIN_SERIAL2_TX );
257261
258262extern " C"
0 commit comments