Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -rddb9707d9e6e46c4b384782aeec20d41f3822996 -rc0375e039dd42ecf7b7d68ce7f2407e52dfe83eb --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision ddb9707d9e6e46c4b384782aeec20d41f3822996) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision c0375e039dd42ecf7b7d68ce7f2407e52dfe83eb) @@ -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" @@ -197,7 +198,7 @@ break; case DG_POST_STATE_SAFETY_SHUTDOWN: - testStatus = SELF_TEST_STATUS_PASSED; + testStatus = execSafetyShutdownTest(); postState = handlePOSTStatus( testStatus ); break; Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r22f1a58ac8e419353ec004b04e7c765c1d59df2b -rc0375e039dd42ecf7b7d68ce7f2407e52dfe83eb --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 22f1a58ac8e419353ec004b04e7c765c1d59df2b) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision c0375e039dd42ecf7b7d68ce7f2407e52dfe83eb) @@ -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; @@ -1293,6 +1276,10 @@ handleFansRPMOverride( message ); break; + case MSG_ID_DG_OP_MODE_PUBLISH_INTERVAL_OVERRIDE: + handleSetDGOpModeBroadcastIntervalOverrideRequest( message ); + break; + default: // TODO - unrecognized message ID received - ignore break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r22f1a58ac8e419353ec004b04e7c765c1d59df2b -rc0375e039dd42ecf7b7d68ce7f2407e52dfe83eb --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 22f1a58ac8e419353ec004b04e7c765c1d59df2b) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision c0375e039dd42ecf7b7d68ce7f2407e52dfe83eb) @@ -3129,6 +3129,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 @@ -3236,6 +3268,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 -r22f1a58ac8e419353ec004b04e7c765c1d59df2b -rc0375e039dd42ecf7b7d68ce7f2407e52dfe83eb --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 22f1a58ac8e419353ec004b04e7c765c1d59df2b) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision c0375e039dd42ecf7b7d68ce7f2407e52dfe83eb) @@ -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 ); @@ -384,6 +387,9 @@ // MSG_ID_FILTER_FLUSH_TIME_PERIOD_OVERRIDE void handleFilterFlushTimePeriodOverride( MESSAGE_T *message ); +// MSG_ID_DG_OP_MODE_PUBLISH_INTERVAL_OVERRIDE +BOOL handleSetDGOpModeBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + // MSG_ID_DG_FANS_RPM_OVERRIDE void handleFansRPMOverride( MESSAGE_T *message );