MCPcopy Index your code
hub / github.com/processing/processing / close

Method close

java/libraries/io/src/processing/io/LED.java:133–150  ·  view source on GitHub ↗

Restores the previous state @webref

()

Source from the content-addressed store, hash-verified

131 * @webref
132 */
133 public void close() {
134 if (NativeInterface.isSimulated()) {
135 return;
136 }
137
138 // restore previous settings
139 String fn = "/sys/class/leds/" + dev + "/brightness";
140 int ret = NativeInterface.writeFile(fn, Integer.toString(prevBrightness));
141 if (ret < 0) {
142 throw new RuntimeException(fn + ": " + NativeInterface.getError(ret));
143 }
144
145 fn = "/sys/class/leds/" + dev + "/trigger";
146 ret = NativeInterface.writeFile(fn, prevTrigger);
147 if (ret < 0) {
148 throw new RuntimeException(fn + ": " + NativeInterface.getError(ret));
149 }
150 }
151
152
153 /**

Callers 5

disposeMethod · 0.45
disposeMethod · 0.45
disposeMethod · 0.45
disposeMethod · 0.45
endDrawMethod · 0.45

Calls 4

isSimulatedMethod · 0.95
writeFileMethod · 0.95
getErrorMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected