Index: firmware/.launches/DG.launch =================================================================== diff -u -rf3aae110ab3efde68897d0224f799dc039ac84f5 -r47c41046beba8affaaaa13a4f222a7b99bd193f1 --- firmware/.launches/DG.launch (.../DG.launch) (revision f3aae110ab3efde68897d0224f799dc039ac84f5) +++ firmware/.launches/DG.launch (.../DG.launch) (revision 47c41046beba8affaaaa13a4f222a7b99bd193f1) @@ -1,5 +1,11 @@ + + + + + + @@ -17,4 +23,5 @@ + Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r67021fbc633259e8e1bce76749dbef7d0cb51998 -r47c41046beba8affaaaa13a4f222a7b99bd193f1 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 67021fbc633259e8e1bce76749dbef7d0cb51998) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 47c41046beba8affaaaa13a4f222a7b99bd193f1) @@ -31,6 +31,7 @@ #include "Reservoirs.h" #include "ROPump.h" #include "RTC.h" +#include "SafetyShutdown.h" #include "SystemCommMessages.h" #include "TemperatureSensors.h" #include "Thermistors.h" @@ -196,6 +197,11 @@ postState = handlePOSTStatus( testStatus ); break; + case DG_POST_STATE_SAFETY_SHUTDOWN: + testStatus = execSafetyShutdownTest(); + postState = handlePOSTStatus( testStatus ); + break; + // Should be last POST (and last POST test must be a test that completes in a single call) case DG_POST_STATE_LOAD_CELL: testStatus = execLoadCellsSelfTest(); Index: firmware/App/Modes/ModeRecirculate.c =================================================================== diff -u -r9cfc69328f6b54a6b8e3737dfa24db607105cdd9 -r47c41046beba8affaaaa13a4f222a7b99bd193f1 --- firmware/App/Modes/ModeRecirculate.c (.../ModeRecirculate.c) (revision 9cfc69328f6b54a6b8e3737dfa24db607105cdd9) +++ firmware/App/Modes/ModeRecirculate.c (.../ModeRecirculate.c) (revision 47c41046beba8affaaaa13a4f222a7b99bd193f1) @@ -24,6 +24,7 @@ #include "FPGA.h" #include "Heaters.h" #include "ModeRecirculate.h" +#include "NVDataMgmt.h" #include "OperationModes.h" #include "Pressures.h" #include "ROPump.h" @@ -44,12 +45,11 @@ #define TARGET_RO_FLOW_RATE_L 0.3 ///< Target flow rate for RO pump. #define TARGET_FLUSH_LINES_RO_FLOW_RATE_L 0.6 ///< Target flow rate for RO pump. -#define FLUSH_LINES_VOLUME_L 0.01 ///< Water volume (in Liters) to flush when starting re-circulate mode. // ********** private data ********** -static DG_RECIRCULATE_MODE_STATE_T recircState; ///< Currently active re-circulation state. -static F32 flushLinesVolumeL = 0.0; ///< Volume of water pumped by RO pump during flush lines state. +static DG_RECIRCULATE_MODE_STATE_T recircState; ///< Currently active re-circulation state. +static F32 flushLinesVolumeL = 0.0; ///< Volume of water pumped by RO pump during flush lines state. // ********** private function prototypes ********** @@ -66,7 +66,7 @@ *************************************************************************/ void initRecirculateMode( void ) { - recircState = DG_RECIRCULATE_MODE_STATE_START; + recircState = DG_RECIRCULATE_MODE_STATE_START; flushLinesVolumeL = 0.0; } @@ -87,6 +87,8 @@ setValveState( VPI, VALVE_STATE_OPEN ); #ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); + setValveState( VRD1, VALVE_STATE_CLOSED ); + setValveState( VRD2, VALVE_STATE_CLOSED ); #endif setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); @@ -107,7 +109,7 @@ // NOTE: The target flow rate should be set prior to setting the start primary heater // because the initial guess in the heaters driver needs the target flow to calculate // the new PWMs for the main and small primary heaters - setROPumpTargetFlowRate( TARGET_RO_FLOW_RATE_L, TARGET_RO_PRESSURE_PSI ); + setROPumpTargetFlowRate( TARGET_FLUSH_LINES_RO_FLOW_RATE_L, TARGET_RO_PRESSURE_PSI ); startPrimaryHeater(); #ifndef _VECTORCAST_ @@ -121,9 +123,11 @@ /*********************************************************************//** * @brief - * The execRecirculateMode function executes the re-circulate mode state machine. + * The execRecirculateMode function executes the re-circulate mode state + * machine. * @details Inputs: recircState - * @details Outputs: Check water quality, re-circulate mode state machine executed + * @details Outputs: Check water quality, re-circulate mode state machine + * executed * @return current state *************************************************************************/ U32 execRecirculateMode( void ) @@ -164,6 +168,35 @@ /*********************************************************************//** * @brief + * The requestDGStop function handles an HD request to stop (return to standby mode). + * @details Inputs: none + * @details Outputs: DG standby mode requested + * @return TRUE if request accepted, FALSE if not. + *************************************************************************/ +BOOL requestDGStop( void ) +{ + BOOL result = TRUE; + + requestNewOperationMode( DG_MODE_STAN ); + + return result; +} + +/*********************************************************************//** + * @brief + * The getCurrentRecirculateState function returns the current state of the + * re-circulate mode. + * @details Inputs: recircState + * @details Outputs: none + * @return the current state of re-circulate mode + *************************************************************************/ +DG_RECIRCULATE_MODE_STATE_T getCurrentRecirculateState( void ) +{ + return recircState; +} + +/*********************************************************************//** + * @brief * The handleFlushLinesState function executes the flush lines state of the * re-circulate mode state machine. * @details Inputs: none @@ -176,11 +209,11 @@ F32 waterFlowRate = getMeasuredROFlowRate(); F32 waterVolume = ( ( waterFlowRate / SEC_PER_MIN ) / ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ); - // integrate volume of water moved through line + // Integrate volume of water moved through line flushLinesVolumeL += waterVolume; - // when enough water volume has flowed to flush the lines, transition to re-circ state - if ( flushLinesVolumeL >= FLUSH_LINES_VOLUME_L ) + // When enough water volume has flowed to flush the lines, transition to re-circ state + if ( flushLinesVolumeL >= getRecirculationDrainVol() ) { setValveState( VDR, VALVE_STATE_RECIRC_C_TO_NC ); setROPumpTargetFlowRate( TARGET_RO_FLOW_RATE_L, TARGET_RO_PRESSURE_PSI ); @@ -220,33 +253,4 @@ return result; } -/*********************************************************************//** - * @brief - * The requestDGStop function handles an HD request to stop (return to standby mode). - * @details Inputs: none - * @details Outputs: DG standby mode requested - * @return TRUE if request accepted, FALSE if not. - *************************************************************************/ -BOOL requestDGStop( void ) -{ - BOOL result = TRUE; - - requestNewOperationMode( DG_MODE_STAN ); - - return result; -} - -/*********************************************************************//** - * @brief - * The getCurrentRecirculateState function returns the current state of the - * re-circulate mode. - * @details Inputs: recircState - * @details Outputs: none - * @return the current state of re-circulate mode - *************************************************************************/ -DG_RECIRCULATE_MODE_STATE_T getCurrentRecirculateState( void ) -{ - return recircState; -} - /**@}*/ Index: firmware/App/Services/AlarmMgmt.h =================================================================== diff -u -r67021fbc633259e8e1bce76749dbef7d0cb51998 -r47c41046beba8affaaaa13a4f222a7b99bd193f1 --- firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision 67021fbc633259e8e1bce76749dbef7d0cb51998) +++ firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision 47c41046beba8affaaaa13a4f222a7b99bd193f1) @@ -75,7 +75,7 @@ ALARM_DATAS_T data; ///< The alarm data of specified type } ALARM_DATA_T; #pragma pack(pop) - + // ********** public function prototypes ********** void initAlarmMgmt( void ); Index: firmware/App/Services/AlarmMgmtSWFaults.h =================================================================== diff -u -r1c74566ff86f1df5e1929b8715d68715dc21a93b -r47c41046beba8affaaaa13a4f222a7b99bd193f1 --- firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision 1c74566ff86f1df5e1929b8715d68715dc21a93b) +++ firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision 47c41046beba8affaaaa13a4f222a7b99bd193f1) @@ -107,7 +107,7 @@ SW_FAULT_ID_HEAT_DISINFECT_INVALID_EXEC_STATE, SW_FAULT_ID_INVALID_DG_RESERVOIR_SELECTED, SW_FAULT_ID_STANDBY_MODE_INVALID_EXEC_STATE, - SW_FAULT_ID_GEN_IDLE_MODE_INVALID_EXEC_STATE, + SW_FAULT_ID_RECIRC_MODE_INVALID_EXEC_STATE, SW_FAULT_ID_DRAIN_MODE_INVALID_EXEC_STATE, // 80 SW_FAULT_ID_FILL_MODE_INVALID_EXEC_STATE, SW_FAULT_ID_SOLO_MODE_INVALID_EXEC_STATE, @@ -125,6 +125,9 @@ SW_FAULT_ID_INVALID_MONITORED_VOLTAGE_ID, SW_FAULT_ID_INVALID_LOAD_CELL_ID, // 95 SW_FAULT_ID_DG_CHEM_DISINFECT_INVALID_EXEC_STATE, + SW_FAULT_ID_DG_INVALID_SWITCH_ID, + SW_FAULT_ID_DG_PRESSURES_INVALID_SELF_TEST_STATE, + SW_FAULT_ID_SAFETY_SHUTDOWN_INVALID_SELF_TEST_STATE, NUM_OF_SW_FAULT_IDS } SW_FAULT_ID_T; Index: firmware/App/Services/Interrupts.c =================================================================== diff -u -r8467f8ff09e382e0991f14d02683080dc811e24e -r47c41046beba8affaaaa13a4f222a7b99bd193f1 --- firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 8467f8ff09e382e0991f14d02683080dc811e24e) +++ firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 47c41046beba8affaaaa13a4f222a7b99bd193f1) @@ -29,9 +29,6 @@ #include "TaskPriority.h" #include "TaskTimer.h" #include "Utilities.h" -#ifdef DEBUG_ENABLED - #include "SystemCommMessages.h" -#endif /** * @addtogroup Interrupts @@ -45,10 +42,6 @@ // ********** private data ********** -static U32 sci2FrameErrorCnt; ///< SCI2 frame error count. -static U32 sci2OverrunErrorCnt; ///< SCI2 overrun error count. - -static U32 can1PassiveCnt; ///< CAN1 passive count. static U32 can1WarningCnt; ///< CAN1 warning count. static U32 can1BusOffCnt; ///< CAN1 bus offline count. static U32 can1ParityCnt; ///< CAN1 parity count. @@ -62,15 +55,11 @@ *************************************************************************/ void initInterrupts( void ) { - sci2FrameErrorCnt = 0; - sci2OverrunErrorCnt = 0; - can1PassiveCnt = 0; can1WarningCnt = 0; can1BusOffCnt = 0; can1ParityCnt = 0; // initialize various time windowed counts for monitoring CAN & UART errors and warnings - initTimeWindowedCount( TIME_WINDOWED_COUNT_CAN_PASSIVE, MAX_COMM_ERRORS, COMM_ERROR_TIME_WINDOW_MS ); initTimeWindowedCount( TIME_WINDOWED_COUNT_CAN_OFF, MAX_COMM_ERRORS, COMM_ERROR_TIME_WINDOW_MS ); initTimeWindowedCount( TIME_WINDOWED_COUNT_CAN_PARITY, MAX_COMM_ERRORS, COMM_ERROR_TIME_WINDOW_MS ); initTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_UART_FRAME_ERROR, MAX_COMM_ERRORS, COMM_ERROR_TIME_WINDOW_MS ); @@ -87,15 +76,6 @@ void phantomInterrupt( void ) { // TODO - what to do with phantom interrupts? -#ifdef DEBUG_ENABLED - { - char debugStr[ 50 ]; - - strcpy( debugStr, "DG-phantom interrupt\n" ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - sendDebugDataToUI( (U08*)debugStr ); - } -#endif } /*********************************************************************//** @@ -166,6 +146,7 @@ { if ( node == canREG1 ) { + // Parity error - message RAM is corrupted if ( notification & canLEVEL_PARITY_ERR ) { can1ParityCnt++; @@ -174,6 +155,7 @@ SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_CAN_PARITY_ERROR ) } } + // Bus off - our transmitter has counted 255+ errors else if ( notification & canLEVEL_BUS_OFF ) { can1BusOffCnt++; @@ -182,62 +164,20 @@ SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_CAN_OFF_ERROR ) } } + // Warning - our transmitter has counted 96+ errors else if ( notification & canLEVEL_WARNING ) { can1WarningCnt++; } - else if ( notification & canLEVEL_PASSIVE ) - { - can1PassiveCnt++; - if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_CAN_PASSIVE ) ) - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_CAN_PASSIVE_WARNING ) - } - } else { - // ignore - other notifications undefined + // Ignore - other notifications - unhandled } } } /*********************************************************************//** * @brief - * The sciNotification function handles UART communication error interrupts. - * Frame and Over-run errors are handled. - * @details Inputs: none - * @details Outputs: UART error interrupts handled. - * @param sci pointer to the SCI peripheral that detected the error - * @param flags error flag(s) - * @return none - *************************************************************************/ -void sciNotification(sciBASE_t *sci, uint32 flags) -{ - if ( sci == scilinREG ) - { - if ( ( flags & SCI_FE_INT ) != 0 ) - { - sci2FrameErrorCnt++; - clearSCI2CommErrors(); - if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_UART_FRAME_ERROR ) ) - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_FPGA_UART_FRAME_ERROR ) - } - } - if ( ( flags & SCI_OE_INT ) != 0 ) - { - sci2OverrunErrorCnt++; - clearSCI2CommErrors(); - if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_UART_OVERRUN ) ) - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_FPGA_UART_OVERRUN_ERROR ) - } - } - } -} - -/*********************************************************************//** - * @brief * The dmaGroupANotification function handles communication DMA interrupts. * @details Inputs: none * @details Outputs: DMA interrupt is handled. Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -r476da1c222d2af6833d9e66a637c977bf927188f -r47c41046beba8affaaaa13a4f222a7b99bd193f1 --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 476da1c222d2af6833d9e66a637c977bf927188f) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 47c41046beba8affaaaa13a4f222a7b99bd193f1) @@ -36,7 +36,6 @@ #define MIN_RESERVOIR_VOLUME_ML 0 ///< Minimum reservoir volume in mL. #define MAX_RESERVOIR_VOLUME_ML 2000 ///< Maximum reservoir volume in mL. #define DEFAULT_FILL_VOLUME_ML 1700 ///< Default fill volume for treatment in mL. -#define DISINFECT_FILL_VOLUME_ML 2400 ///< Fill volume for disinfection in mL. #define MAX_FILL_VOLUME_ML MAX_RESERVOIR_VOLUME_ML ///< Maximum fill volume in mL. #define DEFAULT_DRAIN_VOLUME_ML 0 ///< Default drain volume in mL. #define MAX_DRAIN_VOLUME_ML MAX_RESERVOIR_VOLUME_ML ///< Maximum drain volume in mL. @@ -63,13 +62,15 @@ static F32 reservoirLowestWeight[ NUM_OF_DG_RESERVOIRS ] = { MAX_RESERVOIR_WEIGHT, MAX_RESERVOIR_WEIGHT }; static U32 reservoirWeightUnchangeStartTime[ NUM_OF_DG_RESERVOIRS ] = { 0, 0 }; ///< The reservoirs' weight start time when weight stop decreasing. static BOOL tareLoadCellRequest; ///< Flag indicates if load cell tare has been requested by HD. +static DG_RESERVOIR_VOLUME_RECORD_T reservoirsCalRecord; ///< DG reservoirs non-volatile record. // ********** private function prototypes ********** static DG_RESERVOIR_ID_T getActiveReservoir( void ); static U32 getReservoirFillVolumeTargetMl( void ); -static U32 getReservoirDrainVolumeTargetMl( void ); +static U32 getReservoirDrainVolumeTargetMl( void ); +static BOOL processCalibrationData( void ); /*********************************************************************//** * @brief @@ -93,7 +94,14 @@ * @return none *************************************************************************/ void execReservoirs( void ) -{ +{ + // Check if a new calibration is available + if ( TRUE == isNewCalibrationRecordAvailable() ) + { + // Get the new calibration data and check its validity + processCalibrationData(); + } + // publish active reservoir, fill/drain volume targets at 1 Hz. if ( ++reservoirDataPublicationTimerCounter >= RESERVOIR_DATA_PUB_INTERVAL ) { @@ -103,6 +111,31 @@ broadcastReservoirData( actRes, filVol, drnVol ); reservoirDataPublicationTimerCounter = 0; } +} + +/*********************************************************************//** + * @brief + * The execDrainPumpSelfTest function executes the drain pump's self-test. + * @details Inputs: none + * @details Outputs: none + * @return PressuresSelfTestResult (SELF_TEST_STATUS_T) + *************************************************************************/ +SELF_TEST_STATUS_T execReservoirsSelfTest( void ) +{ + SELF_TEST_STATUS_T result = SELF_TEST_STATUS_IN_PROGRESS; + + BOOL calStatus = processCalibrationData(); + + if ( TRUE == calStatus ) + { + result = SELF_TEST_STATUS_PASSED; + } + else + { + result = SELF_TEST_STATUS_FAILED; + } + + return result; } /*********************************************************************//** @@ -228,8 +261,7 @@ cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; // fill command only valid in re-circulate mode - if ( ( DG_MODE_CIRC == getCurrentOperationMode() ) && - ( DG_RECIRCULATE_MODE_STATE_RECIRC_WATER == getCurrentRecirculateState() ) ) + if ( ( DG_MODE_CIRC == getCurrentOperationMode() ) && ( DG_RECIRCULATE_MODE_STATE_RECIRC_WATER == getCurrentRecirculateState() ) ) { // validate parameters if ( fillToVolMl < MAX_FILL_VOLUME_ML ) @@ -412,6 +444,19 @@ /*********************************************************************//** * @brief + * The getReservoirsCalRecord function returns the reservoirs' calibration + * record. + * @details Inputs: reservoirsCalRecord + * @details Outputs: none + * @return reservoirs' calibration record + *************************************************************************/ +DG_RESERVOIR_VOLUME_RECORD_T getReservoirsCalRecord( void ) +{ + return reservoirsCalRecord; +} + +/*********************************************************************//** + * @brief * The hasTargetFillVolumeReached function checks if the target fill volume * for specific reservoir has been reached. * @details Inputs: fillVolumeTargetMl @@ -562,7 +607,47 @@ return result; } +/*********************************************************************//** + * @brief + * The processCalibrationData function gets the calibration data and makes + * sure it is valid by checking the calibration date. The calibration date + * should not be 0. + * @details Inputs: none + * @details Outputs: reservoirsCalRecord + * @return TRUE if the calibration record is valid, otherwise FALSE + *************************************************************************/ +static BOOL processCalibrationData( void ) +{ + BOOL status = TRUE; + U32 reservoir; + // Get the calibration record from NVDataMgmt + DG_RESERVOIR_VOLUME_RECORD_T calData = getDGReservoirsVolumeRecord(); + + for ( reservoir = 0; reservoir < NUM_OF_CAL_DATA_RSRVRS; reservoir++ ) + { +#ifndef SKIP_CAL_CHECK + // Check if the calibration data that was received from NVDataMgmt is legitimate + // The calibration date item should not be zero. If the calibration date is 0, + // then the data is not stored in the NV memory or it was corrupted. + if ( 0 == calData.reservoir[ reservoir ].calibrationTime ) + { + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_RESERVOIRS_INVALID_CAL_RECORD, (U32)reservoir ); + status = FALSE; + } +#endif + + // The calibration data was valid, update the local copy + reservoirsCalRecord.reservoir[ reservoir ].maxResidualFluid = calData.reservoir[ reservoir ].maxResidualFluid; + reservoirsCalRecord.reservoir[ reservoir ].normalFillVolume = calData.reservoir[ reservoir ].normalFillVolume; + reservoirsCalRecord.reservoir[ reservoir ].rsrvrUnfilledWeight = calData.reservoir[ reservoir ].rsrvrUnfilledWeight; + reservoirsCalRecord.reservoir[ reservoir ].rsrvrVolume = calData.reservoir[ reservoir ].rsrvrVolume; + } + + return status; +} + + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r3ca2e68a33885153648ba20346e3548438b58724 -r47c41046beba8affaaaa13a4f222a7b99bd193f1 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 3ca2e68a33885153648ba20346e3548438b58724) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 47c41046beba8affaaaa13a4f222a7b99bd193f1) @@ -249,14 +249,6 @@ { canTransmit( canREG1, lastCANPacketSentChannel, lastCANPacketSent ); } -#ifdef DEBUG_ENABLED - { - char debugStr[100]; - strcpy( debugStr, "SystemComm-DG resend Last Frame.\n" ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - sendDebugDataToUI( (U08*)debugStr ); - } -#endif } // we must be only node on CAN bus - nobody is ACKing our transmitted frames else @@ -265,11 +257,6 @@ canXmitRetryCtr = MAX_XMIT_RETRIES; signalCANXmitsCompleted(); // clear pending xmit flag clearCANXmitBuffers(); // clear xmit buffers - nothing is going out right now -#ifdef DEBUG_ENABLED - char debugStr[100]; - strcpy( debugStr, "SystemComm-DG is only node.\n" ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); -#endif } // end - are we retrying xmit or are we alone on CAN bus } // end - pending xmit timeout? } // end - transmit in progress or not @@ -857,14 +844,6 @@ { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_COMM_TOO_MANY_BAD_CRCS, 2 ); // 2 for DG } -#ifdef DEBUG_ENABLED - { - char debugStr[100]; - - strcpy( debugStr, "SystemComm-DG-Bad Msg CRC.\n" ); - sendDebugDataToUI( (U08*)debugStr ); - } -#endif } /*********************************************************************//** @@ -1054,6 +1033,10 @@ handleUIClockSyncRequest( message ); break; + case MSG_ID_HD_DG_POST_RESULT_REQUEST: + handleDGPOSTResultRequest( message ); + break; + case MSG_ID_UI_REQUEST_SERVICE_INFO: handleDGServiceScheduleRequest( message ); break; @@ -1285,6 +1268,10 @@ handleSetFluidLeakStateDetectorOverrideRequest( message ); break; + case MSG_ID_DG_OP_MODE_PUBLISH_INTERVAL_OVERRIDE: + handleSetDGOpModeBroadcastIntervalOverrideRequest( message ); + break; + case MSG_ID_FILTER_FLUSH_TIME_PERIOD_OVERRIDE: handleFilterFlushTimePeriodOverride(message); break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r3ca2e68a33885153648ba20346e3548438b58724 -r47c41046beba8affaaaa13a4f222a7b99bd193f1 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 3ca2e68a33885153648ba20346e3548438b58724) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 47c41046beba8affaaaa13a4f222a7b99bd193f1) @@ -3128,6 +3128,38 @@ /*********************************************************************//** * @brief +* The handleSetDGOpModeBroadcastIntervalOverrideRequest function handles a request +* to override the publish interval of the DG operation mode. +* @details Inputs: none +* @details Outputs: message handled +* @param message a pointer to the message to handle +* @return none +*************************************************************************/ +BOOL handleSetDGOpModeBroadcastIntervalOverrideRequest( MESSAGE_T *message ) +{ + TEST_OVERRIDE_PAYLOAD_T payload; + BOOL result = FALSE; + + // verify payload length + if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) + { + memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) + { + result = testSetDGOpModePublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetDGOpModePublishIntervalOverride(); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** +* @brief * The handleROPumpTargetPressureOverride function handles a request * to override the RO pump target pressure. * @details Inputs: none @@ -3235,6 +3267,40 @@ /*********************************************************************//** * @brief +* The handleDGPOSTResultRequest function handles a request to report DG +* POST results. +* @details Inputs: none +* @details Outputs: message handled +* @param message a pointer to the message to handle +* @return none +*************************************************************************/ +void handleDGPOSTResultRequest( MESSAGE_T *message ) +{ + BOOL status = FALSE; + BOOL result = FALSE; + U08* payloadPtr = message->payload; + + if ( 0 == message->hdr.payloadLen ) + { + if ( TRUE == isPOSTCompleted() ) + { + status = TRUE; + if ( TRUE == isPOSTPassed() ) + { + result = TRUE; + } + sendPOSTFinalResult( result ); + } + } + // If can't respond to request, NAK the message + if ( status != TRUE ) + { + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, status ); + } +} + +/*********************************************************************//** +* @brief * The handleSetDGCalibrationRecord function handles a request to set the DG * calibration data record. * @details Inputs: none Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r3ca2e68a33885153648ba20346e3548438b58724 -r47c41046beba8affaaaa13a4f222a7b99bd193f1 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 3ca2e68a33885153648ba20346e3548438b58724) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 47c41046beba8affaaaa13a4f222a7b99bd193f1) @@ -354,6 +354,9 @@ // MSG_ID_UI_DG_SET_RTC_REQUEST void handleUIClockSyncRequest( MESSAGE_T *message ); +// MSG_ID_HD_DG_POST_RESULT_REQUEST +void handleDGPOSTResultRequest( MESSAGE_T *message ); + // MSG_ID_DG_SET_CALIBRATION_DATA void handleSetDGCalibrationRecord( MESSAGE_T *message ); @@ -381,6 +384,9 @@ // MSG_ID_DG_START_STOP_CHEM_DSINFECT BOOL handleStartStopDGChemicalDisinfect( MESSAGE_T *message ); +// MSG_ID_DG_OP_MODE_PUBLISH_INTERVAL_OVERRIDE +BOOL handleSetDGOpModeBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + // MSG_ID_FILTER_FLUSH_TIME_PERIOD_OVERRIDE void handleFilterFlushTimePeriodOverride( MESSAGE_T *message ); Index: firmware/App/Services/WatchdogMgmt.c =================================================================== diff -u -r325ad799da3a89391779d28c8b9a7e957ac9ef84 -r47c41046beba8affaaaa13a4f222a7b99bd193f1 --- firmware/App/Services/WatchdogMgmt.c (.../WatchdogMgmt.c) (revision 325ad799da3a89391779d28c8b9a7e957ac9ef84) +++ firmware/App/Services/WatchdogMgmt.c (.../WatchdogMgmt.c) (revision 47c41046beba8affaaaa13a4f222a7b99bd193f1) @@ -114,7 +114,7 @@ } // check to see if watchdog has expired - if ( getCPLDWatchdogExpired() == PIN_SIGNAL_LOW ) + if ( PIN_SIGNAL_LOW == getCPLDWatchdogExpired() ) { // ignore expired watchdog until after watchdog POST if ( ( WATCHDOG_SELF_TEST_STATE_COMPLETE == watchdogSelfTestState ) || @@ -168,7 +168,7 @@ { // waiting here for w.d. test period to prevent this task from checking in - watchdog should expire } - if ( getCPLDWatchdogExpired() == PIN_SIGNAL_LOW ) + if ( PIN_SIGNAL_LOW == getCPLDWatchdogExpired() ) { F32 v24 = getIntADCVoltageConverted( INT_ADC_PRIMARY_HEATER_24_VOLTS ); @@ -295,7 +295,7 @@ } else { - activateAlarmNoData( ALARM_ID_DG_SOFTWARE_FAULT ); + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_TASK, task ); } return result;