PaulStoffregen 8 years ago
parent
commit
d87c9814b9
1 changed files with 15 additions and 3 deletions
  1. +15
    -3
      teensy3/avr_emulation.h

+ 15
- 3
teensy3/avr_emulation.h View File

} }
inline void disable_pins(void) __attribute__((always_inline)) { inline void disable_pins(void) __attribute__((always_inline)) {
//serial_print("disable_pins\n"); //serial_print("disable_pins\n");
CORE_PIN11_CONFIG = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
CORE_PIN12_CONFIG = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
CORE_PIN13_CONFIG = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
if ((pinout & 1) == 0) {
CORE_PIN11_CONFIG = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
} else {
CORE_PIN7_CONFIG = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
}
if ((pinout & 2) == 0) {
CORE_PIN12_CONFIG = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
} else {
CORE_PIN8_CONFIG = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
}
if ((pinout & 4) == 0) {
CORE_PIN13_CONFIG = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
} else {
CORE_PIN14_CONFIG = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
}
} }
}; };
extern SPCRemulation SPCR; extern SPCRemulation SPCR;

Loading…
Cancel
Save