mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-31 07:28:37 -04:00
Notes:
+ The MPU port is not supported in this revision number. + The documentation for the static allocation functions in the header files has not yet been updated for this revision. Kernel updates: + Simplify the static allocation of objects implementation. + Introduce configSUPPORT_DYNAMIC_ALLOCATION in addition to the existing configSUPPORT_STATIC_ALLOCATION so FreeRTOS can be built without providing a heap at all. Demo application updates: + Update the demos to take into account the new configSUPPORT_DYNAMIC_ALLOCATION constant. + Add an MSVC demo that only uses static allocation, and does not include a FreeRTOS heap. + Update the MSVC project to use both configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION. + Update the MingW project to use only configSUPPORT_DYNAMIC_ALLOCATION.
This commit is contained in:
parent
283bc18d23
commit
6568ba6eb0
50 changed files with 2350 additions and 3914 deletions
|
@ -398,13 +398,23 @@ uint32_t ulReturn;
|
|||
static void prvTestAbortingEventGroupWait( void )
|
||||
{
|
||||
TickType_t xTimeAtStart;
|
||||
static StaticEventGroup_t xEventGroupBuffer;
|
||||
EventGroupHandle_t xEventGroup;
|
||||
EventBits_t xBitsToWaitFor = ( EventBits_t ) 0x01, xReturn;
|
||||
|
||||
/* Create the event group. Statically allocated memory is used so the
|
||||
creation cannot fail. */
|
||||
xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer );
|
||||
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
{
|
||||
static StaticEventGroup_t xEventGroupBuffer;
|
||||
|
||||
/* Create the event group. Statically allocated memory is used so the
|
||||
creation cannot fail. */
|
||||
xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer );
|
||||
}
|
||||
#else
|
||||
{
|
||||
xEventGroup = xEventGroupCreate();
|
||||
configASSERT( xEventGroup );
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Note the time before the delay so the length of the delay is known. */
|
||||
xTimeAtStart = xTaskGetTickCount();
|
||||
|
@ -449,14 +459,25 @@ static void prvTestAbortingQueueSend( void )
|
|||
{
|
||||
TickType_t xTimeAtStart;
|
||||
BaseType_t xReturn;
|
||||
static StaticQueue_t xQueueBuffer;
|
||||
static uint8_t ucQueueStorage[ sizeof( uint8_t ) ], ucItemToQueue;
|
||||
const UBaseType_t xQueueLength = ( UBaseType_t ) 1;
|
||||
QueueHandle_t xQueue;
|
||||
uint8_t ucItemToQueue;
|
||||
|
||||
/* Create the queue. Statically allocated memory is used so the
|
||||
creation cannot fail. */
|
||||
xQueue = xQueueCreateStatic( xQueueLength, sizeof( uint8_t ), ucQueueStorage, &xQueueBuffer );
|
||||
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
{
|
||||
static StaticQueue_t xQueueBuffer;
|
||||
static uint8_t ucQueueStorage[ sizeof( uint8_t ) ];
|
||||
|
||||
/* Create the queue. Statically allocated memory is used so the
|
||||
creation cannot fail. */
|
||||
xQueue = xQueueCreateStatic( xQueueLength, sizeof( uint8_t ), ucQueueStorage, &xQueueBuffer );
|
||||
}
|
||||
#else
|
||||
{
|
||||
xQueue = xQueueCreate( xQueueLength, sizeof( uint8_t ) );
|
||||
configASSERT( xQueue );
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function tests aborting when in the blocked state waiting to send,
|
||||
so the queue must be full. There is only one space in the queue. */
|
||||
|
@ -509,12 +530,21 @@ static void prvTestAbortingSemaphoreTake( void )
|
|||
{
|
||||
TickType_t xTimeAtStart;
|
||||
BaseType_t xReturn;
|
||||
static StaticSemaphore_t xSemaphoreBuffer;
|
||||
SemaphoreHandle_t xSemaphore;
|
||||
|
||||
/* Create the semaphore. Statically allocated memory is used so the
|
||||
creation cannot fail. */
|
||||
xSemaphore = xSemaphoreCreateBinaryStatic( &xSemaphoreBuffer );
|
||||
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
{
|
||||
static StaticSemaphore_t xSemaphoreBuffer;
|
||||
|
||||
/* Create the semaphore. Statically allocated memory is used so the
|
||||
creation cannot fail. */
|
||||
xSemaphore = xSemaphoreCreateBinaryStatic( &xSemaphoreBuffer );
|
||||
}
|
||||
#else
|
||||
{
|
||||
xSemaphore = xSemaphoreCreateBinary();
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Note the time before the delay so the length of the delay is known. */
|
||||
xTimeAtStart = xTaskGetTickCount();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue