Index: firmware/App/Modes/ModePreGenDialysate.c =================================================================== diff -u -r724b64673b719eaac10b0c9dd839ad9675274911 -r6e36d2fd90b130f540494f4128951d81e7dc5ed5 --- firmware/App/Modes/ModePreGenDialysate.c (.../ModePreGenDialysate.c) (revision 724b64673b719eaac10b0c9dd839ad9675274911) +++ firmware/App/Modes/ModePreGenDialysate.c (.../ModePreGenDialysate.c) (revision 6e36d2fd90b130f540494f4128951d81e7dc5ed5) @@ -38,9 +38,9 @@ // ********** private data ********** -static DD_PRE_GEN_DAILYSATE_STATE_T preGenDialysateState; ///< Currently active pre-gen dialysate state. +static DD_PRE_GEN_DAILYSATE_STATE_T preGenDialysateState; ///< Currently active pre-gen dialysate state. static OVERRIDE_U32_T pendingStartDDGenDialRequest; ///< Flag indicating TD has requested DD start the generation dialysate request(Overridable). -static U32 preGenDialysatePublishTimerCounter; ///< Pre-Gen Dialysate data broadcast timer counter used to schedule when to transmit data. +static U32 preGenDialysatePublishTimerCounter; ///< Pre-Gen Dialysate data broadcast timer counter used to schedule when to transmit data. static OVERRIDE_U32_T preGenDialysateModePublishInterval; ///< Interval (in task intervals) at which to publish pre-gen dialysate mode data to CAN bus. // ********** private function prototypes ********** @@ -163,6 +163,32 @@ /*********************************************************************//** * @brief + * The requestDDPreGenStop function handles an TD request to stop + * pre-generation dialysis mode. + * @details \b Inputs: Pre generation dialysate mode / state + * @details \b Outputs: mode transition + * @return TRUE if request accepted, FALSE if not. + *************************************************************************/ +BOOL requestDDPreGenStop( void ) +{ + BOOL status = FALSE; + + //TODO: Transition to post gen dialysate if concentrate priming has been started + + //TODO: Tranistion to standby if concentrate priming is not yet started + if ( DD_MODE_PREG == getCurrentOperationMode() ) + { + // Transition to mode standby + requestNewOperationMode( DD_MODE_STAN ); + + status = TRUE; + } + + return status; +} + +/*********************************************************************//** + * @brief * The handlePreGenDialysateFillCompleteCheckState function checks the * hydrochamber fill and transition to next state. * @details \b Inputs: state