Index: firmware/App/Controllers/ConductivitySensors.c =================================================================== diff -u -rf93ec3de5b9ce8b8d62a06378d12f10fe01a4365 -r56429f955d5da2c3e571908b5a383125ea078197 --- firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision f93ec3de5b9ce8b8d62a06378d12f10fe01a4365) +++ firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 56429f955d5da2c3e571908b5a383125ea078197) @@ -514,25 +514,42 @@ static void processEmstatBoard( EMSTAT_BOARD_T board ) { U08 emstatByte = 0; - U08 fpgaErrorCount = 0; +// U08 fpgaErrorCount = 0; + U16 rxFifoCount = 0; switch ( board ) { // TODO should check Rx FIFO to see if a character exists? case EMSTAT_CPI_CPO_BOARD: - emstatByte = getFPGAEmstatCPiCPoByteOut(); - fpgaErrorCount = getFPGAEmstatCPiCPoRxErrCount(); + // Check for continuous incoming bytes + rxFifoCount = getFPGAEmstatCPiCPoRxFifoCount(); + checkFPGAPersistentAlarms( FPGA_PERS_ERROR_CPI_CPO_COND_SENSORS, rxFifoCount ); - checkFPGAPersistentErrorCountAlarm( FPGA_PERS_ERROR_CPI_CPO_COND_SENSORS, fpgaErrorCount ); - processEmstatSensorRead( &emstatBoardRead[ EMSTAT_CPI_CPO_BOARD ], emstatByte ); + // Only process the sensor read if there is a new byte + if ( 0 != rxFifoCount ) + { + emstatByte = getFPGAEmstatCPiCPoByteOut(); +// fpgaErrorCount = getFPGAEmstatCPiCPoRxErrCount(); + +// checkFPGAPersistentErrorCountAlarm( FPGA_PERS_ERROR_CPI_CPO_COND_SENSORS, fpgaErrorCount ); + processEmstatSensorRead( &emstatBoardRead[ EMSTAT_CPI_CPO_BOARD ], emstatByte ); + } break; case EMSTAT_CD1_CD2_BOARD: - emstatByte = getFPGAEmstatCD1CD2OutByte(); - fpgaErrorCount = getFPGAEmstatCD1CD2RxErrCount(); + // Check for continuous incoming bytes + rxFifoCount = getFPGAEmstatCD1CD2RxFifoCount(); + checkFPGAPersistentAlarms( FPGA_PERS_ERROR_CD1_CD2_COND_SENSORS, rxFifoCount ); - checkFPGAPersistentErrorCountAlarm( FPGA_PERS_ERROR_CD1_CD2_COND_SENSORS, fpgaErrorCount ); - processEmstatSensorRead( &emstatBoardRead[ EMSTAT_CD1_CD2_BOARD ], emstatByte ); + // Only process the sensor read if there is a new byte + if ( 0 != rxFifoCount) + { + emstatByte = getFPGAEmstatCD1CD2OutByte(); +// fpgaErrorCount = getFPGAEmstatCD1CD2RxErrCount(); + +// checkFPGAPersistentErrorCountAlarm( FPGA_PERS_ERROR_CD1_CD2_COND_SENSORS, fpgaErrorCount ); + processEmstatSensorRead( &emstatBoardRead[ EMSTAT_CD1_CD2_BOARD ], emstatByte ); + } break; default: