Added EraseTargetMemory TC command

This commit is contained in:
Nav
2022-12-11 23:25:15 +00:00
parent 83c273a22b
commit 76a0207701
7 changed files with 77 additions and 17 deletions

View File

@@ -18,6 +18,7 @@ namespace Bloom::TargetController::Commands
WRITE_TARGET_REGISTERS,
READ_TARGET_MEMORY,
WRITE_TARGET_MEMORY,
ERASE_TARGET_MEMORY,
GET_TARGET_STATE,
STEP_TARGET_EXECUTION,
SET_BREAKPOINT,

View File

@@ -0,0 +1,33 @@
#pragma once
#include "Command.hpp"
#include "src/Targets/TargetMemory.hpp"
namespace Bloom::TargetController::Commands
{
class EraseTargetMemory: public Command
{
public:
static constexpr CommandType type = CommandType::ERASE_TARGET_MEMORY;
static const inline std::string name = "EraseTargetMemory";
Targets::TargetMemoryType memoryType;
EraseTargetMemory(Targets::TargetMemoryType memoryType)
: memoryType(memoryType)
{};
[[nodiscard]] CommandType getType() const override {
return EraseTargetMemory::type;
}
[[nodiscard]] bool requiresStoppedTargetState() const override {
return true;
}
[[nodiscard]] bool requiresDebugMode() const override {
return this->memoryType == Targets::TargetMemoryType::RAM;
}
};
}