loosing up verification for interface init

10.3.x-maintenance
cTn 2013-12-03 20:52:00 +01:00
parent 83726bc392
commit 04ee01f057
1 changed files with 7 additions and 1 deletions

View File

@ -337,12 +337,18 @@ STM32_protocol.prototype.upload_procedure = function(step) {
switch (step) { switch (step) {
case 1: case 1:
// initialize serial interface on the MCU side, auto baud rate settings // initialize serial interface on the MCU side, auto baud rate settings
// we could probably use interval timer here to try 2-3 times and then fail afterwards
self.send([0x7F], 1, function(reply) { self.send([0x7F], 1, function(reply) {
if (self.verify_response(self.status.ACK, reply)) { if (reply[0] == self.status.ACK || reply[0] == self.status.NACK) {
console.log('STM32 - Serial interface initialized on the MCU side'); console.log('STM32 - Serial interface initialized on the MCU side');
// proceed to next step // proceed to next step
self.upload_procedure(2); self.upload_procedure(2);
} else {
STM32.GUI_status('STM32 Communication with bootloader <span style="color: red">failed</span>');
// disconnect
this.upload_procedure(99);
} }
}); });
break; break;