diff --git a/boards/arduino-common/include/board.h b/boards/arduino-common/include/board.h index ea0b9d8403..fe84d1d286 100644 --- a/boards/arduino-common/include/board.h +++ b/boards/arduino-common/include/board.h @@ -53,6 +53,20 @@ extern "C" { #define LED0_TOGGLE (PORTB ^= LED0_MASK) /** @} */ +/** + ** Context swap defines + ** Setup to use PJ6 which is pin change interrupt 15 (PCINT15) + ** This emulates a software triggered interrupt + ***/ +#define AVR_CONTEXT_SWAP_INIT do { \ + DDRC |= (1 << PC6); \ + PCICR |= (1 << PCIE1); \ + PCMSK1 |= (1 << PCINT14); \ +} while (0) +#define AVR_CONTEXT_SWAP_INTERRUPT_VECT PCINT1_vect +#define AVR_CONTEXT_SWAP_TRIGGER PORTC ^= (1 << PC6) + + /** * @brief xtimer configuration values * @{