diff options
Diffstat (limited to 'drivers/avr/i2c_slave.h')
| -rw-r--r-- | drivers/avr/i2c_slave.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/avr/i2c_slave.h b/drivers/avr/i2c_slave.h index 1cd0625ef..a8647c9da 100644 --- a/drivers/avr/i2c_slave.h +++ b/drivers/avr/i2c_slave.h | |||
| @@ -22,7 +22,18 @@ | |||
| 22 | 22 | ||
| 23 | #pragma once | 23 | #pragma once |
| 24 | 24 | ||
| 25 | #define I2C_SLAVE_REG_COUNT 30 | 25 | #ifndef I2C_SLAVE_REG_COUNT |
| 26 | |||
| 27 | # if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) | ||
| 28 | # include "transport.h" | ||
| 29 | # define I2C_SLAVE_REG_COUNT sizeof(split_shared_memory_t) | ||
| 30 | # else // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) | ||
| 31 | # define I2C_SLAVE_REG_COUNT 30 | ||
| 32 | # endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) | ||
| 33 | |||
| 34 | #endif // I2C_SLAVE_REG_COUNT | ||
| 35 | |||
| 36 | _Static_assert(I2C_SLAVE_REG_COUNT < 256, "I2C target registers must be single byte"); | ||
| 26 | 37 | ||
| 27 | extern volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT]; | 38 | extern volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT]; |
| 28 | 39 | ||
