Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r5e3e9943759f429fc2213db848475c07ca6b79a5 -r3f2b9de757500da37e0ed8881e4e906d94f3076c --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 5e3e9943759f429fc2213db848475c07ca6b79a5) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 3f2b9de757500da37e0ed8881e4e906d94f3076c) @@ -29,6 +29,7 @@ #include "NVDataMgmt.h" #include "OperationModes.h" #include "RTC.h" +#include "SyringePump.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Valves.h" @@ -98,7 +99,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) @@ -119,23 +121,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; @@ -144,6 +135,7 @@ postState = handlePOSTStatus( testStatus ); break; + // NOTE: RTC's POST must go before NVDataMgmt case POST_STATE_RTC: testStatus = execRTCSelfTest(); postState = handlePOSTStatus( testStatus ); @@ -154,6 +146,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 ); @@ -169,19 +164,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: @@ -198,6 +201,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();