From c4092f07f055ac914155930d6a0acba299f96082 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Fri, 23 Sep 2011 17:42:07 -0400 Subject: 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 --- libmaple/usb/usb.c | 28 ---------------------------- libmaple/usb/usb.h | 3 --- libmaple/usb/usb_callbacks.c | 15 +++++++++++++++ 3 files changed, 15 insertions(+), 31 deletions(-) mode change 100644 => 100755 libmaple/usb/usb.c mode change 100644 => 100755 libmaple/usb/usb.h (limited to 'libmaple/usb') diff --git a/libmaple/usb/usb.c b/libmaple/usb/usb.c old mode 100644 new mode 100755 index 1754360..4f31c33 --- 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 old mode 100644 new mode 100755 index 903964b..853300b --- 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(); -- cgit v1.2.3