Add comment explaining new behaviour

This commit is contained in:
Blizzard Finnegan 2023-05-16 10:00:24 -04:00
parent dd7bb577ee
commit 7718ea5dda
No known key found for this signature in database
GPG key ID: F40F3F6CAE325FBA

View file

@ -118,6 +118,9 @@ impl TTY{
}
else {
log::debug!("Read an empty string. Possible read error.");
//Due to a linux kernel power-saving setting that is overly complicated to fix,
//Serial connections will drop for a moment before re-opening, at seemingly-random
//intervals. The below is an attempt to catch and recover from this behaviour.
self.failed_read_count += 1;
if self.failed_read_count >= 15{
self.failed_read_count = 0;