This is a multi-part message in MIME format. --===============47539937613298688== Content-Type: multipart/alternative; boundary="------------020208060602020708080403" This is a multi-part message in MIME format. --------------020208060602020708080403 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by pch.mit.edu id i7V9SnWN011829 Patrick J wrote: >Hi John, > >In can18xx8.h says : >enum CAN_RX_MSG_FLAGS >{ > CAN_RX_FILTER_BITS =3D 0b00000111, // Use this to access filter > // bits > CAN_RX_FILTER_1 =3D 0b00000000, > CAN_RX_FILTER_2 =3D 0b00000001, > CAN_RX_FILTER_3 =3D 0b00000010, > CAN_RX_FILTER_4 =3D 0b00000011, > CAN_RX_FILTER_5 =3D 0b00000100, > CAN_RX_FILTER_6 =3D 0b00000101, > > CAN_RX_OVERFLOW =3D 0b00001000, // Set if Overflowed else > // cleared > > CAN_RX_INVALID_MSG =3D 0b00010000, // Set if invalid else > // cleared > > CAN_RX_XTD_FRAME =3D 0b00100000, // Set if XTD message else > // cleared > > CAN_RX_RTR_FRAME =3D 0b01000000, // Set if RTR message else > // cleared > > CAN_RX_DBL_BUFFERED =3D 0b10000000 // Set if this message was > // hardware double-buffered >}; > > >I found that and thought it would take care of it, but it doesnt! >Maybe the compiler doesnt find it or something. >Strange! >/PJ > >----- Original Message ----- >From: >To: >Sent: Tuesday, August 31, 2004 7:10 AM >Subject: Re: [PIC]: CANbus - AN738 wont compile! > > > =20 > >>On Tue, 31 Aug 2004, Patrick J wrote: >> =20 >> >>>It won't compile w/o errors in the initiation and since this is my fir= st >>>attempt at both C (MCC18) and CANbus I need some help to locate >>>whats wrong. >>> =20 >>> >>>CAN_RX_MSG_FLAGS NewMessageFlags; <<=3D=3D AN738-EX18.c:24:Error: s= yntax >>> =20 >>> >error > > =20 > >>I haven't tried to build this, but glancing at the source, >>CAN_RX_MSG_FLAGS is a tag, not a typedef, so I would think you'd need >>enum CAN_RX_MSG_FLAGS NewMessageFlags; >>John W. Temples, III >> =20 >> > >-- >http://www.piclist.com hint: The PICList is archived three different >ways. See http://www.piclist.com/#archives for details. > > =20 > Yes! they are defined in the header. You can just use them... No need to=20 define again! if ( msg.flag & CAN_RX_MSG_FLAGS.CAN_RX_INVALID_MSG ) { .... if ( msg.flag & CAN_RX_MSG_FLAGS.CAN_RX_XTD_FRAME ) { ...... etc Regards /Ake --=20 --- Ake Hedman (YAP - Yet Another Programmer) eurosource, Brattbergav=E4gen 17, 820 50 LOS, Sweden Phone: (46) 657 413430 Cellular: (46) 73 84 84 102 Company home: http://www.eurosource.se =20 Kryddor/Te/Kaffe: http://www.brattberg.com Personal homepage: http://www.eurosource.se/akhe Automated home: http://www.vscp.org --------------020208060602020708080403 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Patrick J wrote:
Hi John,

In can18xx8.h says :
enum CAN_RX_MSG_FLAGS
{
    CAN_RX_FILTER_BITS  = 0b00000111,   // Use this to access filter
                                        // bits
    CAN_RX_FILTER_1     = 0b00000000,
    CAN_RX_FILTER_2     = 0b00000001,
    CAN_RX_FILTER_3     = 0b00000010,
    CAN_RX_FILTER_4     = 0b00000011,
    CAN_RX_FILTER_5     = 0b00000100,
    CAN_RX_FILTER_6     = 0b00000101,

    CAN_RX_OVERFLOW     = 0b00001000,   // Set if Overflowed else
                                        // cleared

    CAN_RX_INVALID_MSG  = 0b00010000,   // Set if invalid else
                                        // cleared

    CAN_RX_XTD_FRAME    = 0b00100000,   // Set if XTD message else
                                        // cleared

    CAN_RX_RTR_FRAME    = 0b01000000,   // Set if RTR message else
                                        // cleared

    CAN_RX_DBL_BUFFERED = 0b10000000    // Set if this message was
                                        // hardware double-buffered
};


I found that and thought it would take care of it, but it doesnt!
Maybe the compiler doesnt find it or something.
Strange!
/PJ

----- Original Message -----
From: <piclist@XARGS.COM>
To: <PICLIST@MITVMA.MIT.EDU>
Sent: Tuesday, August 31, 2004 7:10 AM
Subject: Re: [PIC]: CANbus - AN738 wont compile!


  
On Tue, 31 Aug 2004, Patrick J wrote:
    
It won't compile w/o errors in the initiation and since this is my first
attempt at both C (MCC18) and CANbus I need some help to locate
whats wrong.
      
CAN_RX_MSG_FLAGS NewMessageFlags;    <<== AN738-EX18.c:24:Error: syntax
      
error

  
I haven't tried to build this, but glancing at the source,
CAN_RX_MSG_FLAGS is a tag, not a typedef, so I would think you'd need
enum CAN_RX_MSG_FLAGS NewMessageFlags;
John W. Temples, III
    

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

  
Yes!

 they are defined in the header. You can just use them... No need to define again!

if ( msg.flag & CAN_RX_MSG_FLAGS.CAN_RX_INVALID_MSG ) {
....

if ( msg.flag & CAN_RX_MSG_FLAGS.CAN_RX_XTD_FRAME ) {
......

etc

Regards
/Ake

-- 
 ---
Ake Hedman (YAP - Yet Another Programmer)
eurosource, Brattbergavägen 17, 820 50 LOS, Sweden
Phone: (46) 657 413430 Cellular: (46) 73 84 84 102
Company home: http://www.eurosource.se      
Kryddor/Te/Kaffe: http://www.brattberg.com
Personal homepage: http://www.eurosource.se/akhe
Automated home: http://www.vscp.org
--------------020208060602020708080403-- --===============47539937613298688== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --===============47539937613298688==--