In the "sdk_config.h",there has two options, one is TIMER_ENABLED,the other is NRFX_TIMER_ENABLED, and in the sample ,there also have"nrf_drv_time" ,what's the difference? I so confused!
In the "sdk_config.h",there has two options, one is TIMER_ENABLED,the other is NRFX_TIMER_ENABLED, and in the sample ,there also have"nrf_drv_time" ,what's the difference? I so confused!
nrfx_* is the new way of interacting with the peripherals. It used to be through nrf_drv_*. I would advise to use nrfx_* calls for new sotftware.
If you take a look at the file nrf_drv_timer.h, you'll see that nrf_drv_* function are translated to nrfx_* functions.
NRFX_TIMER_ENABLED is mandatory if you want to have the nrfx_timer functions in the compilations units. See that line in nrfx_timer.c:
#if NRFX_CHECK(NRFX_TIMER_ENABLED)
Best of luck
Thanks very much! I have other question , if I want to use the "NRFX_TIMER_ENABLED",I put it as 1, when I compile,the error is tell me "the TIMER_ENABLED don't be set",so could I think: if I want to use timer ,I must choose TIMER and NRFX_TIMER ,is't right?
I guess you use apply_old_config.h somewhere.
Take a look at these lines where NRFX_TIMER_ENABLED is redefined and TIMER_ENABLED is used instead:
#if defined(TIMER_ENABLED)
#undef NRFX_TIMER_ENABLED
#define NRFX_TIMER_ENABLED TIMER_ENABLED
You can either remove inclusion of apply_old_config.h or also use TIMER_ENABLED macro, set to 1