From 8483f69a801c3424943842ea2b3ccd7a7a2be3af Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sun, 7 Jul 2019 20:29:05 +0200 Subject: [PATCH] bootloader: configure PTE24 for push button use. --- src/bootloader/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bootloader/main.rs b/src/bootloader/main.rs index 0f863fc..2e43b67 100644 --- a/src/bootloader/main.rs +++ b/src/bootloader/main.rs @@ -32,6 +32,8 @@ mod bootloader; use common::clock; use common::systick; +use common::port; +use common::gpio; use common::usb_serial; extern { @@ -45,6 +47,11 @@ pub unsafe extern fn main() { clock::configure(); systick::init(); + // Configure lower left push button. + gpio::set_direction(gpio::GPIOE, 1 << 24, gpio::Direction::Input); + port::set_af(port::PORTE, 24, 1); + port::set_pull(port::PORTE, 24, port::Pull::Up); + if true { usb_serial::init(0xf055, 0x635c); -- 2.30.2