This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Do we need to define NRFX_TIMER1_ENABLED inorder to use TIMER1 ?

Hello , 

Do we need to use TIMER1 ,2etc.. to use TIMER1 ? In my current configuration i have set NRFX_TIMER_ENABLED to 1 and others to 0 "NRFX_TIMER0_ENABLED and other instances";

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef NRFX_TIMER_ENABLED
#define NRFX_TIMER_ENABLED 1
#endif
// <q> NRFX_TIMER0_ENABLED - Enable TIMER0 instance
#ifndef NRFX_TIMER0_ENABLED
#define NRFX_TIMER0_ENABLED 0
#endif
// <q> NRFX_TIMER1_ENABLED - Enable TIMER1 instance
#ifndef NRFX_TIMER1_ENABLED
#define NRFX_TIMER1_ENABLED 0
#endif
// <q> NRFX_TIMER2_ENABLED - Enable TIMER2 instance
#ifndef NRFX_TIMER2_ENABLED
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

But i can able to use any TIMER without a problem by using nrf libraries , for exmp:  

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
static const nrf_drv_timer_t m_timer2 = NRF_DRV_TIMER_INSTANCE(2);
...
err_code = nrf_drv_timer_init(&m_timer2, &timer_cfg, timer2_handler);
APP_ERROR_CHECK(err_code);
nrf_drv_timer_compare(&m_timer2,
NRF_TIMER_CC_CHANNEL0,
SAMPLES_IN_BUFFER/2,
true);
nrf_drv_timer_extended_compare(&m_timer2,
NRF_TIMER_CC_CHANNEL1,
SAMPLES_IN_BUFFER,
NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK,
false);
...
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Do we need to define NRFX_TIMER1_ENABLED inorder to use TIMER1,2,... by nrf libraries ?  Or are these definitions belongs to some old SDKs ?

BR/