Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
HThuren committed Mar 13, 2023
1 parent 82098b9 commit 1513f19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/js/sensor_helpers.js
Expand Up @@ -19,7 +19,7 @@ export function have_sensor(sensors_detected, sensor_code) {
return false;
}

export function sensor_status(sensors_detected, gps_fix_state) {
export function sensor_status(sensors_detected = 0, gps_fix_state = 0) {
// initialize variable (if it wasn't)
if (!sensor_status.previous_sensors_detected) {
sensor_status.previous_sensors_detected = -1; // Otherwise first iteration will not be run if sensors_detected == 0
Expand Down Expand Up @@ -76,7 +76,7 @@ export function sensor_status(sensors_detected, gps_fix_state) {

if (have_sensor(sensors_detected, "gps")) {
$(".gps", eSensorStatus).addClass("on");
if (gps_fix_state > 0) {
if (gps_fix_state) {
$(".gpsicon", eSensorStatus).removeClass("active");
$(".gpsicon", eSensorStatus).addClass("active_fix");
} else {
Expand Down
5 changes: 2 additions & 3 deletions src/js/serial_backend.js
Expand Up @@ -213,7 +213,7 @@ function finishClose(finishedCallback) {
$('div.connect_controls div.connect_state').text(i18n.getMessage('connect'));

// reset active sensor indicators
sensor_status(0, 0);
sensor_status();

if (wasConnected) {
// detach listeners and remove element data
Expand Down Expand Up @@ -348,7 +348,7 @@ function onOpenVirtual() {
processBoardInfo();

update_dataflash_global();
sensor_status(FC.CONFIG.activeSensors, 0);
sensor_status(FC.CONFIG.activeSensors);
updateTabList(FC.FEATURE_CONFIG.features);
}

Expand Down Expand Up @@ -667,7 +667,6 @@ async function getStatus() {

async function update_live_status() {
const statuswrapper = $('#quad-status_wrapper');
// const sensorState = $('#sensor-status');

if (GUI.active_tab !== 'cli' && GUI.active_tab !== 'presets') {
await MSP.promise(MSPCodes.MSP_BOXNAMES);
Expand Down

0 comments on commit 1513f19

Please sign in to comment.