#include <stdlib.h>
#define CALLBACK_PERIOD_S 1
#define CALLBACK_PERIOD_MS (CALLBACK_PERIOD_S * 1000)
#define EXECUTION_TIME_US 100
static uint32_t blink_holdoff;
static uint32_t blink_func(void)
{
static uint32_t counter = 0;
if (blink_holdoff > 0)
{
blink_holdoff--;
}
else
{
uint32_t bits = counter;
for (uint_fast8_t led_id = 0; led_id < num_leds; led_id++)
{
bits >>= 1;
}
counter++;
}
return CALLBACK_PERIOD_MS;
}
static void button_press_func(uint8_t button_id,
button_event_e event)
{
(void) event;
blink_holdoff = 5;
}
static void button_release_func(uint8_t button_id,
button_event_e event)
{
(void) event;
blink_holdoff = 5;
}
{
(void) functions;
{
return;
}
for (uint_fast8_t button_id = 0; button_id < num_buttons; button_id++)
{
button_press_func);
button_release_func);
}
blink_holdoff = 0;
EXECUTION_TIME_US);
lib_state->startStack();
}
app_scheduler_res_e App_Scheduler_addTask_execTime(task_cb_f cb, uint32_t delay_ms, uint32_t exec_time_us)
Add a task.
#define APP_SCHEDULER_SCHEDULE_ASAP
Value to return from task or as initial time to be executed ASAP.
Board-independent LED functions.
led_res_e Led_set(uint8_t led_id, bool state)
Turn the given LED on or off.
uint8_t Led_getNumber(void)
Get number of leds available.
__STATIC_INLINE app_res_e configureNodeFromBuildParameters()
Wrapper on top of configureNode to get parameters from build system and hardcoded values from chip (f...
List of global functions, passed to App_entrypoint()