From 40c6d578042254749b30ff1c56e7834503e49de9 Mon Sep 17 00:00:00 2001
From: Josef Gajdusek <atx@atx.name>
Date: Wed, 13 May 2015 15:34:54 +0200
Subject: [PATCH] esp8266: Actually use the decimal part of
 system_rtc_clock_cali_proc()

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

diff --git a/esp8266/modpybrtc.c b/esp8266/modpybrtc.c
index c0331760c..7bf65e821 100644
--- a/esp8266/modpybrtc.c
+++ b/esp8266/modpybrtc.c
@@ -47,7 +47,7 @@ typedef struct _pyb_rtc_obj_t {
 #define MEM_USER_MAXLEN     (512 - (MEM_USER_DATA_ADDR - MEM_DELTA_ADDR) * 4)
 
 STATIC uint64_t pyb_rtc_raw_us(uint64_t cal) {
-    return system_get_rtc_time() * ((cal >> 12) * 1000 + (cal & 0x0) / 4) / 1000;
+    return system_get_rtc_time() * ((cal >> 12) * 1000 + (cal & 0xfff) / 4) / 1000;
 };
 
 void pyb_rtc_set_us_since_2000(uint64_t nowus) {
-- 
GitLab