Refactored EEPROM TDF memory segment lookup and included a fallback
for cases where the eeprom segment is located in the data address space, as opposed to a dedicated address space for eeprom memory.
This commit is contained in:
@@ -131,10 +131,18 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile
|
||||
$this->gpRegisterSize = $registerMemorySegment->size;
|
||||
$this->gpRegisterStartAddress = $registerMemorySegment->startAddress;
|
||||
}
|
||||
|
||||
if (isset($dataAddressSpace->memorySegmentsByTypeAndName['eeprom']['eeprom'])) {
|
||||
$eepromMemorySegment = $dataAddressSpace->memorySegmentsByTypeAndName['eeprom']['eeprom'];
|
||||
$this->eepromSize = $eepromMemorySegment->size;
|
||||
$this->eepromPageSize = $eepromMemorySegment->pageSize;
|
||||
}
|
||||
}
|
||||
|
||||
$eepromAddressSpace = $this->addressSpacesById['eeprom'] ?? null;
|
||||
if (!empty($eepromAddressSpace)) {
|
||||
if ((is_null($this->eepromSize) || is_null($this->eepromPageSize))
|
||||
&& isset($this->addressSpacesById['eeprom'])
|
||||
) {
|
||||
$eepromAddressSpace = $this->addressSpacesById['eeprom'];
|
||||
$eepromMemorySegments = $eepromAddressSpace->memorySegmentsByTypeAndName['eeprom'] ?? null;
|
||||
|
||||
if (!empty($eepromMemorySegments)) {
|
||||
|
||||
Reference in New Issue
Block a user