diff options
| author | jacqueline <me@jacqueline.id.au> | 2022-10-14 15:45:00 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2022-10-14 15:45:00 +1100 |
| commit | a1518afd3cd0e3b7500c83f551115633e9c850c5 (patch) | |
| tree | ff69c5eddac2a3c0316ab6a955b965f4fc8558d8 /main/i2c.cpp | |
| parent | f77773496cde2b14e274ead6dd6fb04a1ce42383 (diff) | |
| download | tangara-fw-a1518afd3cd0e3b7500c83f551115633e9c850c5.tar.gz | |
Tune I2C buffer size
Diffstat (limited to 'main/i2c.cpp')
| -rw-r--r-- | main/i2c.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/main/i2c.cpp b/main/i2c.cpp index 9b218f3f..65ed9012 100644 --- a/main/i2c.cpp +++ b/main/i2c.cpp @@ -6,12 +6,12 @@ namespace gay_ipod { +static constexpr int kCmdLinkSize = I2C_LINK_RECOMMENDED_SIZE(12); + I2CTransaction::I2CTransaction() { // Use a fixed size buffer to avoid many many tiny allocations. - // TODO: make this static and tune the size. possibly make it optional too? - // threading. - buffer_ = (uint8_t*) calloc(sizeof(uint8_t), I2C_LINK_RECOMMENDED_SIZE(10)); - handle_ = i2c_cmd_link_create_static(buffer_, I2C_LINK_RECOMMENDED_SIZE(10)); + buffer_ = (uint8_t*) calloc(sizeof(uint8_t), kCmdLinkSize); + handle_ = i2c_cmd_link_create_static(buffer_, kCmdLinkSize); assert(handle_ != NULL && "failed to create command link"); } |
