aboutsummaryrefslogtreecommitdiffstats
path: root/tools/eclipse/config_wizard/resources/gencfg
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-08-08 16:45:56 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-08-08 16:45:56 +0000
commit4bdc2322a82279051981716284f145965321ba07 (patch)
tree7119ac6ea336975ec65e416db9d51f847b89b6bc /tools/eclipse/config_wizard/resources/gencfg
parentecc767386f69585107ce4678c2cb0ab01bd4145a (diff)
downloadChibiOS-4bdc2322a82279051981716284f145965321ba07.tar.gz
ChibiOS-4bdc2322a82279051981716284f145965321ba07.tar.bz2
ChibiOS-4bdc2322a82279051981716284f145965321ba07.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4543 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'tools/eclipse/config_wizard/resources/gencfg')
-rw-r--r--tools/eclipse/config_wizard/resources/gencfg/lib/code_snippets.xml50
-rw-r--r--tools/eclipse/config_wizard/resources/gencfg/lib/libsnippets.ftl33
-rw-r--r--tools/eclipse/config_wizard/resources/gencfg/processors/processors.xml24
-rw-r--r--tools/eclipse/config_wizard/resources/gencfg/schema/common/code_snippets.xsd59
4 files changed, 163 insertions, 3 deletions
diff --git a/tools/eclipse/config_wizard/resources/gencfg/lib/code_snippets.xml b/tools/eclipse/config_wizard/resources/gencfg/lib/code_snippets.xml
new file mode 100644
index 000000000..2d0e5959a
--- /dev/null
+++ b/tools/eclipse/config_wizard/resources/gencfg/lib/code_snippets.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Code Templates -->
+<code
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/common/code_snippets.xsd">
+ <snippets>
+ <snippet>
+ <type>thread_body</type>
+ <name>Empty</name>
+<text><![CDATA[[#ftl]
+[#macro do_code function]
+
+ return 0;
+[/#macro]]]>
+</text>
+ </snippet>
+ <snippet>
+ <type>thread_body</type>
+ <name>Checks for Termination</name>
+<text><![CDATA[[#ftl]
+[#ftl]
+[#macro do_code function]
+
+ while (!chThdShouldTerminate()) {
+ /* Thread activity here. */
+ }
+ return 0;
+[/#macro]]]>
+</text>
+ </snippet>
+ <snippet>
+ <type>thread_body</type>
+ <name>Message Server</name>
+<text><![CDATA[[#ftl]
+[#ftl]
+[#macro do_code function]
+
+ while(TRUE) {
+ msg_t msg, response;
+
+ msg = chMsgWait();
+ /* Process the message here then prepare a response. */
+ chMsgRelease(response);
+ }
+ return 0;
+[/#macro]]]>
+</text>
+ </snippet>
+ </snippets>
+</code>
diff --git a/tools/eclipse/config_wizard/resources/gencfg/lib/libsnippets.ftl b/tools/eclipse/config_wizard/resources/gencfg/lib/libsnippets.ftl
new file mode 100644
index 000000000..a0680af04
--- /dev/null
+++ b/tools/eclipse/config_wizard/resources/gencfg/lib/libsnippets.ftl
@@ -0,0 +1,33 @@
+[#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 <http://www.gnu.org/licenses/>.
+ --]
+
+[#--
+ -- 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/processors/processors.xml b/tools/eclipse/config_wizard/resources/gencfg/processors/processors.xml
index 6dba55fcd..30a70c069 100644
--- a/tools/eclipse/config_wizard/resources/gencfg/processors/processors.xml
+++ b/tools/eclipse/config_wizard/resources/gencfg/processors/processors.xml
@@ -1,20 +1,38 @@
<processors>
- <processor>
+ <processor class="board" target="STM32F0xx">
<name>STM32F0xx Board Configuration</name>
<path>resources/gencfg/processors/boards/stm32f0xx/templates</path>
<default>resources/gencfg/xml/stm32f0board.xml</default>
<basefilename>board</basefilename>
</processor>
- <processor>
+ <processor class="board" target="STM32F4xx">
<name>STM32F4xx Board Configuration</name>
<path>resources/gencfg/processors/boards/stm32f4xx/templates</path>
<default>resources/gencfg/xml/stm32f4board.xml</default>
<basefilename>board</basefilename>
</processor>
- <processor>
+ <processor class="board" target="STM32L1xx">
<name>STM32L1xx Board Configuration</name>
<path>resources/gencfg/processors/boards/stm32l1xx/templates</path>
<default>resources/gencfg/xml/stm32l1board.xml</default>
<basefilename>board</basefilename>
</processor>
+ <processor class="build" target="STM32F0xx">
+ <name>STM32F0xx Build Environment Configuration</name>
+ <path>resources/gencfg/processors/builds/stm32f0xx/templates</path>
+ <default>resources/gencfg/xml/stm32f0build.xml</default>
+ <basefilename>build</basefilename>
+ </processor>
+ <processor class="build" target="STM32F4xx">
+ <name>STM32F4xx Build Environment Configuration</name>
+ <path>resources/gencfg/processors/builds/stm32f4xx/templates</path>
+ <default>resources/gencfg/xml/stm32f4build.xml</default>
+ <basefilename>build</basefilename>
+ </processor>
+ <processor class="build" target="STM32L1xx">
+ <name>STM32L1xx Build Environment Configuration</name>
+ <path>resources/gencfg/processors/builds/stm32l1xx/templates</path>
+ <default>resources/gencfg/xml/stm32l1build.xml</default>
+ <basefilename>build</basefilename>
+ </processor>
</processors>
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
new file mode 100644
index 000000000..ad0bad11a
--- /dev/null
+++ b/tools/eclipse/config_wizard/resources/gencfg/schema/common/code_snippets.xsd
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+
+ <xsd:element name="code">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="snippets" maxOccurs="1"
+ minOccurs="1">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="snippet"
+ maxOccurs="unbounded" minOccurs="1">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="type"
+ maxOccurs="1" minOccurs="1">
+ <xsd:simpleType>
+ <xsd:restriction
+ base="xsd:string">
+ <xsd:enumeration
+ value="thread_body">
+ </xsd:enumeration>
+ <xsd:enumeration
+ value="function_body">
+ </xsd:enumeration>
+ <xsd:whiteSpace
+ value="collapse">
+ </xsd:whiteSpace>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:element>
+ <xsd:element name="name"
+ maxOccurs="1" minOccurs="1">
+ <xsd:simpleType>
+ <xsd:restriction
+ base="xsd:string">
+ <xsd:pattern
+ value="[\w\d\s_]+">
+ </xsd:pattern>
+ <xsd:whiteSpace
+ value="collapse">
+ </xsd:whiteSpace>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:element>
+ <xsd:element name="text"
+ type="xsd:string" maxOccurs="1" minOccurs="1">
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+</xsd:schema>