-#define NUM_ADCS 6
-volatile static unsigned char current_adc;
-static uint16_t adc_sum;
-static unsigned char sum_shift;
-static unsigned char adc_vals;
+#define NUM_ADCS ZERO_ADC
+
+struct {
+ unsigned char read_zero_log : 2;
+ unsigned char read_drop_log : 2;
+ unsigned char read_keep_log : 4;
+} adc_params[NUM_ADCS] = {
+ { 0, 1, PWMLED_ADC_SHIFT }, // pwmled 1
+ { 0, 1, PWMLED_ADC_SHIFT }, // pwmled 2
+ { 0, 1, PWMLED_ADC_SHIFT }, // pwmled 3
+ { 0, 1, AMBIENT_ADC_SHIFT }, // ambient
+ { 0, 1, 0 }, // battery
+ { 0, 1, 0 }, // gain20
+ { 0, 1, 0 }, // buttons
+};
+
+volatile static unsigned char current_adc, current_slow_adc;
+static uint16_t adc_sum, zero_count, drop_count, read_count, n_reads_log;