1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-16 04:45:18 +03:00

Convert to CommonJS Modules Part 3

This commit is contained in:
Scavanger 2024-04-18 15:39:19 -03:00
parent ca13eefa1b
commit 06a4d8b0c8
74 changed files with 1949 additions and 10259 deletions

View file

@ -86,6 +86,17 @@ var MSP = {
lastFrameReceivedMs: 0,
processData: null,
init() {
mspQueue.setPutCallback(this.putCallback);
mspQueue.setremoveCallback(this.removeCallback);
},
setProcessData(cb) {
this.processData = cb;
},
read: function (readInfo) {
var data = new Uint8Array(readInfo.data);
@ -243,7 +254,7 @@ var MSP = {
_dispatch_message(expected_checksum) {
if (this.message_checksum == expected_checksum) {
// message received, process
mspHelper.processData(this);
this.processData(this);
this.lastFrameReceivedMs = Date.now();
} else {
console.log('code: ' + this.code + ' - crc failed');
@ -396,8 +407,4 @@ var MSP = {
}
};
MSP.SDCARD_STATE_NOT_PRESENT = 0;
MSP.SDCARD_STATE_FATAL = 1;
MSP.SDCARD_STATE_CARD_INIT = 2;
MSP.SDCARD_STATE_FS_INIT = 3;
MSP.SDCARD_STATE_READY = 4;
module.exports = MSP;