Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r056bb7c3e42a6c56e10ff75f69aa1d7b9e5c8af8 -r9fcd1ad071bcce7a592833367c103e235e49654f --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 056bb7c3e42a6c56e10ff75f69aa1d7b9e5c8af8) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 9fcd1ad071bcce7a592833367c103e235e49654f) @@ -20,7 +20,7 @@ #include "AlarmLamp.h" //#include "BloodFlow.h" -//#include "Buttons.h" +#include "Buttons.h" #include "Compatible.h" #include "CpldInterface.h" #include "Ejector.h" @@ -197,24 +197,13 @@ postState = handlePOSTStatus( testStatus ); break; - case POST_STATE_PRES_OCCL: -// testStatus = execPresOcclSelfTest(); + case POST_STATE_PRESSURE: +// testStatus = execPressureSelfTest(); 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; @@ -237,17 +226,17 @@ 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 +247,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 +442,7 @@ if ( testStatus == SELF_TEST_STATUS_PASSED ) { // Broadcast passed POST result - sendPOSTTestResult( (TD_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,7 +451,7 @@ // At least one POST has failed tempPOSTPassed = FALSE; // Broadcast failed POST results - sendPOSTTestResult( (TD_POST_STATE_T)((int)postState), 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,20 +484,20 @@ 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 ) + SEND_EVENT_WITH_2_U32_DATA( TD_EVENT_OP_MODE_CHANGE, MODE_INIT, MODE_INIT ) state = POST_STATE_COMPLETED; //POST_STATE_FW_INTEGRITY; startPOSTDelayCounter = 0; } @@ -527,11 +516,11 @@ { 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 +537,24 @@ 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; + } return result; }