Yes, I'd been wondering about this - it wasn't an issue until recently as I2C would only read in 32 bytes (line Arduino iirc).
The problem is that Uint8Array!=Array, so you can't use things like splice, and people will definitely get upset with that as well :( I guess the best option might be to add an optional argument: I2C.readFrom(address,quantity, { asUint8Array : true })
I think SPI does act properly if you give it a Uint8Array to send - obviously in that case it's easy though as if you're using a Uint8Array in the first place you know what to expect.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Yes, I'd been wondering about this - it wasn't an issue until recently as I2C would only read in 32 bytes (line Arduino iirc).
The problem is that Uint8Array!=Array, so you can't use things like splice, and people will definitely get upset with that as well :( I guess the best option might be to add an optional argument:
I2C.readFrom(address,quantity, { asUint8Array : true })
I think SPI does act properly if you give it a Uint8Array to send - obviously in that case it's easy though as if you're using a Uint8Array in the first place you know what to expect.
For now, can't you just read in smaller chunks?