Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -rd91a24c730aeb5cd7e3eba9ef4eca78e442911f8 -re13152777df58456a873789fbfc3f889813109c9 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision d91a24c730aeb5cd7e3eba9ef4eca78e442911f8) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision e13152777df58456a873789fbfc3f889813109c9) @@ -7,8 +7,8 @@ * * @file ModeInitPOST.c * -* @author (last) Sean Nash -* @date (last) 26-Aug-2020 +* @author (last) Dara Navaei +* @date (last) 02-Oct-2020 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -27,6 +27,7 @@ #include "WatchdogMgmt.h" #include "ModeInitPOST.h" #include "NVDataMgmt.h" +#include "Valves.h" /** * @addtogroup HDInitAndPOSTMode @@ -49,9 +50,8 @@ /*********************************************************************//** * @brief * The initInitAndPOSTMode function initializes the Initialize & POST Mode module. - * @details - * Inputs : none - * Outputs : Initialize & POST Mode module initialized. + * @details Inputs: none + * @details Outputs: Initialize & POST Mode module initialized. * @return none *************************************************************************/ void initInitAndPOSTMode( void ) @@ -66,9 +66,8 @@ * @brief * The transitionToInitAndPOSTMode function prepares for transition to * initialize & POST mode. - * @details - * Inputs : none - * Outputs : none + * @details Inputs: none + * @details Outputs: none * @return none *************************************************************************/ void transitionToInitAndPOSTMode( void ) @@ -78,9 +77,8 @@ /*********************************************************************//** * @brief * The execInitAndPOSTMode function executes the Initialize & POST Mode state machine. - * @details - * Inputs : postState - * Outputs : postState, postPassed, postCompleted + * @details Inputs: postState + * @details Outputs: postState, postPassed, postCompleted * @return current state (sub-mode) *************************************************************************/ U32 execInitAndPOSTMode( void ) @@ -89,7 +87,7 @@ // TODO - send POST status on CAN - // execute current POST state + // execute current POST state *Note - these switch cases must be in same order as enum HD_POST_States switch ( postState ) { case POST_STATE_START: @@ -98,13 +96,18 @@ postState = POST_STATE_COMPLETED; #endif #ifdef SKIP_POST +#ifndef DISABLE_UI_TREATMENT_WORKFLOW + postState = POST_STATE_VALVES; +#else postState = POST_STATE_COMPLETED; + postState = POST_STATE_VALVES; #endif +#endif break; case POST_STATE_WATCHDOG: testStatus = execWatchdogTest(); - postState = handlePOSTStatus( testStatus ); // ignoring return value because last test + postState = handlePOSTStatus( testStatus ); break; case POST_STATE_ALARM_LAMP: @@ -137,6 +140,11 @@ postState = handlePOSTStatus( testStatus ); break; + case POST_STATE_VALVES: + testStatus = execValvesSelfTest(); + postState = handlePOSTStatus( testStatus ); + break; + case POST_STATE_ACCELEROMETER: #ifndef DISABLE_ACCELS testStatus = execAccelTest(); @@ -146,9 +154,10 @@ postState = handlePOSTStatus( testStatus ); break; + // Should be last POST case POST_STATE_STUCK_BUTTON: testStatus = execStuckButtonTest(); - handlePOSTStatus( testStatus ); + handlePOSTStatus( testStatus ); // ignoring return value because last test if ( TRUE == tempPOSTPassed ) { @@ -186,9 +195,8 @@ * The isPOSTCompleted function determines whether all HD POST have * been run and completed. If true, call the isPOSTPassed() to see final * result (pass/fail). - * @details - * Inputs : postCompleted - * Outputs : none + * @details Inputs: postCompleted + * @details Outputs: none * @return true if all HD POST tests have completed, false if not *************************************************************************/ BOOL isPOSTCompleted( void ) @@ -200,9 +208,8 @@ * @brief * The isPOSTPassed function determines whether all HD POST have passed. * Call this function after POST is complete (call isPOSTCompleted function). - * @details - * Inputs : postPassed - * Outputs : none + * @details Inputs: postPassed + * @details Outputs: none * @return true if all HD POST tests have passed, false if not *************************************************************************/ BOOL isPOSTPassed( void ) @@ -214,9 +221,8 @@ * @brief * The handlePOSTStatus function handles a status result returned by a * POST function. - * @details - * Inputs : postPassed - * Outputs : none + * @details Inputs: postPassed + * @details Outputs: none * @param testStatus status reported by last test * @return recommended next POST state *************************************************************************/