mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-14 20:10:11 +03:00
Handle 'overrun' conditions the same way as 'break' conditions.
This commit is contained in:
parent
2f6be0650f
commit
ab7ad4b07d
1 changed files with 10 additions and 4 deletions
14
js/serial.js
14
js/serial.js
|
@ -68,17 +68,20 @@ var serial = {
|
|||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case 'break':
|
||||
// This occurs on F1 boards with old firmware during reboot
|
||||
case 'overrun':
|
||||
// wait 50 ms and attempt recovery
|
||||
self.error = info.error;
|
||||
setTimeout(function() {
|
||||
chrome.serial.setPaused(info.connectionId, false, function() {
|
||||
self.getInfo(function (info) {
|
||||
if (info.paused) {
|
||||
// assume unrecoverable, disconnect
|
||||
console.log('SERIAL: Connection did not recover from break condition, disconnecting');
|
||||
console.log('SERIAL: Connection did not recover from ' + self.error + ' condition, disconnecting');
|
||||
GUI.log('Unrecoverable <span style="color: red">failure</span> of serial connection, disconnecting...');
|
||||
googleAnalytics.sendException('Serial: break condition - unrecoverable', false);
|
||||
googleAnalytics.sendException('Serial: ' + self.error + ' - unrecoverable', false);
|
||||
|
||||
if (GUI.connected_to || GUI.connecting_to) {
|
||||
$('a.connect').click();
|
||||
|
@ -87,19 +90,22 @@ var serial = {
|
|||
}
|
||||
}
|
||||
else {
|
||||
console.log('SERIAL: Connection recovered from break condition');
|
||||
googleAnalytics.sendException('Serial: break condition - recovered', false);
|
||||
console.log('SERIAL: Connection recovered from ' + self.error + ' condition');
|
||||
googleAnalytics.sendException('Serial: ' + self.error + ' - recovered', false);
|
||||
}
|
||||
});
|
||||
});
|
||||
}, 50);
|
||||
break;
|
||||
|
||||
case 'timeout':
|
||||
// TODO
|
||||
break;
|
||||
|
||||
case 'device_lost':
|
||||
// TODO
|
||||
break;
|
||||
|
||||
case 'disconnected':
|
||||
// TODO
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue