diff options
-rw-r--r-- | lib/usbio.c | 8 | ||||
-rw-r--r-- | lib/usbio.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/usbio.c b/lib/usbio.c index 3010789..2c9fc9c 100644 --- a/lib/usbio.c +++ b/lib/usbio.c @@ -99,6 +99,14 @@ void usbio_task(void) USB_USBTask(); } +int8_t usbio_is_connected(void) +{ + if(stdin == &usb_stream) + return 1; + else + return 0; +} + int16_t usbio_bytes_received(void) { if(stdin == &usb_stream) diff --git a/lib/usbio.h b/lib/usbio.h index fdd93f1..decc249 100644 --- a/lib/usbio.h +++ b/lib/usbio.h @@ -33,6 +33,7 @@ extern "C" { void usbio_init(void); void usbio_task(void); int16_t usbio_bytes_received(void); +int8_t usbio_is_connected(void); #ifdef __cplusplus } |