Added target power cycling post AVR8 DWEN fuse bit update

This commit is contained in:
Nav
2022-03-16 17:13:40 +00:00
parent 3d95a983b6
commit 696e746279
2 changed files with 13 additions and 0 deletions

View File

@@ -153,6 +153,17 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
);
this->writeDwenFuseBit(true);
// If the debug tool provides a TargetPowerManagementInterface, attempt to cycle the target power
if (this->targetPowerManagementInterface != nullptr) {
Logger::info("Cycling target power");
Logger::debug("Disabling target power");
this->targetPowerManagementInterface->disableTargetPower();
Logger::debug("Holding power off for ~250 ms");
std::this_thread::sleep_for(std::chrono::milliseconds(250));
Logger::debug("Enabling target power");
this->targetPowerManagementInterface->enableTargetPower();
}
} catch (const Exception& exception) {
throw Exception(
"Failed to access/update DWEN fuse bit via ISP interface - " + exception.getMessage()