From 355160dedbbaf6f3d6d4a7579aa23ab07fe63195 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Sun, 12 Apr 2020 00:12:56 +0200 Subject: [PATCH] Increase uart receive timeout --- stk500v2/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stk500v2/main.cpp b/stk500v2/main.cpp index c8f0b35..73cf410 100644 --- a/stk500v2/main.cpp +++ b/stk500v2/main.cpp @@ -21,9 +21,9 @@ struct Message { uint8_t checksum; }; -static inline bool receiveByte(uint8_t &data, uint16_t timeout = 1000) +static inline bool receiveByte(uint8_t &data, uint32_t timeout = 100000) { - for (uint16_t i = 0; i < timeout; ++i) { + for (uint32_t i = 0; i < timeout; ++i) { if (serial.rxByte(data)) return true; }