From 08ff3c0a049d986290b17b954545c59c75fedc4c Mon Sep 17 00:00:00 2001 From: Laurent Navet Date: Tue, 10 Jan 2017 21:48:39 +0100 Subject: [PATCH] boards/arduino-common: fix software interrupt for context swap It wasn't working with pin1/PC6/PINT14 Use pin28/PC5/PINT13 instead --- boards/arduino-common/include/board.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/arduino-common/include/board.h b/boards/arduino-common/include/board.h index 60febb8588..c908082c76 100644 --- a/boards/arduino-common/include/board.h +++ b/boards/arduino-common/include/board.h @@ -55,16 +55,16 @@ extern "C" { /** ** Context swap defines - ** Setup to use PJ6 which is pin change interrupt 15 (PCINT15) + ** Setup to use PC5 which is pin change interrupt 13 (PCINT13) ** This emulates a software triggered interrupt ***/ #define AVR_CONTEXT_SWAP_INIT do { \ - DDRC |= (1 << PC6); \ + DDRC |= (1 << PC5); \ PCICR |= (1 << PCIE1); \ - PCMSK1 |= (1 << PCINT14); \ + PCMSK1 |= (1 << PCINT13); \ } while (0) #define AVR_CONTEXT_SWAP_INTERRUPT_VECT PCINT1_vect -#define AVR_CONTEXT_SWAP_TRIGGER PORTC ^= (1 << PC6) +#define AVR_CONTEXT_SWAP_TRIGGER PORTC ^= (1 << PC5) /**