@@ -156,25 +156,25 @@ from the hardware FIFO (128 bytes for TX and RX), ``Serial`` has an
156
156
add
8000
itional customizable 256-byte RX buffer. The size of this software buffer can
157
157
be changed by the user. It is suggested to use a bigger size at higher receive speeds.
158
158
159
- The ``::setRxBufferSize(size_t size `` method changes the RX buffer size as needed. This
159
+ The ``::setRxBufferSize(size_t size) `` method changes the RX buffer size as needed. This
160
160
should be called before ``::begin() ``. The size argument should be at least large enough
161
161
to hold all data received before reading.
162
162
163
- For transmit-only operation, the buffer can be switched off by passing mode SERIAL_TX_ONLY
164
- to Serial.begin(). Other modes are SERIAL_RX_ONLY and SERIAL_FULL (the default).
163
+ For transmit-only operation, the buffer can be switched off o save RAM by passing mode
164
+ SERIAL_TX_ONLY to Serial.begin(). Other modes are SERIAL_RX_ONLY and SERIAL_FULL (the default).
165
165
166
- Receive is interrupt-driven, but transmit polls and busy-waits. Both are
167
- blocking:
166
+ Receive is interrupt-driven, but transmit polls and busy-waits. Blocking behavior is as follows:
168
167
The ``::write() `` call does not block if the number of bytes fits in the current space available
169
168
in the TX FIFO. The call blocks if the TX FIFO is full and waits until there is room before
170
- writing more bytes into it. In other words, when the call returns, all bytes have been written
171
- to the FIFO, but that doesn't mean that all bytes have been sent out through the serial line yet.
172
- The ``::read() `` call does not block if there are no bytes available for reading.
169
+ writing more bytes into it, until all bytes are written. In other words, when the call returns,
170
+ all bytes have been written to the TX FIFO, but that doesn't mean that all bytes have been sent
171
+ out through the serial line yet.
172
+ The ``::read() `` call doesn't block, not even if there are no bytes available for reading.
173
173
The ``::readBytes() `` call blocks until the number of bytes read complies with the number of
174
174
bytes required by the argument passed in.
175
- The ``::flush() `` call blocks waiting for the FIFO to be empty before returning. It is recommended
176
- to call this to make sure all bytes have been sent before doing configuration changes on the serial
177
- port (e.g. changing baudrate) or doing a board reset.
175
+ The ``::flush() `` call blocks waiting for the TX FIFO to be empty before returning. It is
176
+ recommended to call this to make sure all bytes have been sent before doing configuration changes
177
+ on the serial port (e.g. changing baudrate) or doing a board reset.
178
178
179
179
``Serial `` uses UART0, which is mapped to pins GPIO1 (TX) and GPIO3
180
180
(RX). Serial may be remapped to GPIO15 (TX) and GPIO13 (RX) by calling
0 commit comments