Skip to content

Commit

Permalink
Depending upon i2c method called the device may not be selected on th…
Browse files Browse the repository at this point in the history
…e bus and the operation will fail
  • Loading branch information
taartspi committed Apr 18, 2024
1 parent 2da171d commit b2c8e3a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
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

0 comments on commit b2c8e3a

Please sign in to comment.