From: Tilman Sauerbeck Date: Wed, 18 Dec 2019 09:00:22 +0000 (+0100) Subject: application: Perform a system reset if PTA12 is pressed. X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=28b33a277d30f11989cfdfb142446170b45fab54;p=gps-watch.git application: Perform a system reset if PTA12 is pressed. --- diff --git a/src/application/main.rs b/src/application/main.rs index 1fdc577..bd1091f 100644 --- 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(); + } } }