mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-14 20:10:13 +03:00
Fix board select trigger after flashing
Detect unofficial targets
This commit is contained in:
parent
bf9072b1ff
commit
b44b7ecc2e
2 changed files with 21 additions and 3 deletions
|
@ -3294,6 +3294,10 @@
|
||||||
"message": "Configurator has <span class=\"message-positive\">successfully</span> detected and verified the board: <strong>{{boardName}}</strong>",
|
"message": "Configurator has <span class=\"message-positive\">successfully</span> detected and verified the board: <strong>{{boardName}}</strong>",
|
||||||
"description": "Board verification has succeeded."
|
"description": "Board verification has succeeded."
|
||||||
},
|
},
|
||||||
|
"firmwareFlasherBoardVerficationTargetNotAvailable": {
|
||||||
|
"message": "Configurator has detected the board: <strong>{{boardName}}</strong> but no official Betaflight target was found",
|
||||||
|
"description": "Board verification has succeeded, but the target is not available as offical Betaflight target."
|
||||||
|
},
|
||||||
"firmwareFlasherBoardVerificationFail": {
|
"firmwareFlasherBoardVerificationFail": {
|
||||||
"message": "Configurator <span class=\"message-negative\">failed</span> to verify the board, if this does not work please try switching tab slowly to retry, make a new usb connection or connect first if you might have forgotten to apply custom defaults",
|
"message": "Configurator <span class=\"message-negative\">failed</span> to verify the board, if this does not work please try switching tab slowly to retry, make a new usb connection or connect first if you might have forgotten to apply custom defaults",
|
||||||
"description": "Sometimes MSP values cannot be read from firmware correctly"
|
"description": "Sometimes MSP values cannot be read from firmware correctly"
|
||||||
|
|
|
@ -797,9 +797,23 @@ firmware_flasher.initialize = function (callback) {
|
||||||
|
|
||||||
function onFinish() {
|
function onFinish() {
|
||||||
const board = FC.CONFIG.boardName;
|
const board = FC.CONFIG.boardName;
|
||||||
|
const boardSelect = $('select[name="board"]');
|
||||||
|
const boardSelectOptions = $('select[name="board"] option');
|
||||||
|
const target = boardSelect.val();
|
||||||
|
let targetAvailable = false;
|
||||||
|
|
||||||
if (board) {
|
if (board) {
|
||||||
$('select[name="board"]').val(board).trigger('change');
|
boardSelectOptions.each((_, e) => {
|
||||||
GUI.log(i18n.getMessage('firmwareFlasherBoardVerificationSuccess', {boardName: board}));
|
if ($(e).text() === board) {
|
||||||
|
targetAvailable = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (board !== target) {
|
||||||
|
boardSelect.val(board).trigger('change');
|
||||||
|
}
|
||||||
|
GUI.log(i18n.getMessage(targetAvailable ? 'firmwareFlasherBoardVerificationSuccess' : 'firmwareFlasherBoardVerficationTargetNotAvailable',
|
||||||
|
{ boardName: board }));
|
||||||
} else {
|
} else {
|
||||||
GUI.log(i18n.getMessage('firmwareFlasherBoardVerificationFail'));
|
GUI.log(i18n.getMessage('firmwareFlasherBoardVerificationFail'));
|
||||||
}
|
}
|
||||||
|
@ -869,7 +883,7 @@ firmware_flasher.initialize = function (callback) {
|
||||||
function updateDetectBoardButton() {
|
function updateDetectBoardButton() {
|
||||||
const isDfu = portPickerElement.val().includes('DFU');
|
const isDfu = portPickerElement.val().includes('DFU');
|
||||||
const isBusy = GUI.connect_lock;
|
const isBusy = GUI.connect_lock;
|
||||||
const isLoaded = self.releases ? Object.keys(self.releases).length > 1 : false;
|
const isLoaded = self.releases ? Object.keys(self.releases).length > 0 : false;
|
||||||
const isAvailable = PortHandler.port_available || false;
|
const isAvailable = PortHandler.port_available || false;
|
||||||
const isButtonDisabled = isDfu || isBusy || !isLoaded || !isAvailable;
|
const isButtonDisabled = isDfu || isBusy || !isLoaded || !isAvailable;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue