View previous topic :: View next topic |
Author |
Message |
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
why is the result of get_tris_x() an int 16? |
Posted: Wed Nov 16, 2011 7:39 pm |
|
|
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
|
|
Posted: Thu Nov 17, 2011 1:07 pm |
|
|
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: 19539
|
|
Posted: Thu Nov 17, 2011 3:43 pm |
|
|
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 |
|
|
|