Index: Utilities.h =================================================================== diff -u -r51fff72291e1b83cc32e8f28bad7f821dfcc5b9c -rdeccca7f64383d627e700a8bb929742eb33d947a --- Utilities.h (.../Utilities.h) (revision 51fff72291e1b83cc32e8f28bad7f821dfcc5b9c) +++ Utilities.h (.../Utilities.h) (revision deccca7f64383d627e700a8bb929742eb33d947a) @@ -7,8 +7,8 @@ * * @file Utilities.h * -* @author (last) Michael Garthwaite -* @date (last) 22-Feb-2022 +* @author (last) Dara Navaei +* @date (last) 09-Aug-2022 * * @author (original) Sean * @date (original) 17-Feb-2020 @@ -63,6 +63,13 @@ NUM_OF_CRITICAL_DATA_TYPES ///< Total number of critical data types } CRITICAL_DATA_TYPES_T; +/// Semaphore items +typedef enum Semaphores +{ + SEMAPHORE_RTC = 0, ///< Semaphore RTC + NUM_OF_SEMAPHORES, ///< Number of semaphores +} SEMAPHORE_T; + /// Record structure for alarm data of any supported type. typedef union { @@ -88,7 +95,7 @@ U32 crc32( U32 const initialValue, const U08 *address, U32 len ); U16 crc16( const U08 *address, U32 len ); U08 crc8( const U08 *address, U32 len ); -U08 crc4( U08* buffer ); +U08 crc4( U16* buffer, U32 byteCount ); U32 u32DiffWithWrap( U32 start, U32 end ); S32 u32BiDiffWithWrap( U32 start, U32 end ); U16 u16DiffWithWrap( U16 start, U16 end ); @@ -100,7 +107,12 @@ BOOL isCriticalDataInRange( CRITICAL_DATA_T *data ); void resetCriticalData( CRITICAL_DATA_T *data ); U32 hexStrToDec( U08 const * const valuePtr, U08 size ); -BOOL isCriticalDataSet( CRITICAL_DATA_T *data ); ///< Determines if critcal data has been set. +BOOL isCriticalDataSet( CRITICAL_DATA_T *data ); ///< Determines if critical data has been set. + +void initSemaphores( void ); +BOOL getSemaphore( SEMAPHORE_T s ); +void releaseSemaphore( SEMAPHORE_T s ); +BOOL isSemaphoreReleased( SEMAPHORE_T s ); /**@}*/