tessel/t2-firmware

I2C.send calls callback with extra argument

Opened this issue · 3 comments

I expect the callback of I2C.send to just have an error attribute but it also has a second argument with the value of new Buffer([0x88]).

Looks like I2C.send calls the callback with _simple_cmd(CMD.STOP) (which internally sends a one byte echo command to return 0x88), whereas I2C.read/I2C.transfer call the callback with port.rx, and before sending STOP.

Send only sends and then stops. Read and transfer must wait for responses before the stop.

Functions which also pass [0x88] to their callback parameter: