From fc0b7fab437a4322f0e073ebcd8cd69697a6c68e Mon Sep 17 00:00:00 2001 From: "Jason S. McMullan" Date: Tue, 31 Mar 2026 14:52:39 -0400 Subject: [PATCH] Adjust stop bit condition in decode function Needed for when stop_bits is 1, instead of 2. --- src/decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/decode.c b/src/decode.c index d69f270..bb46fd0 100644 --- a/src/decode.c +++ b/src/decode.c @@ -72,7 +72,7 @@ static bool decode(const SERIAL_CONFIG *c, struct bits_state *s, int8_t offset, s->byte |= (char)(this_bit << (s->bit - 1)); } - if (s->bit >= before_stop + 1) { // accept a minimum number of stop bits + if (s->bit >= before_stop + c->stop_bits - 1) { // accept after required stop bits *out = s->byte; s->byte = 0; s->bit = 0;