changed void* cast to QueueHandle_t cast

This commit is contained in:
Robin Müller 2020-05-14 16:12:01 +02:00
parent 50a1b5170a
commit 49fa2fe32c
2 changed files with 7 additions and 4 deletions

View File

@ -120,7 +120,7 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo,
message->setSender(sentFrom); message->setSender(sentFrom);
BaseType_t result; BaseType_t result;
if(callContext == CallContext::task) { if(callContext == CallContext::task) {
result = xQueueSendToBack(reinterpret_cast<void*>(sendTo), result = xQueueSendToBack(reinterpret_cast<QueueHandle_t>(sendTo),
reinterpret_cast<const void*>(message->getBuffer()), 0); reinterpret_cast<const void*>(message->getBuffer()), 0);
} }
else { else {
@ -128,7 +128,7 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo,
// request a context switch if a higher priority task // request a context switch if a higher priority task
// was blocked by the interrupt. // was blocked by the interrupt.
BaseType_t xHigherPriorityTaskWoken = pdFALSE; BaseType_t xHigherPriorityTaskWoken = pdFALSE;
result = xQueueSendFromISR(reinterpret_cast<void*>(sendTo), result = xQueueSendFromISR(reinterpret_cast<QueueHandle_t>(sendTo),
reinterpret_cast<const void*>(message->getBuffer()), reinterpret_cast<const void*>(message->getBuffer()),
&xHigherPriorityTaskWoken); &xHigherPriorityTaskWoken);
if(xHigherPriorityTaskWoken == pdTRUE) { if(xHigherPriorityTaskWoken == pdTRUE) {

View File

@ -6,8 +6,11 @@
#include <framework/ipc/MessageQueueMessage.h> #include <framework/ipc/MessageQueueMessage.h>
#include <framework/osal/FreeRTOS/TaskManagement.h> #include <framework/osal/FreeRTOS/TaskManagement.h>
#include <FreeRTOS.h> extern "C" {
#include "queue.h" #include "FreeRTOS.h"
#include "freertos/queue.h"
}
//TODO this class assumes that MessageQueueId_t is the same size as void* (the FreeRTOS handle type), compiler will catch this but it might be nice to have something checking or even an always working solution //TODO this class assumes that MessageQueueId_t is the same size as void* (the FreeRTOS handle type), compiler will catch this but it might be nice to have something checking or even an always working solution