I'm trying to get a simple, single shot timer working. The debugger never stops at a breakpoint set in my handler function, and an LED turned on in that function never lights. In main.c, adapted from the BLE proximity sample app:
#define TEST_TIMEOUT APP_TIMER_TICKS(5000, 0)
static app_timer_id_t m_test_timeout_timer_id;
static uint8_t m_test_timed_out = 0;
void timeout_handler(void * p_context)
{
UNUSED_PARAMETER(p_context);
m_test_timed_out = 1;
nrf_gpio_pin_set(LED_0);
}
int main(void)
{
uint32_t err_code;
leds_init();
timers_init();
m_test_timed_out = 0;
err_code = app_timer_create(&m_test_timeout_timer_id, APP_TIMER_MODE_SINGLE_SHOT, timeout_handler);
APP_ERROR_CHECK(err_code);
err_code = app_timer_start(m_test_timeout_timer_id, TEST_TIMEOUT, NULL);
APP_ERROR_CHECK(err_code);
for (;;)
{
power_manage();
}
}
What am I doing wrong here? This is using Soft Device 6.0.0.