1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-17 05:15:21 +03:00

Fixed setting of date/time for pre 4.0 firmware.

This commit is contained in:
mikeller 2018-09-03 23:40:11 +12:00
parent eeab99192f
commit c59bb7b6ce

View file

@ -1667,11 +1667,12 @@ MspHelper.prototype.crunch = function(code) {
break;
case MSPCodes.MSP_SET_RTC:
var now = Date.now();
var now = new Date();
if (semver.gte(CONFIG.apiVersion, "1.41.0")) {
var secs = now / 1000;
var millis = now % 1000;
var timestamp = now.getTime();
var secs = timestamp / 1000;
var millis = timestamp % 1000;
buffer.push32(secs);
buffer.push16(millis);
} else {