Skip to content

Commit

Permalink
Merge pull request #8165 from mprse/issue_8155_fix
Browse files Browse the repository at this point in the history
Fix for issue #8155 (NRF52832: time stops after 35 minutes)
  • Loading branch information
0xc0170 authored Sep 24, 2018
2 parents b5ee0c0 + 814940c commit ac6ca73
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit ac6ca73

Please sign in to comment.