Index: firmware/App/Services/NVMgmtDD.c =================================================================== diff -u -ra68c7679e493224bd41df72321d4c2537207234f -rb878faee61a0800b767d053ab3f65afb3790dacb --- firmware/App/Services/NVMgmtDD.c (.../NVMgmtDD.c) (revision a68c7679e493224bd41df72321d4c2537207234f) +++ firmware/App/Services/NVMgmtDD.c (.../NVMgmtDD.c) (revision b878faee61a0800b767d053ab3f65afb3790dacb) @@ -189,13 +189,13 @@ break; case NVDATAMGMT_WRITE: - writeSector( (U32*)recordFlashAddress, (U08*)bufferAddress, jobSpecs.maxWriteBufferSize ); + writeSector( (U32*)recordFlashAddress, (U08*)bufferAddress, MAX_EEPROM_WRITE_BUFFER_BYTES ); currentTime = getMSTimerCount(); state = NVDATAMGMT_EXEC_STATE_WRITE_TO_EEPROM; break; case NVDATAMGMT_READ: - readSector( (U32*)recordFlashAddress, (U32*)bufferAddress, ( jobSpecs.maxReadBufferSize / EEPROM_OPS_SIZE_OF_CONVERTER ) ); + readSector( (U32*)recordFlashAddress, (U32*)bufferAddress, ( jobSpecs.sizeofRecord / EEPROM_OPS_SIZE_OF_CONVERTER ) ); currentTime = getMSTimerCount(); state = NVDATAMGMT_EXEC_STATE_READ_FROM_EEPROM; break; @@ -266,35 +266,35 @@ { currentTime = getMSTimerCount(); U32 recordFlashAddress = jobSpecs.recordFlashAddress + recordAddressOffset; - U32 maxBufferLength = jobSpecs.maxWriteBufferSize / EEPROM_OPS_SIZE_OF_CONVERTER; + U32 maxBufferLength = MAX_EEPROM_WRITE_BUFFER_BYTES / EEPROM_OPS_SIZE_OF_CONVERTER; // Clear the buffer from the previous content memset( writtenRecordCheckBuffer, 0, sizeof( writtenRecordCheckBuffer ) ); - // Issue a FAPI read command but only the bytes that were written, so use maxWriteBufferSize + // Issue a FAPI read command but only the bytes that were written, so use maxBufferLength readSector( (U32*)recordFlashAddress, (U32*)writtenRecordCheckBuffer, maxBufferLength ); state = NVDATAMGMT_EXEC_STATE_VERIFY_EEPROM_WRITE; } else if ( writtenRecordStatus == NVDATAMGMT_RECORD_VALID ) { // If the data is valid, and if it is at the end of the write, change to idle - if ( jobSpecs.sizeofJob == recordAddressOffset ) + if ( jobSpecs.sizeofRecord == recordAddressOffset ) { state = NVDATAMGMT_EXEC_STATE_IDLE; } else { // Update the variables and issue the next write command currentTime = getMSTimerCount(); - recordAddressOffset += jobSpecs.maxWriteBufferSize; + recordAddressOffset += MAX_EEPROM_WRITE_BUFFER_BYTES; U32 memoryPtr = jobSpecs.recordFlashAddress + recordAddressOffset; U08* structPtr = jobSpecs.structAddressPtr + recordAddressOffset; writtenRecordStatus = NVDATAMGMT_RECORD_NOT_CHECKED; // Issue the write command - writeSector( (U32*)memoryPtr, structPtr, jobSpecs.maxWriteBufferSize ); + writeSector( (U32*)memoryPtr, structPtr, MAX_EEPROM_WRITE_BUFFER_BYTES ); } } } @@ -355,7 +355,7 @@ U08* bufferPtr = jobSpecs.structAddressPtr + recordAddressOffset; // Loop through the bytes in the buffer - for ( i = 0; i < jobSpecs.maxWriteBufferSize; i++ ) + for ( i = 0; i < MAX_EEPROM_WRITE_BUFFER_BYTES; i++ ) { // Check if data in the buffer is not the same as the data in the structure if ( writtenRecordCheckBuffer[ i ] != *bufferPtr )