<?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>Why can&amp;#39;t you put the ble code in another C file?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27094/why-can-t-you-put-the-ble-code-in-another-c-file</link><description>I am trying to take the ble_uart code and encapsulate it , so I took all the code and put it into another C file I made. 
 Then from the main.c program I call a function in this new C file to start the bluetooth. 
 It compiles and run but will not even</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Nov 2017 06:40:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27094/why-can-t-you-put-the-ble-code-in-another-c-file" /><item><title>RE: Why can't you put the ble code in another C file?</title><link>https://devzone.nordicsemi.com/thread/106556?ContentTypeID=1</link><pubDate>Wed, 22 Nov 2017 06:40:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a204415e-f5cc-4ef6-a4f4-ad8e423f2fab</guid><dc:creator>jj</dc:creator><description>&lt;p&gt;Hi, did you managed to solve your problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why can't you put the ble code in another C file?</title><link>https://devzone.nordicsemi.com/thread/106565?ContentTypeID=1</link><pubDate>Sun, 07 May 2017 22:46:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:620b0afa-4a7a-4c96-8bcf-71d36e32a5f1</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;This project is a complete mess. Why do you put static function declaration in h file? why do you put static variable INITIALIZATION (not only declarations) in h files? You should only put non-static functions declarations and public defines in header file... variables should be initialized in c file. I did not try flashing that yet, but that does not look as something that may work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why can't you put the ble code in another C file?</title><link>https://devzone.nordicsemi.com/thread/106563?ContentTypeID=1</link><pubDate>Sat, 06 May 2017 20:24:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fda100d-683f-434d-aa75-e31fdd8e07e8</guid><dc:creator>Bndit</dc:creator><description>&lt;p&gt;Hi, I&amp;#39;v attached the app itself, if you can please take a quick look, it will help me. Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why can't you put the ble code in another C file?</title><link>https://devzone.nordicsemi.com/thread/106564?ContentTypeID=1</link><pubDate>Sat, 06 May 2017 17:59:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5408ac7-66d5-49ff-a85a-5d5fe664fd04</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;As I told you, it would be much easier to say something if you upload the project. I assume there is nothing confidential yet, as you just started it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why can't you put the ble code in another C file?</title><link>https://devzone.nordicsemi.com/thread/106560?ContentTypeID=1</link><pubDate>Sat, 06 May 2017 17:51:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6e9de24-52bf-41e7-b32e-b2f1c365d363</guid><dc:creator>Bndit</dc:creator><description>&lt;p&gt;I have edited the question and added the app file, please check it out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why can't you put the ble code in another C file?</title><link>https://devzone.nordicsemi.com/thread/106562?ContentTypeID=1</link><pubDate>Sat, 06 May 2017 17:50:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e308bfd-069c-4eee-8ee1-2d9ced9aa029</guid><dc:creator>Bndit</dc:creator><description>&lt;p&gt;Well I&amp;#39;v edited the question with all code. As I said, I just took the code from main, and put it into a new C file. Please check out the edited question. Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why can't you put the ble code in another C file?</title><link>https://devzone.nordicsemi.com/thread/106561?ContentTypeID=1</link><pubDate>Sat, 06 May 2017 14:55:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:824d9f54-d039-43b3-9e97-b07478d1c4e3</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;You are doing something wrong in your project. Of course it is possible to encapsulate functions to separate files... You should upload your project if you want someone to check it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why can't you put the ble code in another C file?</title><link>https://devzone.nordicsemi.com/thread/106559?ContentTypeID=1</link><pubDate>Sat, 06 May 2017 13:44:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b028a92-da62-4cb2-80be-670967065a39</guid><dc:creator>Bndit</dc:creator><description>&lt;p&gt;The link to the C file I made (Bluetooth) was added inside preprocessor, the path is to the project folder because this is where the file is. (It compiles just fine)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why can't you put the ble code in another C file?</title><link>https://devzone.nordicsemi.com/thread/106558?ContentTypeID=1</link><pubDate>Sat, 06 May 2017 13:41:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:452dbfd5-347b-4daf-8003-51e42540730d</guid><dc:creator>Bndit</dc:creator><description>&lt;p&gt;Not sure what the question is. I compile using Segger button compile and run, it flash the board. It works if the whole code is inside the main.c (as the ble_uart examples comes), but if you move it to another C file and call it, it won&amp;#39;t even log.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why can't you put the ble code in another C file?</title><link>https://devzone.nordicsemi.com/thread/106557?ContentTypeID=1</link><pubDate>Sat, 06 May 2017 10:40:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b45ee84-a313-4a9c-b1eb-2f08577cb127</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;How do you compile an link your project?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>