Skip to content

Commit 27477f7

Browse files
committed
Fixes plerup#171: prepares for ESP8266 Arduino core PR 6979.
1 parent adec3fe commit 27477f7

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "EspSoftwareSerial",
3-
"version": "6.11.2",
3+
"version": "6.11.3",
44
"keywords": [
55
"serial", "io", "softwareserial"
66
],

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=EspSoftwareSerial
2-
version=6.11.2
2+
version=6.11.3
33
author=Dirk Kaar, Peter Lerup
44
maintainer=Dirk Kaar <dok@dok-net.net>
55
sentence=Implementation of the Arduino software serial for ESP8266/ESP32.

src/SoftwareSerial.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ int SoftwareSerial::read() {
204204
return val;
205205
}
206206

207-
size_t SoftwareSerial::read(uint8_t* buffer, size_t size) {
207+
int SoftwareSerial::read(uint8_t* buffer, size_t size) {
208208
if (!m_rxValid) { return 0; }
209-
size_t avail;
209+
int avail;
210210
if (0 == (avail = m_buffer->pop_n(buffer, size))) {
211211
rxBits();
212212
avail = m_buffer->pop_n(buffer, size);

src/SoftwareSerial.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,13 @@ class SoftwareSerial : public Stream {
156156
return (0x9669 >> byte) & 1;
157157
}
158158
/// The read(buffer, size) functions are non-blocking, the same as readBytes but without timeout
159-
size_t read(uint8_t* buffer, size_t size);
159+
int read(uint8_t* buffer, size_t size)
160+
//#if defined(ESP8266)
161+
// override
162+
//#endif
163+
;
160164
/// The read(buffer, size) functions are non-blocking, the same as readBytes but without timeout
161-
size_t read(char* buffer, size_t size) {
165+
int read(char* buffer, size_t size) {
162166
return read(reinterpret_cast<uint8_t*>(buffer), size);
163167
}
164168
/// @returns The number of bytes read into buffer, up to size. Times out if the limit set through

0 commit comments

Comments
 (0)