Skip to content

Commit 1030478

Browse files
mspangpull[bot]
authored andcommitted
Reduce CPU usage of chip-console (#25663)
This is busy polling the serial port, and as a result uses 100% CPU. Use a non-zero timeout to avoid this. Using asyncio would be better, but pyserial support for this is still experimental.
1 parent 221aa4b commit 1030478

File tree

1 file changed

+1
-1
lines changed
  • examples/common/pigweed/rpc_console/py/chip_rpc

1 file changed

+1
-1
lines changed

examples/common/pigweed/rpc_console/py/chip_rpc/console.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def console(device: str, baudrate: int,
328328
serial_impl = SerialWithLogging
329329

330330
if socket_addr is None:
331-
serial_device = serial_impl(device, baudrate, timeout=0)
331+
serial_device = serial_impl(device, baudrate, timeout=0.1)
332332
def read(): return serial_device.read(8192)
333333
write = serial_device.write
334334
else:

0 commit comments

Comments
 (0)