Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r933a18d740285e70be9d00696ed0f5a5381bc8e4 -r30f049651877229042e3f8700c8596e5b9a1e0f4 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 933a18d740285e70be9d00696ed0f5a5381bc8e4) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 30f049651877229042e3f8700c8596e5b9a1e0f4) @@ -72,6 +72,10 @@ *************************************************************************/ void transitionToInitAndPOSTMode( void ) { + // Set user alarm recovery actions allowed in this mode + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); } /*********************************************************************//** @@ -87,34 +91,21 @@ // TODO - send POST status on CAN - // execute current POST state *Note - these switch cases must be in same order as enum HD_POST_States + // Execute current POST state *Note - these switch cases must be in same order as enum HD_POST_States switch ( postState ) { case POST_STATE_START: postState = POST_STATE_WATCHDOG; -#ifdef RM46_EVAL_BOARD_TARGET - 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 ); break; - case POST_STATE_ALARM_LAMP: - testStatus = execAlarmLampTest(); - postState = handlePOSTStatus( testStatus ); - break; - case POST_STATE_FPGA: testStatus = execFPGATest(); postState = handlePOSTStatus( testStatus ); @@ -151,13 +142,18 @@ case POST_STATE_VALVES: testStatus = execValvesSelfTest(); - postState = POST_STATE_STUCK_BUTTON; + postState = handlePOSTStatus( testStatus ); break; + case POST_STATE_ALARM_LAMP: + testStatus = execAlarmLampTest(); + postState = handlePOSTStatus( testStatus ); + break; + // Should be last POST case POST_STATE_STUCK_BUTTON: testStatus = execStuckButtonTest(); - handlePOSTStatus( testStatus ); // ignoring return value because last test + handlePOSTStatus( testStatus ); // Ignoring return value because last test if ( TRUE == tempPOSTPassed ) { @@ -170,17 +166,17 @@ break; case POST_STATE_COMPLETED: - // set overall HD POST status to "passed" + // Set overall HD POST status to "passed" postPassed = TRUE; - // set overall HD POST completed status to TRUE + // Set overall HD POST completed status to TRUE postCompleted = TRUE; // TODO - send POST status on CAN - // go to standby mode + // Go to standby mode requestNewOperationMode( MODE_STAN ); break; case POST_STATE_FAILED: - // should not get here - any failed post test should have already triggered a fault and taken us to fault mode + // Should not get here - any failed post test should have already triggered a fault and taken us to fault mode default: SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_MODE_INIT_POST_INVALID_POST_STATE, postState ) postState = POST_STATE_FAILED; @@ -192,6 +188,20 @@ /*********************************************************************//** * @brief + * The signalAlarmActionToInitAndPOSTMode function executes the given alarm action + * as appropriate while in InitAndPOST Mode. + * @details Inputs: none + * @details Outputs: given alarm action executed + * @param action ID of alarm action to execute + * @return none + *************************************************************************/ +void signalAlarmActionToInitAndPOSTMode( ALARM_ACTION_T action ) +{ + +} + +/*********************************************************************//** + * @brief * The isPOSTCompleted function determines whether all HD POST have * been run and completed. If true, call the isPOSTPassed() to see final * result (pass/fail). @@ -232,7 +242,7 @@ if ( testStatus == SELF_TEST_STATUS_PASSED ) { - result = (HD_POST_STATE_T)((int)postState + 1); // move on to next POST test + result = (HD_POST_STATE_T)((int)postState + 1); // Move on to next POST test } else if ( testStatus == SELF_TEST_STATUS_FAILED ) { @@ -242,7 +252,7 @@ } else { - // test still in progress - do nothing + // Test still in progress - do nothing } return result;