NRF52_DK: Use 32 bit counter for us ticker (instead 16 bit counter)

pull/7375/head
Przemyslaw Stekiel 2018-05-23 10:23:55 +02:00 committed by adbridge
parent fa8ceef3bb
commit ae5848e29a
2 changed files with 4 additions and 4 deletions

View File

@ -77,7 +77,7 @@ void us_ticker_init(void)
nrf_timer_frequency_set(NRF_TIMER1, NRF_TIMER_FREQ_1MHz);
nrf_timer_bit_width_set(NRF_TIMER1, NRF_TIMER_BIT_WIDTH_16);
nrf_timer_bit_width_set(NRF_TIMER1, NRF_TIMER_BIT_WIDTH_32);
nrf_timer_cc_write(NRF_TIMER1, NRF_TIMER_CC_CHANNEL0, 0);
@ -110,7 +110,7 @@ void us_ticker_set_interrupt(timestamp_t timestamp)
{
core_util_critical_section_enter();
nrf_timer_cc_write(NRF_TIMER1, NRF_TIMER_CC_CHANNEL0, timestamp & 0xFFFF);
nrf_timer_cc_write(NRF_TIMER1, NRF_TIMER_CC_CHANNEL0, timestamp);
if (!nrf_timer_int_enable_check(NRF_TIMER1, nrf_timer_compare_int_get(NRF_TIMER_CC_CHANNEL0))) {
nrf_timer_event_clear(NRF_TIMER1, NRF_TIMER_EVENT_COMPARE0);

View File

@ -18,9 +18,9 @@
#define US_TICKER_H
/* TIMER0 is reserved for SoftDevice. We will use TIMER1 for us ticker
* which counter size is 16 bits. */
* which counter size is 32 bits. */
#define US_TICKER_COUNTER_BITS 16u
#define US_TICKER_COUNTER_BITS 32u
#define US_TICKER_FREQ 1000000
#endif // US_TICKER_H