Currently, two independently defined constants are used:
#define ADC_MAX_AVERAGE 8 // must be 2^n
#define ADC_MAX_AVERAGE_LOG2 3 // please calculate LOG2(ADC_MAX_AVERAGE)
These should be bound to the same value, in order to avoid accidental misalignments:
#define ADC_MAX_AVERAGE_LOG2 3
#define ADC_MAX_AVERAGE (1 << ADC_MAX_AVERAGE_LOG2) // must be 2^n