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:
b6b84d7
)
application: Factor out the reset_requested() function.
author
Tilman Sauerbeck
<tilman@code-monkey.de>
Sun, 5 Jan 2020 18:23:39 +0000
(19:23 +0100)
committer
Tilman Sauerbeck
<tilman@code-monkey.de>
Wed, 8 Jan 2020 11:06:51 +0000
(12:06 +0100)
No change in behavior.
src/application/main.rs
patch
|
blob
|
history
diff --git
a/src/application/main.rs
b/src/application/main.rs
index 8f7bd6d1da6cdf5b76a16927b34cd5d0ad92b1b1..247663081a9c25faf12d1f47557d214d947678a3 100644
(file)
--- a/
src/application/main.rs
+++ b/
src/application/main.rs
@@
-76,11
+76,15
@@
impl Timer {
}
}
+fn reset_requested() -> bool {
+ (gpio::get(gpio::GPIOA) & (1 << 12)) == 0
+}
+
#[inline(never)]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {
- if
(gpio::get(gpio::GPIOA) & (1 << 12)) == 0
{
+ if
reset_requested()
{
nvic::system_reset();
}
}
@@
-230,7
+234,7
@@
pub unsafe extern "C" fn _start() -> ! {
}
});
- if
(gpio::get(gpio::GPIOA) & (1 << 12)) == 0
{
+ if
reset_requested()
{
nvic::system_reset();
}
}