- 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;
- } else {
- // next PWMLED
+ if (slow_adcs_wanted) {
+ current_adc = slow_adcs_wanted;
+ slow_adcs_wanted = 0;
+ goto found;
+ }
+
+ if (current_adc > N_PWMLEDS) {