From 49fa2fe32c6bfc4fba6fc91e8cbf564eb7532658 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Thu, 14 May 2020 16:12:01 +0200 Subject: [PATCH] changed void* cast to QueueHandle_t cast --- osal/FreeRTOS/MessageQueue.cpp | 4 ++-- osal/FreeRTOS/MessageQueue.h | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/osal/FreeRTOS/MessageQueue.cpp b/osal/FreeRTOS/MessageQueue.cpp index e7de799c..aa4b93b7 100644 --- a/osal/FreeRTOS/MessageQueue.cpp +++ b/osal/FreeRTOS/MessageQueue.cpp @@ -120,7 +120,7 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo, message->setSender(sentFrom); BaseType_t result; if(callContext == CallContext::task) { - result = xQueueSendToBack(reinterpret_cast(sendTo), + result = xQueueSendToBack(reinterpret_cast(sendTo), reinterpret_cast(message->getBuffer()), 0); } else { @@ -128,7 +128,7 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo, // request a context switch if a higher priority task // was blocked by the interrupt. BaseType_t xHigherPriorityTaskWoken = pdFALSE; - result = xQueueSendFromISR(reinterpret_cast(sendTo), + result = xQueueSendFromISR(reinterpret_cast(sendTo), reinterpret_cast(message->getBuffer()), &xHigherPriorityTaskWoken); if(xHigherPriorityTaskWoken == pdTRUE) { diff --git a/osal/FreeRTOS/MessageQueue.h b/osal/FreeRTOS/MessageQueue.h index 27076869..d8a307ea 100644 --- a/osal/FreeRTOS/MessageQueue.h +++ b/osal/FreeRTOS/MessageQueue.h @@ -6,8 +6,11 @@ #include #include -#include -#include "queue.h" +extern "C" { +#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