summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorMarc Poulhiès <dkm@kataplop.net>2020-11-08 14:28:14 +0100
committerMarc Poulhiès <dkm@kataplop.net>2020-11-11 21:18:38 +0100
commit8bc83f47ee584b898ef43aa5f3be57f219eef4fa (patch)
tree04d037019fc7cc8dccc7231da8394f0318bab3bc /firmware
parent8d8376c8658e93333c6bb1bcbe22ed4fe1fa7e25 (diff)
Use type to make code easier to read
Diffstat (limited to 'firmware')
-rw-r--r--firmware/src/main.rs22
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> {