stm32duino / Arduino_Core_STM32

STM32 core support for Arduino
https://github.com/stm32duino/Arduino_Core_STM32/wiki
Other
2.71k stars 956 forks source link

Defining CDC_TRANSMIT_QUEUE_BUFFER_SIZE from .ino sketch #1929

Closed mkals closed 1 year ago

mkals commented 1 year ago

I'm using an STM32F4 board as a serial passthrough for programming other STM32 microprocessors. The buffer sizes set in the cdc_queue.h file are too small to allow for this application. Is there a way to set the two relevant parameters (CDC_TRANSMIT_QUEUE_BUFFER_SIZE and CDC_RECEIVE_QUEUE_BUFFER_SIZE) from the .ino sketch without modifying the library?

fpistm commented 1 year ago

Hi, You can try to override it using build_opt.h but basically it is not allowed to redefine it as it is not protected by #ifndef so you should have a warning about redefinition and hope the one in build_opt will be used but I guess it should be safe for you to change it in the core. https://github.com/stm32duino/Arduino_Core_STM32/blob/4b5098cfb8eb9d06bb1c55ad74f04dc2f042fdcf/cores/arduino/stm32/usb/cdc/cdc_queue.h#L56-L57