Quality RTOS & Embedded Software

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




Loading

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.

glen


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 ]    [ Sitemap ]    [ ]




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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