aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/usb
diff options
context:
space:
mode:
Diffstat (limited to 'libmaple/usb')
-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();