SetWatch can miss interrupts? #1220
Replies: 6 comments
-
Posted at 2018-10-10 by @gfwilliams What device are you running it on? Up to date firmware? It can be an issue when you have an input that bounces extremely quickly though. Basically on most systems the hardware doesn't record the status of the input pin, so it has to be explicitly read. So you can get into a state where the IRQ fires, the state is read, then the state changes and the IRQ flag is cleared, but we're left logging only the previous state. Having looked at the code on STM32 based devices again just now I realised I can actually do a bit better though (resetting the interrupt flags immediately rather than after the event is logged) - so if you install a cutting edge build now you may find that the problem has gone away. I just did some tests on the WiFi and it seems an awful lot better. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-10-10 by Georg You're the best! So, then, if I read BTN instead of using a.state in the callback it should work always... right? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-10-10 by Georg Yesss, this seems to work fine:
I don't understand why does the red led stay on until the first BTN press? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-10-10 by Georg
Original Espruino Rev 1.3b, firmware 1v99 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-10-10 by @gfwilliams
Yes, that's correct. I'll answer the red LED thing in your other post on that topic: http://forum.espruino.com/conversations/326517/#comment14452282 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-10-10 by Georg
Got it, thanks. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-10-10 by Georg
With this:
Press the BTN a few times and the green led remains on sometimes, so the last edge has been missed?
Beta Was this translation helpful? Give feedback.
All reactions