This commit is contained in:
Nav
2022-06-05 21:04:47 +01:00
parent 60fb9580d7
commit f065a70551
2 changed files with 8 additions and 4 deletions

View File

@@ -725,13 +725,17 @@ namespace Bloom::TargetController
} }
void TargetControllerComponent::enableProgrammingMode() { void TargetControllerComponent::enableProgrammingMode() {
Logger::debug("Enabling programming mode");
this->target->enableProgrammingMode(); this->target->enableProgrammingMode();
Logger::warning("Programming mode enabled");
EventManager::triggerEvent(std::make_shared<Events::ProgrammingModeEnabled>()); EventManager::triggerEvent(std::make_shared<Events::ProgrammingModeEnabled>());
} }
void TargetControllerComponent::disableProgrammingMode() { void TargetControllerComponent::disableProgrammingMode() {
Logger::debug("Disabling programming mode");
this->target->disableProgrammingMode(); this->target->disableProgrammingMode();
Logger::info("Programming mode disabled");
EventManager::triggerEvent(std::make_shared<Events::ProgrammingModeDisabled>()); EventManager::triggerEvent(std::make_shared<Events::ProgrammingModeDisabled>());
} }

View File

@@ -335,7 +335,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
if (startSection != endSection) { if (startSection != endSection) {
throw Exception( throw Exception(
"Requested program memory write spans more than one section (APPLICATION and BOOT) - aborting." "Requested program memory write spans more than one section (APPLICATION and BOOT) - aborting"
); );
} }
@@ -346,7 +346,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|| endSection == ProgramMemorySection::APPLICATION || endSection == ProgramMemorySection::APPLICATION
) )
) { ) {
Logger::warning("Erasing program memory APPLICATION section, in preparation for programming."); Logger::warning("Erasing program memory APPLICATION section, in preparation for programming");
this->avr8DebugInterface->eraseProgramMemory(ProgramMemorySection::APPLICATION); this->avr8DebugInterface->eraseProgramMemory(ProgramMemorySection::APPLICATION);
this->programmingSession->applicationSectionErased = true; this->programmingSession->applicationSectionErased = true;
} }
@@ -358,13 +358,13 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|| endSection == ProgramMemorySection::BOOT || endSection == ProgramMemorySection::BOOT
) )
) { ) {
Logger::warning("Erasing program memory BOOT section, in preparation for programming."); Logger::warning("Erasing program memory BOOT section, in preparation for programming");
this->avr8DebugInterface->eraseProgramMemory(ProgramMemorySection::BOOT); this->avr8DebugInterface->eraseProgramMemory(ProgramMemorySection::BOOT);
this->programmingSession->bootSectionErased = true; this->programmingSession->bootSectionErased = true;
} }
} else if (!this->programmingSession->chipErased) { } else if (!this->programmingSession->chipErased) {
Logger::warning("Erasing entire chip, in preparation for programming."); Logger::warning("Erasing entire chip, in preparation for programming");
this->avr8DebugInterface->eraseProgramMemory(); this->avr8DebugInterface->eraseProgramMemory();
this->programmingSession->chipErased = true; this->programmingSession->chipErased = true;
} }