I am trying to use an application timer and I want to be able to reference the timer in another source file.
main.c
APP_TIMER_DEF(m_MSG_timer_id);
another.c
extern APP_TIMER_DEF(m_MSG_timer_id);
I am trying to use an application timer and I want to be able to reference the timer in another source file.
main.c
APP_TIMER_DEF(m_MSG_timer_id);
another.c
extern APP_TIMER_DEF(m_MSG_timer_id);
AFAIK, that macro declares a new variable with your name of type `app_timer_id_t`, so doing the `extern` here makes no sense. I would rather pass a pointer to `m_MSG_timer_id` to another.c through a function.
AFAIK, that macro declares a new variable with your name of type `app_timer_id_t`, so doing the `extern` here makes no sense. I would rather pass a pointer to `m_MSG_timer_id` to another.c through a function.
Ok,good point I wasn't thinking....last minute stuff haha....so as an example just do
app_timer_id_t *ptr_timer = m_MSG_timer_id?
Can't confirm, but I would think so :) `app_timer_id_t` is defined as `typedef app_timer_t * app_timer_id_t` https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fgroup__app__timer.html