another run on undefined comparators
parent
468d7f57c8
commit
dbf528345e
|
@ -30,7 +30,7 @@ var GUI_control = function () {
|
|||
// interval = time interval in miliseconds
|
||||
// first = true/false if code should be ran initially before next timer interval hits
|
||||
GUI_control.prototype.interval_add = function (name, code, interval, first) {
|
||||
var data = {'name': name, 'timer': undefined, 'code': code, 'interval': interval, 'fired': 0, 'paused': false};
|
||||
var data = {'name': name, 'timer': null, 'code': code, 'interval': interval, 'fired': 0, 'paused': false};
|
||||
|
||||
if (first == true) {
|
||||
code(); // execute code
|
||||
|
@ -132,7 +132,7 @@ GUI_control.prototype.interval_kill_all = function (keep_array) {
|
|||
// timeout = timeout in miliseconds
|
||||
GUI_control.prototype.timeout_add = function (name, code, timeout) {
|
||||
var self = this;
|
||||
var data = {'name': name, 'timer': undefined, 'timeout': timeout};
|
||||
var data = {'name': name, 'timer': null, 'timeout': timeout};
|
||||
|
||||
// start timer with "cleaning" callback
|
||||
data.timer = setTimeout(function() {
|
||||
|
|
|
@ -59,8 +59,8 @@ var MSP = {
|
|||
code: 0,
|
||||
message_length_expected: 0,
|
||||
message_length_received: 0,
|
||||
message_buffer: undefined,
|
||||
message_buffer_uint8_view: undefined,
|
||||
message_buffer: null,
|
||||
message_buffer_uint8_view: null,
|
||||
message_checksum: 0,
|
||||
|
||||
callbacks: [],
|
||||
|
|
|
@ -13,7 +13,7 @@ var serial = {
|
|||
var self = this;
|
||||
|
||||
chrome.serial.connect(path, options, function(connectionInfo) {
|
||||
if (connectionInfo !== undefined) {
|
||||
if (connectionInfo) {
|
||||
self.connectionId = connectionInfo.connectionId;
|
||||
self.bitrate = connectionInfo.bitrate;
|
||||
self.bytes_received = 0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
$(document).ready(function() {
|
||||
$('div#port-picker a.connect').click(function() {
|
||||
$(document).ready(function () {
|
||||
$('div#port-picker a.connect').click(function () {
|
||||
if (GUI.connect_lock != true) { // GUI control overrides the user control
|
||||
var clicks = $(this).data('clicks');
|
||||
|
||||
|
@ -60,8 +60,8 @@ $(document).ready(function() {
|
|||
});
|
||||
|
||||
// auto-connect
|
||||
chrome.storage.local.get('auto_connect', function(result) {
|
||||
if (typeof result.auto_connect === 'undefined' || result.auto_connect) {
|
||||
chrome.storage.local.get('auto_connect', function (result) {
|
||||
if (!result.auto_connect || result.auto_connect) {
|
||||
// default or enabled by user
|
||||
GUI.auto_connect = true;
|
||||
|
||||
|
@ -78,7 +78,7 @@ $(document).ready(function() {
|
|||
}
|
||||
|
||||
// bind UI hook to auto-connect checkbos
|
||||
$('input.auto_connect').change(function() {
|
||||
$('input.auto_connect').change(function () {
|
||||
GUI.auto_connect = $(this).is(':checked');
|
||||
|
||||
// update title/tooltip
|
||||
|
@ -111,8 +111,8 @@ function onOpen(openInfo) {
|
|||
GUI.log(chrome.i18n.getMessage('serialPortOpened', [openInfo.connectionId]));
|
||||
|
||||
// save selected port with chrome.storage if the port differs
|
||||
chrome.storage.local.get('last_used_port', function(result) {
|
||||
if (typeof result.last_used_port != 'undefined') {
|
||||
chrome.storage.local.get('last_used_port', function (result) {
|
||||
if (result.last_used_port) {
|
||||
if (result.last_used_port != GUI.connected_to) {
|
||||
// last used port doesn't match the one found in local db, we will store the new one
|
||||
chrome.storage.local.set({'last_used_port': GUI.connected_to});
|
||||
|
@ -127,7 +127,7 @@ function onOpen(openInfo) {
|
|||
|
||||
if (!CONFIGURATOR.mspPassThrough) {
|
||||
// disconnect after 10 seconds with error if we don't get IDENT data
|
||||
GUI.timeout_add('connecting', function() {
|
||||
GUI.timeout_add('connecting', function () {
|
||||
if (!CONFIGURATOR.connectionValid) {
|
||||
GUI.log(chrome.i18n.getMessage('noConfigurationReceived'));
|
||||
|
||||
|
@ -136,9 +136,9 @@ function onOpen(openInfo) {
|
|||
}, 10000);
|
||||
|
||||
// request configuration data
|
||||
MSP.send_message(MSP_codes.MSP_UID, false, false, function() {
|
||||
MSP.send_message(MSP_codes.MSP_UID, false, false, function () {
|
||||
GUI.log(chrome.i18n.getMessage('uniqueDeviceIdReceived', [CONFIG.uid[0].toString(16) + CONFIG.uid[1].toString(16) + CONFIG.uid[2].toString(16)]));
|
||||
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.log(chrome.i18n.getMessage('firmwareVersion', [CONFIG.version]));
|
||||
|
|
|
@ -28,7 +28,7 @@ TABS.receiver.initialize = function (callback) {
|
|||
$('.tunings .rate input[name="expo"]').val(RC_tuning.RC_EXPO.toFixed(2));
|
||||
|
||||
chrome.storage.local.get('rx_refresh_rate', function (result) {
|
||||
if (typeof result.rx_refresh_rate != 'undefined') {
|
||||
if (result.rx_refresh_rate) {
|
||||
$('select[name="rx_refresh_rate"]').val(result.rx_refresh_rate).change();
|
||||
} else {
|
||||
$('select[name="rx_refresh_rate"]').change(); // start with default value
|
||||
|
|
Loading…
Reference in New Issue