mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-09 23:57:49 -04:00
add API xMessageBufferResetFromISR
Allow reseting the stream buffer from ISR context Signed-off-by: hagai.moshe <hagaimoshe@outlook.com>
This commit is contained in:
parent
887e78c64f
commit
bfd3f8ee3d
1 changed files with 28 additions and 0 deletions
|
@ -785,6 +785,34 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
|||
xStreamBufferReset( xMessageBuffer )
|
||||
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
* @code{c}
|
||||
* BaseType_t xMessageBufferResetFromISR( MessageBufferHandle_t xMessageBuffer );
|
||||
* @endcode
|
||||
*
|
||||
* An interrupt safe version of the API function that reset the stream buffer.
|
||||
* Resets a message buffer to its initial empty state, discarding any message it
|
||||
* contained.
|
||||
*
|
||||
* A message buffer can only be reset if there are no tasks blocked on it.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferResetFromISR() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the message buffer being reset.
|
||||
*
|
||||
* @return If the message buffer was reset then pdPASS is returned. If the
|
||||
* message buffer could not be reset because either there was a task blocked on
|
||||
* the message queue to wait for space to become available, or to wait for a
|
||||
* a message to be available, then pdFAIL is returned.
|
||||
*
|
||||
* \defgroup xMessageBufferResetFromISR xMessageBufferResetFromISR
|
||||
* \ingroup MessageBufferManagement
|
||||
*/
|
||||
#define xMessageBufferResetFromISR( xMessageBuffer ) \
|
||||
xStreamBufferResetFromISR( xMessageBuffer )
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
* @code{c}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue