Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit 326e15c

Browse files
2 parents cc2722e + 739d38d commit 326e15c

File tree

3 files changed

+10
-38
lines changed

3 files changed

+10
-38
lines changed

node/compiler.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
var uploader = require('./compiler/uploader');
2121
var platform = require('./compiler/platform');
2222

23-
2423
var domainName = "org-arduino-ide-domain-compiler";
2524

2625
var dm, prg = "arduino";
@@ -271,7 +270,6 @@
271270
}
272271

273272

274-
275273
function compile(options, sketchDir, up) {
276274
console.log("I'm Compiler and I'm wearing my sunglasses");
277275
dm.emitEvent (domainName, "console-log", "Start Building");
@@ -374,7 +372,7 @@
374372
calculateLibs(includedLibs,includepaths,libextra, debug, cb, plat, options.sketchbook);
375373
});
376374

377-
//3. actually compile code
375+
//3. compile code
378376
tasks.push(function(cb) {
379377
console.log("moving on now");
380378
debug("include paths = ", JSON.stringify(includepaths,null, ' '));

node/compiler/uploader.js

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ var SerialPort = require('serialport').SerialPort,
1111
sp = null;
1212

1313
var SerialPort2 = require('serialport');
14-
15-
//function runAVRDude(hexfile, portpath, options, debug, cb) {
14+
1615
function runAVRDude(hexfile, options, debug, cb) {
1716
debug("running AVR dude");
1817
if(options.platform.useSerial()) {
@@ -43,17 +42,6 @@ function runAVRDude(hexfile, options, debug, cb) {
4342
}
4443

4544
console.log("running", uploadcmd.join(' '));
46-
//---------------------------------
47-
//sp = new SerialPort(portpath,{
48-
// sp = new SerialPort(options.port,{ baudRate:1200 });
49-
// sp = new SerialPort(options.port);
50-
51-
// sp.on('open',function() {
52-
// sp.close(function(err) {
53-
// if(!err){
54-
//var start = new Date().getTime();
55-
//while(((new Date).getTime()-start)<=2000){};
56-
5745
var result = child_process.execFile(
5846
uploadcmd[0],
5947
uploadcmd.slice(1),
@@ -77,11 +65,6 @@ function runAVRDude(hexfile, options, debug, cb) {
7765
}
7866
}
7967
);
80-
// }
81-
// else
82-
// console.log("APERTURA errore");
83-
// });
84-
// });
8568
}
8669

8770
function scanForPortReturn(list1,options, cb) {
@@ -97,8 +80,7 @@ function scanForPortReturn(list1,options, cb) {
9780
},700);
9881
} else {
9982
console.log('we are back to normal!');
100-
//TODO controllare
101-
console.log("....................................................")
83+
//TODO
10284
setTimeout(function() {
10385
console.log(JSON.stringify(list2));
10486
console.log("TEST 2: "+options.device.uid.length);
@@ -111,11 +93,9 @@ function scanForPortReturn(list1,options, cb) {
11193
//if (list2[item].pnpId=="") {
11294
console.log("SELECTED : " + JSON.stringify(list2[item]));
11395
selected = list2[item].comName;
114-
//cb(list2[item].comName);
11596
}
11697
}
11798
}
118-
//cb(list1[list1.length-1].comName);
11999
cb(selected);
120100
},500);
121101
}
@@ -194,8 +174,6 @@ exports.upload = function(hexfile,options, publish, callback) {
194174
}
195175
}
196176
console.log("uploading to device using ",options.device);
197-
198-
//if(options.device.bootloader.path == 'caterina') {
199177
if(options.device.bootloader.file.indexOf('caterina')> -1) {
200178
console.log("need to do the leonardo dance");
201179

@@ -233,7 +211,7 @@ exports.upload = function(hexfile,options, publish, callback) {
233211
}
234212
}
235213

236-
//TODO modificare port con options.port e lasciare un solo parametro
214+
//TODO edit port -> options.port ; 1 parameter
237215
exports.writeBootloader = function(port, options){
238216
console.log("running AVR dude");
239217

@@ -254,8 +232,7 @@ exports.writeBootloader = function(port, options){
254232

255233
if(options.verboseupload)
256234
cmd.push('-v','-v','-v', '-v');
257-
258-
console.log("******************************************");
235+
259236
console.log("writing bootloader \n", uploadcmd.join(' '));
260237

261238
var newcmd = customizeUpload(uploadcmd, uploadcmd[searchStringInArray('-c', uploadcmd)].slice(2));

node/discover.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
Async.filter(ports,
7676
function(item, cbk_2_1){
7777

78-
//MACOSX
79-
if(process.platform == "mac" || process.platform == "darwin"){
78+
//MACOSX AND LINUX
79+
if(process.platform == "mac" || process.platform == "darwin" || process.platform == "linux"){
8080
if(pids.length == 0)
8181
cbk_2_1(true);
8282
else
@@ -86,7 +86,7 @@
8686
cbk_2_1(false);
8787
}
8888

89-
//WIN:
89+
//WIN
9090
if(process.platform == "win" || process.platform == "win32" || process.platform == "win64"){
9191

9292
item.vendorId = "0X"+item.pnpId.substring(item.pnpId.indexOf("VID_")+4, item.pnpId.indexOf("VID_")+8);
@@ -100,9 +100,6 @@
100100
else
101101
cbk_2_1(false);
102102
}
103-
104-
//TODO LINUX
105-
106103
},
107104
function(result){
108105
cbk_2(null, result);
@@ -116,8 +113,8 @@
116113

117114
bport.address = port.comName; //ADDRESS
118115
bport.protcol = "serial"; //PROTOCOL
119-
//MACOSX
120-
if(process.platform == "mac" || process.platform == "darwin"){
116+
//MACOSX AND LINUX
117+
if(process.platform == "mac" || process.platform == "darwin" || process.platform == "linux"){
121118
bport.vid = port.vendorId;
122119
bport.pid = port.productId;
123120
}

0 commit comments

Comments
 (0)