Why don't you go the opposite way and just define BUFFER_INDEX, then it's easy to create BUFFER_LENGTH through a bit shifting that the processor will do for you?
const byte BUFFER_INDEX = 5;
const size_t BUFFER_LENGTH = 1 << BUFFER_INDEX;
Why don't you go the opposite way and just define BUFFER_INDEX, then it's easy to create BUFFER_LENGTH through a bit shifting that the processor will do for you?
const byte BUFFER_INDEX = 5;
const size_t BUFFER_LENGTH = 1 << BUFFER_INDEX;