Main Site Documentation

ReservePin throws CLR_E_INVALID_OPERATION on I2CDevice


#1

I have a program that needs I2C (gyro) and USBClient.
For some reason I am getting the exception above when I call the I2CDevice(config)
As this is the happening on initialization with almost nothing before, I am not sure what can be wrong. Is it possible you can’t use USBClient and I2C together?


#2

So just throwing this out there…

You’re saying that if you don’t use USBClient, that the same I2C code works as expected? Or is this piece of code untested on its own?


#3

After quite a bit of debugging I found it was a race on Pin reservation by two different threads. Sorry about that.