<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>APP_ERROR_CHECK usage pattern</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16796/app_error_check-usage-pattern</link><description>Hello,
while reading some nrf5 examples, I&amp;#39;ve stumbled over a pattern in the examples, where the result code of a function is stored in variable (most of the time named err_code ) and then this variable is passed to APP_ERROR_CHECK . Intuitivly, I would</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 01 Oct 2016 14:37:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16796/app_error_check-usage-pattern" /><item><title>RE: APP_ERROR_CHECK usage pattern</title><link>https://devzone.nordicsemi.com/thread/64272?ContentTypeID=1</link><pubDate>Sat, 01 Oct 2016 14:37:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e1c9616-2553-48fd-aa87-5477d9eb26ea</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Thanks! :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: APP_ERROR_CHECK usage pattern</title><link>https://devzone.nordicsemi.com/thread/64271?ContentTypeID=1</link><pubDate>Sat, 01 Oct 2016 12:19:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0425ec6-e6d1-4636-a69a-3c96bb514277</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Doesn&amp;#39;t matter a damn, do whichever you like. However if you are debugging/single-stepping the code it&amp;#39;s easier to have it on two lines so you can see the value of the variable before you enter the APP_ERR_CHECK() and go to the fault handler.&lt;/p&gt;
&lt;p&gt;In release code it&amp;#39;s all optimized anyway so either piece of code ends up looking exactly the same.&lt;/p&gt;
&lt;p&gt;Use whichever suits your own personal style, I usually do it all on one line, unless that makes the line incredibly long, in which case I split it up.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>