Skip to content
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

Depending upon i2c method called the device may not be selected on th… #352

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ protected void selectBusSlave(I2C i2c) throws IOException {
*/
public int executeIOCTL(final I2C i2c, long command, ByteBuffer data, IntBuffer offsets){
int rc = -1;
if (this.lastAddress != i2c.device()) {
this.lastAddress = i2c.device();
}
try {
if (this.lock.tryLock() || this.lock.tryLock(this.lockAquireTimeout, this.lockAquireTimeoutUnit)) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ 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();
this.context.registry().add(i2C);
return i2C;
}
Expand Down