freertos: removed likely macros from non-port specifics parts of freertos

fatfs: moved esp_compiler header file inside of disk implementation file
This commit is contained in:
Felipe Neves 2019-12-04 11:01:25 -03:00
parent 668b33dcf3
commit d059a955ae
11 changed files with 18 additions and 18 deletions

View File

@ -18,6 +18,7 @@
#include "ff.h" #include "ff.h"
#include "esp_log.h" #include "esp_log.h"
#include "diskio_rawflash.h" #include "diskio_rawflash.h"
#include "esp_compiler.h"
static const char* TAG = "diskio_rawflash"; static const char* TAG = "diskio_rawflash";

View File

@ -20,7 +20,6 @@ extern "C" {
#endif #endif
#include "esp_partition.h" #include "esp_partition.h"
#include "esp_compiler.h"
/** /**
* Register spi flash partition * Register spi flash partition

View File

@ -17,6 +17,7 @@
#include "ff.h" #include "ff.h"
#include "sdmmc_cmd.h" #include "sdmmc_cmd.h"
#include "esp_log.h" #include "esp_log.h"
#include "esp_compiler.h"
static sdmmc_card_t* s_cards[FF_VOLUMES] = { NULL }; static sdmmc_card_t* s_cards[FF_VOLUMES] = { NULL };

View File

@ -16,7 +16,6 @@
#include "sdmmc_cmd.h" #include "sdmmc_cmd.h"
#include "driver/sdmmc_host.h" #include "driver/sdmmc_host.h"
#include "esp_compiler.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -19,6 +19,7 @@
#include "esp_log.h" #include "esp_log.h"
#include "diskio_wl.h" #include "diskio_wl.h"
#include "wear_levelling.h" #include "wear_levelling.h"
#include "esp_compiler.h"
static const char* TAG = "ff_diskio_spiflash"; static const char* TAG = "ff_diskio_spiflash";

View File

@ -20,7 +20,6 @@ extern "C" {
#endif #endif
#include "wear_levelling.h" #include "wear_levelling.h"
#include "esp_compiler.h"
/** /**

View File

@ -444,7 +444,7 @@ BaseType_t xTimeoutOccurred = pdFALSE;
event list item, and they should now be retrieved then cleared. */ event list item, and they should now be retrieved then cleared. */
uxReturn = uxTaskResetEventItemValue(); uxReturn = uxTaskResetEventItemValue();
if( unlikely (( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0) ) if( ( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0 )
{ {
taskENTER_CRITICAL( &pxEventBits->eventGroupMux ); taskENTER_CRITICAL( &pxEventBits->eventGroupMux );
{ {

View File

@ -216,7 +216,7 @@ List_t * const pxList = ( List_t * ) pxItemToRemove->pvContainer;
pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext; pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
/* Make sure the index is left pointing to a valid item. */ /* Make sure the index is left pointing to a valid item. */
if(likely(pxList->pxIndex == pxItemToRemove)) if(pxList->pxIndex == pxItemToRemove)
{ {
pxList->pxIndex = pxItemToRemove->pxPrevious; pxList->pxIndex = pxItemToRemove->pxPrevious;
} }

View File

@ -782,7 +782,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
mtCOVERAGE_TEST_MARKER(); mtCOVERAGE_TEST_MARKER();
} }
} }
else if(unlikely(xYieldRequired != pdFALSE)) else if(xYieldRequired != pdFALSE)
{ {
/* This path is a special case that will only get /* This path is a special case that will only get
executed if the task was holding multiple mutexes executed if the task was holding multiple mutexes
@ -815,7 +815,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
mtCOVERAGE_TEST_MARKER(); mtCOVERAGE_TEST_MARKER();
} }
} }
else if(unlikely(xYieldRequired != pdFALSE)) else if(xYieldRequired != pdFALSE)
{ {
/* This path is a special case that will only get /* This path is a special case that will only get
executed if the task was holding multiple mutexes and executed if the task was holding multiple mutexes and
@ -868,7 +868,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
taskENTER_CRITICAL(&pxQueue->mux); taskENTER_CRITICAL(&pxQueue->mux);
/* Update the timeout state to see if it has expired yet. */ /* Update the timeout state to see if it has expired yet. */
if(likely(xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )) if(xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )
{ {
if( prvIsQueueFull( pxQueue ) != pdFALSE ) if( prvIsQueueFull( pxQueue ) != pdFALSE )
{ {
@ -1573,7 +1573,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
taskENTER_CRITICAL(&pxQueue->mux); taskENTER_CRITICAL(&pxQueue->mux);
/* Update the timeout state to see if it has expired yet. */ /* Update the timeout state to see if it has expired yet. */
if(likely(xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE)) if(xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE)
{ {
if( prvIsQueueEmpty( pxQueue ) != pdFALSE ) if( prvIsQueueEmpty( pxQueue ) != pdFALSE )
{ {
@ -1888,7 +1888,7 @@ BaseType_t xReturn = pdFALSE;
} }
#endif /* configUSE_MUTEXES */ #endif /* configUSE_MUTEXES */
} }
else if(likely(xPosition == queueSEND_TO_BACK)) else if(xPosition == queueSEND_TO_BACK)
{ {
( void ) memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 !e418 MISRA exception as the casts are only redundant for some ports, plus previous logic ensures a null pointer can only be passed to memcpy() if the copy size is 0. */ ( void ) memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 !e418 MISRA exception as the casts are only redundant for some ports, plus previous logic ensures a null pointer can only be passed to memcpy() if the copy size is 0. */
pxQueue->pcWriteTo += pxQueue->uxItemSize; pxQueue->pcWriteTo += pxQueue->uxItemSize;

View File

@ -2467,7 +2467,7 @@ BaseType_t xSwitchRequired = pdFALSE;
/* Only allow core 0 increase the tick count in the case of xPortSysTickHandler processing. */ /* Only allow core 0 increase the tick count in the case of xPortSysTickHandler processing. */
/* And allow core 0 and core 1 to unwind uxPendedTicks during xTaskResumeAll. */ /* And allow core 0 and core 1 to unwind uxPendedTicks during xTaskResumeAll. */
if (likely(xPortInIsrContext())) if (xPortInIsrContext())
{ {
#if ( configUSE_TICK_HOOK == 1 ) #if ( configUSE_TICK_HOOK == 1 )
vApplicationTickHook(); vApplicationTickHook();
@ -4188,7 +4188,7 @@ For ESP32 FreeRTOS, vTaskEnterCritical implements both portENTER_CRITICAL and po
{ {
BaseType_t oldInterruptLevel=0; BaseType_t oldInterruptLevel=0;
BaseType_t schedulerRunning = xSchedulerRunning; BaseType_t schedulerRunning = xSchedulerRunning;
if(likely(schedulerRunning != pdFALSE)) if(schedulerRunning != pdFALSE)
{ {
//Interrupts may already be disabled (because we're doing this recursively) but we can't get the interrupt level after //Interrupts may already be disabled (because we're doing this recursively) but we can't get the interrupt level after
//vPortCPUAquireMutex, because it also may mess with interrupts. Get it here first, then later figure out if we're nesting //vPortCPUAquireMutex, because it also may mess with interrupts. Get it here first, then later figure out if we're nesting
@ -4201,7 +4201,7 @@ For ESP32 FreeRTOS, vTaskEnterCritical implements both portENTER_CRITICAL and po
vPortCPUAcquireMutexIntsDisabled( mux, portMUX_NO_TIMEOUT ); vPortCPUAcquireMutexIntsDisabled( mux, portMUX_NO_TIMEOUT );
#endif #endif
if(likely(schedulerRunning != pdFALSE)) if(schedulerRunning != pdFALSE)
{ {
TCB_t *tcb = pxCurrentTCB[xPortGetCoreID()]; TCB_t *tcb = pxCurrentTCB[xPortGetCoreID()];
BaseType_t newNesting = tcb->uxCriticalNesting + 1; BaseType_t newNesting = tcb->uxCriticalNesting + 1;
@ -4260,11 +4260,11 @@ For ESP32 FreeRTOS, vTaskExitCritical implements both portEXIT_CRITICAL and port
#else #else
vPortCPUReleaseMutexIntsDisabled( mux ); vPortCPUReleaseMutexIntsDisabled( mux );
#endif #endif
if(likely(xSchedulerRunning != pdFALSE)) if(xSchedulerRunning != pdFALSE)
{ {
TCB_t *tcb = pxCurrentTCB[xPortGetCoreID()]; TCB_t *tcb = pxCurrentTCB[xPortGetCoreID()];
BaseType_t nesting = tcb->uxCriticalNesting; BaseType_t nesting = tcb->uxCriticalNesting;
if(likely(nesting > 0U)) if(nesting > 0U)
{ {
nesting--; nesting--;
tcb->uxCriticalNesting = nesting; tcb->uxCriticalNesting = nesting;

View File

@ -410,7 +410,7 @@ DaemonTaskMessage_t xMessage;
/* Send a message to the timer service task to perform a particular action /* Send a message to the timer service task to perform a particular action
on a particular timer definition. */ on a particular timer definition. */
if(unlikely( xTimerQueue != NULL )) if( xTimerQueue != NULL )
{ {
/* Send a command to the timer service task to start the xTimer timer. */ /* Send a command to the timer service task to start the xTimer timer. */
xMessage.xMessageID = xCommandID; xMessage.xMessageID = xCommandID;
@ -725,7 +725,7 @@ TickType_t xTimeNow;
/* Commands that are positive are timer commands rather than pended /* Commands that are positive are timer commands rather than pended
function calls. */ function calls. */
if(likely( xMessage.xMessageID >= ( BaseType_t ) 0) ) if( xMessage.xMessageID >= ( BaseType_t ) 0 )
{ {
/* The messages uses the xTimerParameters member to work on a /* The messages uses the xTimerParameters member to work on a
software timer. */ software timer. */
@ -759,7 +759,7 @@ TickType_t xTimeNow;
case tmrCOMMAND_RESET_FROM_ISR : case tmrCOMMAND_RESET_FROM_ISR :
case tmrCOMMAND_START_DONT_TRACE : case tmrCOMMAND_START_DONT_TRACE :
/* Start or restart a timer. */ /* Start or restart a timer. */
if(likely( prvInsertTimerInActiveList( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow, xMessage.u.xTimerParameters.xMessageValue ) == pdTRUE )) if( prvInsertTimerInActiveList( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow, xMessage.u.xTimerParameters.xMessageValue ) == pdTRUE )
{ {
/* The timer expired before it was added to the active /* The timer expired before it was added to the active
timer list. Process it now. */ timer list. Process it now. */