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

Merge pull request #1190 from mikeller/fix_date_setting

Fixed setting of date/time for pre 4.0 firmware.
This commit is contained in:
Michael Keller 2018-09-04 01:23:15 +12:00 committed by GitHub
commit 3a94d0056f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 {