mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Revision:
188:bcfe06ba3d64
Parent:
187:0387e8f68319
Child:
189:f392fc9709a3
--- a/platform/mbed_rtc_time.cpp	Thu Sep 06 13:40:20 2018 +0100
+++ b/platform/mbed_rtc_time.cpp	Thu Nov 08 11:46:34 2018 +0000
@@ -33,6 +33,8 @@
 
 #include "drivers/LowPowerTimer.h"
 
+#define US_PER_SEC 1000000
+
 static SingletonPtr<mbed::LowPowerTimer> _rtc_lp_timer;
 static uint64_t _rtc_lp_base;
 static bool _rtc_enabled;
@@ -50,7 +52,7 @@
 
 static time_t _rtc_lpticker_read(void)
 {
-    return (uint64_t)_rtc_lp_timer->read() + _rtc_lp_base;
+    return _rtc_lp_timer->read_high_resolution_us() / US_PER_SEC + _rtc_lp_base;
 }
 
 static void _rtc_lpticker_write(time_t t)