- Rework the StaticAllocation.c common demo file to reflect the changes to the static allocation object create functions from the previous check-in.
- Correct various typos in comments. - Add xTimerGetPeriod() function (feature request).
This commit is contained in:
@ -329,7 +329,7 @@ volatile uint32_t ulSetToNonZeroInDebuggerToContinue = 0;
|
||||
( void ) ulLine;
|
||||
( void ) pcFileName;
|
||||
|
||||
printf( "ASSERT! Line %d, file %s\r\n", ulLine, pcFileName );
|
||||
printf( "ASSERT! Line %d, file %s, GetLastError() %d\r\n", ulLine, pcFileName, GetLastError() );
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
@ -410,38 +410,51 @@ const HeapRegion_t xHeapRegions[] =
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an
|
||||
implementation of vApplicationGetIdleTaskMemory() to provide the memory that is
|
||||
used by the Idle task. */
|
||||
void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint16_t *pusIdleTaskStackSize )
|
||||
{
|
||||
/* The buffers used by the idle task must be static so they are persistent, and
|
||||
so exist after this function returns. */
|
||||
/* If the buffers to be provided to the Idle task are declared inside this
|
||||
function then they must be declared static - otherwise they will be allocated on
|
||||
the stack and so not exists after this function exits. */
|
||||
static StaticTask_t xIdleTaskTCB;
|
||||
static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
|
||||
|
||||
/* configUSE_STATIC_ALLOCATION is set to 1, so the application has the
|
||||
opportunity to supply the buffers that will be used by the Idle task as its
|
||||
stack and to hold its TCB. If these are set to NULL then the buffers will
|
||||
be allocated dynamically, just as if xTaskCreate() had been called. */
|
||||
/* Pass out a pointer to the StaticTask_t structure in which the Idle task's
|
||||
state will be stored. */
|
||||
*ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
|
||||
|
||||
/* Pass out the array that will be used as the Idle task's stack. */
|
||||
*ppxIdleTaskStackBuffer = uxIdleTaskStack;
|
||||
*pusIdleTaskStackSize = configMINIMAL_STACK_SIZE; /* In words. NOT in bytes! */
|
||||
|
||||
/* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer.
|
||||
Note that, as the array is necessarily of type StackType_t,
|
||||
configMINIMAL_STACK_SIZE is specified in words, not bytes. */
|
||||
*pusIdleTaskStackSize = configMINIMAL_STACK_SIZE;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* configUSE_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the
|
||||
application must provide an implementation of vApplicationGetTimerTaskMemory()
|
||||
to provide the memory that is used by the Timer service task. */
|
||||
void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint16_t *pusTimerTaskStackSize )
|
||||
{
|
||||
/* The buffers used by the Timer/Daemon task must be static so they are
|
||||
persistent, and so exist after this function returns. The stack buffer is
|
||||
not declared here, but globally, as it is checked by a test in a different
|
||||
file. */
|
||||
/* If the buffers to be provided to the Timer task are declared inside this
|
||||
function then they must be declared static - otherwise they will be allocated on
|
||||
the stack and so not exists after this function exits. */
|
||||
static StaticTask_t xTimerTaskTCB;
|
||||
|
||||
/* configUSE_STATIC_ALLOCATION is set to 1, so the application has the
|
||||
opportunity to supply the buffers that will be used by the Timer/RTOS daemon
|
||||
task as its stack and to hold its TCB. If these are set to NULL then the
|
||||
buffers will be allocated dynamically, just as if xTaskCreate() had been
|
||||
called. */
|
||||
/* Pass out a pointer to the StaticTask_t structure in which the Timer
|
||||
task's state will be stored. */
|
||||
*ppxTimerTaskTCBBuffer = &xTimerTaskTCB;
|
||||
|
||||
/* Pass out the array that will be used as the Timer task's stack. */
|
||||
*ppxTimerTaskStackBuffer = uxTimerTaskStack;
|
||||
*pusTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH; /* In words. NOT in bytes! */
|
||||
|
||||
/* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer.
|
||||
Note that, as the array is necessarily of type StackType_t,
|
||||
configMINIMAL_STACK_SIZE is specified in words, not bytes. */
|
||||
*pusTimerTaskStackSize = configMINIMAL_STACK_SIZE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user