diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp index db810b1f..0a51b12e 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp @@ -579,6 +579,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit this->name = this->targetDescriptionFile->getTargetName(); this->family = this->targetDescriptionFile->getFamily(); + this->supportedPhysicalInterfaces = this->targetDescriptionFile->getSupportedPhysicalInterfaces(); this->targetParameters = this->targetDescriptionFile->getTargetParameters(); this->padDescriptorsByName = this->targetDescriptionFile->getPadDescriptorsMappedByName(); @@ -736,8 +737,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit ); } - const auto& supportedPhysicalInterfaces = this->targetDescriptionFile->getSupportedDebugPhysicalInterfaces(); - if (!supportedPhysicalInterfaces.contains(PhysicalInterface::DEBUG_WIRE)) { + if (!this->supportedPhysicalInterfaces.contains(PhysicalInterface::DEBUG_WIRE)) { throw Exception( "Target does not support debugWire physical interface - check target configuration or " "report this issue via " + Paths::homeDomainName() + "/report-issue" diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.hpp b/src/Targets/Microchip/AVR/AVR8/Avr8.hpp index 75782abe..f876d7e6 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.hpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.hpp @@ -140,6 +140,8 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit std::optional family; std::optional targetDescriptionFile; + std::set supportedPhysicalInterfaces; + std::optional targetParameters; std::map padDescriptorsByName; std::map targetVariantsById; diff --git a/src/Targets/Microchip/AVR/AVR8/PhysicalInterface.hpp b/src/Targets/Microchip/AVR/AVR8/PhysicalInterface.hpp index 2046ad0a..ed765975 100644 --- a/src/Targets/Microchip/AVR/AVR8/PhysicalInterface.hpp +++ b/src/Targets/Microchip/AVR/AVR8/PhysicalInterface.hpp @@ -6,6 +6,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit { enum class PhysicalInterface: std::uint8_t { + ISP, JTAG, DEBUG_WIRE, PDI, diff --git a/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp b/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp index 8886966a..8b429954 100644 --- a/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp +++ b/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp @@ -96,7 +96,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription void TargetDescriptionFile::init(const QDomDocument& xml) { Targets::TargetDescription::TargetDescriptionFile::init(xml); - this->loadDebugPhysicalInterfaces(); + this->loadSupportedPhysicalInterfaces(); this->loadPadDescriptors(); this->loadTargetVariants(); this->loadTargetRegisterDescriptors(); @@ -270,7 +270,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription } } - const auto& supportedPhysicalInterfaces = this->getSupportedDebugPhysicalInterfaces(); + const auto& supportedPhysicalInterfaces = this->getSupportedPhysicalInterfaces(); if (supportedPhysicalInterfaces.contains(PhysicalInterface::DEBUG_WIRE) || supportedPhysicalInterfaces.contains(PhysicalInterface::JTAG) @@ -396,17 +396,18 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription return this->getFuseBitsDescriptorByName("spien"); } - void TargetDescriptionFile::loadDebugPhysicalInterfaces() { + void TargetDescriptionFile::loadSupportedPhysicalInterfaces() { auto interfaceNamesToInterfaces = std::map({ {"updi", PhysicalInterface::UPDI}, {"debugwire", PhysicalInterface::DEBUG_WIRE}, {"jtag", PhysicalInterface::DEBUG_WIRE}, {"pdi", PhysicalInterface::PDI}, + {"isp", PhysicalInterface::ISP}, }); for (const auto& [interfaceName, interface]: this->interfacesByName) { if (interfaceNamesToInterfaces.contains(interfaceName)) { - this->supportedDebugPhysicalInterfaces.insert(interfaceNamesToInterfaces.at(interfaceName)); + this->supportedPhysicalInterfaces.insert(interfaceNamesToInterfaces.at(interfaceName)); } } } diff --git a/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.hpp b/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.hpp index 5ece59c0..f4272c5c 100644 --- a/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.hpp +++ b/src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.hpp @@ -106,8 +106,8 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription * * @return */ - [[nodiscard]] const auto& getSupportedDebugPhysicalInterfaces() const { - return this->supportedDebugPhysicalInterfaces; + [[nodiscard]] const auto& getSupportedPhysicalInterfaces() const { + return this->supportedPhysicalInterfaces; } /** @@ -161,7 +161,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription }; }; - std::set supportedDebugPhysicalInterfaces; + std::set supportedPhysicalInterfaces; std::map padDescriptorsByName; std::map targetVariantsById; @@ -169,9 +169,9 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription std::map targetRegisterDescriptorsByType; /** - * Populates this->supportedDebugPhysicalInterfaces with physical interfaces defined in the TDF. + * Populates this->supportedPhysicalInterfaces with physical interfaces defined in the TDF. */ - void loadDebugPhysicalInterfaces(); + void loadSupportedPhysicalInterfaces(); /** * Generates a collection of PadDescriptor objects from data in the TDF and populates this->padDescriptorsByName.