Skip to content

Commit

Permalink
removing useless comments
Browse files Browse the repository at this point in the history
  • Loading branch information
supertick committed Aug 19, 2023
1 parent 517f71f commit d5a1569
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions src/main/java/org/myrobotlab/i2c/I2CFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,14 @@ public class I2CFactory {
*/
public static I2CBus getInstance(int busNumber) throws IOException {

/*
* String architecture = Platform.getArch(); try { String I2CBusType =
* "org.myrobotlab.i2c.I2CBusProxy"; if
* (architecture.equals(Platform.ARCH_ARM)) { // raspi I2CBusType =
* "com.pi4j.io.i2c.impl.I2CBusImpl"; }
*
* Object[] param = new Object[0];
*
* Class<?> c; c = Class.forName(I2CBusType); Class<?>[] paramTypes = new
* Class[param.length]; for (int i = 0; i < param.length; ++i) {
* paramTypes[i] = param[i].getClass(); } Constructor<?> mc =
* c.getConstructor(paramTypes); return (I2CBus) mc.newInstance(param); }
* catch (Exception e) { Logging.logException(e); return null; }
*/
// pi4j's factory calls the implementation directly
// which would not be my first choice - but since it does
// I will do the same here... otherwise I'll need to invoke
// without an interface
Platform platform = Platform.getLocalInstance();

if (platform.isArm()) {
// raspi
// TODO: fix this!!!
// log.warn("This probable doesn't work for ARM / RasPI now.. update the
// code!");
// return I2CBusImpl.getBus(busNumber);
// return null;

try {
return provider.getBus(busNumber, DEFAULT_LOCKAQUIRE_TIMEOUT, DEFAULT_LOCKAQUIRE_TIMEOUT_UNITS);
} catch (UnsupportedBusNumberException e) {
Expand All @@ -66,13 +47,6 @@ public static I2CBus getInstance(int busNumber) throws IOException {
} else {
return I2CProxyImpl.getBus(busNumber);
}

// return I2CBusImpl.getBus(busNumber);
}

public static void main(String[] args) {
// TODO Auto-generated method stub

}

}

0 comments on commit d5a1569

Please sign in to comment.