Made physical interface enum more generic (moved out of AVR8-specific context)

This commit is contained in:
Nav
2024-02-15 21:24:41 +00:00
parent f33b4d8c70
commit 7e9e28286f
20 changed files with 156 additions and 160 deletions

View File

@@ -14,25 +14,6 @@ namespace Targets::Microchip::Avr::Avr8Bit
const auto& targetNode = targetConfig.targetNode;
if (!targetNode["physicalInterface"]) {
throw InvalidConfig("Missing physical interface config parameter for AVR8 target.");
}
const auto physicalInterfaceName = Services::StringService::asciiToLower(targetNode["physicalInterface"].as<std::string>());
const auto physicalInterfaceIt = Avr8TargetConfig::debugPhysicalInterfacesByConfigName.find(
physicalInterfaceName
);
if (physicalInterfaceIt == Avr8TargetConfig::debugPhysicalInterfacesByConfigName.end()) {
throw InvalidConfig(
"Invalid physical interface provided (\"" + physicalInterfaceName + "\") for AVR8 target. "
"See " + Services::PathService::homeDomainName() + "/docs/configuration/avr8-physical-interfaces for valid physical "
"interface configuration values."
);
}
this->physicalInterface = physicalInterfaceIt->second;
// The 'manageDwenFuseBit' param used to be 'updateDwenFuseBit' - we still support the old, for now.
if (targetNode["updateDwenFuseBit"]) {
this->manageDwenFuseBit = targetNode["updateDwenFuseBit"].as<bool>(