diff options
Diffstat (limited to 'usb/src/main.rs')
-rw-r--r-- | usb/src/main.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usb/src/main.rs b/usb/src/main.rs index 42cdf55..a87ecfb 100644 --- a/usb/src/main.rs +++ b/usb/src/main.rs @@ -39,6 +39,12 @@ use smart_leds::colors; use smart_leds_trait::SmartLedsWrite; use usb_host::Driver; +// Wow, would I love to not be annotating this type. +type UARTLogger = logger::SerialLogger< + sercom::UART0<sercom::Sercom0Pad3<Pa7<PfD>>, sercom::Sercom0Pad2<Pa6<PfD>>, (), ()>, + Pa10<Output<OpenDrain>>, +>; + // A very unsafe copy of an LED to turn on when things go really, really wrong. static mut LED: usize = 0; @@ -111,11 +117,7 @@ fn main() -> ! { let uart_wrapped = logger::WriteWrapper::new(uart); let logger = logger::SerialLogger::new(uart_wrapped, red_led); - // Wow, would I love to not be annotating this type. - let logger_ref: &'static logger::SerialLogger< - sercom::UART0<sercom::Sercom0Pad3<Pa7<PfD>>, sercom::Sercom0Pad2<Pa6<PfD>>, (), ()>, - Pa10<Output<OpenDrain>>, - > = unsafe { mem::transmute(&logger) }; + let logger_ref: &'static UARTLogger = unsafe { mem::transmute(&logger) }; unsafe { log::set_logger_racy(logger_ref).expect("couldn't set logger") }; log::set_max_level(LevelFilter::Trace); |