Index: Utilities.h =================================================================== diff -u -r839935998cfe2a1a7594e6b6810301ad3c2aa872 -r80ad1af00243aca326afb85dd81dfe7302400d81 --- Utilities.h (.../Utilities.h) (revision 839935998cfe2a1a7594e6b6810301ad3c2aa872) +++ Utilities.h (.../Utilities.h) (revision 80ad1af00243aca326afb85dd81dfe7302400d81) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2020-2022 Diality Inc. - All Rights Reserved. +* Copyright (c) 2020-2023 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file Utilities.h * -* @author (last) Michael Garthwaite -* @date (last) 22-Feb-2022 +* @author (last) Bill Bracken +* @date (last) 14-May-2023 * * @author (original) Sean * @date (original) 17-Feb-2020 @@ -29,7 +29,7 @@ // ********** public definitions ********** // ******* Time Windowed Count Definitions ********* -#define MAX_TIME_WINDOWED_COUNT 5 ///< Maximum number of counts that a time windowed count can count to +#define MAX_TIME_WINDOWED_COUNT 10 ///< Maximum number of counts that a time windowed count can count to /// Enumeration of time-windowed counts. typedef enum TimeWindowedCounts @@ -38,16 +38,18 @@ TIME_WINDOWED_COUNT_CAN_WARNING, ///< CAN warning TIME_WINDOWED_COUNT_CAN_OFF, ///< CAN off TIME_WINDOWED_COUNT_CAN_PARITY, ///< CAN parity error - TIME_WINDOWED_COUNT_FPGA_UART_FRAME_ERROR, ///< FPGA UART frame error - TIME_WINDOWED_COUNT_FPGA_UART_OVERRUN, ///< FPGA UART overrun error + TIME_WINDOWED_COUNT_FPGA_CLOCK_SPEED_ERROR, ///< FPGA clock speed error #ifdef _HD_ TIME_WINDOWED_COUNT_BP_COMMUTATION_ERROR, ///< Blood pump commutation error TIME_WINDOWED_COUNT_DIP_COMMUTATION_ERROR, ///< Dialysate inlet pump commutation error TIME_WINDOWED_COUNT_DOP_COMMUTATION_ERROR, ///< Dialysate outlet pump commutation error + TIME_WINDOWED_COUNT_SYRINGE_PUMP_OFF_ERROR, ///< Syringe pump off movement error + TIME_WINDOWED_COUNT_BATT_COMM_ERROR, ///< Battery communication error #endif #ifdef _DG_ TIME_WINDOWED_COUNT_FPGA_CONDUCTIVITY_SENSOR_ERROR, ///< FPGA Conductivity sensor error TIME_WINDOWED_COUNT_FPGA_TEMPERATURE_SENSOR_ERROR, ///< FPGA Temperature sensor error + TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES, ///< FPGA communication failure (NAK, CRC, timeout) #endif NUM_OF_TIME_WINDOWED_COUNTS ///< Number of pressure sensors } TIME_WINDOWED_COUNT_T; @@ -72,21 +74,21 @@ /// Record structure for alarm data of any supported type. typedef union { - U32 uInt; ///< critical data of unsigned integer type - S32 sInt; ///< critical data of signed integer type - F32 sFlt; ///< critical data of floating point type + U32 uInt; ///< critical data of unsigned integer type + S32 sInt; ///< critical data of signed integer type + F32 sFlt; ///< critical data of floating point type } CRITICAL_DATAS_T; /// critical integer data structure. typedef struct { - CRITICAL_DATA_TYPES_T typ; ///< Type of data - CRITICAL_DATAS_T minimum; ///< Minimum value for valid data - CRITICAL_DATAS_T maximum; ///< Maximum value for valid data - CRITICAL_DATAS_T defValue; ///< Default value - CRITICAL_DATAS_T data; ///< Data value - U32 comp; ///< One's compliment of value - BOOL set; ///< Flag indicates data has been set + CRITICAL_DATA_TYPES_T typ; ///< Type of data + CRITICAL_DATAS_T minimum; ///< Minimum value for valid data + CRITICAL_DATAS_T maximum; ///< Maximum value for valid data + CRITICAL_DATAS_T defValue; ///< Default value + CRITICAL_DATAS_T data; ///< Data value + U32 comp; ///< One's compliment of value + BOOL set; ///< Flag indicates data has been set } CRITICAL_DATA_T; // ********** public function prototypes ********** @@ -105,13 +107,13 @@ BOOL setCriticalData( CRITICAL_DATA_T *data, CRITICAL_DATAS_T value ); BOOL isCriticalDataInRange( CRITICAL_DATA_T *data ); void resetCriticalData( CRITICAL_DATA_T *data ); -U32 hexStrToDec( U08 const * const valuePtr, U08 size ); +BOOL hexStrToDec( U08 const * const valuePtr, U32* convValueAddress, U08 size ); 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 ); +BOOL isSemaphoreReleased( SEMAPHORE_T s ); /**@}*/