Hello everyone,
I've got strange behavior coming out of my app timer.
I'm using the timer to periodically turn on or off some LED's and since each LED pattern is different I want to incorporate a counter to set different stages of my pattern.
Now comes the fun part
I have set breakpoints on my counter and I see that it increments, but the next time it enters the handler the counter is reset and it is incremented to 1 again.
Other times the upper 8 bits of the variable are set and it doesn't want to count.
static void DeviceLedHandler(void * p_context) { static uint16_t counter = 0; counter++; }
Even if I declare the counter globally it still shows the same behavior.
I do have a second app timer running as well but to my knowledge this shouldn't make a difference.
This is my declaration
APP_TIMER_DEF(m_DeviceLeds_timer); APP_ERROR_CHECK(app_timer_create(&m_DeviceLeds_timer, APP_TIMER_MODE_REPEATED, DeviceLedHandler)); APP_ERROR_CHECK(app_timer_start(m_DeviceLeds_timer, APP_TIMER_TICKS(2.5), NULL));
PCA10056 S140
Anyone got a clue what is going on here?