From cadf956f85505f96aff137175e6f73f84ddd9250 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Thu, 15 Jun 2023 11:54:50 +0000 Subject: [PATCH] Implemented "verbatim" notes under "configs". git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@16284 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- tools/ftl/libs/libccode.ftl | 38 +++++++++++++++++------------- tools/ftl/schema/ccode/modules.xsd | 10 ++++---- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/tools/ftl/libs/libccode.ftl b/tools/ftl/libs/libccode.ftl index f6d64e361..b5b6b6a6f 100644 --- a/tools/ftl/libs/libccode.ftl +++ b/tools/ftl/libs/libccode.ftl @@ -365,12 +365,10 @@ ${s} * @name Configuration options * @{ */ - [#list configs.* as this] - [#if this?node_name == "config"] -[@doxygen.EmitFullCommentFromNode "" this /] -[@GenerateConfigFromNode this /] - [/#if] - [#if !this?is_last] + [#list configs.config as config] +[@doxygen.EmitFullCommentFromNode indent="" node=config /] +[@GenerateConfigFromNode node=config /] + [#if !config?is_last] [/#if] [/#list] @@ -385,22 +383,30 @@ ${s} --] [#macro GenerateConfigAssertsFromNode node=[]] [#local configs = node] - [#list configs.config as config] - [#local name = (config.@name[0]!"no-name")?trim] - [#if config.assert[0]??] + [#list configs.* as this] + [#if this?node_name == "config"] + [#local name = (this.@name[0]!"no-name")?trim] + [#if this.assert[0]??] /* Checks on ${name} configuration.*/ - [#list config.assert as assert] - [#local invalid = (assert.@invalid[0]!"TRUE")?replace("$N", name) - message = assert[0]?trim?replace("$N", name) /] + [#list this.assert as assert] + [#local invalid = (assert.@invalid[0]!"TRUE")?replace("$N", name) + message = assert[0]?trim?replace("$N", name) /] #if ${invalid} - [#if message?length > 0] + [#if message?length > 0] #error "${message}" - [#else] + [#else] #error "invalid ${name} value" - [/#if] + [/#if] #endif - [/#list] + [/#list] + [/#if] + [#elseif this?node_name == "verbatim"] + [#local ccode = (this[0]!"")?trim] + [#if ccode?length > 0] +[@GenerateIndentedCCode "" ccode /] + + [/#if] [/#if] [/#list] [/#macro] diff --git a/tools/ftl/schema/ccode/modules.xsd b/tools/ftl/schema/ccode/modules.xsd index 519456dc1..da98ea11c 100644 --- a/tools/ftl/schema/ccode/modules.xsd +++ b/tools/ftl/schema/ccode/modules.xsd @@ -105,10 +105,12 @@ - - - + + + + +