From 8bc83f47ee584b898ef43aa5f3be57f219eef4fa Mon Sep 17 00:00:00 2001 From: Marc Poulhiès Date: Sun, 8 Nov 2020 14:28:14 +0100 Subject: Use type to make code easier to read --- firmware/src/main.rs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'firmware') 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>, - gpioa::PA6>, - gpioa::PA7>, - EightBit, - >, - >, +type Spi = hal::spi::Spi< + stm32::SPI1, + gpioa::PA5>, + gpioa::PA6>, + gpioa::PA7>, + EightBit, >; +type UsbClass = keyberon::Class<'static, usb::UsbBusType, Leds>; + type UsbDevice = usb_device::device::UsbDevice<'static, usb::UsbBusType>; trait ResultExt { -- cgit v1.2.3