Also set DDR mask for upper 8 channels if using a 16-bit mux.

This commit is contained in:
Bas Laarhoven 2011-08-13 11:33:13 -07:00 committed by Markus Hitter
parent ffdfde8d8d
commit 9cc2bb9125
1 changed files with 3 additions and 0 deletions

View File

@ -59,6 +59,9 @@ void analog_init() {
// clear analog inputs in the data direction register(s) // clear analog inputs in the data direction register(s)
AIO0_DDR &= ~analog_mask; AIO0_DDR &= ~analog_mask;
#ifdef AIO8_DDR
AIO8_DDR &= ~(analog_mask >> 8);
#endif
// disable the analog inputs for digital use. // disable the analog inputs for digital use.
DIDR0 = analog_mask & 0xFF; DIDR0 = analog_mask & 0xFF;