General area when it fits no where else

Moderator: Mmiscool

User avatar
By JMS
#67599 I have a momentary normally open switch connected to pin 13 and ground. Pin 13 also has a 10k pull up resistor connected to pin 13 & +3.3v.

When I press the button the section it runs once and then when reset the interrupt the vars page tells me it that the interrupt is waiting for the pin to go high even though the pin is high when I reset the interrupt. I had very similar code in the 2.0 branch and it worked well for a long time but when I upgraded the firmware to the 3.0 branch I started getting this behavior.

1. If I read the pin before I reset the interrupt it reads high, like it should
2. I tried writing the pin high before setting the interrupt
3. I tried writing the pin low before setting the interrupt

Below is a condensed version of the code


Code: Select all
interrupt garageSwitchPin, [garageButtonPress]

[garageButtonPress]
interrupt garageSwitchPin
print "buttonPress <br>"
gosub [garageFlipFlop]
delay 500
interrupt garageSwitchPin, [garageButtonPress]
wait

[garageFlipFlop]
if io(laststat,garageRelayPin) = 1 then
   io(po,garageRelayPin,0)
   io(po,garageIndicatePin,0)
else
   io(po,garageRelayPin,1)
   io(po,garageIndicatePin,1)
endif
return
User avatar
By JMS
#67642 Thank's Ill give that a try.

Electroguard wrote:A first thing to try could be reducing the vars names to 10 chars or less (if the 10 char limit still applies).
User avatar
By JMS
#68166 I reduced the variable names to < 10 characters an I had to write the interrupt pin HIGH again before I reset the interrupt. All is working well now.