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

why is the result of get_tris_x() an int 16?

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



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

why is the result of get_tris_x() an int 16?
PostPosted: Wed Nov 16, 2011 7:39 pm     Reply with quote

every version of the CCS doc says that get_tris_X()
returns an int16 -

yet the LST file never shows more than a BYTE being conveyed
with 16F and 18F parts ??

is this perpetual uncorrected information in the manual
or am i missing something important here ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Nov 17, 2011 1:07 pm     Reply with quote

It looks like CCS simply copied the get_tris_x() section from the PCD
manual into the 16F and 18F manual. They forgot to edit it the return
type to 8-bits.
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Thu Nov 17, 2011 3:43 pm     Reply with quote

Actually not every version of the manual does say it is an int16.
Historically the older V3 compilers didn't have this function. Early V4 compilers say it returns a Byte. It was post V4.100, when it started saying it returns an int16, just after they expanded the index to list all the get_tris entries for all ports, as well as a generic portx entry.
So as PCM programmer says, it was when they updated the manual with a lot of PCD stuff, that this got screwed.
It is not as if it actually matters. Correctly it returns an int16, on the compilers where int16 is the default int data type. Given that C will automatically cast an int16 to int8 if needed, and on all older chips only 8bits of data are returned, it doesn't affect programming at all.

Best Wishes
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