diff options
author | Marc Poulhiès <dkm@kataplop.net> | 2020-11-08 14:28:14 +0100 |
---|---|---|
committer | Marc Poulhiès <dkm@kataplop.net> | 2020-11-11 21:18:38 +0100 |
commit | 8bc83f47ee584b898ef43aa5f3be57f219eef4fa (patch) | |
tree | 04d037019fc7cc8dccc7231da8394f0318bab3bc | |
parent | 8d8376c8658e93333c6bb1bcbe22ed4fe1fa7e25 (diff) |
Use type to make code easier to read
-rw-r--r-- | firmware/src/main.rs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/firmware/src/main.rs b/firmware/src/main.rs index 5e4e063..39013b5 100644 --- a/firmware/src/main.rs +++ b/firmware/src/main.rs @@ -21,7 +21,7 @@ use embedded_hal::spi::FullDuplex; use hal::usb; use hal::{ - spi::{EightBit, Mode, Phase, Polarity, Spi}, + spi::{EightBit, Mode, Phase, Polarity}, stm32, timers, }; use keyberon::action::{k, l, m, Action, Action::*}; @@ -38,20 +38,16 @@ use usb_device::bus::UsbBusAllocator; use usb_device::class::UsbClass as _; use usb_device::device::UsbDeviceState; -type UsbClass = keyberon::Class< - 'static, - usb::UsbBusType, - Leds< - Spi< - stm32::SPI1, - gpioa::PA5<Alternate<AF0>>, - gpioa::PA6<Alternate<AF0>>, - gpioa::PA7<Alternate<AF0>>, - EightBit, - >, - >, +type Spi = hal::spi::Spi< + stm32::SPI1, + gpioa::PA5<Alternate<AF0>>, + gpioa::PA6<Alternate<AF0>>, + gpioa::PA7<Alternate<AF0>>, + EightBit, >; +type UsbClass = keyberon::Class<'static, usb::UsbBusType, Leds<Spi>>; + type UsbDevice = usb_device::device::UsbDevice<'static, usb::UsbBusType>; trait ResultExt<T> { |