-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
platform_gpio_register_intr_hook does not update interrupt hook pins #3089
Comments
Good catch. |
Forgot to ask - should I make a PR to fix it or leave it up to you @pjsg ? |
You should make a PR... Thank you
…On Thu, May 7, 2020, 06:30 galjonsfigur ***@***.***> wrote:
Forgot to ask - should I make a PR to fix it or leave it up to you @pjsg
<https://github.com/pjsg> ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3089 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALQLTMKZX3NVLWOYRPZJ73RQKETBANCNFSM4M2NRTOQ>
.
|
Having looked at this code, what this issue really exposes is that the approach to registering and registering interrupt hooks needs to have temporal update integrity because the GPIO ISR is currently concurrently to this update process. Given that this is an very infrequent (typically zero or a few calls during startup) then the simplest and cleanest method of achieving this is to make This removes a lot of complexity rather than adding to it, which is a good thing, IMO. Incidentally another issue is that this registration task can fail and so returns a boolean success status. However all of the current modules that do this registration PS: @galjonsfigur, I've rewritten this routine. It's quite a bit shorter now. I can send you the patch if others think that we should go this route. |
Sorry Terry, missed this comment. I just merged the PR (already approved by @pjsg ). |
@marcelstoer, that's fine. I can raise this as part of the module tidy up. As I said, this change doesn't really fix the underlying issue |
While I was testing and cleaning up
softuart
module I discovered that serial receive from multiple pins does not work and only first registered object can receive. After some debugging I found that functionplatform_gpio_register_intr_hook
should update interrupt hook but It doesn't do it. Because of that, other modules that uses this function (for examplerotary
module) also has this problem. I don't have any encodes around but is seems like only first registered rotary encoder would work (according to the documentation registering and using 3 encoders should be possible)It seems like adding the following lines before the
return
hereshould fix this issue.
Expected behavior
platform_gpio_register_intr_hook
should update interrupt hookActual behavior
platform_gpio_register_intr_hook
does not update interrupt hookTest code
NodeMCU startup banner
NodeMCU 3.0.0.0
branch: dev
commit: 88a33af
release: 2.0.0-master_20170202 +509
release DTS: 202005011052
SSL: false
build type: float
LFS: 0x0 bytes total capacity
modules: adc,bit,dht,file,gpio,i2c,mqtt,net,node,ow,rotary,softuart,spi,tmr,uart,wifi
build 2020-05-06 13:52 powered by Lua 5.3.5 on SDK 3.0.1-dev(fce080e)
cannot open init.lua:
Hardware
NodeMCU Devkit V0.9 with ESP-12E
The text was updated successfully, but these errors were encountered: