Moved loading of AVR8 TDFs into single function
This commit is contained in:
@@ -69,7 +69,6 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|
|||||||
|
|
||||||
void Avr8::postActivationConfigure() {
|
void Avr8::postActivationConfigure() {
|
||||||
if (!this->targetDescriptionFile.has_value()) {
|
if (!this->targetDescriptionFile.has_value()) {
|
||||||
this->loadTargetDescriptionFile();
|
|
||||||
this->initFromTargetDescriptionFile();
|
this->initFromTargetDescriptionFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -572,15 +571,12 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|
|||||||
return this->programmingSession.has_value();
|
return this->programmingSession.has_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Avr8::loadTargetDescriptionFile() {
|
void Avr8::initFromTargetDescriptionFile() {
|
||||||
this->targetDescriptionFile = TargetDescription::TargetDescriptionFile(
|
this->targetDescriptionFile = TargetDescription::TargetDescriptionFile(
|
||||||
this->getId(),
|
this->getId(),
|
||||||
(!this->name.empty()) ? std::optional(this->name) : std::nullopt
|
(!this->name.empty()) ? std::optional(this->name) : std::nullopt
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
void Avr8::initFromTargetDescriptionFile() {
|
|
||||||
assert(this->targetDescriptionFile.has_value());
|
|
||||||
this->name = this->targetDescriptionFile->getTargetName();
|
this->name = this->targetDescriptionFile->getTargetName();
|
||||||
this->family = this->targetDescriptionFile->getFamily();
|
this->family = this->targetDescriptionFile->getFamily();
|
||||||
|
|
||||||
@@ -590,13 +586,13 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|
|||||||
|
|
||||||
if (!this->targetParameters->stackPointerRegisterLowAddress.has_value()) {
|
if (!this->targetParameters->stackPointerRegisterLowAddress.has_value()) {
|
||||||
throw Exception(
|
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()) {
|
if (!this->targetParameters->statusRegisterStartAddress.has_value()) {
|
||||||
throw Exception(
|
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"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|
|||||||
explicit Avr8() = default;
|
explicit Avr8() = default;
|
||||||
Avr8(std::string name, const TargetSignature& signature): name(std::move(name)) {
|
Avr8(std::string name, const TargetSignature& signature): name(std::move(name)) {
|
||||||
this->id = signature;
|
this->id = signature;
|
||||||
this->loadTargetDescriptionFile();
|
|
||||||
this->initFromTargetDescriptionFile();
|
this->initFromTargetDescriptionFile();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -149,11 +148,6 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|
|||||||
|
|
||||||
std::optional<ProgrammingSession> programmingSession;
|
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.
|
* Initiates the AVR8 instance from data extracted from the TDF.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user