I2C-Tiny-USB icon indicating copy to clipboard operation
I2C-Tiny-USB copied to clipboard

USB_CFG_LONG_TRANSFERS?

Open mzwtjp opened this issue 7 years ago • 0 comments

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); }

@@ -484,7 +486,8 @@ uchar usbFunctionWrite(uchar data, uchar len) / ------------------------------------------------------------------------- / / ------------------------ interface to USB driver ------------------------ / / ------------------------------------------------------------------------- */ -uchar usbFunctionSetup(uchar data[8]) +//uchar usbFunctionSetup(uchar data[8]) +usbMsgLen_t usbFunctionSetup(uchar data[8]) { static uchar replyBuf[4]; usbMsgPtr = replyBuf;

mzwtjp avatar Nov 21 '17 07:11 mzwtjp