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

Change digitalPinToInterrupt to return pin, and use...

Change digitalPinToInterrupt to return pin, and use g_APinDescription[pin].ulExtInt to map pin inside attachInterrupt/detachInterrupt

This brings things inline with the atachInterrupt documentation for
usage:
attachInterrupt(digitalPinToInterrupt(pin), ISR, mode);
parent 897532fc
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,7 @@ void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode)
uint32_t config;
uint32_t pos;
EExt_Interrupts in = digitalPinToInterrupt(pin);
EExt_Interrupts in = g_APinDescription[pin].ulExtInt;
if (in == NOT_AN_INTERRUPT || in == EXTERNAL_INT_NMI)
return;
......@@ -116,7 +116,7 @@ void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode)
*/
void detachInterrupt(uint32_t pin)
{
EExt_Interrupts in = digitalPinToInterrupt(pin);
EExt_Interrupts in = g_APinDescription[pin].ulExtInt;
if (in == NOT_AN_INTERRUPT || in == EXTERNAL_INT_NMI)
return;
......
......@@ -77,7 +77,7 @@ extern "C"
// #define digitalPinToTimer(P)
// Interrupts
#define digitalPinToInterrupt(P) ( g_APinDescription[P].ulExtInt )
#define digitalPinToInterrupt(P) ( P )
// LEDs
#define PIN_LED_13 (13u)
......
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