FreeRTOS: Update to r2536.

* Introduce sbBYTES_TO_STORE_MESSAGE_LENGTH

* Fix bug in ucStreamBufferGetStreamBufferType() - which is only used by the
  Percepio trace tool.

* Update the line within vTaskStartScheduler() that was setting xTickCount to 0
  to instead set it to configINITIAL_TICK_COUNT.

* Introduce xMessageBufferNextLengthBytes() and tests for the same.

* Add call to traceTASK_SWITCHED_IN() in vTaskStartScheduler() so trace tools
  can see the first task to run.

* Correct definition of StaticTask_t in the case that portUSE_MPU_WRAPPERS is
  set to 1.

* prvTaskCheckFreeStackSpace() now returns configSTACK_DEPTH_TYPE to allow
  return values greater than max uint16_t value if required.

* xStreamBufferSend() and xStreamBufferReceive() no longer clear task
  notification bits - clearing was unnecessary as only the task notification
  state is used.

* Correct out of date comment in tasks.c.

* Fix typo in comment in queue.h.
This commit is contained in:
Our Air Quality 2018-03-31 23:28:49 +11:00
parent a89417e26e
commit a6fa0ee497
11 changed files with 116 additions and 17 deletions

View file

@ -509,7 +509,7 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait, const BaseT
*/
#if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )
static uint16_t prvTaskCheckFreeStackSpace( const uint8_t * pucStackByte ) PRIVILEGED_FUNCTION;
static configSTACK_DEPTH_TYPE prvTaskCheckFreeStackSpace( const uint8_t * pucStackByte ) PRIVILEGED_FUNCTION;
#endif
@ -846,6 +846,8 @@ UBaseType_t x;
uxPriority &= ~portPRIVILEGE_BIT;
#endif /* portUSING_MPU_WRAPPERS == 1 */
configASSERT( pcName );
/* Avoid dependency on memset() if it is not required. */
#if( tskSET_NEW_STACKS_TO_KNOWN_VALUE == 1 )
{
@ -1982,7 +1984,7 @@ BaseType_t xReturn;
xNextTaskUnblockTime = portMAX_DELAY;
xSchedulerRunning = pdTRUE;
xTickCount = ( TickType_t ) 0U;
xTickCount = ( TickType_t ) configINITIAL_TICK_COUNT;
/* If configGENERATE_RUN_TIME_STATS is defined then the following
macro must be defined to configure the timer/counter used to generate
@ -1992,6 +1994,8 @@ BaseType_t xReturn;
FreeRTOSConfig.h file. */
portCONFIGURE_TIMER_FOR_RUN_TIME_STATS();
traceTASK_SWITCHED_IN();
/* Setting up the timer tick is hardware specific and thus in the
portable interface. */
if( xPortStartScheduler() != pdFALSE )
@ -2778,7 +2782,9 @@ BaseType_t xSwitchRequired = pdFALSE;
/* Save the hook function in the TCB. A critical section is required as
the value can be accessed from an interrupt. */
taskENTER_CRITICAL();
{
xTCB->pxTaskTag = pxHookFunction;
}
taskEXIT_CRITICAL();
}
@ -3474,7 +3480,7 @@ static void prvCheckTasksWaitingTermination( void )
{
TCB_t *pxTCB;
/* uxDeletedTasksWaitingCleanUp is used to prevent vTaskSuspendAll()
/* uxDeletedTasksWaitingCleanUp is used to prevent taskENTER_CRITICAL()
being called too often in the idle task. */
while( uxDeletedTasksWaitingCleanUp > ( UBaseType_t ) 0U )
{
@ -3625,7 +3631,7 @@ static void prvCheckTasksWaitingTermination( void )
#if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )
static uint16_t prvTaskCheckFreeStackSpace( const uint8_t * pucStackByte )
static configSTACK_DEPTH_TYPE prvTaskCheckFreeStackSpace( const uint8_t * pucStackByte )
{
uint32_t ulCount = 0U;
@ -3637,7 +3643,7 @@ static void prvCheckTasksWaitingTermination( void )
ulCount /= ( uint32_t ) sizeof( StackType_t ); /*lint !e961 Casting is not redundant on smaller architectures. */
return ( uint16_t ) ulCount;
return ( configSTACK_DEPTH_TYPE ) ulCount;
}
#endif /* ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) ) */