mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
Added xQueueSendToBack, xQueueSendToFront, xQueuePeek and xSemaphoreCreateMutex - along with GenQTest.c to demonstrate their usage.
This commit is contained in:
parent
ac14fdb0b7
commit
60338bd872
18 changed files with 2005 additions and 367 deletions
|
@ -89,7 +89,7 @@ Changes from V4.0.2
|
|||
#include "BlockQ.h"
|
||||
#include "print.h"
|
||||
|
||||
#define blckqSTACK_SIZE ( ( unsigned portSHORT ) 128 )
|
||||
#define blckqSTACK_SIZE ( ( unsigned portSHORT ) configMINIMAL_STACK_SIZE )
|
||||
#define blckqNUM_TASK_SETS ( 3 )
|
||||
|
||||
/* Structure used to pass parameters to the blocking queue tasks. */
|
||||
|
@ -215,7 +215,7 @@ portSHORT sErrorEverOccurred = pdFALSE;
|
|||
|
||||
for( ;; )
|
||||
{
|
||||
if( xQueueSend( pxQueueParameters->xQueue, ( void * ) &usValue, pxQueueParameters->xBlockTime ) != pdPASS )
|
||||
if( xQueueSendToBack( pxQueueParameters->xQueue, ( void * ) &usValue, pxQueueParameters->xBlockTime ) != pdPASS )
|
||||
{
|
||||
vPrintDisplayMessage( &pcTaskErrorMsg );
|
||||
sErrorEverOccurred = pdTRUE;
|
||||
|
|
|
@ -78,7 +78,7 @@ Changes from V2.0.0
|
|||
/* Demo program include files. */
|
||||
#include "PollQ.h"
|
||||
|
||||
#define pollqSTACK_SIZE ( ( unsigned portSHORT ) 128 )
|
||||
#define pollqSTACK_SIZE ( ( unsigned portSHORT ) configMINIMAL_STACK_SIZE )
|
||||
|
||||
/* The task that posts the incrementing number onto the queue. */
|
||||
static void vPolledQueueProducer( void *pvParameters );
|
||||
|
@ -125,7 +125,7 @@ portSHORT sError = pdFALSE;
|
|||
for( usLoop = 0; usLoop < usNumToProduce; ++usLoop )
|
||||
{
|
||||
/* Send an incrementing number on the queue without blocking. */
|
||||
if( xQueueSend( *pxQueue, ( void * ) &usValue, ( portTickType ) 0 ) != pdPASS )
|
||||
if( xQueueSendToBack( *pxQueue, ( void * ) &usValue, ( portTickType ) 0 ) != pdPASS )
|
||||
{
|
||||
/* We should never find the queue full - this is an error. */
|
||||
vPrintDisplayMessage( &pcTaskErrorMsg );
|
||||
|
|
|
@ -146,7 +146,7 @@ static void prvChangePriorityHelperTask( void *pvParameters );
|
|||
|
||||
|
||||
/* Demo task specific constants. */
|
||||
#define priSTACK_SIZE ( ( unsigned portSHORT ) 128 )
|
||||
#define priSTACK_SIZE ( ( unsigned portSHORT ) configMINIMAL_STACK_SIZE )
|
||||
#define priSLEEP_TIME ( ( portTickType ) 50 )
|
||||
#define priLOOPS ( 5 )
|
||||
#define priMAX_COUNT ( ( unsigned portLONG ) 0xff )
|
||||
|
@ -193,7 +193,7 @@ void vStartDynamicPriorityTasks( void )
|
|||
xTaskCreate( vQueueSendWhenSuspendedTask, "SUSP_SEND", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
|
||||
xTaskCreate( vQueueReceiveWhenSuspendedTask, "SUSP_RECV", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
|
||||
xTaskCreate( prvChangePriorityWhenSuspendedTask, "1st_P_CHANGE", priSTACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );
|
||||
xTaskCreate( prvChangePriorityHelperTask, "2nt_P_CHANGE", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, &xChangePriorityWhenSuspendedHandle );
|
||||
xTaskCreate( prvChangePriorityHelperTask, "2nd_P_CHANGE", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, &xChangePriorityWhenSuspendedHandle );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
#include "print.h"
|
||||
|
||||
/* Demo specific constants. */
|
||||
#define evtSTACK_SIZE ( ( unsigned portBASE_TYPE ) 128 )
|
||||
#define evtSTACK_SIZE ( ( unsigned portBASE_TYPE ) configMINIMAL_STACK_SIZE )
|
||||
#define evtNUM_TASKS ( 4 )
|
||||
#define evtQUEUE_LENGTH ( ( unsigned portBASE_TYPE ) 3 )
|
||||
#define evtNO_DELAY 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue