From aefe3dd7e81b3c38a36877bf5164f23f623387ab Mon Sep 17 00:00:00 2001 From: Nav Date: Tue, 17 May 2022 19:45:56 +0100 Subject: [PATCH] Added programmingModeEnabled flag to EdbgAvr8Interface --- .../CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp | 5 +++++ .../CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp index 462bceb1..09847ecd 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp @@ -686,6 +686,8 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr if (response.getResponseId() == Avr8ResponseId::FAILED) { throw Avr8CommandFailure("Failed to enter programming mode on EDBG debug tool", response); } + + this->programmingModeEnabled = true; } void EdbgAvr8Interface::disableProgrammingMode() { @@ -697,6 +699,9 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr throw Avr8CommandFailure("Failed to leave programming mode on EDBG debug tool", response); } + this->programmingModeEnabled = false; + } + std::map> EdbgAvr8Interface::getConfigVariantsByFamilyAndPhysicalInterface() { return std::map>({ diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp index e7424b1e..9545e83b 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp @@ -336,6 +336,8 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr */ bool targetAttached = false; + bool programmingModeEnabled = false; + /** * This mapping allows us to determine which config variant to select, based on the target family and the * selected physical interface.