Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r44a100f8e5210a02c23b8fcc4527d8e96d577381 -r4a9872d81bae53492c124d0378028ece422f1b4d --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 44a100f8e5210a02c23b8fcc4527d8e96d577381) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 4a9872d81bae53492c124d0378028ece422f1b4d) @@ -28,6 +28,7 @@ #include "NVDataMgmt.h" #include "OperationModes.h" #include "RTC.h" +#include "SyringePump.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Valves.h" @@ -97,7 +98,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) @@ -118,23 +120,12 @@ switch ( postState ) { case POST_STATE_START: - postState = POST_STATE_FW_COMPATIBILITY; -#ifdef SKIP_POST - postState = POST_STATE_COMPLETED; -#endif -#ifdef DONT_SKIP_NV_POST - // Only run NVDataMgmt POST - postState = POST_STATE_NVDATAMGMT; -#endif + postState = POST_STATE_FW_INTEGRITY; break; - case POST_STATE_FW_COMPATIBILITY: - testStatus = execFWCompatibilityTest(); - postState = handlePOSTStatus( testStatus ); - break; - case POST_STATE_FW_INTEGRITY: testStatus = execIntegrityTest(); + testStatus = SELF_TEST_STATUS_PASSED; postState = handlePOSTStatus( testStatus ); break; @@ -143,6 +134,12 @@ postState = handlePOSTStatus( testStatus ); break; + case POST_STATE_SAFETY_SHUTDOWN: + testStatus = SELF_TEST_STATUS_PASSED; + postState = handlePOSTStatus( testStatus ); + break; + + // NOTE: RTC's POST must go before NVDataMgmt case POST_STATE_RTC: testStatus = execRTCSelfTest(); postState = handlePOSTStatus( testStatus ); @@ -153,6 +150,9 @@ 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 ); @@ -168,19 +168,27 @@ postState = handlePOSTStatus( testStatus ); break; + case POST_STATE_SYRINGE_PUMP: + testStatus = execSyringePumpSelfTest(); + postState = handlePOSTStatus( testStatus ); + break; + case POST_STATE_ALARM_AUDIO: +#ifdef SKIP_POST + testStatus = SELF_TEST_STATUS_PASSED; +#else testStatus = execAlarmAudioSelfTest(); +#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; +#ifdef SKIP_POST + testStatus = SELF_TEST_STATUS_PASSED; #else testStatus = execAlarmLampTest(); - postState = handlePOSTStatus( testStatus ); #endif + postState = handlePOSTStatus( testStatus ); break; case POST_STATE_ACCELEROMETER: @@ -197,6 +205,17 @@ postState = handlePOSTStatus( testStatus ); break; + case POST_STATE_UI_POST: + // TODO implement the UI POST self test + testStatus = SELF_TEST_STATUS_PASSED; + postState = handlePOSTStatus( testStatus ); + break; + + case POST_STATE_FW_COMPATIBILITY: + testStatus = execFWCompatibilityTest(); + postState = handlePOSTStatus( testStatus ); + break; + // Should be last POST (and last POST test must be a test that completes in a single call) case POST_STATE_FPGA: testStatus = execFPGATest();