Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r53f4c6476728fdbfc76147062e66e8bb21d30841 -r7838caf7aff7f6a3d890d21c13a4a695782c97bd --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 53f4c6476728fdbfc76147062e66e8bb21d30841) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 7838caf7aff7f6a3d890d21c13a4a695782c97bd) @@ -16,15 +16,20 @@ ***************************************************************************/ #include "Accel.h" +#include "ConcentratePumps.h" +#include "ConductivitySensors.h" #include "CPLD.h" #include "DrainPump.h" #include "Fans.h" #include "FPGA.h" +#include "Integrity.h" #include "LoadCell.h" #include "ModeInitPOST.h" #include "NVDataMgmt.h" #include "OperationModes.h" #include "Pressures.h" +#include "Reservoirs.h" +#include "ROPump.h" #include "RTC.h" #include "SafetyShutdown.h" #include "SystemCommMessages.h" @@ -98,17 +103,18 @@ #ifdef SKIP_POST postState = DG_POST_STATE_COMPLETED; #endif -#ifdef DONT_SKIP_NV_POST - // Only run NVDataMgmt POST - postState = DG_POST_STATE_NVDATAMGMT; -#endif break; case DG_POST_STATE_FW_COMPATIBILITY: testStatus = execFWCompatibilityTest(); postState = handlePOSTStatus( testStatus ); break; + case DG_POST_STATE_FW_INTEGRITY: + testStatus = execIntegrityTest(); + postState = handlePOSTStatus( testStatus ); + break; + case DG_POST_STATE_FPGA: testStatus = execFPGATest(); postState = handlePOSTStatus( testStatus ); @@ -124,14 +130,12 @@ 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 DG_POST_STATE_TEMPERATURE_SENSORS: -#ifdef DONT_SKIP_NV_POST - // Skip the rest of the POSTs - postState = DG_POST_STATE_COMPLETED; -#else testStatus = execTemperatureSensorsSelfTest(); postState = handlePOSTStatus( testStatus ); -#endif break; case DG_POST_STATE_ACCELEROMETER: @@ -148,29 +152,46 @@ postState = handlePOSTStatus( testStatus ); break; -#ifdef _VECTORCAST_ - case DG_POST_DRAIN_PUMP: + case DG_POST_STATE_RO_PUMP: + testStatus = execROPumpSelfTest(); + postState = handlePOSTStatus( testStatus ); + break; + + case DG_POST_STATE_DRAIN_PUMP: testStatus = execDrainPumpSelfTest(); postState = handlePOSTStatus( testStatus ); break; -// To be able to run integration test in VectorCAST. -// Not all the fans and thermistors have been implemented so POST might fail - case DG_POST_STATE_THERMISTORS: - testStatus = execThermistorsSelfTest(); + + case DG_POST_STATE_CONCENTRATE_PUMPS: + testStatus = execConcenratePumpsSelfTest(); postState = handlePOSTStatus( testStatus ); break; - case DG_POST_STATE_FANS: - testStatus = execFansSelfTest(); + case DG_POST_STATE_CONDUCTIVITY_SENSORS: + testStatus = execConductivitySensorsSelfTest(); postState = handlePOSTStatus( testStatus ); break; + case DG_POST_STATE_RESERVOIRS: + testStatus = execReservoirsSelfTest(); + postState = handlePOSTStatus( testStatus ); + break; + case DG_POST_STATE_UV_REACTORS: testStatus = execUVReactorsSelfTest(); postState = handlePOSTStatus( testStatus ); break; -#endif + case DG_POST_STATE_THERMISTORS: + testStatus = execThermistorsSelfTest(); + postState = handlePOSTStatus( testStatus ); + break; + + case DG_POST_STATE_FANS: + testStatus = execFansSelfTest(); + postState = handlePOSTStatus( testStatus ); + break; + case DG_POST_STATE_WATCHDOG: testStatus = execWatchdogTest(); postState = handlePOSTStatus( testStatus ); @@ -184,7 +205,8 @@ // Should be last POST (and last POST test must be a test that completes in a single call) case DG_POST_STATE_LOAD_CELL: testStatus = execLoadCellsSelfTest(); - handlePOSTStatus( testStatus ); // ignoring return value because last test + handlePOSTStatus( testStatus ); + // Ignoring return value because last test if ( TRUE == tempPOSTPassed ) { postState = DG_POST_STATE_COMPLETED; @@ -214,7 +236,7 @@ break; default: - // TODO - s/w fault + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_MODE_INIT_POST_INVALID_POST_STATE, postState ) postState = DG_POST_STATE_FAILED; break; }