1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-24 16:55:24 +03:00

Issue #74: Show battery & statuses in top bar

- Battery voltage appears as a horizontal bar
- Autodetection of battery type is used to calculate the bar min, max &
alarm values according to the battery configuration parameters.
- Color changes to red when battery level goes under the alarm setting
- Armed, failsafe and Serial Link status icons below battery voltage
monitor
- Change calibration button contents to "Calibrating" during calibration
This commit is contained in:
gael 2016-04-20 01:38:23 +02:00
parent 81a49d48b2
commit 0518ed6993
15 changed files with 433 additions and 40 deletions

View file

@ -128,6 +128,9 @@ var MSP = {
ledDirectionLetters: ['n', 'e', 's', 'w', 'u', 'd'], // in LSB bit order
ledFunctionLetters: ['i', 'w', 'f', 'a', 't', 'r', 'c'], // in LSB bit order
last_received_timestamp: null,
analog_last_received_timestamp: null,
supportedBaudRates: [ // 0 based index.
'AUTO',
'9600',
@ -233,6 +236,7 @@ var MSP = {
console.log('Unknown state detected: ' + this.state);
}
}
this.last_received_timestamp = Date.now();
},
process_data: function (code, message_buffer, message_length) {
var data = new DataView(message_buffer, 0); // DataView (allowing us to view arrayBuffer as struct/union)
@ -330,6 +334,7 @@ var MSP = {
ANALOG.mAhdrawn = data.getUint16(1, 1);
ANALOG.rssi = data.getUint16(3, 1); // 0-1023
ANALOG.amperage = data.getInt16(5, 1) / 100; // A
this.analog_last_received_timestamp = Date.now();
break;
case MSP_codes.MSP_RC_TUNING:
var offset = 0;