aboutsummaryrefslogtreecommitdiffstats
path: root/tools/eclipse/config_wizard/resources/gencfg/lib/code_snippets.xml
blob: 2d0e5959a4b9a8123247b081b54f44e0afcd38ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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>