another run on undefined comparators

10.3.x-maintenance
cTn 2014-08-14 16:41:49 +02:00 committed by Dominic Clifton
parent 644fb5afed
commit d4f4d619cf
5 changed files with 16 additions and 16 deletions

View File

@ -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() {

View File

@ -61,8 +61,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: [],

View File

@ -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;

View File

@ -61,7 +61,7 @@ $(document).ready(function() {
// auto-connect
chrome.storage.local.get('auto_connect', function (result) {
if (typeof result.auto_connect === 'undefined' || result.auto_connect) {
if (!result.auto_connect || result.auto_connect) {
// default or enabled by user
GUI.auto_connect = true;
@ -112,7 +112,7 @@ function onOpen(openInfo) {
// 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') {
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});

View File

@ -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