Updated TDF variant extraction to align with new TDF format
This commit is contained in:
@@ -256,6 +256,14 @@ namespace Targets::TargetDescription
|
||||
std::pair(pinout.key, std::move(pinout))
|
||||
);
|
||||
}
|
||||
|
||||
for (
|
||||
auto element = deviceElement.firstChildElement("variants").firstChildElement("variant");
|
||||
!element.isNull();
|
||||
element = element.nextSiblingElement("variant")
|
||||
) {
|
||||
this->variants.emplace_back(TargetDescriptionFile::variantFromXml(element));
|
||||
}
|
||||
}
|
||||
|
||||
const std::string& TargetDescriptionFile::deviceAttribute(const std::string& attributeName) const {
|
||||
@@ -653,4 +661,12 @@ namespace Targets::TargetDescription
|
||||
TargetDescriptionFile::getAttribute(xmlElement, "pad")
|
||||
);
|
||||
}
|
||||
|
||||
Variant TargetDescriptionFile::variantFromXml(const QDomElement& xmlElement) {
|
||||
return Variant(
|
||||
TargetDescriptionFile::getAttribute(xmlElement, "name"),
|
||||
TargetDescriptionFile::getAttribute(xmlElement, "pinout-key"),
|
||||
TargetDescriptionFile::getAttribute(xmlElement, "package")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user