I/O: Cosmetic fixes

This commit is contained in:
gohai
2015-10-14 15:16:54 +02:00
parent b20c2266fb
commit def1bddafa
3 changed files with 21 additions and 21 deletions

View File

@@ -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
*

View File

@@ -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);

View File

@@ -64,7 +64,7 @@ public class SPI {
/**
* Closes the I2C interface
* Closes the SPI interface
*/
public void close() {
NativeInterface.closeDevice(handle);