diff options
author | Brian Cully <bjc@kublai.com> | 2019-08-13 11:39:46 -0400 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2019-08-13 15:33:41 -0400 |
commit | d23ecf5ed4632f75d239e0e3858a94234baa90cd (patch) | |
tree | 80f93c560556153c788b37784a5198e3bddea1fd /ble | |
parent | 432f0dec2d7a716d43e2195c3b89fd050e4c536f (diff) | |
download | bleusb-d23ecf5ed4632f75d239e0e3858a94234baa90cd.tar.gz bleusb-d23ecf5ed4632f75d239e0e3858a94234baa90cd.zip |
Check rtc flags before updating counter.
Diffstat (limited to 'ble')
-rw-r--r-- | ble/src/rtc.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ble/src/rtc.rs b/ble/src/rtc.rs index 8fe581f..7b6faa2 100644 --- a/ble/src/rtc.rs +++ b/ble/src/rtc.rs @@ -62,7 +62,8 @@ fn handler<R>(rtc: &mut Rtc<R, rtc::Started>) where R: rtc::Instance, { - let _ = rtc.get_event_triggered(RtcInterrupt::Tick, true); - CLOCK.add(1); - log::logger().flush(); + if rtc.get_event_triggered(RtcInterrupt::Tick, true) { + CLOCK.add(1); + log::logger().flush(); + } } |