Replaced SetTargetPinState event with TC command

This commit is contained in:
Nav
2022-05-01 17:33:09 +01:00
parent 870c4ba3d7
commit 1072534809
9 changed files with 52 additions and 102 deletions

View File

@@ -21,5 +21,6 @@ namespace Bloom::TargetController::Commands
REMOVE_BREAKPOINT,
SET_PROGRAM_COUNTER,
GET_TARGET_PIN_STATES,
SET_TARGET_PIN_STATE,
};
}

View File

@@ -0,0 +1,34 @@
#pragma once
#include "Command.hpp"
#include "src/Targets/TargetPinDescriptor.hpp"
namespace Bloom::TargetController::Commands
{
class SetTargetPinState: public Command
{
public:
static constexpr CommandType type = CommandType::SET_TARGET_PIN_STATE;
static inline const std::string name = "SetTargetPinState";
Targets::TargetPinDescriptor pinDescriptor;
Targets::TargetPinState pinState;
SetTargetPinState(
const Targets::TargetPinDescriptor& pinDescriptor,
const Targets::TargetPinState& pinState
)
: pinDescriptor(pinDescriptor)
, pinState(pinState)
{};
[[nodiscard]] CommandType getType() const override {
return SetTargetPinState::type;
}
[[nodiscard]] bool requiresStoppedTargetState() const override {
return true;
}
};
}