Skip to content

Commit 2eaf97e

Browse files
committed
fix broken gyro led bug
1 parent 4b4e307 commit 2eaf97e

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "hhd"
3-
version = "1.3.4"
3+
version = "1.3.5"
44
authors = [
55
{ name="Kapenekakis Antheas", email="[email protected]" },
66
]

src/hhd/controller/virtual/dualsense/const.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ def prefill_ds5_report(bluetooth: bool):
116116
# bat = 10*lvl + 5
117117
d[ofs + 52] = (0x0 << 4) + 8
118118

119+
# Add dummy data in case the gyro is broken
120+
d[ofs + 27 : ofs + 31] = int(28742700000000 / DS5_EDGE_DELTA_TIME_NS).to_bytes(
121+
8, byteorder="little", signed=False
122+
)[:4]
123+
119124
return bytes(d)
120125

121126

src/hhd/device/legion_go/base.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -329,16 +329,7 @@ def prepare(m):
329329

330330
for d in d_outs:
331331
d.consume(evs)
332-
# If unbounded, the total number of events per second is the sum of all
333-
# events generated by the producers.
334-
# For Legion go, that would be 100 + 100 + 500 + 30 = 730
335-
# Since the controllers of the legion go only update at 500hz, this is
336-
# wasteful.
337-
# By setting a target refresh rate for the report and sleeping at the
338-
# end, we ensure that even if multiple fds become ready close to each other
339-
# they are combined to the same report, limiting resource use.
340-
# Ideally, this rate is smaller than the report rate of the hardware controller
341-
# to ensure there is always a report from that ready during refresh
332+
342333
t = time.perf_counter()
343334
elapsed = t - start
344335
if elapsed < REPORT_DELAY_MIN:

0 commit comments

Comments
 (0)