Made AVR8 Physical Interfaces more generic (to include non-debug interfaces such as ISP)

This commit is contained in:
Nav
2022-08-04 21:06:13 +01:00
parent 40218e5c21
commit 96f0c14b53
5 changed files with 15 additions and 11 deletions

View File

@@ -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<std::string, PhysicalInterface>({
{"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));
}
}
}