diff --git a/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp b/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp index 071b9727..881772f6 100644 --- a/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp +++ b/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp @@ -13,7 +13,6 @@ namespace Targets::Microchip::Avr::Avr8Bit::TargetDescription using Targets::TargetDescription::RegisterGroup; using Targets::TargetDescription::AddressSpace; using Targets::TargetDescription::MemorySegment; - using Targets::TargetDescription::MemorySegmentType; using Targets::TargetDescription::Register; using Targets::TargetVariant; using Targets::TargetRegisterDescriptor; diff --git a/src/Targets/TargetDescription/MemorySegment.hpp b/src/Targets/TargetDescription/MemorySegment.hpp index d6081f4a..f72a4eb6 100644 --- a/src/Targets/TargetDescription/MemorySegment.hpp +++ b/src/Targets/TargetDescription/MemorySegment.hpp @@ -3,6 +3,8 @@ #include #include +#include "src/Targets/TargetMemorySegmentType.hpp" + #include "MemorySegmentSection.hpp" #include "src/Services/StringService.hpp" @@ -10,27 +12,11 @@ namespace Targets::TargetDescription { - enum class MemorySegmentType: std::uint8_t - { - ALIASED, - REGISTERS, - EEPROM, - FLASH, - FUSES, - IO, - RAM, - LOCKBITS, - OSCCAL, - PRODUCTION_SIGNATURES, - SIGNATURES, - USER_SIGNATURES, - }; - struct MemorySegment { std::string key; std::string name; - MemorySegmentType type; + TargetMemorySegmentType type; std::uint32_t startAddress; std::uint32_t size; std::optional pageSize; @@ -39,7 +25,7 @@ namespace Targets::TargetDescription MemorySegment( const std::string& key, const std::string& name, - MemorySegmentType type, + TargetMemorySegmentType type, std::uint32_t startAddress, std::uint32_t size, const std::optional& pageSize, diff --git a/src/Targets/TargetDescription/TargetDescriptionFile.cpp b/src/Targets/TargetDescription/TargetDescriptionFile.cpp index 1913ef88..a8f0851f 100644 --- a/src/Targets/TargetDescription/TargetDescriptionFile.cpp +++ b/src/Targets/TargetDescription/TargetDescriptionFile.cpp @@ -369,19 +369,19 @@ namespace Targets::TargetDescription } MemorySegment TargetDescriptionFile::memorySegmentFromXml(const QDomElement& xmlElement) { - static const auto typesByName = BiMap({ - {"aliased", MemorySegmentType::ALIASED}, - {"regs", MemorySegmentType::REGISTERS}, - {"eeprom", MemorySegmentType::EEPROM}, - {"flash", MemorySegmentType::FLASH}, - {"fuses", MemorySegmentType::FUSES}, - {"io", MemorySegmentType::IO}, - {"ram", MemorySegmentType::RAM}, - {"lockbits", MemorySegmentType::LOCKBITS}, - {"osccal", MemorySegmentType::OSCCAL}, - {"production_signatures", MemorySegmentType::PRODUCTION_SIGNATURES}, - {"signatures", MemorySegmentType::SIGNATURES}, - {"user_signatures", MemorySegmentType::USER_SIGNATURES}, + static const auto typesByName = BiMap({ + {"aliased", TargetMemorySegmentType::ALIASED}, + {"regs", TargetMemorySegmentType::REGISTERS}, + {"eeprom", TargetMemorySegmentType::EEPROM}, + {"flash", TargetMemorySegmentType::FLASH}, + {"fuses", TargetMemorySegmentType::FUSES}, + {"io", TargetMemorySegmentType::IO}, + {"ram", TargetMemorySegmentType::RAM}, + {"lockbits", TargetMemorySegmentType::LOCKBITS}, + {"osccal", TargetMemorySegmentType::OSCCAL}, + {"production_signatures", TargetMemorySegmentType::PRODUCTION_SIGNATURES}, + {"signatures", TargetMemorySegmentType::SIGNATURES}, + {"user_signatures", TargetMemorySegmentType::USER_SIGNATURES}, }); const auto typeName = TargetDescriptionFile::getAttribute(xmlElement, "type");