[TriEmbed] TriEmbed Digest, Vol 58, Issue 10

Alex Davis alexd at matrixwide.com
Mon Mar 12 11:54:42 CDT 2018


>> 
>> All I do in the handler is detach the interrupt.
> This is the point in other forums where somebody would yell at you for 
> not showing us enough of your code. :-)
> 
> I studied the detachInterrupt code for the 32U4 and it does just what 
> one would expect: clears the enable register bit for the given interrupt 
> number. You're sure you're giving it the correct interrupt number and 
> not the pin number, right? If that was mixed up then every time you 
> pushed the button you'd still be getting another interrupt. If it's a 
> level interrupt vs edge triggered, then that would explain the hang 
> until you released the button ('cause every time you left the handler 
> the interrupt would occur again while the button was pressed)

Yeah the initial mistake was using detachInterrupt(BUTTON_0); not detachInterrupt(digitalPinToInterrupt(BUTTON_0)); I think I still had issues after fixing that though.

I am using level interrupts. Does the 32u4 wake from an edge? However, I do detach the interrupt in the handler… maybe it still jumps to the start in memory before it gets to the detach instructions though. Good point.

Hopefully my new LIS3DH boards will come in soon!



|\ |  (¯  \/ |¯\  |V| |\ ¯|¯ |¯) | \/ | | | |¯\ (¯   /¯  /\ |V|
|-||_ (_  /\ |_/ @| | |-| |  | \ | /\ |^| | |_/ (_ . \_  \/ | |







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20180312/080c1c0e/attachment.htm>


More information about the TriEmbed mailing list