projects
/
gps-watch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
common: Store GPS coordinates in radians, too.
[gps-watch.git]
/
src
/
common
/
usb_serial.rs
diff --git
a/src/common/usb_serial.rs
b/src/common/usb_serial.rs
index 6a7cd173b0fc09e51e04021e7a32604170914bbe..3f9e48f7faff8a81e244e477744dad5e0fce5c68 100644
(file)
--- a/
src/common/usb_serial.rs
+++ b/
src/common/usb_serial.rs
@@
-26,12
+26,17
@@
use clock;
extern {
fn USB_VcomInit(vid: u16, pid: u16);
extern {
fn USB_VcomInit(vid: u16, pid: u16);
+ fn USB_VcomDeinit();
}
pub unsafe fn init(vid: u16, pid: u16) {
USB_VcomInit(vid, pid);
}
}
pub unsafe fn init(vid: u16, pid: u16) {
USB_VcomInit(vid, pid);
}
+pub unsafe fn shutdown() {
+ USB_VcomDeinit();
+}
+
#[no_mangle]
#[allow(non_snake_case)]
pub unsafe extern fn USB_DeviceIsrEnable()
#[no_mangle]
#[allow(non_snake_case)]
pub unsafe extern fn USB_DeviceIsrEnable()
@@
-43,6
+48,15
@@
pub unsafe extern fn USB_DeviceIsrEnable()
nvic::enable_irq(irq_number);
}
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()
#[no_mangle]
#[allow(non_snake_case)]
pub unsafe extern fn USB_DeviceClockInit()