You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable/disable dbprint using definition in `debug_dbprint.h`</h1>
86
86
<p>In the file <code><aclass="el" href="debug__dbprint_8h.html" title="Enable or disable printing to UART with dbprint. ">debug_dbprint.h</a></code><b>dbprint UART functionality can be enabled/disabled</b> with the definition <code>#define DEBUG_DBPRINT</code>. If it's value is <code>0</code>, all dbprint functionality is disabled.</p>
87
-
<dlclass="section note"><dt>Note</dt><dd>This means that the <b>only header file to include in your projects</b> for dbprint to work is<br/>
88
-
<code>#include <aclass="el" href="debug__dbprint_8h.html" title="Enable or disable printing to UART with dbprint. ">debug_dbprint.h</a></code></dd>
89
-
<dd>
90
-
If you also want to use this definition to enable/disable dbprint statements in your code, please use the following convention:<br/>
87
+
<dlclass="section warning"><dt>Warning</dt><dd>This means that the <b>only header file to include in your projects</b> for dbprint to work is<br/>
88
+
<code>#include <aclass="el" href="debug__dbprint_8h.html" title="Enable or disable printing to UART with dbprint. ">debug_dbprint.h</a></code></dd></dl>
89
+
<dlclass="section note"><dt>Note</dt><dd>If you also want to use this definition to enable/disable dbprint statements in your code, please use the following convention:<br/>
<code><your source code dbprint statements go here></code><br/>
93
92
<code>#endif // DEBUG_DBPRINT</code></dd></dl>
94
93
<hr/>
95
94
<h1><aclass="anchor" id="DBPRINT"></a>
96
-
More info about dbprint and VCOM</h1>
97
-
<p>VCOM is an on-board (SLSTK3400A) UART to USB converter alongside the Segger J-Link debugger, connected with microcontroller pins <code>PA0</code> (RX) and <code>PF2</code> (TX). This converter can then be used with Putty or another serial port program.</p>
98
-
<dlclass="section note"><dt>Note</dt><dd>When you want to debug using VCOM with interrupt functionality disabled, you can use the following initialization settings:<br/>
When using <code>dbprint</code> functionality, the following settings are used:<br/>
95
+
More info about dbprint (and VCOM)</h1>
96
+
<dlclass="section note"><dt>Note</dt><dd>When using <code>dbprint</code> functionality, the following settings are used and can't be changed without editing the source code:<br/>
102
97
<ul>
103
98
<li>Baudrate = 115200</li>
104
99
<li>8 databits</li>
105
100
<li>1 stopbit</li>
106
101
<li>No parity</li>
107
102
</ul>
108
103
</dd></dl>
104
+
<p>VCOM is an on-board (SLSTK3400A) UART to USB converter alongside the Segger J-Link debugger, connected with microcontroller pins <code>PA0</code> (RX) and <code>PF2</code> (TX). This converter can then be used with Putty or another serial port program.</p>
105
+
<dlclass="section note"><dt>Note</dt><dd>When you want to debug using VCOM with interrupt functionality disabled, you can use the following initialization settings:<br/>
<dlclass="section warning"><dt>Warning</dt><dd>Setting the third argument to <code>true</code> indicates to the code that <code>PA9</code> (<code>EFM_BC_EN</code>) should be set high to enable the isolation switch on the PCB of the Happy Gecko to link <code>PA0</code> (RX) and <code>PF2</code> (TX) to the debugger. Don't use this pin yourself if you want to make use of the on-board UART to USB converter!</dd></dl>
<li>Isolation switch - <code>PA9</code> (<code>EFM_BC_EN</code>) (don't use this pin yourself when using the on-board UART to USB converter)</li>
135
135
</ul>
136
136
<hr/>
137
137
<h1><aclass="anchor" id="Keywords"></a>
138
138
Keywords</h1>
139
139
<h2><aclass="anchor" id="Volatile"></a>
140
140
Volatile</h2>
141
-
<p>The <code>volatile</code> type indicates to the compiler that the data is not normal memory, and could change at unexpected times. Hardware registers are often volatile, and so are variables which get changed in interrupts.</p>
141
+
<p>The <code>volatile</code> type indicates to the compiler that the data is not normal memory, and could change at unexpected times. Hardware registers are often volatile, and so are variables which get changed in interrupts.<br/>
142
+
Volatile variables are stored in <em>RAM</em>.</p>
142
143
<h2><aclass="anchor" id="Static"></a>
143
144
Static</h2>
144
-
<ul>
145
-
<li><b>Static variable inside a function:</b> The variable keeps its value between invocations.</li>
146
-
<li><b>Static global variable or function:</b> The variable or function is only "seen" in the file it's declared in.</li>
147
-
</ul>
145
+
<h3><aclass="anchor" id="VARIABLE"></a>
146
+
Static variable</h3>
147
+
<p>During compile time (this is why we can't use variable length array's) memory gets reserved for this variable. The data itself gets put in the <em>data</em> segment of the memory (regular variables are put in the <em>stack</em> segment).<br/>
148
+
It's best to keep the use of <code>static</code> variables to a minimum. One should ask himself the question if it's necessary to keep the variable constantly in the memory. If the answer is yes, a <code>static</code> variable is acceptable.<br/>
149
+
A <b>static variable inside a function</b> keeps its value between invocations.</p>
150
+
<h3><aclass="anchor" id="FUNCTION"></a>
151
+
Static global function</h3>
152
+
<p>The function is only "seen" in the file it's declared in. This means <code>static</code> can be used for methods the same way <code>private</code> is used for certain methods in C++.</p>
148
153
<hr/>
149
154
<h1><aclass="anchor" id="DATA"></a>
150
155
Bits, bytes, nibbles and unsigned/signed integer value ranges</h1>
<divclass="textblock"><p>Enable or disable printing to UART with dbprint. </p>
82
-
<p><b>This header file should be called in every other file where there are UART dbprint debugging statements. Depending on the value of <code>DEBUG_DBPRINT</code>, UART statements are enabled or disabled.</b></p><dlclass="section version"><dt>Version</dt><dd>6.2</dd></dl>
82
+
<p><b>This header file should be called in every other file where there are UART dbprint debugging statements. Depending on the value of <code>DEBUG_DBPRINT</code>, UART statements are enabled or disabled.</b></p><dlclass="section version"><dt>Version</dt><dd>7.0</dd></dl>
83
83
<dlclass="section author"><dt>Author</dt><dd>Brecht Van Eeckhoudt</dd></dl>
0 commit comments