6 years, 6 months ago.

Clarification on base class


MODSERIAL inherits Serial, which itself inherits SerialBase and Stream

Stream defines the putc and getc methods On the other hand, there is the RawSerial interface that defines the same methods putc getc

Do you know if there is a reason for this redundancy ?

Thank you for your help

Question relating to:

Andy K / MODSERIAL Featured
Bug fix release buffer, Buffered, rs232, RS485, Serial

1 Answer

6 years, 6 months ago.

RawSerial defines it in a different way, which skips the stdio layer that Stream uses. The Stream implementation is due to this more extensive and more flexible. However it is slower, and it is not allowed to be used in an IRQ when using RTOS, which is the main reason for RawSerial existing.