diff --git a/src/Application.hpp b/src/Application.hpp index 9725c31e..6d4129d2 100644 --- a/src/Application.hpp +++ b/src/Application.hpp @@ -159,7 +159,7 @@ namespace Bloom void saveProjectSettings(); /** - * Extracts the project config from the user's JSON config file and populates the following members: + * Extracts the project config from the user's config file and populates the following members: * - this->projectConfig * - this->environmentConfig * - this->debugServerConfig diff --git a/src/EventManager/EventListener.cpp b/src/EventManager/EventListener.cpp index 5ed49c2a..a6aae34a 100644 --- a/src/EventManager/EventListener.cpp +++ b/src/EventManager/EventListener.cpp @@ -92,7 +92,7 @@ namespace Bloom std::sort( output.begin(), output.end(), - [](const SharedGenericEventPointer& a, const SharedGenericEventPointer& b) { + [] (const SharedGenericEventPointer& a, const SharedGenericEventPointer& b) { return a->id < b->id; } ); diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp index 4b2b0448..cd877f9f 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp @@ -77,16 +77,16 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit if (this->targetConfig->physicalInterface == PhysicalInterface::JTAG) { throw InvalidConfig( "The JTAG physical interface cannot be used with an ambiguous target name" - " - please specify the exact name of the target in your configuration file. " - "See " + Paths::homeDomainName() + "/docs/supported-targets" + " - please specify the exact name of the target in your configuration file. " + "See " + Paths::homeDomainName() + "/docs/supported-targets" ); } if (this->targetConfig->physicalInterface == PhysicalInterface::UPDI) { throw InvalidConfig( "The UPDI physical interface cannot be used with an ambiguous target name" - " - please specify the exact name of the target in your configuration file. " - "See " + Paths::homeDomainName() + "/docs/supported-targets" + " - please specify the exact name of the target in your configuration file. " + "See " + Paths::homeDomainName() + "/docs/supported-targets" ); } } @@ -97,7 +97,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit ) { Logger::warning( "The connected debug tool (or associated driver) does not provide any ISP interface. " - "Bloom will be unable to update the DWEN fuse bit in the event of a debugWire activation failure." + "Bloom will be unable to update the DWEN fuse bit in the event of a debugWire activation failure." ); } @@ -126,9 +126,9 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit if (targetSignature != tdSignature) { throw Exception( "Failed to validate connected target - target signature mismatch.\nThe target signature" - " (\"" + targetSignature.toHex() + "\") does not match the AVR8 target description signature (\"" - + tdSignature.toHex() + "\"). This will likely be due to an incorrect target name in the configuration" - + " file (bloom.yaml)." + " (\"" + targetSignature.toHex() + "\") does not match the AVR8 target description signature (\"" + + tdSignature.toHex() + "\"). This will likely be due to an incorrect target name in the " + + "configuration file (bloom.yaml)." ); } } diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.cpp index 63d0dd74..bcb62e78 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.cpp @@ -1,6 +1,7 @@ #include "Avr8TargetConfig.hpp" #include "src/Helpers/String.hpp" +#include "src/Helpers/Paths.hpp" #include "src/Exceptions/InvalidConfig.hpp" namespace Bloom::Targets::Microchip::Avr::Avr8Bit @@ -16,13 +17,15 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit const auto physicalInterfaceName = String::asciiToLower(targetNode["physicalInterface"].as()); - static const auto physicalInterfacesByName = Avr8TargetConfig::getPhysicalInterfacesByName(); - - if (!physicalInterfacesByName.contains(physicalInterfaceName)) { - throw InvalidConfig("Invalid physical interface config parameter for AVR8 target."); + if (!Avr8TargetConfig::debugPhysicalInterfacesByConfigName.contains(physicalInterfaceName)) { + throw InvalidConfig( + "Invalid physical interface provided (\"" + physicalInterfaceName + "\") for AVR8 target. " + "See " + Paths::homeDomainName() + "/docs/configuration/avr8-physical-interfaces for valid physical " + "interface configuration values." + ); } - this->physicalInterface = physicalInterfacesByName.at(physicalInterfaceName); + this->physicalInterface = Avr8TargetConfig::debugPhysicalInterfacesByConfigName.at(physicalInterfaceName); if (targetNode["updateDwenFuseBit"]) { this->updateDwenFuseBit = targetNode["updateDwenFuseBit"].as(); diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.hpp b/src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.hpp index e1f2527f..117fb24d 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.hpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.hpp @@ -13,7 +13,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit /** * Extending the generic TargetConfig struct to accommodate AVR8 target configuration parameters. */ - class Avr8TargetConfig: public TargetConfig + struct Avr8TargetConfig: public TargetConfig { public: /** @@ -70,14 +70,12 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit explicit Avr8TargetConfig(const TargetConfig& targetConfig); private: - static inline auto getPhysicalInterfacesByName() { - return std::map({ - {"debugwire", PhysicalInterface::DEBUG_WIRE}, // Deprecated - left here for backwards compatibility - {"debug-wire", PhysicalInterface::DEBUG_WIRE}, - {"pdi", PhysicalInterface::PDI}, - {"jtag", PhysicalInterface::JTAG}, - {"updi", PhysicalInterface::UPDI}, - }); - }; + static inline auto debugPhysicalInterfacesByConfigName = std::map({ + {"debugwire", PhysicalInterface::DEBUG_WIRE}, // Deprecated - left here for backwards compatibility + {"debug-wire", PhysicalInterface::DEBUG_WIRE}, + {"pdi", PhysicalInterface::PDI}, + {"jtag", PhysicalInterface::JTAG}, + {"updi", PhysicalInterface::UPDI}, + }); }; }