[PD] [pii2c] won't send more than 32 bytes

Alexandros adrcki at gmail.com
Tue Sep 1 19:17:03 CEST 2020

The MAX_I2C_BUF_SIZE macro in pii2c.c is set to 64, but still when I try
to send 64 bytes to a slave Teensy, only 32 go through, the rest 32 are
all 0s. Raising this value to an even greater number, like 128 (which is
something I would like to implement), gives similar results. The same
behavior occurs whether I set the I2C address as an argument to the
object, or if I pass it through the "write" message.

I checked the code and couldn't find where this occurs. I added this:

`post("%d", x->x_xferbuf[i-1]);`

to line 348 to make sure the bytes are stored in the object's buffer,
and they do get stored properly. The only place I found they end up in
is a "write()" function, called in line 293, inside the pii2c_writer()
function. I guess this function is from one of the header files included
in the object, as I couldn't find it in the code.

Long story short, is it possible to send more than 32 bytes over I2C in
the Pi? I really like [pii2c], and since wiringPi is now deprecated, I'd
like to stick to this object.

More information about the Pd-list mailing list