CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

CAN driver differences from version 4 to latest

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rusty_shackleford



Joined: 16 Sep 2014
Posts: 5

View user's profile Send private message

CAN driver differences from version 4 to latest
PostPosted: Thu Sep 18, 2014 2:02 pm     Reply with quote

recently upgraded from 4.053 PCH to latest PCH
compiling old code yields this error
"Line 1034(28,29): Element is not a member"
tracked this down to this line in old(V4.053) CAN-18F4580.c driver file

can_enable_b_transfer ( b );
the reason it fails is because of this line in same file
#define can_enable_b_transfer(b) (BSEL0.btxen|=b);
OK.
now going over to the CAN-18F4580.h file (the new one in latest version).
the definition of BSEL0 is:
Code:
struct {
   int   void10:2;      //0-1
   int1  b0txen;        //2   //buffer 0 transmit enable bit
   int1  b1txen;        //3   //buffer 1 transmit enable bit
   int1  b2txen;        //4   //buffer 2 transmit enable bit
   int1  b3txen;        //5   //buffer 3 transmit enable bit
   int1  b4txen;        //6   //buffer 4 transmit enable bit
   int1  b5txen;        //7   //buffer 5 transmit enable bit
} BSEL0;
there is no btxen in this definition

Heres my problem. The old CAN18F4580.c file is required because it has been modified to suit my application. The install of latest version of PCH wrote in a different CAN-18F4580.h.

At a loss as to what to do here.

If I include the latest Version of CAN-18F4580.c i doubt my ckt will work. I really dont have time to go back and re-configure the timing in the new file again.

Any ideas how to get around this? is there a way I can retrieve the CAN-18F4580.h from V 4.053?

Can I change this line and simply use b0txen intead of btxen?

#define can_enable_b_transfer(b) (BSEL0.btxen|=b);


Side note: the reason i waited so long to upgrade is because of the above situation. Happens to me every time i upgrade. Something isn't define right any longer and i have to troubleshoot what happened. ugh
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 18, 2014 2:39 pm     Reply with quote

Quote:
The install of latest version of PCH wrote in a different CAN-18F4580.h.

Re-install your old compiler on a different PC. Get the old .h file that
you need. Put it in your project directory on your current PC.
If you put the #include in quotes, the compiler will fetch it from your
project directory instead of the CCS Drivers directory. Example:
Code:
#include "can-18F4580.h"

Or you could just rename it and #include the new filename.

For extra safety, add a #warning line to the old file, such as
Code:
#warning This file is from vs. 4.053. 

Look for the warning in your Build window when you compile to make
sure the compiler used that file.

There might be a better or different solution. This is one quick solution
that I thought of.
rusty_shackleford



Joined: 16 Sep 2014
Posts: 5

View user's profile Send private message

PostPosted: Thu Sep 18, 2014 2:46 pm     Reply with quote

thanks. i thought of that but I dont have the old compiler on a disk. Could I re-install from the archive folder in my PICC directory? And then go back to the new one?

It would be nice to be able to install the upgrade and maintain the older versions so older code can continue to compile on the older versions.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 18, 2014 3:09 pm     Reply with quote

I don't think it's possible to have two different versions of the command
line compiler installed simultaneously on the same PC. CCS has the
version switching feature with vs. 5.xxx, but I can't see where they
maintain a separate directory for the #include files, or driver files, etc.

So even though you can select a different version from the Version
switching utility, they don't replace vs. 5.028 with vs. 4.053 files.
It appears to me that they only use the 5.028 files. And we know that's
unsafe, because CCS changes the built-in function definitions between
versions, and they may define the parameter constants differently.
Once I figured this out, I don't even bother using their version switching
anymore.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group