diff options
author | bnewbold <bnewbold@robocracy.org> | 2010-07-22 18:24:51 -0400 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2010-07-22 18:24:51 -0400 |
commit | 99c251b8462e7bc304e9e4a52bfc378d22804291 (patch) | |
tree | 051bdb863c92d9447191b92a49877e4dff141758 /libmaple/usb | |
parent | 05f137fab9f4604ca3c7e8bb415c4b29db40ae5e (diff) | |
download | librambutan-99c251b8462e7bc304e9e4a52bfc378d22804291.tar.gz librambutan-99c251b8462e7bc304e9e4a52bfc378d22804291.zip |
added isConnected() to serialusb
Diffstat (limited to 'libmaple/usb')
-rw-r--r-- | libmaple/usb/usb.c | 8 | ||||
-rw-r--r-- | libmaple/usb/usb.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libmaple/usb/usb.c b/libmaple/usb/usb.c index 881c7f9..23cde00 100644 --- a/libmaple/usb/usb.c +++ b/libmaple/usb/usb.c @@ -459,6 +459,14 @@ uint8 usbGetRTS() { return ((line_dtr_rts & CONTROL_LINE_RTS) != 0); } +uint8 usbIsConfigured() { + return (bDeviceState == CONFIGURED); +} + +uint8 usbIsConnected() { + return (bDeviceState != UNCONNECTED); +} + uint16 usbGetPending() { return countTx; } diff --git a/libmaple/usb/usb.h b/libmaple/usb/usb.h index e0d4231..ec179b1 100644 --- a/libmaple/usb/usb.h +++ b/libmaple/usb/usb.h @@ -57,6 +57,8 @@ typedef enum uint8 usbReceiveBytes(uint8* recvBuf, uint8 len); uint8 usbGetDTR(void); uint8 usbGetRTS(void); + uint8 usbIsConnected(void); + uint8 usbIsConfigured(void); uint16 usbGetPending(void); void usbSendHello(void); |