View previous topic :: View next topic |
Author |
Message |
KaraMuraT
Joined: 16 May 2006 Posts: 65 Location: Ankara/Turkey
|
Strange compilation problem with i2C_write() function |
Posted: Tue May 16, 2006 1:57 am |
|
|
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
|
|
Posted: Tue May 16, 2006 2:53 am |
|
|
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
|
|
Posted: Thu May 25, 2006 2:18 am |
|
|
Thank you
I realized the problem after 30 seconds of this post 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 |
|
|
|