From b01d1ea1edf5f1ec8b01901aa742d9f157a39edd Mon Sep 17 00:00:00 2001 From: Nav Date: Fri, 5 Nov 2021 23:44:09 +0000 Subject: [PATCH] EEPROM memory descriptor for AVR8 targets --- src/Targets/Microchip/AVR/AVR8/Avr8.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp index b8f06706..5bfc0d6e 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp @@ -554,8 +554,7 @@ void Avr8::loadTargetRegisterDescriptors() { } void Avr8::loadTargetMemoryDescriptors() { - auto ramSize = this->targetParameters->ramSize.value(); - auto ramStartAddress = this->targetParameters->ramStartAddress.value(); + const auto ramStartAddress = this->targetParameters->ramStartAddress.value(); this->targetMemoryDescriptorsByType.insert(std::pair( TargetMemoryType::RAM, @@ -563,10 +562,25 @@ void Avr8::loadTargetMemoryDescriptors() { TargetMemoryType::RAM, TargetMemoryAddressRange( ramStartAddress, - ramStartAddress + ramSize + ramStartAddress + this->targetParameters->ramSize.value() ) ) )); + + if (this->targetParameters->eepromStartAddress.has_value() && this->targetParameters->eepromSize.has_value()) { + const auto eepromStartAddress = this->targetParameters->eepromStartAddress.value(); + + this->targetMemoryDescriptorsByType.insert(std::pair( + TargetMemoryType::EEPROM, + TargetMemoryDescriptor( + TargetMemoryType::EEPROM, + TargetMemoryAddressRange( + eepromStartAddress, + eepromStartAddress + this->targetParameters->eepromSize.value() + ) + ) + )); + } } TargetSignature Avr8::getId() {