From: Tilman Sauerbeck Date: Sat, 16 Nov 2019 10:11:54 +0000 (+0100) Subject: common: Disable the USB interrupt in usb_serial::shutdown(). X-Git-Url: http://git.code-monkey.de/?p=gps-watch.git;a=commitdiff_plain;h=9768316cd360db334dce307e1a8fefd081785401 common: Disable the USB interrupt in usb_serial::shutdown(). --- diff --git a/src/common/usb_serial.rs b/src/common/usb_serial.rs index cce12e3..3f9e48f 100644 --- a/src/common/usb_serial.rs +++ b/src/common/usb_serial.rs @@ -48,6 +48,15 @@ pub unsafe extern fn USB_DeviceIsrEnable() nvic::enable_irq(irq_number); } +#[no_mangle] +#[allow(non_snake_case)] +pub unsafe extern fn USB_DeviceIsrDisable() +{ + let irq_number = 24; // USB0 + + nvic::disable_irq(irq_number); +} + #[no_mangle] #[allow(non_snake_case)] pub unsafe extern fn USB_DeviceClockInit() diff --git a/src/common/virtual_com.c b/src/common/virtual_com.c index 2427f93..cc388c7 100644 --- a/src/common/virtual_com.c +++ b/src/common/virtual_com.c @@ -59,6 +59,7 @@ /* Provided by users. */ extern void USB_DeviceClockInit(void); extern void USB_DeviceIsrEnable(void); +extern void USB_DeviceIsrDisable(void); /******************************************************************************* * Definitions ******************************************************************************/ @@ -669,6 +670,8 @@ USB_VcomDeinit (void) USB_DeviceDeinit (s_cdcVcom.deviceHandle); s_cdcVcom.deviceHandle = NULL; + USB_DeviceIsrDisable(); + /* XXX: We are not stopping the USBOTG clock yet. */ }