From 777fa5d5684ef62c7241e43a457acfb69965e4a3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 17 Feb 2013 11:46:37 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5219 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- tools/eclipse/config_wizard/.classpath | 13 - tools/eclipse/config_wizard/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 8 - tools/eclipse/config_wizard/META-INF/MANIFEST.MF | 24 - tools/eclipse/config_wizard/build.properties | 8 - tools/eclipse/config_wizard/icons/check.gif | Bin 591 -> 0 bytes tools/eclipse/config_wizard/icons/chibios.gif | Bin 581 -> 0 bytes tools/eclipse/config_wizard/icons/generate.gif | Bin 378 -> 0 bytes tools/eclipse/config_wizard/icons/sample.gif | Bin 983 -> 0 bytes tools/eclipse/config_wizard/lib/bsh.jar | Bin 281694 -> 0 bytes tools/eclipse/config_wizard/lib/fmpp.jar | Bin 314020 -> 0 bytes tools/eclipse/config_wizard/lib/freemarker.jar | Bin 931168 -> 0 bytes tools/eclipse/config_wizard/lib/jdom-2.0.2.jar | Bin 295355 -> 0 bytes tools/eclipse/config_wizard/lib/oro.jar | Bin 65261 -> 0 bytes tools/eclipse/config_wizard/lib/resolver.jar | Bin 60047 -> 0 bytes tools/eclipse/config_wizard/plugin.xml | 219 ---- .../resources/app_templates/c/template.xml | 82 -- .../resources/gencfg/lib/code_snippets.xml | 50 - .../config_wizard/resources/gencfg/lib/libcode.ftl | 316 ------ .../resources/gencfg/lib/liblicense.ftl | 58 - .../resources/gencfg/lib/libsnippets.ftl | 33 - .../resources/gencfg/lib/libstm32f4xx.ftl | 144 --- .../resources/gencfg/lib/libutils.ftl | 109 -- .../boards/stm32f0xx/templates/board.c.ftl | 101 -- .../boards/stm32f0xx/templates/board.h.ftl | 326 ------ .../boards/stm32f0xx/templates/board.mk.ftl | 28 - .../boards/stm32f3xx/templates/board.c.ftl | 133 --- .../boards/stm32f3xx/templates/board.h.ftl | 327 ------ .../boards/stm32f3xx/templates/board.mk.ftl | 28 - .../boards/stm32f4xx/templates/board.c.ftl | 139 --- .../boards/stm32f4xx/templates/board.h.ftl | 327 ------ .../boards/stm32f4xx/templates/board.mk.ftl | 28 - .../boards/stm32l1xx/templates/board.c.ftl | 133 --- .../boards/stm32l1xx/templates/board.h.ftl | 321 ------ .../boards/stm32l1xx/templates/board.mk.ftl | 28 - .../resources/gencfg/processors/processors.xml | 26 - .../gencfg/schema/boards/abstract_board.xsd | 81 -- .../gencfg/schema/boards/stm32f0xx_board.xsd | 94 -- .../gencfg/schema/boards/stm32f3xx_board.xsd | 100 -- .../gencfg/schema/boards/stm32f4xx_board.xsd | 108 -- .../gencfg/schema/boards/stm32l1xx_board.xsd | 81 -- .../gencfg/schema/common/code_snippets.xsd | 59 - .../gencfg/schema/common/config_settings.xsd | 36 - .../resources/gencfg/schema/common/doc.xsd | 108 -- .../schema/common/stm32/stm32_gpiov2_port.xsd | 214 ---- .../resources/gencfg/xml/stm32f0board.xml | 669 ----------- .../resources/gencfg/xml/stm32f3board.xml | 797 ------------- .../resources/gencfg/xml/stm32f4board.xml | 1194 -------------------- .../resources/gencfg/xml/stm32l1board.xml | 799 ------------- .../config_wizard/src/config_wizard/Activator.java | 88 -- .../eclipse/config/handlers/CheckDescription.java | 55 - .../eclipse/config/handlers/GenerateFiles.java | 131 --- .../process/ApplicationGeneratorProcessRunner.java | 37 - .../tools/eclipse/config/utils/TemplateEngine.java | 260 ----- .../eclipse/config/utils/TemplateException.java | 30 - .../config/wizards/ConfigurationNewWizard.java | 185 --- .../config/wizards/ConfigurationNewWizardPage.java | 264 ----- .../wizards/NewApplicationProjectWizard.java | 158 --- .../wizards/NewApplicationProjectWizardPage.java | 312 ----- 59 files changed, 8897 deletions(-) delete mode 100644 tools/eclipse/config_wizard/.classpath delete mode 100644 tools/eclipse/config_wizard/.project delete mode 100644 tools/eclipse/config_wizard/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tools/eclipse/config_wizard/META-INF/MANIFEST.MF delete mode 100644 tools/eclipse/config_wizard/build.properties delete mode 100644 tools/eclipse/config_wizard/icons/check.gif delete mode 100644 tools/eclipse/config_wizard/icons/chibios.gif delete mode 100644 tools/eclipse/config_wizard/icons/generate.gif delete mode 100644 tools/eclipse/config_wizard/icons/sample.gif delete mode 100644 tools/eclipse/config_wizard/lib/bsh.jar delete mode 100644 tools/eclipse/config_wizard/lib/fmpp.jar delete mode 100644 tools/eclipse/config_wizard/lib/freemarker.jar delete mode 100644 tools/eclipse/config_wizard/lib/jdom-2.0.2.jar delete mode 100644 tools/eclipse/config_wizard/lib/oro.jar delete mode 100644 tools/eclipse/config_wizard/lib/resolver.jar delete mode 100644 tools/eclipse/config_wizard/plugin.xml delete mode 100644 tools/eclipse/config_wizard/resources/app_templates/c/template.xml delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/lib/code_snippets.xml delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/lib/libcode.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/lib/liblicense.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/lib/libsnippets.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/lib/libstm32f4xx.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/lib/libutils.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f0xx/templates/board.c.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f0xx/templates/board.h.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f0xx/templates/board.mk.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f3xx/templates/board.c.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f3xx/templates/board.h.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f3xx/templates/board.mk.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f4xx/templates/board.c.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f4xx/templates/board.h.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f4xx/templates/board.mk.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32l1xx/templates/board.c.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32l1xx/templates/board.h.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32l1xx/templates/board.mk.ftl delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/processors/processors.xml delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/schema/boards/abstract_board.xsd delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32f0xx_board.xsd delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32f3xx_board.xsd delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32f4xx_board.xsd delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32l1xx_board.xsd delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/schema/common/code_snippets.xsd delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/schema/common/config_settings.xsd delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/schema/common/doc.xsd delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/schema/common/stm32/stm32_gpiov2_port.xsd delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/xml/stm32f0board.xml delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/xml/stm32f3board.xml delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/xml/stm32f4board.xml delete mode 100644 tools/eclipse/config_wizard/resources/gencfg/xml/stm32l1board.xml delete mode 100644 tools/eclipse/config_wizard/src/config_wizard/Activator.java delete mode 100644 tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/handlers/CheckDescription.java delete mode 100644 tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/handlers/GenerateFiles.java delete mode 100644 tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/process/ApplicationGeneratorProcessRunner.java delete mode 100644 tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/utils/TemplateEngine.java delete mode 100644 tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/utils/TemplateException.java delete mode 100644 tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/ConfigurationNewWizard.java delete mode 100644 tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/ConfigurationNewWizardPage.java delete mode 100644 tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/NewApplicationProjectWizard.java delete mode 100644 tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/NewApplicationProjectWizardPage.java (limited to 'tools/eclipse/config_wizard') diff --git a/tools/eclipse/config_wizard/.classpath b/tools/eclipse/config_wizard/.classpath deleted file mode 100644 index 724303fa9..000000000 --- a/tools/eclipse/config_wizard/.classpath +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/.project b/tools/eclipse/config_wizard/.project deleted file mode 100644 index 6611705c5..000000000 --- a/tools/eclipse/config_wizard/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - Tool Config Wizard - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/tools/eclipse/config_wizard/.settings/org.eclipse.jdt.core.prefs b/tools/eclipse/config_wizard/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index da0e3846d..000000000 --- a/tools/eclipse/config_wizard/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Mon Jul 30 11:37:30 CEST 2012 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/tools/eclipse/config_wizard/META-INF/MANIFEST.MF b/tools/eclipse/config_wizard/META-INF/MANIFEST.MF deleted file mode 100644 index 37f4f5b08..000000000 --- a/tools/eclipse/config_wizard/META-INF/MANIFEST.MF +++ /dev/null @@ -1,24 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: ChibiOS-RT_Configuration_Support -Bundle-SymbolicName: org.chibios.tools.eclipse.config;singleton:=true -Bundle-Version: 1.2.1 -Bundle-Activator: config_wizard.Activator -Require-Bundle: org.eclipse.core.resources;bundle-version="3.7.101", - org.eclipse.core.runtime;bundle-version="3.7.0", - org.eclipse.ui;bundle-version="3.7.0", - org.eclipse.ui.console;bundle-version="3.5.100", - org.eclipse.ui.ide;bundle-version="3.7.0", - org.eclipse.cdt.core;bundle-version="5.3.2", - org.eclipse.cdt.managedbuilder.core;bundle-version="8.0.2", - org.eclipse.cdt.ui;bundle-version="5.3.2" -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Bundle-Vendor: chibios.org -Bundle-ClassPath: ., - lib/jdom-2.0.2.jar, - lib/freemarker.jar, - lib/fmpp.jar, - lib/bsh.jar, - lib/oro.jar, - lib/resolver.jar diff --git a/tools/eclipse/config_wizard/build.properties b/tools/eclipse/config_wizard/build.properties deleted file mode 100644 index 008ba6d91..000000000 --- a/tools/eclipse/config_wizard/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = plugin.xml,\ - META-INF/,\ - .,\ - icons/,\ - lib/,\ - resources/ diff --git a/tools/eclipse/config_wizard/icons/check.gif b/tools/eclipse/config_wizard/icons/check.gif deleted file mode 100644 index 18ffabe77..000000000 Binary files a/tools/eclipse/config_wizard/icons/check.gif and /dev/null differ diff --git a/tools/eclipse/config_wizard/icons/chibios.gif b/tools/eclipse/config_wizard/icons/chibios.gif deleted file mode 100644 index ddbf1e1d1..000000000 Binary files a/tools/eclipse/config_wizard/icons/chibios.gif and /dev/null differ diff --git a/tools/eclipse/config_wizard/icons/generate.gif b/tools/eclipse/config_wizard/icons/generate.gif deleted file mode 100644 index 55e2d04ad..000000000 Binary files a/tools/eclipse/config_wizard/icons/generate.gif and /dev/null differ diff --git a/tools/eclipse/config_wizard/icons/sample.gif b/tools/eclipse/config_wizard/icons/sample.gif deleted file mode 100644 index 34fb3c9d8..000000000 Binary files a/tools/eclipse/config_wizard/icons/sample.gif and /dev/null differ diff --git a/tools/eclipse/config_wizard/lib/bsh.jar b/tools/eclipse/config_wizard/lib/bsh.jar deleted file mode 100644 index 36fe03d71..000000000 Binary files a/tools/eclipse/config_wizard/lib/bsh.jar and /dev/null differ diff --git a/tools/eclipse/config_wizard/lib/fmpp.jar b/tools/eclipse/config_wizard/lib/fmpp.jar deleted file mode 100644 index 8cb8e6262..000000000 Binary files a/tools/eclipse/config_wizard/lib/fmpp.jar and /dev/null differ diff --git a/tools/eclipse/config_wizard/lib/freemarker.jar b/tools/eclipse/config_wizard/lib/freemarker.jar deleted file mode 100644 index b13671dac..000000000 Binary files a/tools/eclipse/config_wizard/lib/freemarker.jar and /dev/null differ diff --git a/tools/eclipse/config_wizard/lib/jdom-2.0.2.jar b/tools/eclipse/config_wizard/lib/jdom-2.0.2.jar deleted file mode 100644 index d540bad66..000000000 Binary files a/tools/eclipse/config_wizard/lib/jdom-2.0.2.jar and /dev/null differ diff --git a/tools/eclipse/config_wizard/lib/oro.jar b/tools/eclipse/config_wizard/lib/oro.jar deleted file mode 100644 index 23488d260..000000000 Binary files a/tools/eclipse/config_wizard/lib/oro.jar and /dev/null differ diff --git a/tools/eclipse/config_wizard/lib/resolver.jar b/tools/eclipse/config_wizard/lib/resolver.jar deleted file mode 100644 index 073d78967..000000000 Binary files a/tools/eclipse/config_wizard/lib/resolver.jar and /dev/null differ diff --git a/tools/eclipse/config_wizard/plugin.xml b/tools/eclipse/config_wizard/plugin.xml deleted file mode 100644 index d8c660eea..000000000 --- a/tools/eclipse/config_wizard/plugin.xml +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/resources/app_templates/c/template.xml b/tools/eclipse/config_wizard/resources/app_templates/c/template.xml deleted file mode 100644 index 9b2b51fdd..000000000 --- a/tools/eclipse/config_wizard/resources/app_templates/c/template.xml +++ /dev/null @@ -1,82 +0,0 @@ - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/lib/code_snippets.xml b/tools/eclipse/config_wizard/resources/gencfg/lib/code_snippets.xml deleted file mode 100644 index 2d0e5959a..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/lib/code_snippets.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - thread_body - Empty - - - - - thread_body - Checks for Termination - - - - - thread_body - Message Server - - - - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/lib/libcode.ftl b/tools/eclipse/config_wizard/resources/gencfg/lib/libcode.ftl deleted file mode 100644 index 45b94a320..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/lib/libcode.ftl +++ /dev/null @@ -1,316 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] - -<#-- - -- Coding style global settings. - --> -[#assign indentation = " " /] -[#assign fields_align = 24 /] -[#assign define_value_align = 36 /] -[#assign comments_align = 48 /] -[#assign boundary = 80 /] - -[#-- - -- This macro generates a brief description in DoxyGen format. - --] -[#macro EmitDoxygenBrief object=[]] - [#if object.brief[0]??] -[@utils.FormatStringAsText " * @brief " - " * " - utils.WithDot(object.brief[0]?cap_first) - boundary /] - [/#if] -[/#macro] - -[#-- - -- This macro generates a detailed description in DoxyGen format. - --] -[#macro EmitDoxygenDetails object=[]] - [#if object.details[0]??] -[@utils.FormatStringAsText " * @details " - " * " - utils.WithDot(object.details[0]?cap_first) - boundary /] - [/#if] -[/#macro] - -[#-- - -- This macro generates a notes list in DoxyGen format. - --] -[#macro EmitDoxygenNotes object=[]] - [#list object.* as note] - [#if note?node_name == "note"] - [@utils.FormatStringAsText " * @note " - " * " - utils.WithDot(note[0]?cap_first) - boundary /] - [/#if] - [/#list] -[/#macro] - -[#-- - -- This macro generates a pre-requisites list in DoxyGen format. - --] -[#macro EmitDoxygenPrerequisites object=[]] - [#list object.* as pre] - [#if pre?node_name == "pre"] - [@utils.FormatStringAsText " * @pre " - " * " - utils.WithDot(pre[0]?cap_first) - boundary /] - [/#if] - [/#list] -[/#macro] - -[#-- - -- This macro generates a post-requisites list in DoxyGen format. - --] -[#macro EmitDoxygenPostrequisites object=[]] - [#list object.* as post] - [#if post?node_name == "post"] - [@utils.FormatStringAsText " * @post " - " * " - utils.WithDot(post[0]?cap_first) - boundary /] - [/#if] - [/#list] -[/#macro] - -[#-- - -- This macro generates a complete Doxygen documentation comment. - --] -[#macro EmitDoxygenDocumentationComment object=[]] -/** - [@code.EmitDoxygenBrief object /] - [@code.EmitDoxygenDetails object /] - [@code.EmitDoxygenPrerequisites object /] - [@code.EmitDoxygenPostrequisites object /] - [@code.EmitDoxygenNotes object /] - */ -[/#macro] - -[#-- - -- This macro generates the parameters description in DoxyGen format. - --] -[#macro EmitDoxygenParams params=[]] - [#list params as param] - [#local name = (param.@name[0]!"no-name")?trim /] - [#local brief = (param.@brief[0]!"")?trim /] - [#local dir = (param.@dir[0]!"boh")?trim?lower_case /] - [#if dir == "in"] -[@utils.FormatStringAsText " * @param[in] " - " * " - utils.IntelligentDot(name + " " + brief?uncap_first) - boundary /] - [#elseif dir == "out"] -[@utils.FormatStringAsText " * @param[out] " - " * " - utils.IntelligentDot(name + " " + brief?uncap_first) - boundary /] - [#elseif dir == "both"] -[@utils.FormatStringAsText " * @param[in,out] " - " * " - utils.IntelligentDot(name + " " + brief?uncap_first) - boundary /] - [#elseif dir == "boh"] -[@utils.FormatStringAsText " * @param " - " * " - utils.IntelligentDot(name + " " + brief?uncap_first) - boundary /] - [/#if] - [/#list] -[/#macro] - -[#-- - -- This macro generates a return description followed by a retval list - -- in DoxyGen format. - --] -[#macro EmitDoxygenReturn return=[]] - [#if return[0]?? && ((return[0].@type[0]!"void")?trim != "void")] - [#local brief = (return[0].@brief[0]!"")?trim /] - [#if brief != ""] -[@utils.FormatStringAsText " * @return " - " * " - utils.WithDot(brief?cap_first) - boundary /] - [/#if] - [#list return[0].value as value] - [#local label = (value.@name[0]!"no-val")?trim /] - [#local brief = (value.@brief[0]!"")?trim /] -[@utils.FormatStringAsText " * @retval " - " * " - utils.WithDot(label + " " + brief?uncap_first) - boundary /] - [/#list] - [/#if] -[/#macro] - -[#-- - -- This macro generates the inner function code (if present). - --] -[#macro EmitCode code=[]] - [#if function.code[0]?? && (function.code[0]?trim != "")] -${indentation}${function.code[0]?trim} - [/#if] -[/#macro] - -[#-- - -- Returns true if the module exports some functions. - --] -[#function HasPublicFunctions module=[]] - [#local flag = false /] - [#list module.function as function] - [#if (function.@visibility[0]!"private") == "public"] - [#local flag = true /] - [/#if] - [/#list] - [#return flag /] -[/#function] - -[#-- - -- Returns true if the module has static functions. - --] -[#function HasPrivateFunctions module=[]] - [#local flag = false /] - [#list module.function as function] - [#if (function.@visibility[0]!"private") == "private"] - [#local flag = true /] - [/#if] - [/#list] - [#return flag /] -[/#function] - -[#-- - -- This macro generates a function prototype from an XML "function" - -- node passed as parameter. - -- @note Does not generate the final EOL. - --] -[#macro GeneratePrototype function={}] - [#if function.return?? && function.return[0]??] - [#local rettype = (function.return[0].@type[0]!"void")?trim /] - [#else] - [#local rettype = "void" /] - [/#if] - [#local name = (function.@name[0]!"no-name")?trim /] - [#local visibility = (function.@visibility[0]!"private")?trim /] - [#if function.param?? && function.param[0]??] - [#-- If the function has parameters then generates the parameters list --] - [#local l1 = rettype + " " + name + "(" /] - [#if visibility == "private"] - [#local l1 = "static " + l1 /] - [/#if] - [#local ln = ""?right_pad(l1?length) /] - [#list function.param as param] - [#local type = (param.@type[0]!"no-type")?trim /] - [#if type?contains("$")] - [#local pstring = type?replace("$", (param.@name[0]!"no-name")?trim) /] - [#else] - [#local pstring = type + " " + (param.@name[0]!"no-name")?trim /] - [/#if] - [#local dir = (param.@dir[0]!"boh")?trim?lower_case /] - [#if dir == "in"] - [#local pstring = "const " + pstring /] - [/#if] - [#if param_index == 0] - [#local line = l1 + pstring /] - [#else] - [#if (line + ", " + pstring + " ")?length > boundary] -${line + ","} - [#local line = ln + pstring /] - [#else] - [#local line = line + ", " + pstring /] - [/#if] - [/#if] - [/#list] -${line + ")"}[#rt] - [#else] -${rettype + " " + name}(void)[#rt] - [/#if] -[/#macro] - -[#-- - -- This macro generates a function (and its Doxygen documentation) - -- from an XML "function" node passed as parameter. - --] -[#macro GenerateFunction function={}] -/** -[@EmitDoxygenBrief function.@brief /] -[@EmitDoxygenDetails function.details /] -[@EmitDoxygenParams function.param /] -[@EmitDoxygenReturn function.return /] - * - * @note --Implementer notes here (or remove the tag)-- - * @bug --Known problems please here (or remove the tag)-- - * @todo --Implement this function (then remove the tag)-- - */ -[@GeneratePrototype function /] { - [#if function.code[0]??] - [#-- Makes sure to undef the do_code macro --] - [#assign inline = "[#ftl][#macro do_code function][/#macro]"?interpret /] -[@inline /] - [#-- Interprets the code within the code element --] - [#assign inline = function.code[0]?interpret /] -[@inline /] -[@do_code function /] - [#else] - -${indentation}/* ${function.@name[0]!"no-name"}() Implementation here! */ - [/#if] -} -[/#macro] - -[#-- - -- Generates the implementations for the private functions in the specified - -- module. - --] -[#macro GeneratePrivateFunctionsImplementations module] - [#list module.function as function] - [#if (function.@visibility[0]!"private") == "private"] -[@code.GenerateFunction function /] - - [/#if] - [/#list] -[/#macro] - -[#-- - -- Generates the prototypes of the public functions in the specified - -- module. - --] -[#macro GeneratePublicFunctionsPrototypes indentation module] - [#list module.function as function] - [#if (function.@visibility[0]!"private")?trim == "public"] -${indentation}[@code.GeneratePrototype function /]; - [/#if] - [/#list] -[/#macro] - -[#-- - -- Generates the implementations for the public functions in the specified - -- module. - --] -[#macro GeneratePublicFunctionsImplementations module] - [#list module.function as function] - [#if (function.@visibility[0]!"private") == "public"] -[@code.GenerateFunction function /] - - [/#if] - [/#list] -[/#macro] diff --git a/tools/eclipse/config_wizard/resources/gencfg/lib/liblicense.ftl b/tools/eclipse/config_wizard/resources/gencfg/lib/liblicense.ftl deleted file mode 100644 index 18581ee29..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/lib/liblicense.ftl +++ /dev/null @@ -1,58 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] - -[#-- - -- Emits the ChibiOS/RT standard license exception text. - -- The license exception text is indented by 4 spaces. - --] -[#macro EmitLicenseExceptionAsText] - - --- - - A special exception to the GPL can be applied should you wish to distribute - a combined work that includes ChibiOS/RT, without being obliged to provide - the source code for any proprietary components. See the file exception.txt - for full details of how and when the exception can be applied. -[/#macro] - -[#-- - -- Emits the ChibiOS/RT standard license text. - -- The license text is indented by 4 spaces. - --] -[#macro EmitLicenseAsText] - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -[/#macro] diff --git a/tools/eclipse/config_wizard/resources/gencfg/lib/libsnippets.ftl b/tools/eclipse/config_wizard/resources/gencfg/lib/libsnippets.ftl deleted file mode 100644 index a0680af04..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/lib/libsnippets.ftl +++ /dev/null @@ -1,33 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] - -[#-- - -- Find and return a code template from the templates archive. - --] -[#function GetThreadCode name] - [#list doc_snippets.code.snippets.snippet as snippet] - [#if (snippet.type[0] == "thread_body") && - ((snippet.name[0]!"")?trim?lower_case == name?trim?lower_case)] - [#return snippet.text[0]!"" /] - [/#if] - [/#list] - [#return "/* Thread style not found: " + name + " */" /] -[/#function] diff --git a/tools/eclipse/config_wizard/resources/gencfg/lib/libstm32f4xx.ftl b/tools/eclipse/config_wizard/resources/gencfg/lib/libstm32f4xx.ftl deleted file mode 100644 index 81b8f987c..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/lib/libstm32f4xx.ftl +++ /dev/null @@ -1,144 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] - -[#-- - -- Emits the STM32F4xx ADC driver constant configuration structures. - --] -[#macro EmitADCConfig config] - [#local cfg_name = config.name[0]?string /] - [@code.EmitDoxygenDocumentationComment config /] -const ADCConfig ${cfg_name} = {0}; - - [#list config.groups.group as group] - [#local grpcfg_name = group.name[0]?string /] - [@code.EmitDoxygenDocumentationComment group /] -const ADCGroupConfig ${grpcfg_name} = { - /* Circular conversion flag.*/ - ${group.circular[0]?string?upper_case}, - /* Number of channels sampled in the conversion group.*/ - ${group.channels_sequence.channel?size}, - /* End of conversion callback or NULL.*/ - [#if group.conv_callback[0]?string?trim == ""] - NULL, - [#else] - ${group.conv_callback[0]?string?trim}, - [/#if] - /* Error callback or NULL.*/ - [#if group.error_callback[0]?string?trim == ""] - NULL, - [#else] - ${group.error_callback[0]?string?trim}, - [/#if] - /* CR1 register initialization value.*/ - [#local resolution = group.resolution[0]?word_list[0]?number /] - [#local cr1 = "ADC_CR1_RESOLUTION_N(" + resolution?string + ")" /] - [#local disc = group.discontinuous[0]?word_list[0]?number /] - [#if disc > 0] - [#local cr1 = cr1 + " | ADC_CR1_DISCEN" /] - [#local cr1 = cr1 + " | ADC_CR1_DISCNUM_N(" + (disc - 1)?string + ")" /] - [/#if] - ${cr1}, - /* CR2 register initialization value.*/ - [#local exten = group.trigger_mode[0]?word_list[0]?number /] - [#local cr2 = "ADC_CR1_EXTEN_N(" + exten?string + ")" /] - [#local extsel = group.trigger_source[0]?word_list[0]?number /] - [#local cr2 = cr2 + " | ADC_CR1_EXSEL_N(" + extsel?string + ")" /] - [#if group.alignment[0]?word_list[0]?number != 0] - [#local cr2 = cr2 + " | ADC_CR2_ALIGN" /] - [/#if] - ${cr2}, - /* Channels sample time settings.*/ - [#local smpr1 = "" /] - [#local smpr2 = "" /] - [#list group.sample_time.* as input] - [#local sinput = input?node_name] - [#if input_index < 9] - [#local smpr2 = smpr2 + "ADC_SMPR2_SMP_" + input?node_name + - "(" + input?string + ") | " /] - [#elseif input_index == 9] - [#local smpr2 = smpr2 + "ADC_SMPR2_SMP_" + input?node_name + - "(" + input?string + ")," /] - [#elseif input_index < 18] - [#local smpr1 = smpr1 + "ADC_SMPR1_SMP_" + input?node_name + - "(" + input?string + ") | " /] - [#else] - [#local smpr1 = smpr1 + "ADC_SMPR1_SMP_" + input?node_name + - "(" + input?string + ")," /] - [/#if] - [/#list] - [@utils.FormatStringAsText " " " " smpr1 80 /] - [@utils.FormatStringAsText " " " " smpr2 80 /] - /* Channels sequence.*/ - [#local sqr1 = "ADC_SQR1_NUM_CH(" + group.channels_sequence?size + ")" /] - [#local sqr2 = "" /] - [#local sqr3 = "" /] - [#list group.channels_sequence.channel as channel] - [#if channel_index <= 5] - [#local sqr3 = sqr3 + "ADC_SQR3_SQ" + (channel_index + 1) + - "_N(" + channel + ")" /] - [#if channel_has_next && channel_index < 5] - [#local sqr3 = sqr3 + " | " /] - [/#if] - [#elseif channel_index <= 11] - [#local sqr2 = sqr2 + "ADC_SQR2_SQ" + (channel_index + 1) + - "_N(" + channel + ")" /] - [#if channel_has_next && channel_index < 11] - [#local sqr2 = sqr2 + " | " /] - [/#if] - [#else] - [#local sqr1 = sqr1 + " | ADC_SQR2_SQ" + (channel_index + 1) + - "_N(" + channel + ")" /] - [/#if] - [/#list] - [#-- SQR2 could be empty.--] - [#if sqr2 == ""] - [#local sqr2 = "0" /] - [/#if] - [#local sqr1 = sqr1 + "," /] - [#local sqr2 = sqr2 + "," /] - [@utils.FormatStringAsText " " " " sqr1 80 /] - [@utils.FormatStringAsText " " " " sqr2 80 /] - [@utils.FormatStringAsText " " " " sqr3 80 /] -}; - [/#list] -[/#macro] - -[#-- - -- Emits the STM32F4xx ADC driver configuration external declarations. - --] -[#macro EmitADCConfigExtern config] - [#local cfg_name = config.name[0]?string /] - [#list config.groups.group as group] - [#local grpcfg_name = group.name[0]?string /] - [#-- Only emits the comment if there is at least a callback defined.--] - /* ADC configuration "${cfg_name}".*/ - extern const ADCConfig ${cfg_name}; - /* ADC conversion group "${grpcfg_name}".*/ - extern const ADCGroupConfig ${grpcfg_name}; - [#if group.conv_callback[0]?string?trim != ""] - void ${group.conv_callback[0]?string?trim}(ADCDriver *, adcsample_t *, size_t); - [/#if] - [#if group.error_callback[0]?string?trim != ""] - void ${group.error_callback[0]?string?trim}(ADCDriver *, adcerror_t); - [/#if] - - [/#list] -[/#macro] diff --git a/tools/eclipse/config_wizard/resources/gencfg/lib/libutils.ftl b/tools/eclipse/config_wizard/resources/gencfg/lib/libutils.ftl deleted file mode 100644 index 03b0622a3..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/lib/libutils.ftl +++ /dev/null @@ -1,109 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] - -[#-- - -- Returns the trimmed text "s" making sure it is terminated by a dot. - -- The empty string is always returned as an empty string, the dot is not - -- added. - --] -[#function WithDot s] - [#local s = s?trim /] - [#if s == ""] - [#return s /] - [/#if] - [#if s?ends_with(".")] - [#return s /] - [/#if] - [#return s + "." /] -[/#function] - -[#-- - -- Returns the trimmed text "s" making sure it is not terminated by a dot. - --] -[#function WithoutDot s] - [#local s = s?trim /] - [#if s?ends_with(".")] - [#return s?substring(0, s?length - 2) /] - [/#if] - [#return s /] -[/#function] - -[#-- - -- Returns the trimmed text "s" making sure it is terminated by a dot if the - -- text is composed of multiple phrases, if the text is composed of a single - -- phrase then makes sure it is *not* terminated by a dot. - -- A phrase is recognized by the pattern ". " into the text. - -- The empty string is always returned as an empty string, the dot is never - -- added. - --] -[#function IntelligentDot s] - [#local s = s?trim /] - [#if s?contains(". ")] - [#return WithDot(s) /] - [/#if] - [#return WithoutDot(s) /] -[/#function] - -[#-- - -- Formats a text string in a sequence of strings no longer than "len" (first - -- line) or "lenn" (subsequent lines). - -- White spaces are normalized between words, sequences of white spaces become - -- a single space. - --] -[#function StringToText len1 lenn s] - [#local words=s?word_list /] - [#local line="" /] - [#local lines=[] /] - [#list words as word] - [#if lines?size == 0] - [#local len = len1 /] - [#else] - [#local len = lenn /] - [/#if] - [#if (line?length + word?length + 1 > len)] - [#local lines = lines + [line?trim] /] - [#local line = word + " " /] - [#else] - [#local line = line + word + " " /] - [/#if] - [/#list] - [#if line != ""] - [#local lines = lines + [line?trim] /] - [/#if] - [#return lines /] -[/#function] - -[#-- - -- Emits a string "s" as a formatted text, the first line is prefixed by the - -- "p1" parameter, subsequent lines are prefixed by the "pn" paramenter. - -- Emitted lines are no longer than the "len" parameter. - -- White spaces are normalized between words. - --] -[#macro FormatStringAsText p1 pn s len] - [#local lines = StringToText(len - p1?length, len - pn?length, s) /] - [#list lines as line] - [#if line_index == 0] -${p1}${line} - [#else] -${pn}${line} - [/#if] - [/#list] -[/#macro] diff --git a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f0xx/templates/board.c.ftl b/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f0xx/templates/board.c.ftl deleted file mode 100644 index 22510cb2b..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f0xx/templates/board.c.ftl +++ /dev/null @@ -1,101 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] -[@pp.dropOutputFile /] -[#import "/@lib/libutils.ftl" as utils /] -[#import "/@lib/liblicense.ftl" as license /] -[@pp.changeOutputFile name="board.c" /] -/* -[@license.EmitLicenseAsText /] -*/ - -#include "ch.h" -#include "hal.h" - -#if HAL_USE_PAL || defined(__DOXYGEN__) -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -const PALConfig pal_default_config = -{ - {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, - VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, - {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, - VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, - {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, - VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, - {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, - VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, - {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, - VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH} -}; -#endif - -/** - * @brief Early initialization code. - * @details This initialization must be performed just after stack setup - * and before any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); -[#if doc1.board.board_functions.__early_init[0]??] - ${doc1.board.board_functions.__early_init[0]} -[/#if] -} - -#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) -/** - * @brief MMC_SPI card detection. - */ -bool_t mmc_lld_is_card_inserted(MMCDriver *mmcp) { -[#if doc1.board.board_functions.mmc_lld_is_card_inserted[0]??] -${doc1.board.board_functions.mmc_lld_is_card_inserted[0]} -[#else] - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return TRUE; -[/#if] -} - -/** - * @brief MMC_SPI card write protection detection. - */ -bool_t mmc_lld_is_write_protected(MMCDriver *mmcp) { -[#if doc1.board.board_functions.mmc_lld_is_write_protected[0]??] -${doc1.board.board_functions.mmc_lld_is_write_protected[0]} -[#else] - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return FALSE; -[/#if] -} -#endif - -/** - * @brief Board-specific initialization code. - * @todo Add your board-specific code, if any. - */ -void boardInit(void) { -} diff --git a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f0xx/templates/board.h.ftl b/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f0xx/templates/board.h.ftl deleted file mode 100644 index 6eb360b6c..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f0xx/templates/board.h.ftl +++ /dev/null @@ -1,326 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] -[@pp.dropOutputFile /] -[#import "/@lib/libutils.ftl" as utils /] -[#import "/@lib/liblicense.ftl" as license /] -[@pp.changeOutputFile name="board.h" /] -/* -[@license.EmitLicenseAsText /] -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for ${doc1.board.board_name[0]} board. - */ - -/* - * Board identifier. - */ -#define BOARD_${doc1.board.board_id[0]} -#define BOARD_NAME "${doc1.board.board_name[0]}" - -[#if doc1.board.ethernet_phy[0]??] -/* - * Ethernet PHY type. - */ -#define BOARD_PHY_ID ${doc1.board.ethernet_phy.identifier[0]} -[#if doc1.board.ethernet_phy.bus_type[0]?string == "RMII"] -#define BOARD_PHY_RMII -[/#if] - -[/#if] -/* - * Board oscillators-related settings. -[#if doc1.board.clocks.@LSEFrequency[0]?number == 0] - * NOTE: LSE not fitted. -[/#if] -[#if doc1.board.clocks.@HSEFrequency[0]?number == 0] - * NOTE: HSE not fitted. -[/#if] - */ -#if !defined(STM32_LSECLK) -#define STM32_LSECLK ${doc1.board.clocks.@LSEFrequency[0]} -#endif - -[#if doc1.board.clocks.@LSEBypass[0]?string == "true"] -#define STM32_LSE_BYPASS - -[/#if] -#define STM32_LSEDRV (${doc1.board.clocks.@LSEDrive[0]?word_list[0]?number} << 3) - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK ${doc1.board.clocks.@HSEFrequency[0]} -#endif - -[#if doc1.board.clocks.@HSEBypass[0]?string == "true"] -#define STM32_HSE_BYPASS - -[/#if] -/* - * MCU type as defined in the ST header file stm32f0xx.h. - */ -#define STM32F0XX - -/* - * IO pins assignments. - */ -[#list doc1.board.ports.* as port] - [#assign port_name = port?node_name?upper_case /] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] -#define ${(port_name + "_" + name)?right_pad(27, " ")} ${pin_index?string} - [/#list] - -[/#list] -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * Please refer to the STM32 Reference Manual for details. - */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2)) -#define PIN_OSPEED_10M(n) (1U << ((n) * 2)) -#define PIN_OSPEED_40M(n) (3U << ((n) * 2)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2)) -#define PIN_AFIO_AF(n, v) ((v##U) << ((n % 8) * 4)) - -[#list doc1.board.ports.* as port] - [#assign port_name = port?node_name?upper_case /] -/* - * ${port_name} setup: - * - [#-- Generating pin descriptions inside the comment.--] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign mode = pin.@Mode[0] /] - [#assign type = pin.@Type[0] /] - [#assign resistor = pin.@Resistor[0] /] - [#assign speed = pin.@Speed[0] /] - [#assign alternate = pin.@Alternate[0] /] - [#if mode == "Input"] - [#assign desc = mode + " " + resistor /] - [#elseif mode == "Output"] - [#assign desc = mode + " " + type + " " + speed /] - [#elseif mode == "Alternate"] - [#assign desc = mode + " " + alternate /] - [#else] - [#assign desc = "Analog" /] - [/#if] - * P${(port?node_name[4..] + pin_index?string)?right_pad(3, " ")} - ${name?right_pad(26, " ")}(${desc?lower_case}). - [/#list] - */ - [#-- - -- Generating MODER register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign mode = pin.@Mode[0] /] - [#if mode == "Input"] - [#assign out = "PIN_MODE_INPUT(" + port_name + "_" + name + ")" /] - [#elseif mode == "Output"] - [#assign out = "PIN_MODE_OUTPUT(" + port_name + "_" + name + ")" /] - [#elseif mode == "Alternate"] - [#assign out = "PIN_MODE_ALTERNATE(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_MODE_ANALOG(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_MODER (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating OTYPER register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign type = pin.@Type[0] /] - [#if type == "PushPull"] - [#assign out = "PIN_OTYPE_PUSHPULL(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_OTYPE_OPENDRAIN(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_OTYPER (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating SPEEDR register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign speed = pin.@Speed[0] /] - [#if speed == "Minimum"] - [#assign out = "PIN_OSPEED_2M(" + port_name + "_" + name + ")" /] - [#elseif speed == "Low"] - [#assign out = "PIN_OSPEED_2M(" + port_name + "_" + name + ")" /] - [#elseif speed == "High"] - [#assign out = "PIN_OSPEED_10M(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_OSPEED_40M(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_OSPEEDR (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating PUPDR register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign resistor = pin.@Resistor[0] /] - [#if resistor == "Floating"] - [#assign out = "PIN_PUPDR_FLOATING(" + port_name + "_" + name + ")" /] - [#elseif resistor == "PullUp"] - [#assign out = "PIN_PUPDR_PULLUP(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_PUPDR_PULLDOWN(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_PUPDR (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating ODR register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign level = pin.@Level[0] /] - [#if level == "Low"] - [#assign out = "PIN_ODR_LOW(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_ODR_HIGH(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_ODR (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating AFRx registers values. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign alternate = pin.@Alternate[0]?trim /] - [#assign out = "PIN_AFIO_AF(" + port_name + "_" + name + ", " + alternate + ")" /] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_AFRL (" + out /] - [#elseif pin_index == 8] - [#assign line = "#define VAL_" + port_name + "_AFRH (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if (pin_index == 7) || (pin_index == 15)] -${line + ")"} - [#else] -${(line + " |")?right_pad(76, " ") + "\\"} - [/#if] - [/#list] - -[/#list] - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f0xx/templates/board.mk.ftl b/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f0xx/templates/board.mk.ftl deleted file mode 100644 index c88471ac3..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f0xx/templates/board.mk.ftl +++ /dev/null @@ -1,28 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] -[@pp.dropOutputFile /] -[#import "/@lib/libutils.ftl" as utils /] -[@pp.changeOutputFile name="board.mk" /] -# List of all the board related files. -BOARDSRC = ${'$'}{CHIBIOS}/boards/${doc1.board.board_id[0]}/board.c - -# Required include directories -BOARDINC = ${'$'}{CHIBIOS}/boards/${doc1.board.board_id[0]} diff --git a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f3xx/templates/board.c.ftl b/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f3xx/templates/board.c.ftl deleted file mode 100644 index 03a4df8c3..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f3xx/templates/board.c.ftl +++ /dev/null @@ -1,133 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] -[@pp.dropOutputFile /] -[#import "/@lib/libutils.ftl" as utils /] -[#import "/@lib/liblicense.ftl" as license /] -[@pp.changeOutputFile name="board.c" /] -/* -[@license.EmitLicenseAsText /] -*/ - -#include "ch.h" -#include "hal.h" - -#if HAL_USE_PAL || defined(__DOXYGEN__) -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -const PALConfig pal_default_config = -{ - {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, - VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, - {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, - VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, - {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, - VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, - {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, - VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, - {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, - VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, - {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, - VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH} -}; -#endif - -/** - * @brief Early initialization code. - * @details This initialization must be performed just after stack setup - * and before any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); -[#if doc1.board.board_functions.__early_init[0]??] - ${doc1.board.board_functions.__early_init[0]} -[/#if] -} - -#if HAL_USE_SDC || defined(__DOXYGEN__) -/** - * @brief SDC card detection. - */ -bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) { -[#if doc1.board.board_functions.sdc_lld_is_card_inserted[0]??] -${doc1.board.board_functions.sdc_lld_is_card_inserted[0]} -[#else] - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return TRUE; -[/#if] -} - -/** - * @brief SDC card write protection detection. - */ -bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) { -[#if doc1.board.board_functions.sdc_lld_is_write_protected[0]??] -${doc1.board.board_functions.sdc_lld_is_write_protected[0]} -[#else] - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return FALSE; -[/#if] -} -#endif /* HAL_USE_SDC */ - -#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) -/** - * @brief MMC_SPI card detection. - */ -bool_t mmc_lld_is_card_inserted(MMCDriver *mmcp) { -[#if doc1.board.board_functions.mmc_lld_is_card_inserted[0]??] -${doc1.board.board_functions.mmc_lld_is_card_inserted[0]} -[#else] - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return TRUE; -[/#if] -} - -/** - * @brief MMC_SPI card write protection detection. - */ -bool_t mmc_lld_is_write_protected(MMCDriver *mmcp) { -[#if doc1.board.board_functions.mmc_lld_is_write_protected[0]??] -${doc1.board.board_functions.mmc_lld_is_write_protected[0]} -[#else] - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return FALSE; -[/#if] -} -#endif - -/** - * @brief Board-specific initialization code. - * @todo Add your board-specific code, if any. - */ -void boardInit(void) { -} diff --git a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f3xx/templates/board.h.ftl b/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f3xx/templates/board.h.ftl deleted file mode 100644 index da8169026..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f3xx/templates/board.h.ftl +++ /dev/null @@ -1,327 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] -[@pp.dropOutputFile /] -[#import "/@lib/libutils.ftl" as utils /] -[#import "/@lib/liblicense.ftl" as license /] -[@pp.changeOutputFile name="board.h" /] -/* -[@license.EmitLicenseAsText /] -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for ${doc1.board.board_name[0]} board. - */ - -/* - * Board identifier. - */ -#define BOARD_${doc1.board.board_id[0]} -#define BOARD_NAME "${doc1.board.board_name[0]}" - -[#if doc1.board.ethernet_phy[0]??] -/* - * Ethernet PHY type. - */ -#define BOARD_PHY_ID ${doc1.board.ethernet_phy.identifier[0]} -[#if doc1.board.ethernet_phy.bus_type[0]?string == "RMII"] -#define BOARD_PHY_RMII -[/#if] - -[/#if] -/* - * Board oscillators-related settings. -[#if doc1.board.clocks.@LSEFrequency[0]?number == 0] - * NOTE: LSE not fitted. -[/#if] -[#if doc1.board.clocks.@HSEFrequency[0]?number == 0] - * NOTE: HSE not fitted. -[/#if] - */ -#if !defined(STM32_LSECLK) -#define STM32_LSECLK ${doc1.board.clocks.@LSEFrequency[0]} -#endif - -[#if doc1.board.clocks.@LSEBypass[0]?string == "true"] -#define STM32_LSE_BYPASS - -[/#if] -#define STM32_LSEDRV (${doc1.board.clocks.@LSEDrive[0]?word_list[0]?number} << 3) - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK ${doc1.board.clocks.@HSEFrequency[0]} -#endif - -[#if doc1.board.clocks.@HSEBypass[0]?string == "true"] -#define STM32_HSE_BYPASS - -[/#if] -/* - * MCU type as defined in the ST header file stm32f30x.h. - */ -#define STM32F30X - -/* - * IO pins assignments. - */ -[#list doc1.board.ports.* as port] - [#assign port_name = port?node_name?upper_case /] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] -#define ${(port_name + "_" + name)?right_pad(27, " ")} ${pin_index?string} - [/#list] - -[/#list] -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * Please refer to the STM32 Reference Manual for details. - */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2)) -#define PIN_AFIO_AF(n, v) ((v##U) << ((n % 8) * 4)) - -[#list doc1.board.ports.* as port] - [#assign port_name = port?node_name?upper_case /] -/* - * ${port_name} setup: - * - [#-- Generating pin descriptions inside the comment.--] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign mode = pin.@Mode[0] /] - [#assign type = pin.@Type[0] /] - [#assign resistor = pin.@Resistor[0] /] - [#assign speed = pin.@Speed[0] /] - [#assign alternate = pin.@Alternate[0] /] - [#if mode == "Input"] - [#assign desc = mode + " " + resistor /] - [#elseif mode == "Output"] - [#assign desc = mode + " " + type + " " + speed /] - [#elseif mode == "Alternate"] - [#assign desc = mode + " " + alternate /] - [#else] - [#assign desc = "Analog" /] - [/#if] - * P${(port?node_name[4..] + pin_index?string)?right_pad(3, " ")} - ${name?right_pad(26, " ")}(${desc?lower_case}). - [/#list] - */ - [#-- - -- Generating MODER register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign mode = pin.@Mode[0] /] - [#if mode == "Input"] - [#assign out = "PIN_MODE_INPUT(" + port_name + "_" + name + ")" /] - [#elseif mode == "Output"] - [#assign out = "PIN_MODE_OUTPUT(" + port_name + "_" + name + ")" /] - [#elseif mode == "Alternate"] - [#assign out = "PIN_MODE_ALTERNATE(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_MODE_ANALOG(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_MODER (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating OTYPER register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign type = pin.@Type[0] /] - [#if type == "PushPull"] - [#assign out = "PIN_OTYPE_PUSHPULL(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_OTYPE_OPENDRAIN(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_OTYPER (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating SPEEDR register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign speed = pin.@Speed[0] /] - [#if speed == "Minimum"] - [#assign out = "PIN_OSPEED_2M(" + port_name + "_" + name + ")" /] - [#elseif speed == "Low"] - [#assign out = "PIN_OSPEED_25M(" + port_name + "_" + name + ")" /] - [#elseif speed == "High"] - [#assign out = "PIN_OSPEED_50M(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_OSPEED_100M(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_OSPEEDR (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating PUPDR register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign resistor = pin.@Resistor[0] /] - [#if resistor == "Floating"] - [#assign out = "PIN_PUPDR_FLOATING(" + port_name + "_" + name + ")" /] - [#elseif resistor == "PullUp"] - [#assign out = "PIN_PUPDR_PULLUP(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_PUPDR_PULLDOWN(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_PUPDR (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating ODR register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign level = pin.@Level[0] /] - [#if level == "Low"] - [#assign out = "PIN_ODR_LOW(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_ODR_HIGH(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_ODR (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating AFRx registers values. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign alternate = pin.@Alternate[0]?trim /] - [#assign out = "PIN_AFIO_AF(" + port_name + "_" + name + ", " + alternate + ")" /] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_AFRL (" + out /] - [#elseif pin_index == 8] - [#assign line = "#define VAL_" + port_name + "_AFRH (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if (pin_index == 7) || (pin_index == 15)] -${line + ")"} - [#else] -${(line + " |")?right_pad(76, " ") + "\\"} - [/#if] - [/#list] - -[/#list] - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f3xx/templates/board.mk.ftl b/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f3xx/templates/board.mk.ftl deleted file mode 100644 index c88471ac3..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f3xx/templates/board.mk.ftl +++ /dev/null @@ -1,28 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] -[@pp.dropOutputFile /] -[#import "/@lib/libutils.ftl" as utils /] -[@pp.changeOutputFile name="board.mk" /] -# List of all the board related files. -BOARDSRC = ${'$'}{CHIBIOS}/boards/${doc1.board.board_id[0]}/board.c - -# Required include directories -BOARDINC = ${'$'}{CHIBIOS}/boards/${doc1.board.board_id[0]} diff --git a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f4xx/templates/board.c.ftl b/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f4xx/templates/board.c.ftl deleted file mode 100644 index f38fd106a..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f4xx/templates/board.c.ftl +++ /dev/null @@ -1,139 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] -[@pp.dropOutputFile /] -[#import "/@lib/libutils.ftl" as utils /] -[#import "/@lib/liblicense.ftl" as license /] -[@pp.changeOutputFile name="board.c" /] -/* -[@license.EmitLicenseAsText /] -*/ - -#include "ch.h" -#include "hal.h" - -#if HAL_USE_PAL || defined(__DOXYGEN__) -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -const PALConfig pal_default_config = -{ - {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, - VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, - {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, - VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, - {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, - VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, - {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, - VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, - {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, - VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, - {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, - VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, - {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, - VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, - {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, - VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, - {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, - VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} -}; -#endif - -/** - * @brief Early initialization code. - * @details This initialization must be performed just after stack setup - * and before any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); -[#if doc1.board.board_functions.__early_init[0]??] - ${doc1.board.board_functions.__early_init[0]} -[/#if] -} - -#if HAL_USE_SDC || defined(__DOXYGEN__) -/** - * @brief SDC card detection. - */ -bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) { -[#if doc1.board.board_functions.sdc_lld_is_card_inserted[0]??] -${doc1.board.board_functions.sdc_lld_is_card_inserted[0]} -[#else] - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return TRUE; -[/#if] -} - -/** - * @brief SDC card write protection detection. - */ -bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) { -[#if doc1.board.board_functions.sdc_lld_is_write_protected[0]??] -${doc1.board.board_functions.sdc_lld_is_write_protected[0]} -[#else] - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return FALSE; -[/#if] -} -#endif /* HAL_USE_SDC */ - -#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) -/** - * @brief MMC_SPI card detection. - */ -bool_t mmc_lld_is_card_inserted(MMCDriver *mmcp) { -[#if doc1.board.board_functions.mmc_lld_is_card_inserted[0]??] -${doc1.board.board_functions.mmc_lld_is_card_inserted[0]} -[#else] - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return TRUE; -[/#if] -} - -/** - * @brief MMC_SPI card write protection detection. - */ -bool_t mmc_lld_is_write_protected(MMCDriver *mmcp) { -[#if doc1.board.board_functions.mmc_lld_is_write_protected[0]??] -${doc1.board.board_functions.mmc_lld_is_write_protected[0]} -[#else] - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return FALSE; -[/#if] -} -#endif - -/** - * @brief Board-specific initialization code. - * @todo Add your board-specific code, if any. - */ -void boardInit(void) { -} diff --git a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f4xx/templates/board.h.ftl b/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f4xx/templates/board.h.ftl deleted file mode 100644 index c24c0a355..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f4xx/templates/board.h.ftl +++ /dev/null @@ -1,327 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] -[@pp.dropOutputFile /] -[#import "/@lib/libutils.ftl" as utils /] -[#import "/@lib/liblicense.ftl" as license /] -[@pp.changeOutputFile name="board.h" /] -/* -[@license.EmitLicenseAsText /] -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for ${doc1.board.board_name[0]} board. - */ - -/* - * Board identifier. - */ -#define BOARD_${doc1.board.board_id[0]} -#define BOARD_NAME "${doc1.board.board_name[0]}" - -[#if doc1.board.ethernet_phy[0]??] -/* - * Ethernet PHY type. - */ -#define BOARD_PHY_ID ${doc1.board.ethernet_phy.identifier[0]} -[#if doc1.board.ethernet_phy.bus_type[0]?string == "RMII"] -#define BOARD_PHY_RMII -[/#if] -[/#if] - -/* - * Board oscillators-related settings. -[#if doc1.board.clocks.@LSEFrequency[0]?number == 0] - * NOTE: LSE not fitted. -[/#if] -[#if doc1.board.clocks.@HSEFrequency[0]?number == 0] - * NOTE: HSE not fitted. -[/#if] - */ -#if !defined(STM32_LSECLK) -#define STM32_LSECLK ${doc1.board.clocks.@LSEFrequency[0]} -#endif - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK ${doc1.board.clocks.@HSEFrequency[0]} -#endif - -[#if doc1.board.clocks.@HSEBypass[0]?string == "true"] -#define STM32_HSE_BYPASS -[/#if] - -/* - * Board voltages. - * Required for performance limits calculation. - */ -#define STM32_VDD ${doc1.board.clocks.@VDD[0]} - -/* - * MCU type as defined in the ST header file stm32f4xx.h. - */ -#define STM32F4XX - -/* - * IO pins assignments. - */ -[#list doc1.board.ports.* as port] - [#assign port_name = port?node_name?upper_case /] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] -#define ${(port_name + "_" + name)?right_pad(27, " ")} ${pin_index?string} - [/#list] - -[/#list] -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * Please refer to the STM32 Reference Manual for details. - */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2)) -#define PIN_AFIO_AF(n, v) ((v##U) << ((n % 8) * 4)) - -[#list doc1.board.ports.* as port] - [#assign port_name = port?node_name?upper_case /] -/* - * ${port_name} setup: - * - [#-- Generating pin descriptions inside the comment.--] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign mode = pin.@Mode[0] /] - [#assign type = pin.@Type[0] /] - [#assign resistor = pin.@Resistor[0] /] - [#assign speed = pin.@Speed[0] /] - [#assign alternate = pin.@Alternate[0] /] - [#if mode == "Input"] - [#assign desc = mode + " " + resistor /] - [#elseif mode == "Output"] - [#assign desc = mode + " " + type + " " + speed /] - [#elseif mode == "Alternate"] - [#assign desc = mode + " " + alternate /] - [#else] - [#assign desc = "Analog" /] - [/#if] - * P${(port?node_name[4..] + pin_index?string)?right_pad(3, " ")} - ${name?right_pad(26, " ")}(${desc?lower_case}). - [/#list] - */ - [#-- - -- Generating MODER register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign mode = pin.@Mode[0] /] - [#if mode == "Input"] - [#assign out = "PIN_MODE_INPUT(" + port_name + "_" + name + ")" /] - [#elseif mode == "Output"] - [#assign out = "PIN_MODE_OUTPUT(" + port_name + "_" + name + ")" /] - [#elseif mode == "Alternate"] - [#assign out = "PIN_MODE_ALTERNATE(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_MODE_ANALOG(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_MODER (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating OTYPER register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign type = pin.@Type[0] /] - [#if type == "PushPull"] - [#assign out = "PIN_OTYPE_PUSHPULL(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_OTYPE_OPENDRAIN(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_OTYPER (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating SPEEDR register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign speed = pin.@Speed[0] /] - [#if speed == "Minimum"] - [#assign out = "PIN_OSPEED_2M(" + port_name + "_" + name + ")" /] - [#elseif speed == "Low"] - [#assign out = "PIN_OSPEED_25M(" + port_name + "_" + name + ")" /] - [#elseif speed == "High"] - [#assign out = "PIN_OSPEED_50M(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_OSPEED_100M(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_OSPEEDR (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating PUPDR register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign resistor = pin.@Resistor[0] /] - [#if resistor == "Floating"] - [#assign out = "PIN_PUPDR_FLOATING(" + port_name + "_" + name + ")" /] - [#elseif resistor == "PullUp"] - [#assign out = "PIN_PUPDR_PULLUP(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_PUPDR_PULLDOWN(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_PUPDR (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating ODR register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign level = pin.@Level[0] /] - [#if level == "Low"] - [#assign out = "PIN_ODR_LOW(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_ODR_HIGH(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_ODR (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating AFRx registers values. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign alternate = pin.@Alternate[0]?trim /] - [#assign out = "PIN_AFIO_AF(" + port_name + "_" + name + ", " + alternate + ")" /] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_AFRL (" + out /] - [#elseif pin_index == 8] - [#assign line = "#define VAL_" + port_name + "_AFRH (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if (pin_index == 7) || (pin_index == 15)] -${line + ")"} - [#else] -${(line + " |")?right_pad(76, " ") + "\\"} - [/#if] - [/#list] - -[/#list] - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f4xx/templates/board.mk.ftl b/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f4xx/templates/board.mk.ftl deleted file mode 100644 index c88471ac3..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32f4xx/templates/board.mk.ftl +++ /dev/null @@ -1,28 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] -[@pp.dropOutputFile /] -[#import "/@lib/libutils.ftl" as utils /] -[@pp.changeOutputFile name="board.mk" /] -# List of all the board related files. -BOARDSRC = ${'$'}{CHIBIOS}/boards/${doc1.board.board_id[0]}/board.c - -# Required include directories -BOARDINC = ${'$'}{CHIBIOS}/boards/${doc1.board.board_id[0]} diff --git a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32l1xx/templates/board.c.ftl b/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32l1xx/templates/board.c.ftl deleted file mode 100644 index b46be86a2..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32l1xx/templates/board.c.ftl +++ /dev/null @@ -1,133 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] -[@pp.dropOutputFile /] -[#import "/@lib/libutils.ftl" as utils /] -[#import "/@lib/liblicense.ftl" as license /] -[@pp.changeOutputFile name="board.c" /] -/* -[@license.EmitLicenseAsText /] -*/ - -#include "ch.h" -#include "hal.h" - -#if HAL_USE_PAL || defined(__DOXYGEN__) -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -const PALConfig pal_default_config = -{ - {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, - VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, - {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, - VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, - {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, - VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, - {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, - VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, - {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, - VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, - {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, - VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH} -}; -#endif - -/** - * @brief Early initialization code. - * @details This initialization must be performed just after stack setup - * and before any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); -[#if doc1.board.board_functions.__early_init[0]??] - ${doc1.board.board_functions.__early_init[0]} -[/#if] -} - -#if HAL_USE_SDC || defined(__DOXYGEN__) -/** - * @brief SDC card detection. - */ -bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) { -[#if doc1.board.board_functions.sdc_lld_is_card_inserted[0]??] -${doc1.board.board_functions.sdc_lld_is_card_inserted[0]} -[#else] - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return TRUE; -[/#if] -} - -/** - * @brief SDC card write protection detection. - */ -bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) { -[#if doc1.board.board_functions.sdc_lld_is_write_protected[0]??] -${doc1.board.board_functions.sdc_lld_is_write_protected[0]} -[#else] - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return FALSE; -[/#if] -} -#endif /* HAL_USE_SDC */ - -#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) -/** - * @brief MMC_SPI card detection. - */ -bool_t mmc_lld_is_card_inserted(MMCDriver *mmcp) { -[#if doc1.board.board_functions.mmc_lld_is_card_inserted[0]??] -${doc1.board.board_functions.mmc_lld_is_card_inserted[0]} -[#else] - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return TRUE; -[/#if] -} - -/** - * @brief MMC_SPI card write protection detection. - */ -bool_t mmc_lld_is_write_protected(MMCDriver *mmcp) { -[#if doc1.board.board_functions.mmc_lld_is_write_protected[0]??] -${doc1.board.board_functions.mmc_lld_is_write_protected[0]} -[#else] - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return FALSE; -[/#if] -} -#endif - -/** - * @brief Board-specific initialization code. - * @todo Add your board-specific code, if any. - */ -void boardInit(void) { -} diff --git a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32l1xx/templates/board.h.ftl b/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32l1xx/templates/board.h.ftl deleted file mode 100644 index 76db7eb27..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32l1xx/templates/board.h.ftl +++ /dev/null @@ -1,321 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] -[@pp.dropOutputFile /] -[#import "/@lib/libutils.ftl" as utils /] -[#import "/@lib/liblicense.ftl" as license /] -[@pp.changeOutputFile name="board.h" /] -/* -[@license.EmitLicenseAsText /] -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for ${doc1.board.board_name[0]} board. - */ - -/* - * Board identifier. - */ -#define BOARD_${doc1.board.board_id[0]} -#define BOARD_NAME "${doc1.board.board_name[0]}" - -[#if doc1.board.ethernet_phy[0]??] -/* - * Ethernet PHY type. - */ -#define BOARD_PHY_ID ${doc1.board.ethernet_phy.identifier[0]} -[#if doc1.board.ethernet_phy.bus_type[0]?string == "RMII"] -#define BOARD_PHY_RMII -[/#if] -[/#if] - -/* - * Board oscillators-related settings. -[#if doc1.board.clocks.@LSEFrequency[0]?number == 0] - * NOTE: LSE not fitted. -[/#if] -[#if doc1.board.clocks.@HSEFrequency[0]?number == 0] - * NOTE: HSE not fitted. -[/#if] - */ -#if !defined(STM32_LSECLK) -#define STM32_LSECLK ${doc1.board.clocks.@LSEFrequency[0]} -#endif - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK ${doc1.board.clocks.@HSEFrequency[0]} -#endif - -[#if doc1.board.clocks.@HSEBypass[0]?string == "true"] -#define STM32_HSE_BYPASS -[/#if] - -/* - * MCU type as defined in the ST header file stm32l1xx.h. - */ -#define STM32L1XX_MD - -/* - * IO pins assignments. - */ -[#list doc1.board.ports.* as port] - [#assign port_name = port?node_name?upper_case /] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] -#define ${(port_name + "_" + name)?right_pad(27, " ")} ${pin_index?string} - [/#list] - -[/#list] -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * Please refer to the STM32 Reference Manual for details. - */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_400K(n) (0U << ((n) * 2)) -#define PIN_OSPEED_2M(n) (1U << ((n) * 2)) -#define PIN_OSPEED_10M(n) (2U << ((n) * 2)) -#define PIN_OSPEED_40M(n) (3U << ((n) * 2)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2)) -#define PIN_AFIO_AF(n, v) ((v##U) << ((n % 8) * 4)) - -[#list doc1.board.ports.* as port] - [#assign port_name = port?node_name?upper_case /] -/* - * ${port_name} setup: - * - [#-- Generating pin descriptions inside the comment.--] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign mode = pin.@Mode[0] /] - [#assign type = pin.@Type[0] /] - [#assign resistor = pin.@Resistor[0] /] - [#assign speed = pin.@Speed[0] /] - [#assign alternate = pin.@Alternate[0] /] - [#if mode == "Input"] - [#assign desc = mode + " " + resistor /] - [#elseif mode == "Output"] - [#assign desc = mode + " " + type + " " + speed /] - [#elseif mode == "Alternate"] - [#assign desc = mode + " " + alternate /] - [#else] - [#assign desc = "Analog" /] - [/#if] - * P${(port?node_name[4..] + pin_index?string)?right_pad(3, " ")} - ${name?right_pad(26, " ")}(${desc?lower_case}). - [/#list] - */ - [#-- - -- Generating MODER register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign mode = pin.@Mode[0] /] - [#if mode == "Input"] - [#assign out = "PIN_MODE_INPUT(" + port_name + "_" + name + ")" /] - [#elseif mode == "Output"] - [#assign out = "PIN_MODE_OUTPUT(" + port_name + "_" + name + ")" /] - [#elseif mode == "Alternate"] - [#assign out = "PIN_MODE_ALTERNATE(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_MODE_ANALOG(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_MODER (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating OTYPER register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign type = pin.@Type[0] /] - [#if type == "PushPull"] - [#assign out = "PIN_OTYPE_PUSHPULL(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_OTYPE_OPENDRAIN(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_OTYPER (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating SPEEDR register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign speed = pin.@Speed[0] /] - [#if speed == "Minimum"] - [#assign out = "PIN_OSPEED_400K(" + port_name + "_" + name + ")" /] - [#elseif speed == "Low"] - [#assign out = "PIN_OSPEED_2M(" + port_name + "_" + name + ")" /] - [#elseif speed == "High"] - [#assign out = "PIN_OSPEED_10M(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_OSPEED_40M(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_OSPEEDR (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating PUPDR register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign resistor = pin.@Resistor[0] /] - [#if resistor == "Floating"] - [#assign out = "PIN_PUPDR_FLOATING(" + port_name + "_" + name + ")" /] - [#elseif resistor == "PullUp"] - [#assign out = "PIN_PUPDR_PULLUP(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_PUPDR_PULLDOWN(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_PUPDR (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating ODR register value. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign level = pin.@Level[0] /] - [#if level == "Low"] - [#assign out = "PIN_ODR_LOW(" + port_name + "_" + name + ")" /] - [#else] - [#assign out = "PIN_ODR_HIGH(" + port_name + "_" + name + ")" /] - [/#if] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_ODR (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if pin_index < 15] -${(line + " |")?right_pad(76, " ") + "\\"} - [#else] -${line + ")"} - [/#if] - [/#list] - [#-- - -- Generating AFRx registers values. - --] - [#list port.* as pin] - [#assign pin_name = pin?node_name?upper_case /] - [#assign name = pin.@ID[0]?string?trim /] - [#if name?length == 0] - [#assign name = pin_name /] - [/#if] - [#assign alternate = pin.@Alternate[0]?trim /] - [#assign out = "PIN_AFIO_AF(" + port_name + "_" + name + ", " + alternate + ")" /] - [#if pin_index == 0] - [#assign line = "#define VAL_" + port_name + "_AFRL (" + out /] - [#elseif pin_index == 8] - [#assign line = "#define VAL_" + port_name + "_AFRH (" + out /] - [#else] - [#assign line = " " + out /] - [/#if] - [#if (pin_index == 7) || (pin_index == 15)] -${line + ")"} - [#else] -${(line + " |")?right_pad(76, " ") + "\\"} - [/#if] - [/#list] - -[/#list] - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32l1xx/templates/board.mk.ftl b/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32l1xx/templates/board.mk.ftl deleted file mode 100644 index c88471ac3..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/processors/boards/stm32l1xx/templates/board.mk.ftl +++ /dev/null @@ -1,28 +0,0 @@ -[#ftl] -[#-- - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - --] -[@pp.dropOutputFile /] -[#import "/@lib/libutils.ftl" as utils /] -[@pp.changeOutputFile name="board.mk" /] -# List of all the board related files. -BOARDSRC = ${'$'}{CHIBIOS}/boards/${doc1.board.board_id[0]}/board.c - -# Required include directories -BOARDINC = ${'$'}{CHIBIOS}/boards/${doc1.board.board_id[0]} diff --git a/tools/eclipse/config_wizard/resources/gencfg/processors/processors.xml b/tools/eclipse/config_wizard/resources/gencfg/processors/processors.xml deleted file mode 100644 index b4998fd9a..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/processors/processors.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - STM32F0xx Board Configuration - resources/gencfg/processors/boards/stm32f0xx/templates - resources/gencfg/xml/stm32f0board.xml - board - - - STM32F3xx Board Configuration - resources/gencfg/processors/boards/stm32f3xx/templates - resources/gencfg/xml/stm32f3board.xml - board - - - STM32F4xx Board Configuration - resources/gencfg/processors/boards/stm32f4xx/templates - resources/gencfg/xml/stm32f4board.xml - board - - - STM32L1xx Board Configuration - resources/gencfg/processors/boards/stm32l1xx/templates - resources/gencfg/xml/stm32l1board.xml - board - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/schema/boards/abstract_board.xsd b/tools/eclipse/config_wizard/resources/gencfg/schema/boards/abstract_board.xsd deleted file mode 100644 index a1c696339..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/schema/boards/abstract_board.xsd +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32f0xx_board.xsd b/tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32f0xx_board.xsd deleted file mode 100644 index fb41cf6ea..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32f0xx_board.xsd +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32f3xx_board.xsd b/tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32f3xx_board.xsd deleted file mode 100644 index 74ad4d7ba..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32f3xx_board.xsd +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32f4xx_board.xsd b/tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32f4xx_board.xsd deleted file mode 100644 index f0d5a0a87..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32f4xx_board.xsd +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32l1xx_board.xsd b/tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32l1xx_board.xsd deleted file mode 100644 index 01350cc7c..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/schema/boards/stm32l1xx_board.xsd +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/schema/common/code_snippets.xsd b/tools/eclipse/config_wizard/resources/gencfg/schema/common/code_snippets.xsd deleted file mode 100644 index ad0bad11a..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/schema/common/code_snippets.xsd +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/schema/common/config_settings.xsd b/tools/eclipse/config_wizard/resources/gencfg/schema/common/config_settings.xsd deleted file mode 100644 index 45d228142..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/schema/common/config_settings.xsd +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - Templates resources associated to the configuration. - - - - - - - - - - - - Output directory relative to the configuration file. - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/schema/common/doc.xsd b/tools/eclipse/config_wizard/resources/gencfg/schema/common/doc.xsd deleted file mode 100644 index e5be361d5..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/schema/common/doc.xsd +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - >Generic item with optional name and brief - description - - - - - - Name of the object. - - - - - - - - - - - - - - - - >Something that can have a detailed description - attached - - - - - - - - - Brief description of the object. - - - - - - - - - - - - - - Object documentation as text, does not preserve - formatting. - - - - - - - - - - - - Object pre-requisites as text, does not preserve - formatting. - - - - - - - - - - - - Object post-requisites as text, does not preserve - formatting. - - - - - - - - - - - - Object note as text, does not preserve formatting. - - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/schema/common/stm32/stm32_gpiov2_port.xsd b/tools/eclipse/config_wizard/resources/gencfg/schema/common/stm32/stm32_gpiov2_port.xsd deleted file mode 100644 index c3ac59487..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/schema/common/stm32/stm32_gpiov2_port.xsd +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Object representing an STM32 pin for the GPIOv2 - peripheral. - - - - - Pin identifier, used to generate a #define with the - pin name. - - - - - - - - - - - - - - - - Pin mode, as defined for MODER register. - - - - - - - - - - - - - - Logic level for the ODR register. - - - - - - - - - - - - Pin speed as defined in SPEEDR register. - - - - - - - - - - - - - - - Pin type as defined in TYPER register. - - - - - - - - - - - - - Pin pull-up/down resistor as defined in PUDR register. - - - - - - - - - - - - - - Pin alternate function number, only valid if - "Alternate" is selected - in the Mode attribute. - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/xml/stm32f0board.xml b/tools/eclipse/config_wizard/resources/gencfg/xml/stm32f0board.xml deleted file mode 100644 index 843dfe925..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/xml/stm32f0board.xml +++ /dev/null @@ -1,669 +0,0 @@ - - - - - resources/gencfg/processors/boards/stm32f0xx/templates - . - - -----human readable board name----- - BOARD_IDENTIFIER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/xml/stm32f3board.xml b/tools/eclipse/config_wizard/resources/gencfg/xml/stm32f3board.xml deleted file mode 100644 index a552903be..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/xml/stm32f3board.xml +++ /dev/null @@ -1,797 +0,0 @@ - - - - - resources/gencfg/processors/boards/stm32f3xx/templates - . - - -----human readable board name----- - BOARD_IDENTIFIER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/xml/stm32f4board.xml b/tools/eclipse/config_wizard/resources/gencfg/xml/stm32f4board.xml deleted file mode 100644 index 66a09d0d6..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/xml/stm32f4board.xml +++ /dev/null @@ -1,1194 +0,0 @@ - - - - - resources/gencfg/processors/boards/stm32f4xx/templates - . - - -----human readable board name----- - BOARD_IDENTIFIER - - - MII_KS8721_ID - RMII - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/resources/gencfg/xml/stm32l1board.xml b/tools/eclipse/config_wizard/resources/gencfg/xml/stm32l1board.xml deleted file mode 100644 index 00e5b5319..000000000 --- a/tools/eclipse/config_wizard/resources/gencfg/xml/stm32l1board.xml +++ /dev/null @@ -1,799 +0,0 @@ - - - - - resources/gencfg/processors/boards/stm32l1xx/templates - . - - -----human readable board name----- - BOARD_IDENTIFIER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/config_wizard/src/config_wizard/Activator.java b/tools/eclipse/config_wizard/src/config_wizard/Activator.java deleted file mode 100644 index 1f62c4f62..000000000 --- a/tools/eclipse/config_wizard/src/config_wizard/Activator.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -package config_wizard; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.chibios.tools.eclipse.config"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext - * ) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext - * ) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - /** - * Returns an image descriptor for the image file at the given plug-in - * relative path - * - * @param path - * the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/handlers/CheckDescription.java b/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/handlers/CheckDescription.java deleted file mode 100644 index 0d7e7e292..000000000 --- a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/handlers/CheckDescription.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -package org.chibios.tools.eclipse.config.handlers; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.jface.dialogs.MessageDialog; - -/** - * Our sample handler extends AbstractHandler, an IHandler base class. - * @see org.eclipse.core.commands.IHandler - * @see org.eclipse.core.commands.AbstractHandler - */ -public class CheckDescription extends AbstractHandler { - - /** - * The constructor. - */ - public CheckDescription() { - } - - /** - * the command has been executed, so extract extract the needed information - * from the application context. - */ - public Object execute(ExecutionEvent event) throws ExecutionException { - IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); - MessageDialog.openInformation( - window.getShell(), - "ChibiOS-RT_Configuration_Support", - "Hello, Eclipse world"); - return null; - } -} diff --git a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/handlers/GenerateFiles.java b/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/handlers/GenerateFiles.java deleted file mode 100644 index aad5adfce..000000000 --- a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/handlers/GenerateFiles.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -package org.chibios.tools.eclipse.config.handlers; - -import java.io.File; -import java.io.IOException; - -import org.chibios.tools.eclipse.config.utils.TemplateEngine; -import org.chibios.tools.eclipse.config.utils.TemplateException; -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.jdom2.Document; -import org.jdom2.Element; -import org.jdom2.JDOMException; -import org.jdom2.input.SAXBuilder; -import org.osgi.framework.Bundle; - -import config_wizard.Activator; - -/** - * Our sample handler extends AbstractHandler, an IHandler base class. - * - * @see org.eclipse.core.commands.IHandler - * @see org.eclipse.core.commands.AbstractHandler - */ -public class GenerateFiles extends AbstractHandler { - - /** - * The constructor. - */ - public GenerateFiles() { - } - - /** - * the command has been executed, so extract extract the needed information - * from the application context. - */ - public Object execute(ExecutionEvent event) throws ExecutionException { - - IWorkbenchWindow window = HandlerUtil - .getActiveWorkbenchWindowChecked(event); - ISelection selection = window.getSelectionService().getSelection(); - if (selection instanceof IStructuredSelection) { - - /* Retrieves the full path of the configuration file. */ - IPath cfgfilepath = ((IFile)((IStructuredSelection)selection) - .getFirstElement()).getLocation(); - - /* DOM tree creation. */ - SAXBuilder builder = new SAXBuilder(); - Document document; - try { - document = builder.build(cfgfilepath.toFile()); - } catch (JDOMException e) { - return null; - } catch (IOException e) { - return null; - } - - /* Retrieving configuration settings info.*/ - Element settings = document.getRootElement().getChild("configuration_settings"); - String templates_path = settings.getChildText("templates_path"); - String output_path = settings.getChildText("output_path"); - - /* Calculating derived paths. */ - IPath tpath = new Path(templates_path); - try { - Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID); - tpath = new Path(FileLocator.toFileURL( - FileLocator.find(bundle, tpath, null)).getFile()); - } catch (IOException e) { - MessageDialog.openInformation(window.getShell(), "Path Error", - e.getMessage()); - return null; - } - - /* Templates execution. */ - try { - TemplateEngine.process(cfgfilepath.toFile(), - tpath.toFile(), - new File(output_path)); - } catch (TemplateException e) { - MessageDialog.openInformation(window.getShell(), "Processing Error", - e.getMessage()); - return null; - } - - /* Destination directory refresh.*/ - IContainer container = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(cfgfilepath).getParent(); - try { - container.refreshLocal(IResource.DEPTH_INFINITE, null); - } catch (CoreException e) { - e.printStackTrace(); - } - } - return null; - } -} diff --git a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/process/ApplicationGeneratorProcessRunner.java b/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/process/ApplicationGeneratorProcessRunner.java deleted file mode 100644 index e85442d81..000000000 --- a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/process/ApplicationGeneratorProcessRunner.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -package org.chibios.tools.eclipse.config.process; - -import org.eclipse.cdt.core.templateengine.TemplateCore; -import org.eclipse.cdt.core.templateengine.process.ProcessArgument; -import org.eclipse.cdt.core.templateengine.process.ProcessFailureException; -import org.eclipse.cdt.core.templateengine.process.ProcessRunner; -import org.eclipse.core.runtime.IProgressMonitor; - -public class ApplicationGeneratorProcessRunner extends ProcessRunner { - - @Override - public void process(TemplateCore template, ProcessArgument[] args, - String processId, IProgressMonitor monitor) - throws ProcessFailureException { - - } -} diff --git a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/utils/TemplateEngine.java b/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/utils/TemplateEngine.java deleted file mode 100644 index ce1e5325a..000000000 --- a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/utils/TemplateEngine.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -package org.chibios.tools.eclipse.config.utils; - -import java.io.IOException; -import java.util.HashMap; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsole; -import org.eclipse.ui.console.IConsoleConstants; -import org.eclipse.ui.console.IConsoleManager; -import org.eclipse.ui.console.IConsoleView; -import org.eclipse.ui.console.MessageConsole; -import org.eclipse.ui.console.MessageConsoleStream; -import org.osgi.framework.Bundle; -import org.w3c.dom.Document; -import org.xml.sax.SAXException; - -import config_wizard.Activator; - -import fmpp.Engine; -import fmpp.ProcessingException; -import fmpp.ProgressListener; -import fmpp.setting.SettingException; -import fmpp.setting.Settings; -import freemarker.ext.dom.NodeModel; -import freemarker.template.TemplateNodeModel; - -/** - * FMPP wrapper class. - */ -public class TemplateEngine { - - private final static String CONSOLE_NAME = "ChibiOS/RT Configuration Tool"; - - private final static Color DEFAULT_MESSAGE = new Color(Display.getDefault(), new RGB(0, 0, 255)); - private final static Color DEFAULT_OUTPUT = new Color(Display.getDefault(), new RGB(0, 0, 0)); - private final static Color DEFAULT_WARNING = new Color(Display.getDefault(), new RGB(255, 255, 0)); - private final static Color DEFAULT_ERROR = new Color(Display.getDefault(), new RGB(255, 0, 0)); - - private static Settings settings; - private static MessageConsoleStream msg; - private static MessageConsoleStream out; - private static MessageConsoleStream err; - private static MessageConsoleStream warn; - - /** - * Runs the templates engine. - * - * @param xmldata - * absolute path to XML data file - * @param sourcedir - * absolute path to templates directory - * @param outputdir - * output directory relative to xmldata - * - * @throws SettingException - * @throws ProcessingException - */ - public static void process(java.io.File xmldata, - java.io.File sourcedir, - java.io.File outputdir) throws TemplateException { - - /* Finds or creates a named console. */ - MessageConsole console = findConsole(CONSOLE_NAME); - activateConsole(console); - console.clearConsole(); - msg = console.newMessageStream(); - msg.setColor(DEFAULT_MESSAGE); - out = console.newMessageStream(); - out.setColor(DEFAULT_OUTPUT); - err = console.newMessageStream(); - err.setColor(DEFAULT_ERROR); - warn = console.newMessageStream(); - warn.setColor(DEFAULT_WARNING); - - /* - * Calculates the path for FTL libraries. - */ - IPath libpath = new Path("resources/gencfg/lib"); - Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID); - try { - libpath = new Path(FileLocator.toFileURL(FileLocator.find(bundle, libpath, null)).getFile()); - } - catch (IOException e1) { - err.println(": FTL libraries path not found."); - return; - } - - /* - * Instantiates the FMPP Settings engine and associates a listener for - * events to be logged. - */ - try { - settings = new Settings(xmldata.getParentFile()); - } catch (SettingException e) { - e.printStackTrace(); - return; - } - settings.addProgressListener(new ProgressListener() { - public void notifyProgressEvent(Engine engine, int event, - java.io.File src, int pMode, - java.lang.Throwable error, - java.lang.Object param) { - - if (error != null) { - err.println(": " + error.getMessage()); - return; - } - - if (pMode == Engine.PMODE_IGNORE) - return; - - switch (event) { - case EVENT_BEGIN_PROCESSING_SESSION: - msg.println("Starting session"); - msg.println(); - break; - case EVENT_END_PROCESSING_SESSION: - msg.println(); - msg.println("Finished"); - break; - case EVENT_BEGIN_FILE_PROCESSING: - out.println("> Processing " + src.getName()); - break; - case EVENT_END_FILE_PROCESSING: - break; - case EVENT_IGNORING_DIR: - out.println("> Ignoring directory " + src.getName()); - break; - case EVENT_SOURCE_NOT_MODIFIED: - out.println("> Skipping " + src.getName()); - break; - case EVENT_WARNING: - warn.println(": " + (String)param); - break; - } - } - }); - - /* Loading data model. */ - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - dbf.setValidating(false); - DocumentBuilder db; - try { - db = dbf.newDocumentBuilder(); - } catch (ParserConfigurationException e) { - throw new TemplateException(e.getMessage()); - } - Document dom1, dom_snippets; - try { - dom1 = db.parse(xmldata); - java.io.File xmlsnippets = libpath.addTrailingSeparator().append("code_snippets.xml").toFile(); - dom_snippets = db.parse(xmlsnippets); - } catch (SAXException e) { - throw new TemplateException(e.getMessage()); - } catch (IOException e) { - throw new TemplateException(e.getMessage()); - } - - NodeModel.removeComments(dom1); - NodeModel.mergeAdjacentText(dom1); - NodeModel.removeComments(dom_snippets); - TemplateNodeModel doc1 = NodeModel.wrap(dom1); - NodeModel.mergeAdjacentText(dom_snippets); - TemplateNodeModel doc_snippets = NodeModel.wrap(dom_snippets); - - HashMap xmls = new HashMap(); - xmls.put("doc1", doc1); - xmls.put("doc_snippets", doc_snippets); - - /* Setting libraries path. */ - HashMap libs = new HashMap(); - libs.put("lib", libpath.toString()); - - /* Other settings. */ - try { - settings.add("freemarkerLinks", libs); - settings.add("data", xmls); - settings.add("sourceRoot", sourcedir.toString()); - settings.add("outputRoot", outputdir.toString()); - settings.add("ignoreCvsFiles", true); - settings.add("ignoreSvnFiles", true); - } catch (SettingException e) { - throw new TemplateException(e.getMessage()); - } - - /* Processor execution. */ - try { - settings.execute(); - } catch (SettingException e) { - throw new TemplateException(e.getMessage()); - } catch (ProcessingException e) { - throw new TemplateException(e.getMessage()); - } - } - - private static MessageConsole findConsole(String name) { - ConsolePlugin plugin = ConsolePlugin.getDefault(); - IConsoleManager conMan = plugin.getConsoleManager(); - IConsole[] existing = conMan.getConsoles(); - for (int i = 0; i < existing.length; i++) - if (name.equals(existing[i].getName())) - return (MessageConsole) existing[i]; - - /* No console found, so create a new one. */ - MessageConsole myConsole = new MessageConsole(name, null); - conMan.addConsoles(new IConsole[] { myConsole }); - return myConsole; - } - - private static void activateConsole(MessageConsole console) { - IWorkbench wb = PlatformUI.getWorkbench(); - IWorkbenchWindow win = wb.getActiveWorkbenchWindow(); - IWorkbenchPage page = win.getActivePage(); - IConsoleView view; - try { - view = (IConsoleView) page.showView(IConsoleConstants.ID_CONSOLE_VIEW); - } catch (PartInitException e) { - e.printStackTrace(); - return; - } - view.display(console); - } -} diff --git a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/utils/TemplateException.java b/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/utils/TemplateException.java deleted file mode 100644 index 73746de1d..000000000 --- a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/utils/TemplateException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -package org.chibios.tools.eclipse.config.utils; - -public class TemplateException extends Exception { - - private static final long serialVersionUID = -3317410595937500925L; - - public TemplateException(String msg) { - super(msg); - } -} diff --git a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/ConfigurationNewWizard.java b/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/ConfigurationNewWizard.java deleted file mode 100644 index 28ee7e6e7..000000000 --- a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/ConfigurationNewWizard.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -package org.chibios.tools.eclipse.config.wizards; - -import java.lang.reflect.InvocationTargetException; -import java.io.*; - -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; -import org.eclipse.core.runtime.*; -import org.eclipse.jface.operation.*; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.ui.*; -import org.eclipse.ui.ide.IDE; -import org.osgi.framework.Bundle; - -import config_wizard.Activator; - -/** - * This is a sample new wizard. Its role is to create a new file resource in the - * provided container. If the container resource (a folder or a project) is - * selected in the workspace when the wizard is opened, it will accept it as the - * target container. The wizard creates one file with the extension "chcfg". If - * a sample multi-page editor (also available as a template) is registered for - * the same extension, it will be able to open it. - */ - -public class ConfigurationNewWizard extends Wizard implements INewWizard { - private ConfigurationNewWizardPage page; - private ISelection selection; - - private String containerName; - private String projectFileName; - private String defaultDataFile; - - /** - * Constructor for ConfigurationNewWizard. - */ - public ConfigurationNewWizard() { - super(); - setNeedsProgressMonitor(true); - } - - /** - * Adding the page to the wizard. - */ - public void addPages() { - page = new ConfigurationNewWizardPage(selection); - addPage(page); - } - - /** - * Checks if the wizard page allows to finish. - */ - public boolean canFinish() { - - return page.canFinish(); - } - - /** - * This method is called when 'Finish' button is pressed in the wizard. We - * will create an operation and run it using wizard as execution context. - */ - public boolean performFinish() { - - containerName = page.getContainerName(); - projectFileName = page.getProjectFileName(); - defaultDataFile = page.getDefaultDataFile(); - - IRunnableWithProgress op = new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) - throws InvocationTargetException { - try { - doFinish(monitor); - } catch (CoreException e) { - throw new InvocationTargetException(e); - } finally { - monitor.done(); - } - } - }; - try { - getContainer().run(true, false, op); - } catch (InterruptedException e) { - return false; - } catch (InvocationTargetException e) { - Throwable realException = e.getTargetException(); - MessageDialog.openError(getShell(), "Error", realException.getMessage()); - return false; - } - return true; - } - - /** - * The worker method. It will find the container, create the file if missing - * or just replace its contents, and open the editor on the newly created - * file. - */ - private void doFinish(IProgressMonitor monitor) throws CoreException { - - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IResource resource = root.findMember(new Path(containerName)); - if (!resource.exists() || !(resource instanceof IContainer)) { - throwCoreException("Container \"" + containerName + "\" does not exist."); - } - IContainer container = (IContainer)resource; - monitor.beginTask("Creating " + projectFileName, 3); - - /* Step #1, creates the project file.*/ - final IFile projectFile = container.getFile(new Path(projectFileName)); - Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID); - IPath path = new Path(defaultDataFile); - String s; - try { - s = FileLocator.toFileURL(FileLocator.find(bundle, path, null)).getFile(); - InputStream stream = new FileInputStream(s); - if (projectFile.exists()) { - projectFile.setContents(stream, true, true, monitor); - } else { - projectFile.create(stream, true, monitor); - } - stream.close(); - } catch (IOException e) { - } - monitor.worked(1); - - /* Step #2, opens the XML data file.*/ - monitor.setTaskName("Opening XML data file for editing..."); - getShell().getDisplay().asyncExec(new Runnable() { - public void run() { - IWorkbenchPage page = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getActivePage(); - try { - IDE.openEditor(page, projectFile, true); - } catch (PartInitException e) { - } - } - }); - monitor.worked(1); - - /* Step #3, refreshing local resources.*/ - container.refreshLocal(IResource.DEPTH_INFINITE, monitor); - monitor.worked(1); - } - - private void throwCoreException(String message) throws CoreException { - IStatus status = new Status(IStatus.ERROR, - "org.chibios.tools.eclipse.config", IStatus.OK, - message, null); - throw new CoreException(status); - } - - /** - * We will accept the selection in the workbench to see if we can initialize - * from it. - * - * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection) - */ - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.selection = selection; - } -} diff --git a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/ConfigurationNewWizardPage.java b/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/ConfigurationNewWizardPage.java deleted file mode 100644 index d503d9748..000000000 --- a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/ConfigurationNewWizardPage.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -package org.chibios.tools.eclipse.config.wizards; - -import java.io.IOException; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.Combo; - -import org.osgi.framework.Bundle; - -import org.jdom2.Document; -import org.jdom2.Element; -import org.jdom2.JDOMException; -import org.jdom2.input.SAXBuilder; - -import config_wizard.Activator; - -/** - * The "New" wizard page allows setting the container for the new file as well - * as the file name. The page will only accept file name without the extension - * OR with the extension that matches the expected one (chcfg). - */ - -public class ConfigurationNewWizardPage extends WizardPage { - - private ISelection selection; - private IContainer resourceContainer; - - private Document processorsDocument; - private String currentDefaultDataFile; - - private Composite container; - private Combo configurationTemplatesCombo; - private Text confProjectFilenameText; - - /** - * Constructor for SampleNewWizardPage. - */ - public ConfigurationNewWizardPage(ISelection selection) { - - super("wizardPage"); - setTitle("ChibiOS/RT Configuration Project File"); - setDescription("This wizard creates a ChibiOS/RT configuration resource. Configuration resources allow to generate project resources starting from high level descriptions written in XML."); - this.selection = selection; - } - - /** - * @see IDialogPage#createControl(Composite) - */ - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - layout.verticalSpacing = 9; - - Label lbl1 = new Label(container, SWT.NULL); - lbl1.setText("Configuration template:"); - - configurationTemplatesCombo = new Combo(container, SWT.READ_ONLY); - configurationTemplatesCombo.setLayoutData(new GridData(SWT.FILL, - SWT.CENTER, true, - false, 1, 1)); - - Label lbl2 = new Label(container, SWT.NULL); - lbl2.setText("Configuration project filename:"); - - confProjectFilenameText = new Text(container, SWT.BORDER | SWT.SINGLE); - confProjectFilenameText.setText("config.chcfg"); - confProjectFilenameText - .setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - confProjectFilenameText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - confProjectFilenameUpdated(); - } - }); - - /* Note, it must stay after the creation of the text fields. */ - configurationTemplatesCombo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - Element processor = getSelectedTemplate(); - String basefilename = processor.getChildText("basefilename"); - confProjectFilenameText.setText(basefilename.concat(".chcfg")); - currentDefaultDataFile = processor.getChildText("default"); - } - }); - - initialize(); - setControl(container); - } - - public String getContainerName() { - - return resourceContainer.getFullPath().toString(); - } - - public String getProjectFileName() { - - return confProjectFilenameText.getText(); - } - - public String getDefaultDataFile() { - - return currentDefaultDataFile; - } - - public boolean canFinish() { - - return container.getEnabled(); - } - - /** - * Tests if the current workbench selection is a suitable container to use. - */ - private void initialize() { - - if (selection != null && selection.isEmpty() == false - && selection instanceof IStructuredSelection) { - IStructuredSelection ssel = (IStructuredSelection) selection; - if (ssel.size() > 1) - return; - Object obj = ssel.getFirstElement(); - if (obj instanceof IResource) { - if (obj instanceof IContainer) - resourceContainer = (IContainer) obj; - else - resourceContainer = ((IResource) obj).getParent(); - } - } - else { - MessageDialog.openError(getShell(), - "Error", "Container for the resource not selected."); - container.setEnabled(false); - updateStatus("Container for the resource not selected."); - } - - /* Retrieving the resource path of the processors.xml file. */ - String fpath; - try { - Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID); - IPath path = new Path("resources/gencfg/processors/processors.xml"); - fpath = FileLocator.toFileURL(FileLocator.find(bundle, path, null)) - .getFile(); - } catch (IOException e) { - e.printStackTrace(); - return; - } - - /* DOM tree creation. */ - SAXBuilder builder = new SAXBuilder(); - try { - processorsDocument = builder.build(fpath); - } catch (JDOMException e) { - e.printStackTrace(); - return; - } catch (IOException e) { - e.printStackTrace(); - return; - } - - /* Parsing the content of the processors.xml file in order to populate the - panel objects.*/ - Element root = processorsDocument.getRootElement(); - for (Element processor : root.getChildren("processor")) { - String name = processor.getChildText("name"); - configurationTemplatesCombo.add(name); - } - configurationTemplatesCombo.select(0); - } - - /** - * Checks the content of the confProjectFilenameText field. - */ - private void confProjectFilenameUpdated() { - String fileName = getProjectFileName(); - - if (fileName.length() == 0) { - updateStatus("File name must be specified"); - return; - } - if (fileName.replace('\\', '/').indexOf('/', 1) > 0) { - updateStatus("File name must be valid"); - return; - } - int dotLoc = fileName.lastIndexOf('.'); - if (dotLoc != -1) { - String ext = fileName.substring(dotLoc + 1); - if (ext.equalsIgnoreCase("chcfg") == false) { - updateStatus("Configuration project filename extension must be \"chcfg\""); - return; - } - } - updateStatus(null); - } - - /** - * Returns the XML Element associated to the current selection in the combo - * box. - * - * @return An Element Object. - */ - private Element getSelectedTemplate() { - - for (Element processor : processorsDocument.getRootElement() - .getChildren("processor")) { - String name = processor.getChildText("name"); - String item = configurationTemplatesCombo - .getItem(configurationTemplatesCombo.getSelectionIndex()); - if (name.compareTo(item) == 0) { - return processor; - } - } - return null; - } - - /** - * Updates the status text in the Wizard page. - * - * @param message - * the message to be shown - */ - private void updateStatus(String message) { - - setErrorMessage(message); - setPageComplete(message == null); - } -} diff --git a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/NewApplicationProjectWizard.java b/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/NewApplicationProjectWizard.java deleted file mode 100644 index b94df01cc..000000000 --- a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/NewApplicationProjectWizard.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -package org.chibios.tools.eclipse.config.wizards; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.settings.model.ICProjectDescription; -import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager; -import org.eclipse.cdt.core.settings.model.extension.CConfigurationData; -import org.eclipse.cdt.managedbuilder.core.IBuilder; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.internal.core.Configuration; -import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; - -@SuppressWarnings("restriction") -public class NewApplicationProjectWizard extends Wizard implements INewWizard { - - private NewApplicationProjectWizardPage page; - private ISelection selection; - - private String projectName; - private String finalProjectPath; - private String platform; - - /** - * Constructor for ConfigurationNewWizard. - */ - public NewApplicationProjectWizard() { - super(); - setNeedsProgressMonitor(true); - } - - /** - * Adding the page to the wizard. - */ - public void addPages() { - page = new NewApplicationProjectWizardPage(selection); - addPage(page); - } - - @Override - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.selection = selection; - } - - @Override - public boolean performFinish() { - - projectName = page.getProjectName(); - finalProjectPath = page.getFinalProjectPath(); - platform = page.getPlatform(); - - IRunnableWithProgress op = new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) - throws InvocationTargetException { - try { - doFinish(monitor); - } - catch (CoreException e) { - throw new InvocationTargetException(e); - } - finally { - monitor.done(); - } - } - }; - try { - getContainer().run(true, false, op); - } - catch (InterruptedException e) { - return false; - } - catch (InvocationTargetException e) { - Throwable realException = e.getTargetException(); - MessageDialog.openError(getShell(), "Error", realException.getMessage()); - return false; - } - return true; - } - - /** - * The worker method. It will find the container, create the file if missing - * or just replace its contents, and open the editor on the newly created - * file. - */ - private void doFinish(IProgressMonitor monitor) throws CoreException { - - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IWorkspaceRoot root = workspace.getRoot(); - - monitor.beginTask("Creating " + projectName, 3); - - /* Step #1, creates the project file.*/ - IProject project = root.getProject(projectName); - if (project.exists()) { - monitor.done(); - MessageDialog.openError(getShell(), "Error", "Project " + projectName + - " already exists in workspace"); - return; - } - - IProjectDescription desc = project.getWorkspace().newProjectDescription(projectName); - if (finalProjectPath != null) - desc.setLocation(new Path(finalProjectPath)); - project.create(desc, null); - - /* Step #2, makes it a CDT project.*/ - desc = workspace.newProjectDescription(projectName); - project = CCorePlugin.getDefault().createCDTProject(desc, project, null); - - ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager(); - ICProjectDescription cdesc = mngr.createProjectDescription(project, false); - ManagedProject mproject = new ManagedProject(cdesc); - Configuration cfg = new Configuration(mproject, null, "Default", "Default"); - IBuilder bld = cfg.getEditableBuilder(); - bld.setManagedBuildOn(false); - CConfigurationData data = cfg.getConfigurationData(); - cdesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data); - - mngr.setProjectDescription(project, cdesc); - monitor.worked(1); - } -} diff --git a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/NewApplicationProjectWizardPage.java b/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/NewApplicationProjectWizardPage.java deleted file mode 100644 index b2daabeac..000000000 --- a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/wizards/NewApplicationProjectWizardPage.java +++ /dev/null @@ -1,312 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -package org.chibios.tools.eclipse.config.wizards; - -import java.io.File; -import java.io.IOException; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.widgets.Combo; - -import org.jdom2.Document; -import org.jdom2.Element; -import org.jdom2.JDOMException; -import org.jdom2.input.SAXBuilder; -import org.osgi.framework.Bundle; - -import config_wizard.Activator; - -public class NewApplicationProjectWizardPage extends WizardPage { - - private Composite container; - private Text projectParentPathText; - private Button btnBrowse; - private Label lbl1; - private Text projectNameText; - private Button useCustomPathButton; - private Label lbl3; - private Text projectFinalPathText; - private Label lbl4; - private Combo platformCombo; - - /** - * Constructor for SampleNewWizardPage. - */ - public NewApplicationProjectWizardPage(ISelection selection) { - - super("wizardPage"); - setTitle("ChibiOS/RT New Application Project Wizard"); - setDescription("This wizard creates a new ChibiOS/RT application project."); - } - - /** - * @see IDialogPage#createControl(Composite) - */ - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 3; - layout.verticalSpacing = 9; - - /* Layout row 1.*/ - lbl1 = new Label(container, SWT.NONE); - lbl1.setText("Project name:"); - projectNameText = new Text(container, SWT.BORDER); - projectNameText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - projectPageUpdated(); - } - }); - projectNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); - new Label(container, SWT.NONE); - - /* Layout row 2.*/ - useCustomPathButton = new Button(container, SWT.CHECK); - useCustomPathButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (useCustomPathButton.getSelection()) { - projectParentPathText.setText(ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()); - projectParentPathText.setEnabled(false); - btnBrowse.setEnabled(false); - updateFinalProjectPathText(); - } - else { - projectParentPathText.setText(ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()); - projectParentPathText.setEnabled(true); - btnBrowse.setEnabled(true); - updateFinalProjectPathText(); - } - } - }); - useCustomPathButton.setText("Use default location"); - new Label(container, SWT.NONE); - new Label(container, SWT.NONE); - - /* Layout row 3.*/ - Label lbl2 = new Label(container, SWT.NULL); - lbl2.setText("Project parent path:"); - projectParentPathText = new Text(container, SWT.BORDER | SWT.SINGLE); - projectParentPathText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - projectPageUpdated(); - } - }); - projectParentPathText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - btnBrowse = new Button(container, SWT.NONE); - btnBrowse.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - /* Prompts the user for a parent directory for the new project.*/ - DirectoryDialog dlg = new DirectoryDialog(getShell()); - dlg.setFilterPath(projectParentPathText.getText()); - dlg.setText("New ChibiOS/RT Project"); - dlg.setMessage("Select the parent directory for the new ChibiOS/RT application project."); - String parent = dlg.open(); - if (parent != null) { - projectParentPathText.setText(parent); - projectPageUpdated(); - } - } - }); - btnBrowse.setText("Browse..."); - - /* Layout row 4.*/ - lbl3 = new Label(container, SWT.NONE); - lbl3.setText("Final project path:"); - projectFinalPathText = new Text(container, SWT.BORDER); - projectFinalPathText.setEditable(false); - projectFinalPathText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); - new Label(container, SWT.NONE); - - /* Layout row 5.*/ - lbl4 = new Label(container, SWT.NONE); - lbl4.setText("Target platform:"); - platformCombo = new Combo(container, SWT.READ_ONLY); - platformCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); - new Label(container, SWT.NONE); - - initialize(); - setControl(container); - } - - /** - * Tests if the current workbench selection is a suitable container to use. - */ - private void initialize() { - - /* Initial state of the check box and project path text.*/ - useCustomPathButton.setSelection(true); - projectParentPathText.setText(ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()); - projectParentPathText.setEnabled(false); - btnBrowse.setEnabled(false); - - /* Retrieving the resource path of the processors.xml file. */ - String fpath; - try { - Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID); - IPath path = new Path("resources/gencfg/processors/processors.xml"); - fpath = FileLocator.toFileURL(FileLocator.find(bundle, path, null)).getFile(); - } catch (IOException e) { - e.printStackTrace(); - return; - } - - /* DOM tree creation. */ - SAXBuilder builder = new SAXBuilder(); - Document document; - try { - document = builder.build(fpath); - } catch (JDOMException e) { - e.printStackTrace(); - return; - } catch (IOException e) { - e.printStackTrace(); - return; - } - - /* Parsing the content of the processors.xml file in order to populate the - panel objects.*/ - Element root = document.getRootElement(); - for (Element processor : root.getChildren("processor")) { - String class_attr = processor.getAttributeValue("class", ""); - if (class_attr.compareToIgnoreCase("build") == 0) { - String name = processor.getAttributeValue("target", "internal error"); - platformCombo.add(name); - } - } - platformCombo.select(0); - - /* Update checks on the fields.*/ - projectPageUpdated(); - - /* Focus on the first editable field.*/ - projectNameText.setFocus(); - } - - public String getProjectName() { - - return projectNameText.getText(); - } - - public String getProjectParentPath() { - - return projectParentPathText.getText(); - } - - public String getFinalProjectPath() { - - if (useCustomPathButton.getSelection()) - return null; - return projectFinalPathText.getText(); - } - - public String getPlatform() { - - return platformCombo.getText(); - } - - private void projectPageUpdated() { - - updateFinalProjectPathText(); - - /* Checks the project location.*/ - File path = new File(projectParentPathText.getText()); - if (!path.exists()) { - updateStatus("Project path is not valid."); - return; - } - if (!path.isDirectory()) { - updateStatus("Project path is a directory."); - return; - } - - /* Checks the project name.*/ - String name = projectNameText.getText(); - if (!isValidFilename(name)) { - updateStatus("Invalid project name."); - return; - } - - /* Checks if the project already exists in the workspace.*/ - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); - if (project.exists()) { - updateStatus("Project exists."); - return; - } - - updateStatus(null); - } - - /** - * Updates the status text in the Wizard page. - * - * @param message - * the message to be shown - */ - private void updateStatus(String message) { - - setErrorMessage(message); - setPageComplete(message == null); - } - - private void updateFinalProjectPathText() { - - IPath parent = new Path(projectParentPathText.getText()); - IPath project = parent.addTrailingSeparator().append(projectNameText.getText()); - projectFinalPathText.setText(project.toString()); - } - - private boolean isValidFilename(String name) { - - if (name.length() == 0) - return false; - if ((name.indexOf("`") >= 0) || (name.indexOf("?") >= 0) || - (name.indexOf("*") >= 0) || (name.indexOf("<") >= 0) || - (name.indexOf(">") >= 0) || (name.indexOf("|") >= 0) || - (name.indexOf("\"") >= 0) || (name.indexOf(":") >= 0) || - (name.indexOf("#") >= 0) || (name.indexOf("\\") >= 0) || - (name.indexOf("/") >= 0) || (name.indexOf("|") >= 0)) - return false; - return true; - } -} -- cgit v1.2.3