Skip to content

Fix for issue #8155 (NRF52832: time stops after 35 minutes) #8165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion platform/mbed_rtc_time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ static void (*_rtc_write)(time_t t) = rtc_write;

#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;
Expand All @@ -50,7 +52,7 @@ static int _rtc_lpticker_isenabled(void)

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)
Expand Down