From 7fc1145d4b4404078eb860f467c932cf5be7d0b0 Mon Sep 17 00:00:00 2001 From: Nav Date: Sun, 6 Oct 2024 17:09:06 +0100 Subject: [PATCH] Moved `reserveSteppingBreakpoint` AVR8 config param to more generic `TargetConfig` struct --- src/ProjectConfig.cpp | 6 ++++++ src/ProjectConfig.hpp | 5 +++++ src/Targets/Microchip/AVR8/Avr8TargetConfig.cpp | 6 ------ src/Targets/Microchip/AVR8/Avr8TargetConfig.hpp | 5 ----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ProjectConfig.cpp b/src/ProjectConfig.cpp index fa59bf87..a1c5cc83 100644 --- a/src/ProjectConfig.cpp +++ b/src/ProjectConfig.cpp @@ -203,6 +203,12 @@ TargetConfig::TargetConfig(const YAML::Node& targetNode) { this->programMemoryCache = targetNode["programMemoryCache"].as(this->programMemoryCache); } + if (targetNode["reserveSteppingBreakpoint"]) { + this->reserveSteppingBreakpoint = targetNode["reserveSteppingBreakpoint"].as( + this->reserveSteppingBreakpoint + ); + } + this->targetNode = targetNode; } diff --git a/src/ProjectConfig.hpp b/src/ProjectConfig.hpp index 217eeeab..007f59ba 100644 --- a/src/ProjectConfig.hpp +++ b/src/ProjectConfig.hpp @@ -69,6 +69,11 @@ struct TargetConfig */ bool programMemoryCache = true; + /** + * Determines if Bloom will reserve a single hardware breakpoint for stepping operations. + */ + bool reserveSteppingBreakpoint = true; + /** * For extracting any target specific configuration. See Avr8TargetConfig::Avr8TargetConfig() and * Avr8::preActivationConfigure() for an example of this. diff --git a/src/Targets/Microchip/AVR8/Avr8TargetConfig.cpp b/src/Targets/Microchip/AVR8/Avr8TargetConfig.cpp index a25ad95e..1709c3d1 100644 --- a/src/Targets/Microchip/AVR8/Avr8TargetConfig.cpp +++ b/src/Targets/Microchip/AVR8/Avr8TargetConfig.cpp @@ -49,11 +49,5 @@ namespace Targets::Microchip::Avr8 this->preserveEeprom ); } - - if (targetNode["reserveSteppingBreakpoint"]) { - this->reserveSteppingBreakpoint = targetNode["reserveSteppingBreakpoint"].as( - this->reserveSteppingBreakpoint - ); - } } } diff --git a/src/Targets/Microchip/AVR8/Avr8TargetConfig.hpp b/src/Targets/Microchip/AVR8/Avr8TargetConfig.hpp index 7ad6dc8f..d3f99b3d 100644 --- a/src/Targets/Microchip/AVR8/Avr8TargetConfig.hpp +++ b/src/Targets/Microchip/AVR8/Avr8TargetConfig.hpp @@ -79,11 +79,6 @@ namespace Targets::Microchip::Avr8 */ bool preserveEeprom = true; - /** - * Determines if Bloom will reserve a single hardware breakpoint for stepping operations. - */ - bool reserveSteppingBreakpoint = true; - explicit Avr8TargetConfig(const TargetConfig& targetConfig); }; }