We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eceebcc commit f348438Copy full SHA for f348438
cores/nRF5/Uart.cpp
@@ -246,6 +246,10 @@ size_t Uart::write(const uint8_t data)
246
return 1;
247
}
248
249
+Uart::operator bool() {
250
+ return nrfUart->ENABLE == UART_ENABLE_ENABLE_Enabled;
251
+}
252
+
253
#if defined(NRF52_SERIES)
254
#define NRF_UART0_IRQn UARTE0_UART0_IRQn
255
#elif defined(NRF51_SERIES)
cores/nRF5/Uart.h
@@ -47,10 +47,10 @@ class Uart : public HardwareSerial
47
48
void IrqHandler();
49
50
- operator bool() { return true; }
+ operator bool();
51
52
private:
53
- NRF_UART_Type *nrfUart;
+ NRF_UART_Type *nrfUart{nullptr};
54
RingBuffer rxBuffer;
55
56
IRQn_Type IRQn;
0 commit comments