Skip to content

Commit 509da9c

Browse files
committed
I/O: Cosmetic fixes
1 parent 635ec82 commit 509da9c

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

java/libraries/io/src/processing/io/I2C.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,6 @@ public I2C(String dev) {
5454
}
5555

5656

57-
/**
58-
* Close the I2C device
59-
*/
60-
public void close() {
61-
NativeInterface.closeDevice(handle);
62-
handle = 0;
63-
}
64-
65-
66-
protected void finalize() throws Throwable {
67-
try {
68-
close();
69-
} finally {
70-
super.finalize();
71-
}
72-
}
73-
74-
7557
/**
7658
* Begins a transmission to an attached device
7759
*
@@ -84,7 +66,7 @@ protected void finalize() throws Throwable {
8466
* of the i2cdetect tool.
8567
* If the address provided in a datasheet is greater than 127 (hex 0x7f)
8668
* or there are separate addresses for read and write operations listed,
87-
* which vary exactly by one, then you want to shif the this number by
69+
* which vary exactly by one, then you want to shift the this number by
8870
* one bit to the right before passing it as an argument to this function.
8971
* @param slave 7 bit address of slave device
9072
* @see write
@@ -103,6 +85,24 @@ public void beginTransmission(int slave) {
10385
}
10486

10587

88+
/**
89+
* Closes the I2C device
90+
*/
91+
public void close() {
92+
NativeInterface.closeDevice(handle);
93+
handle = 0;
94+
}
95+
96+
97+
protected void finalize() throws Throwable {
98+
try {
99+
close();
100+
} finally {
101+
super.finalize();
102+
}
103+
}
104+
105+
106106
/**
107107
* Ends the current transmissions
108108
*

java/libraries/io/src/processing/io/PWM.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public PWM(String channel) {
8181

8282

8383
/**
84-
* Disables the output
84+
* Disables the PWM output
8585
*/
8686
public void clear() {
8787
String fn = String.format("/sys/class/pwm/%s/gpio%d/enable", chip, channel);

java/libraries/io/src/processing/io/SPI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public SPI(String dev) {
6464

6565

6666
/**
67-
* Closes the I2C interface
67+
* Closes the SPI interface
6868
*/
6969
public void close() {
7070
NativeInterface.closeDevice(handle);

0 commit comments

Comments
 (0)