Tidying RISC-V register structs

- Removed unnecessary bit fields
- Added default values to members
- Removed all user-defined constructors to make the structs aggregate, replacing the from-value constructor with a `fromValue()` status member function.
- Made use of designated initialisation
- Changed unscoped enums to scoped
- Other small bits of tidying
This commit is contained in:
Nav
2024-10-16 21:22:16 +01:00
parent 17b90e3c08
commit 348ec19c1b
16 changed files with 338 additions and 378 deletions

View File

@@ -1,11 +1,13 @@
#include "DebugTranslatorConfig.hpp"
#include <cstdint>
namespace DebugToolDrivers::Protocols::RiscVDebugSpec
{
DebugTranslatorConfig::DebugTranslatorConfig(const YAML::Node& configNode) {
if (configNode["targetResponseTimeout"]) {
this->targetResponseTimeout = std::chrono::microseconds{
configNode["targetResponseTimeout"].as<int>(this->targetResponseTimeout.count())
configNode["targetResponseTimeout"].as<std::int64_t>(this->targetResponseTimeout.count())
};
}
}