projects
/
gps-watch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c01181
)
application: Configure PTA12 for push button use.
author
Tilman Sauerbeck
<tilman@code-monkey.de>
Wed, 18 Dec 2019 08:59:12 +0000
(09:59 +0100)
committer
Tilman Sauerbeck
<tilman@code-monkey.de>
Sun, 5 Jan 2020 19:38:11 +0000
(20:38 +0100)
src/application/main.rs
patch
|
blob
|
history
diff --git
a/src/application/main.rs
b/src/application/main.rs
index 55214279c599367e8010a578cb597291b7449675..1fdc577cf9c55fca378798ce5434a390ac345eb4 100644
(file)
--- 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();