Save local changes (4 yrs later)
This commit is contained in:
parent
4e9d7b1334
commit
8111d591cb
60 changed files with 2039 additions and 279 deletions
45
Middlewares/Third_Party/FreeRTOS/Source/timers.c
vendored
45
Middlewares/Third_Party/FreeRTOS/Source/timers.c
vendored
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* FreeRTOS Kernel V10.2.1
|
||||
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* FreeRTOS Kernel V10.3.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
@ -132,10 +132,10 @@ timer service task is allowed to access these lists.
|
|||
xActiveTimerList1 and xActiveTimerList2 could be at function scope but that
|
||||
breaks some kernel aware debuggers, and debuggers that reply on removing the
|
||||
static qualifier. */
|
||||
PRIVILEGED_DATA static List_t xActiveTimerList1 = { 0 };
|
||||
PRIVILEGED_DATA static List_t xActiveTimerList2 = { 0 };
|
||||
PRIVILEGED_DATA static List_t *pxCurrentTimerList = NULL;
|
||||
PRIVILEGED_DATA static List_t *pxOverflowTimerList = NULL;
|
||||
PRIVILEGED_DATA static List_t xActiveTimerList1;
|
||||
PRIVILEGED_DATA static List_t xActiveTimerList2;
|
||||
PRIVILEGED_DATA static List_t *pxCurrentTimerList;
|
||||
PRIVILEGED_DATA static List_t *pxOverflowTimerList;
|
||||
|
||||
/* A queue that is used to send commands to the timer service task. */
|
||||
PRIVILEGED_DATA static QueueHandle_t xTimerQueue = NULL;
|
||||
|
@ -182,7 +182,7 @@ static BaseType_t prvInsertTimerInActiveList( Timer_t * const pxTimer, const Tic
|
|||
|
||||
/*
|
||||
* An active timer has reached its expire time. Reload the timer if it is an
|
||||
* auto reload timer, then call its callback.
|
||||
* auto-reload timer, then call its callback.
|
||||
*/
|
||||
static void prvProcessExpiredTimer( const TickType_t xNextExpireTime, const TickType_t xTimeNow ) PRIVILEGED_FUNCTION;
|
||||
|
||||
|
@ -292,7 +292,7 @@ BaseType_t xReturn = pdFAIL;
|
|||
if( pxNewTimer != NULL )
|
||||
{
|
||||
/* Status is thus far zero as the timer is not created statically
|
||||
and has not been started. The autoreload bit may get set in
|
||||
and has not been started. The auto-reload bit may get set in
|
||||
prvInitialiseNewTimer. */
|
||||
pxNewTimer->ucStatus = 0x00;
|
||||
prvInitialiseNewTimer( pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, pxCallbackFunction, pxNewTimer );
|
||||
|
@ -334,7 +334,7 @@ BaseType_t xReturn = pdFAIL;
|
|||
{
|
||||
/* Timers can be created statically or dynamically so note this
|
||||
timer was created statically in case it is later deleted. The
|
||||
autoreload bit may get set in prvInitialiseNewTimer(). */
|
||||
auto-reload bit may get set in prvInitialiseNewTimer(). */
|
||||
pxNewTimer->ucStatus = tmrSTATUS_IS_STATICALLY_ALLOCATED;
|
||||
|
||||
prvInitialiseNewTimer( pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, pxCallbackFunction, pxNewTimer );
|
||||
|
@ -459,6 +459,31 @@ Timer_t * pxTimer = xTimer;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer )
|
||||
{
|
||||
Timer_t * pxTimer = xTimer;
|
||||
UBaseType_t uxReturn;
|
||||
|
||||
configASSERT( xTimer );
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) == 0 )
|
||||
{
|
||||
/* Not an auto-reload timer. */
|
||||
uxReturn = ( UBaseType_t ) pdFALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Is an auto-reload timer. */
|
||||
uxReturn = ( UBaseType_t ) pdTRUE;
|
||||
}
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
|
||||
return uxReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer )
|
||||
{
|
||||
Timer_t * pxTimer = xTimer;
|
||||
|
@ -489,7 +514,7 @@ Timer_t * const pxTimer = ( Timer_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTi
|
|||
( void ) uxListRemove( &( pxTimer->xTimerListItem ) );
|
||||
traceTIMER_EXPIRED( pxTimer );
|
||||
|
||||
/* If the timer is an auto reload timer then calculate the next
|
||||
/* If the timer is an auto-reload timer then calculate the next
|
||||
expiry time and re-insert the timer in the list of active timers. */
|
||||
if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0 )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue