1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-23 16:25:19 +03:00

report IMU2 hardware status

This commit is contained in:
Pawel Spychalski (DzikuVx) 2021-08-12 15:00:03 +02:00
parent 291a2289c2
commit f719f7c464
8 changed files with 37 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View file

@ -93,7 +93,8 @@ var FC = {
gpsHwStatus: 0,
rangeHwStatus: 0,
speedHwStatus: 0,
flowHwStatus: 0
flowHwStatus: 0,
imu2HwStatus: 0
};
SENSOR_CONFIG = {

View file

@ -1,4 +1,4 @@
/*global $, SERVO_DATA, PID_names, ADJUSTMENT_RANGES, RXFAIL_CONFIG, SERVO_CONFIG*/
/*global $, SERVO_DATA, PID_names, ADJUSTMENT_RANGES, RXFAIL_CONFIG, SERVO_CONFIG,CONFIG*/
'use strict';
var mspHelper = (function (gui) {
@ -133,6 +133,12 @@ var mspHelper = (function (gui) {
SENSOR_STATUS.rangeHwStatus = data.getUint8(6);
SENSOR_STATUS.speedHwStatus = data.getUint8(7);
SENSOR_STATUS.flowHwStatus = data.getUint8(8);
if (semver.gte(CONFIG.flightControllerVersion, "3.1.0")) {
SENSOR_STATUS.imu2HwStatus = data.getUint8(9);
} else {
SENSOR_STATUS.imu2HwStatus = 0;
}
sensor_status_ex(SENSOR_STATUS);
break;

View file

@ -403,6 +403,7 @@ function sensor_status_ex(hw_status)
sensor_status_update_icon('.sonar', '.sonaricon', hw_status.rangeHwStatus);
sensor_status_update_icon('.airspeed', '.airspeedicon', hw_status.speedHwStatus);
sensor_status_update_icon('.opflow', '.opflowicon', hw_status.flowHwStatus);
sensor_status_update_icon('.imu2', '.imu2icon', hw_status.imu2HwStatus);
}
function sensor_status_update_icon(sensId, sensIconId, status)
@ -437,7 +438,8 @@ function sensor_status_hash(hw_status)
hw_status.gpsHwStatus +
hw_status.rangeHwStatus +
hw_status.speedHwStatus +
hw_status.flowHwStatus;
hw_status.flowHwStatus +
hw_status.imu2HwStatus;
}
/**
@ -460,6 +462,7 @@ function sensor_status(sensors_detected) {
SENSOR_STATUS.rangeHwStatus = have_sensor(sensors_detected, 'sonar') ? 1 : 0;
SENSOR_STATUS.speedHwStatus = have_sensor(sensors_detected, 'airspeed') ? 1 : 0;
SENSOR_STATUS.flowHwStatus = have_sensor(sensors_detected, 'opflow') ? 1 : 0;
SENSOR_STATUS.imu2HwStatus = have_sensor(sensors_detected, 'imu2') ? 1 : 0;
sensor_status_ex(SENSOR_STATUS);
}

View file

@ -318,6 +318,27 @@ input[type="number"]::-webkit-inner-spin-button {
color: #d40000;
}
.imu2icon {
background: url("../images/icons/sensor_imu2_off.png") no-repeat -5px 2px;
background-size: 40px;
height: 30px;
margin-top: 3px;
width: 100%;
padding-top: 40px;
color: #4f4f4f;
text-align: center;
}
.imu2icon.active {
background-image: url("../images/icons/sensor_imu2_on.png");
color: #818181;
}
.imu2icon.error {
background-image: url("../images/icons/sensor_imu2_error.png");
color: #d40000;
}
.magicon {
background: url("../images/icons/sensor_mag_off.png") no-repeat -5px 2px;
background-size: 42px;

View file

@ -138,6 +138,9 @@
<li class="airspeed" title="Airspeed">
<div class="airspeedicon">Speed</div>
</li>
<li class="imu2" title="IMU2">
<div class="imu2icon">IMU2</div>
</li>
</ul>
</div>
<div id="quad-status_wrapper">