<?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>CodeWarrior for MCUのトピックRe: inline function</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323831#M11029</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The original code where the inline function is called looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="InlineFunction.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/45042i5E7BABD41FC0EEE2/image-size/large?v=v2&amp;amp;px=999" role="button" title="InlineFunction.png" alt="InlineFunction.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The inline function itself is defined in the module header:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="InlineFunction_Header.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/45043iAF7ECDC9BC05207B/image-size/large?v=v2&amp;amp;px=999" role="button" title="InlineFunction_Header.png" alt="InlineFunction_Header.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Project Compiler Settings:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="InlineFunction_CompilerSettings.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/45044iE170D1B18376119A/image-size/large?v=v2&amp;amp;px=999" role="button" title="InlineFunction_CompilerSettings.png" alt="InlineFunction_CompilerSettings.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've already tried various compiler settings (especially inline and optimization level).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Jul 2014 09:26:32 GMT</pubDate>
    <dc:creator>markuskandler</dc:creator>
    <dc:date>2014-07-15T09:26:32Z</dc:date>
    <item>
      <title>inline function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323827#M11025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to inline this Little function but the Compiler (S12ZCPU) refuses to do that. Is there any Limitation I violated?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__inline__ void FunctionToInline(uint16 *current_ptr)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; current_ptr[0] -= Adc0Offset;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; current_ptr[1] -= Adc1Offset;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With another function that staturates a value, inlining worked well.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 07:48:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323827#M11025</guid>
      <dc:creator>markuskandler</dc:creator>
      <dc:date>2014-06-25T07:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: inline function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323828#M11026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Markus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you getting the compilation error? If yes, what is the error?&lt;/P&gt;&lt;P&gt;Which version of CodeWarrior you are using?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to compile this function.&lt;/P&gt;&lt;P&gt;Even, if I disassemble the file, I can see the difference with the use of "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;__inline__&lt;/SPAN&gt;" and without it.&lt;/P&gt;&lt;P&gt;I have checked on CW10.6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Arpita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 06:01:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323828#M11026</guid>
      <dc:creator>arpitaagarwal-b</dc:creator>
      <dc:date>2014-06-27T06:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: inline function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323829#M11027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your answer.&lt;/P&gt;&lt;P&gt;I get no compilation error but a warning, that the function cannot be inlined.&lt;/P&gt;&lt;P&gt;I'm using CW 10.5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my compilation output I see no difference if inline is used or not&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 06:06:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323829#M11027</guid>
      <dc:creator>markuskandler</dc:creator>
      <dc:date>2014-06-27T06:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: inline function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323830#M11028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See below the basic code which I have developed:&lt;/P&gt;&lt;P&gt;********************************************************************&lt;/P&gt;&lt;P&gt;int a[2], Adc0Offset, Adc1Offset;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;__inline__&amp;nbsp; void FunctionToInline(int *current_ptr)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; current_ptr[0] -= Adc0Offset;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; current_ptr[1] -= Adc1Offset;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;void main(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; Adc1Offset=10;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Adc0Offset=8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; EnableInterrupts;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* include your code here */&lt;/P&gt;&lt;P&gt;&amp;nbsp; FunctionToInline(a);&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __RESET_WATCHDOG(); /* feeds the dog */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; } /* loop forever */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;P&gt;Right click on the file and select Disassemble option.&lt;/P&gt;&lt;P&gt;With inline, I can see that the function has not allocated a memory space and main() starts at 0x00, while if I remove "__inline__", main() starts at 0000001F, and function is treated as a subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure why it is not working in your code? Are you using code optimization?&lt;/P&gt;&lt;P&gt;Can you share your code so that issue can be replicated at our end and then we can find the cause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Arpita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 11:15:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323830#M11028</guid>
      <dc:creator>arpitaagarwal-b</dc:creator>
      <dc:date>2014-06-27T11:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: inline function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323831#M11029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The original code where the inline function is called looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="InlineFunction.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/45042i5E7BABD41FC0EEE2/image-size/large?v=v2&amp;amp;px=999" role="button" title="InlineFunction.png" alt="InlineFunction.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The inline function itself is defined in the module header:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="InlineFunction_Header.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/45043iAF7ECDC9BC05207B/image-size/large?v=v2&amp;amp;px=999" role="button" title="InlineFunction_Header.png" alt="InlineFunction_Header.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Project Compiler Settings:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="InlineFunction_CompilerSettings.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/45044iE170D1B18376119A/image-size/large?v=v2&amp;amp;px=999" role="button" title="InlineFunction_CompilerSettings.png" alt="InlineFunction_CompilerSettings.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've already tried various compiler settings (especially inline and optimization level).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jul 2014 09:26:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323831#M11029</guid>
      <dc:creator>markuskandler</dc:creator>
      <dc:date>2014-07-15T09:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: inline function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323832#M11030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Markus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to include similar code into one of my projects.&lt;/P&gt;&lt;P&gt;I found that I had to enable both "optimize for speed" and "Bottom-Up Inlining", in order for this function to be inlined. I left "inline level" at the default ("smart").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MJW&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 10:35:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323832#M11030</guid>
      <dc:creator>MJW</dc:creator>
      <dc:date>2014-07-17T10:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: inline function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323833#M11031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your answer. I tried your suggested Settings but with my Project it make no difference. I still got the warning that the function cannot be inlined.&lt;/P&gt;&lt;P&gt;I've also tried to setup a new project, but that didn't change anything. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 08:07:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/inline-function/m-p/323833#M11031</guid>
      <dc:creator>markuskandler</dc:creator>
      <dc:date>2014-07-29T08:07:21Z</dc:date>
    </item>
  </channel>
</rss>

