PlatformIO Community

Change library define on my private source

Hi,

The RingBuffer library has its SERIAL_BUFFER_SIZE definition as below:
#define SERIAL_BUFFER_SIZE 64

I would like to change it to 512 without touching the lib itself.
I have tried adding this definition on build_flags (-D SERIAL_BUFFER_SIZE=512) but it won’t take effect.

Is there any way to make this work without touching the RingBuffer library?

Thanks.

You could give -U SERIAL_BUFFER_SIZE before -D SERIAL_BUFFER_SIZE=512 a try… it’s a build_flag which cancels previous declarations of a macro, but I don’t know if it will clear the definition provided by the library.

1 Like

Hi,

I tried that but it doesn’t work.

Thanks anyway.

1 Like