mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Call send if the buffer would be full
This commit is contained in:
parent
e6a557870b
commit
1dc75ae89f
1 changed files with 1 additions and 1 deletions
2
SPP.cpp
2
SPP.cpp
|
@ -736,7 +736,7 @@ size_t SPP::write(uint8_t data) {
|
|||
size_t SPP::write(const uint8_t* data, size_t size) {
|
||||
for(uint8_t i = 0; i < size; i++) {
|
||||
if(sppIndex >= sizeof(sppOutputBuffer)/sizeof(sppOutputBuffer[0]))
|
||||
return i; // Don't send any more if buffer is already full
|
||||
send(); // Send the current data in the buffer
|
||||
sppOutputBuffer[sppIndex++] = data[i]; // All the bytes are put into a buffer and then send using the send() function
|
||||
}
|
||||
return size;
|
||||
|
|
Loading…
Reference in a new issue