Skip to content

Wire: limit buffer size allocation #1539

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

Closed
fpistm opened this issue Nov 10, 2021 · 0 comments · Fixed by #1562
Closed

Wire: limit buffer size allocation #1539

fpistm opened this issue Nov 10, 2021 · 0 comments · Fixed by #1562
Labels

Comments

@fpistm
Copy link
Member

fpistm commented Nov 10, 2021

Currently, built-in Wire library dynamically allocate Rx and Tx Buffer and raised an error when no more space are available.
(TwoWire::allocateRxBuffer and TwoWire::allocateTxBuffer)
Goal of this issue is to add a maximum buffer length and return 0 if it is reached to allow application to know the buffer is full and need to be flushed (endTransmission).
Ex: https://github.com/simondlevy/VL53L5/blob/b81b3d1bef74bdecbe7615e3a498a8648a2fdd0d/src/st/platform.cpp#L117-L140

@fpistm fpistm added arduino compatibility enhancement New feature or request labels Nov 10, 2021
ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this issue Nov 25, 2021
If data size to be sent is greater than the max defined,
application can split the transfert
Note: no limit implemented in RX buffer, because when receiving,
data are received on I2C, it is not possible to split.

Fixes stm32duino#1539

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this issue Nov 26, 2021
If data size to be sent is greater than the max defined,
application can split the transfert
Note: no limit implemented in RX buffer, because when receiving,
data are received on I2C, it is not possible to split.

Fixes stm32duino#1539

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this issue Nov 26, 2021
If data size to be sent is greater than the max defined,
application can split the transfert
Note: no limit implemented in RX buffer, because when receiving,
data are received on I2C, it is not possible to split.

Fixes stm32duino#1539

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this issue Nov 26, 2021
If data size to be sent is greater than the max defined,
application can split the transfert
Note: no limit implemented in RX buffer, because when receiving,
data are received on I2C, it is not possible to split.

Fixes stm32duino#1539

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant