diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp index 7aede7b7..f3bd04ac 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp @@ -575,16 +575,16 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit void Avr8::enableProgrammingMode() { this->avr8DebugInterface->enableProgrammingMode(); - this->programmingModeActive = true; + this->programmingSession = ProgrammingSession(); } void Avr8::disableProgrammingMode() { this->avr8DebugInterface->disableProgrammingMode(); - this->programmingModeActive = false; + this->programmingSession = std::nullopt; } bool Avr8::programmingModeEnabled() { - return this->programmingModeActive; + return this->programmingSession.has_value(); } void Avr8::loadTargetDescriptionFile() { diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.hpp b/src/Targets/Microchip/AVR/AVR8/Avr8.hpp index ffc9c249..70632a50 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.hpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.hpp @@ -13,6 +13,7 @@ #include "Family.hpp" #include "TargetParameters.hpp" #include "PadDescriptor.hpp" +#include "ProgrammingSession.hpp" #include "src/Targets/TargetRegister.hpp" #include "TargetDescription/TargetDescriptionFile.hpp" @@ -145,7 +146,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit std::map targetRegisterDescriptorsByType; std::map targetMemoryDescriptorsByType; - bool programmingModeActive = false; + std::optional programmingSession; /** * Resolves the appropriate TDF for the AVR8 target and populates this->targetDescriptionFile. diff --git a/src/Targets/Microchip/AVR/AVR8/ProgrammingSession.hpp b/src/Targets/Microchip/AVR/AVR8/ProgrammingSession.hpp new file mode 100644 index 00000000..ad81c5ad --- /dev/null +++ b/src/Targets/Microchip/AVR/AVR8/ProgrammingSession.hpp @@ -0,0 +1,10 @@ +#pragma once + +namespace Bloom::Targets::Microchip::Avr::Avr8Bit +{ + struct ProgrammingSession + { + bool applicationSectionErased = false; + bool bootSectionErased = false; + }; +}