<?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 can I re-use timers?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13221/how-can-i-re-use-timers</link><description>Timers are defined by a macro: APP_TIMER_DEF. This unfortunately expands to:
#define APP_TIMER_DEF(timer_id) 
static app_timer_t timer_id##_data = { {0} }; 
static const app_timer_id_t timer_id = &amp;amp;timer_id##_data 
 Suppose I have several modules that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Jun 2016 09:03:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13221/how-can-i-re-use-timers" /><item><title>RE: How can I re-use timers?</title><link>https://devzone.nordicsemi.com/thread/50408?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2016 09:03:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79b0bf7e-c3b4-4d64-983d-3fda7bbc26ee</guid><dc:creator>Jeong Hyun Seok</dc:creator><description>&lt;p&gt;How about this?&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;APP_TIMER_DEF() in main.c, create timer in main.c&lt;/li&gt;
&lt;li&gt;make new function which includes &amp;quot;app_timer_stop()&amp;quot; and &amp;quot;app_timer_start()&amp;quot; the timer - this function is in main.c and other files can use it (extern)&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I re-use timers?</title><link>https://devzone.nordicsemi.com/thread/50407?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2016 08:59:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b7e75df-bd30-46a3-9f92-ca3f276052fc</guid><dc:creator>Jeong Hyun Seok</dc:creator><description>&lt;p&gt;I got the same situation.
APP_TIMER_DEF - which makes static variables, and we cannot use the timer in several files.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I re-use timers?</title><link>https://devzone.nordicsemi.com/thread/50406?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 08:51:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9792b0cd-8396-4f57-b102-30a5f2aa5570</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Pierre,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure there is a better solution, for me it sounds right.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>