NangiDev / GDSerCommPlugin

A Godot plugin to read Arduino serial input
MIT License
79 stars 13 forks source link

Throw error on read more than max, add drain function #27

Closed ambiguousname closed 1 month ago

ambiguousname commented 1 month ago

This is to prevent segfaults for when there are a lot of waiting bytes coming in.

If this becomes an issue in Godot, you can call the drain() function that comes with this patch as well.

Found this issue when I set up a pause screen that also paused reading serial input. Waiting bytes accumulated, which led to a read error when processing was resumed.

NangiDev commented 1 month ago

Great! This is good quality of life things.