Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r065601bf5b0fc1b31b10ab54c2711875923c369a -r406b3ea2507978267a519af0e9cbfbaaf03027c7 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 065601bf5b0fc1b31b10ab54c2711875923c369a) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 406b3ea2507978267a519af0e9cbfbaaf03027c7) @@ -28,6 +28,7 @@ #include "OperationModes.h" #include "RTC.h" #include "SystemCommMessages.h" +#include "TaskGeneral.h" #include "Valves.h" #include "WatchdogMgmt.h" @@ -38,6 +39,10 @@ // ********** private definitions ********** +/// Delay (in task intervals) after POST completes. +#define POST_COMPLETED_DELAY ( 2 * MS_PER_SECOND / TASK_GENERAL_INTERVAL ) + + // ********** private data ********** static HD_POST_STATE_T postState; ///< Current state of initialize and POST mode. @@ -48,6 +53,8 @@ static BOOL uiPOSTPassed; ///< Final result for UI POST tests (TRUE = passed, FALSE = failed). static BOOL dgPOSTPassed; ///< Final result for DG POST tests (TRUE = passed, FALSE = failed). +static U32 postCompleteDelayTimerCtr; ///< Timer counter for 2 second delay after POST completes and before transitioning to Standbymode. + // ********** private function prototypes ********** static HD_POST_STATE_T handlePOSTStatus( SELF_TEST_STATUS_T testStatus ); @@ -68,6 +75,7 @@ tempPOSTPassed = TRUE; uiPOSTPassed = FALSE; dgPOSTPassed = FALSE; + postCompleteDelayTimerCtr = 0; } /*********************************************************************//** @@ -187,7 +195,7 @@ postState = handlePOSTStatus( testStatus ); break; - // Should be last POST + // Should be last POST (and last POST test must be a test that completes in a single call) case POST_STATE_FPGA: testStatus = execFPGATest(); handlePOSTStatus( testStatus ); // Ignoring return value because last test @@ -211,8 +219,11 @@ postCompleted = TRUE; // Broadcast final POST passed sendPOSTFinalResult( TRUE ); - // Go to standby mode - requestNewOperationMode( MODE_STAN ); + // Delay before going to standby mode + if ( ++postCompleteDelayTimerCtr > POST_COMPLETED_DELAY ) + { + requestNewOperationMode( MODE_STAN ); + } break; case POST_STATE_FAILED: