From d23ecf5ed4632f75d239e0e3858a94234baa90cd Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Tue, 13 Aug 2019 11:39:46 -0400 Subject: Check rtc flags before updating counter. --- ble/src/rtc.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ble') 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(rtc: &mut Rtc) 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(); + } } -- cgit v1.2.3