Index: PersistentAlarm.c =================================================================== diff -u -r7f049fb55e8f7fd41cf2dbd19a0e43d4e684af78 -r7c49409b1bfeee8fd788fe1cd2a6dbf2abda7fea --- PersistentAlarm.c (.../PersistentAlarm.c) (revision 7f049fb55e8f7fd41cf2dbd19a0e43d4e684af78) +++ PersistentAlarm.c (.../PersistentAlarm.c) (revision 7c49409b1bfeee8fd788fe1cd2a6dbf2abda7fea) @@ -59,7 +59,7 @@ * @return none *************************************************************************/ void initPersistentAlarm( PERSISTENT_ALARM_T alarmIndex, ALARM_ID_T alarm, BOOL isClearable, - F32 persistentClearPeriod, F32 persistentTriggerPeriod ) + U32 persistentClearPeriod, U32 persistentTriggerPeriod ) { if ( alarmIndex < NUM_OF_PERSISTENT_ALARM ) { Index: PersistentAlarm.h =================================================================== diff -u -r9af7bb552347c6dd5a328e465214c11cffd746d2 -r7c49409b1bfeee8fd788fe1cd2a6dbf2abda7fea --- PersistentAlarm.h (.../PersistentAlarm.h) (revision 9af7bb552347c6dd5a328e465214c11cffd746d2) +++ PersistentAlarm.h (.../PersistentAlarm.h) (revision 7c49409b1bfeee8fd788fe1cd2a6dbf2abda7fea) @@ -34,6 +34,8 @@ typedef enum PersistentAlarm { #ifdef _HD_ + PERSISTENT_ALARM_BLOOD_FLOW_SIGNAL_STRENGTH, ///< Blood flow signal strength too low + PERSISTENT_ALARM_DIALYSATE_FLOW_SIGNAL_STRENGTH, ///< Dialysate flow signal strength too low #endif #ifdef _DG_ PERSISTENT_ALARM_INLET_WATER_HIGH_TEMPERATURE, ///< Inlet water high temperature persistent alarm @@ -56,7 +58,7 @@ // Persistent period resolution is in ms void initPersistentAlarm( PERSISTENT_ALARM_T alarmIndex, ALARM_ID_T alarm, BOOL isClearable, - F32 persistentClearPeriod, F32 persistentTriggerPeriod ); + U32 persistentClearPeriod, U32 persistentTriggerPeriod ); void checkPersistentAlarm( PERSISTENT_ALARM_T const alarmIndex, BOOL const isOutOfRange, F32 const data ); /**@}*/ Index: Utilities.c =================================================================== diff -u -r4b3e011f99900660c9c9f23d3ea50a07cb61e64b -r7c49409b1bfeee8fd788fe1cd2a6dbf2abda7fea --- Utilities.c (.../Utilities.c) (revision 4b3e011f99900660c9c9f23d3ea50a07cb61e64b) +++ Utilities.c (.../Utilities.c) (revision 7c49409b1bfeee8fd788fe1cd2a6dbf2abda7fea) @@ -104,7 +104,7 @@ * @brief * The crc16 function calculates a 16-bit CRC for a given range of bytes * in memory. Poly = 0x1021. Not reflected. Initial value = 0xFFFF. - * @details Inputs: none + * @details Inputs: crc16_table[] * @details Outputs: none * @param address pointer to start address of memory range to calculate CRC for * @param len number of bytes in the memory range to calculate CRC for @@ -127,7 +127,7 @@ * @brief * The crc8 function calculates a 8-bit CRC for a given range of bytes * in memory. - * @details Inputs: none + * @details Inputs: crc8_table[] * @details Outputs: none * @param address pointer to start address of memory range to calculate CRC for * @param len number of bytes in the memory range to calculate CRC for @@ -144,6 +144,36 @@ } return crc; +} + +/*********************************************************************//** + * @brief + * The u32DiffWithWrap function calculates the difference between two given + * unsigned 32-bit numbers. If the second (ending) number is less than the + * first (starting) number, then the difference is calculated with a wrap past + * 32-bit full scale to zero. + * @details Inputs: none + * @details Outputs: none + * @param start first number to compute difference for + * @param end second number to compute difference for + * @return the difference between the two given numbers + *************************************************************************/ +U32 u32DiffWithWrap( U32 start, U32 end ) +{ + U32 result; + + // no wrap + if ( end >= start ) + { + result = end - start; + } + // wrapped + else + { + result = ( 0xFFFFFFFF - start ) + end + 1; + } + + return result; } /*********************************************************************//** Index: Utilities.h =================================================================== diff -u -r7971a36491e30a84139068d7e00b416cf1ea3ee1 -r7c49409b1bfeee8fd788fe1cd2a6dbf2abda7fea --- Utilities.h (.../Utilities.h) (revision 7971a36491e30a84139068d7e00b416cf1ea3ee1) +++ Utilities.h (.../Utilities.h) (revision 7c49409b1bfeee8fd788fe1cd2a6dbf2abda7fea) @@ -90,7 +90,8 @@ 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 ); +void resetCriticalData( CRITICAL_DATA_T *data ); +U32 hexStrToDec( U08 const * const valuePtr, U08 size ); /**@}*/