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:
b7095b9
)
application: Perform a system reset if PTA12 is pressed.
author
Tilman Sauerbeck
<tilman@code-monkey.de>
Wed, 18 Dec 2019 09:00:22 +0000
(10:00 +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 1fdc577cf9c55fca378798ce5434a390ac345eb4..bd1091f3c2bbca3632de41c8c536bd7619b34d80 100644
(file)
--- a/
src/application/main.rs
+++ b/
src/application/main.rs
@@
-32,6
+32,7
@@
use common::clock;
use common::systick;
use common::port;
use common::gpio;
+use common::nvic;
use common::usb_serial;
extern {
@@
-63,5
+64,9
@@
pub unsafe extern fn main() {
cdc_tx_buf.write(b".\n");
cdc_tx_buf.flush();
+
+ if (gpio::get(gpio::GPIOA) & (1 << 12)) == 0 {
+ nvic::system_reset();
+ }
}
}