Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[common] Make Serial RX buffer size configurable, increase default to 256 bytes #313

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

hn
Copy link
Contributor

@hn hn commented Jan 11, 2025

Increase RX buffer from 64 bytes to 256 bytes (ESPHome UART bus component default). Other sizes can easily be defined in ESPHome YAML e.g. like this:

bk72xx:
  board: cbu
  framework:
    options:
      LT_SERIAL_BUFFER_SIZE: 512

Preparatory work for esphome/issues#6240. ESPHome could change LT_SERIAL_BUFFER_SIZE whenever rx_buffer_size: is changed.

Also covertly increases the send buffer for SoftwareSerial, but that should have no side effects.

@hn
Copy link
Contributor Author

hn commented Jan 11, 2025

Basic tests done with cbu and rtl8710bx modules.

@hn
Copy link
Contributor Author

hn commented Jan 11, 2025

Withdraw Relativize the above statement: rx_buffer_size: is a per-device (per-UART) setting, while LT_SERIAL_BUFFER_SIZE would be a global setting. That would be somewhat inconsistent.

Anyway, it is an advantage if the standard buffer size is increased and made adjustable.

@kuba2k2
Copy link
Member

kuba2k2 commented Jan 11, 2025

I know it's a per-UART setting, but it's the most logical place to put it. So unless rx_buffer_size: controls ESPHome's internal buffer, it should control LibreTiny's global buffer. If there is more than one UART component used (likely never), prohibit changing the buffer size on one of them only.

@kuba2k2 kuba2k2 changed the title [common] Make UART/serial RX buffer size configurable and increase default to 256 bytes [common] Make Serial RX buffer size configurable, increase default to 256 bytes Jan 13, 2025
@kuba2k2 kuba2k2 merged commit 2ea0066 into libretiny-eu:master Jan 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants