Browse Source

Allow attachInterrupt without pinMode (for AVR compatibility)

teensy4-core
PaulStoffregen 8 years ago
parent
commit
e76a593adc
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      teensy3/pins_teensy.c

+ 5
- 1
teensy3/pins_teensy.c View File

} }
mask = (mask << 16) | 0x01000000; mask = (mask << 16) | 0x01000000;
config = portConfigRegister(pin); config = portConfigRegister(pin);

if ((*config & 0x00000700) == 0) {
// for compatibility with programs which depend
// on AVR hardware default to input mode.
pinMode(pin, INPUT);
}
#if defined(KINETISK) #if defined(KINETISK)
attachInterruptVector(IRQ_PORTA, port_A_isr); attachInterruptVector(IRQ_PORTA, port_A_isr);
attachInterruptVector(IRQ_PORTB, port_B_isr); attachInterruptVector(IRQ_PORTB, port_B_isr);

Loading…
Cancel
Save