Skip to content
Browse files

Fix: move away from tpad flash building firmware. Do allow users to p…

…rovide a hex file of their own
  • Loading branch information...
1 parent 12032ad commit b1f8c50711b3778f26b0aba0f161e148a5118a45 @tmpvar committed Aug 16, 2012
Showing with 6 additions and 25 deletions.
  1. +6 −25 firmware/index.js
View
31 firmware/index.js
@@ -26,10 +26,11 @@ var firmware = module.exports = function(options) {
firmware.flash(hexData, options);
});
} else {
- console.log('Using firmware', path.resolve(options.location));
- firmware.build(firmwareFolder, options, function(err) {
- firmware.flash(firmwareFolder, options);
- })
+ var hexFilePath = path.resolve(options.location);
+ console.log('Using firmware', hexFilePath);
+ fs.readFile(hexFilePath, function(err, data) {
+ firmware.flash(data.toString(), options);
+ });
}
};
@@ -68,28 +69,8 @@ firmware.fetch = function(options, fn) {
});
};
-// build all of the firmware
-firmware.build = function(dir, options, fn) {
-
- if (options.build) {
- console.log('building...');
-
- exec('make', {
- cwd : dir
- }, function (error, stdout, stderr) {
- if (error) {
- throw error;
- } else {
- fn();
- }
- });
- } else {
- fn();
- }
-};
-
// Basically wait for the known tpad connection to drop
-// wait 2 seconds then run avrdude
+// wait 2 seconds then run chip.avr.lufacdc's flash mechanism
firmware.waitForReset = function(options, fn) {
// attempt a software reset (as of firmware 0.0.2)

0 comments on commit b1f8c50

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