|
RSeries astromech firmware
|
|
Go to the documentation of this file. 1 #ifndef PSRamBufferedPrintStream_h
2 #define PSRamBufferedPrintStream_h
13 fPtr = fBuffer = (uint8_t*)malloc(fSize);
19 if (fPtr - fBuffer > 0)
21 fStream.write(fBuffer, fPtr - fBuffer);
33 virtual size_t write(uint8_t ch)
override
38 virtual size_t write(
const uint8_t *buffer,
size_t size)
override
40 if (fPtr + size >= fEnd)
44 if (fPtr + size < fEnd)
46 memcpy(fPtr, buffer, size);
51 fStream.write(buffer, size);
71 fPtr = fBuffer = (uint8_t*)ps_malloc(fSize);
77 if (fPtr - fBuffer > 0)
79 fStream.write(fBuffer, fPtr - fBuffer);
91 virtual size_t write(uint8_t ch)
override
96 virtual size_t write(
const uint8_t *buffer,
size_t size)
override
98 if (fPtr + size >= fEnd)
102 if (fPtr + size < fEnd)
104 memcpy(fPtr, buffer, size);
109 fStream.write(buffer, size);
virtual size_t write(const uint8_t *buffer, size_t size) override
Definition: PSRamBufferedPrintStream.h:38
virtual size_t write(uint8_t ch) override
Definition: PSRamBufferedPrintStream.h:91
RamBufferedPrintStream(Stream &stream, size_t siz=4096)
Definition: PSRamBufferedPrintStream.h:9
Definition: PSRamBufferedPrintStream.h:64
void flush()
Definition: PSRamBufferedPrintStream.h:17
Definition: PSRamBufferedPrintStream.h:6
virtual size_t write(uint8_t ch) override
Definition: PSRamBufferedPrintStream.h:33
virtual ~PSRamBufferedPrintStream()
Definition: PSRamBufferedPrintStream.h:84
virtual size_t write(const uint8_t *buffer, size_t size) override
Definition: PSRamBufferedPrintStream.h:96
void flush()
Definition: PSRamBufferedPrintStream.h:75
virtual ~RamBufferedPrintStream()
Definition: PSRamBufferedPrintStream.h:26
PSRamBufferedPrintStream(Stream &stream, size_t siz=64768)
Definition: PSRamBufferedPrintStream.h:67