...
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.
TODO (WIP)
Code Block | ||||
---|---|---|---|---|
| ||||
//=========================== variables =======================================
#ifdef USE_FREERTOS
#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
|
Compiling FreeRTOS in OpenWSN
In order to enable FreeRTOS kernel in OpenWSN a compilation options have been added to the Scons build option.
Info |
---|
$>scons board=OpenMote-CC2538 toolchain=armgcc kernel=freertos oos_openwsn |
By now FreeRTOS is only supported by those boards with enough memory footprint.