Add descriptive comment for portTIMER_CALLBACK_ATTRIBUTE and move to same line as decorated code

This commit is contained in:
David Chalco 2020-04-21 16:50:45 -07:00
parent 52911682c4
commit 7eafef28c0
2 changed files with 8 additions and 9 deletions

View file

@ -654,8 +654,7 @@ const List_t *pxTasksWaitingForBits = &( pxEventBits->xTasksWaitingForBits );
/* For internal use only - execute a 'set bits' command that was pended from
an interrupt. */
portTIMER_CALLBACK_ATTRIBUTE
void vEventGroupSetBitsCallback( void *pvEventGroup, const uint32_t ulBitsToSet )
portTIMER_CALLBACK_ATTRIBUTE void vEventGroupSetBitsCallback( void *pvEventGroup, const uint32_t ulBitsToSet )
{
( void ) xEventGroupSetBits( pvEventGroup, ( EventBits_t ) ulBitsToSet ); /*lint !e9079 Can't avoid cast to void* as a generic timer callback prototype. Callback casts back to original type so safe. */
}
@ -663,8 +662,7 @@ void vEventGroupSetBitsCallback( void *pvEventGroup, const uint32_t ulBitsToSet
/* For internal use only - execute a 'clear bits' command that was pended from
an interrupt. */
portTIMER_CALLBACK_ATTRIBUTE
void vEventGroupClearBitsCallback( void *pvEventGroup, const uint32_t ulBitsToClear )
portTIMER_CALLBACK_ATTRIBUTE void vEventGroupClearBitsCallback( void *pvEventGroup, const uint32_t ulBitsToClear )
{
( void ) xEventGroupClearBits( pvEventGroup, ( EventBits_t ) ulBitsToClear ); /*lint !e9079 Can't avoid cast to void* as a generic timer callback prototype. Callback casts back to original type so safe. */
}

View file

@ -69,15 +69,17 @@ defining trmTIMER_SERVICE_TASK_NAME in FreeRTOSConfig.h. */
#define tmrSTATUS_IS_STATICALLY_ALLOCATED ( ( uint8_t ) 0x02 )
#define tmrSTATUS_IS_AUTORELOAD ( ( uint8_t ) 0x04 )
/* The definition of the timers themselves. */
/* The definition of the timers themselves.
portTIMER_CALLBACK_ATTRIBUTE can be used to apply an __attribute__ to timer callbacks and timer
callback function pointers. In some ports, this attribute enables the compiler to resolve function pointers in static analysis.
portTIMER_CALLBACK_ATTRIBUTE defaults as white space unless it is defined by the user. */
typedef struct tmrTimerControl /* The old naming convention is used to prevent breaking kernel aware debuggers. */
{
const char *pcTimerName; /*<< Text name. This is not used by the kernel, it is included simply to make debugging easier. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
ListItem_t xTimerListItem; /*<< Standard linked list item as used by all kernel features for event management. */
TickType_t xTimerPeriodInTicks;/*<< How quickly and often the timer expires. */
void *pvTimerID; /*<< An ID to identify the timer. This allows the timer to be identified when the same callback is used for multiple timers. */
portTIMER_CALLBACK_ATTRIBUTE
TimerCallbackFunction_t pxCallbackFunction; /*<< The function that will be called when the timer expires. */
portTIMER_CALLBACK_ATTRIBUTE TimerCallbackFunction_t pxCallbackFunction; /*<< The function that will be called when the timer expires. */
#if( configUSE_TRACE_FACILITY == 1 )
UBaseType_t uxTimerNumber; /*<< An ID assigned by trace tools such as FreeRTOS+Trace */
#endif
@ -102,8 +104,7 @@ typedef struct tmrTimerParameters
typedef struct tmrCallbackParameters
{
portTIMER_CALLBACK_ATTRIBUTE
PendedFunction_t pxCallbackFunction; /* << The callback function to execute. */
portTIMER_CALLBACK_ATTRIBUTE PendedFunction_t pxCallbackFunction; /* << The callback function to execute. */
void *pvParameter1; /* << The value that will be used as the callback functions first parameter. */
uint32_t ulParameter2; /* << The value that will be used as the callback functions second parameter. */
} CallbackParameters_t;