Index: Utilities.h =================================================================== diff -u -r6d80d69a210f45c733e5307859351f2cd820a8e7 -r5fb988facecb08dceb2bba1c462d3097b53617f0 --- Utilities.h (.../Utilities.h) (revision 6d80d69a210f45c733e5307859351f2cd820a8e7) +++ Utilities.h (.../Utilities.h) (revision 5fb988facecb08dceb2bba1c462d3097b53617f0) @@ -18,6 +18,16 @@ #ifndef __UTILITIES_H__ #define __UTILITIES_H__ +#ifdef _TD_ +#include "TDCommon.h" +#endif +#ifdef _DD_ +#include "DDCommon.h" +#endif +#ifdef _RO_ +#include "ROCommon.h" +#endif + /** * @defgroup Utilities Utilities * @brief Utilities module contains various utility functions. @@ -98,22 +108,25 @@ U16 crc16( const U08 *address, U32 len ); U08 crc8( const U08 *address, U32 len ); U08 crc4( U16* buffer, U32 byteCount ); + U32 u32DiffWithWrap( U32 start, U32 end ); S32 u32BiDiffWithWrap( U32 start, U32 end ); U16 u16DiffWithWrap( U16 start, U16 end ); S16 u16BiDiffWithWrap( U16 start, U16 end ); + void initTimeWindowedCount( TIME_WINDOWED_COUNT_T cnt, U32 maxCnt, U32 winMs ); BOOL incTimeWindowedCount( TIME_WINDOWED_COUNT_T cnt ); + CRITICAL_DATAS_T getCriticalData( CRITICAL_DATA_T *data ); BOOL setCriticalData( CRITICAL_DATA_T *data, CRITICAL_DATAS_T value ); BOOL isCriticalDataInRange( CRITICAL_DATA_T *data ); void resetCriticalData( CRITICAL_DATA_T *data ); BOOL hexStrToDec( U08 const * const valuePtr, U32* convValueAddress, U08 size ); void initSemaphores( void ); -BOOL getSemaphore( SEMAPHORE_T s ); +BOOL acquireSemaphore( SEMAPHORE_T s ); void releaseSemaphore( SEMAPHORE_T s ); -BOOL isSemaphoreReleased( SEMAPHORE_T s ); +BOOL isSemaphoreAvailable( SEMAPHORE_T s ); /**@}*/