I2C-Tiny-USB
I2C-Tiny-USB copied to clipboard
USB_CFG_LONG_TRANSFERS?
Hello. I am trtying i2c-tiny-usb + digispark for my project. This is a linux host.
I am now trying CFG_USB_LONG_TRANSFERS in usbconfig.h with 1 since I am seeing my I2C read() fails with 205 bytes or larger data.
Though I have not succeeded yet with the larger data transfers, at least I think following changes are needed in order to build this configuration properly. (At least, passing compilation.)
I wonder if anyone already tried CFG_USB_LONG_TRANSFER configuration. Or possible clue to solve my issue of not able to read() 205 bytes or more?
==== diff --git a/digispark/main.c b/digispark/main.c index 472595c..1b7b76e 100644 --- a/digispark/main.c +++ b/digispark/main.c @@ -359,7 +359,8 @@ struct i2c_cmd { static uchar status = STATUS_IDLE;
-static uchar i2c_do(struct i2c_cmd *cmd) { +//static uchar i2c_do(struct i2c_cmd *cmd) { +static usbMsgLen_t i2c_do(struct i2c_cmd *cmd) { uchar addr;
LED_PORT |= LED_BV @@ -398,7 +399,8 @@ static uchar i2c_do(struct i2c_cmd *cmd) {
LED_PORT &= ~LED_BV;
- return(cmd->len?0xff:0x00);
- //return(cmd->len?0xff:0x00);
- return(cmd->len?USB_NO_MSG:0x00); }