...
One interesting thing to do once a RTOS is supported is to have some application level tasks that handle the application activity without constraining the OpenWSN activity. This can be easily achived by letting the application to create a FreeRTOS task.
Code Block | ||||
---|---|---|---|---|
| ||||
//=========================== variables =======================================
#define tskUDPECHOAPP_PRIORITY configMAX_PRIORITIES - 4
TaskHandle_t xAppUechoHandle; // task
//=========================== prototypes ======================================
static void vUechoTask(void* pvParameters);
#endif
//=========================== public ==========================================
void uecho_init() {
#ifdef USE_FREERTOS
xTaskCreate(vUechoTask, "Uecho", 50, NULL, tskUDPECHOAPP_PRIORITY,
&(xAppUechoHandle));
#endif
}
#ifdef USE_FREERTOS
static void vUechoTask(void* pvParameters) {
uint8_t count = 0;
while (1) {
debugpins_fsm_toggle();
vTaskDelay(10000);
leds_debug_toggle();
udpecho_sendHello(count++);
}
}
#endif
|
TODO (WIP)