Control Surface pin-t-adl
MIDI Control Surface library for Arduino
NumInterrupts.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <Settings/NamespaceSettings.hpp>
5
6#ifdef ARDUINO_ARCH_NRF52840
7#include <pins_arduino.h>
8#endif
9
11
12// Teensy (and maybe others)
13#if defined(CORE_NUM_INTERRUPT)
14// CORE_NUM_INTERRUPT already defined by core
15
16// Wiring boards
17#elif defined(WIRING)
18#define CORE_NUM_INTERRUPT NUM_EXTERNAL_INTERRUPTS
19
20// Arduino Uno, Duemilanove, Diecimila, LilyPad, Mini, Fio, etc...
21#elif defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328PB__) || \
22 defined(__AVR_ATmega168__) || defined(__AVR_ATmega8__)
23#define CORE_NUM_INTERRUPT 2
24
25// Arduino Mega
26#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
27#define CORE_NUM_INTERRUPT 6
28
29// Arduino Nano Every, Uno R2 Wifi
30#elif defined(__AVR_ATmega4809__)
31#define CORE_NUM_INTERRUPT 22
32
33// Arduino Leonardo
34#elif defined(__AVR_ATmega32U4__) && !defined(CORE_TEENSY)
35#define CORE_NUM_INTERRUPT 5
36
37// Sanguino (untested) and ATmega1284P
38#elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__) || \
39 defined(__AVR_ATmega1284P__)
40#define CORE_NUM_INTERRUPT 3
41
42// ATmega32u2 and ATmega32u16 based boards with HoodLoader2
43#elif defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U2__)
44#define CORE_NUM_INTERRUPT 8
45
46#elif defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)
47#define CORE_NUM_INTERRUPT 1
48
49// https://github.com/SpenceKonde/ATTinyCore/blob/master/avr/extras/ATtiny_x313.md
50#elif defined(__AVR_ATtinyX313__)
51#define CORE_NUM_INTERRUPT 2
52
53// Attiny167 same core as above
54#elif defined(__AVR_ATtiny167__)
55#define CORE_NUM_INTERRUPT 2
56
57// Arduino Due
58#elif defined(__SAM3X8E__)
59#define CORE_NUM_INTERRUPT 54
60
61// ESP8266 (https://github.com/esp8266/Arduino/)
62#elif defined(ESP8266)
63#define CORE_NUM_INTERRUPT EXTERNAL_NUM_INTERRUPTS
64
65// ESP32 (https://github.com/espressif/arduino-esp32)
66#elif defined(ESP32)
67#define CORE_NUM_INTERRUPT 40
68
69// Arduino Zero - TODO: interrupts do not seem to work
70// please help, contribute a fix!
71#elif defined(__SAMD21G18A__) || defined(__SAMD21E18A__)
72#define CORE_NUM_INTERRUPT 31
73
74// SAMD51
75#elif defined(__SAMD51__)
76#define CORE_NUM_INTERRUPT 26
77
78// Arduino Nano BLE
79#elif defined(ARDUINO_ARCH_NRF52840)
80#define CORE_NUM_INTERRUPT NUM_DIGITAL_PINS
81
82// Arduino Nano RP2040 Connect
83#elif defined(ARDUINO_NANO_RP2040_CONNECT)
84#define CORE_NUM_INTERRUPT 20
85
86#elif defined(ARDUINO_ARCH_RP2040)
87#define CORE_NUM_INTERRUPT 26
88
89// ARM mbed OS
90#elif defined(ARDUINO_ARCH_MBED)
91#define CORE_NUM_INTERRUPT NUM_DIGITAL_PINS
92
93// Others
94#else
95#warning "Unknown board. Please specify the number of external interrupts."
96#define CORE_NUM_INTERRUPT NUM_DIGITAL_PINS
97
98#endif
99
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE