An RTOS-friendly Serial interface Its primary benefit is that it never hogs the CPU. An amusing alternative to the traditional ring-bufferd interrupt-serviced systems, it uses short mbed-rtos queues to buffer characters to and from the UART, and a thread to service the transmitter. Short interrupt service routines enqueue received characters and signal the transmit thread when the transmitter is available. WARNING: Do not create RTOS-Serial objects before the RTOS is running! Put them inside your main() block or another function, not in the global initialization.
Dependents: Test_RDM880_rfid_reader
Diff: rtos_serial.h
- Revision:
- 19:d974f46f6882
- Parent:
- 18:8665cc17b30d
--- a/rtos_serial.h Wed Oct 30 05:53:06 2013 +0000 +++ b/rtos_serial.h Wed Oct 30 05:56:17 2013 +0000 @@ -112,6 +112,7 @@ * Thread::wait(400); * } * } + * @endcode */ class RTOS_Serial : public RawSerial { public: