<?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>How to use SDK in your custom library in SES?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60092/how-to-use-sdk-in-your-custom-library-in-ses</link><description>I have the following code in my main.c file: 
 
 I also have mylib.c and mylib.h file. I want to move my function there. I tried the following. 
 mylib.c 
 
 mylib.h 
 
 I also tried to pass m_xfer_done and m_twi as a pointer, but that didn&amp;#39;t work either</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Apr 2020 22:41:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60092/how-to-use-sdk-in-your-custom-library-in-ses" /><item><title>RE: How to use SDK in your custom library in SES?</title><link>https://devzone.nordicsemi.com/thread/244235?ContentTypeID=1</link><pubDate>Fri, 10 Apr 2020 22:41:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2eed4b6-7253-40c3-8dbe-1fc191c6fee0</guid><dc:creator>ephimee</dc:creator><description>&lt;p&gt;Thanks for the quick reply, it works!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use SDK in your custom library in SES?</title><link>https://devzone.nordicsemi.com/thread/244231?ContentTypeID=1</link><pubDate>Fri, 10 Apr 2020 21:34:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b6f2f53-8216-491f-8765-1b009dd260a4</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;&amp;quot;static&amp;quot; in this file context means &amp;quot;I am invisible to all other source files&amp;quot;. Simply remove &amp;quot;static&amp;quot; in both files:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;In main.c change:
/* Indicates if operation on TWI has ended. */
static volatile bool m_xfer_done = false;
/* TWI instance. */
static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);
 to:
 /* Indicates if operation on TWI has ended. */
volatile bool m_xfer_done = false;
/* TWI instance. */
const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);

In mylib.c change:
extern static volatile bool m_xfer_done;
extern static const nrf_drv_twi_t m_twi;
to:
extern volatile bool m_xfer_done;
extern const nrf_drv_twi_t m_twi;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>