Index: firmware/App/Drivers/ConductivitySensors.c =================================================================== diff -u -r7362b089e676aadfaa614cca148e2aed007bae95 -r13e865e5849f939d1c413b55f7240bc047006996 --- firmware/App/Drivers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 7362b089e676aadfaa614cca148e2aed007bae95) +++ firmware/App/Drivers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 13e865e5849f939d1c413b55f7240bc047006996) @@ -1005,7 +1005,8 @@ if ( sensorIdx < NUM_OF_CONDUCTIVITY_SENSORS ) { - record = conductivitySensorCoefficients[ sensorIdx ]; +// record = conductivitySensorCoefficients[ sensorIdx ]; + record = conductivityCalRecord[ sensorIdx ]; } else { Index: firmware/App/Services/NVMessagingDD.c =================================================================== diff -u -r3ac9763f9bcf1246565b6309c5d1b1d6b665700c -r13e865e5849f939d1c413b55f7240bc047006996 --- firmware/App/Services/NVMessagingDD.c (.../NVMessagingDD.c) (revision 3ac9763f9bcf1246565b6309c5d1b1d6b665700c) +++ firmware/App/Services/NVMessagingDD.c (.../NVMessagingDD.c) (revision 13e865e5849f939d1c413b55f7240bc047006996) @@ -82,7 +82,7 @@ { BOOL accepted; ///< Accepted/Rejected U32 rejectionReason; ///< Reason to reject the entire request - U32 waterRecoveryRejectReason; ///< Reason to reject Service record parameter waterRecovery + U32 waterRecoveryModeRejectReason; ///< Reason to reject Service record parameter waterRecoveryMode U32 primaryFilterReplacementDateRejectReason; ///< Reason to reject Service record parameter primaryFilterReplacementDate U32 secondaryFilterReplacementDateRejectReason; ///< Reason to reject Service record parameter secondaryFilterReplacementDate U32 ROMembraneReplacementDateRejectReason; ///< Reason to reject Service record parameter ROMembraneReplacementDate @@ -2630,6 +2630,7 @@ { memcpy( &record, message->payload, expectedPayloadLen ); record.crc = crc16( (U08*)&record, expectedPayloadLen ); + // TODO: Add a range check function setNVMRecord( NV_DD_DATA_INSTIT_BASIC_RECORD, (U08*)&record, 0 ); result = enqueueEraseAndWriteSector( NVM_INSTITUTIONAL_RECORD ); sendNVEvent( NVM_INSTITUTIONAL_RECORD, 0, 0 ); Index: firmware/App/Services/NVRecordsDD.c =================================================================== diff -u -r7b414857790dd5282137bf67d56688a703d4bfe7 -r13e865e5849f939d1c413b55f7240bc047006996 --- firmware/App/Services/NVRecordsDD.c (.../NVRecordsDD.c) (revision 7b414857790dd5282137bf67d56688a703d4bfe7) +++ firmware/App/Services/NVRecordsDD.c (.../NVRecordsDD.c) (revision 13e865e5849f939d1c413b55f7240bc047006996) @@ -122,14 +122,6 @@ // ********** DD record structures ********** -/// DD calibration group structure -typedef struct -{ - DD_CALIBRATION_RECORD_T ddCalibrationRecord; ///< DD calibration groups. - U08 padding[ CALIBRATION_RECORD_PADDING_LENGTH ]; ///< DD calibration record padding byte array. - U16 crc; ///< CRC for the DG calibration record structure. -} DD_CALIBRATION_GROUP_T; - /// DD system group structure typedef struct { @@ -146,6 +138,14 @@ U16 crc; ///< CRC for the DG service structure. } DD_SERVICE_GROUP_T; +/// DD calibration group structure +typedef struct +{ + DD_CALIBRATION_RECORD_T ddCalibrationRecord; ///< DD calibration groups. + U08 padding[ CALIBRATION_RECORD_PADDING_LENGTH ]; ///< DD calibration record padding byte array. + U16 crc; ///< CRC for the DG calibration record structure. +} DD_CALIBRATION_GROUP_T; + /// DD institutional group structure typedef struct { @@ -424,11 +424,6 @@ activateAlarmNoData( ALARM_ID_DD_NVM_INVALID_INSTITUTIONAL_RECORD_CRC ); } - if ( FALSE == hasFPServiceRecordPassed ) - { - activateAlarmNoData( ALARM_ID_FP_NVM_INVALID_SERVICE_RECORD_CRC ); - } - if ( FALSE == hasFPUsageRecordPassed ) { activateAlarmNoData( ALARM_ID_FP_NVM_INVALID_USAGE_RECORD_CRC ); @@ -1254,7 +1249,7 @@ *************************************************************************/ static void initFPServiceRecord( void ) { - ddServiceGroup.ddServiceRecord.fpRecord.waterRecovery = 0; + ddServiceGroup.ddServiceRecord.fpRecord.waterRecoveryMode = 0; ddServiceGroup.ddServiceRecord.fpRecord.primaryFilterReplacementDate = 0; ddServiceGroup.ddServiceRecord.fpRecord.secondaryFilterReplacementDate = 0; ddServiceGroup.ddServiceRecord.fpRecord.ROMembraneReplacementDate = 0; Index: firmware/App/Services/NVRecordsDD.h =================================================================== diff -u -r7b414857790dd5282137bf67d56688a703d4bfe7 -r13e865e5849f939d1c413b55f7240bc047006996 --- firmware/App/Services/NVRecordsDD.h (.../NVRecordsDD.h) (revision 7b414857790dd5282137bf67d56688a703d4bfe7) +++ firmware/App/Services/NVRecordsDD.h (.../NVRecordsDD.h) (revision 13e865e5849f939d1c413b55f7240bc047006996) @@ -153,6 +153,53 @@ #pragma pack(push, 1) +/// DD systems record structure +typedef struct +{ + BOOL isROFeatured; ///< True : RO featured. False : RO de-featured. + BOOL isROFeaturedBoostPump; ///< True : RO featured with boost pump. False : RO featured without the boost pump. + char topLevelPN[ MAX_TOP_LEVEL_PN_CHARS ]; ///< DD top level part number. + char topLevelSN[ MAX_TOP_LEVEL_SN_CHARS ]; ///< DD top level serial number. + U32 mfgLocation; ///< DD manufacturing location. + U32 mfgDate; ///< DD manufacturing date. + U16 crc; ///< CRC for the DD system record structure. +} DD_SYSTEM_RECORD_T; + +/// FP service record structure +typedef struct +{ + U32 waterRecoveryMode; ///< Low : 0, Medium : 1, High : 2. + U32 primaryFilterReplacementDate; ///< Last replacement date of primary carbon filter + U32 secondaryFilterReplacementDate; ///< Last replacement date of secondary carbon filter + U32 ROMembraneReplacementDate; ///< Last replacement date of RO Membrane + U32 serviceLoc; ///< DD service location. + U32 lastServiceEpochDate; ///< DD last service date in epoch. + U32 serviceIntervalSeconds; ///< DD service interval in seconds. + U32 lastResetTimeEpoch; ///< Last time the record was reset in epoch. + U16 crc; ///< CRC for the DD service record structure. +} SERVICE_RECORD_FP_T; + +/// DD service record structure +typedef struct +{ + BOOL isHDFOnlineFluidAvailable; ///< True : HDF Online Fluid feature is available, False if not. + U32 ultraFilter1ReplacementDate; ///< Last replacement date of Ultrafilter 1 + U32 ultraFilter2ReplacementDate; ///< Last replacement date of Ultrafilter 2 + U32 UFPumpTubingReplacementDate; ///< Last replacement date of UP Pump Tubing + U32 serviceLoc; ///< DD service location. + U32 lastServiceEpochDate; ///< DD last service date in epoch. + U32 serviceIntervalSeconds; ///< DD service interval in seconds. + U32 lastResetTimeEpoch; ///< Last time the record was reset in epoch. + U16 crc; ///< CRC for the DD service record structure. +} SERVICE_RECORD_DD_T; + +/// DD service record structure +typedef struct +{ + SERVICE_RECORD_FP_T fpRecord; ///< FP service record + SERVICE_RECORD_DD_T ddRecord; ///< DD service record. +} DD_SERVICE_RECORD_T; + /// Linear calibration structure typedef struct { @@ -255,64 +302,17 @@ /// DD calibration groups structure typedef struct { - DD_PRES_SENSORS_CAL_RECORD_T presSensorsCalRecord; ///< DD pressure sensors calibration record - DD_TEMP_SENSORS_CAL_RECORD_T tempSensorsCalRecord; ///< DD temperature sensors calibration record - DD_CONC_PUMPS_CAL_RECORD_T concentratePumpsRecord; ///< DD concentrate pumps calibration record - DD_D12_DIALYSATE_PUMP_RECORD_T d12DialysatePumpRecord; ///< DD dialysate pump d12 calibration data. - DD_D48_DIALYSATE_PUMP_RECORD_T d48DialysatePumpRecord; ///< DD dialysate pumps calibration record - DD_ACID_CONCENTRATES_RECORD_T acidConcentratesRecord; ///< DD acid concentrates calibration record - DD_BICARB_CONCENTRATES_RECORD_T bicarbConcentratesRecord; ///< DD bicarb concentrates calibration record - DD_ACCEL_SENSOR_CAL_RECORD_T accelerometerSensorCalRecord; ///< DD accelerometer sensor. - DD_BLOOD_LEAK_SENSOR_CAL_RECORD_T bloodLeakSensorCalRecord; ///< DD blood leak detector calibration record + DD_PRES_SENSORS_CAL_RECORD_T presSensorsCalRecord; ///< DD pressure sensors calibration record + DD_TEMP_SENSORS_CAL_RECORD_T tempSensorsCalRecord; ///< DD temperature sensors calibration record + DD_CONC_PUMPS_CAL_RECORD_T concentratePumpsRecord; ///< DD concentrate pumps calibration record + DD_D12_DIALYSATE_PUMP_RECORD_T d12DialysatePumpRecord; ///< DD dialysate pump d12 calibration data. + DD_D48_DIALYSATE_PUMP_RECORD_T d48DialysatePumpRecord; ///< DD dialysate pumps calibration record + DD_ACID_CONCENTRATES_RECORD_T acidConcentratesRecord; ///< DD acid concentrates calibration record + DD_BICARB_CONCENTRATES_RECORD_T bicarbConcentratesRecord; ///< DD bicarb concentrates calibration record + DD_ACCEL_SENSOR_CAL_RECORD_T accelerometerSensorCalRecord; ///< DD accelerometer sensor. + DD_BLOOD_LEAK_SENSOR_CAL_RECORD_T bloodLeakSensorCalRecord; ///< DD blood leak detector calibration record } DD_CALIBRATION_RECORD_T; -/// DD systems record structure -typedef struct -{ - BOOL isROFeatured; ///< True : RO featured. False : RO de-featured. - BOOL isROFeaturedBoostPump; ///< True : RO featured with boost pump. False : RO featured without the boost pump. - char topLevelPN[ MAX_TOP_LEVEL_PN_CHARS ]; ///< DD top level part number. - char topLevelSN[ MAX_TOP_LEVEL_SN_CHARS ]; ///< DD top level serial number. - U32 mfgLocation; ///< DD manufacturing location. - U32 mfgDate; ///< DD manufacturing date. - U16 crc; ///< CRC for the DD system record structure. -} DD_SYSTEM_RECORD_T; - -/// FP service record structure -typedef struct -{ - U32 waterRecovery; ///< Low : 0, Medium : 1, High : 2. - U32 primaryFilterReplacementDate; ///< Last replacement date of primary carbon filter - U32 secondaryFilterReplacementDate; ///< Last replacement date of secondary carbon filter - U32 ROMembraneReplacementDate; ///< Last replacement date of RO Membrane - U32 serviceLoc; ///< DD service location. - U32 lastServiceEpochDate; ///< DD last service date in epoch. - U32 serviceIntervalSeconds; ///< DD service interval in seconds. - U32 lastResetTimeEpoch; ///< Last time the record was reset in epoch. - U16 crc; ///< CRC for the DD service record structure. -} SERVICE_RECORD_FP_T; - -/// DD service record structure -typedef struct -{ - BOOL isHDFOnlineFluidAvailable; ///< True : HDF Online Fluid feature is available, False if not. - U32 ultraFilter1ReplacementDate; ///< Last replacement date of Ultrafilter 1 - U32 ultraFilter2ReplacementDate; ///< Last replacement date of Ultrafilter 2 - U32 UFPumpTubingReplacementDate; ///< Last replacement date of UP Pump Tubing - U32 serviceLoc; ///< DD service location. - U32 lastServiceEpochDate; ///< DD last service date in epoch. - U32 serviceIntervalSeconds; ///< DD service interval in seconds. - U32 lastResetTimeEpoch; ///< Last time the record was reset in epoch. - U16 crc; ///< CRC for the DD service record structure. -} SERVICE_RECORD_DD_T; - -/// DD service record structure -typedef struct -{ - SERVICE_RECORD_FP_T fpRecord; ///< FP service record - SERVICE_RECORD_DD_T ddRecord; ///< DD service record. -} DD_SERVICE_RECORD_T; - /// Institutional data structure. typedef struct { @@ -360,12 +360,12 @@ /// FP usage info structure. typedef struct { - U32 primaryFilterTreatmentNum; ///< Number of treatments performed on ultrafilter 1 since last replaced - U32 primaryFilterDisinfectionNum; ///< Number of disinfections performed on ultrafilter 1 since last replaced - U32 secondaryFilterTreatmentNum; ///< Number of treatments performed on ultrafilter 2 since last replaced - U32 secondaryFilterDisinfectionNum; ///< Number of disinfections performed on ultrafilter 2 since last replaced - U32 ROMembraneTreatmentNum; ///< Number of treatments performed on UF Pump Tubing since last replaced - U32 ROMembraneDisinfectionNum; ///< Number of disinfections performed on UF Pump Tubing since last replaced + U32 primaryFilterTreatmentNum; ///< Number of treatments performed on primary carbon filter since last replaced + U32 primaryFilterDisinfectionNum; ///< Number of heat disinfections performed on primary carbon filter since last replaced + U32 secondaryFilterTreatmentNum; ///< Number of treatments performed on secondary carbon filter since last replaced + U32 secondaryFilterDisinfectionNum; ///< Number of heat disinfections performed on secondary carbon filter since last replaced + U32 ROMembraneTreatmentNum; ///< Number of treatments performed on RO membrane since last replaced + U32 ROMembraneDisinfectionNum; ///< Number of heat disinfections performed on RO membrane since last replaced U32 lastResetTimeEpoch; ///< Last time the record was reset in epoch. U16 crc; ///< CRC for the DD usage info structure. } USAGE_RECORD_FP_T; @@ -376,11 +376,11 @@ F32 roWaterGenTotalL; ///< Total RO water generated in liters. (Cannot be reset) F32 roWaterGenSinceLastServiceL; ///< RO water generated since last treatment in liters. U32 ultraFilter1TreatmentNum; ///< Number of treatments performed on ultrafilter 1 since last replaced - U32 ultraFilter1DisinfectionNum; ///< Number of disinfections performed on ultrafilter 1 since last replaced + U32 ultraFilter1DisinfectionNum; ///< Number of heat disinfections performed on ultrafilter 1 since last replaced U32 ultraFilter2TreatmentNum; ///< Number of treatments performed on ultrafilter 2 since last replaced - U32 ultraFilter2DisinfectionNum; ///< Number of disinfections performed on ultrafilter 2 since last replaced + U32 ultraFilter2DisinfectionNum; ///< Number of heat disinfections performed on ultrafilter 2 since last replaced U32 UFPumpTubingTreatmentNum; ///< Number of treatments performed on UF Pump Tubing since last replaced - U32 UFPumpTubingDisinfectionNum; ///< Number of disinfections performed on UF Pump Tubing since last replaced + U32 UFPumpTubingDisinfectionNum; ///< Number of heat disinfections performed on UF Pump Tubing since last replaced U32 lastBasicFlushCompleteDateEpoch; ///< Last basic flush complete date in epoch. U32 lastHeatDisCompleteDateEpoch; ///< Last heat disinfect complete date in epoch. U32 lastHeatActiveCoolCompleteDateEpoch; ///< Last heat disinfect active cool complete date in epoch.