Fixed setting of date/time for pre 4.0 firmware.

10.5.x-maintenance
mikeller 2018-09-03 23:40:11 +12:00
parent eeab99192f
commit c59bb7b6ce
1 changed files with 4 additions and 3 deletions

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 {