From f6fa676411dc7318224d2f6b92c309bd7aca2bd9 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 20 Dec 2021 19:08:33 +1100 Subject: [PATCH] AP_AIS: correct number of bytes to read from device --- libraries/AP_AIS/AP_AIS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_AIS/AP_AIS.cpp b/libraries/AP_AIS/AP_AIS.cpp index 621dd84fe2..93f7c8f863 100644 --- a/libraries/AP_AIS/AP_AIS.cpp +++ b/libraries/AP_AIS/AP_AIS.cpp @@ -89,7 +89,7 @@ void AP_AIS::update() } // read any available lines - uint32_t nbytes = MAX(_uart->available(),1024U); + uint32_t nbytes = MIN(_uart->available(),1024U); while (nbytes-- > 0) { const int16_t byte = _uart->read(); if (byte == -1) {