Updated TargetControllerConsole to use template method for triggering events for the TargetController.

This commit is contained in:
Nav
2021-08-20 22:53:31 +01:00
parent e3ec4e31e8
commit 092a7df675
14 changed files with 54 additions and 130 deletions

View File

@@ -4,6 +4,7 @@
#include <string>
#include "Event.hpp"
#include "BreakpointRemovedOnTarget.hpp"
#include "src/Targets/TargetBreakpoint.hpp"
namespace Bloom::Events
@@ -11,6 +12,8 @@ namespace Bloom::Events
class RemoveBreakpointOnTarget: public Event
{
public:
using TargetControllerResponseType = BreakpointRemovedOnTarget;
static inline EventType type = EventType::REMOVE_BREAKPOINT_ON_TARGET;
static inline const std::string name = "RemoveBreakpointOnTarget";
Targets::TargetBreakpoint breakpoint;

View File

@@ -3,12 +3,15 @@
#include <string>
#include "Event.hpp"
#include "TargetControllerStateReported.hpp"
namespace Bloom::Events
{
class ReportTargetControllerState: public Event
{
public:
using TargetControllerResponseType = TargetControllerStateReported;
static inline EventType type = EventType::REPORT_TARGET_CONTROLLER_STATE;
static inline const std::string name = "ReportTargetControllerState";

View File

@@ -4,12 +4,15 @@
#include <string>
#include "Event.hpp"
#include "TargetExecutionResumed.hpp"
namespace Bloom::Events
{
class ResumeTargetExecution: public Event
{
public:
using TargetControllerResponseType = TargetExecutionResumed;
static inline EventType type = EventType::RESUME_TARGET_EXECUTION;
static inline const std::string name = "ResumeTargetExecutionEvent";
std::optional<std::uint32_t> fromProgramCounter;

View File

@@ -4,6 +4,7 @@
#include <string>
#include "Event.hpp"
#include "MemoryRetrievedFromTarget.hpp"
#include "src/Targets/TargetMemory.hpp"
namespace Bloom::Events
@@ -11,6 +12,8 @@ namespace Bloom::Events
class RetrieveMemoryFromTarget: public Event
{
public:
using TargetControllerResponseType = MemoryRetrievedFromTarget;
static inline EventType type = EventType::RETRIEVE_MEMORY_FROM_TARGET;
static inline const std::string name = "RetrieveMemoryFromTarget";
Targets::TargetMemoryType memoryType = Targets::TargetMemoryType::RAM;

View File

@@ -3,6 +3,7 @@
#include <string>
#include "Event.hpp"
#include "RegistersRetrievedFromTarget.hpp"
#include "src/Targets/TargetRegister.hpp"
namespace Bloom::Events
@@ -10,6 +11,8 @@ namespace Bloom::Events
class RetrieveRegistersFromTarget: public Event
{
public:
using TargetControllerResponseType = RegistersRetrievedFromTarget;
static inline EventType type = EventType::RETRIEVE_REGISTERS_FROM_TARGET;
static inline const std::string name = "RetrieveRegistersFromTarget";
Targets::TargetRegisterDescriptors descriptors;

View File

@@ -3,12 +3,15 @@
#include <string>
#include "Event.hpp"
#include "TargetPinStatesRetrieved.hpp"
namespace Bloom::Events
{
class RetrieveTargetPinStates: public Event
{
public:
using TargetControllerResponseType = TargetPinStatesRetrieved;
static inline EventType type = EventType::RETRIEVE_TARGET_PIN_STATES;
static inline const std::string name = "RetrieveTargetPinStates";
int variantId = 0;

View File

@@ -4,6 +4,7 @@
#include <string>
#include "Event.hpp"
#include "BreakpointSetOnTarget.hpp"
#include "src/Targets/TargetBreakpoint.hpp"
namespace Bloom::Events
@@ -11,6 +12,8 @@ namespace Bloom::Events
class SetBreakpointOnTarget: public Event
{
public:
using TargetControllerResponseType = BreakpointSetOnTarget;
static inline EventType type = EventType::SET_BREAKPOINT_ON_TARGET;
static inline const std::string name = "SetBreakpointOnTarget";
Targets::TargetBreakpoint breakpoint;

View File

@@ -4,12 +4,15 @@
#include <string>
#include "Event.hpp"
#include "ProgramCounterSetOnTarget.hpp"
namespace Bloom::Events
{
class SetProgramCounterOnTarget: public Event
{
public:
using TargetControllerResponseType = ProgramCounterSetOnTarget;
static inline EventType type = EventType::SET_PROGRAM_COUNTER_ON_TARGET;
static inline const std::string name = "SetProgramCounterOnTarget";
std::uint32_t address = 0;

View File

@@ -3,6 +3,7 @@
#include <string>
#include "Event.hpp"
#include "TargetPinStatesRetrieved.hpp"
#include "src/Targets/TargetPinDescriptor.hpp"
namespace Bloom::Events
@@ -10,6 +11,8 @@ namespace Bloom::Events
class SetTargetPinState: public Event
{
public:
using TargetControllerResponseType = TargetPinStatesRetrieved;
static inline EventType type = EventType::SET_TARGET_PIN_STATE;
static inline const std::string name = "SetTargetPinState";
int variantId = 0;

View File

@@ -4,12 +4,15 @@
#include <string>
#include "Event.hpp"
#include "TargetExecutionResumed.hpp"
namespace Bloom::Events
{
class StepTargetExecution: public Event
{
public:
using TargetControllerResponseType = TargetExecutionResumed;
static inline EventType type = EventType::STEP_TARGET_EXECUTION;
static inline const std::string name = "StepTargetExecution";
std::optional<std::uint32_t> fromProgramCounter;

View File

@@ -3,12 +3,15 @@
#include <string>
#include "Event.hpp"
#include "TargetExecutionStopped.hpp"
namespace Bloom::Events
{
class StopTargetExecution: public Event
{
public:
using TargetControllerResponseType = TargetExecutionStopped;
static inline EventType type = EventType::STOP_TARGET_EXECUTION;
static inline const std::string name = "StopTargetExecution";

View File

@@ -5,6 +5,7 @@
#include <utility>
#include "Event.hpp"
#include "MemoryWrittenToTarget.hpp"
#include "src/Targets/TargetMemory.hpp"
namespace Bloom::Events
@@ -12,6 +13,8 @@ namespace Bloom::Events
class WriteMemoryToTarget: public Event
{
public:
using TargetControllerResponseType = MemoryWrittenToTarget;
static inline EventType type = EventType::WRITE_MEMORY_TO_TARGET;
static inline const std::string name = "WriteMemoryToTarget";
Targets::TargetMemoryType memoryType = Targets::TargetMemoryType::RAM;

View File

@@ -4,6 +4,7 @@
#include <utility>
#include "Event.hpp"
#include "RegistersWrittenToTarget.hpp"
#include "src/Targets/TargetRegister.hpp"
namespace Bloom::Events
@@ -11,6 +12,8 @@ namespace Bloom::Events
class WriteRegistersToTarget: public Event
{
public:
using TargetControllerResponseType = RegistersWrittenToTarget;
static inline EventType type = EventType::WRITE_REGISTERS_TO_TARGET;
static inline const std::string name = "WriteRegistersToTarget";
Targets::TargetRegisters registers;