Index: firmware/App/Services/TDInterface.c =================================================================== diff -u -r3f88f2878bfb58d9b67e05ed0717f6fbff136232 -r1a15aa462c0db129606243a4761fa2978ce01730 --- firmware/App/Services/TDInterface.c (.../TDInterface.c) (revision 3f88f2878bfb58d9b67e05ed0717f6fbff136232) +++ firmware/App/Services/TDInterface.c (.../TDInterface.c) (revision 1a15aa462c0db129606243a4761fa2978ce01730) @@ -8,7 +8,7 @@ * @file TDInterface.c * * @author (last) Sameer Kalliadan Poyil -* @date (last) 16-Jun-2026 +* @date (last) 10-Jul-2026 * * @author (original) Vinayakam Mani * @date (original) 06-Nov-2024 @@ -40,36 +40,34 @@ // ********** private definitions ********** -#define TD_DATA_FRESHNESS_TIMEOUT_MS ( 3 * MS_PER_SECOND ) ///< TD data freshness timeout (in ms). +#define TD_DATA_FRESHNESS_TIMEOUT_MS ( 3 * MS_PER_SECOND ) ///< TD data freshness timeout (in ms). -#define TD_DIALYSATE_FLOWRATE_MIN_ML_MIN ( 50.0F ) ///< TD Min dialysate flow rate (mL/min) -#define TD_DIALYSATE_FLOWRATE_MAX_ML_MIN ( 600.0F ) ///< TD Max dialysate flow rate (mL/min) +#define TD_DIALYSATE_FLOWRATE_MIN_ML_MIN ( 50.0F ) ///< TD Min dialysate flow rate (mL/min) +#define TD_DIALYSATE_FLOWRATE_MAX_ML_MIN ( 600.0F ) ///< TD Max dialysate flow rate (mL/min) -#define TD_UF_RATE_MIN_ML_MIN ( 0.0F ) ///< TD Min UF rate (mL/min) -#define TD_UF_RATE_MAX_ML_MIN ( 2000.0F / 60.0F ) ///< TD Max UF rate (mL/min) +#define TD_UF_RATE_MIN_ML_MIN ( 0.0F ) ///< TD Min UF rate (mL/min) +#define TD_UF_RATE_MAX_ML_MIN ( 2000.0F / 60.0F ) ///< TD Max UF rate (mL/min) -#define TD_DIALYSATE_TEMP_MIN_DEGC ( 35.0F ) ///< TD Min dialysate temperature (deg C) -#define TD_DIALYSATE_TEMP_MAX_DEGC ( 38.0F ) ///< TD Max dialysate temperature (deg C) +#define TD_DIALYSATE_TEMP_MIN_DEGC ( 35.0F ) ///< TD Min dialysate temperature (deg C) +#define TD_DIALYSATE_TEMP_MAX_DEGC ( 38.0F ) ///< TD Max dialysate temperature (deg C) -#define TD_ACID_TYPE_MIN ( 0U ) ///< TD Min acid type index -#define TD_ACID_TYPE_MAX ( (U32)( NUM_OF_ACID_TYPE - 1U ) ) ///< TD Max acid type index +#define TD_ACID_TYPE_MIN ( 0U ) ///< TD Min acid type index +#define TD_ACID_TYPE_MAX ( (U32)( NUM_OF_ACID_TYPE - 1U ) ) ///< TD Max acid type index -#define TD_SODIUM_MIN ( 130U ) ///< TD Min acid type index -#define TD_SODIUM_MAX ( 155U ) ///< TD Max acid type index +#define TD_SODIUM_MIN ( 130U ) ///< TD Min acid type index +#define TD_SODIUM_MAX ( 155U ) ///< TD Max acid type index +#define TD_BICARBONATE_MIN ( 20U ) ///< TD Min acid type index +#define TD_BICARBONATE_MAX ( 40U ) ///< TD Max acid type index +#define BICARBONATE_CONVERSION_FACTOR 0.073371212F ///< Bicarbonate conversion factor mS/cm per mmol/L +#define MAX_ACID_CONC_TYPES 10 ///< Number of acid concentrate conversion factors -#define TD_BICARBONATE_MIN ( 20U ) ///< TD Min acid type index -#define TD_BICARBONATE_MAX ( 40U ) ///< TD Max acid type index - -#define BICARBONATE_CONVERSION_FACTOR 0.07337F ///< Bicarbonate conversion factor mS/cm per mmol/L -#define MAX_ACID_CONC_TYPES 10 ///< Number of acid concentrate conversion factors - // TODO move to institutional records once implemented /// Acid concentration conversion factors for each acid type -const F32 ACID_CONVERSION_FACTOR[ MAX_ACID_CONC_TYPES ] = { 0.11192F, - 0.11313F, - 0.11435F, +const F32 ACID_CONVERSION_FACTOR[ MAX_ACID_CONC_TYPES ] = { 0.1119255F, + 0.1131362F, + 0.1143568F, 0.0F, 0.0F, 0.0F, @@ -143,12 +141,12 @@ tdDialysateTemp.ovInitData = TD_DIALYSATE_TEMP_MIN_DEGC; tdDialysateTemp.override = OVERRIDE_RESET; - tdAcidConvFactor.data = 0.0F; + tdAcidConvFactor.data = ACID_CONVERSION_FACTOR[ TD_ACID_TYPE_MIN ]; tdAcidConvFactor.ovData = 0.0F; tdAcidConvFactor.ovInitData = ACID_CONVERSION_FACTOR[ TD_ACID_TYPE_MIN ]; tdAcidConvFactor.override = OVERRIDE_RESET; - tdBicarbConvFactor.data = 0.0F; + tdBicarbConvFactor.data = BICARBONATE_CONVERSION_FACTOR; tdBicarbConvFactor.ovData = 0.0F; tdBicarbConvFactor.ovInitData = BICARBONATE_CONVERSION_FACTOR; tdBicarbConvFactor.override = OVERRIDE_RESET; @@ -237,7 +235,7 @@ *************************************************************************/ void execTDInterfaceMonitor( void ) { - + // TODO:implementation pending } /*********************************************************************//** @@ -521,7 +519,6 @@ if ( ( DD_MODE_STAN == ddMode ) && ( TRUE == startPreGenRequest.start ) ) { // Start FP Pre-Generate Permeate - if ( ( FP_MODE_STAN == fpMode ) && ( getTestConfigStatus( TEST_CONFIG_DD_RUN_SOLO ) == FALSE ) ) { fpReason = signalStartGenPermeate();