From def1bddafab2bf1c72588ecd0c77db061ecc3dd4 Mon Sep 17 00:00:00 2001 From: gohai Date: Wed, 14 Oct 2015 15:16:54 +0200 Subject: [PATCH] I/O: Cosmetic fixes --- java/libraries/io/src/processing/io/I2C.java | 38 ++++++++++---------- java/libraries/io/src/processing/io/PWM.java | 2 +- java/libraries/io/src/processing/io/SPI.java | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/java/libraries/io/src/processing/io/I2C.java b/java/libraries/io/src/processing/io/I2C.java index 6a006af5d..c0665d755 100644 --- a/java/libraries/io/src/processing/io/I2C.java +++ b/java/libraries/io/src/processing/io/I2C.java @@ -54,24 +54,6 @@ public class I2C { } - /** - * Close the I2C device - */ - public void close() { - NativeInterface.closeDevice(handle); - handle = 0; - } - - - protected void finalize() throws Throwable { - try { - close(); - } finally { - super.finalize(); - } - } - - /** * Begins a transmission to an attached device * @@ -84,7 +66,7 @@ public class I2C { * of the i2cdetect tool. * If the address provided in a datasheet is greater than 127 (hex 0x7f) * or there are separate addresses for read and write operations listed, - * which vary exactly by one, then you want to shif the this number by + * which vary exactly by one, then you want to shift the this number by * one bit to the right before passing it as an argument to this function. * @param slave 7 bit address of slave device * @see write @@ -103,6 +85,24 @@ public class I2C { } + /** + * Closes the I2C device + */ + public void close() { + NativeInterface.closeDevice(handle); + handle = 0; + } + + + protected void finalize() throws Throwable { + try { + close(); + } finally { + super.finalize(); + } + } + + /** * Ends the current transmissions * diff --git a/java/libraries/io/src/processing/io/PWM.java b/java/libraries/io/src/processing/io/PWM.java index 641738959..011836219 100644 --- a/java/libraries/io/src/processing/io/PWM.java +++ b/java/libraries/io/src/processing/io/PWM.java @@ -81,7 +81,7 @@ public class PWM { /** - * Disables the output + * Disables the PWM output */ public void clear() { String fn = String.format("/sys/class/pwm/%s/gpio%d/enable", chip, channel); diff --git a/java/libraries/io/src/processing/io/SPI.java b/java/libraries/io/src/processing/io/SPI.java index 4a4b08352..bc3ed47b9 100644 --- a/java/libraries/io/src/processing/io/SPI.java +++ b/java/libraries/io/src/processing/io/SPI.java @@ -64,7 +64,7 @@ public class SPI { /** - * Closes the I2C interface + * Closes the SPI interface */ public void close() { NativeInterface.closeDevice(handle);