MCPcopy Create free account
hub / github.com/FastLED/FastLED / read

Method read

src/platforms/esp/32/drivers/uart_esp32_idf.hpp:430–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428}
429
430int UartEsp32::read() FL_NOEXCEPT {
431 if (!mBuffered) {
432 return -1; // Driver not installed, cannot read
433 }
434
435 uart_port_t port = static_cast<uart_port_t>(mPortInt);
436 u8 c = 0;
437 int len = uart_read_bytes(port, &c, 1, 0); // timeout=0 (non-blocking)
438
439 if (len == 1) {
440 return static_cast<int>(c); // Success: return byte as unsigned
441 } else {
442 return -1; // No data available or error
443 }
444}
445
446bool UartEsp32::flush(u32 timeoutMs) FL_NOEXCEPT {
447 if (!mBuffered) {

Callers 3

io_esp_idf.hppFile · 0.45
EspIOClass · 0.45
beginMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected