diff --git a/tools/svdconv/SVDGenerator/include/SfdGenerator.h b/tools/svdconv/SVDGenerator/include/SfdGenerator.h index a5195220a..1448ffa84 100644 --- a/tools/svdconv/SVDGenerator/include/SfdGenerator.h +++ b/tools/svdconv/SVDGenerator/include/SfdGenerator.h @@ -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 ); @@ -243,6 +245,7 @@ class SfdGenerator : public CodeGenerator { parse_and_call(&SfdGenerator::CreateTextonly, text, std::forward(args)...); } + // Close ordinary items unless SINGLE output was requested. if constexpr (elementType != sfd::SINGLE) { CreateItemEnd(elementIndex); } diff --git a/tools/svdconv/SVDModel/src/SvdField.cpp b/tools/svdconv/SVDModel/src/SvdField.cpp index cb60167a8..c22ffad24 100644 --- a/tools/svdconv/SVDModel/src/SvdField.cpp +++ b/tools/svdconv/SVDModel/src/SvdField.cpp @@ -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; @@ -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; @@ -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);