From 9170cc6282a45d7d2b84728bef11b6553d939f19 Mon Sep 17 00:00:00 2001 From: dceejay Date: Thu, 29 Jan 2015 16:41:39 +0000 Subject: [PATCH] Little extra loading error handling for BBB node --- hardware/BBB/145-BBB-hardware.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/hardware/BBB/145-BBB-hardware.js b/hardware/BBB/145-BBB-hardware.js index d51fb6e2..17b916b2 100755 --- a/hardware/BBB/145-BBB-hardware.js +++ b/hardware/BBB/145-BBB-hardware.js @@ -41,12 +41,16 @@ module.exports = function (RED) { bonescript.pinMode(pin, direction, callback); } } catch (e) { - bonescript = require("bonescript"); - adjustName = function (pin) { - return pin; - }; - setPinMode = function (pin, direction, callback) { - bonescript.pinMode(pin, direction, undefined, undefined, undefined, callback); + try { + bonescript = require("bonescript"); + adjustName = function (pin) { + return pin; + }; + setPinMode = function (pin, direction, callback) { + bonescript.pinMode(pin, direction, undefined, undefined, undefined, callback); + } + } catch (e) { + throw "Info : Ignoring Beaglebone specific node."; } } @@ -549,4 +553,4 @@ module.exports = function (RED) { clearTimeout(this.pulseTimer); } }; -}; \ No newline at end of file +};