Index: firmware/App/Services/NVRecordsDD.c =================================================================== diff -u -re17e1dc97bf8878056f1f7e4aa861c2448db52bc -r9a14f69c0f0de343b5664b20753142b50bc4e093 --- firmware/App/Services/NVRecordsDD.c (.../NVRecordsDD.c) (revision e17e1dc97bf8878056f1f7e4aa861c2448db52bc) +++ firmware/App/Services/NVRecordsDD.c (.../NVRecordsDD.c) (revision 9a14f69c0f0de343b5664b20753142b50bc4e093) @@ -139,14 +139,14 @@ // ********** private data ********** -// Temporary Record variable used only for receiving record before crc verification +/// Temporary Record variable used only for receiving record before crc verification static DD_SYSTEM_GROUP_T ddTempRxSystemGrp; ///< DD system group structure (including padding and final CRC). static DD_SERVICE_GROUP_T ddTempRxServiceGrp; ///< DD service group structure (including padding and final CRC). static DD_CALIBRATION_RECORD_T ddTempRxCalRecord; ///< DD calibration record structure (including padding and final CRC). static DD_INSTITUTIONAL_GROUP_T ddTempRxInstitGrp; ///< DD institutional group structure (including padding and final CRC). static DD_USAGE_INFO_GROUP_T ddTempRxUsageGrp; ///< DD usage info structure (including padding and final CRC). -// Temporary Process records specifications used only for receiving +/// Temporary Process records specifications used only for receiving static PROCESS_RECORD_SPECS_T tempRxRecords[ NUM_OF_NVM_RECORD_TYPES ] = { // Start address Size of the job Record structure pointer Record CRC pointer Event calibration record update {SYSTEM_RECORD_NV_MEM_START_ADDRESS, sizeof(DD_SYSTEM_GROUP_T), (U08*)&ddTempRxSystemGrp, (U08*)&ddTempRxSystemGrp.crc, DD_EVENT_SYSTEM_RECORD_UPDATE }, // NVM_SYSTEM_RECORD @@ -156,14 +156,14 @@ {USAGE_INFO_START_ADDRESS, sizeof(DD_USAGE_INFO_GROUP_T), (U08*)&ddTempRxUsageGrp, (U08*)&ddTempRxUsageGrp.crc, DD_EVENT_USAGE_INFO_UPDATE }, // NVM_USAGE_INFO_RECORD }; -// Main NVM Record variables +/// Main NVM Record variables static DD_SYSTEM_GROUP_T ddSystemGroup; ///< DD system group structure (including padding and final CRC). static DD_SERVICE_GROUP_T ddServiceGroup; ///< DD service group structure (including padding and final CRC). static DD_CALIBRATION_RECORD_T ddCalibrationRecord; ///< DD calibration record structure (including padding and final CRC). static DD_INSTITUTIONAL_GROUP_T ddInstitutionalGroup; ///< DD institutional group structure (including padding and final CRC). static DD_USAGE_INFO_GROUP_T ddUsageInfoGroup; ///< DD usage info structure (including padding and final CRC). -// Main Process records specifications +/// Main Process records specifications const PROCESS_RECORD_SPECS_T RECORDS_SPECS[ NUM_OF_NVM_RECORD_TYPES ] = { // Start address Size of the job Record structure pointer Record CRC pointer Event calibration record update {SYSTEM_RECORD_NV_MEM_START_ADDRESS, sizeof(DD_SYSTEM_GROUP_T), (U08*)&ddSystemGroup, (U08*)&ddSystemGroup.crc, DD_EVENT_SYSTEM_RECORD_UPDATE }, // NVM_SYSTEM_RECORD @@ -173,10 +173,10 @@ {USAGE_INFO_START_ADDRESS, sizeof(DD_USAGE_INFO_GROUP_T), (U08*)&ddUsageInfoGroup, (U08*)&ddUsageInfoGroup.crc, DD_EVENT_USAGE_INFO_UPDATE }, // NVM_USAGE_INFO_RECORD }; -static NVM_SELF_TEST_STATE_T nvmSelfTestState; ///< NVM self-test state variable. -static SELF_TEST_STATUS_T nvmSelfTestResult; ///< NVM self-test result. -static U32 usageWriteTries; ///< Usage write tries. -static BOOL isSelfTestReadRecordsDone; ///< Set to true when all the records are read +static NVM_SELF_TEST_STATE_T nvmSelfTestState; ///< NVM self-test state variable. +static SELF_TEST_STATUS_T nvmSelfTestResult; ///< NVM self-test result. +static U32 usageWriteTries; ///< Usage write tries. +static BOOL isSelfTestReadRecordsDone; ///< Set to true when all the records are read // ********** private function prototypes ********** @@ -217,7 +217,7 @@ /*********************************************************************//** * @brief - * The execNVMSelfTest function runs the NV data management + * The execNVMRecordsSelfTest function runs the NV data management * self-test state machine. It processes states and updates the result * based on self-test execution. * @details \b Alarms: ALARM_ID_DD_SOFTWARE_FAULT @@ -227,7 +227,7 @@ * nvmSelfTestResult * @return nvmSelfTestResult the result of self-test *************************************************************************/ -SELF_TEST_STATUS_T execNVMSelfTest ( void ) +SELF_TEST_STATUS_T execNVMRecordsSelfTest ( void ) { switch ( nvmSelfTestState ) { @@ -524,18 +524,19 @@ if ( calcCRC != recordCRC ) { // CRC did not pass so set all values to default -// ddInstitutionalGroup.ddInstitutionalRecord.minDialysateFlowMLPM = getU32DefaultTreatmentParamEdge( TREATMENT_PARAM_DIALYSATE_FLOW, TRUE ); -// ddInstitutionalGroup.ddInstitutionalRecord.maxDialysateFlowMLPM = getU32DefaultTreatmentParamEdge( TREATMENT_PARAM_DIALYSATE_FLOW, FALSE ); -// ddInstitutionalGroup.ddInstitutionalRecord.minDialysateTempC = getF32DefaultTreatmentParamEdge( TREATMENT_PARAM_DIALYSATE_TEMPERATURE, TRUE ); -// ddInstitutionalGroup.ddInstitutionalRecord.maxDialysateTempC = getF32DefaultTreatmentParamEdge( TREATMENT_PARAM_DIALYSATE_TEMPERATURE, FALSE ); -// ddInstitutionalGroup.ddInstitutionalRecord.acidConcentrate = getF32DefaultTreatmentParamEdge( TREATMENT_PARAM_ACID_CONCENTRATE, FALSE ); +// ddInstitutionalGroup.ddInstitutionalRecord.minDialysateFlowMLPM = getU32TreatmentParamLowerRangeLimit( TREATMENT_PARAM_DIALYSATE_FLOW ); +// ddInstitutionalGroup.ddInstitutionalRecord.maxDialysateFlowMLPM = getU32TreatmentParamUpperRangeLimit( TREATMENT_PARAM_DIALYSATE_FLOW ); +// ddInstitutionalGroup.ddInstitutionalRecord.minDialysateTempC = getF32TreatmentParamLowerRangeLimit( TREATMENT_PARAM_DIALYSATE_TEMPERATURE ); +// ddInstitutionalGroup.ddInstitutionalRecord.maxDialysateTempC = getF32TreatmentParamUpperRangeLimit( TREATMENT_PARAM_DIALYSATE_TEMPERATURE ); +// ddInstitutionalGroup.ddInstitutionalRecord.minAcidConcentrate = getU32TreatmentParamLowerRangeLimit( TREATMENT_PARAM_ACID_CONCENTRATE ); +// ddInstitutionalGroup.ddInstitutionalRecord.maxAcidConcentrate = getU32TreatmentParamUpperRangeLimit( TREATMENT_PARAM_ACID_CONCENTRATE ); +// ddInstitutionalGroup.ddInstitutionalRecord.minBicarbCartridgeSizeG = getU32TreatmentParamLowerRangeLimit( TREATMENT_PARAM_DRY_BICARB_CART_SIZE ); +// ddInstitutionalGroup.ddInstitutionalRecord.maxBicarbCartridgeSizeG = getU32TreatmentParamUpperRangeLimit( TREATMENT_PARAM_DRY_BICARB_CART_SIZE ); +// ddInstitutionalGroup.ddInstitutionalRecord.minSodiumMEQL = getU32TreatmentParamLowerRangeLimit( TREATMENT_PARAM_SODIUM ); +// ddInstitutionalGroup.ddInstitutionalRecord.maxSodiumMEQL = getU32TreatmentParamUpperRangeLimit( TREATMENT_PARAM_SODIUM ); +// ddInstitutionalGroup.ddInstitutionalRecord.minBicarbonateMEQL = getU32TreatmentParamLowerRangeLimit( TREATMENT_PARAM_BICARBONATE ); +// ddInstitutionalGroup.ddInstitutionalRecord.maxBicarbonateMEQL = getU32TreatmentParamUpperRangeLimit( TREATMENT_PARAM_BICARBONATE ); -// ddInstitutionalGroup.ddInstitutionalRecord.bicarbCartridgeSizeG = getF32DefaultTreatmentParamEdge( TREATMENT_PARAM_DIALYSATE_TEMPERATURE, FALSE ); -// ddInstitutionalGroup.ddInstitutionalRecord.minSodiumMEQL = getF32DefaultTreatmentParamEdge( TREATMENT_PARAM_DIALYSATE_TEMPERATURE, FALSE ); -// ddInstitutionalGroup.ddInstitutionalRecord.maxSodiumMEQL = getF32DefaultTreatmentParamEdge( TREATMENT_PARAM_DIALYSATE_TEMPERATURE, FALSE ); -// ddInstitutionalGroup.ddInstitutionalRecord.minBicarbonateMEQL = getF32DefaultTreatmentParamEdge( TREATMENT_PARAM_DIALYSATE_TEMPERATURE, FALSE ); -// ddInstitutionalGroup.ddInstitutionalRecord.maxBicarbonateMEQL = getF32DefaultTreatmentParamEdge( TREATMENT_PARAM_DIALYSATE_TEMPERATURE, FALSE ); - ddInstitutionalGroup.ddInstitutionalRecord.minRORejectionRatioPCT = DEFAULT_MAX_RO_REJECTION_RATIO_PCT; ddInstitutionalGroup.ddInstitutionalRecord.disinfectionFrequency = DEFAULT_NUM_OF_DISINFECTION_FREQUENCY; ddInstitutionalGroup.ddInstitutionalRecord.disinfectionCycleTime = DEFAULT_NUM_OF_DISINFECTION_CYCLE_TIME; @@ -977,7 +978,7 @@ /*********************************************************************//** * @brief - * The getNVRecord2Driver function copies the requested non-volatile + * The getNVMRecord function copies the requested non-volatile * data into the provided buffer and checks if the data is valid. It * raises the specified alarm if invalid data is detected. * @details \b Alarms: ALARM_ID_DD_SOFTWARE_FAULT if invalid record is @@ -992,7 +993,7 @@ * if the data is not valid * @return TRUE if the non-volatile data is valid otherwise FALSE *************************************************************************/ -BOOL getNVRecord2Driver( NV_DATA_T nvData, U08* bufferAddress, U32 bufferLength, +BOOL getNVMRecord( NV_DATA_T nvData, U08* bufferAddress, U32 bufferLength, U08 numOfSnsrs2Check, ALARM_ID_T nvAlarm ) { U08 i;