9 years, 1 month ago.

Clarification on base class

Hi,

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

9 years, 1 month 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.