FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [April 2008 Threads] xQueueGenericReceive pvBuffer is const?Posted by Phil on April 9, 2008 I'm using FreeRTOS for a new, ARM-based project. As part of the initial stages I've been putting together a shim to allow PC-based code development to the FreeRTOS API, using wrappers around pthreads library calls for the task/queue implementation.
One of several potential issue I've found is that the output pvBuffer parameter passed to xQueueGenericReceive() is, it would appear, incorrectly declared as a const pointer to const data. In the API documentation, xQueueReceive()/xQueuePeek() take a void* (although it should probably be a const pointer to non-const data).
As a result, the implementation of xQueueGenericReceive() has to do some casts in the memcpy() call. Am I correct in assuming this is by oversight rather than design?
Regards, Phil
RE: xQueueGenericReceive pvBuffer is const?Posted by Richard on April 9, 2008 It is a legacy thing of trying to compile with many different compilers while simultaneously attempting to get lint to shut up. It is basically nonsense and was removed from the SafeRTOS code. It is my intention to remove it from the FreeRTOS.org code too but it has not caught up quite yet.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|