Skip to content

Conversation

@d3str0y3rport
Copy link

The increase of the buffer size to handle larger streams like the ones from GPS.

The increase of the buffer size to handle larger streams like the ones from GPS.
@Adminius
Copy link
Contributor

why not let user define his own buffer size?

#ifndef defined(SERIAL_BUFFER_SIZE)
#define SERIAL_BUFFER_SIZE 64
#endif

@tuxedo0801
Copy link
Contributor

@cmaglie @sandeepmistry Any comments on this?

@Adminius
Copy link
Contributor

Adminius commented Aug 7, 2018

@d3str0y3rport sorry, i made a mistake:

  1. possibility:
    #ifndef SERIAL_BUFFER_SIZE
  2. possibility
    #if !defined(SERIAL_BUFFER_SIZE)
    see also: https://github.com/arduino/ArduinoCore-avr/blob/master/cores/arduino/HardwareSerial.h#L42

@keestux
Copy link

keestux commented Sep 1, 2018

Can you also show how and where you would define a different value? You'd have to define SERIAL_BUFFER_SIZE in the right place.

And what about if you have an application with multiple modules (one .ino and one or more .cpp)? Each module may or may not include Arduino.h (or Uart.h, or RingBuffer.h). If you don't set the same SERIAL_BUFFER_SIZE everywhere then you're screwed.

@keestux
Copy link

keestux commented Sep 1, 2018

Another note. Each Uart has 2 ringbuffers. That means the data size increases quite a bit if the variant has 3 or 4 Serial devices.

@sandeepmistry
Copy link
Contributor

Closing in favour of:
da9bfe8

@sandeepmistry
Copy link
Contributor

@keestux

Can you also show how and where you would define a different value?

This would have to be changed in the boards.txt entry of the variant you are using.

boseji pushed a commit to go-ut/combined-ArduinoCore-samd that referenced this pull request Dec 23, 2021
Introduce digital pin definitions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants