Skip to content

Commit

Permalink
I2C: allow static redefinition of buffer size
Browse files Browse the repository at this point in the history
Default buffer size is still 32,
but it is now possible to redefine compilation switch: I2C_TXRX_BUFFER_SIZE
It's maximum value is 255
  • Loading branch information
ABOSTM authored and fpistm committed Jan 6, 2020
1 parent 757493c commit bca9a7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/Wire/src/utility/twi.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ extern "C" {
#endif

/* I2C Tx/Rx buffer size */
#if !defined(I2C_TXRX_BUFFER_SIZE)
#define I2C_TXRX_BUFFER_SIZE 32
#elif (I2C_TXRX_BUFFER_SIZE >= 256)
#error I2C buffer size cannot exceed 255
#endif

/* Redefinition of IRQ for F0/G0/L0 families */
#if defined(STM32F0xx) || defined(STM32G0xx) || defined(STM32L0xx)
Expand Down

0 comments on commit bca9a7e

Please sign in to comment.