Index: NVDataMgmt.c =================================================================== diff -u -r57a8de63b2dbecb2e951e8672f95a387c3d522a1 -r1e0372e3d21d91eb8afcf9fc496c06df4d0cf3b9 --- NVDataMgmt.c (.../NVDataMgmt.c) (revision 57a8de63b2dbecb2e951e8672f95a387c3d522a1) +++ NVDataMgmt.c (.../NVDataMgmt.c) (revision 1e0372e3d21d91eb8afcf9fc496c06df4d0cf3b9) @@ -2961,35 +2961,25 @@ *************************************************************************/ static BOOL areRecordsValid( void ) { - U32 i; - U16 calcCRC; - U16 recordCRC; - PROCESS_RECORD_SPECS_T spec; + ALARM_ID_T alarm; + BOOL status = TRUE; - BOOL isCheckRequired = TRUE; + PROCESS_RECORD_SPECS_T spec = RECORDS_SPECS [ NVDATAMGMT_CALIBRATION_RECORD ]; + U16 calcCRC = crc16 ( spec.structAddressPtr, spec.sizeofJob - sizeof(U16) ); + U16 recordCRC = *(U16*)spec.structCRCPtr; - for ( i = 0; i < NUM_OF_NVDATMGMT_RECORDS_JOBS; i++ ) + // If the CRCs do not match, break out of loop since POST will be failed + // regardless of the rest of the results + if ( calcCRC != recordCRC ) { #ifdef _DG_ - // Scheduled runs are not part this phase but it is part of the enums - // so they are ignored during checking - isCheckRequired = ( NVDATAMGMT_SCHEDULED_RUNS_RECORD == i ? FALSE : TRUE ); + alarm = ALARM_ID_DG_NVDATAMGMT_CAL_GROUP_RECORD_CRC_INVALID; #endif - if ( TRUE == isCheckRequired ) - { - spec = RECORDS_SPECS [ i ]; - calcCRC = crc16 ( spec.structAddressPtr, spec.sizeofJob - sizeof(U16) ); - recordCRC = *(U16*)spec.structCRCPtr; - - // If the CRCs do not match, break out of loop since POST will be failed - // regardless of the rest of the results - if ( calcCRC != recordCRC ) - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_NVDATAMGMT_GROUP_RECORD_CRC_INVALID, i ); - status = FALSE; - } - } - +#ifdef _HD_ + alam = ALARM_ID_HD_NVDATAMGMT_CAL_GROUP_RECORD_CRC_INVALID +#endif + activateAlarmNoData( alarm ); + status = FALSE; } return status; @@ -3105,7 +3095,7 @@ // Recalculate the CRC with the default values dgSystemGroup.dgSystemRecord.crc = crc16 ( (U08*)&dgSystemGroup.dgSystemRecord, sizeof(DG_SYSTEM_RECORD_T) - sizeof(U16) ); - activateAlarmNoData( ALARM_ID_DG_INVALID_SYSTEM_RECORD ); + activateAlarmNoData( ALARM_ID_DG_INVALID_SYSTEM_RECORD_CRC ); // Set the to FALSE since the record is not valid status = FALSE; @@ -3137,7 +3127,7 @@ dgServiceGroup.dgServiceRecord.crc = crc16 ( (U08*)&dgServiceGroup.dgServiceRecord, sizeof(DG_SERVICE_RECORD_T) - sizeof(U16) ); // Service record failure is also considered as RTC RAM failure - activateAlarmNoData( ALARM_ID_DG_INVALID_SERVICE_RECORD ); + activateAlarmNoData( ALARM_ID_DG_INVALID_SERVICE_RECORD_CRC ); // Set the to FALSE since the record is not valid status = FALSE; @@ -3563,9 +3553,6 @@ record->calibrationTime = RECORD_DEFAULT_TIME; record->crc = crc16 ( (U08*)record, sizeof(DG_BICARB_CONCENTRATE_T) - sizeof(U16) ); - // Alarm if the CRC did not pass - activateAlarmNoData( ALARM_ID_NVDATAMGMT_INDIVIDUAL_RECORD_CRC_INVALID ); - // Set the to FALSE since the record is not valid status = FALSE; }