Tidying EDBG driver code:

- Binned a lot of pointless code
- Simplified many EDBG data structure implementations
- Const-correctness
- Many other bits of tidying
This commit is contained in:
Nav
2022-10-01 20:42:37 +01:00
parent a5b0097036
commit 2c6fd25ae4
91 changed files with 591 additions and 689 deletions

View File

@@ -17,21 +17,21 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg
{}
void EdbgTargetPowerManagementInterface::enableTargetPower() {
auto response = this->edbgInterface->sendAvrCommandFrameAndWaitForResponseFrame(
const auto responseFrame = this->edbgInterface->sendAvrCommandFrameAndWaitForResponseFrame(
SetParameter(EdbgParameters::CONTROL_TARGET_POWER, 0x01)
);
if (response.getResponseId() == EdbgControlResponseId::FAILED) {
if (responseFrame.id == EdbgControlResponseId::FAILED) {
throw Exception("Failed to enable target power via EDBG Control protocol");
}
}
void EdbgTargetPowerManagementInterface::disableTargetPower() {
auto response = this->edbgInterface->sendAvrCommandFrameAndWaitForResponseFrame(
const auto responseFrame = this->edbgInterface->sendAvrCommandFrameAndWaitForResponseFrame(
SetParameter(EdbgParameters::CONTROL_TARGET_POWER, 0x00)
);
if (response.getResponseId() == EdbgControlResponseId::FAILED) {
if (responseFrame.id == EdbgControlResponseId::FAILED) {
throw Exception("Failed to disable target power via EDBG Control protocol");
}
}