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

Merge pull request #1076 from mikeller/add_rtc_setting

Added setting of RTC when connecting.
This commit is contained in:
Michael Keller 2018-07-03 22:51:10 +12:00 committed by GitHub
commit 192e886f30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 2 deletions

View file

@ -1178,6 +1178,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
case MSPCodes.MSP_ARMING_DISABLE:
console.log('Arming disable');
break;
case MSPCodes.MSP_SET_RTC:
console.log('Real time clock set');
break;
default:
console.log('Unknown code detected: ' + code);
} else {
@ -1577,6 +1580,16 @@ MspHelper.prototype.crunch = function(code) {
// This will be ignored if `armingDisabled` is true
buffer.push8(value);
break;
case MSPCodes.MSP_SET_RTC:
var now = new Date();
buffer.push16(now.getUTCFullYear());
buffer.push8(now.getUTCMonth() + 1);
buffer.push8(now.getUTCDate());
buffer.push8(now.getUTCHours());
buffer.push8(now.getUTCMinutes());
buffer.push8(now.getUTCSeconds());
break;
default:
return false;