Skip to content
Snippets Groups Projects
Commit 2e620d70 authored by Sandeep Mistry's avatar Sandeep Mistry
Browse files

Move digitalPinToInterrupt definition to Arduino.h if variant compliance it 1.6.5 or higher

parent 0352cc85
No related branches found
No related tags found
No related merge requests found
......@@ -114,6 +114,11 @@ void loop( void ) ;
#define bit(b) (1UL << (b))
#if (ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10605)
// Interrupts
#define digitalPinToInterrupt(P) ( g_APinDescription[P].ulExtInt )
#endif
// USB Device
#include "USB/USBDesc.h"
#include "USB/USBCore.h"
......
......@@ -57,7 +57,11 @@ void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode)
uint32_t config;
uint32_t pos;
#if ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10605
EExt_Interrupts in = g_APinDescription[pin].ulExtInt;
#else
EExt_Interrupts in = digitalPinToInterrupt(pin);
#endif
if (in == NOT_AN_INTERRUPT || in == EXTERNAL_INT_NMI)
return;
......@@ -116,7 +120,11 @@ void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode)
*/
void detachInterrupt(uint32_t pin)
{
#if (ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10605)
EExt_Interrupts in = g_APinDescription[pin].ulExtInt;
#else
EExt_Interrupts in = digitalPinToInterrupt(pin);
#endif
if (in == NOT_AN_INTERRUPT || in == EXTERNAL_INT_NMI)
return;
......
......@@ -19,8 +19,8 @@
#ifndef _VARIANT_ARDUINO_ZERO_
#define _VARIANT_ARDUINO_ZERO_
// The definitions here needs a SAMD core >=1.6.3
#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10603
// The definitions here needs a SAMD core >=1.6.5
#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10605
/*----------------------------------------------------------------------------
* Definitions
......@@ -76,9 +76,6 @@ extern "C"
*/
// #define digitalPinToTimer(P)
// Interrupts
#define digitalPinToInterrupt(P) ( P )
// LEDs
#define PIN_LED_13 (13u)
#define PIN_LED_RXL (25u)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment