<?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>Classic/Legacy CodeWarrior中的主题 S12 bit field define problem</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/S12-bit-field-define-problem/m-p/770479#M7475</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I defined a variable via bit field way as follow:&lt;/P&gt;&lt;P&gt;typedef struct stAbbrTime_t&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;UINT32 Sec : 6;&lt;BR /&gt; UINT32 Min : 6;&lt;BR /&gt; UINT32 Hour : 5;&lt;BR /&gt; UINT32 Day : 5;&lt;BR /&gt; UINT32 Month : 4;&lt;BR /&gt; UINT32 Year : 6;&lt;/P&gt;&lt;P&gt;}ST_ABBR_TIME;&lt;/P&gt;&lt;P&gt;I think this variable must be 4 bytes length, but in fact it occupy 5 bytes as follow:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20862i1E0B0AB1BDC1B010/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I don't know why.&lt;/P&gt;&lt;P&gt;The bit field settings in CW5.1 is as follow(I use the default setting)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20957i057B574D1B63C986/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jun 2018 12:05:44 GMT</pubDate>
    <dc:creator>赵子成</dc:creator>
    <dc:date>2018-06-11T12:05:44Z</dc:date>
    <item>
      <title>S12 bit field define problem</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/S12-bit-field-define-problem/m-p/770479#M7475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I defined a variable via bit field way as follow:&lt;/P&gt;&lt;P&gt;typedef struct stAbbrTime_t&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;UINT32 Sec : 6;&lt;BR /&gt; UINT32 Min : 6;&lt;BR /&gt; UINT32 Hour : 5;&lt;BR /&gt; UINT32 Day : 5;&lt;BR /&gt; UINT32 Month : 4;&lt;BR /&gt; UINT32 Year : 6;&lt;/P&gt;&lt;P&gt;}ST_ABBR_TIME;&lt;/P&gt;&lt;P&gt;I think this variable must be 4 bytes length, but in fact it occupy 5 bytes as follow:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20862i1E0B0AB1BDC1B010/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I don't know why.&lt;/P&gt;&lt;P&gt;The bit field settings in CW5.1 is as follow(I use the default setting)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20957i057B574D1B63C986/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 12:05:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/S12-bit-field-define-problem/m-p/770479#M7475</guid>
      <dc:creator>赵子成</dc:creator>
      <dc:date>2018-06-11T12:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: S12 bit field define problem</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/S12-bit-field-define-problem/m-p/770480#M7476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Can you please upload your demo project? Thanks&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Jennie Zhang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2018 08:11:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/S12-bit-field-define-problem/m-p/770480#M7476</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2018-06-14T08:11:54Z</dc:date>
    </item>
  </channel>
</rss>

