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 support@ccsinfo.com

Strange compilation problem with i2C_write() function

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



Joined: 16 May 2006
Posts: 65
Location: Ankara/Turkey

View user's profile Send private message Send e-mail

Strange compilation problem with i2C_write() function
PostPosted: Tue May 16, 2006 1:57 am     Reply with quote

Hello everyone;

I searched the forum about my problem but couldn't find any suitable solutions. First of all let me show the code to you:

Code:


#use i2c(MASTER,scl=PIN_C3,sda=PIN_C4,SLOW)


#define ANTI_COLLISION_ACCESS       0x03
#define IO_FRAME_REGISTER           0x01
#define PARAM_REGISTER               0x00
#define INITIATE                  0x06       
#define SELECT                    0x0E
#define COMPLETE                0x0F
#define RESET_TO_INVENTORY           0x0C
#define READ_BLOCK                 0x08
#define WRITE_BLOCK               0x09
#define GET_UID                    0x0B

#define I2C_WRITE               0b00000000
#define I2C_READ               0b00000001

#define CRX14_ADDR                0b10100000

void RFActivateSignal()
{
   i2c_start();                     // line #1   
   i2c_write(CRX14_ADDR | I2C_WRITE);       //line #2
   i2c_write(PARAM_REGISTER);               // line #3   
   i2c_write(0b00010000);                  // line #4
   i2c_stop();                     // line #5   

}


void RFDeactivateSignal()
{

}



If I compile this code with CCS compiler (version PCH 3.212) it gives me these errors:

Code:

>>> Warning 207 ".....\TESTS\rfid.c" Line #2(1,1): Code has no effect
*** Error 76 ".....\TESTS\rfid.c" Line #2(10,11): Expect ;
*** Error 76 ".....\TESTS\rfid.c" Line #3(10,11): Expect ;
*** Error 76 ".....\TESTS\rfid.c" Line #4(10,11): Expect ;




PS: I edited the cocerning line numbers.

I think such a simple code shouldn't give these errors. Do you have any ideas? I'm really stucked with it.

Thanks guys.
_________________
/// KMT
/// www.muratursavas.com
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 16, 2006 2:53 am     Reply with quote

The following names are reserved by the compiler for use as
the i2c library functions. You can't use them as constants.
Choose some different names.
Quote:
#define I2C_WRITE 0b00000000
#define I2C_READ 0b00000001
KaraMuraT



Joined: 16 May 2006
Posts: 65
Location: Ankara/Turkey

View user's profile Send private message Send e-mail

PostPosted: Thu May 25, 2006 2:18 am     Reply with quote

Thank you

I realized the problem after 30 seconds of this post Wink Then I immediately removed the topic, but I can see now, it's not removed. Thanks anyway.

But I still have some problems with CRX14 RFID coupler. Do you have any information about that? or anyone?
_________________
/// KMT
/// www.muratursavas.com
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