Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r78cee9347b3766ac7c14d413ed848be758c7e9cd -rabbad386f4cc94f315300dffef321fe8c03fbd52 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 78cee9347b3766ac7c14d413ed848be758c7e9cd) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision abbad386f4cc94f315300dffef321fe8c03fbd52) @@ -23,11 +23,11 @@ #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 "SyringePump.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Valves.h" @@ -97,7 +97,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,13 +120,6 @@ { 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 break; case POST_STATE_FW_COMPATIBILITY: @@ -134,15 +128,23 @@ break; case POST_STATE_FW_INTEGRITY: - testStatus = execIntegrityTest(); + //testStatus = execIntegrityTest(); TODO what happened to this module? + testStatus = SELF_TEST_STATUS_PASSED; postState = handlePOSTStatus( testStatus ); break; + case POST_STATE_BATTERY: + // TODO implement the battery self test + testStatus = SELF_TEST_STATUS_PASSED; + postState = handlePOSTStatus( testStatus ); + break; + case POST_STATE_WATCHDOG: testStatus = execWatchdogTest(); postState = handlePOSTStatus( testStatus ); break; + // NOTE: RTC's POST must go before NVDataMgmt case POST_STATE_RTC: testStatus = execRTCSelfTest(); postState = handlePOSTStatus( testStatus ); @@ -153,6 +155,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,25 +173,27 @@ postState = handlePOSTStatus( testStatus ); break; + case POST_STATE_SYRINGE_PUMP: + testStatus = execSyringePumpSelfTest(); + postState = handlePOSTStatus( testStatus ); + break; + case POST_STATE_ALARM_AUDIO: -#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 = execAlarmAudioSelfTest(); - postState = handlePOSTStatus( testStatus ); #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: @@ -203,6 +210,12 @@ 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; + // Should be last POST (and last POST test must be a test that completes in a single call) case POST_STATE_FPGA: testStatus = execFPGATest();