Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -r977f03e20990ed5579160b9b927df1c0f2428101 -rcaa15db89a49c98671f0a87dc2242d0fc7f683b7 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 977f03e20990ed5579160b9b927df1c0f2428101) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision caa15db89a49c98671f0a87dc2242d0fc7f683b7) @@ -418,13 +418,9 @@ spentDialPressure = getFilteredPressure( D51_PRES ); // Check fresh and spent dialysate pressure in range or BC switch only flag set -#ifndef __BC_PRESSURE_ALARM__ - if ( 1 ) -#else if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && - ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) || - ( TRUE == getBalChamberSwitchingOnlyStatus() ) ) -#endif + ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) || + ( TRUE == getBalChamberSwitchingOnlyStatus() ) || ( TRUE == getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) ) ) { //Valve control for state 1 fill valveControlForBCState1FillStart(); @@ -446,10 +442,11 @@ } else { -#ifdef __BC_PRESSURE_ALARM__ - //Alarm when pressure is not in range - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE1_FILL_START_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); -#endif + if ( getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) != TRUE ) + { + //Alarm when pressure is not in range + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE1_FILL_START_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + } } return state; @@ -521,20 +518,23 @@ spentDialPressure = getFilteredPressure( D51_PRES ); // Check fresh and spent dialysate pressure back in range to indicate fill complete. -#ifdef __BC_PRESSURE_ALARM__ - if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && - ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) ) + if ( getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) != TRUE ) { - if ( ++balChamberFillCompleteStablePressureCounter >= BAL_CHAMBER_FILL_COMPLETE_MS ) + if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && + ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) ) { - // stabilized pressure indicating fill is complete - isPressureStalbilizedDuringFill = TRUE; - isBalChamberFillInProgress = FALSE; + if ( ++balChamberFillCompleteStablePressureCounter >= BAL_CHAMBER_FILL_COMPLETE_MS ) + { + // stabilized pressure indicating fill is complete + isPressureStalbilizedDuringFill = TRUE; + isBalChamberFillInProgress = FALSE; + } } } -#else + else + { isPressureStalbilizedDuringFill = FALSE; -#endif + } // Switching time met or pressure in range, close valves if ( ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ) || @@ -574,26 +574,29 @@ if ( TRUE != getBalChamberSwitchingOnlyStatus() ) { -#ifdef __BC_PRESSURE_ALARM__ - if ( ( TRUE != isPressureDroppedDuringFill ) && ( TRUE == isFirstCycleBCSwitchingCompleted ) ) + if ( getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) != TRUE ) { - // When fill initiated, pressure is not dropped to the expected range, possible valve failures. - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE1_FILL_PRESSURE_DROP_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + if ( ( TRUE != isPressureDroppedDuringFill ) && ( TRUE == isFirstCycleBCSwitchingCompleted ) ) + { + // When fill initiated, pressure is not dropped to the expected range, possible valve failures. + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE1_FILL_PRESSURE_DROP_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + } + else if ( TRUE != isPressureStalbilizedDuringFill ) + { + // Alarm when switching time expired, but still pressure not in range which indicates fill is not yet completed. + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE1_FILL_END_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + } + else + { + // Move to next state when pressure is in range. + state = BAL_CHAMBER_STATE2_FILL_START; + } } - else if ( TRUE != isPressureStalbilizedDuringFill ) - { - // Alarm when switching time expired, but still pressure not in range which indicates fill is not yet completed. - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE1_FILL_END_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); - } else { - // Move to next state when pressure is in range. + // Allow to proceed next state even though pressure is not stabilized. state = BAL_CHAMBER_STATE2_FILL_START; } -#else - // Allow to proceed next state even though pressure is not stabilized. - state = BAL_CHAMBER_STATE2_FILL_START; -#endif } else { @@ -629,13 +632,9 @@ spentDialPressure = getFilteredPressure( D51_PRES ); // Check fresh and spent dialysate pressure in range -#ifndef __BC_PRESSURE_ALARM__ - if ( 1 ) -#else if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) || - ( TRUE == getBalChamberSwitchingOnlyStatus() ) ) -#endif + ( TRUE == getBalChamberSwitchingOnlyStatus() ) || ( TRUE == getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) ) ) { // Valve control for state 2 fill valveControlForBCState2FillStart(); @@ -657,10 +656,11 @@ } else { -#ifdef __BC_PRESSURE_ALARM__ - //Alarm when pressure is not in range - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_START_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); -#endif + if ( getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) != TRUE ) + { + //Alarm when pressure is not in range + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_START_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + } } return state; } @@ -681,20 +681,23 @@ spentDialPressure = getFilteredPressure( D51_PRES ); // Check fresh and spent dialysate pressure back in range to indicate fill complete. -#ifdef __BC_PRESSURE_ALARM__ - if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && - ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) ) + if ( getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) != TRUE ) { - if ( ++balChamberFillCompleteStablePressureCounter >= BAL_CHAMBER_FILL_COMPLETE_MS ) + if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && + ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) ) { - // stabilized pressure indicating fill is complete - isPressureStalbilizedDuringFill = TRUE; - isBalChamberFillInProgress = FALSE; + if ( ++balChamberFillCompleteStablePressureCounter >= BAL_CHAMBER_FILL_COMPLETE_MS ) + { + // stabilized pressure indicating fill is complete + isPressureStalbilizedDuringFill = TRUE; + isBalChamberFillInProgress = FALSE; + } } } -#else + else + { isPressureStalbilizedDuringFill = FALSE; -#endif + } // Check switching cycle time or pressure check for valve closure if ( ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ) || @@ -735,32 +738,35 @@ // Pressure alarm check if ( TRUE != getBalChamberSwitchingOnlyStatus() ) { -#ifdef __BC_PRESSURE_ALARM__ - if ( ( TRUE != isPressureDroppedDuringFill ) && ( TRUE == isFirstCycleBCSwitchingCompleted ) ) + if ( getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) != TRUE ) { - // When fill initiated, pressure is not dropped to the expected range, possible valve failures. - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_PRESSURE_DROP_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + if ( ( TRUE != isPressureDroppedDuringFill ) && ( TRUE == isFirstCycleBCSwitchingCompleted ) ) + { + // When fill initiated, pressure is not dropped to the expected range, possible valve failures. + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_PRESSURE_DROP_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + } + else if ( TRUE != isPressureStalbilizedDuringFill ) + { + // Alarm when switching time expired, but still pressure not in range which indicates fill is not completed. + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_END_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + } + else + { + // Move to next state when pressure is in range. + state = BAL_CHAMBER_STATE1_FILL_START; + + // Trigger pressure drop alarm after first cycle of balancing chamber switching complete + if ( FALSE == isFirstCycleBCSwitchingCompleted ) + { + isFirstCycleBCSwitchingCompleted = TRUE; + } + } } - else if ( TRUE != isPressureStalbilizedDuringFill ) - { - // Alarm when switching time expired, but still pressure not in range which indicates fill is not completed. - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_END_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); - } else { - // Move to next state when pressure is in range. + // Allow to proceed next state even though pressure is not stabilized. state = BAL_CHAMBER_STATE1_FILL_START; - - // Trigger pressure drop alarm after first cycle of balancing chamber switching complete - if ( FALSE == isFirstCycleBCSwitchingCompleted ) - { - isFirstCycleBCSwitchingCompleted = TRUE; - } } -#else - // Allow to proceed next state even though pressure is not stabilized. - state = BAL_CHAMBER_STATE1_FILL_START; -#endif } else { Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -r696a272b81bab714038cbc3f25f0b8d633cbcf53 -rcaa15db89a49c98671f0a87dc2242d0fc7f683b7 --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 696a272b81bab714038cbc3f25f0b8d633cbcf53) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision caa15db89a49c98671f0a87dc2242d0fc7f683b7) @@ -43,14 +43,8 @@ #define CONCENTRATE_PUMP_LOW_SPEED_THRESHOLD_MLPM 10.0F ///< Concentrate pump low speed threshold in mL/min. #define CONCENTRATE_PUMP_ZERO_FLOW_RATE 0xFFFF ///< Pulse width value when zero flow rate or pump is off. -#ifdef __DIENER_CONC_PUMP__ -#define CONCENTRATE_PUMP_VOLUME_PER_REV 0.4F ///< Volume output every revolution (mL). -#elif __PUMPTEST__ -#define PISTON_PUMP_STEPS_PER_ML 342.0F ///< Revolution count for 1ml volume delivery. -#define CONCENTRATE_PUMP_VOLUME_PER_REV ( CONCENTRATE_PUMP_STEP_PER_REV / PISTON_PUMP_STEPS_PER_ML ) ///< Volume output every revolution (mL). -#else +#define CONCENTRATE_PUMP_VOLUME_PER_REV_DIENER 0.4F ///< Volume output every revolution (mL). #define CONCENTRATE_PUMP_VOLUME_PER_REV 0.1F ///< Volume output every revolution (mL). -#endif #define CONCENTRATE_PUMP_PULSE_PER_REV 2.0F ///< Number of pulses generate for every revolution. #define CONCENTRATE_PUMP_STEP_PER_REV 200.0F ///< Number of steps for every revolution. @@ -59,16 +53,17 @@ #define CONCENTRATE_PUMP_HALL_SENSORS_OUT_OF_RANGE_TIME_MS ( 5 * MS_PER_SECOND ) ///< Hall sensors out of range time in milliseconds. #define CONCENTRATE_PUMP_MICRO_STEPS_PER_STEP 8.0F ///< Number of micro-steps ( fractions of step) per step. -#define CONCENTRATE_PUMP_VOLUME_TO_REVOLUTION ( ( 1.0F / CONCENTRATE_PUMP_VOLUME_PER_REV ) * \ +#define CONCENTRATE_PUMP_VOLUME_TO_REVOLUTION_DIENER ( ( 1.0F / CONCENTRATE_PUMP_VOLUME_PER_REV_DIENER ) * \ ( CONCENTRATE_PUMP_STEP_PER_REV * \ CONCENTRATE_PUMP_MICRO_STEPS_PER_STEP ) ) ///< Convert volume in to number of revolutions needed. -#ifdef __PUMPTEST__ -#define PISTON_PUMP_VOLUME_TO_REVOLUTION ( PISTON_PUMP_STEPS_PER_ML * CONCENTRATE_PUMP_MICRO_STEPS_PER_STEP ) ///< Convert volume in to number of revolutions needed. -#endif +#define CONCENTRATE_PUMP_VOLUME_TO_REVOLUTION ( ( 1.0F / CONCENTRATE_PUMP_VOLUME_PER_REV ) * \ + ( CONCENTRATE_PUMP_VOLUME_PER_REV * \ + CONCENTRATE_PUMP_MICRO_STEPS_PER_STEP ) ) ///< Convert volume in to number of revolutions needed. #define CONCENTRATE_PUMP_STEP_PERIOD_RESOLUTION ( 0.50F / ( US_PER_SECOND * SEC_PER_MIN ) ) ///< Convert step period resolution (0.50 us) to minute. /// Volume output per pulse. -#define CONCENTRATE_PUMP_VOLUME_PER_PULSE ( CONCENTRATE_PUMP_VOLUME_PER_REV / CONCENTRATE_PUMP_PULSE_PER_REV ) +#define CONCENTRATE_PUMP_VOLUME_PER_PULSE_DIENER ( CONCENTRATE_PUMP_VOLUME_PER_REV / CONCENTRATE_PUMP_VOLUME_PER_REV_DIENER ) +#define CONCENTRATE_PUMP_VOLUME_PER_PULSE ( CONCENTRATE_PUMP_VOLUME_PER_REV / CONCENTRATE_PUMP_VOLUME_PER_REV ) #define CONCENTRATE_PUMP_DATA_PUBLISH_INTERVAL ( 1000 / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the concentrate pump is monitored. #define CONCENTRATE_PUMP_CONTROL_INTERVAL ( 100 / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the concentrate pump is controlled. @@ -560,18 +555,22 @@ //Update target revolution count if ( targetVolume_ml > 0.0 ) { -#ifndef __PUMPTEST__ if ( DOSING_CONT_VOLUME == targetVolume_ml ) { pumpTargetRevCnt[ pumpId ].data = DOSING_CONT_VOLUME; } else { - pumpTargetRevCnt[ pumpId ].data = (U32)( targetVolume_ml * CONCENTRATE_PUMP_VOLUME_TO_REVOLUTION ); + if ( TRUE == getTestConfigStatus( TEST_CONFIG_DIENER_CONC_PUMP ) ) + { + pumpTargetRevCnt[ pumpId ].data = (U32)( targetVolume_ml * CONCENTRATE_PUMP_VOLUME_TO_REVOLUTION_DIENER ); + } + else + { + pumpTargetRevCnt[ pumpId ].data = (U32)( targetVolume_ml * CONCENTRATE_PUMP_VOLUME_TO_REVOLUTION ); + } } -#else - pumpTargetRevCnt[ pumpId ].data = (U32)( targetVolume_ml * PISTON_PUMP_VOLUME_TO_REVOLUTION ); -#endif + if ( D11_PUMP == pumpId ) { setFPGAD11PumpRevolutionCount( getConcPumpTargetRevolutionCount( pumpId ) ); @@ -885,7 +884,7 @@ { setFPGAD76PumpSetStepSpeed( CONCENTRATE_PUMP_ZERO_FLOW_RATE ); } -#ifndef __PUMPTEST__ + // Park concentrate pump too if requested if ( TRUE == parkPump ) { @@ -906,7 +905,6 @@ } concentratePumps[ pumpId ].isConcPumpParkInProgress = TRUE; } -#endif } /*********************************************************************//** @@ -1068,9 +1066,18 @@ if ( concentratePumps[ pumpId ].currentPumpSpeed > NEARLY_ZERO ) { - F32 timePerStep = CONCENTRATE_PUMP_VOLUME_PER_REV / ( concentratePumps[ pumpId ].currentPumpSpeed * CONCENTRATE_PUMP_STEP_PER_REV ); + F32 timePerStep; F32 stepPeriodCounts = timePerStep / ( CONCENTRATE_PUMP_STEP_PERIOD_RESOLUTION * CONCENTRATE_PUMP_MICRO_STEPS_PER_STEP ); + if ( TRUE == getTestConfigStatus( TEST_CONFIG_DIENER_CONC_PUMP ) ) + { + timePerStep = CONCENTRATE_PUMP_VOLUME_PER_REV_DIENER / ( concentratePumps[ pumpId ].currentPumpSpeed * CONCENTRATE_PUMP_STEP_PER_REV ); + } + else + { + timePerStep = CONCENTRATE_PUMP_VOLUME_PER_REV / ( concentratePumps[ pumpId ].currentPumpSpeed * CONCENTRATE_PUMP_STEP_PER_REV ); + } + concentratePumps[ pumpId ].togglePeriodCount = (U16)( stepPeriodCounts + FLOAT_TO_INT_ROUNDUP_OFFSET ); } else @@ -1144,7 +1151,14 @@ } else if ( FALSE == isPumpPulseWidthOut ) { - measuredPumpSpeed[ pumpId ].data = ( US_PER_SECOND / pulseWidthInMicroSeconds ) * CONCENTRATE_PUMP_VOLUME_PER_PULSE * SEC_PER_MIN; + if ( TRUE == getTestConfigStatus( TEST_CONFIG_DIENER_CONC_PUMP ) ) + { + measuredPumpSpeed[ pumpId ].data = ( US_PER_SECOND / pulseWidthInMicroSeconds ) * CONCENTRATE_PUMP_VOLUME_PER_PULSE_DIENER * SEC_PER_MIN; + } + else + { + measuredPumpSpeed[ pumpId ].data = ( US_PER_SECOND / pulseWidthInMicroSeconds ) * CONCENTRATE_PUMP_VOLUME_PER_PULSE * SEC_PER_MIN; + } } // If pulse width is out of range capture pump out of range, pumpId and pulse width @@ -1441,9 +1455,7 @@ { // Handle start command if ( ( TRUE == payload.startStop ) && -#ifndef __PUMPTEST__ ( ( payload.speed >= CONCENTRATE_PUMP_MIN_SPEED ) && ( payload.speed <= CONCENTRATE_PUMP_MAX_SPEED ) ) && -#endif ( payload.volume > 0.0 ) ) { setConcentratePumpTargetSpeed( (CONCENTRATE_PUMPS_T)payload.pumpID, payload.speed, payload.volume ); Index: firmware/App/DDCommon.h =================================================================== diff -u -r846d04b392ffb11d26e5f8376734e1d5335b140e -rcaa15db89a49c98671f0a87dc2242d0fc7f683b7 --- firmware/App/DDCommon.h (.../DDCommon.h) (revision 846d04b392ffb11d26e5f8376734e1d5335b140e) +++ firmware/App/DDCommon.h (.../DDCommon.h) (revision caa15db89a49c98671f0a87dc2242d0fc7f683b7) @@ -25,7 +25,7 @@ #define DD_VERSION_MAJOR 0 #define DD_VERSION_MINOR 0 #define DD_VERSION_MICRO 0 -#define DD_VERSION_BUILD 11 +#define DD_VERSION_BUILD 21 // ********** development build switches ********** @@ -44,11 +44,8 @@ //Uncomment below once characterization/study completed //#define ENABLE_ALARM_2 - //Uncomment below to disable heaters debug message #define __HEATERS_DEBUG__ 1 - - #include #include #endif Index: firmware/App/Services/Messaging.c =================================================================== diff -u -rc51c9d66062c27c588006850550b412ea7dd5144 -rcaa15db89a49c98671f0a87dc2242d0fc7f683b7 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision c51c9d66062c27c588006850550b412ea7dd5144) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision caa15db89a49c98671f0a87dc2242d0fc7f683b7) @@ -34,14 +34,12 @@ #include "ModeStandby.h" #include "OperationModes.h" #include "PAL.h" -#ifdef __PUMPTEST__ -#include "PistonPumpControl.h" -#endif #include "Pressure.h" #include "SafetyShutdown.h" #include "SpentChamberFill.h" #include "SystemCommDD.h" #include "Temperature.h" +#include "TestSupport.h" #include "TDInterface.h" #include "Utilities.h" #include "Ultrafiltration.h" @@ -170,6 +168,9 @@ { MSG_ID_DD_PISTON_PUMP_START_STOP_OVERRIDE_REQUEST, &testDDPistonPumpStartStopOverride }, { MSG_ID_DD_PISTON_PUMP_FILL_AFTER_DISPENSE_OVERRIDE_REQUEST, &testDDPistonPumpFillAfterDispenseOverride }, #endif + { MSG_ID_DD_SET_TEST_CONFIGURATION, &testSetTestConfiguration }, + { MSG_ID_DD_GET_TEST_CONFIGURATION, &testGetTestConfiguration }, + { MSG_ID_DD_RESET_ALL_TEST_CONFIGURATIONS, &testResetAllTestConfigurations }, }; #define NUM_OF_FUNCTION_HANDLERS (sizeof(MSG_FUNCTION_HANDLER_LOOKUP) / sizeof(MSG_HANDLER_LOOKUP_T)) @@ -718,9 +719,90 @@ setSystemREG1_SYSECR( (0x2) << 14 ); // Reset processor } - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); + return result; +} +/*********************************************************************//** + * @brief + * The testSetTestConfiguration function handles a request to set a + * test configuration. + * @details \b Inputs: none + * @details \b Outputs: message handled + * @param message a pointer to the message to handle + * @return TRUE if command accepted, FALSE if rejected + *************************************************************************/ +BOOL testSetTestConfiguration( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // Verify payload length + if ( sizeof( TEST_CONFIG_PAYLOAD_T ) == message->hdr.payloadLen ) + { + TEST_CONFIG_PAYLOAD_T payload; + + // copy message payload to local variable + memcpy( (U08*)&payload, &message->payload[0], sizeof( TEST_CONFIG_PAYLOAD_T ) ); + + // Verify given test configuration is valid + if ( payload.config < NUM_OF_TEST_CONFIGS ) + { + result = TRUE; + if ( FALSE == payload.reset ) + { + setTestConfig( (TEST_CONFIG_T)payload.config ); + } + else + { + resetTestConfig( (TEST_CONFIG_T)payload.config ); + } + } + } + return result; } +/*********************************************************************//** + * @brief + * The testGetTestConfiguration function handles a request to get a + * test configuration. + * @details \b Inputs: none + * @details \b Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +BOOL testGetTestConfiguration( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // verify payload length + if ( 0 == message->hdr.payloadLen ) + { + result = sendTestConfigStatusToDialin(); + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetTestConfiguration function handles a request to reset all + * test configurations. + * @details \b Inputs: none + * @details \b Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +BOOL testResetAllTestConfigurations( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // verify payload length + if ( 0 == message->hdr.payloadLen ) + { + result = resetAllTestConfigs(); + } + + return result; +} + /**@}*/ Index: firmware/source/sys_main.c =================================================================== diff -u -rb36ca0b49c410f690519c0622990825fd5dba500 -rcaa15db89a49c98671f0a87dc2242d0fc7f683b7 --- firmware/source/sys_main.c (.../sys_main.c) (revision b36ca0b49c410f690519c0622990825fd5dba500) +++ firmware/source/sys_main.c (.../sys_main.c) (revision caa15db89a49c98671f0a87dc2242d0fc7f683b7) @@ -74,9 +74,6 @@ #include "Level.h" #include "MsgQueues.h" #include "OperationModes.h" -#ifdef __PUMPTEST__ -#include "PistonPumpControl.h" -#endif #include "Pressure.h" #include "SafetyShutdown.h" #include "SystemCommDD.h" @@ -185,9 +182,6 @@ initTDInterface(); initFPInterface(); initUltrafiltration(); -#ifdef __PUMPTEST__ - initPistonPump(); -#endif } /*************************************************************************