Merge pull request #225 from mikeller/fix_connection_active_indicator

Fixed 'connection active' indicator.
10.3.x-maintenance
Michael Keller 2016-08-16 23:59:50 +12:00 committed by GitHub
commit abaf226818
3 changed files with 4 additions and 3 deletions

View File

@ -170,7 +170,8 @@ var FC = {
voltage: 0,
mAhdrawn: 0,
rssi: 0,
amperage: 0
amperage: 0,
last_received_timestamp: Date.now()
};
ARMING_CONFIG = {

View File

@ -115,7 +115,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
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(); //TODO, fix this
ANALOG.last_received_timestamp = Date.now();
break;
case MSPCodes.MSP_RC_TUNING:
var offset = 0;

View File

@ -475,7 +475,7 @@ function update_live_status() {
MSP.send_message(MSPCodes.MSP_ANALOG, false, false);
}
var active = ((Date.now() - MSP.analog_last_received_timestamp) < 300);
var active = ((Date.now() - ANALOG.last_received_timestamp) < 300);
for (var i = 0; i < AUX_CONFIG.length; i++) {
if (AUX_CONFIG[i] == 'ARM') {