|
@ -403,7 +403,7 @@ void hwss_init(void) { |
|
|
*/ |
|
|
*/ |
|
|
nrfx_err_t err; |
|
|
nrfx_err_t err; |
|
|
nrfx_timer_config_t timer_cfg = { |
|
|
nrfx_timer_config_t timer_cfg = { |
|
|
.frequency = NRF_TIMER_FREQ_125kHz, |
|
|
|
|
|
|
|
|
.frequency = NRF_TIMER_FREQ_250kHz, |
|
|
.mode = NRF_TIMER_MODE_TIMER, |
|
|
.mode = NRF_TIMER_MODE_TIMER, |
|
|
.bit_width = NRF_TIMER_BIT_WIDTH_24, |
|
|
.bit_width = NRF_TIMER_BIT_WIDTH_24, |
|
|
.p_context = NULL, |
|
|
.p_context = NULL, |
|
@ -417,6 +417,7 @@ void hwss_init(void) { |
|
|
|
|
|
|
|
|
ZASSERT(SAMPLE_RATE == 400); |
|
|
ZASSERT(SAMPLE_RATE == 400); |
|
|
uint32_t timer_ticks = nrfx_timer_ms_to_ticks(&m_timer, 5); // 200HZ |
|
|
uint32_t timer_ticks = nrfx_timer_ms_to_ticks(&m_timer, 5); // 200HZ |
|
|
|
|
|
ZLOGI("timer_ticks:%d\n", timer_ticks); |
|
|
ZASSERT(timer_ticks % 2 == 0); // |
|
|
ZASSERT(timer_ticks % 2 == 0); // |
|
|
timer_ticks = timer_ticks / 2; // 400HZ |
|
|
timer_ticks = timer_ticks / 2; // 400HZ |
|
|
nrfx_timer_extended_compare(&m_timer, NRF_TIMER_CC_CHANNEL0, timer_ticks, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true); |
|
|
nrfx_timer_extended_compare(&m_timer, NRF_TIMER_CC_CHANNEL0, timer_ticks, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true); |
|
|