Skip to content

Commit 4b02a9d

Browse files
committed
We need a bigger serial transmit ringbuffer, if we are going to store messages there before writing them to the actual serial interface.
1 parent 760e4b8 commit 4b02a9d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/serial/SerialDispatcher.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,13 @@ class SerialDispatcher : public arduino::HardwareSerial
7676
bool _has_tread_started;
7777
bool _terminate_thread;
7878

79+
static int constexpr THREADSAFE_SERIAL_TRANSMIT_RINGBUFFER_SIZE = 128;
80+
typedef arduino::RingBufferN<THREADSAFE_SERIAL_TRANSMIT_RINGBUFFER_SIZE> SerialTransmitRingbuffer;
81+
7982
typedef struct
8083
{
8184
osThreadId_t thread_id;
82-
arduino::RingBuffer tx_buffer;
85+
SerialTransmitRingbuffer tx_buffer;
8386
bool block_tx_buffer;
8487
mbed::SharedPtr<arduino::RingBuffer> rx_buffer; /* Only when a thread has expressed interested to read from serial a receive ringbuffer is allocated. */
8588
PrefixInjectorCallbackFunc prefix_func;

0 commit comments

Comments
 (0)