Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


xQueueRemoveItem modifications

Posted by glenenglish on September 3, 2016

xQueueRemoveItem does not exist. (but would be useful)

This is a function I need in the case where I just want to pull an item off the queue and discard it - IE I dont want to copy it or do anything with it. This is a case where I am trying to maintain a filling level of buffers to 50% (remove for packets to dry up, or flood in ) . I pass a NULL pointer to QueueReceive() instead

I modified prvCopyDataFromQueue to not call MEMCPY if pvBuffer was NULL;

and in xQueueGenericReceive I also removed the assert check for pvBuffer == NULL

This of course could be dangerous for callers that do not intentionally set pvBuffer to NULL... I could copy the fn with some different params.


xQueueRemoveItem modifications

Posted by rtel on September 3, 2016

At the moment the convoluted asserts in some of the queue functions are designed to only allow you to pass in a null pointer if the queue is in fact a semaphore (semaphores not having any data associated with them - only the count is of interest).

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner