Skip to content

How can I prevent soft interrupts stacking up until schedule queue is full? #13187

Discussion options

You must be logged in to vote
p.irq(handler=isr, trigger=Pin.IRQ_FALLING | Pin.IRQ_RISING, hard=False)

That line already prepares to schedule delayed calls which will run once a full Python line has been completed.
Problem is, it initially does that using hardware interrupts. So a bouncing contact quite likely triggers a whole bunch of hardware IRQs within a few µs, resulting in the schedule stack overflow.

Have you tried using ›hard=True‹ and disable IRQ there?
Not that it would be the best practice…

Replies: 9 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by rkompass
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@GitHubsSilverBullet
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@rkompass
Comment options

@peterhinch
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@peterhinch
Comment options

Comment options

You must be logged in to vote
1 reply
@robert-hh
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants