mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
write(), print(), and println() now return number of bytes written.
The type is long, and negative values indicate errors. Needs more testing. http://code.google.com/p/arduino/issues/detail?id=551
This commit is contained in:
@ -440,10 +440,10 @@ int SoftwareSerial::available()
|
||||
return (_receive_buffer_tail + _SS_MAX_RX_BUFF - _receive_buffer_head) % _SS_MAX_RX_BUFF;
|
||||
}
|
||||
|
||||
void SoftwareSerial::write(uint8_t b)
|
||||
long SoftwareSerial::write(uint8_t b)
|
||||
{
|
||||
if (_tx_delay == 0)
|
||||
return;
|
||||
return -1;
|
||||
|
||||
uint8_t oldSREG = SREG;
|
||||
cli(); // turn off interrupts for a clean txmit
|
||||
@ -484,6 +484,8 @@ void SoftwareSerial::write(uint8_t b)
|
||||
|
||||
SREG = oldSREG; // turn interrupts back on
|
||||
tunedDelay(_tx_delay);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void SoftwareSerial::flush()
|
||||
|
Reference in New Issue
Block a user