Index: firmware/App/Monitors/Pressures.c =================================================================== diff -u -r8e5105d7e059711084c0d30041cde756d995d62f -rd697e368e012ee528e2f57fb627db4b62fd1e360 --- firmware/App/Monitors/Pressures.c (.../Pressures.c) (revision 8e5105d7e059711084c0d30041cde756d995d62f) +++ firmware/App/Monitors/Pressures.c (.../Pressures.c) (revision d697e368e012ee528e2f57fb627db4b62fd1e360) @@ -212,7 +212,7 @@ static void checkTmpPressureInRange( void ); static void publishPressureData( void ); static void determineArtVenPressureLimits( void ); -static void filterInlinePressureReadings( F32 artPres, F32 venPres ); +static void filterInlinePressureReadings( F32 artPres, F32 venPres, F32 tmpPres ); static void filterBaroPressureReadings( F32 baroPresPSI ); /*********************************************************************//** @@ -587,10 +587,11 @@ PRESSURE_STATE_T result = PRESSURE_CONTINUOUS_READ_STATE; F32 fpgaArtPres = getPressure( H2_PRES ) - arterialPressureOffset; F32 fpgaVenPres = getPressure( H14_PRES ) - venousPressureOffset; + F32 tmpPres = fpgaVenPres - ( getDialysatePressure() * PSI_TO_MMHG ); F32 fpgaBaroPresPSI = getPressure( H23_PRES ); // Filter inline pressure readings - filterInlinePressureReadings( fpgaArtPres, fpgaVenPres ); + filterInlinePressureReadings( fpgaArtPres, fpgaVenPres, tmpPres); // Filter the baro pressure filterBaroPressureReadings( fpgaBaroPresPSI ); @@ -1026,7 +1027,7 @@ * @param venPres newest venous pressure sample to add to filter * @return none *************************************************************************/ -static void filterInlinePressureReadings( F32 artPres, F32 venPres ) +static void filterInlinePressureReadings( F32 artPres, F32 venPres, F32 tmpPres ) { // Long filter for arterial pressure. if ( artPressureReadingsLongCount >= SIZE_OF_LONG_ART_ROLLING_AVG ) @@ -1077,11 +1078,12 @@ { tmpPressureReadingsLongTotal -= tmpPressureReadingsLong[ tmpPressureReadingsLongIdx ]; } - tmpPressureReadingsLong[ tmpPressureReadingsLongIdx ] = tmpPressure.data; - tmpPressureReadingsLongTotal += tmpPressure.data; + tmpPressureReadingsLong[ tmpPressureReadingsLongIdx ] = tmpPres; + tmpPressureReadingsLongTotal += tmpPres; tmpPressureReadingsLongIdx = INC_WRAP( tmpPressureReadingsLongIdx, 0, SIZE_OF_LONG_TMP_ROLLING_AVG - 1 ); tmpPressureReadingsLongCount = INC_CAP( tmpPressureReadingsLongCount, SIZE_OF_LONG_TMP_ROLLING_AVG ); longFilteredTmpPressure = tmpPressureReadingsLongTotal / (F32)tmpPressureReadingsLongCount; + tmpPressure.data = getF32OverrideValue( &tmpPressure ); }