mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
implement build info
This commit is contained in:
parent
c24b8fb482
commit
4719d1562d
3 changed files with 26 additions and 11 deletions
|
@ -10,6 +10,7 @@ var CONFIGURATOR = {
|
||||||
|
|
||||||
var CONFIG = {
|
var CONFIG = {
|
||||||
version: 0,
|
version: 0,
|
||||||
|
buildInfo: '',
|
||||||
multiType: 0,
|
multiType: 0,
|
||||||
msp_version: 0,
|
msp_version: 0,
|
||||||
capability: 0,
|
capability: 0,
|
||||||
|
|
|
@ -462,8 +462,13 @@ var MSP = {
|
||||||
console.log('Reboot request accepted');
|
console.log('Reboot request accepted');
|
||||||
break;
|
break;
|
||||||
case MSP_codes.MSP_BUILDINFO:
|
case MSP_codes.MSP_BUILDINFO:
|
||||||
console.log('Build info received');
|
var buff = [];
|
||||||
// TODO implement this
|
|
||||||
|
for (var i = 0; i < data.byteLength; i++) {
|
||||||
|
buff.push(data.getUint8(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
CONFIG.buildInfo = String.fromCharCode.apply(null, buff);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -139,22 +139,31 @@ function onOpen(openInfo) {
|
||||||
MSP.send_message(MSP_codes.MSP_IDENT, false, false, function () {
|
MSP.send_message(MSP_codes.MSP_IDENT, false, false, function () {
|
||||||
GUI.timeout_remove('connecting'); // kill connecting timer
|
GUI.timeout_remove('connecting'); // kill connecting timer
|
||||||
|
|
||||||
// silencing firmware shoutout, since nobody cares anyway
|
// TODO clean / remove this after compatibility period is over
|
||||||
// GUI.log(chrome.i18n.getMessage('firmwareVersion', [CONFIG.version]));
|
|
||||||
|
|
||||||
if (!bit_check(CONFIG.capability, 30)) {
|
if (!bit_check(CONFIG.capability, 30)) {
|
||||||
GUI.log('Configurator detected that you are running an old version of the firmware and will operate in compatibility mode,\
|
GUI.log('Configurator detected that you are running an old version of the firmware and will operate in compatibility mode,\
|
||||||
to enjoy all of the recently implemented features, please <strong>update</strong> your firmware.');
|
to enjoy all of the recently implemented features, please <strong>update</strong> your firmware.');
|
||||||
}
|
|
||||||
|
|
||||||
if (CONFIG.version >= CONFIGURATOR.firmwareVersionAccepted) {
|
if (CONFIG.version >= CONFIGURATOR.firmwareVersionAccepted) {
|
||||||
CONFIGURATOR.connectionValid = true;
|
CONFIGURATOR.connectionValid = true;
|
||||||
|
|
||||||
$('div#port-picker a.connect').text(chrome.i18n.getMessage('disconnect')).addClass('active');
|
$('div#port-picker a.connect').text(chrome.i18n.getMessage('disconnect')).addClass('active');
|
||||||
$('#tabs li a:first').click();
|
$('#tabs li a:first').click();
|
||||||
|
} else {
|
||||||
|
GUI.log(chrome.i18n.getMessage('firmwareVersionNotSupported', [CONFIGURATOR.firmwareVersionAccepted]));
|
||||||
|
$('div#port-picker a.connect').click(); // disconnect
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
GUI.log(chrome.i18n.getMessage('firmwareVersionNotSupported', [CONFIGURATOR.firmwareVersionAccepted]));
|
MSP.send_message(MSP_codes.MSP_BUILDINFO, false, false, function () {
|
||||||
$('div#port-picker a.connect').click(); // disconnect
|
GUI.log('Running firmware released on: <strong>' + CONFIG.buildInfo + '</strong>');
|
||||||
|
|
||||||
|
// continue as usually
|
||||||
|
CONFIGURATOR.connectionValid = true;
|
||||||
|
|
||||||
|
$('div#port-picker a.connect').text(chrome.i18n.getMessage('disconnect')).addClass('active');
|
||||||
|
$('#tabs li a:first').click();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue