rem: var slots = file_find('/sys/devices', /^bone_capemgr./) + '/slots'; var helper = file_find('/sys/module/bone_iio_helper/drivers/platform:bone-iio-helper', /^helper./); 
add: var slots = file_find('/sys/devices', /^bone_capemgr\./) + '/slots'; var helper = file_find('/sys/module/bone_iio_helper/drivers/platform:bone-iio-helper', /^helper\./); 
context: f.analogRead = function(pin, callback) {    winston.debug('analogRead(' + [pin] + ');');    pin = getpin(pin);    if(!this.filePrefix) {        var slots = file_find('/sys/devices', /^bone_capemgr./) + '/slots';        var helper = file_find('/sys/module/bone_iio_helper/drivers/platform:bone-iio-helper', /^helper./);        var prefix_new = helper + '/AIN';        var prefix_old = '/sys/bus/platform/devices/tsc/ain';        if(file_existsSync(slots)) {            if(!file_existsSync(prefix_new + '0')) {                fs.writeFileSync(slots, 'cape-bone-iio');                for(var i = 0; i < 10000; i++) {                    if(file_existsSync(prefix_new + '0')) break;                }            }        }        if(file_existsSync(prefix_new + '0')) {            this.filePrefix = prefix_new;            this.indexOffset = 0;            this.scale = 1800;        } else {            this.filePrefix = prefix_old;            this.indexOffset = 1;            this.scale = 4096;        }    }    var ainFile = this.filePrefix + (pin.ain + this.indexOffset).toString();    if(callback) {        var readFile = function(err, data) {            if(err) {                delete this.filePrefix;                winston.error('analogRead error: ' + err);            }            var value = parseInt(data, 10) / this.scale;            callback({'value': value});        };        fs.readFile(ainFile, readFile);        return(true);    }    var data = parseInt(fs.readFileSync(ainFile), 10);    if(isNaN(data)) {        delete this.filePrefix;        throw('analogRead(' + pin.key + ') returned ' + data);    }    data = data / this.scale;    if(isNaN(data)) {        delete this.filePrefix;        throw('analogRead(' + pin.key + ') scaled to ' + data);    }    return(data);}; 
meta: 3863	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3863/a94dc02da3e8ccf591be8476a78fe861507c2b13/index.js/clean/node_modules/bonescript/index.js