Re-lint a load of nodes

This commit is contained in:
Dave Conway-Jones
2017-01-29 17:45:44 +00:00
parent 603189f123
commit 316a2fd272
42 changed files with 447 additions and 254 deletions

View File

@@ -16,31 +16,37 @@ module.exports = function(RED) {
var g = node.x.read();
var msg = { payload:g, topic:node.board+"/D"+node.pin };
switch (g) {
case 0:
case 0: {
node.status({fill:"green",shape:"ring",text:"low"});
if (node.interrupt=== "f" || node.interrupt === "b") {
node.send(msg);
}
break;
case 1:
}
case 1: {
node.status({fill:"green",shape:"dot",text:"high"});
if (node.interrupt=== "r" || node.interrupt === "b") {
node.send(msg);
}
break;
default:
}
default: {
node.status({fill:"grey",shape:"ring",text:"unknown"});
}
}
});
switch (node.x.read()) {
case 0:
case 0: {
node.status({fill:"green",shape:"ring",text:"low"});
break;
case 1:
}
case 1: {
node.status({fill:"green",shape:"dot",text:"high"});
break;
default:
}
default: {
node.status({});
}
}
this.on('close', function() {
node.x.isr(m.EDGE_BOTH, null);

View File

@@ -10,7 +10,8 @@ module.exports = function(RED) {
var node = this;
if (node.pin === 14) {
node.p = new m.Gpio(3,false,true); // special for onboard LED v1
} else {
}
else {
node.p = new m.Gpio(node.pin);
}
node.p.mode(m.PIN_GPIO);
@@ -21,7 +22,8 @@ module.exports = function(RED) {
node.on("input", function(msg) {
if (msg.payload == "1") {
node.p.write(1);
} else {
}
else {
node.p.write(0);
}
});