Index: firmware/App/Modes/SelfTests.c =================================================================== diff -u -r8afac005a36a62d8d36e58a4c46d0225b3367204 -r50086215a9c8977c977f836dcd4c454dd4d7d712 --- firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 8afac005a36a62d8d36e58a4c46d0225b3367204) +++ firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 50086215a9c8977c977f836dcd4c454dd4d7d712) @@ -8,7 +8,7 @@ * @file SelfTests.c * * @author (last) Sean Nash -* @date (last) 02-Feb-2023 +* @date (last) 05-Feb-2023 * * @author (original) Quang Nguyen * @date (original) 28-Jan-2021 @@ -75,6 +75,7 @@ #define WET_SELF_TEST_SECOND_DISPLACEMENT_TARGET_VOLUME_ML 600.0F ///< Target of second displacement volume in ml. #define WET_SELF_TEST_INTEGRATED_VOLUME_PCT_TOLERANCE 0.10F ///< Tolerance on integrated volume as a percentage (10%). #define WET_SELF_TEST_INTEGRATED_VOLUME_TOLERANCE 20.0F ///< Tolerance on integrated volume in grams. +#define WET_SELF_TEST_INTEGRATED_VOLUME_WIDER_TOLERANCE 100.0F ///< Wider tolerance on integrated volume in grams, during debug. #define WET_SELF_TEST_DISPLACEMENT_TOLERANCE_G 20.0F ///< Tolerance in the load cell readings of the displacement in grams. #define WET_SELF_TEST_FIRST_DISPLACEMENT_TIME_MS ( SEC_PER_MIN * MS_PER_SECOND ) ///< Time to displace dialysate in wet self-test in ms (first). #define WET_SELF_TEST_SECOND_DISPLACEMENT_TIME_MS ( 30 * MS_PER_SECOND ) ///< Time to displace dialysate in wet self-test in ms (second). @@ -926,6 +927,13 @@ else #endif { +#ifndef _RELEASE_ + if ( SW_CONFIG_DISABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_AIR_PUMP ) ) // Allow res 1&2 fills now if air pump not disabled +#endif + { + signalAllowDGFillRes1(); + signalAllowDGFillRes2(); + } state = DRY_SELF_TESTS_WAIT_FOR_DOOR_CLOSE_STATE; } } @@ -1447,7 +1455,14 @@ { state = DRY_SELF_TESTS_SYRINGE_PUMP_OCCLUSION_DETECTION_STATE; syringeOcclusionDelayStartTime = getMSTimerCount(); // Get the current time to check for occlusion after 3 seconds has elapsed - signalActionToResumeFill(); +#ifndef _RELEASE_ + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_AIR_PUMP ) ) // if no air pump, now we can allow fills to start + { + signalAllowDGFlushFills(); + signalAllowDGFillRes1(); + signalAllowDGFillRes2(); + } +#endif } else { @@ -1469,7 +1484,14 @@ } else { - signalActionToResumeFill(); +#ifndef _RELEASE_ + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_AIR_PUMP ) ) // if no air pump, now we can allow fills to start + { + signalAllowDGFlushFills(); + signalAllowDGFillRes1(); + signalAllowDGFillRes2(); + } +#endif state = DRY_SELF_TESTS_COMPLETE_STATE; } @@ -1765,13 +1787,11 @@ // Once we've settled (5 sec), integrate flow to volume over duration of fluid transfer if ( 0 == settleStartTime ) { - // This is not a volume for now and it is a flow rate. - fmdIntegratedVolume += getMeasuredDialInFlowRate(); + fmdIntegratedVolume += ( getMeasuredDialInFlowRate() / (F32)( ( SEC_PER_MIN * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ) ); if ( TRUE == didTimeout( displacementStartTime, WET_SELF_TEST_FIRST_DISPLACEMENT_TIME_MS ) ) { signalDialInPumpHardStop(); - fmdIntegratedVolume = ( ( fmdIntegratedVolume * TASK_GENERAL_INTERVAL ) / ( WET_SELF_TEST_FIRST_DISPLACEMENT_TIME_MS ) ); settleStartTime = getMSTimerCount(); state = WET_SELF_TESTS_FIRST_DISPLACEMENT_VERIFY_STATE; } @@ -1817,7 +1837,7 @@ #ifndef _RELEASE_ if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_WET_SELF_TEST_WIDER_VOLUME_TOL ) ) { - integrateVolumeToleranceG = 50.0F; + integrateVolumeToleranceG = WET_SELF_TEST_INTEGRATED_VOLUME_WIDER_TOLERANCE; } #endif @@ -1918,12 +1938,11 @@ if ( 0 == settleStartTime ) { - fmdIntegratedVolume += getMeasuredDialInFlowRate(); + fmdIntegratedVolume += ( getMeasuredDialInFlowRate() / (F32)( ( SEC_PER_MIN * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ) ); if ( TRUE == didTimeout( displacementStartTime, WET_SELF_TEST_SECOND_DISPLACEMENT_TIME_MS ) ) { signalDialInPumpHardStop(); - fmdIntegratedVolume = ( ( fmdIntegratedVolume * TASK_GENERAL_INTERVAL ) / ( WET_SELF_TEST_SECOND_DISPLACEMENT_TIME_MS ) ); settleStartTime = getMSTimerCount(); state = WET_SELF_TESTS_SECOND_DISPLACEMENT_VERIFY_STATE; } @@ -1959,7 +1978,7 @@ #ifndef _RELEASE_ if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_WET_SELF_TEST_WIDER_VOLUME_TOL ) ) { - integrateVolumeToleranceG = 50.0F; + integrateVolumeToleranceG = WET_SELF_TEST_INTEGRATED_VOLUME_WIDER_TOLERANCE; } #endif