Index: firmware/App/Services/FPGA.c =================================================================== diff -u -rebbb1f85550a1f9b8f946655f7b2b63f76fbf67d -r76f413c7bde4ca9d12cc61e0191daddb1e86e9f1 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision ebbb1f85550a1f9b8f946655f7b2b63f76fbf67d) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 76f413c7bde4ca9d12cc61e0191daddb1e86e9f1) @@ -140,8 +140,8 @@ U08 fpgaADC2ErrorCnt; ///< Reg 357. U08 fpgaRTDReadCnt; ///< Reg 358. Temperature sensors read count U08 fpgaRTDErrorCnt; ///< Reg 359. Temperature sensors error count - U08 fpgaTHDoReadCnt; ///< Reg 360. Redundant outlet temperature sensor read count - U08 fpgaTHDoErrorCnt; ///< Reg 361. Redundant outlet temperature sensor error count + U08 fpgaTRoReadCnt; ///< Reg 360. Redundant outlet temperature sensor read count + U08 fpgaTRoErrorCnt; ///< Reg 361. Redundant outlet temperature sensor error count U08 fpgaTDiReadCnt; ///< Reg 362. Dialysate inlet temperature sensor read count U08 fpgaTDiErrorCnt; ///< Reg 363. Dialysate inlet temperature sensor error count U08 fpgaPrimaryHeaterFlags; ///< Reg 364. Primary heater flags @@ -466,10 +466,10 @@ break; } - // if retries for commands exceeds limit, fault - if ( fpgaCommRetryCount > MAX_COMM_ERROR_RETRIES ) + // if retries for commands exceeds limit or FPGA reports comm error, fault + if ( ( fpgaCommRetryCount > MAX_COMM_ERROR_RETRIES ) || ( fpgaSensorReadings.fpgaIOErrorCntProcessor > MAX_COMM_ERROR_RETRIES ) ) { - // TODO - FPGA comm fault + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_FPGA_COMM_TIMEOUT, fpgaCommRetryCount, (U32)fpgaSensorReadings.fpgaIOErrorCntProcessor ) } // reset comm flags after processing incoming responses @@ -1047,49 +1047,57 @@ /*********************************************************************//** * @brief * The getFPGALoadCellA1 function gets the latest load cell A 1 reading. + * Least significant 24 bits are the reading. Most significant bit indicates + * CRC or status error. * @details Inputs: fpgaSensorReadings * @details Outputs: none * @return last load cell A 1 reading *************************************************************************/ U32 getFPGALoadCellA1( void ) { - return ( fpgaSensorReadings.fpgaLCA1 & MASK_OFF_U32_MSB ); + return fpgaSensorReadings.fpgaLCA1; } /*********************************************************************//** * @brief * The getFPGALoadCellA2 function gets the latest load cell A 2 reading. + * Least significant 24 bits are the reading. Most significant bit indicates + * CRC or status error. * @details Inputs: fpgaSensorReadings * @details Outputs: none * @return last load cell A 2 reading *************************************************************************/ U32 getFPGALoadCellA2( void ) { - return ( fpgaSensorReadings.fpgaLCA2 & MASK_OFF_U32_MSB ); + return fpgaSensorReadings.fpgaLCA2; } /*********************************************************************//** * @brief * The getFPGALoadCellB1 function gets the latest load cell B 1 reading. + * Least significant 24 bits are the reading. Most significant bit indicates + * CRC or status error. * @details Inputs: fpgaSensorReadings * @details Outputs: none * @return last load cell B 1 reading *************************************************************************/ U32 getFPGALoadCellB1( void ) { - return ( fpgaSensorReadings.fpgaLCB1 & MASK_OFF_U32_MSB ); + return fpgaSensorReadings.fpgaLCB1; } /*********************************************************************//** * @brief * The getFPGALoadCellB2 function gets the latest load cell B 2 reading. + * Least significant 24 bits are the reading. Most significant bit indicates + * CRC or status error. * @details Inputs: fpgaSensorReadings * @details Outputs: none * @return last load cell B 2 reading *************************************************************************/ U32 getFPGALoadCellB2( void ) { - return ( fpgaSensorReadings.fpgaLCB2 & MASK_OFF_U32_MSB ); + return fpgaSensorReadings.fpgaLCB2; } /*********************************************************************//** @@ -1221,26 +1229,26 @@ /*********************************************************************//** * @brief - * The getFPGATHDoErrorCount gets the error count of the THDo (redundant) temperature sensor. - * @details Inputs: fpgaSensorReadings.fpgaTHDoErrorCnt + * The getFPGATRoErrorCount gets the error count of the THDo (redundant) temperature sensor. + * @details Inputs: fpgaSensorReadings.fpgaTRoErrorCnt * @details Outputs: none * @return Last redundant sensor outlet temperature error count *************************************************************************/ -U08 getFPGATHDoErrorCount( void ) +U08 getFPGATRoErrorCount( void ) { - return fpgaSensorReadings.fpgaTHDoErrorCnt; + return fpgaSensorReadings.fpgaTRoErrorCnt; } /*********************************************************************//** * @brief - * The getFPGATHDoReadCount gets the read count of the THDo (redundant) temperature sensor. - * @details Inputs: fpgaSensorReadings.fpgaTHDoReadCnt + * The getFPGATRoReadCount gets the read count of the THDo (redundant) temperature sensor. + * @details Inputs: fpgaSensorReadings.fpgaTRoReadCnt * @details Outputs: none * @return Last redundant sensor outlet temperature error count reading *************************************************************************/ -U08 getFPGATHDoReadCount( void ) +U08 getFPGATRoReadCount( void ) { - return fpgaSensorReadings.fpgaTHDoReadCnt; + return fpgaSensorReadings.fpgaTRoReadCnt; } /*********************************************************************//**