Index: NVDataMgmt.c =================================================================== diff -u -rea50b65284ae5683fd7e6b89fd8134cf46777722 -r73b6222bc2c1a69f45f62bfc3463e5616d813fb8 --- NVDataMgmt.c (.../NVDataMgmt.c) (revision ea50b65284ae5683fd7e6b89fd8134cf46777722) +++ NVDataMgmt.c (.../NVDataMgmt.c) (revision 73b6222bc2c1a69f45f62bfc3463e5616d813fb8) @@ -678,11 +678,11 @@ nvDataMgmtSelfTestState = handleSelfTestReadServiceRecord(); break; - case NVDATAMGMT_SELF_TEST_STATE_READ_SCHEDULED_RUNS_RECORD: #ifdef _DG_ + case NVDATAMGMT_SELF_TEST_STATE_READ_SCHEDULED_RUNS_RECORD: nvDataMgmtSelfTestState = handleSelfTestReadScheduledRunsRecord(); -#endif break; +#endif case NVDATAMGMT_SELF_TEST_STATE_READ_LOG_RECORD: nvDataMgmtSelfTestState = handleSelfTestReadLogRecord(); @@ -2150,7 +2150,7 @@ { currentTime = getMSTimerCount(); U32 startAddress = jobSpecs.startAddress + recordAddressOffset; - U32 maxBufferLength = ( jobSpecs.maxWriteBufferSize / EEPROM_OPS_SIZE_OF_CONVERTER ); + U32 maxBufferLength = jobSpecs.maxWriteBufferSize / EEPROM_OPS_SIZE_OF_CONVERTER; // Clear the buffer from the previous content memset( writtenRecordCheckBuffer, 0, sizeof(writtenRecordCheckBuffer)); @@ -2178,7 +2178,7 @@ writtenRecordStatus = NVDATAMGMT_RECORD_NOT_CHECKED; // The length should be divided by 4 - U32 maxBufferLength = jobSpecs.maxWriteBufferSize; + U32 maxBufferLength = jobSpecs.maxWriteBufferSize / EEPROM_OPS_SIZE_OF_CONVERTER; // Issue the write command Fapi_issueProgrammingCommand ( (U32*)memoryPtr, structPtr, maxBufferLength, 0x00, 0, Fapi_DataOnly ); @@ -2981,16 +2981,16 @@ if ( TRUE == isCheckRequired ) { spec = RECORDS_SPECS [ i ]; - calcCRC = crc16 ( spec.structAddressPtr, spec.sizeofJob - sizeof(U16) ); - recordCRC = *(U16*)spec.structCRCPtr; + 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; - } + // 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; + } } }