Retrieving AVR8 target registers and including them in the TargetDescriptor
This commit is contained in:
@@ -10,6 +10,7 @@ namespace Bloom::Targets::TargetDescription
|
||||
struct Register
|
||||
{
|
||||
std::string name;
|
||||
std::optional<std::string> caption;
|
||||
std::uint16_t offset;
|
||||
std::uint16_t size;
|
||||
};
|
||||
@@ -17,6 +18,7 @@ namespace Bloom::Targets::TargetDescription
|
||||
struct RegisterGroup
|
||||
{
|
||||
std::string name;
|
||||
std::optional<std::string> moduleName;
|
||||
std::optional<std::uint16_t> offset;
|
||||
std::map<std::string, Register> registersMappedByName;
|
||||
};
|
||||
|
||||
@@ -169,6 +169,10 @@ RegisterGroup TargetDescriptionFile::generateRegisterGroupFromXml(const QDomElem
|
||||
throw Exception("Empty register group name");
|
||||
}
|
||||
|
||||
registerGroup.moduleName = xmlElement.hasAttribute("name-in-module")
|
||||
? xmlElement.attribute("name-in-module").toLower().toStdString()
|
||||
: registerGroup.name;
|
||||
|
||||
if (xmlElement.hasAttribute("offset")) {
|
||||
registerGroup.offset = xmlElement.attribute("offset").toInt(nullptr, 16);
|
||||
}
|
||||
@@ -207,6 +211,10 @@ Register TargetDescriptionFile::generateRegisterFromXml(const QDomElement& xmlEl
|
||||
throw Exception("Empty register name");
|
||||
}
|
||||
|
||||
if (xmlElement.hasAttribute("caption")) {
|
||||
reg.caption = xmlElement.attribute("caption").toStdString();
|
||||
}
|
||||
|
||||
bool conversionStatus;
|
||||
reg.size = xmlElement.attribute("size").toUShort(nullptr, 10);
|
||||
reg.offset = xmlElement.attribute("offset").toUShort(&conversionStatus, 16);
|
||||
|
||||
Reference in New Issue
Block a user