mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Merge pull request #8165 from mprse/issue_8155_fix
Fix for issue #8155 (NRF52832: time stops after 35 minutes)pull/8230/head
						commit
						ac6ca73dd8
					
				| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue