From cbb5f06016c3da72a813bbbbd08f80574075a9e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20M=C3=A4del?= Date: Sat, 14 Jun 2014 14:39:57 +0200 Subject: [PATCH] Changed the non-IRQ checking interval for some reason the interval was set to 0ms, which lead to an infinite loop of memory allocations quickly resulting in a segmentation fault. --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5995dd7..d8616ad 100644 --- a/index.js +++ b/index.js @@ -394,7 +394,7 @@ exports.connect = function (spi,ce,irq) { console.warn("Recommend use with IRQ pin, fallback handling is suboptimal."); irqListener = setInterval(function () { // TODO: clear interval when there are no listeners? if (nrf.listeners('interrupt').length) nrf._checkStatus(false); - }, 0); // (minimum 4ms is a looong time if hoping to quickly stream data!) + }, 4); // (minimum 4ms is a looong time if hoping to quickly stream data!) } irqOn = true; }; @@ -678,4 +678,4 @@ exports.connect = function (spi,ce,irq) { nrf.on('interrupt', function (d) { if (nrf._debug) console.log("IRQ.", d); }); return nrf; -} \ No newline at end of file +}