Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -raa4db7d76566ad7473f896e543f71fdbbc921ea9 -rd37f31cff6c20085953ecb598558e4d91e42f0af --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision aa4db7d76566ad7473f896e543f71fdbbc921ea9) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision d37f31cff6c20085953ecb598558e4d91e42f0af) @@ -15,6 +15,7 @@ * ***************************************************************************/ +#include "reg_crc.h" // Used to hold reset reason code at startup before bits get cleared #include "reg_system.h" // Used to access exception status registers for reset reason code at startup #include "Accel.h" @@ -25,18 +26,21 @@ #include "Compatible.h" #include "CPLD.h" #include "DialInFlow.h" +#include "DialOutFlow.h" +#include "Fans.h" #include "FPGA.h" #include "Integrity.h" #include "ModeInitPOST.h" #include "NVDataMgmt.h" #include "OperationModes.h" -#include "reg_crc.h" +#include "PresOccl.h" #include "RTC.h" #include "SafetyShutdown.h" #include "SyringePump.h" #include "system.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" +#include "Temperatures.h" #include "Valves.h" #include "WatchdogMgmt.h" @@ -73,6 +77,8 @@ static DG_VERSIONS_T dgVersion = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; ///< Version and compatibility information reported by DG. static U32 startPOSTDelayCounter = 0; ///< Start POST delay counter. +extern U32 savedResetReasonCode; ///< Saved reset reason code from sys_startup.c. + // ********** private function prototypes ********** static HD_POST_STATE_T handlePOSTStatus( SELF_TEST_STATUS_T testStatus ); @@ -192,6 +198,11 @@ postState = handlePOSTStatus( testStatus ); break; + case POST_STATE_DIALYSATE_OUTLET_FLOW: + testStatus = execDialOutFlowTest(); + postState = handlePOSTStatus( testStatus ); + break; + case POST_STATE_BLOOD_LEAK: testStatus = execBloodLeakSelfTest(); postState = handlePOSTStatus( testStatus ); @@ -207,12 +218,20 @@ postState = handlePOSTStatus( testStatus ); break; + case POST_STATE_PRES_OCCL: + testStatus = execPresOcclSelfTest(); + postState = handlePOSTStatus( testStatus ); + break; + case POST_STATE_ALARM_AUDIO: -#ifndef DISABLE_ALARM_AUDIO - testStatus = execAlarmAudioSelfTest(); -#else - testStatus = SELF_TEST_STATUS_PASSED; -#endif + if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_ALARM_AUDIO ) != SW_CONFIG_ENABLE_VALUE ) + { + testStatus = execAlarmAudioSelfTest(); + } + else + { + testStatus = SELF_TEST_STATUS_PASSED; + } postState = handlePOSTStatus( testStatus ); break; @@ -222,14 +241,30 @@ break; case POST_STATE_ACCELEROMETER: -#ifndef DISABLE_ACCELS - testStatus = execAccelTest(); -#else + // TODO I don't like this testStatus = SELF_TEST_STATUS_PASSED; +#ifndef _RELEASE_ + if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_ACCELEROMETERS ) != SW_CONFIG_ENABLE_VALUE ) #endif + { + testStatus = execAccelTest(); + } postState = handlePOSTStatus( testStatus ); break; + case POST_STATE_TEMPERATURES: + testStatus = execTemperaturesSelfTest(); + postState = handlePOSTStatus( testStatus ); + break; + + // NOTE: fans self test must be called after temperatures since the + // temperatures must get their calibration first before the fans start monitoring + // for RPM out of range + case POST_STATE_FANS: + testStatus = execFansSelfTest(); + postState = handlePOSTStatus( testStatus ); + break; + case POST_STATE_STUCK_BUTTON: testStatus = execStuckButtonTest(); postState = handlePOSTStatus( testStatus ); @@ -393,6 +428,10 @@ { HD_POST_STATE_T result = postState; +#ifdef BOARD_WITH_NO_HARDWARE + testStatus = SELF_TEST_STATUS_PASSED; +#endif + if ( testStatus == SELF_TEST_STATUS_PASSED ) { // Broadcast passed POST result