-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temporary fix for linuxfs-i2c IOException. Also fix return code for … #336
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,8 @@ public synchronized I2C create(I2CConfig config) { | |
LinuxFsI2CBus i2CBus = this.i2CBusMap.computeIfAbsent(config.getBus(), busNr -> new LinuxFsI2CBus(config)); | ||
// create new I/O instance based on I/O config | ||
LinuxFsI2C i2C = new LinuxFsI2C(i2CBus, this, config); | ||
// Workaround, needed if first LinuxFsI2C usage is ioctl (readRegister or writeRegister) | ||
i2C.read(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there not an init of a buffer in this method, which then makes the ioctl work? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For instance i can see this:
so the very first thing that happens, is that we set the lastAddress, then immediately perform an ioctl... So maybe this is missing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, i do see that the readRegister() does this too... |
||
this.context.registry().add(i2C); | ||
return i2C; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove this readRegister?