Skip to content

Commit 9e8bcf6

Browse files
committed
fix random disconnections
1 parent 333ae1c commit 9e8bcf6

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

frameWriter.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ class FrameWriter:
55
def __init__(self, frameBuffer: asyncio.Queue, lcd: driver.KrakenLCD):
66
self.frameBuffer = frameBuffer
77
self.lcd = lcd
8-
self.shouldStop = False
98
async def run(self):
10-
while not self.shouldStop:
11-
if self.frameBuffer.empty():
12-
await asyncio.sleep(0.001)
13-
continue
9+
while True:
1410
await self.onFrame()
1511
async def onFrame(self):
1612
frame = await self.frameBuffer.get()

hardwareServer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ async def updateDuty(channel, temp, criticalTemp):
177177
global config
178178
norm = normalizeProfile(config[channel], criticalTemp)
179179
average = None
180-
cutoff_freq = 1 / 10
180+
cutoff_freq = 1 / 2 / 10
181181
alpha = 1 - math.exp(-2 * math.pi * cutoff_freq)
182182
ema = average
183183
sample = temp
@@ -195,6 +195,7 @@ async def updateDuty(channel, temp, criticalTemp):
195195

196196
async def checkCurves(cpuTemp, gpuTemp, liquidTemp):
197197
global config, cpuTemps
198+
await asyncio.sleep(1)
198199
cpuTemps.append(cpuTemp)
199200
cpuTemps.pop(0)
200201
averageCpuTemp = 0

0 commit comments

Comments
 (0)