mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-22 07:45:29 +03:00
polishing serial backend and background page
This commit is contained in:
parent
49317da015
commit
a81cdb6d9d
3 changed files with 13 additions and 18 deletions
|
@ -10,9 +10,9 @@ function start_app() {
|
|||
window_child.onClosed.addListener(function() {
|
||||
// connectionId is passed from the script side through the chrome.runtime.getBackgroundPage refference
|
||||
// allowing us to automatically close the port when application shut down
|
||||
if (connectionId != -1) {
|
||||
chrome.serial.close(connectionId, function() {
|
||||
console.log('CLEANUP: Connection to serial port was opened after application closed, closing the connection.');
|
||||
if (app_window.connectionId > 0) {
|
||||
chrome.serial.close(app_window.connectionId, function(result) {
|
||||
console.log('SERIAL: Connection closed - ' + result);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue