mirror of https://github.com/ARMmbed/mbed-os.git
NRF52_DK: Use 32 bit counter for us ticker (instead 16 bit counter)
parent
fa8ceef3bb
commit
ae5848e29a
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue