Skip to content

Commit 9fb2bd1

Browse files
committed
Changes to reflect MSP_SET_RTC implementation
1 parent fead6f4 commit 9fb2bd1

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

X9.lua

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ NoTelem = { 70, 55, "No Telemetry", BLINK }
7777
-- THIS CODE HAS TO BE MOVED TO A SEPERATE LUA FILE
7878
--
7979

80-
local MSP_SET_TX_INFO = 187
80+
local MSP_SET_RTC = 246
8181

8282
--
8383

@@ -89,10 +89,20 @@ local function run_bg()
8989
if lastSendTS == 0 or lastSendTS + INTERVAL < getTime() then
9090
local now = getDateTime()
9191
local rssi, alarm_low, alarm_high = getRSSI()
92-
local values = { now.year-2000, now.mon, now.day, now.hour, now.min, now.sec, rssi }
92+
local year = now.year;
93+
94+
local values = {}
95+
values[1] = bit32.band(year, 0xFF)
96+
year = bit32.rshift(year, 8)
97+
values[2] = bit32.band(year, 0xFF)
98+
values[3] = now.mon
99+
values[4] = now.day
100+
values[5] = now.hour
101+
values[6] = now.min
102+
values[7] = now.sec
93103

94104
-- send info
95-
mspSendRequest(MSP_SET_TX_INFO, values)
105+
mspSendRequest(MSP_SET_RTC, values)
96106

97107
lastSendTS = getTime()
98108
end

0 commit comments

Comments
 (0)