mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-17 21:35:30 +03:00
simplify hex referencing
This commit is contained in:
parent
d49e33bbad
commit
64dbef2c58
2 changed files with 5 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
var STM32_protocol = function() {
|
var STM32_protocol = function() {
|
||||||
this.hex; // hex object
|
this.hex; // ref
|
||||||
|
|
||||||
this.receive_buffer;
|
this.receive_buffer;
|
||||||
|
|
||||||
|
@ -52,8 +52,9 @@ STM32_protocol.prototype.GUI_status = function(string) {
|
||||||
};
|
};
|
||||||
|
|
||||||
// no input parameters
|
// no input parameters
|
||||||
STM32_protocol.prototype.connect = function() {
|
STM32_protocol.prototype.connect = function(hex) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
self.hex = hex;
|
||||||
|
|
||||||
var selected_port = String($('div#port-picker .port select').val());
|
var selected_port = String($('div#port-picker .port select').val());
|
||||||
var baud = parseInt($('div#port-picker #baud').val());
|
var baud = parseInt($('div#port-picker #baud').val());
|
||||||
|
|
|
@ -84,9 +84,7 @@ function tab_initialize_firmware_flasher() {
|
||||||
if (!$(this).hasClass('locked')) {
|
if (!$(this).hasClass('locked')) {
|
||||||
if (!GUI.connect_lock) { // button disabled while flashing is in progress
|
if (!GUI.connect_lock) { // button disabled while flashing is in progress
|
||||||
if (parsed_hex != false) {
|
if (parsed_hex != false) {
|
||||||
STM32.hex = parsed_hex;
|
STM32.connect(parsed_hex);
|
||||||
|
|
||||||
STM32.connect();
|
|
||||||
} else {
|
} else {
|
||||||
STM32.GUI_status('<span style="color: red">Firmware not loaded</span>');
|
STM32.GUI_status('<span style="color: red">Firmware not loaded</span>');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue