From b7095b94fad1391e712a0030a47f2e52c2ae5f2b Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Wed, 18 Dec 2019 09:59:12 +0100 Subject: [PATCH] application: Configure PTA12 for push button use. --- src/application/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) 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(); -- 2.30.2