aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/usb
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-06-15 16:43:48 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-10-18 13:30:17 -0400
commitc6c959682084c8493a0c39754374e7dbe6cf1708 (patch)
treefa07c52c4527a2d1f11dbd1630aae1da25d54655 /libmaple/usb
parent9e3c80a3ae38c111c138aa9e7c70f1abb5d1424f (diff)
downloadlibrambutan-c6c959682084c8493a0c39754374e7dbe6cf1708.tar.gz
librambutan-c6c959682084c8493a0c39754374e7dbe6cf1708.zip
usb: Cleanups and renames.
Rename setupUSB() and disableUSB() to usb_cdcacm_enable() and usb_cdcacm_disable(), respectively. Remove usbSendHello(). This shouldn't exist. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'libmaple/usb')
-rw-r--r--libmaple/usb/usb.c19
-rw-r--r--libmaple/usb/usb.h6
2 files changed, 4 insertions, 21 deletions
diff --git a/libmaple/usb/usb.c b/libmaple/usb/usb.c
index 9b70b6b..5c4c35a 100644
--- a/libmaple/usb/usb.c
+++ b/libmaple/usb/usb.c
@@ -99,7 +99,7 @@ struct {
volatile uint8 bESOFcnt;
} ResumeS;
-void setupUSB (gpio_dev *disc_dev, uint8 disc_bit) {
+void usb_cdcacm_enable(gpio_dev *disc_dev, uint8 disc_bit) {
gpio_set_mode(disc_dev, disc_bit, GPIO_OUTPUT_PP);
/* setup the apb1 clock for USB */
@@ -110,7 +110,7 @@ void setupUSB (gpio_dev *disc_dev, uint8 disc_bit) {
USB_Init(); // low level init routine provided by the ST library
}
-void disableUSB (gpio_dev *disc_dev, uint8 disc_bit) {
+void usb_cdcacm_disable(gpio_dev *disc_dev, uint8 disc_bit) {
// These are just guesses about how to do this
// TODO: real disable function
usbDsbISR();
@@ -400,21 +400,6 @@ uint32 usbReceiveBytes(uint8* recvBuf, uint32 len) {
return len;
}
-void usbSendHello(void) {
- uint8 bufin = 48 + recvBufIn;;
- uint8 bufout = 48 + recvBufOut;
- uint8 avail = 48 + usbBytesAvailable();
-
- char *line = "\r\n";
- while(usbSendBytes(&bufin,1) == 0);
- while(usbSendBytes(&bufout,1) == 0);
- while(usbSendBytes(&avail,1) == 0);
- while(usbSendBytes((uint8*)line,2) == 0);
-
- uint8 recv[64];
- usbReceiveBytes(&recv[0],1);
-}
-
uint8 usbGetDTR() {
return ((line_dtr_rts & CONTROL_LINE_DTR) != 0);
}
diff --git a/libmaple/usb/usb.h b/libmaple/usb/usb.h
index 0df3c8d..c3d587d 100644
--- a/libmaple/usb/usb.h
+++ b/libmaple/usb/usb.h
@@ -57,8 +57,8 @@ typedef enum {
extern volatile uint32 bDeviceState;
-void setupUSB(gpio_dev*, uint8);
-void disableUSB(gpio_dev*, uint8);
+void usb_cdcacm_enable(gpio_dev*, uint8);
+void usb_cdcacm_disable(gpio_dev*, uint8);
void usbSuspend(void);
void usbResumeInit(void);
void usbResume(RESUME_STATE);
@@ -84,8 +84,6 @@ uint8 usbIsConnected(void);
uint8 usbIsConfigured(void);
uint16 usbGetPending(void);
-void usbSendHello(void);
-
#ifdef __cplusplus
} // extern "C"
#endif