1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

pi gpio close pins timeout

This commit is contained in:
Dave Conway-Jones 2022-07-14 11:28:20 +01:00
parent e133d01e53
commit c32823a85a
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
2 changed files with 11 additions and 7 deletions

View File

@ -108,10 +108,12 @@ module.exports = function(RED) {
delete pinsInUse[node.pin];
if (node.child != null) {
node.finished = done;
node.child.stdin.write("close "+node.pin);
node.child.kill('SIGKILL');
node.child.stdin.write("close "+node.pin, () => {
node.child.kill('SIGKILL');
setTimeout(function() { if (done) { done(); } }, 25);
});
}
else { done(); }
else { if (done) { done(); } }
});
}
RED.nodes.registerType("rpi-gpio in",GPIOInNode);
@ -210,10 +212,12 @@ module.exports = function(RED) {
delete pinsInUse[node.pin];
if (node.child != null) {
node.finished = done;
node.child.stdin.write("close "+node.pin);
node.child.kill('SIGKILL');
node.child.stdin.write("close "+node.pin, () => {
node.child.kill('SIGKILL');
setTimeout(function() { if (done) { done(); } }, 25);
});
}
else { done(); }
else { if (done) { done(); } }
});
}

View File

@ -1,6 +1,6 @@
{
"name": "node-red-node-pi-gpio",
"version": "2.0.3",
"version": "2.0.4",
"description": "The basic Node-RED node for Pi GPIO",
"dependencies" : {
},