From d5a1569920d954f5d8efbb5ee878efe06488f56a Mon Sep 17 00:00:00 2001 From: grog Date: Sat, 19 Aug 2023 14:10:37 -0700 Subject: [PATCH] removing useless comments --- .../java/org/myrobotlab/i2c/I2CFactory.java | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/main/java/org/myrobotlab/i2c/I2CFactory.java b/src/main/java/org/myrobotlab/i2c/I2CFactory.java index 7b69481d38..d5b72c8565 100644 --- a/src/main/java/org/myrobotlab/i2c/I2CFactory.java +++ b/src/main/java/org/myrobotlab/i2c/I2CFactory.java @@ -29,20 +29,6 @@ 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 @@ -50,12 +36,7 @@ public static I2CBus getInstance(int busNumber) throws IOException { 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) { @@ -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 - } }