/************************************************************************** * * 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 ModePrescription.c * * @date 19-Sep-2019 * @author S. Nash * * @brief Top-level state machine for the prescription mode. * **************************************************************************/ #include #include "AlarmLamp.h" #include "BloodFlow.h" #include "Buttons.h" #include "OperationModes.h" #include "ModePrescription.h" #ifdef RM46_EVAL_BOARD_TARGET #include "Timers.h" static U32 start; #endif // ********** private data ********** // ********** private function prototypes ********** /************************************************************************* * @brief initPrescriptionMode * The initPrescriptionMode function initializes the Prescription Mode module. * @details * Inputs : none * Outputs : Prescription Mode module initialized. * @param none * @return none *************************************************************************/ void initPrescriptionMode( void ) { } /************************************************************************* * @brief transitionToPrescriptionMode * The transitionToPrescriptionMode function prepares for transition to \n * prescription mode. * @details * Inputs : none * Outputs : * @param none * @return none *************************************************************************/ void transitionToPrescriptionMode( void ) { // temporary test code - alarm lamp Off setBloodPumpTargetFlowRate( 500, MOTOR_DIR_FORWARD ); #ifdef RM46_EVAL_BOARD_TARGET // TODO - temporary test code for eval board start = getMSTimerCount(); #endif } /************************************************************************* * @brief execPrescriptionMode * The execFaultMode function executes the Prescription Mode state machine. * @details * Inputs : none * Outputs : * @param none * @return none *************************************************************************/ void execPrescriptionMode( void ) { BOOL stop = isStopButtonPressed(); if ( TRUE == stop ) { requestNewOperationMode( MODE_OPAR ); } #ifdef RM46_EVAL_BOARD_TARGET // TODO - temporary test code for eval board - move to next mode after 10 sec if ( TRUE == didTimeout( start, 10000U ) ) { requestNewOperationMode( MODE_OPAR ); } #endif }