MCPcopy Create free account
hub / github.com/bdring/FluidNC / uart_read_bytes

Function uart_read_bytes

X86TestSupport/TestSupport/driver/uartdriver.cpp:34–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34int uart_read_bytes(uart_port_t uart_num, uint8_t* buf, uint32_t length, TickType_t ticks_to_wait) {
35 auto key = uart_key(uart_num);
36 const auto& val = Inputs::instance().get(key);
37 auto max = std::min(size_t(length), val.size());
38 for (size_t i = 0; i < max; ++i) {
39 buf[i] = uint8_t(val[i]);
40 }
41 std::vector<uint32_t> newval(val.begin() + max, val.end());
42 Inputs::instance().set(key, newval);
43 return int(max);
44}
45
46int uart_write_bytes(uart_port_t uart_num, const char* src, size_t size) {
47 auto key = uart_key(uart_num);

Callers 1

uart_readFunction · 0.85

Calls 6

uart_keyFunction · 0.70
getMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected