Commits

Sebastian Bub committed b40a9ef

bugfix: ti is an input during init

Comments (0)

Files changed (1)

src/main/java/de/derbub/rpigpio/gpio/GpioSysFsInitializer.java

         for (ConfiguredGpio gpio : configuredGpioMap.values()) {
             try {
                 currentOutputPortState.put(gpio, Integer.toString(gpio.getDefaultState()));
-                if (!Direction.OUT.equals(gpio.getDirection()) &&  gpio.getDefaultState() == ConfiguredGpio.NO_STATE) {
+                if (!Direction.OUT.equals(gpio.getDirection()) ||  gpio.getDefaultState() == ConfiguredGpio.NO_STATE) {
                     log.debug("Set no default state for " + gpio);
                     continue;
                 }
         File aGpioFile = null;
         boolean isSuccessful = true;
         for (ConfiguredGpio gpio : configuredGpioMap.values()) {
-            if (gpio.getDirection().isInput()) {
+            if (!gpio.getDirection().isOutput()) {
                 continue;
             }
             try {