mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Fixed flush
It behaved like prior Arduino 1.0
This commit is contained in:
parent
a31cc42585
commit
148b67ca2d
3 changed files with 8 additions and 5 deletions
2
SPP.cpp
2
SPP.cpp
|
@ -801,7 +801,7 @@ int SPP::available(void) {
|
|||
return rfcommAvailable;
|
||||
};
|
||||
|
||||
void SPP::flush(void) {
|
||||
void SPP::discard(void) {
|
||||
rfcommAvailable = 0;
|
||||
}
|
||||
|
||||
|
|
8
SPP.h
8
SPP.h
|
@ -130,8 +130,10 @@ public:
|
|||
* @return Return the number of bytes ready to be read.
|
||||
*/
|
||||
virtual int available(void);
|
||||
/** Discard all the bytes in the buffer. */
|
||||
virtual void flush(void);
|
||||
/** Send out all bytes in the buffer. */
|
||||
virtual void flush(void) {
|
||||
send();
|
||||
};
|
||||
/**
|
||||
* Used to read the next value in the buffer without advancing to the next one.
|
||||
* @return Return the byte. Will return -1 if no bytes are available.
|
||||
|
@ -157,6 +159,8 @@ public:
|
|||
virtual size_t write(const uint8_t* data, size_t size);
|
||||
/** Pull in write(const char *str) from Print */
|
||||
using Print::write;
|
||||
/** Discard all the bytes in the buffer. */
|
||||
void discard(void);
|
||||
/**
|
||||
* This will send all the bytes in the buffer.
|
||||
* This is called whenever Usb.Task() is called,
|
||||
|
|
|
@ -228,8 +228,7 @@ SPP KEYWORD1
|
|||
####################################################
|
||||
|
||||
connected KEYWORD2
|
||||
printNumber KEYWORD2
|
||||
printNumberln KEYWORD2
|
||||
discard KEYWORD2
|
||||
|
||||
####################################################
|
||||
# Syntax Coloring Map For Wiimote Library
|
||||
|
|
Loading…
Reference in a new issue