Target driver passthrough commands
Added `pm` commands to manage the program mode of WCH targets
This commit is contained in:
@@ -51,6 +51,7 @@ namespace TargetController
|
||||
using Commands::GetTargetProgramCounter;
|
||||
using Commands::EnableProgrammingMode;
|
||||
using Commands::DisableProgrammingMode;
|
||||
using Commands::InvokeTargetPassthroughCommand;
|
||||
|
||||
using Responses::Response;
|
||||
using Responses::AtomicSessionId;
|
||||
@@ -60,6 +61,7 @@ namespace TargetController
|
||||
using Responses::TargetStackPointer;
|
||||
using Responses::TargetProgramCounter;
|
||||
using Responses::ProgramBreakpoint;
|
||||
using Responses::TargetPassthroughResponse;
|
||||
|
||||
TargetControllerComponent::TargetControllerComponent(
|
||||
const ProjectConfig& projectConfig,
|
||||
@@ -262,6 +264,10 @@ namespace TargetController
|
||||
std::bind(&TargetControllerComponent::handleDisableProgrammingMode, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->registerCommandHandler<InvokeTargetPassthroughCommand>(
|
||||
std::bind(&TargetControllerComponent::handleTargetPassthroughCommand, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
// Register event handlers
|
||||
this->eventListener->registerCallbackForEventType<Events::ShutdownTargetController>(
|
||||
std::bind(&TargetControllerComponent::onShutdownTargetControllerEvent, this, std::placeholders::_1)
|
||||
@@ -1173,4 +1179,10 @@ namespace TargetController
|
||||
|
||||
return std::make_unique<Response>();
|
||||
}
|
||||
|
||||
std::unique_ptr<TargetPassthroughResponse> TargetControllerComponent::handleTargetPassthroughCommand(
|
||||
InvokeTargetPassthroughCommand& command
|
||||
) {
|
||||
return std::make_unique<TargetPassthroughResponse>(this->target->invokePassthroughCommand(command.command));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user