mirror of
https://github.com/processing/processing4.git
synced 2026-01-27 10:21:26 +01:00
I/O: Cosmetic fixes
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -64,7 +64,7 @@ public class SPI {
|
||||
|
||||
|
||||
/**
|
||||
* Closes the I2C interface
|
||||
* Closes the SPI interface
|
||||
*/
|
||||
public void close() {
|
||||
NativeInterface.closeDevice(handle);
|
||||
|
||||
Reference in New Issue
Block a user