Topic : potential compiler optimization problem

Forum : 8051

Original Post
Post Information Post
November 19, 2009 - 7:00pm
Guest

Hi there,

I have downloaded the RKit-Eval51 product for use in my Silicon Labs IDE.
The program builds fine, but the run time operations are not as expected.

If I have multiple calls to the same function, it seems to ignore the first call all together.
In the following, I am expecting to make 2 independent writes over I2C. The first write to address 0x21 and 21 bytes long, the second write to address 0x10 and 2 byes long. If I log the I2C traffic I only see the second write.

Can anyone provide some insight ?

Packet[0] = 0x21; // address to start writing
NUM_BYTES_WR = 21;
TARGET = SLAVE_ADDR; // Target the Slave for next SMBus transfer
SMB_Write();

Packet[0] = 0x10; // address to start writing
Packet[1] = 0x01;
NUM_BYTES_WR = 2;
TARGET = SLAVE_ADDR; // Target the Slave for next SMBus transfer
SMB_Write();

Replies
Post Information Post
+1
0
-1
November 20, 2009 - 12:30am
Guest

n/m

I figured it out