Fixed issue with AVR8 'store program memory control register' (SPMCR) loading from TDFs
This commit is contained in:
@@ -595,11 +595,14 @@ std::optional<Register> TargetDescriptionFile::getOscillatorCalibrationRegister(
|
|||||||
std::optional<Register> TargetDescriptionFile::getSpmcsRegister() const {
|
std::optional<Register> TargetDescriptionFile::getSpmcsRegister() const {
|
||||||
auto cpuRegisterGroup = this->getCpuRegisterGroup();
|
auto cpuRegisterGroup = this->getCpuRegisterGroup();
|
||||||
|
|
||||||
if (cpuRegisterGroup.has_value()) {
|
if (cpuRegisterGroup.has_value() && cpuRegisterGroup->registersMappedByName.contains("spmcsr")) {
|
||||||
auto spmcsRegisterIt = cpuRegisterGroup->registersMappedByName.find("spmcsr");
|
return cpuRegisterGroup->registersMappedByName.at("spmcsr");
|
||||||
|
|
||||||
if (spmcsRegisterIt != cpuRegisterGroup->registersMappedByName.end()) {
|
} else {
|
||||||
return spmcsRegisterIt->second;
|
auto bootLoadRegisterGroup = this->getBootLoadRegisterGroup();
|
||||||
|
|
||||||
|
if (bootLoadRegisterGroup.has_value() && bootLoadRegisterGroup->registersMappedByName.contains("spmcsr")) {
|
||||||
|
return bootLoadRegisterGroup->registersMappedByName.at("spmcsr");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -609,11 +612,14 @@ std::optional<Register> TargetDescriptionFile::getSpmcsRegister() const {
|
|||||||
std::optional<Register> TargetDescriptionFile::getSpmcRegister() const {
|
std::optional<Register> TargetDescriptionFile::getSpmcRegister() const {
|
||||||
auto bootLoadRegisterGroup = this->getBootLoadRegisterGroup();
|
auto bootLoadRegisterGroup = this->getBootLoadRegisterGroup();
|
||||||
|
|
||||||
if (bootLoadRegisterGroup.has_value()) {
|
if (bootLoadRegisterGroup.has_value() && bootLoadRegisterGroup->registersMappedByName.contains("spmcr")) {
|
||||||
auto spmcRegisterIt = bootLoadRegisterGroup->registersMappedByName.find("spmcr");
|
return bootLoadRegisterGroup->registersMappedByName.at("spmcr");
|
||||||
|
|
||||||
if (spmcRegisterIt != bootLoadRegisterGroup->registersMappedByName.end()) {
|
} else {
|
||||||
return spmcRegisterIt->second;
|
auto cpuRegisterGroup = this->getCpuRegisterGroup();
|
||||||
|
|
||||||
|
if (cpuRegisterGroup.has_value() && cpuRegisterGroup->registersMappedByName.contains("spmcr")) {
|
||||||
|
return cpuRegisterGroup->registersMappedByName.at("spmcr");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user