From: Tilman Sauerbeck Date: Wed, 18 Dec 2019 08:59:12 +0000 (+0100) Subject: application: Configure PTA12 for push button use. X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=b7095b94fad1391e712a0030a47f2e52c2ae5f2b;p=gps-watch.git application: Configure PTA12 for push button use. --- diff --git a/src/application/main.rs b/src/application/main.rs index 5521427..1fdc577 100644 --- a/src/application/main.rs +++ b/src/application/main.rs @@ -30,6 +30,8 @@ extern crate common; use common::buffer::Buffer; use common::clock; use common::systick; +use common::port; +use common::gpio; use common::usb_serial; extern { @@ -42,6 +44,12 @@ extern { pub unsafe extern fn main() { clock::configure(); systick::init(); + port::init(); + + // Configure upper right push button. + gpio::set_direction(gpio::GPIOA, 1 << 12, gpio::Direction::Input); + port::set_af(port::PORTA, 12, 1); + port::set_pull(port::PORTA, 12, port::Pull::Up); enable_interrupts();