diff --git a/src/TargetController/Commands/CommandTypes.hpp b/src/TargetController/Commands/CommandTypes.hpp index 47ebfba9..295f8e92 100644 --- a/src/TargetController/Commands/CommandTypes.hpp +++ b/src/TargetController/Commands/CommandTypes.hpp @@ -19,7 +19,7 @@ namespace Bloom::TargetController::Commands STEP_TARGET_EXECUTION, SET_BREAKPOINT, REMOVE_BREAKPOINT, - SET_PROGRAM_COUNTER, + SET_TARGET_PROGRAM_COUNTER, GET_TARGET_PIN_STATES, SET_TARGET_PIN_STATE, GET_TARGET_STACK_POINTER, diff --git a/src/TargetController/Commands/SetProgramCounter.hpp b/src/TargetController/Commands/SetTargetProgramCounter.hpp similarity index 57% rename from src/TargetController/Commands/SetProgramCounter.hpp rename to src/TargetController/Commands/SetTargetProgramCounter.hpp index 4147be2d..d666ce9b 100644 --- a/src/TargetController/Commands/SetProgramCounter.hpp +++ b/src/TargetController/Commands/SetTargetProgramCounter.hpp @@ -8,20 +8,20 @@ namespace Bloom::TargetController::Commands { - class SetProgramCounter: public Command + class SetTargetProgramCounter: public Command { public: - static constexpr CommandType type = CommandType::SET_PROGRAM_COUNTER; - static inline const std::string name = "SetProgramCounter"; + static constexpr CommandType type = CommandType::SET_TARGET_PROGRAM_COUNTER; + static inline const std::string name = "SetTargetProgramCounter"; std::uint32_t address = 0; - explicit SetProgramCounter(std::uint32_t address) + explicit SetTargetProgramCounter(std::uint32_t address) : address(address) {}; [[nodiscard]] CommandType getType() const override { - return SetProgramCounter::type; + return SetTargetProgramCounter::type; } [[nodiscard]] bool requiresStoppedTargetState() const override { diff --git a/src/TargetController/TargetControllerComponent.cpp b/src/TargetController/TargetControllerComponent.cpp index 72a955c9..e2b0f18f 100644 --- a/src/TargetController/TargetControllerComponent.cpp +++ b/src/TargetController/TargetControllerComponent.cpp @@ -34,7 +34,7 @@ namespace Bloom::TargetController using Commands::StepTargetExecution; using Commands::SetBreakpoint; using Commands::RemoveBreakpoint; - using Commands::SetProgramCounter; + using Commands::SetTargetProgramCounter; using Commands::GetTargetPinStates; using Commands::SetTargetPinState; using Commands::GetTargetStackPointer; @@ -408,7 +408,7 @@ namespace Bloom::TargetController this->deregisterCommandHandler(StepTargetExecution::type); this->deregisterCommandHandler(SetBreakpoint::type); this->deregisterCommandHandler(RemoveBreakpoint::type); - this->deregisterCommandHandler(SetProgramCounter::type); + this->deregisterCommandHandler(SetTargetProgramCounter::type); this->deregisterCommandHandler(GetTargetPinStates::type); this->deregisterCommandHandler(SetTargetPinState::type); this->deregisterCommandHandler(GetTargetStackPointer::type); @@ -479,7 +479,7 @@ namespace Bloom::TargetController std::bind(&TargetControllerComponent::handleRemoveBreakpoint, this, std::placeholders::_1) ); - this->registerCommandHandler( + this->registerCommandHandler( std::bind(&TargetControllerComponent::handleSetProgramCounter, this, std::placeholders::_1) ); @@ -883,7 +883,7 @@ namespace Bloom::TargetController return std::make_unique(); } - std::unique_ptr TargetControllerComponent::handleSetProgramCounter(SetProgramCounter& command) { + std::unique_ptr TargetControllerComponent::handleSetProgramCounter(SetTargetProgramCounter& command) { this->target->setProgramCounter(command.address); return std::make_unique(); } diff --git a/src/TargetController/TargetControllerComponent.hpp b/src/TargetController/TargetControllerComponent.hpp index 83300ad7..d666c5d3 100644 --- a/src/TargetController/TargetControllerComponent.hpp +++ b/src/TargetController/TargetControllerComponent.hpp @@ -30,7 +30,7 @@ #include "Commands/StepTargetExecution.hpp" #include "Commands/SetBreakpoint.hpp" #include "Commands/RemoveBreakpoint.hpp" -#include "Commands/SetProgramCounter.hpp" +#include "Commands/SetTargetProgramCounter.hpp" #include "Commands/GetTargetPinStates.hpp" #include "Commands/SetTargetPinState.hpp" #include "Commands/GetTargetStackPointer.hpp" @@ -314,7 +314,7 @@ namespace Bloom::TargetController std::unique_ptr handleStepTargetExecution(Commands::StepTargetExecution& command); std::unique_ptr handleSetBreakpoint(Commands::SetBreakpoint& command); std::unique_ptr handleRemoveBreakpoint(Commands::RemoveBreakpoint& command); - std::unique_ptr handleSetProgramCounter(Commands::SetProgramCounter& command); + std::unique_ptr handleSetProgramCounter(Commands::SetTargetProgramCounter& command); std::unique_ptr handleGetTargetPinStates(Commands::GetTargetPinStates& command); std::unique_ptr handleSetTargetPinState(Commands::SetTargetPinState& command); std::unique_ptr handleGetTargetStackPointer( diff --git a/src/TargetController/TargetControllerConsole.cpp b/src/TargetController/TargetControllerConsole.cpp index b5888224..7e5a0d9b 100644 --- a/src/TargetController/TargetControllerConsole.cpp +++ b/src/TargetController/TargetControllerConsole.cpp @@ -17,7 +17,7 @@ #include "Commands/StepTargetExecution.hpp" #include "Commands/SetBreakpoint.hpp" #include "Commands/RemoveBreakpoint.hpp" -#include "Commands/SetProgramCounter.hpp" +#include "Commands/SetTargetProgramCounter.hpp" #include "Commands/GetTargetPinStates.hpp" #include "Commands/SetTargetPinState.hpp" #include "Commands/GetTargetStackPointer.hpp" @@ -43,7 +43,7 @@ namespace Bloom::TargetController using Commands::StepTargetExecution; using Commands::SetBreakpoint; using Commands::RemoveBreakpoint; - using Commands::SetProgramCounter; + using Commands::SetTargetProgramCounter; using Commands::GetTargetPinStates; using Commands::SetTargetPinState; using Commands::GetTargetStackPointer; @@ -178,7 +178,7 @@ namespace Bloom::TargetController void TargetControllerConsole::setProgramCounter(std::uint32_t address) { this->commandManager.sendCommandAndWaitForResponse( - std::make_unique(address), + std::make_unique(address), this->defaultTimeout ); }