We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8edd5b9 commit 8861451Copy full SHA for 8861451
src/serial/SerialDispatcher.cpp
@@ -122,25 +122,7 @@ void SerialDispatcher::flush()
122
123
size_t SerialDispatcher::write(uint8_t const b)
124
{
125
- mbed::ScopedLock<rtos::Mutex> lock(_mutex);
126
-
127
- auto iter = findThreadCustomerDataById(rtos::ThisThread::get_id());
128
129
- /* If this thread hasn't registered yet
130
- * with the SerialDispatcher via 'begin'.
131
- */
132
- if (iter == std::end(_thread_customer_list))
133
- return 0;
134
135
- if (iter->tx_buffer.availableForStore())
136
- iter->tx_buffer.store_char(b);
137
138
- /* Inform the worker thread that new data has
139
- * been written to a Serial transmit buffer.
140
141
- _cond.notify_one();
142
143
- return 1;
+ return write(&b, 1);
144
}
145
146
size_t SerialDispatcher::write(const uint8_t * data, size_t len)
0 commit comments