FreeRTOS Improvements #82

Closed
muellerr wants to merge 24 commits from KSat:mueller_FreeRTOS_improvements into master
3 changed files with 7 additions and 1 deletions
Showing only changes of commit c2d758eb96 - Show all commits

View File

@ -1,6 +1,8 @@
#include <framework/osal/FreeRTOS/CountingSemaphore.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
// Make sure #define configUSE_COUNTING_SEMAPHORES 1 is set in
// free FreeRTOSConfig.h file.
CountingSemaphore::CountingSemaphore(uint8_t count, uint8_t initCount):
count(count), initCount(initCount) {
handle = xSemaphoreCreateCounting(count, initCount);

View File

@ -4,6 +4,8 @@
#include <framework/serviceinterface/ServiceInterfaceStream.h>
SemaphoreFactory* SemaphoreFactory::factoryInstance = nullptr;
const uint32_t SemaphoreIF::NO_TIMEOUT = 0;
const uint32_t SemaphoreIF::MAX_TIMEOUT = portMAX_DELAY;
SemaphoreFactory::SemaphoreFactory() {
}

View File

@ -20,8 +20,10 @@
class SemaphoreIF {
public:
virtual~ SemaphoreIF() {};
//!< Needs to be defined in implementation.
//! Needs to be defined in implementation. No blocking time
static const uint32_t NO_TIMEOUT;
//! Needs to be defined in implementation. Blocks indefinitely.
static const uint32_t MAX_TIMEOUT;
static const uint8_t INTERFACE_ID = CLASS_ID::SEMAPHORE_IF;
//! Semaphore timeout
static constexpr ReturnValue_t SEMAPHORE_TIMEOUT = MAKE_RETURN_CODE(1);