aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-09-23 17:42:07 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-10-18 13:30:17 -0400
commitc4092f07f055ac914155930d6a0acba299f96082 (patch)
tree76e149721bd9870976857c6f72b2df16c4ef61b3
parent24e294c9b0be5f2f24c9d7b9cddd163ac22efab2 (diff)
downloadlibrambutan-c4092f07f055ac914155930d6a0acba299f96082.tar.gz
librambutan-c4092f07f055ac914155930d6a0acba299f96082.zip
usb: Remove usbPowerOff(), move usbPowerOn() to usb_callbacks.c.
Remove usbPowerOn(), usbPowerOff() prototypes from usb.h. These aren't used outside of the USB subsystem, so they don't belong here. Move usbPowerOn() from usb.c to usb_callbacks.c. This is the only place where it's used. Remove the unused usbPowerOff() (from usb.c) altogether. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
-rwxr-xr-x[-rw-r--r--]libmaple/usb/usb.c28
-rwxr-xr-x[-rw-r--r--]libmaple/usb/usb.h3
-rw-r--r--libmaple/usb/usb_callbacks.c15
3 files changed, 15 insertions, 31 deletions
diff --git a/libmaple/usb/usb.c b/libmaple/usb/usb.c
index 1754360..4f31c33 100644..100755
--- a/libmaple/usb/usb.c
+++ b/libmaple/usb/usb.c
@@ -191,34 +191,6 @@ void usbResume(RESUME_STATE eResumeSetVal) {
}
}
-RESULT usbPowerOn(void) {
- u16 wRegVal;
-
- wRegVal = CNTR_FRES;
- _SetCNTR(wRegVal);
-
- wInterrupt_Mask = 0;
- _SetCNTR(wInterrupt_Mask);
- _SetISTR(0);
- wInterrupt_Mask = CNTR_RESETM | CNTR_SUSPM | CNTR_WKUPM; // the bare minimum
- _SetCNTR(wInterrupt_Mask);
-
- return USB_SUCCESS;
-}
-
-RESULT usbPowerOff(void) {
- _SetCNTR(CNTR_FRES);
- _SetISTR(0);
- _SetCNTR(CNTR_FRES + CNTR_PDWN);
-
- /* note that all weve done here is powerdown the
- usb peripheral. we have no disabled the clocks,
- pulled the usb_disc pin back up, or reset the
- application state machines */
-
- return USB_SUCCESS;
-}
-
/* overloaded ISR routine, this is the main usb ISR */
void __irq_usb_lp_can_rx0(void) {
wIstr = _GetISTR();
diff --git a/libmaple/usb/usb.h b/libmaple/usb/usb.h
index 903964b..853300b 100644..100755
--- a/libmaple/usb/usb.h
+++ b/libmaple/usb/usb.h
@@ -66,9 +66,6 @@ void usbSuspend(void);
void usbResumeInit(void);
void usbResume(RESUME_STATE);
-RESULT usbPowerOn(void);
-RESULT usbPowerOff(void);
-
/* overloaded ISR routine, this is the main usb ISR */
void __irq_usb_lp_can_rx0(void);
void usbWaitReset(void);
diff --git a/libmaple/usb/usb_callbacks.c b/libmaple/usb/usb_callbacks.c
index 72f97ad..5a69d4c 100644
--- a/libmaple/usb/usb_callbacks.c
+++ b/libmaple/usb/usb_callbacks.c
@@ -137,6 +137,21 @@ u8* vcomGetSetLineCoding(uint16 length) {
void vcomSetLineState(void) {
}
+static RESULT usbPowerOn(void) {
+ u16 wRegVal;
+
+ wRegVal = CNTR_FRES;
+ _SetCNTR(wRegVal);
+
+ wInterrupt_Mask = 0;
+ _SetCNTR(wInterrupt_Mask);
+ _SetISTR(0);
+ wInterrupt_Mask = CNTR_RESETM | CNTR_SUSPM | CNTR_WKUPM; // the bare minimum
+ _SetCNTR(wInterrupt_Mask);
+
+ return USB_SUCCESS;
+}
+
void usbInit(void) {
pInformation->Current_Configuration = 0;
usbPowerOn();