Index: firmware/App/Monitors/Pressures.c =================================================================== diff -u -r049c0e6a638465ef9cbbd14b9fa6fdf2d661872c -r3629bf54d343cb1e8631ea8327909746c9420780 --- firmware/App/Monitors/Pressures.c (.../Pressures.c) (revision 049c0e6a638465ef9cbbd14b9fa6fdf2d661872c) +++ firmware/App/Monitors/Pressures.c (.../Pressures.c) (revision 3629bf54d343cb1e8631ea8327909746c9420780) @@ -162,8 +162,8 @@ static OVERRIDE_F32_T shortFilteredArterialPressure; ///< Measured arterial pressure after short (1 s) filter (in mmHg). static F32 longFilteredVenousPressure; ///< Measured venous pressure after long (10 s) filter (in mmHg). static OVERRIDE_F32_T shortFilteredVenousPressure; ///< Measured venous pressure after short (1 s) filter (in mmHg). -static OVERRIDE_F32_T tmpPressure; ///< Calculated trans-membrane pressure (in mmHg). static F32 longFilteredTmpPressure; ///< Measured trans-membrane pressure after long (10 s) filter (in mmHg). +static OVERRIDE_F32_T tmpPressure; ///< Calculated trans-membrane pressure (in mmHg). static STABILIZATION_PERIODS_T pressureStabilizeTime; ///< Pressure stabilization time based on system events such as airpump, treatment param changes etc., static BOOL resetFillExemptPeriod; ///< Flag to reset the exempt period after defined time expire. static BOOL lowVenousPressureExemptCheck; ///< low venous pressure exempt check flag based on the air trap valve status @@ -605,6 +605,7 @@ #ifndef TEST_NO_PRESSURE_CHECKS checkArterialPressureInRange(); checkVenousPressureInRange(); + checkTMPPressureInRange(); #endif return result; @@ -1012,15 +1013,17 @@ /*********************************************************************//** * @brief - * The filterInlinePressureReadings function adds a new arterial and venous - * pressure sample to the filters. + * The filterInlinePressureReadings function adds a new arterial, venous and + * trans-membrane pressure sample to the filters. * @details \b Inputs: none * @details \b Outputs: artPressureReadingsLong[], artPressureReadingsLongIdx, artPressureReadingsLongTotal, artPressureReadingsLongCount, * artPressureReadingsShort, artPressureReadingsShortIdx, artPressureReadingsShortTotal, artPressureReadingsShortCount, * venPressureReadingsShort, venPressureReadingsShortIdx, venPressureReadingsShortTotal, venPressureReadingsShortCount, - * longFilteredArterialPressure, shortFilteredArterialPressure, shortFilteredVenousPressure + * longFilteredArterialPressure, shortFilteredArterialPressure, shortFilteredVenousPressure, + * tmpPressureReadingsLong[], tmpPressureReadingsLongIdx, tmpPressureReadingsLongTotal, tmpPressureReadingsLongCount * @param artPres newest arterial pressure sample to add to filters * @param venPres newest venous pressure sample to add to filter + * @param tmpPres newest trans-membrane pressure sample to add to filter * @return none *************************************************************************/ static void filterInlinePressureReadings( F32 artPres, F32 venPres, F32 tmpPres ) @@ -1070,7 +1073,7 @@ shortFilteredVenousPressure.data = venPressureReadingsShortTotal / (F32)venPressureReadingsShortCount; // Long filter for trans-membrane pressure - if ( tmpPressureReadingsLongCount >= SIZE_OF_LONG_VEN_ROLLING_AVG ) + if ( tmpPressureReadingsLongCount >= SIZE_OF_LONG_TMP_ROLLING_AVG ) { tmpPressureReadingsLongTotal -= tmpPressureReadingsLong[ tmpPressureReadingsLongIdx ]; } @@ -1079,8 +1082,8 @@ 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 = tmpPres; tmpPressure.data = getF32OverrideValue( &tmpPressure ); - } /*********************************************************************//**