node-red-node-pi-gpio 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/36-rpi-gpio.js +10 -6
- package/package.json +1 -1
package/36-rpi-gpio.js
CHANGED
|
@@ -108,10 +108,12 @@ module.exports = function(RED) {
|
|
|
108
108
|
delete pinsInUse[node.pin];
|
|
109
109
|
if (node.child != null) {
|
|
110
110
|
node.finished = done;
|
|
111
|
-
node.child.stdin.write("close "+node.pin)
|
|
112
|
-
|
|
111
|
+
node.child.stdin.write("close "+node.pin, () => {
|
|
112
|
+
node.child.kill('SIGKILL');
|
|
113
|
+
setTimeout(function() { if (done) { done(); } }, 25);
|
|
114
|
+
});
|
|
113
115
|
}
|
|
114
|
-
else { done(); }
|
|
116
|
+
else { if (done) { done(); } }
|
|
115
117
|
});
|
|
116
118
|
}
|
|
117
119
|
RED.nodes.registerType("rpi-gpio in",GPIOInNode);
|
|
@@ -210,10 +212,12 @@ module.exports = function(RED) {
|
|
|
210
212
|
delete pinsInUse[node.pin];
|
|
211
213
|
if (node.child != null) {
|
|
212
214
|
node.finished = done;
|
|
213
|
-
node.child.stdin.write("close "+node.pin)
|
|
214
|
-
|
|
215
|
+
node.child.stdin.write("close "+node.pin, () => {
|
|
216
|
+
node.child.kill('SIGKILL');
|
|
217
|
+
setTimeout(function() { if (done) { done(); } }, 25);
|
|
218
|
+
});
|
|
215
219
|
}
|
|
216
|
-
else { done(); }
|
|
220
|
+
else { if (done) { done(); } }
|
|
217
221
|
});
|
|
218
222
|
|
|
219
223
|
}
|