Skip to content
Snippets Groups Projects
Commit 5b8cfb0b authored by Laurent Navet's avatar Laurent Navet
Browse files

boards/arduino-common: use software interrupt for context swap

parent 3ff576e4
Branches
No related tags found
No related merge requests found
...@@ -53,6 +53,20 @@ extern "C" { ...@@ -53,6 +53,20 @@ extern "C" {
#define LED0_TOGGLE (PORTB ^= LED0_MASK) #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 * @brief xtimer configuration values
* @{ * @{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment