Browse Source

One less compare

teensy4-core
Kurt Eckhardt 8 years ago
parent
commit
8fdabf68ed
1 changed files with 3 additions and 6 deletions
  1. +3
    -6
      teensy3/analog.c

+ 3
- 6
teensy3/analog.c View File

// A18 PTC10 ADC1_SE6b // A18 PTC10 ADC1_SE6b
// A19 PTC11 ADC1_SE7b // A19 PTC11 ADC1_SE7b
// A20 PTA17 ADC1_SE17 // A20 PTA17 ADC1_SE17
23, 23+128, 10+128, 11+128, 26, 18+128 // A21-A24, temp sensor, vref
23, 23+128, 26, 18+128, 10+128, 11+128 // A21-A22, temp sensor, vref A23, A24
// A21 DAC0 ADC0_SE23 // A21 DAC0 ADC0_SE23
// A22 DAC1 ADC1_SE23 // A22 DAC1 ADC1_SE23
}; };
index = pin - 19; // 31-39 are A12-A20 index = pin - 19; // 31-39 are A12-A20
} else if (pin >= 40 && pin <= 41) { } else if (pin >= 40 && pin <= 41) {
index = pin - 30; // 40-41 are A10-A11 index = pin - 30; // 40-41 are A10-A11
} else if (pin >= 42 && pin <= 43) {
} else if (pin >= 42 && pin <= 45) {
index = pin - 21; // 42-43 are A21-A22 index = pin - 21; // 42-43 are A21-A22
} else if (pin >= 49 && pin <= 50) { } else if (pin >= 49 && pin <= 50) {
index = pin - 26; // 50 and 51 are A23-A24
// Leave compatibility with older where 44 and 45 are Temp and Vref
} else if (pin >= 44 && pin <= 45) {
index = pin - 19; // 42-43 are A21-A22, 44 is temp sensor, 45 is vref A25, 26
index = pin - 24; // 49 and 50 are A23-A24
} else { } else {
return 0; return 0;
} }

Loading…
Cancel
Save