diff --git a/main/gay-ipod-fw.cpp b/main/gay-ipod-fw.cpp index 69c0f87f..ffbdea62 100644 --- a/main/gay-ipod-fw.cpp +++ b/main/gay-ipod-fw.cpp @@ -17,7 +17,6 @@ #include "driver/sdspi_host.h" #include "driver/spi_common.h" #include "driver/spi_master.h" -#include "esp_heap_trace.h" #include "esp_intr_alloc.h" #include "esp_log.h" #include "hal/gpio_types.h" 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"); }