2022-03-19 13:26:04 +00:00
|
|
|
#include "Avr8TargetConfig.hpp"
|
|
|
|
|
|
2022-12-26 21:47:09 +00:00
|
|
|
#include "src/Services/PathService.hpp"
|
2022-12-26 21:57:28 +00:00
|
|
|
#include "src/Services/StringService.hpp"
|
|
|
|
|
|
2022-03-19 13:26:04 +00:00
|
|
|
#include "src/Exceptions/InvalidConfig.hpp"
|
|
|
|
|
|
2023-08-13 15:47:51 +01:00
|
|
|
namespace Targets::Microchip::Avr::Avr8Bit
|
2022-03-19 13:26:04 +00:00
|
|
|
{
|
2022-11-16 23:51:07 +00:00
|
|
|
Avr8TargetConfig::Avr8TargetConfig(const TargetConfig& targetConfig)
|
|
|
|
|
: TargetConfig(targetConfig)
|
|
|
|
|
{
|
2023-08-13 15:47:51 +01:00
|
|
|
using Exceptions::InvalidConfig;
|
2022-03-19 13:26:04 +00:00
|
|
|
|
2022-07-23 15:37:22 +01:00
|
|
|
const auto& targetNode = targetConfig.targetNode;
|
|
|
|
|
|
2022-09-18 13:02:33 +01:00
|
|
|
// The 'manageDwenFuseBit' param used to be 'updateDwenFuseBit' - we still support the old, for now.
|
2022-07-23 15:37:22 +01:00
|
|
|
if (targetNode["updateDwenFuseBit"]) {
|
2023-09-23 21:50:04 +01:00
|
|
|
this->manageDwenFuseBit = targetNode["updateDwenFuseBit"].as<bool>(
|
|
|
|
|
this->manageDwenFuseBit
|
|
|
|
|
);
|
2022-09-18 13:02:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (targetNode["manageDwenFuseBit"]) {
|
2023-09-23 21:50:04 +01:00
|
|
|
this->manageDwenFuseBit = targetNode["manageDwenFuseBit"].as<bool>(
|
|
|
|
|
this->manageDwenFuseBit
|
|
|
|
|
);
|
2022-03-19 13:26:04 +00:00
|
|
|
}
|
|
|
|
|
|
2022-07-23 15:37:22 +01:00
|
|
|
if (targetNode["cycleTargetPowerPostDwenUpdate"]) {
|
2023-09-23 21:50:04 +01:00
|
|
|
this->cycleTargetPowerPostDwenUpdate = targetNode["cycleTargetPowerPostDwenUpdate"].as<bool>(
|
|
|
|
|
this->cycleTargetPowerPostDwenUpdate
|
|
|
|
|
);
|
2022-03-19 13:26:04 +00:00
|
|
|
}
|
|
|
|
|
|
2022-07-23 15:37:22 +01:00
|
|
|
if (targetNode["disableDebugWirePreDisconnect"]) {
|
2023-09-23 21:50:04 +01:00
|
|
|
this->disableDebugWireOnDeactivate = targetNode["disableDebugWirePreDisconnect"].as<bool>(
|
|
|
|
|
this->disableDebugWireOnDeactivate
|
|
|
|
|
);
|
2022-03-19 13:26:04 +00:00
|
|
|
}
|
2022-03-21 13:04:12 +00:00
|
|
|
|
2022-07-23 15:37:22 +01:00
|
|
|
if (targetNode["targetPowerCycleDelay"]) {
|
2023-09-23 21:50:04 +01:00
|
|
|
this->targetPowerCycleDelay = std::chrono::milliseconds(targetNode["targetPowerCycleDelay"].as<int>(
|
|
|
|
|
this->targetPowerCycleDelay.count()
|
|
|
|
|
));
|
2022-03-21 13:04:12 +00:00
|
|
|
}
|
2023-05-07 16:49:45 +01:00
|
|
|
|
|
|
|
|
if (targetNode["manageOcdenFuseBit"]) {
|
2023-09-23 21:50:04 +01:00
|
|
|
this->manageOcdenFuseBit = targetNode["manageOcdenFuseBit"].as<bool>(
|
|
|
|
|
this->manageOcdenFuseBit
|
|
|
|
|
);
|
2023-05-07 16:49:45 +01:00
|
|
|
}
|
2023-05-07 16:50:59 +01:00
|
|
|
|
|
|
|
|
if (targetNode["preserveEeprom"]) {
|
2023-09-23 21:50:04 +01:00
|
|
|
this->preserveEeprom = targetNode["preserveEeprom"].as<bool>(
|
|
|
|
|
this->preserveEeprom
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (targetNode["reserveSteppingBreakpoint"]) {
|
|
|
|
|
this->reserveSteppingBreakpoint = targetNode["reserveSteppingBreakpoint"].as<bool>(
|
|
|
|
|
this->reserveSteppingBreakpoint
|
|
|
|
|
);
|
2023-05-07 16:50:59 +01:00
|
|
|
}
|
2022-03-19 13:26:04 +00:00
|
|
|
}
|
|
|
|
|
}
|