Moved loading of AVR8 TDFs into single function

This commit is contained in:
Nav
2022-08-04 21:03:43 +01:00
parent 0bc886be38
commit 40218e5c21
2 changed files with 3 additions and 13 deletions

View File

@@ -69,7 +69,6 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
void Avr8::postActivationConfigure() {
if (!this->targetDescriptionFile.has_value()) {
this->loadTargetDescriptionFile();
this->initFromTargetDescriptionFile();
}
@@ -572,15 +571,12 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
return this->programmingSession.has_value();
}
void Avr8::loadTargetDescriptionFile() {
void Avr8::initFromTargetDescriptionFile() {
this->targetDescriptionFile = TargetDescription::TargetDescriptionFile(
this->getId(),
(!this->name.empty()) ? std::optional(this->name) : std::nullopt
);
}
void Avr8::initFromTargetDescriptionFile() {
assert(this->targetDescriptionFile.has_value());
this->name = this->targetDescriptionFile->getTargetName();
this->family = this->targetDescriptionFile->getFamily();
@@ -590,13 +586,13 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
if (!this->targetParameters->stackPointerRegisterLowAddress.has_value()) {
throw Exception(
"Failed to load sufficient AVR8 target paramters - missting stack pointer start address"
"Failed to load sufficient AVR8 target parameters - missing stack pointer start address"
);
}
if (!this->targetParameters->statusRegisterStartAddress.has_value()) {
throw Exception(
"Failed to load sufficient AVR8 target parameters - missting status register start address"
"Failed to load sufficient AVR8 target parameters - missing status register start address"
);
}

View File

@@ -29,7 +29,6 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
explicit Avr8() = default;
Avr8(std::string name, const TargetSignature& signature): name(std::move(name)) {
this->id = signature;
this->loadTargetDescriptionFile();
this->initFromTargetDescriptionFile();
};
@@ -149,11 +148,6 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
std::optional<ProgrammingSession> programmingSession;
/**
* Resolves the appropriate TDF for the AVR8 target and populates this->targetDescriptionFile.
*/
void loadTargetDescriptionFile();
/**
* Initiates the AVR8 instance from data extracted from the TDF.
*/