mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-23 16:25:19 +03:00
Deduplicatrion of the queue and delayed release of hard lock
This commit is contained in:
parent
a4fd2bce9d
commit
93bb0eba4f
3 changed files with 32 additions and 1 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
const MSPCodes = require('./msp/MSPCodes')
|
||||
const mspQueue = require('./serial_queue');
|
||||
const eventFrequencyAnalyzer = require('./eventFrequencyAnalyzer');
|
||||
const timeout = require('./timeouts');
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -265,7 +267,9 @@ var MSP = {
|
|||
/*
|
||||
* Free port
|
||||
*/
|
||||
mspQueue.freeHardLock();
|
||||
timeout.add('delayedFreeHardLock', function() {
|
||||
mspQueue.freeHardLock();
|
||||
}, 50);
|
||||
|
||||
// Reset variables
|
||||
this.message_length_received = 0;
|
||||
|
@ -301,6 +305,8 @@ var MSP = {
|
|||
var checksum;
|
||||
var ii;
|
||||
|
||||
eventFrequencyAnalyzer.put('MPS ' + code);
|
||||
|
||||
if (!protocolVersion) {
|
||||
protocolVersion = this.protocolVersion;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue