This commit is contained in:
Nav
2022-09-17 20:16:23 +01:00
parent 8e9d114343
commit 0b54a1b590
2 changed files with 11 additions and 0 deletions

View File

@@ -25,6 +25,9 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
try { try {
if (debugSession.programmingSession.has_value()) { if (debugSession.programmingSession.has_value()) {
const auto& programmingSession = debugSession.programmingSession.value(); const auto& programmingSession = debugSession.programmingSession.value();
Logger::info(
"Flushing " + std::to_string(programmingSession.buffer.size()) + " bytes to target's program memory"
);
targetControllerConsole.enableProgrammingMode(); targetControllerConsole.enableProgrammingMode();

View File

@@ -772,6 +772,10 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
} }
void EdbgAvr8Interface::enableProgrammingMode() { void EdbgAvr8Interface::enableProgrammingMode() {
if (this->programmingModeEnabled) {
return;
}
auto response = this->edbgInterface.sendAvrCommandFrameAndWaitForResponseFrame( auto response = this->edbgInterface.sendAvrCommandFrameAndWaitForResponseFrame(
EnterProgrammingMode() EnterProgrammingMode()
); );
@@ -784,6 +788,10 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
} }
void EdbgAvr8Interface::disableProgrammingMode() { void EdbgAvr8Interface::disableProgrammingMode() {
if (!this->programmingModeEnabled) {
return;
}
auto response = this->edbgInterface.sendAvrCommandFrameAndWaitForResponseFrame( auto response = this->edbgInterface.sendAvrCommandFrameAndWaitForResponseFrame(
LeaveProgrammingMode() LeaveProgrammingMode()
); );