-#if 0
- if (current_adc == 0) {
- if (current_slow_adc > N_PWMLEDS) {
- // read one of the non-PWMLED ADCs
- current_adc = --current_slow_adc;
- } else {
- // no more non-PWMLEDs to do, start with PWMLEDs
- current_adc = N_PWMLEDS-1;
- }
- } else if (current_adc >= N_PWMLEDS) {
- // one of the non-PWMLED ADCs just finished, skip to PWMLEDs.
- current_adc = N_PWMLEDS-1;
+ if (need_battery_adc) {
+ need_battery_adc = 0;
+ current_adc = 1;
+ read_zero = 1;
+ drop_count = 1;
+ read_count = 1;
+ n_reads_log = 0;
+ } else if (need_pwmled_adc) {
+ current_adc = 0;
+ read_zero = 0;
+ drop_count = 1;
+ read_count = 1 << PWMLED_ADC_SHIFT;
+ n_reads_log = PWMLED_ADC_SHIFT;