You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As already mentioned in #218 , when a device gets opened, the state is reset and the last configured state cannot be retrieved anymore.
I was able to workaround this by temporarily monkey-patching out the set_bitmode function:
And i could verify that indeed this works for my use-case: I can set the GPIO state in one invocation of the script and i can retrieve the state with above workaround in another invocation of the script. I also verified that after a ftdi.reset(usb_reset=True) the approach still works but then obviously returns the default state (by which i mean that calling read() seems to be ok even if set_bitmode has not been called before on the device)
But obviously this is a quite nasty workaround and i wonder whether maybe it could be supported maybe as a special kind of GpioReadOnceController or something?
The text was updated successfully, but these errors were encountered:
Using pyftdi==0.55.0 .
As already mentioned in #218 , when a device gets opened, the state is reset and the last configured state cannot be retrieved anymore.
I was able to workaround this by temporarily monkey-patching out the set_bitmode function:
And i could verify that indeed this works for my use-case: I can set the GPIO state in one invocation of the script and i can retrieve the state with above workaround in another invocation of the script. I also verified that after a ftdi.reset(usb_reset=True) the approach still works but then obviously returns the default state (by which i mean that calling read() seems to be ok even if set_bitmode has not been called before on the device)
But obviously this is a quite nasty workaround and i wonder whether maybe it could be supported maybe as a special kind of GpioReadOnceController or something?
The text was updated successfully, but these errors were encountered: