FSFW Restructuring #445

Merged
mohr merged 77 commits from mueller/restructuring into development 2021-08-09 16:00:27 +02:00
2 changed files with 7 additions and 2 deletions
Showing only changes of commit 3c4289335e - Show all commits

View File

@ -39,7 +39,8 @@ private:
QueueMapManager();
~QueueMapManager();
uint32_t queueCounter = 0;
// Start at 1 because 0 might be the NO_QUEUE value
uint32_t queueCounter = 1;
MutexIF* mapLock;
QueueMap queueMap;
static QueueMapManager* mqManagerInstance;

View File

@ -17,7 +17,11 @@ QueueMapManager* QueueMapManager::instance() {
ReturnValue_t QueueMapManager::addMessageQueue(QueueHandle_t queue, MessageQueueId_t* id) {
MutexGuard lock(mapLock);
uint32_t currentId = ++queueCounter;
uint32_t currentId = queueCounter++;
if(currentId == MessageQueueIF::NO_QUEUE) {
// Skip the NO_QUEUE value
currentId = queueCounter++;
}
auto returnPair = queueMap.emplace(currentId, queue);
if(not returnPair.second) {
#if FSFW_CPP_OSTREAM_ENABLED == 1