Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

attiny-common

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

attiny-common - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

35

lib/index.js

@@ -32,3 +32,4 @@ /*

this.irq = hardware.digital[2].rawWrite(false);
this.spi = hardware.SPI({clockSpeed : 1000, dataMode:2, chipSelect:this.chipSelect, chipSelectDelayUs:500});
this.defaultSPISettings = {clockSpeed : 1000, dataMode:2, chipSelect:this.chipSelect, chipSelectDelayUs:500};
this.spi = hardware.SPI(this.defaultSPISettings);
this.transmitting = false;

@@ -80,7 +81,7 @@ this.listening = false;

});
}
}
else {
// Continue with the initialziation process
self._checkModuleInformation(firmwareOptions, readFirmwareVersion, readModuleID, callback);
}
}
});

@@ -112,3 +113,3 @@ });

// But the module ID is wring, this is bad
else if (readModuleID != firmwareOptions.moduleID) {
else if (readModuleID != firmwareOptions.moduleID) {

@@ -164,11 +165,11 @@ // Abort so we don't flash the wrong firmware

});
};
};
Attiny.prototype.getFirmwareVersion = function (callback) {
this.getModuleInformation(FIRMWARE_CMD, callback);
};
};
Attiny.prototype.getModuleID = function (callback) {
this.getModuleInformation(MODULE_ID_CMD, callback);
};
};

@@ -190,3 +191,3 @@ Attiny.prototype.getModuleInformation = function(cmd, callback) {

var self = this;
// Update the firmware
// Update the firmware
isp.updateFirmware(this.hardware, firmwareOptions, function crcMatch(err) {

@@ -200,7 +201,9 @@

}
// Give the tiny some time to settle
setTimeout( function(){
// Then confirm the CRC is what we think it is
self.CRCCheck(firmwareOptions.crc, callback)
}, 500);
// Reset the chip so it reboots
self._reset(function() {
// Reset our SPI instance to the correct settings (1kHz)
self.spi = self.hardware.SPI(self.defaultSPISettings);
// Check the CRC was set correctly
self.CRCCheck(firmwareOptions.crc, callback)
});
});

@@ -275,3 +278,3 @@ }

return;
}
}
else if (self._validateResponse(res, [PACKET_CONF, CRC_CMD, false, false]) && res.length === 4) {

@@ -289,5 +292,5 @@ if (callback) {

});
}
module.exports = Attiny;
module.exports = Attiny;
{
"name": "attiny-common",
"version": "0.0.8",
"version": "0.0.9",
"description": "A common library for Tessel's ATTiny based modules",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc