Skip to content

Commit abaf226

Browse files
authored
Merge pull request #225 from mikeller/fix_connection_active_indicator
Fixed 'connection active' indicator.
2 parents 6bf7ca9 + d8f19ab commit abaf226

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

js/fc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ var FC = {
170170
voltage: 0,
171171
mAhdrawn: 0,
172172
rssi: 0,
173-
amperage: 0
173+
amperage: 0,
174+
last_received_timestamp: Date.now()
174175
};
175176

176177
ARMING_CONFIG = {

js/msp/MSPHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
115115
ANALOG.mAhdrawn = data.getUint16(1, 1);
116116
ANALOG.rssi = data.getUint16(3, 1); // 0-1023
117117
ANALOG.amperage = data.getInt16(5, 1) / 100; // A
118-
// this.analog_last_received_timestamp = Date.now(); //TODO, fix this
118+
ANALOG.last_received_timestamp = Date.now();
119119
break;
120120
case MSPCodes.MSP_RC_TUNING:
121121
var offset = 0;

js/serial_backend.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ function update_live_status() {
475475
MSP.send_message(MSPCodes.MSP_ANALOG, false, false);
476476
}
477477

478-
var active = ((Date.now() - MSP.analog_last_received_timestamp) < 300);
478+
var active = ((Date.now() - ANALOG.last_received_timestamp) < 300);
479479

480480
for (var i = 0; i < AUX_CONFIG.length; i++) {
481481
if (AUX_CONFIG[i] == 'ARM') {

0 commit comments

Comments
 (0)