FreeRTOS: Improvements #55
Issue for several freeRTOS improvements:
Semaphore class for FreeRTOS.
Has been implemented. It would make sense to create a Semaphore factory, interface, and implement it for the other OSes as well. There are binary and counting semaphores, for now I implemented the binary semaphore. Tied to the new TaskManagement helper functions (see 3.)
ISR calls for Message Queue
Simple version implemented. Requires switchting contex manually.
Tied to new TaskManagement functions (3.).
Also implemented a new cast for the xQueueSendToBack: Uses a cast to QueueHandle_t instead of void* , new FreeRTOS functions don't use a void* cast anymore but a special Queuedefinition struct pointer cast. The QueueHandle_t cast should be compatible to older FreeRTOS versions as long as as the respective downwards compatibility configuration define in the freeRTOS config file is set to one
Task Management Helper functions.
- FreeRTOS has different functions calls depending on whether a function is to be called from an ISR or a task.
- When using interrupts, a context switch has to be requested in some cases, but the right function call has to be used.
THere is no reliable way in FreeRTOS to get the current task context (ISR or Task) for every architecture and some of those function calls are also architecture dependant, so a general way to get this context is to ask it from the developer. This is how ISIS does it.
- For that reason, I implemented a TaskManagement function, which requests a context switch and calls different FreeRTOS functions depending on the call context supplied. However, maybe it would be better to declare this function external and define it in the bsp. The function call is located in "portmacro.h", which depends on the architecture used.
Also see here:
UPDATE: The pull request does it like that now: function call is external and has to be implemented by developer when starting new freeRTOS project. This generally involves looking for the function call in the partmacro.h file. This is small hassle but keeps the osal separated from the architecture.
The TaskManagement helpers also are wrappers to ensure abstracton of certain OSAL features:
- Requesting a context switch: explicit named function which calls vTaskDelay(0)
- Function to request stack high watermark and get TaskHandle.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?