Skip to content
Browse files

Add: human friendly output of flashing process, and --debug flag

  • Loading branch information...
1 parent f7bca2a commit 1c64de320e75d7516c2a6b55b8a2ff1e8571ca84 @tmpvar committed Aug 16, 2012
Showing with 9 additions and 4 deletions.
  1. +1 −1 bin/tpad
  2. +8 −3 firmware/index.js
View
2 bin/tpad
@@ -99,7 +99,7 @@ if (!command) {
// allow the user to specify a development version of the tpad firmware
config.location = argv._[1] || null;
-
+ config.debug = !!argv.debug;
flash(config);
});
View
11 firmware/index.js
@@ -39,6 +39,10 @@ firmware.fetch = function(options, fn) {
// get the latest firmware
console.log('finding the latest firmware');
request('https://api.github.com/repos/tmpvar/tpad-firmware/git/refs/tags', function(err, res) {
+ if (err) {
+ return fn(err);
+ }
+
var data = JSON.parse(res.body);
// find the latest version
@@ -127,18 +131,19 @@ firmware.flash = function(hexData, options, fn) {
var sp = new SerialPort(options.serialport.port);
sp.on('open', function() {
- lufacdc.init(sp, function (err, flasher) {
+ lufacdc.init(sp, options, function (err, flasher) {
if (err) {
throw err;
}
+ console.log('\nerasing chip')
flasher.erase(function() {
- console.log('initialized');
+ console.log('programming');
flasher.program(hexData, function(err) {
if (err) throw err;
- console.log('programmed!');
+ console.log('verifying')
flasher.verify(function(err) {
if (err) {
throw err

0 comments on commit 1c64de3

Please sign in to comment.
Something went wrong with that request. Please try again.