From 65e63bf378488dabf79e377debd4b0fa05fb3316 Mon Sep 17 00:00:00 2001 From: Bernhard Nebel Date: Mon, 18 Oct 2021 16:07:40 +0200 Subject: Inserted cast to unsigned int in available method in order to avoid call to __divmodhi4 --- libraries/SoftwareSerial/src/SoftwareSerial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libraries/SoftwareSerial/src/SoftwareSerial.cpp') diff --git a/libraries/SoftwareSerial/src/SoftwareSerial.cpp b/libraries/SoftwareSerial/src/SoftwareSerial.cpp index 3163d7a..5a387ab 100644 --- a/libraries/SoftwareSerial/src/SoftwareSerial.cpp +++ b/libraries/SoftwareSerial/src/SoftwareSerial.cpp @@ -409,7 +409,7 @@ int SoftwareSerial::available() if (!isListening()) return 0; - return (_receive_buffer_tail + _SS_MAX_RX_BUFF - _receive_buffer_head) % _SS_MAX_RX_BUFF; + return ((unsigned int)(_receive_buffer_tail + _SS_MAX_RX_BUFF - _receive_buffer_head)) % _SS_MAX_RX_BUFF; } size_t SoftwareSerial::write(uint8_t b) -- cgit v1.2.3-18-g5258