<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic MPC560xB inline function utilization in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC560xB-inline-function-utilization/m-p/639079#M13720</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in my project I use for each element a header file (input / output data interface) and an associated source file (data interface utilization)&lt;/P&gt;&lt;P&gt;So per example a function which returns content of the STM timer:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the header file: extern UINT32 u32GetTime(void); // UINT32 = unsigned long int&lt;/P&gt;&lt;P&gt;in the source file:&amp;nbsp;&lt;SPAN&gt;UINT32 u32GetTime(void) { return (STM.CNT.R); }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And I want to write this simple function as inline to save time&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I write this function in my header file as:&amp;nbsp;inline UINT32 TIMS_u32GetFreeRunningTimerInUs(void) { return (STM.CNT.R); }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;the content of the function is copying where it is used (and not called as another function, so inline utilization)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But when I want to write this function as inline in the source file with the external declaration in the header the linker don't copy the associated code and keep the call function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there an option in the linker to use inline function as (correct this example if necessary) :&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;in header file: extern&amp;nbsp;UINT32 u32GetTime(void);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;in source file : inline&amp;nbsp;UINT32 u32GetTime(void) { return (STM.CNT.R); }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your help&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Romain&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Sep 2016 13:16:51 GMT</pubDate>
    <dc:creator>romainbenet</dc:creator>
    <dc:date>2016-09-21T13:16:51Z</dc:date>
    <item>
      <title>MPC560xB inline function utilization</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC560xB-inline-function-utilization/m-p/639079#M13720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in my project I use for each element a header file (input / output data interface) and an associated source file (data interface utilization)&lt;/P&gt;&lt;P&gt;So per example a function which returns content of the STM timer:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the header file: extern UINT32 u32GetTime(void); // UINT32 = unsigned long int&lt;/P&gt;&lt;P&gt;in the source file:&amp;nbsp;&lt;SPAN&gt;UINT32 u32GetTime(void) { return (STM.CNT.R); }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And I want to write this simple function as inline to save time&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I write this function in my header file as:&amp;nbsp;inline UINT32 TIMS_u32GetFreeRunningTimerInUs(void) { return (STM.CNT.R); }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;the content of the function is copying where it is used (and not called as another function, so inline utilization)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But when I want to write this function as inline in the source file with the external declaration in the header the linker don't copy the associated code and keep the call function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there an option in the linker to use inline function as (correct this example if necessary) :&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;in header file: extern&amp;nbsp;UINT32 u32GetTime(void);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;in source file : inline&amp;nbsp;UINT32 u32GetTime(void) { return (STM.CNT.R); }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your help&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Romain&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 13:16:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC560xB-inline-function-utilization/m-p/639079#M13720</guid>
      <dc:creator>romainbenet</dc:creator>
      <dc:date>2016-09-21T13:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: MPC560xB inline function utilization</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC560xB-inline-function-utilization/m-p/639080#M13721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Romain,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried few configurations, but only one of them works correct. Please look at the following URL. This is what I have tried and it worked.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://stackoverflow.com/questions/5229343/how-to-declare-an-inline-function-in-c99-multi-file-project" title="http://stackoverflow.com/questions/5229343/how-to-declare-an-inline-function-in-c99-multi-file-project"&gt;c - How to declare an inline function in C99 multi-file project? - Stack Overflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 10:47:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/MPC560xB-inline-function-utilization/m-p/639080#M13721</guid>
      <dc:creator>martin_kovar</dc:creator>
      <dc:date>2016-09-22T10:47:52Z</dc:date>
    </item>
  </channel>
</rss>

