From 64de134a2844fe630631568467f795bc8e2b88f2 Mon Sep 17 00:00:00 2001 From: Nav Date: Sun, 1 May 2022 19:02:04 +0100 Subject: [PATCH] More tidying --- .../Commands/CommandTypes.hpp | 2 +- .../Responses/ResponseTypes.hpp | 2 +- .../TargetControllerConsole.cpp | 29 +++++++++++++------ .../TargetControllerConsole.hpp | 1 + 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/TargetController/Commands/CommandTypes.hpp b/src/TargetController/Commands/CommandTypes.hpp index 295f8e92..93c74043 100644 --- a/src/TargetController/Commands/CommandTypes.hpp +++ b/src/TargetController/Commands/CommandTypes.hpp @@ -8,6 +8,7 @@ namespace Bloom::TargetController::Commands { GENERIC, GET_TARGET_CONTROLLER_STATE, + GET_TARGET_DESCRIPTOR, STOP_TARGET_EXECUTION, RESUME_TARGET_EXECUTION, RESET_TARGET, @@ -24,6 +25,5 @@ namespace Bloom::TargetController::Commands SET_TARGET_PIN_STATE, GET_TARGET_STACK_POINTER, GET_TARGET_PROGRAM_COUNTER, - GET_TARGET_DESCRIPTOR, }; } diff --git a/src/TargetController/Responses/ResponseTypes.hpp b/src/TargetController/Responses/ResponseTypes.hpp index 609c27f8..7b5d4548 100644 --- a/src/TargetController/Responses/ResponseTypes.hpp +++ b/src/TargetController/Responses/ResponseTypes.hpp @@ -8,12 +8,12 @@ namespace Bloom::TargetController::Responses { GENERIC, ERROR, + TARGET_DESCRIPTOR, TARGET_REGISTERS_READ, TARGET_MEMORY_READ, TARGET_STATE, TARGET_PIN_STATES, TARGET_STACK_POINTER, TARGET_PROGRAM_COUNTER, - TARGET_DESCRIPTOR, }; } diff --git a/src/TargetController/TargetControllerConsole.cpp b/src/TargetController/TargetControllerConsole.cpp index 32999cc9..99c401f4 100644 --- a/src/TargetController/TargetControllerConsole.cpp +++ b/src/TargetController/TargetControllerConsole.cpp @@ -21,13 +21,8 @@ #include "Commands/GetTargetStackPointer.hpp" #include "Commands/GetTargetProgramCounter.hpp" -#include "src/Logger/Logger.hpp" - namespace Bloom::TargetController { - using namespace Bloom::Targets; - using namespace Bloom::Exceptions; - using Commands::GetTargetDescriptor; using Commands::GetTargetState; using Commands::StopTargetExecution; @@ -46,6 +41,22 @@ namespace Bloom::TargetController using Commands::GetTargetStackPointer; using Commands::GetTargetProgramCounter; + using Targets::TargetDescriptor; + using Targets::TargetState; + + using Targets::TargetRegisters; + using Targets::TargetRegisterDescriptors; + + using Targets::TargetMemoryType; + using Targets::TargetMemoryAddressRange; + using Targets::TargetMemoryBuffer; + + using Targets::TargetBreakpoint; + + using Targets::TargetPinDescriptor; + using Targets::TargetPinState; + using Targets::TargetPinStateMappingType; + TargetControllerState TargetControllerConsole::getTargetControllerState() { return TargetControllerComponent::getState(); } @@ -59,14 +70,14 @@ namespace Bloom::TargetController } } - Targets::TargetDescriptor TargetControllerConsole::getTargetDescriptor() { + TargetDescriptor TargetControllerConsole::getTargetDescriptor() { return this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout )->targetDescriptor; } - Targets::TargetState TargetControllerConsole::getTargetState() { + TargetState TargetControllerConsole::getTargetState() { return this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout @@ -124,7 +135,7 @@ namespace Bloom::TargetController TargetMemoryType memoryType, std::uint32_t startAddress, std::uint32_t bytes, - const std::set& excludedAddressRanges + const std::set& excludedAddressRanges ) { return this->commandManager.sendCommandAndWaitForResponse( std::make_unique( @@ -176,7 +187,7 @@ namespace Bloom::TargetController ); } - Targets::TargetPinStateMappingType TargetControllerConsole::getPinStates(int variantId) { + TargetPinStateMappingType TargetControllerConsole::getPinStates(int variantId) { return this->commandManager.sendCommandAndWaitForResponse( std::make_unique(variantId), this->defaultTimeout diff --git a/src/TargetController/TargetControllerConsole.hpp b/src/TargetController/TargetControllerConsole.hpp index 7ee19e20..a176e2ca 100644 --- a/src/TargetController/TargetControllerConsole.hpp +++ b/src/TargetController/TargetControllerConsole.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include "CommandManager.hpp"