We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0be991b commit 3852552Copy full SHA for 3852552
1 file changed
STM32F1/cores/maple/usb_serial.cpp
@@ -178,10 +178,6 @@ uint8 USBSerial::pending(void) {
178
return usb_cdcacm_get_pending();
179
}
180
181
-uint8 USBSerial::isConnected(void) {
182
- return usb_is_connected(USBLIB) && usb_is_configured(USBLIB) && usb_cdcacm_get_dtr();
183
-}
184
-
185
uint8 USBSerial::getDTR(void) {
186
return usb_cdcacm_get_dtr();
187
@@ -190,6 +186,10 @@ uint8 USBSerial::getRTS(void) {
190
return usb_cdcacm_get_rts();
191
192
188
189
+uint8 USBSerial::operator bool() {
+ return usb_is_connected(USBLIB) && usb_is_configured(USBLIB) && usb_cdcacm_get_dtr();
+}
+
193
#if BOARD_HAVE_SERIALUSB
194
#ifdef SERIAL_USB
195
USBSerial Serial;
0 commit comments