Page 1 of 1

What does the comment in HardwareSerial.h file is explaining us?

Posted: Mon Oct 11, 2021 10:05 am
by mustaq_ahm
In HardwareSerial.h file there is a set of following line. What does it say? I did not understand.

Is that saying, that only 32 bytes can be accessed in buffer? or What? Could some one explain me this?

Code: Select all

    // Don't put any members after these buffers, since only the first
    // 32 bytes of this struct can be accessed quickly using the ldd
    // instruction.
    unsigned char _rx_buffer[SERIAL_RX_BUFFER_SIZE];
    unsigned char _tx_buffer[SERIAL_TX_BUFFER_SIZE];

Re: What does the comment in HardwareSerial.h file is explaining us?

Posted: Mon Oct 11, 2021 12:18 pm
by fpiSTM
It's a legacy from Arduino:
https://github.com/arduino/ArduinoCore- ... #L110-L112

For STM32 this is not relevant.

Re: What does the comment in HardwareSerial.h file is explaining us?

Posted: Mon Oct 11, 2021 2:36 pm
by mustaq_ahm
For STM32 this is not relevant.
Okay Thank you.