Introduced concept of programming mode
This commit is contained in:
@@ -40,6 +40,10 @@ namespace Bloom::TargetController::Commands
|
||||
return false;
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual bool requiresDebugMode() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
static inline std::atomic<CommandIdType> lastCommandId = 0;
|
||||
};
|
||||
|
||||
@@ -24,5 +24,7 @@ namespace Bloom::TargetController::Commands
|
||||
SET_TARGET_PIN_STATE,
|
||||
GET_TARGET_STACK_POINTER,
|
||||
GET_TARGET_PROGRAM_COUNTER,
|
||||
ENABLE_PROGRAMMING_MODE,
|
||||
DISABLE_PROGRAMMING_MODE,
|
||||
};
|
||||
}
|
||||
|
||||
27
src/TargetController/Commands/DisableProgrammingMode.hpp
Normal file
27
src/TargetController/Commands/DisableProgrammingMode.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include "Command.hpp"
|
||||
|
||||
namespace Bloom::TargetController::Commands
|
||||
{
|
||||
class DisableProgrammingMode: public Command
|
||||
{
|
||||
public:
|
||||
static constexpr CommandType type = CommandType::DISABLE_PROGRAMMING_MODE;
|
||||
static inline const std::string name = "DisableProgrammingMode";
|
||||
|
||||
DisableProgrammingMode() = default;
|
||||
|
||||
[[nodiscard]] CommandType getType() const override {
|
||||
return DisableProgrammingMode::type;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool requiresStoppedTargetState() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool requiresDebugMode() const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
27
src/TargetController/Commands/EnableProgrammingMode.hpp
Normal file
27
src/TargetController/Commands/EnableProgrammingMode.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include "Command.hpp"
|
||||
|
||||
namespace Bloom::TargetController::Commands
|
||||
{
|
||||
class EnableProgrammingMode: public Command
|
||||
{
|
||||
public:
|
||||
static constexpr CommandType type = CommandType::ENABLE_PROGRAMMING_MODE;
|
||||
static inline const std::string name = "EnableProgrammingMode";
|
||||
|
||||
EnableProgrammingMode() = default;
|
||||
|
||||
[[nodiscard]] CommandType getType() const override {
|
||||
return EnableProgrammingMode::type;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool requiresStoppedTargetState() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool requiresDebugMode() const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -17,5 +17,9 @@ namespace Bloom::TargetController::Commands
|
||||
[[nodiscard]] CommandType getType() const override {
|
||||
return GetTargetDescriptor::type;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool requiresDebugMode() const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -42,5 +42,9 @@ namespace Bloom::TargetController::Commands
|
||||
[[nodiscard]] bool requiresStoppedTargetState() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool requiresDebugMode() const override {
|
||||
return this->memoryType == Targets::TargetMemoryType::RAM;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -34,5 +34,9 @@ namespace Bloom::TargetController::Commands
|
||||
[[nodiscard]] bool requiresStoppedTargetState() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool requiresDebugMode() const override {
|
||||
return this->memoryType == Targets::TargetMemoryType::RAM;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user