Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r9cc543b1c2508280767573e20eddd94e68be1fb5 -re9f15ff59ac0350adcbe544df8b3451e15ee7287 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 9cc543b1c2508280767573e20eddd94e68be1fb5) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision e9f15ff59ac0350adcbe544df8b3451e15ee7287) @@ -20,13 +20,13 @@ #include "AlarmLamp.h" //#include "BloodFlow.h" -//#include "Buttons.h" +#include "Buttons.h" #include "Compatible.h" #include "CpldInterface.h" #include "Ejector.h" //#include "Fans.h" #include "FpgaTD.h" -//#include "Integrity.h" +#include "Integrity.h" #include "Messaging.h" #include "ModeInitPOST.h" //#include "NVDataMgmt.h" @@ -144,13 +144,13 @@ U32 execInitAndPOSTMode( void ) { SELF_TEST_STATUS_T testStatus = SELF_TEST_STATUS_IN_PROGRESS; -// BOOL stop = isStopButtonPressed(); -// -// if ( TRUE == stop ) -// { -// // Ignore stop button in this mode. -// } + BOOL stop = isStopButtonPressed(); + if ( TRUE == stop ) + { + // Ignore stop button in this mode. + } + // Execute current POST state *Note - these switch cases must be in same order as enum HD_POST_States switch ( postState ) { @@ -159,7 +159,7 @@ break; case POST_STATE_FW_INTEGRITY: -// testStatus = execIntegrityTest(); + testStatus = execIntegrityTest(); postState = handlePOSTStatus( testStatus ); break; @@ -168,86 +168,91 @@ // can query their corresponding calibration values successfully case POST_STATE_NVDATAMGMT: // testStatus = execNVDataMgmtSelfTest(); + // TODO: Restore NVDataMgmt POST execution when NVDataMgmt self-test is available. + // Temporarily pass this POST state so the POST sequence can continue. + testStatus = SELF_TEST_STATUS_PASSED; postState = handlePOSTStatus( testStatus ); break; case POST_STATE_WATCHDOG: // testStatus = execWatchdogTest(); + // TODO: Restore Watchdog POST execution when DVT hardware support is available. + // Temporarily pass this POST state so the POST sequence can continue. + testStatus = SELF_TEST_STATUS_PASSED; postState = handlePOSTStatus( testStatus ); break; case POST_STATE_SAFETY_SHUTDOWN: // testStatus = execSafetyShutdownTest(); + // TODO: Restore Safety Shutdown POST execution when DVT hardware support is available. + // Temporarily pass this POST state so the POST sequence can continue. + testStatus = SELF_TEST_STATUS_PASSED; postState = handlePOSTStatus( testStatus ); break; case POST_STATE_BLOOD_FLOW: // testStatus = execBloodFlowTest(); + // TODO: Restore Blood Flow POST execution when Blood Flow self-test is available. + // Temporarily pass this POST state so the POST sequence can continue. + testStatus = SELF_TEST_STATUS_PASSED; postState = handlePOSTStatus( testStatus ); // sendUIRequestPOSTFinalResult(); // request UI POST final result here so we have it before UI test below break; case POST_STATE_VALVES: // testStatus = execValvesSelfTest(); + // TODO: Restore Valves POST execution when Valves self-test is available. + // Temporarily pass this POST state so the POST sequence can continue. + testStatus = SELF_TEST_STATUS_PASSED; postState = handlePOSTStatus( testStatus ); break; case POST_STATE_SYRINGE_PUMP: // testStatus = execSyringePumpSelfTest(); + // TODO: Restore Syringe Pump POST execution when Syringe Pump self-test is available. + // Temporarily pass this POST state so the POST sequence can continue. + testStatus = SELF_TEST_STATUS_PASSED; postState = handlePOSTStatus( testStatus ); break; - case POST_STATE_PRES_OCCL: -// testStatus = execPresOcclSelfTest(); + case POST_STATE_PRESSURE: +// testStatus = execPressureSelfTest(); + // TODO: Restore Pressure POST execution when Pressure self-test is available. + // Temporarily pass this POST state so the POST sequence can continue. + testStatus = SELF_TEST_STATUS_PASSED; postState = handlePOSTStatus( testStatus ); break; case POST_STATE_ALARM_AUDIO: -#ifndef _RELEASE_ -// if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_ALARM_AUDIO ) != SW_CONFIG_ENABLE_VALUE ) -#endif -// { -// testStatus = execAlarmAudioSelfTest(); -// } -#ifndef _RELEASE_ -// else - { - testStatus = SELF_TEST_STATUS_PASSED; - } -#endif + testStatus = execAlarmAudioSelfTest(); postState = handlePOSTStatus( testStatus ); break; case POST_STATE_ALARM_LAMP: -// testStatus = execAlarmLampTest(); + testStatus = execAlarmLampTest(); postState = handlePOSTStatus( testStatus ); break; case POST_STATE_TEMPERATURES: // testStatus = execTemperaturesSelfTest(); + // TODO: Restore Temperatures POST execution when Temperatures self-test is available. + // Temporarily pass this POST state so the POST sequence can continue. + testStatus = SELF_TEST_STATUS_PASSED; postState = handlePOSTStatus( testStatus ); break; - // NOTE: fans self test must be called after temperatures since the - // temperatures must get their calibration first before the fans start monitoring - // for RPM out of range - case POST_STATE_FANS: -// testStatus = execFansSelfTest(); - postState = handlePOSTStatus( testStatus ); - break; - case POST_STATE_STUCK_BUTTON: -// testStatus = execStuckButtonTest(); + testStatus = execStuckButtonTest(); postState = handlePOSTStatus( testStatus ); break; case POST_STATE_UI_POST: -// testStatus = execUITest(); + testStatus = execUITest(); postState = handlePOSTStatus( testStatus ); break; case POST_STATE_FW_COMPATIBILITY: -// testStatus = execFWCompatibilityTest(); + testStatus = execFWCompatibilityTest(); postState = handlePOSTStatus( testStatus ); break; @@ -258,7 +263,7 @@ // Should be last POST (and last POST test must be a test that completes in a single call) case POST_STATE_FPGA: -// testStatus = execFPGATest(); + testStatus = execFPGATest(); handlePOSTStatus( testStatus ); // Ignoring return value because last test if ( TRUE == tempPOSTPassed ) { @@ -453,7 +458,7 @@ if ( testStatus == SELF_TEST_STATUS_PASSED ) { // Broadcast passed POST result -// sendPOSTTestResult( (HD_POST_STATE_T)((int)postState), TRUE ); + sendPOSTTestResult( (TD_POST_STATE_T)( (int)postState ), TRUE ); // Move on to next POST test result = (TD_POST_STATE_T)((int)postState + 1); } @@ -462,8 +467,8 @@ // At least one POST has failed tempPOSTPassed = FALSE; // Broadcast failed POST results -// sendPOSTTestResult( (HD_POST_STATE_T)((int)postState), FALSE ); -// sendPOSTFinalResult( FALSE ); + sendPOSTTestResult( (TD_POST_STATE_T)( (int)postState ), FALSE ); + sendPOSTFinalResult( FALSE ); // Test that failed should have triggered a fault which will request fault mode, so should POST state machine should never see FAILED state and will fault if it does result = POST_STATE_FAILED; } @@ -495,21 +500,21 @@ setSystemREG1_SYSECR( getSystemREG1_SYSECR() ); // clear reset bit(s) after logging event so subsequent resets can be properly identified as not being power-on resets. setCrcREG_PSA_SIGREGL1( 0 ); // clear preserved power-on reset bit. -// sendUIVersionRequest(); // request UI to send us its version - needed for compatibility check + sendUIVersionRequest(); // request UI to send us its version - needed for compatibility check -// if ( TRUE == isDGCommunicating() ) -// { -// sendRequestForDGResendAlarms(); // request DG to re-send any active alarms that may have been triggered before we came up -// } + if ( TRUE == isDDCommunicating() ) + { + sendRequestForDDResendAlarms(); // request DD to re-send any active alarms that may have been triggered before we came up + } // Send the startup event -// SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_STARTUP, systemREG1->DEV, 0x12345678 ) // log startup event w/ device ID bits -// SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_STARTUP, resetReason, systemREG1->GBLSTAT ) // log startup event w/ reset reason(s) bits + SEND_EVENT_WITH_2_U32_DATA( TD_EVENT_STARTUP, systemREG1->DEV, 0x12345678 ) // log startup event w/ device ID bits + SEND_EVENT_WITH_2_U32_DATA( TD_EVENT_STARTUP, resetReason, systemREG1->GBLSTAT ) // log startup event w/ reset reason(s) bits // Send the first submode change event. It is the mode Init and it does not start from a previous // mode previous and current are both published as Init -// SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_OP_MODE_CHANGE, MODE_INIT, MODE_INIT ) - state = POST_STATE_COMPLETED; //POST_STATE_FW_INTEGRITY; + SEND_EVENT_WITH_2_U32_DATA( TD_EVENT_OP_MODE_CHANGE, MODE_INIT, MODE_INIT ) + state = POST_STATE_FW_INTEGRITY; startPOSTDelayCounter = 0; } @@ -519,19 +524,19 @@ /*********************************************************************//** * @brief * The execFWCompatibilityTest function executes the firmware compatibility test. - * @details \b Inputs: none + * @details \b Inputs: uiVersion * @details \b Outputs: none * @return in progress, passed, or failed *************************************************************************/ static SELF_TEST_STATUS_T execFWCompatibilityTest( void ) { SELF_TEST_STATUS_T result = SELF_TEST_STATUS_PASSED; -// if ( uiVersion.compatibility != SW_COMPATIBILITY_REV ) -// { -// result = SELF_TEST_STATUS_FAILED; -// SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_UI_COMPATIBILITY_ERROR, uiVersion.compatibility, SW_COMPATIBILITY_REV ) -// } + if ( uiVersion.compatibility != SW_COMPATIBILITY_REV ) + { + result = SELF_TEST_STATUS_FAILED; + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_UI_COMPATIBILITY_ERROR, uiVersion.compatibility, SW_COMPATIBILITY_REV ) + } return result; } @@ -548,24 +553,28 @@ SELF_TEST_STATUS_T result = SELF_TEST_STATUS_IN_PROGRESS; // UI should have sent POST results before we start this test -// if ( TRUE == uiPOSTResultReceived ) -// { -// if ( TRUE == uiPOSTPassed ) + if ( TRUE == uiPOSTResultReceived ) + { + if ( TRUE == uiPOSTPassed ) { result = SELF_TEST_STATUS_PASSED; } -// else -// { -// SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_UI_POST_TIMEOUT, 0 ) -// result = SELF_TEST_STATUS_FAILED; -// } -// } -// // If UI had not already sent POST results before we started, allow finite period for UI to send. -// else if ( ++waitForUIPostTimerCtr > POST_UI_MAX_WAIT_TIME ) -// { -// SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_UI_POST_TIMEOUT, 1 ) -// result = SELF_TEST_STATUS_FAILED; -// } + else + { + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_TD_UI_POST_TIMEOUT, 0 ) + result = SELF_TEST_STATUS_FAILED; + } + } + // If UI had not already sent POST results before we started, allow finite period for UI to send. + else if ( ++waitForUIPostTimerCtr > POST_UI_MAX_WAIT_TIME ) + { + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_TD_UI_POST_TIMEOUT, 1 ) + result = SELF_TEST_STATUS_FAILED; + } + else + { + ; // do nothing + } return result; }