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;
2929
3030uint32_t millis ( void )
3131{
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 );
3333
3434 return (ticks * 1000 ) / 32768 ;
3535}
3636
3737uint32_t micros ( void )
3838{
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 );
4040
4141 return (ticks * 1000000 ) / 32768 ;
4242}
Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ void init( void )
3535 NRF_CLOCK -> TASKS_LFCLKSTART = 1UL ;
3636
3737 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 ;
4040 NRF_RTC1 -> TASKS_START = 1 ;
4141}
4242
4343#ifdef __cplusplus
4444}
45- #endif
45+ #endif
You can’t perform that action at this time.
0 commit comments