|
@@ -229,12 +229,14 @@ public:
|
229
|
229
|
}
|
230
|
230
|
|
231
|
231
|
// Begin ADC sampling on the given channel
|
232
|
|
- static inline void adc_start(const pin_t ch) {
|
|
232
|
+ static inline void adc_start(const uint8_t ch) {
|
233
|
233
|
#ifdef MUX5
|
234
|
|
- if (ch > 7) { ADCSRB = _BV(MUX5); return; }
|
|
234
|
+ ADCSRB = ch > 7 ? _BV(MUX5) : 0;
|
|
235
|
+ #else
|
|
236
|
+ ADCSRB = 0;
|
235
|
237
|
#endif
|
236
|
|
- ADCSRB = 0;
|
237
|
|
- ADMUX = _BV(REFS0) | (ch & 0x07); SBI(ADCSRA, ADSC);
|
|
238
|
+ ADMUX = _BV(REFS0) | (ch & 0x07);
|
|
239
|
+ SBI(ADCSRA, ADSC);
|
238
|
240
|
}
|
239
|
241
|
|
240
|
242
|
// Is the ADC ready for reading?
|