You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -76,23 +76,19 @@ class HardwareSerial: public Stream
76
76
// onReceive will setup a callback that will be called whenever an UART interruption occurs (UART_INTR_RXFIFO_FULL or UART_INTR_RXFIFO_TOUT)
77
77
// UART_INTR_RXFIFO_FULL interrupt triggers at UART_FULL_THRESH_DEFAULT bytes received (defined as 120 bytes by default in IDF)
78
78
// UART_INTR_RXFIFO_TOUT interrupt triggers at UART_TOUT_THRESH_DEFAULT symbols passed without any reception (defined as 10 symbos by default in IDF)
79
-
// The prototype of the callback function passed must be as defined by OnReceiveCb (void callbackFunction(bool timeout))
80
-
// The bool parameter in the callback function prototype informs the callback function if the callback was called because a timeout (true) or because the RX FIFO reached 120 bytes (false)
81
-
// param function is the callback to be called after reception timeout
82
-
voidonReceive(OnReceiveCb function);
83
-
84
-
// setRxTimeout sets the timeout after which onReceive callback will be called (after receiving data, it waits for this time of UART rx inactivity to call the callback fnc)
85
-
// param symbols_timeout defines a timeout threshold in uart symbol periods. Setting 0 symbol timeout disables the callback call by timeout.
86
-
// Maximum timeout setting is calculacted automatically by IDF. If set above the maximum, it is ignored and an error is printed on Serial0 (check console).
87
-
// Examples: Maximum for 11 bits symbol is 92 (SERIAL_8N2, SERIAL_8E1, SERIAL_8O1, etc), Maximum for 10 bits symbol is 101 (SERIAL_8N1).
88
-
// For example symbols_timeout=1 defines a timeout equal to transmission time of one symbol (~11 bit) on current baudrate.
89
-
// For a baudrate of 9600, SERIAL_8N1 (10 bit symbol) and symbols_timeout = 3, the timeout would be 3 / (9600 / 10) = 3.125 ms
90
-
voidsetRxTimeout(uint8_t symbols_timeout);
79
+
// onlyOnTimeout parameter will define how onReceive will behave:
80
+
// Default: true -- The callback will only be called when RX Timeout happens.
81
+
// Whole stream of bytes will be ready for being read on the callback function at once.
82
+
// This option may lead to Rx Overflow depending on the Rx Buffer Size and number of bytes received in the streaming
83
+
// false -- The callback will be called when FIFO reaches 120 bytes and also on RX Timeout.
84
+
// The stream of incommig bytes will be "split" into blocks of 120 bytes on each callback.
85
+
// This option avoid any sort of Rx Overflow, but leaves the UART packet reassembling work to the Application.
0 commit comments