1 #include <twr_scheduler.h>
2 #include <twr_system.h>
9 void application_init(
void);
11 void application_task(
void *param);
13 void application_error(twr_error_t code);
33 __attribute__((weak))
void application_init(
void)
37 __attribute__((weak))
void application_task(
void *param)
42 __attribute__((weak))
void application_idle()
47 __attribute__((weak))
void application_error(twr_error_t code)
72 case TWR_ERROR_NOT_ENOUGH_TASKS:
77 case TWR_ERROR_LOG_NOT_INITIALIZED:
82 case TWR_ERROR_ERROR_UNLOCK:
87 case TWR_ERROR_CALLBACK:
92 case TWR_ERROR_INVALID_PARAMETER:
106 timeout =
twr_tick_get() + ((cnt > 1 && cnt < 5) ? 1000 : 300);
131 void NMI_Handler(
void)
135 void SVC_Handler(
void)
139 void PendSV_Handler(
void)
143 void SysTick_Handler(
void)
146 HAL_SYSTICK_IRQHandler();
void twr_gpio_set_output(twr_gpio_channel_t channel, int state)
Set output state for GPIO channel.
void twr_gpio_set_mode(twr_gpio_channel_t channel, twr_gpio_mode_t mode)
Set mode of operation for GPIO channel.
@ TWR_GPIO_MODE_OUTPUT
GPIO channel operates as output.
@ TWR_GPIO_LED
GPIO channel LED.
void void void void void twr_log_error(const char *format,...) __attribute__((format(printf
Log ERROR message (annotated in log as <E>)
void twr_log_init(twr_log_level_t level, twr_log_timestamp_t timestamp)
Initialize logging facility.
@ TWR_LOG_LEVEL_DEBUG
Log level DEBUG.
@ TWR_LOG_TIMESTAMP_ABS
Timestamp logging enabled (absolute time format)
void twr_scheduler_run(void)
Run task scheduler (this call never ends)
void twr_scheduler_init(void)
Initialize task scheduler.
twr_scheduler_task_id_t twr_scheduler_register(void(*task)(void *), void *param, twr_tick_t tick)
Register task in scheduler.
twr_tick_t twr_tick_get(void)
Get absolute timestamp since start of program.
uint64_t twr_tick_t
Timestamp data type.