Removed all using declarations and directives from header files

This commit is contained in:
Nav
2021-05-24 20:58:49 +01:00
parent d39ca609bc
commit ce480a996c
96 changed files with 415 additions and 473 deletions

View File

@@ -14,10 +14,6 @@
namespace Bloom::DebugToolDrivers
{
using namespace Protocols::CmsisDap;
using Protocols::CmsisDap::Edbg::EdbgInterface;
using Protocols::CmsisDap::Edbg::Avr::EdbgAvr8Interface;
/**
* The Atmel-ICE device is an EDBG (Embedded Debugger) device. It implements the CMSIS-DAP layer as well
* as an Atmel Data Gateway Interface (DGI).
@@ -53,13 +49,13 @@ namespace Bloom::DebugToolDrivers
* Any non-EDBG CMSIS-DAP commands for the Atmel-ICE can be sent through the EdbgInterface (as the
* EdbgInterface extends the CmsisDapInterface).
*/
EdbgInterface edbgInterface = EdbgInterface();
Protocols::CmsisDap::Edbg::EdbgInterface edbgInterface = Protocols::CmsisDap::Edbg::EdbgInterface();
/**
* The Atmel-ICE employs the EDBG AVR8 Generic protocol, for debugging AVR8 targets. This protocol is
* implemented in EdbgAvr8Interface. See the EdbgAvr8Interface class for more information.
*/
std::unique_ptr<EdbgAvr8Interface> edbgAvr8Interface = nullptr;
std::unique_ptr<Protocols::CmsisDap::Edbg::Avr::EdbgAvr8Interface> edbgAvr8Interface = nullptr;
bool sessionStarted = false;
@@ -70,13 +66,15 @@ namespace Bloom::DebugToolDrivers
AtmelIce(): UsbDevice(AtmelIce::USB_VENDOR_ID, AtmelIce::USB_PRODUCT_ID) {}
void init() override;
void close() override;
EdbgInterface& getEdbgInterface() {
Protocols::CmsisDap::Edbg::EdbgInterface& getEdbgInterface() {
return this->edbgInterface;
}
Avr8Interface* getAvr8Interface() override {
TargetInterfaces::Microchip::Avr::Avr8::Avr8Interface* getAvr8Interface() override {
return this->edbgAvr8Interface.get();
}

View File

@@ -14,10 +14,6 @@
namespace Bloom::DebugToolDrivers
{
using namespace Protocols::CmsisDap;
using Protocols::CmsisDap::Edbg::EdbgInterface;
using Protocols::CmsisDap::Edbg::Avr::EdbgAvr8Interface;
/**
* The MPLAB Snap device is a hybrid device - that is, it can present itself as an "MPLAB Snap ICD" device, as well
* as an EDBG (Embedded Debugger) device. The device switches between these two modes via a firmware update, issued
@@ -39,13 +35,13 @@ namespace Bloom::DebugToolDrivers
class MplabSnap: public DebugTool, public Usb::UsbDevice
{
private:
EdbgInterface edbgInterface = EdbgInterface();
Protocols::CmsisDap::Edbg::EdbgInterface edbgInterface = Protocols::CmsisDap::Edbg::EdbgInterface();
/**
* The MPLAB Snap employs the EDBG AVR8 Generic protocol, for debugging AVR8 targets. This protocol is
* implemented in EdbgAvr8Interface. See the EdbgAvr8Interface class for more information.
*/
std::unique_ptr<EdbgAvr8Interface> edbgAvr8Interface = nullptr;
std::unique_ptr<Protocols::CmsisDap::Edbg::Avr::EdbgAvr8Interface> edbgAvr8Interface = nullptr;
bool sessionStarted = false;
@@ -56,13 +52,15 @@ namespace Bloom::DebugToolDrivers
MplabSnap(): UsbDevice(MplabSnap::USB_VENDOR_ID, MplabSnap::USB_PRODUCT_ID) {}
void init() override;
void close() override;
EdbgInterface& getEdbgInterface() {
Protocols::CmsisDap::Edbg::EdbgInterface& getEdbgInterface() {
return this->edbgInterface;
}
Avr8Interface* getAvr8Interface() override {
TargetInterfaces::Microchip::Avr::Avr8::Avr8Interface* getAvr8Interface() override {
return this->edbgAvr8Interface.get();
}

View File

@@ -2,9 +2,11 @@
#include "src/Exceptions/Exception.hpp"
using namespace Bloom::DebugToolDrivers;
using namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr;
using namespace Protocols::CmsisDap::Edbg::Avr;
using namespace Bloom::Exceptions;
using Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::EdbgAvr8Interface;
void PowerDebugger::init() {
UsbDevice::init();
@@ -48,10 +50,10 @@ void PowerDebugger::close() {
std::string PowerDebugger::getSerialNumber() {
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
CommandFrames::Discovery::Query(Discovery::QueryContext::SERIAL_NUMBER)
CommandFrames::Discovery::Query(CommandFrames::Discovery::QueryContext::SERIAL_NUMBER)
);
if (response.getResponseId() != Discovery::ResponseId::OK) {
if (response.getResponseId() != CommandFrames::Discovery::ResponseId::OK) {
throw Exception("Failed to fetch serial number from device - invalid Discovery Protocol response ID.");
}
@@ -64,7 +66,7 @@ void PowerDebugger::startSession() {
CommandFrames::HouseKeeping::StartSession()
);
if (response.getResponseId() == HouseKeeping::ResponseId::FAILED) {
if (response.getResponseId() == CommandFrames::HouseKeeping::ResponseId::FAILED) {
// Failed response returned!
throw Exception("Failed to start session with the Power Debugger - device returned failed response ID");
}
@@ -77,7 +79,7 @@ void PowerDebugger::endSession() {
CommandFrames::HouseKeeping::EndSession()
);
if (response.getResponseId() == HouseKeeping::ResponseId::FAILED) {
if (response.getResponseId() == CommandFrames::HouseKeeping::ResponseId::FAILED) {
// Failed response returned!
throw Exception("Failed to end session with the Power Debugger - device returned failed response ID");
}

View File

@@ -14,13 +14,6 @@
namespace Bloom::DebugToolDrivers
{
using namespace Protocols::CmsisDap;
using namespace Protocols::CmsisDap::Edbg::Avr::CommandFrames;
using namespace Protocols::CmsisDap::Edbg::Avr::CommandFrames::Discovery;
using namespace Protocols::CmsisDap::Edbg::Avr::CommandFrames::HouseKeeping;
using Protocols::CmsisDap::Edbg::EdbgInterface;
using Protocols::CmsisDap::Edbg::Avr::EdbgAvr8Interface;
/**
* The Power Debugger device is very similar to the Atmel-ICE. It implements the CMSIS-DAP layer as well
* as an Atmel Data Gateway Interface (DGI).
@@ -43,12 +36,12 @@ namespace Bloom::DebugToolDrivers
* Any non-EDBG CMSIS-DAP commands for the Power Debugger can be sent through the EDBGInterface (as the
* EdbgInterface extends the CmsisDapInterface).
*/
EdbgInterface edbgInterface = EdbgInterface();
Protocols::CmsisDap::Edbg::EdbgInterface edbgInterface = Protocols::CmsisDap::Edbg::EdbgInterface();
/**
* The Power Debugger employs the EDBG AVR8Generic protocol for interfacing with AVR8 targets.
*/
std::unique_ptr<EdbgAvr8Interface> edbgAvr8Interface;
std::unique_ptr<Protocols::CmsisDap::Edbg::Avr::EdbgAvr8Interface> edbgAvr8Interface;
bool sessionStarted = false;
@@ -59,13 +52,15 @@ namespace Bloom::DebugToolDrivers
PowerDebugger(): UsbDevice(PowerDebugger::USB_VENDOR_ID, PowerDebugger::USB_PRODUCT_ID) {}
void init() override;
void close() override;
EdbgInterface& getEdbgInterface() {
Protocols::CmsisDap::Edbg::EdbgInterface& getEdbgInterface() {
return this->edbgInterface;
}
Avr8Interface* getAvr8Interface() override {
TargetInterfaces::Microchip::Avr::Avr8::Avr8Interface* getAvr8Interface() override {
return this->edbgAvr8Interface.get();
}