New "cycleTargetPowerPostDwenUpdate" target config param to control the automatic cycling of target power, after updating the target's DWEN fuse bit
This commit is contained in:
@@ -81,6 +81,12 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (targetConfig.jsonObject.contains("cycleTargetPowerPostDwenUpdate")) {
|
||||||
|
this->cycleTargetPowerPostDwenUpdate = targetConfig.jsonObject.value(
|
||||||
|
"cycleTargetPowerPostDwenUpdate"
|
||||||
|
).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
this->avr8DebugInterface->configure(targetConfig);
|
this->avr8DebugInterface->configure(targetConfig);
|
||||||
|
|
||||||
if (this->avrIspInterface != nullptr) {
|
if (this->avrIspInterface != nullptr) {
|
||||||
@@ -154,12 +160,15 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|
|||||||
this->writeDwenFuseBit(true);
|
this->writeDwenFuseBit(true);
|
||||||
|
|
||||||
// If the debug tool provides a TargetPowerManagementInterface, attempt to cycle the target power
|
// If the debug tool provides a TargetPowerManagementInterface, attempt to cycle the target power
|
||||||
if (this->targetPowerManagementInterface != nullptr) {
|
if (this->targetPowerManagementInterface != nullptr && this->cycleTargetPowerPostDwenUpdate) {
|
||||||
Logger::info("Cycling target power");
|
Logger::info("Cycling target power");
|
||||||
|
|
||||||
Logger::debug("Disabling target power");
|
Logger::debug("Disabling target power");
|
||||||
this->targetPowerManagementInterface->disableTargetPower();
|
this->targetPowerManagementInterface->disableTargetPower();
|
||||||
|
|
||||||
Logger::debug("Holding power off for ~250 ms");
|
Logger::debug("Holding power off for ~250 ms");
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(250));
|
std::this_thread::sleep_for(std::chrono::milliseconds(250));
|
||||||
|
|
||||||
Logger::debug("Enabling target power");
|
Logger::debug("Enabling target power");
|
||||||
this->targetPowerManagementInterface->enableTargetPower();
|
this->targetPowerManagementInterface->enableTargetPower();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|
|||||||
std::map<TargetMemoryType, TargetMemoryDescriptor> targetMemoryDescriptorsByType;
|
std::map<TargetMemoryType, TargetMemoryDescriptor> targetMemoryDescriptorsByType;
|
||||||
|
|
||||||
bool updateDwenFuseBit = false;
|
bool updateDwenFuseBit = false;
|
||||||
|
bool cycleTargetPowerPostDwenUpdate = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Users are required to set their desired physical interface in their Bloom configuration. This would take
|
* Users are required to set their desired physical interface in their Bloom configuration. This would take
|
||||||
|
|||||||
Reference in New Issue
Block a user