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:
commit
192e886f30
3 changed files with 28 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue