Index: firmware/App/Modes/ModeTreatment.h =================================================================== diff -u -r68aefeff8890cdfa956c7bfdf0d4505b4ac25cb7 -rcd5be724d5a3ba7457e761191d82f278654d7f5c --- firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision 68aefeff8890cdfa956c7bfdf0d4505b4ac25cb7) +++ firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision cd5be724d5a3ba7457e761191d82f278654d7f5c) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2019-2022 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2024 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 ModeTreatment.h * * @author (last) Dara Navaei -* @date (last) 12-Nov-2021 +* @date (last) 18-Jul-2023 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -21,6 +21,7 @@ #include "HDCommon.h" #include "HDDefs.h" #include "Dialysis.h" +#include "TaskGeneral.h" /** * @defgroup HDTreatmentMode HDTreatmentMode @@ -65,21 +66,19 @@ /// Payload record structure for the in-line pressure limits change request. typedef struct { - S32 artLowLimit; - S32 artHighLimit; - S32 venLowLimit; - S32 venHighLimit; + S32 artPresLimitWindowmmHg; + S32 venPresLimitWindowmmHg; + S32 venPresLimitAsymmetricmmHg; } PRESSURE_LIMIT_CHANGE_REQUEST_T; /// Payload record structure for the in-line pressure limits change response. typedef struct { BOOL accepted; U32 rejReasonCode; - S32 artLowLimit; - S32 artHighLimit; - S32 venLowLimit; - S32 venHighLimit; + S32 artPresLimitWindowmmHg; + S32 venPresLimitWindowmmHg; + S32 venPresLimitAsymmetricmmHg; } PRESSURE_LIMIT_CHANGE_RESPONSE_T; /// Payload record structure for the treatment log 30 minutes periodic data. @@ -92,6 +91,11 @@ F32 avgVenousPressure; } TREATMENT_LOG_DATA_PERIODIC_T; +/// Maximum time in this mode before blood sitting alarm given (in general task intervals). +#define MAX_TIME_BLOOD_SITTING ( ( 5 * SEC_PER_MIN * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ) +/// Maximum time in this mode before blood sitting warning given (in general task intervals). +#define WARN_TIME_BLOOD_SITTING ( ( 4 * SEC_PER_MIN * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ) + // ********** public function prototypes ********** void initTreatmentMode( void ); // Initialize this module @@ -106,6 +110,7 @@ TREATMENT_STATE_T getTreatmentState( void ); // Determine the current treatment sub-mode (state) BOOL isTreatmentCompleted( void ); // Determine whether the treatment has completed +BOOL isTreatmentResumeBlocked( void ); // Determine whether the treatment is not allowed to be resumed. U32 getTreatmentTimeRemainingSecs( void ); // Determine number of seconds remaining in the treatment U32 getActualTreatmentTimeSecs( void ); // Determine the actual treatment duration in seconds BOOL getRinsebackCompleted( void ); // Determine whether a rinseback has been completed