Tidying low-level debug tool driver code:
- Use automatic objects for libusb/hidapi resources, where possible (to reduce manual resource management) - Removed unused/redundant code - Tidied HidInterface class - Tidied debug tool initialisation code - Other bits of tidying
This commit is contained in:
@@ -12,8 +12,12 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg
|
||||
using Protocols::CmsisDap::Edbg::Avr::CommandFrames::EdbgControl::GetParameter;
|
||||
using Protocols::CmsisDap::Edbg::Avr::CommandFrames::EdbgControl::SetParameter;
|
||||
|
||||
EdbgTargetPowerManagementInterface::EdbgTargetPowerManagementInterface(EdbgInterface* edbgInterface)
|
||||
: edbgInterface(edbgInterface)
|
||||
{}
|
||||
|
||||
void EdbgTargetPowerManagementInterface::enableTargetPower() {
|
||||
auto response = this->edbgInterface.sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
auto response = this->edbgInterface->sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
SetParameter(EdbgParameters::CONTROL_TARGET_POWER, 0x01)
|
||||
);
|
||||
|
||||
@@ -23,7 +27,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg
|
||||
}
|
||||
|
||||
void EdbgTargetPowerManagementInterface::disableTargetPower() {
|
||||
auto response = this->edbgInterface.sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
auto response = this->edbgInterface->sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
SetParameter(EdbgParameters::CONTROL_TARGET_POWER, 0x00)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user