Bläddra i källkod

Don't allow pre-init of Serial2 Teensy 3.2 pins on Teensy3.6

teensy4-core
PaulStoffregen 8 år sedan
förälder
incheckning
be40459682
1 ändrade filer med 4 tillägg och 2 borttagningar
  1. +4
    -2
      teensy3/serial2.c

+ 4
- 2
teensy3/serial2.c Visa fil

@@ -120,15 +120,17 @@ void serial2_begin(uint32_t divisor)
#if defined(KINETISK)
switch (rx_pin_num) {
case 9: CORE_PIN9_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_PFE | PORT_PCR_MUX(3); break;
#if defined(__MK20DX128__) || defined(__MK20DX256__) // T3.0, T3.1, T3.2
case 26: CORE_PIN26_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_PFE | PORT_PCR_MUX(3); break;
#if defined(__MK64FX512__) || defined(__MK66FX1M0__) // on T3.5 or T3.6
#elif defined(__MK64FX512__) || defined(__MK66FX1M0__) // T3.5 or T3.6
case 59: CORE_PIN59_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_PFE | PORT_PCR_MUX(3); break;
#endif
}
switch (tx_pin_num) {
case 10: CORE_PIN10_CONFIG = PORT_PCR_DSE | PORT_PCR_SRE | PORT_PCR_MUX(3); break;
#if defined(__MK20DX128__) || defined(__MK20DX256__) // T3.0, T3.1, T3.2
case 31: CORE_PIN31_CONFIG = PORT_PCR_DSE | PORT_PCR_SRE | PORT_PCR_MUX(3); break;
#if defined(__MK64FX512__) || defined(__MK66FX1M0__) // on T3.5 or T3.6
#elif defined(__MK64FX512__) || defined(__MK66FX1M0__) // T3.5 or T3.6
case 58: CORE_PIN58_CONFIG = PORT_PCR_DSE | PORT_PCR_SRE | PORT_PCR_MUX(3); break;
#endif
}

Laddar…
Avbryt
Spara