Hi, the idea is to toggle green led using scheduler without SD
β¦
void change_mode(void* data, uint16_t length)
{
nrf_gpio_pin_toggle(LED_GREEN);
}
ret_code_t button_press_handler(const ruuvi_standard_message_t message)
{
app_sched_event_put (NULL, 0,change_mode);
return NRF_SUCCESS;
}
static void power_manage(void)
{
sd_app_evt_wait();
watchdog_feed();
}
int main(void)
{
init_watchdog(NULL);
init_leds();
nrf_gpio_pin_clear(LED_RED);
//Button press: Start interrupts first and Initialize button.
pin_interrupt_init();
pin_interrupt_enable(BSP_BUTTON_0, NRF_GPIOTE_POLARITY_HITOLO, button_press_handler);
//timers_init();
APP_TIMER_APPSH_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, true);
//scheduler_init();
APP_SCHED_INIT(SCHED_MAX_EVENT_DATA_SIZE, SCHED_QUEUE_SIZE);
// Enter main loop.
for (;;)
{
app_sched_execute();
power_manage();
}
}