Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tools/svdconv/SVDGenerator/include/SfdGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ class SfdGenerator : public CodeGenerator {
// codeql[cpp/unused-local-variable]; codeql[cpp/unused-static-variable]
void Generate(const std::string& text, Args&&... args)
{
// SFD generator core: decode element flags and dispatch to the output helpers.
// parse_and_call separates helper arguments from text-formatting arguments.
[[maybe_unused]] constexpr sfd::Index elementIndex = (sfd::Index)(element & sfd::INDEX_MASK);
constexpr sfd::Options elementType = (sfd::Options)(element & sfd::OPTIONS_MASK );
constexpr sfd::Special specialType = (sfd::Special)(element & sfd::SPECIAL_MASK );
Expand Down Expand Up @@ -243,6 +245,7 @@ class SfdGenerator : public CodeGenerator {
parse_and_call(&SfdGenerator::CreateTextonly, text, std::forward<Args>(args)...);
}

// Close ordinary items unless SINGLE output was requested.
if constexpr (elementType != sfd::SINGLE) {
CreateItemEnd(elementIndex);
}
Expand Down
3 changes: 3 additions & 0 deletions tools/svdconv/SVDModel/src/SvdField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ bool SvdField::Calculate()

bool SvdField::CalculateDim()
{
// Expand dimension indices into individually named fields.
const auto dim = GetDimension();
if(!dim) {
return true;
Expand Down Expand Up @@ -229,6 +230,7 @@ bool SvdField::CalculateDim()
uint32_t dimElementIndex = 0;
string dimIndexText;

// Reserve the shared expansion budget before cloning each field.
for(const auto& index : dimIndexList) {
if(!dim->ReserveExpansion(1)) {
return false;
Expand Down Expand Up @@ -276,6 +278,7 @@ bool SvdField::CalculateDim()
}
}

// Use the index summary in the dimension's display name and description.
string name = dim->CreateName("");
dim->SetName(name);

Expand Down
Loading