Hi Joep, and others,

I'm writing a i2c software master test, corresponding to the master's part of 
my echo test. Earch communication between the slave and the master involves:

 - one byte to send
 - one byte to receive

So, I said:

var byte i2c_tx_buffer[1]
var byte i2c_rx_buffer[1]

But it fails compiling...:

/home/sirloon/Documents/Projects/jallib/include/peripheral/i2c/i2c_level1.jal:76:
 
subscript out of range


At this line, in i2c_level1, there is this function

function i2c_receive_wordaddr(byte in i2c_address, word in addr, byte in 
i2c_rx_count) return bit is

   i2c_tx_buffer[0] = byte(addr >> 8)
   i2c_tx_buffer[1] = byte(addr & 0xFF)  -- <======== HERE
   return i2c_send_receive(i2c_address, 2, i2c_rx_count)

end function


I understand this is to deal with 10-bits address, so you need 2 bytes. But I 
don't use this function :)


So, for now I have to say:

var byte i2c_tx_buffer[2]
var byte i2c_rx_buffer[1]


And i2c_tx_buffer must be at least 2 bytes long. Maybe there's a test which 
can be performed in the function to fix this, I don't know...


Cheers,
Seb
-- 
Sébastien LELONG
http://www.sirloon.net
http://sirbot.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to