From a2e39a756c45b388f61fae02b20602f8cc0e5f1d Mon Sep 17 00:00:00 2001
From: Paul Sokolovsky <pfalcon@users.sourceforge.net>
Date: Fri, 12 Feb 2016 23:20:52 +0200
Subject: [PATCH] esp8266/modpybrtc: Simplify multiplication by fixed-point
 value.

---
 esp8266/modpybrtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/esp8266/modpybrtc.c b/esp8266/modpybrtc.c
index 6dea4b1b9..02377985c 100644
--- a/esp8266/modpybrtc.c
+++ b/esp8266/modpybrtc.c
@@ -58,7 +58,7 @@ STATIC mp_obj_t pyb_rtc_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp
 }
 
 STATIC uint64_t pyb_rtc_raw_us(uint64_t cal) {
-    return system_get_rtc_time() * ((cal >> 12) * 1000 + (cal & 0xfff) / 4) / 1000;
+    return (system_get_rtc_time() * cal) >> 12;
 };
 
 void pyb_rtc_set_us_since_2000(uint64_t nowus) {
-- 
GitLab