Construct an AVR8 TDF via a TargetSignature object, as opposed to the signature hex value.
This commit is contained in:
@@ -69,7 +69,7 @@ void Avr8::postPromotionConfigure() {
|
|||||||
void Avr8::loadPartDescription() {
|
void Avr8::loadPartDescription() {
|
||||||
auto targetSignature = this->getId();
|
auto targetSignature = this->getId();
|
||||||
auto partDescription = TargetDescription::TargetDescriptionFile(
|
auto partDescription = TargetDescription::TargetDescriptionFile(
|
||||||
targetSignature.toHex(),
|
targetSignature,
|
||||||
(!this->name.empty()) ? std::optional(this->name) : std::nullopt
|
(!this->name.empty()) ? std::optional(this->name) : std::nullopt
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,11 @@ using namespace Bloom::Targets::Microchip::Avr;
|
|||||||
using namespace Bloom::Exceptions;
|
using namespace Bloom::Exceptions;
|
||||||
|
|
||||||
TargetDescriptionFile::TargetDescriptionFile(
|
TargetDescriptionFile::TargetDescriptionFile(
|
||||||
const std::string& targetSignatureHex,
|
const TargetSignature& targetSignature,
|
||||||
std::optional<std::string> targetName
|
std::optional<std::string> targetName
|
||||||
) {
|
) {
|
||||||
auto mapping = this->getTargetDescriptionMapping();
|
auto targetSignatureHex = targetSignature.toHex();
|
||||||
|
auto mapping = TargetDescriptionFile::getTargetDescriptionMapping();
|
||||||
auto qTargetSignatureHex = QString::fromStdString(targetSignatureHex);
|
auto qTargetSignatureHex = QString::fromStdString(targetSignatureHex);
|
||||||
|
|
||||||
if (mapping.contains(qTargetSignatureHex)) {
|
if (mapping.contains(qTargetSignatureHex)) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
|
|||||||
* @param targetSignatureHex
|
* @param targetSignatureHex
|
||||||
* @param targetName
|
* @param targetName
|
||||||
*/
|
*/
|
||||||
TargetDescriptionFile(const std::string& targetSignatureHex, std::optional<std::string> targetName);
|
TargetDescriptionFile(const TargetSignature& targetSignature, std::optional<std::string> targetName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the AVR8 target description JSON mapping file.
|
* Loads the AVR8 target description JSON mapping file.
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace Bloom::Targets::Microchip::Avr
|
|||||||
this->byteTwo = static_cast<unsigned char>(signature);
|
this->byteTwo = static_cast<unsigned char>(signature);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string toHex() {
|
std::string toHex() const {
|
||||||
std::stringstream stream;
|
std::stringstream stream;
|
||||||
stream << std::hex << std::setfill('0');
|
stream << std::hex << std::setfill('0');
|
||||||
stream << std::setw(2) << static_cast<unsigned int>(this->byteZero);
|
stream << std::setw(2) << static_cast<unsigned int>(this->byteZero);
|
||||||
|
|||||||
Reference in New Issue
Block a user