Index: firmware/App/Controllers/AirTrap.c =================================================================== diff -u -r79a1bc916aaa25b696385e9b292bf6262bab6113 -r18981bf79f6c19a1822f003084e80547c21cdb62 --- firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision 79a1bc916aaa25b696385e9b292bf6262bab6113) +++ firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision 18981bf79f6c19a1822f003084e80547c21cdb62) @@ -440,7 +440,7 @@ // Air pump stop time based on the blood flow rate S32 qB = 500; // TODO abs( getTargetBloodFlowRate() ); U32 qBx = ( 0 == qB ? MIN_SET_BLOOD_FLOW_RATE : (U32)qB ); - U32 airPumpStopTime = AIR_PUMP_LOWER_OP_TIME_MIN_MS + ( ( qBx - MIN_SET_BLOOD_FLOW_RATE ) / 2 ); + U32 airPumpStopTime = 10000; //AIR_PUMP_LOWER_OP_TIME_MIN_MS + ( ( qBx - MIN_SET_BLOOD_FLOW_RATE ) / 2 ); // Transition to manual valve control state when requested if ( TRUE == pendingStopAirTrapController ) @@ -523,6 +523,7 @@ data.h13State = get3WayValveState( H13_VALV ); data.h20State = get3WayValveState( H20_VALV ); data.isAutoControlling = isAirTrapControlling(); + data.airTrapState = airTrapControllerState; broadcastData( MSG_ID_TD_AIR_TRAP_DATA, COMM_BUFFER_OUT_CAN_TD_BROADCAST, (U08*)&data, sizeof( AIR_TRAP_PAYLOAD_T ) ); airTrapDataPublicationTimerCounter = 0; Index: firmware/App/Controllers/AirTrap.h =================================================================== diff -u -reaff654b897f641b874e3ba30a22cbda3779e4a7 -r18981bf79f6c19a1822f003084e80547c21cdb62 --- firmware/App/Controllers/AirTrap.h (.../AirTrap.h) (revision eaff654b897f641b874e3ba30a22cbda3779e4a7) +++ firmware/App/Controllers/AirTrap.h (.../AirTrap.h) (revision 18981bf79f6c19a1822f003084e80547c21cdb62) @@ -62,6 +62,8 @@ BOOL testAirTrapDataPublishIntervalOverride( MESSAGE_T *message ); BOOL testSetAirTrapControl( MESSAGE_T *message ); +BOOL testAirPumpPowerRaiseOverride( MESSAGE_T *message ); +BOOL testAirPumpPowerLowerOverride( MESSAGE_T *message ); /**@}*/ Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -rc06a32218bad65414ccda5d41293e5349e46d241 -r18981bf79f6c19a1822f003084e80547c21cdb62 --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision c06a32218bad65414ccda5d41293e5349e46d241) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 18981bf79f6c19a1822f003084e80547c21cdb62) @@ -383,6 +383,7 @@ isBloodPumpOn = FALSE; bpControlTimerCounter = 0; setPeristalticPumpSetSpeed( bloodPumpSetSpeedRPM ); + setPeristalticPumpHardStop(); resetPIController( PI_CONTROLLER_ID_BLOOD_FLOW, 0.0F, 0.0F ); } @@ -1319,6 +1320,27 @@ /*********************************************************************//** * @brief + * The testHardStopBloodPump function hard stops the blood pump. + * @details \b Inputs: none + * @details \b Outputs: none + * @param message BP home command message from Dialin. + * @return TRUE if command successful, FALSE if not + *************************************************************************/ +BOOL testHardStopBloodPump( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + if ( 0 == message->hdr.payloadLen ) + { + result = TRUE; + signalBloodPumpHardStop(); + } + + return result; +} + +/*********************************************************************//** + * @brief * The testBPFlowAlphaYInterceptOverride function overrides the Alpha Y * intercept of the blood flow estimation equation. * @details \b Inputs: none Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -rc06a32218bad65414ccda5d41293e5349e46d241 -r18981bf79f6c19a1822f003084e80547c21cdb62 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision c06a32218bad65414ccda5d41293e5349e46d241) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 18981bf79f6c19a1822f003084e80547c21cdb62) @@ -23,7 +23,7 @@ #include "ModeFault.h" #include "ModeStandby.h" #include "ModeTxParams.h" -//#include "ModePreTreat.h" +#include "ModePreTreat.h" #include "ModeTreatment.h" //#include "ModePostTreat.h" //#include "NVDataMgmt.h" @@ -207,10 +207,10 @@ currentSubMode = execTreatParamsMode(); break; -// case MODE_PRET: -// currentSubMode = execPreTreatmentMode(); -// break; -// + case MODE_PRET: + currentSubMode = execPreTreatmentMode(); + break; + case MODE_TREA: currentSubMode = execTreatmentMode(); break; @@ -413,9 +413,9 @@ case MODE_TPAR: currentSubMode = transitionToTreatParamsMode(); break; -// case MODE_PRET: -// currentSubMode = transitionToPreTreatmentMode(); -// break; + case MODE_PRET: + currentSubMode = transitionToPreTreatmentMode(); + break; case MODE_TREA: currentSubMode = transitionToTreatmentMode(); break; Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r927c47388ab6bd716b857f76e2026c116dd52e69 -r18981bf79f6c19a1822f003084e80547c21cdb62 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 927c47388ab6bd716b857f76e2026c116dd52e69) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 18981bf79f6c19a1822f003084e80547c21cdb62) @@ -117,7 +117,7 @@ { MSG_ID_TD_VOLTAGE_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testVoltageDataPublishIntervalOverride }, { MSG_ID_TD_VOLTAGE_OVERRIDE_REQUEST, &testVoltageOverride }, { MSG_ID_TD_PRESSURE_OVERRIDE_REQUEST, &testPressureSensorOverride }, - { MSG_ID_TD_PRESSURE_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testSwitchesDataPublishIntervalOverride }, + { MSG_ID_TD_PRESSURE_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testPressuresDataPublishIntervalOverride }, { MSG_ID_TD_AIR_PUMP_SET_STATE_REQUEST, &testSetAirPump }, { MSG_ID_TD_AIR_PUMP_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testAirPumpDataPublishIntervalOverride }, { MSG_ID_TD_SWITCHES_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testSwitchesDataPublishIntervalOverride }, @@ -165,6 +165,11 @@ { MSG_ID_TD_BLOOD_FLOW_ALPHA_Y_INTERCEPT_OVERRIDE_REQUEST, &testBPFlowAlphaYInterceptOverride }, { MSG_ID_TD_BLOOD_FLOW_WEAR_A_TERM_OVERRIDE_REQUEST, &testBPFlowWearATermOverride }, { MSG_ID_TD_BLOOD_FLOW_WEAR_B_TERM_OVERRIDE_REQUEST, &testBPFlowWearBTermOverride }, + { MSG_ID_TD_SET_TEST_CONFIGURATION, &testSetTestConfiguration }, + { MSG_ID_TD_GET_TEST_CONFIGURATION, &testGetTestConfiguration }, + { MSG_ID_TD_RESET_ALL_TEST_CONFIGURATIONS, &testResetAllTestConfigurations }, + { MSG_ID_TD_AIR_PUMP_POWER_RAISE_OVERRIDE_REQUEST, &testAirPumpPowerRaiseOverride }, + { MSG_ID_TD_AIR_PUMP_POWER_LOWER_OVERRIDE_REQUEST, &testAirPumpPowerLowerOverride }, { MSG_ID_TD_HARD_STOP_BLOOD_PUMP, &testHardStopBloodPump } }; @@ -671,4 +676,87 @@ 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/App/TDCommon.h =================================================================== diff -u -reaff654b897f641b874e3ba30a22cbda3779e4a7 -r18981bf79f6c19a1822f003084e80547c21cdb62 --- firmware/App/TDCommon.h (.../TDCommon.h) (revision eaff654b897f641b874e3ba30a22cbda3779e4a7) +++ firmware/App/TDCommon.h (.../TDCommon.h) (revision 18981bf79f6c19a1822f003084e80547c21cdb62) @@ -25,7 +25,7 @@ #define TD_VERSION_MAJOR 0 #define TD_VERSION_MINOR 0 #define TD_VERSION_MICRO 0 -#define TD_VERSION_BUILD 12 +#define TD_VERSION_BUILD 16 // ********** development build switches **********