@ScruffR Thanks for opening the issue. Ill keep that in mind if I run into any other issues.
@satishgn My code is as follows
#include "application.h"
SYSTEM_MODE(MANUAL);
pin_t myLed = P1S4;
pin_t myInterruptPin = A4;
void toggleLed(void)
{
digitalWrite(myLed, 1^digitalRead(D7));
}
void setup()
{
pinMode(myLed, OUTPUT);
pinMode(myInterruptPin, OUTPUT);
attachInterrupt(myInterruptPin, toggleLed, FALLING);
digitalWrite(myInterruptPin, HIGH);
}
void loop()
{
}
When I pull A4 low it toggles the LED like its supposed too. If I change code to
pinMode(myInterruptPin, INPUT_PULLUP);
attachInterrupt(myInterruptPin, toggleLed, FALLING);
myInterruptPin seems to go low after the attachInterrupt function returns… Not sure why…
I also want to point out that i’m testing only on a P1 module and compiling with "PLATFORM=P1"
Things may me different on the photon.
Thanks for the note about EXT1 on the photon, I wasn’t aware of this. Is this the same deal on the P1 module? If it is, it should be much more clear on the P1 Datasheet
Also, I think the following code from your snippit
//Note: According to current implementation
//pin mode INPUT_PULLUP => should use FALLING interrupt mode
//pin mode INPUT_PULLDOWN => should use RISING interrupt mode
is a bit misleading for anyone else reading this. The interrupt mode is quit independent of the pin mode. It really doesn’t matter who’s doing the pulling-up or pulling-down, or in my working example, if it even thinks its a input at all. The interrupt should fire On the way up, down, or change if thats whats configured in the register.