<?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>Problem reading buffer in different functions</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70997/problem-reading-buffer-in-different-functions</link><description>Hello! me and a coworker are developing a library for communicating with a peripheral via UART. The main idea is that when we send a command, we should get the corresponding to acknowledge and, if needed, more data. 
 We are using Zephyr, and using the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Jan 2021 15:31:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70997/problem-reading-buffer-in-different-functions" /><item><title>RE: Problem reading buffer in different functions</title><link>https://devzone.nordicsemi.com/thread/291571?ContentTypeID=1</link><pubDate>Wed, 27 Jan 2021 15:31:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3aa30469-4c66-47dc-a7d2-3850ad70a960</guid><dc:creator>Baowz</dc:creator><description>&lt;p&gt;Thank you for your quick response! You are totally right, this fixed the problem!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem reading buffer in different functions</title><link>https://devzone.nordicsemi.com/thread/291566?ContentTypeID=1</link><pubDate>Wed, 27 Jan 2021 15:17:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f313018-2090-431c-b94e-b8a3916fca49</guid><dc:creator>Daniel Chisholm</dc:creator><description>&lt;p&gt;&amp;quot;static&amp;quot; in your header file will make your variables local to that module.&amp;nbsp; So read_buf[] i&amp;nbsp; your library is a different read_buf[] than in main.c&lt;/p&gt;
&lt;p&gt;You probably want a global variable.&amp;nbsp; Declare it &amp;quot;extern uint_8&amp;quot; in your header file, and &amp;quot;uint_8&amp;quot; (neither static nor extern) in your main.c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>