File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -29,14 +29,14 @@ static volatile uint32_t overflows = 0;
29
29
30
30
uint32_t millis ( void )
31
31
{
32
- uint64_t ticks = (uint64_t )((uint64_t )overflows << (uint64_t )32 ) | (uint64_t )(NRF_RTC1 -> COUNTER );
32
+ uint64_t ticks = (uint64_t )((uint64_t )overflows << (uint64_t )24 ) | (uint64_t )(NRF_RTC1 -> COUNTER );
33
33
34
34
return (ticks * 1000 ) / 32768 ;
35
35
}
36
36
37
37
uint32_t micros ( void )
38
38
{
39
- uint64_t ticks = (uint64_t )((uint64_t )overflows << (uint64_t )32 ) | (uint64_t )(NRF_RTC1 -> COUNTER );
39
+ uint64_t ticks = (uint64_t )((uint64_t )overflows << (uint64_t )24 ) | (uint64_t )(NRF_RTC1 -> COUNTER );
40
40
41
41
return (ticks * 1000000 ) / 32768 ;
42
42
}
Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ void init( void )
35
35
NRF_CLOCK -> TASKS_LFCLKSTART = 1UL ;
36
36
37
37
NRF_RTC1 -> PRESCALER = 0 ;
38
- NRF_RTC1 -> EVTENSET = offsetof( NRF_RTC_Type , EVENTS_OVRFLW ) ;
39
- NRF_RTC1 -> INTENSET = offsetof( NRF_RTC_Type , EVENTS_OVRFLW ) ;
38
+ NRF_RTC1 -> EVTENSET = RTC_INTENSET_OVRFLW_Msk ;
39
+ NRF_RTC1 -> INTENSET = RTC_EVTEN_OVRFLW_Msk ;
40
40
NRF_RTC1 -> TASKS_START = 1 ;
41
41
}
42
42
43
43
#ifdef __cplusplus
44
44
}
45
- #endif
45
+ #endif
You can’t perform that action at this time.
0 commit comments