1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/boards/arduino-mega2560
Jon Thacker e0365e0bf9 atmega: use software interrupt for context swap
Fixes #5745
For AVR based boards, three defines must be defined AVR_CONTEXT_SWAP_INIT,
AVR_CONTEXT_SWAP_INTERRUPT_VECT, and AVR_CONTEXT_SWAP_TRIGGER.
These defines are used to trigger a software interrupt used for context
switching.

When AVR_CONTEXT_SWAP_INTERRUPT_VECT is handled, the scheduler is run
and a context swap will happen if necessary, with the resulting thread
starting following the reti instruction. This results in threads running
at normal priority instead of at interrupt priority.

Atmega devices do provide a pure software interrupt. The method used
here for waspmote-pro and arduino-mega2560 is to use pin change
interrupts, set the pin to act as an output, and toggle the value to
simulate a software interrupt. The main limitation here is that a
physical pin is now occupied and must be defined for each board
supported by RIOT. On the plus side, it provides an easy method for
detecting context swaps with an oscilloscope.
2016-09-07 14:35:53 -05:00
..
dist scripts: remove hardcoding of bash hashbang 2015-11-25 16:20:56 +01:00
include atmega: use software interrupt for context swap 2016-09-07 14:35:53 -05:00
board.c core: Fix/refactor function naming in core/incude/irq.h 2016-03-20 16:47:34 +01:00
Makefile boards: changed module name to 'board' 2015-12-07 17:53:22 +01:00
Makefile.features boards/arduino-mega2560: added SPI configuration 2016-03-09 18:34:42 +01:00
Makefile.include boards/arduino-mega2560: Add -Wno-error if building with LTO 2016-08-10 16:18:29 +02:00