/************************************************************************** * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file ModeStandby.c * * @date 19-Sep-2019 * @author S. Nash * * @brief Top-level state machine for the standby mode. * **************************************************************************/ #include #include "AlarmLamp.h" #include "BloodFlow.h" #include "Buttons.h" #include "OperationModes.h" #include "ModeStandby.h" #ifdef RM46_EVAL_BOARD_TARGET #include "Timers.h" static U32 start; #endif // ********** private data ********** // ********** private function prototypes ********** /************************************************************************* * @brief initStandbyMode * The initStandbyMode function initializes the Standby Mode module. * @details * Inputs : none * Outputs : Standby Mode module initialized. * @param none * @return none *************************************************************************/ void initStandbyMode( void ) { } /************************************************************************* * @brief transitionToStandbyMode * The transitionToStandbyMode function prepares for transition to standby mode. * @details * Inputs : none * Outputs : * @param none * @return none *************************************************************************/ void transitionToStandbyMode( void ) { // temporary test code - alarm lamp OK setBloodPumpTargetFlowRate( 0, MOTOR_DIR_FORWARD ); #ifdef RM46_EVAL_BOARD_TARGET start = getMSTimerCount(); #endif } /************************************************************************* * @brief execStandbyMode * The execStandbyMode function executes the Standby Mode state machine. * @details * Inputs : none * Outputs : * @param none * @return none *************************************************************************/ void execStandbyMode( void ) { BOOL stop = isStopButtonPressed(); if ( TRUE == stop ) { requestNewOperationMode( MODE_PRES ); } #ifdef RM46_EVAL_BOARD_TARGET if ( TRUE == didTimeout( start, 10000U ) ) { requestNewOperationMode( MODE_PRES ); } #endif }