<?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>Proper way to define Queue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32733/proper-way-to-define-queue</link><description>What is the proper way to use the Queue Library and define a queue that can be used across multiple C files? I have the following code a my common header 
 NRF_QUEUE_DEF(uint8_t, m_msg_queue, 36, NRF_QUEUE_MODE_OVERFLOW); NRF_QUEUE_INTERFACE_DEC(uint8_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Mar 2018 01:21:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32733/proper-way-to-define-queue" /><item><title>RE: Proper way to define Queue</title><link>https://devzone.nordicsemi.com/thread/126183?ContentTypeID=1</link><pubDate>Wed, 28 Mar 2018 01:21:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8b6e106-f58d-4b8d-92d2-c08a3d195858</guid><dc:creator>SRose</dc:creator><description>&lt;p&gt;I put the &lt;span&gt;NRF_QUEUE_INTERFACE_DEC(uint8_t, msg_queue);&lt;/span&gt;&amp;nbsp; in the common header file and put the other two in a .c file and everything is working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper way to define Queue</title><link>https://devzone.nordicsemi.com/thread/125962?ContentTypeID=1</link><pubDate>Mon, 26 Mar 2018 13:14:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31bfd9d7-7ad1-4693-ae54-381b252413f8</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You shall move below source to .c file:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;NRF_QUEUE_DEF(uint8_t, m_msg_queue, 36, NRF_QUEUE_MODE_OVERFLOW);&lt;/span&gt;&lt;br /&gt;&lt;span&gt;NRF_QUEUE_INTERFACE_DEC(uint8_t, msg_queue);&lt;/span&gt;&lt;br /&gt;&lt;span&gt;NRF_QUEUE_INTERFACE_DEF(uint8_t, msg_queue, &amp;amp;m_msg_queue);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In other .c file you need this queue&amp;nbsp;add:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;extern&amp;nbsp;const nrf_queue_t&amp;nbsp;&lt;span&gt;m_msg_queue;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>