Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT-FS → Thread

   

Porting ANTFS reference code to a PIC - compile error

RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Hi,
I just started porting the ANTFS example to a PIC18(XLP)-based project, and ran into the following issue. Within antfs.c there is the following:

///////////////////////////////////////////////////////////////////////
// Decode Transport Commands
///////////////////////////////////////////////////////////////////////
static void DecodeTransportCommand(UCHAR ucControlByte_UCHAR *pucTransCommand_)
{
   
...

      case 
ANTFS_CMD_LINK_ID:
      
{
         ULONG_UNION uHostSerialNumber
;

         
uHostSerialNumber.stBytes.ucByte0 pucMesg[HOST_ID_OFFSET_0];
         
uHostSerialNumber.stBytes.ucByte1 pucMesg[HOST_ID_OFFSET_1];
         
uHostSerialNumber.stBytes.ucByte2 pucMesg[HOST_ID_OFFSET_2];
         
uHostSerialNumber.stBytes.ucByte3 pucMesg[HOST_ID_OFFSET_3];

         ... 


...however, I can't find any definition of (uchar*) pucMesg, and neither can the compiler. Should this be referencing (uchar*) pucTransCommand_ instead?

Thanks!      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Are you using the latest version (1.1.0) of the embedded reference design?

http://www.thisisant.com/pages/ant/ant-fs-specification      
Rank

Total Posts: 5

Joined 2009-10-16

PM

Hi Alejandra,
The code I'm using is from the ANTFS_EMBEDDED_CLIENT.zip file, downloaded on 2/18 or so. It doesn't state a version number, but the file size matches the one currently posted (80989 bytes).      
Rank

Total Posts: 5

Joined 2009-10-16

PM

Hi,
I ran into another suspicious bit of code: at line 1187 or so of antfs.c, there is:

if(ucControlByte_ & SEQUENCE_LAST_MESSAGE) // last packet
{

if(PAIRING_AVAILABLE_FLAG_MASK)
{
...


which generates a compiler warning ("condition always true") because PAIRING_AVAILABLE_FLAG_MASK is a bitmask set at compile-time. Is this really meant to test that the mask constant is defined/nonzero, or should this be testing if(some_status_byte & PAIRING_AVAILABLE_FLAG_MASK) ?

Thanks!      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

The compile problems you see are not present in version 1.1.0. Please make sure to use the latest version from the website. Most of our software releases have a version.h file with the version, in case you are unsure you have the right one.

Regarding the pairing flag mask, you are correct, the code should be checking for stActiveBeaconStatus1.bPairingEnabled.