Index: NVDataMgmt.c =================================================================== diff -u -r448294501a7a561274286907e9c20ab2400daff3 -r0683bee0dab93f2f6f96562f8e9d642e805fcf0c --- NVDataMgmt.c (.../NVDataMgmt.c) (revision 448294501a7a561274286907e9c20ab2400daff3) +++ NVDataMgmt.c (.../NVDataMgmt.c) (revision 0683bee0dab93f2f6f96562f8e9d642e805fcf0c) @@ -2178,7 +2178,7 @@ writtenRecordStatus = NVDATAMGMT_RECORD_NOT_CHECKED; // Issue the write command - Fapi_issueProgrammingCommand( (U32*)memoryPtr, structPtr, jobSpecs.maxWriteBufferSize, 0x00, 0, Fapi_DataOnly ); + Fapi_issueProgrammingCommand ( (U32*)memoryPtr, structPtr, jobSpecs.maxWriteBufferSize, 0x00, 0, Fapi_DataOnly ); } } } @@ -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_ + alarm = 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; }