2 Commits
Author SHA1 Message Date
Gl0w1amp 35169a5057 Remove global Sleep(1) from uart_handle_read (#6)
This removes the global Sleep(1) workaround that was originally added to prevent memory leaks caused by tight polling loops.

While it helped with the mai2 memory leak, introducing artificial latency here negatively impacts other UART devices (e.g., breaking slider inputs in chusan). The proper fix has now been implemented downstream in `segatools` by rate-limiting the specific `led15070` board instead. Therefore, this global hack is no longer needed and can be safely removed.

Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/capnhook/pulls/6
Co-authored-by: Gl0w1amp <gl0w1amp@noreply.gitea.tendokyu.moe>
Co-committed-by: Gl0w1amp <gl0w1amp@noreply.gitea.tendokyu.moe>
2026-03-09 16:33:23 +00:00
Gl0w1amp 34a2716827 Add delay in uart_handle_read() to prevent tight polling loop and memory leaks
Added Sleep(1) to uart_handle_read when no data is available to simulate
hardware I/O latency. This prevents the hook from entering a tight polling
loop, which was causing high CPU usage and massive memory leaks.
2025-11-29 05:32:56 +00:00