<?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 Re: bad variables in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216599#M8533</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;#define ST_ID_100 0xE0000000&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;unsigned char CAN0SendFrame (unsigned long id, unsigned &lt;BR /&gt;&lt;BR /&gt;char priority,unsigned char length, unsigned char *txdata){ &lt;BR /&gt;unsigned char vojta[] = "ERR_BUFFER_FULL";&lt;BR /&gt;char txbuffer;&lt;BR /&gt;int index;&lt;BR /&gt;if (!CAN0TFLG)                        /* Is Transmit Buffer full?? */&lt;BR /&gt;&lt;BR /&gt;return *(vojta);&lt;BR /&gt;CAN0TBSEL = CAN0TFLG;                   /* Select lowest empty buffer */&lt;BR /&gt;txbuffer = CAN0TBSEL;                   /* Backup selected buffer */&lt;BR /&gt;                                        /* Load Id to IDR Register */&lt;BR /&gt;*((unsigned long *) ((unsigned long)(&amp;amp;CAN0TXIDR0))) = id;&lt;BR /&gt;for (index=0;index&lt;LENGTH&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;call function&lt;BR /&gt;&lt;BR /&gt;   CAN0SendFrame (ST_ID_100, 0x00, delka, txdata1);&lt;/LENGTH&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jan 2009 16:59:08 GMT</pubDate>
    <dc:creator>Seitec</dc:creator>
    <dc:date>2009-01-16T16:59:08Z</dc:date>
    <item>
      <title>bad variables</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216597#M8531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have problem with my function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned char CAN0SendFrame (unsigned long id, unsigned char priority,unsigned char length, unsigned char *txdata);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like have unsigned long 0xE0000000 but if I forward this variable function instead E0000000 there is E000. Do anybody know please where is mistake?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using HC9S12DP256 and codewarrior.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 01:50:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216597#M8531</guid>
      <dc:creator>Seitec</dc:creator>
      <dc:date>2009-01-16T01:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: bad variables</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216598#M8532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Impossible to tell without the whole code.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 15:24:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216598#M8532</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2009-01-16T15:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: bad variables</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216599#M8533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;#define ST_ID_100 0xE0000000&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;unsigned char CAN0SendFrame (unsigned long id, unsigned &lt;BR /&gt;&lt;BR /&gt;char priority,unsigned char length, unsigned char *txdata){ &lt;BR /&gt;unsigned char vojta[] = "ERR_BUFFER_FULL";&lt;BR /&gt;char txbuffer;&lt;BR /&gt;int index;&lt;BR /&gt;if (!CAN0TFLG)                        /* Is Transmit Buffer full?? */&lt;BR /&gt;&lt;BR /&gt;return *(vojta);&lt;BR /&gt;CAN0TBSEL = CAN0TFLG;                   /* Select lowest empty buffer */&lt;BR /&gt;txbuffer = CAN0TBSEL;                   /* Backup selected buffer */&lt;BR /&gt;                                        /* Load Id to IDR Register */&lt;BR /&gt;*((unsigned long *) ((unsigned long)(&amp;amp;CAN0TXIDR0))) = id;&lt;BR /&gt;for (index=0;index&lt;LENGTH&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;call function&lt;BR /&gt;&lt;BR /&gt;   CAN0SendFrame (ST_ID_100, 0x00, delka, txdata1);&lt;/LENGTH&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 16:59:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216599#M8533</guid>
      <dc:creator>Seitec</dc:creator>
      <dc:date>2009-01-16T16:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: bad variables</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216600#M8534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV align="center"&gt;Let me guess, is CAN0SendFrame() prototype declared&amp;nbsp;before you call it? No warnings about missing prototype?&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 18:15:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216600#M8534</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2009-01-16T18:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: bad variables</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216601#M8535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The cause of the bug is that you aren't setting the IDE bit in the extended CAN frame.&lt;BR /&gt;&lt;BR /&gt;For 29-bit id you must always set IDE. In MSCAN, 29-bit and 11-bit share the same registers. If the IDE bit isn't set, the CAN controller will interpret the id as 11-bit and thus only use the 11 most significant bits. This means that 0xE000 will be used and you will get a 11-bit CAN id of 0x700.&lt;BR /&gt;&lt;BR /&gt;Read "3.2.2 Programmer's model of message storage" in the MSCAN manual for detailed info.&lt;BR /&gt;&lt;BR /&gt;---&lt;BR /&gt;&lt;BR /&gt;Also, this line seems suspicious:&lt;BR /&gt;&lt;BR /&gt;if (!CAN0TFLG) /* Is Transmit Buffer full?? */&lt;BR /&gt;return *(vojta);&lt;BR /&gt;&lt;BR /&gt;This will return the letter 'E'. How did you intend this to work? You can't return a pointer to a local string either, that will only give rubbish to the caller.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 23:16:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216601#M8535</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2009-01-16T23:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: bad variables</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216602#M8536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Yes I know but variable where is mistake, it is variable which I would like copy to IDRx where is IDE.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Jan 2009 02:07:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216602#M8536</guid>
      <dc:creator>Seitec</dc:creator>
      <dc:date>2009-01-17T02:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: bad variables</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216603#M8537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I find it, bad declaration. Thank you very much all for you time.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Jan 2009 02:41:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/bad-variables/m-p/216603#M8537</guid>
      <dc:creator>Seitec</dc:creator>
      <dc:date>2009-01-17T02:41:39Z</dc:date>
    </item>
  </channel>
</rss>

