mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 08:15:22 +03:00
Fixes after feedback
This commit is contained in:
parent
6334e1a3e9
commit
c22b69e7b5
1 changed files with 6 additions and 7 deletions
13
js/msp.js
13
js/msp.js
|
@ -737,13 +737,9 @@ var MSP = {
|
|||
case MSP_codes.MSP_NAME:
|
||||
var offset = 0;
|
||||
var name = '';
|
||||
var letter;
|
||||
do {
|
||||
letter = String.fromCharCode(data.getUint8(offset++));
|
||||
if (letter != '\0') {
|
||||
name += letter;
|
||||
}
|
||||
} while (letter != '\0');
|
||||
while (offset<data.byteLength) {
|
||||
name += String.fromCharCode(data.getUint8(offset++));;
|
||||
}
|
||||
CONFIG.name = name;
|
||||
break;
|
||||
|
||||
|
@ -1510,6 +1506,9 @@ MSP.crunch = function (code) {
|
|||
for (var i = 0; i<CONFIG.name.length; i++) {
|
||||
buffer.push(CONFIG.name.charCodeAt(i));
|
||||
}
|
||||
if (!buffer.length) {
|
||||
buffer.push('-'.charCodeAt(0));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue