Read data from buffer
| 450 | |
| 451 | // Read data from buffer |
| 452 | int SoftwareSerial::read() |
| 453 | { |
| 454 | if (!isListening()) |
| 455 | return -1; |
| 456 | |
| 457 | // Empty buffer? |
| 458 | if (_receive_buffer_head == _receive_buffer_tail) |
| 459 | return -1; |
| 460 | |
| 461 | // Read from "head" |
| 462 | uint8_t d = _receive_buffer[_receive_buffer_head]; // grab next byte |
| 463 | _receive_buffer_head = (_receive_buffer_head + 1) % _SS_MAX_RX_BUFF; |
| 464 | return d; |
| 465 | } |
| 466 | |
| 467 | int SoftwareSerial::available() |
| 468 | { |
nothing calls this directly
no outgoing calls
no test coverage detected