if( *pxMailBox != NULL )\r
{\r
xReturn = ERR_OK;\r
- #if SYS_STATS\r
- {\r
- SYS_STATS_INC( mbox.used );\r
- }\r
- #endif /* SYS_STATS */\r
+ SYS_STATS_INC_USED( mbox );\r
}\r
\r
return xReturn;\r
{\r
/* The queue was already full. */\r
xReturn = ERR_MEM;\r
- #if SYS_STATS\r
- {\r
- SYS_STATS_INC( mbox.err );\r
- }\r
- #endif /* SYS_STATS */\r
+ SYS_STATS_INC( mbox.err );\r
}\r
\r
return xReturn;\r
}\r
else\r
{\r
- while( pdTRUE != xQueueReceive( pxMailBox, &( *ppvBuffer ), portMAX_DELAY ) );\r
+ while( pdTRUE != xQueueReceive( *pxMailBox, &( *ppvBuffer ), portMAX_DELAY ) );\r
xEndTime = xTaskGetTickCount();\r
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;\r
\r
}\r
\r
xReturn = ERR_OK;\r
-\r
- #if SYS_STATS\r
- {\r
- SYS_STATS_INC( sem.used );\r
- }\r
- #endif\r
+ SYS_STATS_INC_USED( sem );\r
}\r
else\r
{\r
- #if SYS_STATS\r
- {\r
- SYS_STATS_INC( sem.err );\r
- }\r
- #endif\r
+ SYS_STATS_INC( sem.err );\r
}\r
\r
return xReturn;\r
}\r
else\r
{\r
- while( xSemaphoreTake( pxSemaphore, portMAX_DELAY ) != pdTRUE );\r
+ while( xSemaphoreTake( *pxSemaphore, portMAX_DELAY ) != pdTRUE );\r
xEndTime = xTaskGetTickCount();\r
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;\r
\r
\r
*pxMutex = xQueueCreateMutex();\r
\r
- if( *pxMutex != NULL )\r
+ if( *pxMutex != NULL ) \r
{\r
xReturn = ERR_OK;\r
- #if SYS_STATS\r
- {\r
- SYS_STATS_INC( mutex.used );\r
- }\r
- #endif\r
+ SYS_STATS_INC_USED( mutex );\r
} \r
else \r
{\r
- #if SYS_STATS\r
- {\r
- SYS_STATS_INC( mutex.err );\r
- }\r
- #endif\r
+ SYS_STATS_INC( mutex.err );\r
}\r
\r
return xReturn;\r
* @param mutex the mutex to delete */\r
void sys_mutex_free( sys_mutex_t *pxMutex )\r
{\r
- #if SYS_STATS\r
- {\r
- SYS_STATS_DEC( mutex.used );\r
- }\r
- #endif /* SYS_STATS */\r
+ SYS_STATS_DEC( mutex.used );\r
vQueueDelete( *pxMutex );\r
}\r
\r
*---------------------------------------------------------------------------*/\r
void sys_sem_free( sys_sem_t *pxSemaphore )\r
{\r
- #if SYS_STATS\r
- {\r
- SYS_STATS_DEC(sem.used);\r
- }\r
- #endif\r
-\r
+ SYS_STATS_DEC(sem.used);\r
vQueueDelete( *pxSemaphore );\r
}\r
\r