Added target family attribute to AVR8 TDFs and renamed AVR family attribute to avr-family
This commit is contained in:
@@ -27,8 +27,19 @@ namespace Targets::TargetDescription
|
||||
return this->targetName;
|
||||
}
|
||||
|
||||
const std::string& TargetDescriptionFile::getFamilyName() const {
|
||||
return this->familyName;
|
||||
TargetFamily TargetDescriptionFile::getFamily() const {
|
||||
static const auto familiesByName = std::map<std::string, TargetFamily> {
|
||||
{"AVR8", TargetFamily::AVR_8},
|
||||
{"RISCV", TargetFamily::RISC_V},
|
||||
};
|
||||
|
||||
const auto familyIt = familiesByName.find(this->familyName);
|
||||
|
||||
if (familyIt == familiesByName.end()) {
|
||||
throw Exception("Failed to resolve target family - invalid family name");
|
||||
}
|
||||
|
||||
return familyIt->second;
|
||||
}
|
||||
|
||||
void TargetDescriptionFile::init(const QString& xmlFilePath) {
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "Pinout.hpp"
|
||||
#include "Interface.hpp"
|
||||
|
||||
#include "src/Targets/TargetFamily.hpp"
|
||||
|
||||
#include GENERATED_TDF_MAPPING_PATH
|
||||
|
||||
namespace Targets::TargetDescription
|
||||
@@ -74,11 +76,11 @@ namespace Targets::TargetDescription
|
||||
[[nodiscard]] const std::string& getTargetName() const;
|
||||
|
||||
/**
|
||||
* Returns the target family name extracted from the TDF.
|
||||
* Returns the target family extracted from the TDF.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
[[nodiscard]] const std::string& getFamilyName() const;
|
||||
[[nodiscard]] TargetFamily getFamily() const;
|
||||
|
||||
protected:
|
||||
std::string targetName;
|
||||
|
||||
Reference in New Issue
Block a user