Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r8e50cc04fb92d9b4ee9045e445ca8451abe951ab -r8466e63f95f65a3ffb18c3af85ac99328e41167b --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 8e50cc04fb92d9b4ee9045e445ca8451abe951ab) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 8466e63f95f65a3ffb18c3af85ac99328e41167b) @@ -23,11 +23,13 @@ #include "CPLD.h" #include "DialInFlow.h" #include "FPGA.h" +#include "Integrity.h" #include "ModeInitPOST.h" #include "NVDataMgmt.h" #include "OperationModes.h" #include "RTC.h" #include "SafetyShutdown.h" +#include "SyringePump.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Valves.h" @@ -108,7 +110,8 @@ /*********************************************************************//** * @brief - * The execInitAndPOSTMode function executes the Initialize & POST Mode state machine. + * The execInitAndPOSTMode function executes the Initialize & POST Mode + * state machine. * @details Inputs: postState * @details Outputs: postState, postPassed, postCompleted * @return current state (sub-mode) @@ -129,17 +132,12 @@ case POST_STATE_START: sendUIVersionRequest(); postState = POST_STATE_FW_INTEGRITY; -#ifdef SKIP_POST - postState = POST_STATE_COMPLETED; -#endif -#ifdef DONT_SKIP_NV_POST - // Only run NVDataMgmt POST - postState = POST_STATE_NVDATAMGMT; -#endif break; case POST_STATE_FW_INTEGRITY: - postState = POST_STATE_WATCHDOG; + testStatus = execIntegrityTest(); + testStatus = SELF_TEST_STATUS_PASSED; + postState = handlePOSTStatus( testStatus ); break; case POST_STATE_WATCHDOG: @@ -152,17 +150,20 @@ postState = handlePOSTStatus( testStatus ); break; + // NOTE: RTC's POST must go before NVDataMgmt case POST_STATE_RTC: testStatus = execRTCSelfTest(); postState = handlePOSTStatus( testStatus ); break; case POST_STATE_NVDATAMGMT: -// testStatus = execNVDataMgmtSelfTest(); -// postState = handlePOSTStatus( testStatus ); - postState = POST_STATE_BLOOD_FLOW; // TODO - restore before merge to staging (for now, cal failure fails but does not trigger fault and so I am seeing s/w fault) + testStatus = execNVDataMgmtSelfTest(); + postState = handlePOSTStatus( testStatus ); break; + // NOTE: all the actuators and sensors must execute their POST after NVDataMgmt + // NVDataMgmt must load all the calibration data into RAM so the actuators + // can query their corresponding calibration values successfully case POST_STATE_BLOOD_FLOW: testStatus = execBloodFlowTest(); postState = handlePOSTStatus( testStatus ); @@ -179,22 +180,22 @@ break; case POST_STATE_SYRINGE_PUMP: - postState = POST_STATE_ALARM_AUDIO; + testStatus = execSyringePumpSelfTest(); + postState = handlePOSTStatus( testStatus ); break; case POST_STATE_ALARM_AUDIO: +#ifndef DISABLE_ALARM_AUDIO testStatus = execAlarmAudioSelfTest(); +#else + testStatus = SELF_TEST_STATUS_PASSED; +#endif postState = handlePOSTStatus( testStatus ); break; case POST_STATE_ALARM_LAMP: -#ifdef DONT_SKIP_NV_POST - // Skip the rest of the POSTs - postState = POST_STATE_COMPLETED; -#else testStatus = execAlarmLampTest(); postState = handlePOSTStatus( testStatus ); -#endif break; case POST_STATE_ACCELEROMETER: @@ -253,7 +254,6 @@ // Should not get here - any failed post test should have already triggered a fault and taken us to fault mode default: SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_MODE_INIT_POST_INVALID_POST_STATE, postState ) - postState = POST_STATE_FAILED; break; }