Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -rf68d42f6972d7be8e994cc35ba52d72a275800f0 -r12929ac400de74684371b01b962926f868922448 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision f68d42f6972d7be8e994cc35ba52d72a275800f0) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 12929ac400de74684371b01b962926f868922448) @@ -404,7 +404,7 @@ F32 bicarbVolume = getF32OverrideValue( &bicarbDoseVolume ); // Check fresh and spent dialysate pressure in range or BC switch only flag set -#ifndef __BC_PRESSURE_ALARM__ +#ifdef __BC_PRESSURE_ALARM__ if ( 1 ) #else if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && @@ -597,7 +597,7 @@ F32 bicarbVolume = getF32OverrideValue( &bicarbDoseVolume ); // Check fresh and spent dialysate pressure in range -#ifndef __BC_PRESSURE_ALARM__ +#ifdef __BC_PRESSURE_ALARM__ if ( 1 ) #else if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && Index: firmware/App/DDCommon.h =================================================================== diff -u -r399c6b8efe0bf5ca7f5afb0aa0bc38c557fa36be -r12929ac400de74684371b01b962926f868922448 --- firmware/App/DDCommon.h (.../DDCommon.h) (revision 399c6b8efe0bf5ca7f5afb0aa0bc38c557fa36be) +++ firmware/App/DDCommon.h (.../DDCommon.h) (revision 12929ac400de74684371b01b962926f868922448) @@ -40,10 +40,10 @@ //#define __PITEST__ 1 //Uncomment below if diener concentrate pump used -//#define __DIENER_CONC_PUMP__ 1 +#define __DIENER_CONC_PUMP__ 1 //Uncomment below if beta hardware is used -//#define __BETA_HW_VER__ 1 +#define __BETA_HW_VER__ 1 //Uncomment below if barometric pressure sensor reading available //#define __BARO_PRES_SENSOR__ 1 Index: firmware/App/Drivers/PressureSensor.c =================================================================== diff -u -rafb05eebd86337012af4f6a9d21cb9a1e7f5f16a -r12929ac400de74684371b01b962926f868922448 --- firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision afb05eebd86337012af4f6a9d21cb9a1e7f5f16a) +++ firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision 12929ac400de74684371b01b962926f868922448) @@ -32,11 +32,11 @@ #define PRES_SENSORS_COUNT_ERROR_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< Pressure sensors read and error count timeout in milliseconds. #define HIGH_PRES_MAX_PSI 145.038F ///< Convert pressure to PSI for 10 bar pressure sensor #define LOW_PRES_MAX_PSI 50.7632F ///< Convert pressure to PSI for 3.5 bar pressure sensor -#ifndef __BETA_HW_VER__ +#define __BETA_HW_VER__ #define PRES_MIN_PSI 0.0F ///< Minimum value for PSI conversion -#else +//#else #define PRES_MIN_PSI -14.5038F ///< Minimum value for PSI conversion -#endif +//#endif #define ONE_BAR_TO_MILLI_BAR 1000 ///< 1 bar to milli-bar conversion. #define COUNTS_TO_MILLI_BAR 100 ///< Counts to milli-bar conversion. #define BAR_TO_MMHG ( 750.062F ) ///< Conversion factor for converting bar to mmHg. @@ -146,7 +146,7 @@ void readPressureSensors( void ) { // Update and convert raw pressures to mmHg -#ifndef __BETA_HW_VER__ +#ifdef __BETA_HW_VER__ currentPressureReadings[ M1_PRES ].data = convertPressureReading( getFPGAM1PresRawPressure(), PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); currentPressureReadings[ M3_PRES ].data = convertPressureReading( getFPGAM3PresRawPressure(),PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); currentPressureReadings[ D9_PRES ].data = convertPressureReading( getFPGAD9PresRawPressure(),PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r724b64673b719eaac10b0c9dd839ad9675274911 -r12929ac400de74684371b01b962926f868922448 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 724b64673b719eaac10b0c9dd839ad9675274911) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 12929ac400de74684371b01b962926f868922448) @@ -138,7 +138,7 @@ // any new mode requests? newMode = arbitrateModeRequest(); // will return current mode if no pending requests - if ( ( isTestingActivated() != TRUE ) && ( getTestConfigStatus( TEST_CONFIG_RECOVER_TREATMENT ) != TRUE ) ) +// if ( ( isTestingActivated() != TRUE ) && ( getTestConfigStatus( TEST_CONFIG_RECOVER_TREATMENT ) != TRUE ) ) { // If the test configuration is not enabled check for the legality of the transition request newMode = MODE_TRANSITION_TABLE[ currentMode ][ newMode ]; Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r573a26b2a0273a4983b1de1cbff5bed63e01dce0 -r12929ac400de74684371b01b962926f868922448 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 573a26b2a0273a4983b1de1cbff5bed63e01dce0) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 12929ac400de74684371b01b962926f868922448) @@ -41,6 +41,7 @@ #include "SafetyShutdown.h" #include "SystemCommDD.h" #include "Temperature.h" +#include "TestSupport.h" #include "TDInterface.h" #include "Utilities.h" #include "Ultrafiltration.h" @@ -163,6 +164,9 @@ { MSG_ID_FW_VERSIONS_REQUEST, &handleVersionRequestMessage }, { MSG_ID_DD_SAFETY_SHUTDOWN_OVERRIDE_REQUEST, &testSetResetSafetyShutdownOverride }, { MSG_ID_DD_UF_DATA_PUBLISH_OVERRIDE_REQUEST, &testDDUFDataPublishIntervalOverride }, + { MSG_ID_DD_SET_TEST_CONFIGURATION, &handleSetTestConfiguration }, + { MSG_ID_DD_GET_TEST_CONFIGURATION, &handleGetTestConfiguration }, + { MSG_ID_DD_RESET_ALL_TEST_CONFIGURATIONS, &handleResetAllTestConfigurations }, #ifdef __PUMPTEST__ { MSG_ID_DD_PISTON_PUMP_DATA_PUBLISH_OVERRIDE_REQUEST, &testDDPistonPumpControlDataPublishIntervalOverride }, { MSG_ID_DD_PISTON_PUMP_START_STOP_OVERRIDE_REQUEST, &testDDPistonPumpStartStopOverride }, @@ -716,9 +720,90 @@ setSystemREG1_SYSECR( (0x2) << 14 ); // Reset processor } - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); + return result; +} +/*********************************************************************//** + * @brief + * The handleSetTestConfiguration 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 handleSetTestConfiguration( 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 handleGetTestConfiguration 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 handleGetTestConfiguration( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // verify payload length + if ( 0 == message->hdr.payloadLen ) + { + result = sendTestConfigStatusToDialin(); + } + + return result; +} + +/*********************************************************************//** + * @brief + * The handleResetTestConfiguration 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 handleResetAllTestConfigurations( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // verify payload length + if ( 0 == message->hdr.payloadLen ) + { + result = resetAllTestConfigs(); + } + + return result; +} + /**@}*/ Index: firmware/App/Services/Messaging.h =================================================================== diff -u -r88f86f2dc5107670e32f53e04e256ad8249ba55f -r12929ac400de74684371b01b962926f868922448 --- firmware/App/Services/Messaging.h (.../Messaging.h) (revision 88f86f2dc5107670e32f53e04e256ad8249ba55f) +++ firmware/App/Services/Messaging.h (.../Messaging.h) (revision 12929ac400de74684371b01b962926f868922448) @@ -79,6 +79,11 @@ BOOL handleTesterLogInRequest( MESSAGE_T *message ); BOOL handleDDSoftwareResetRequest( MESSAGE_T *message ); +BOOL handleSetTestConfiguration( MESSAGE_T *message ); +BOOL handleGetTestConfiguration( MESSAGE_T *message ); +//BOOL handleSendTestConfiguration( MESSAGE_T *message ); +BOOL handleResetAllTestConfigurations( MESSAGE_T *message ); + /**@}*/ #endif