New targetPowerCycleDelay target config param, for configuring the AVR8 target power cycle delay (after updating the DWEN fuse bit)
This commit is contained in:
@@ -143,8 +143,12 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|
|||||||
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(
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(250));
|
"Holding power off for ~"
|
||||||
|
+ std::to_string(this->targetConfig->targetPowerCycleDelay.count())
|
||||||
|
+ " ms"
|
||||||
|
);
|
||||||
|
std::this_thread::sleep_for(this->targetConfig->targetPowerCycleDelay);
|
||||||
|
|
||||||
Logger::debug("Enabling target power");
|
Logger::debug("Enabling target power");
|
||||||
this->targetPowerManagementInterface->enableTargetPower();
|
this->targetPowerManagementInterface->enableTargetPower();
|
||||||
|
|||||||
@@ -38,5 +38,11 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|
|||||||
"disableDebugWirePreDisconnect"
|
"disableDebugWirePreDisconnect"
|
||||||
).toBool();
|
).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (targetConfig.jsonObject.contains("targetPowerCycleDelay")) {
|
||||||
|
this->targetPowerCycleDelay = std::chrono::milliseconds(targetConfig.jsonObject.value(
|
||||||
|
"targetPowerCycleDelay"
|
||||||
|
).toInt(static_cast<int>(this->targetPowerCycleDelay.count())));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <string>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
#include "src/ProjectConfig.hpp"
|
#include "src/ProjectConfig.hpp"
|
||||||
|
|
||||||
#include "PhysicalInterface.hpp"
|
#include "PhysicalInterface.hpp"
|
||||||
@@ -55,6 +59,8 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|
|||||||
*/
|
*/
|
||||||
bool cycleTargetPowerPostDwenUpdate = true;
|
bool cycleTargetPowerPostDwenUpdate = true;
|
||||||
|
|
||||||
|
std::chrono::milliseconds targetPowerCycleDelay = std::chrono::milliseconds(250);
|
||||||
|
|
||||||
explicit Avr8TargetConfig(const TargetConfig& targetConfig);
|
explicit Avr8TargetConfig(const TargetConfig& targetConfig);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user