mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-03 12:55:03 +01:00
Fixup MemStream warning messages
This commit is contained in:
parent
d39c367132
commit
23088cda88
|
@ -4,6 +4,8 @@
|
||||||
buffer serial device
|
buffer serial device
|
||||||
based on Arduino SoftwareSerial
|
based on Arduino SoftwareSerial
|
||||||
|
|
||||||
|
Constructor warning messages fixed by Chris Harlow.
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
License as published by the Free Software Foundation; either
|
License as published by the Free Software Foundation; either
|
||||||
|
@ -23,13 +25,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#include "MemStream.h"
|
#include "MemStream.h"
|
||||||
|
|
||||||
MemStream::MemStream(uint8_t *buffer, const uint16_t len, uint16_t content_len, bool allowWrite)
|
MemStream::MemStream(uint8_t *buffer, const uint16_t len, uint16_t content_len, bool allowWrite)
|
||||||
:_buffer(buffer),_len(len), _buffer_overflow(false), _pos_write(content_len), _pos_read(0), _allowWrite(allowWrite)
|
:_buffer(buffer),_len(len), _buffer_overflow(false), _pos_read(0), _allowWrite(allowWrite)
|
||||||
{
|
{
|
||||||
if (content_len==0) memset(_buffer, 0, _len);
|
if (content_len==0) memset(_buffer, 0, _len);
|
||||||
if (content_len>len) {
|
_pos_write=(content_len>len)? len: content_len;
|
||||||
content_len=len;
|
|
||||||
_pos_write=len;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t MemStream::write(uint8_t byte) {
|
size_t MemStream::write(uint8_t byte) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user