Skip to content

Commit 191d847

Browse files
author
Alberto Iannaccone
committed
minor fix
1 parent 01ec377 commit 191d847

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/boardConfiguration.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { takeUntil, filter, first } from 'rxjs/operators';
2323
import { provisioningSketch } from './sketches/provisioning.ino';
2424

2525
const BAUDRATE = 9600;
26-
const UPLOAD_DONE_TIMER = 5000;
2726
export default class BoardConfiguration {
2827
constructor(daemon) {
2928
this.CONFIGURE_IN_PROGRESS = 'CONFIGURE_IN_PROGRESS';
@@ -63,7 +62,6 @@ export default class BoardConfiguration {
6362
let partialMessage = '';
6463
const gettingCsr = new Promise((resolve, reject) => {
6564
const parseCsrQuestions = message => {
66-
// TODO: store partial messages
6765
partialMessage += message;
6866

6967
if (partialMessage.indexOf('No ECCX08 present') !== -1) {
@@ -201,7 +199,7 @@ export default class BoardConfiguration {
201199
err: error.toString()
202200
});
203201
});
204-
timer(UPLOAD_DONE_TIMER).subscribe(() => this.daemon.openSerialMonitor(board.port, BAUDRATE));
202+
this.daemon.openSerialMonitor(board.port, BAUDRATE);
205203
});
206204

207205
this.daemon.uploadingError.pipe(first()).subscribe(upload => {

src/socket-daemon.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import Daemon from './daemon';
3131
const MIN_VERSION = '1.1.71';
3232
const browser = detect();
3333
const POLLING_INTERVAL = 2500;
34+
const UPLOAD_DONE_TIMER = 5000;
3435

3536
const PROTOCOL = {
3637
HTTP: 'http',
@@ -333,7 +334,7 @@ export default class SocketDaemon extends Daemon {
333334
}
334335
if (message.Flash === 'Ok' && message.ProgrammerStatus === 'Done') {
335336
// After the upload is completed the port goes down for a while, so we have to wait a few seconds
336-
return timer(10000).subscribe(() => this.uploading.next({ status: this.UPLOAD_DONE, msg: message.Flash }));
337+
return timer(UPLOAD_DONE_TIMER).subscribe(() => this.uploading.next({ status: this.UPLOAD_DONE, msg: message.Flash }));
337338
}
338339
switch (message.ProgrammerStatus) {
339340
case 'Starting':

0 commit comments

Comments
 (0)