From: Tilman Sauerbeck Date: Sun, 7 Jul 2019 18:29:05 +0000 (+0200) Subject: bootloader: configure PTE24 for push button use. X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=8483f69a801c3424943842ea2b3ccd7a7a2be3af;p=gps-watch.git bootloader: configure PTE24 for push button use. --- 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);