<?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 Development Toolsのトピックconverting between Little Endian and Big Endian for signed int, float values ?</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/converting-between-Little-Endian-and-Big-Endian-for-signed-int/m-p/375042#M2095</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt; I am using K60 uc with CW 10.6. Using structure I am storing some values and printing it. The datatypes present in the structure has signed int, unsigned int 32, float.... When I am printing it , the values are appearing to be flipped(as uc is little endian). I tried converting it so that It appears in Big Endian form&amp;nbsp; but it didn't worked well. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Firstly I tried using&amp;nbsp;&amp;nbsp;&amp;nbsp; __builtin_bswap32();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Present in GCC compiler&lt;/P&gt;&lt;P&gt;It works fine for uint32_t .but It didn't worked for float values.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I tried using&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln" style="background: transparent;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; background-position: initial;"&gt;&lt;SPAN class="pln" style="background: transparent;"&gt;ntohl&lt;/SPAN&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;();&lt;/SPAN&gt;&lt;SPAN class="pln" style="background: transparent;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="com" style="color: #808080; background: transparent;"&gt;//Network to Host byte order (Long)&lt;/SPAN&gt;&lt;SPAN class="pln" style="background: transparent;"&gt;&lt;BR /&gt;htonl&lt;/SPAN&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pln" style="background: transparent;"&gt; &lt;/SPAN&gt;&lt;SPAN class="com" style="color: #808080; background: transparent;"&gt;//Host to Network byte order (Long)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for this I didn't new what header files to include, and so it didn't worked. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I searched ARM's website and got a document&amp;nbsp; &lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Finfocenter.arm.com%2Fhelp%2Findex.jsp%3Ftopic%3D%2Fcom.arm.doc.dui0491i%2FBABBHFJF.html" rel="nofollow" target="_blank"&gt;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491i/BABBHFJF.html&lt;/A&gt; but again this was not for single value. and didn't worked.&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any command which does this ?? &lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Amit Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Sep 2014 09:27:24 GMT</pubDate>
    <dc:creator>Amit_Kumar1</dc:creator>
    <dc:date>2014-09-17T09:27:24Z</dc:date>
    <item>
      <title>converting between Little Endian and Big Endian for signed int, float values ?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/converting-between-Little-Endian-and-Big-Endian-for-signed-int/m-p/375042#M2095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt; I am using K60 uc with CW 10.6. Using structure I am storing some values and printing it. The datatypes present in the structure has signed int, unsigned int 32, float.... When I am printing it , the values are appearing to be flipped(as uc is little endian). I tried converting it so that It appears in Big Endian form&amp;nbsp; but it didn't worked well. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Firstly I tried using&amp;nbsp;&amp;nbsp;&amp;nbsp; __builtin_bswap32();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Present in GCC compiler&lt;/P&gt;&lt;P&gt;It works fine for uint32_t .but It didn't worked for float values.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I tried using&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln" style="background: transparent;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; background-position: initial;"&gt;&lt;SPAN class="pln" style="background: transparent;"&gt;ntohl&lt;/SPAN&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;();&lt;/SPAN&gt;&lt;SPAN class="pln" style="background: transparent;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="com" style="color: #808080; background: transparent;"&gt;//Network to Host byte order (Long)&lt;/SPAN&gt;&lt;SPAN class="pln" style="background: transparent;"&gt;&lt;BR /&gt;htonl&lt;/SPAN&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pln" style="background: transparent;"&gt; &lt;/SPAN&gt;&lt;SPAN class="com" style="color: #808080; background: transparent;"&gt;//Host to Network byte order (Long)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for this I didn't new what header files to include, and so it didn't worked. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I searched ARM's website and got a document&amp;nbsp; &lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Finfocenter.arm.com%2Fhelp%2Findex.jsp%3Ftopic%3D%2Fcom.arm.doc.dui0491i%2FBABBHFJF.html" rel="nofollow" target="_blank"&gt;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491i/BABBHFJF.html&lt;/A&gt; but again this was not for single value. and didn't worked.&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any command which does this ?? &lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Amit Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2014 09:27:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/converting-between-Little-Endian-and-Big-Endian-for-signed-int/m-p/375042#M2095</guid>
      <dc:creator>Amit_Kumar1</dc:creator>
      <dc:date>2014-09-17T09:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: converting between Little Endian and Big Endian for signed int, float values ?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/converting-between-Little-Endian-and-Big-Endian-for-signed-int/m-p/375043#M2096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Amit Kumar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please check if you can find something useful in professor Erich Blog:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2012/02/19/a-little-or-big-indian-a-plea-for-peace/" title="http://mcuoneclipse.com/2012/02/19/a-little-or-big-indian-a-plea-for-peace/"&gt;A little or big Indian? A Plea for Peace… | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;==========================================&lt;/P&gt;&lt;P&gt;this answer is for you, if it helps, please click on "correct answer" button. thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Zhang Jun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 04:45:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/converting-between-Little-Endian-and-Big-Endian-for-signed-int/m-p/375043#M2096</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2014-09-19T04:45:47Z</dc:date>
    </item>
  </channel>
</rss>

