MCPcopy Create free account
hub / github.com/MCUdude/MiniCore / read

Method read

avr/libraries/SoftwareSerial/src/SoftwareSerial.cpp:452–465  ·  view source on GitHub ↗

Read data from buffer

Source from the content-addressed store, hash-verified

450
451// Read data from buffer
452int 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
467int SoftwareSerial::available()
468{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected