-
Notifications
You must be signed in to change notification settings - Fork 13.3k
noInterrupts(), interrupts() #2218
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
Comments
Current implementation of For the ESP8266, the only values of Now for the ESP32 things get slightly more interesting because we have more interrupt levels and also we have two SMP cores. I'm still deliberating on the best model to use in that case. I'd like to use the same code for both chips, if possible. |
Also /cc @Makuna who participated in |
Something we should also research is the use of the AVR asm wrappers. cli() and sei() which map directly to or they directly map to them. Further, there is a technique used for Nesting, using the SREG sandwich where you store the SREG (where the global interrupt flag resides), then cli(), then do work, and end by reapplying the saved SREG. You may find this use a little more common. On the subject of why did we use xt_rsil(15) in the first place. There is one interrupt in the core for WiFi that was causing problems with bitbang timing. This was the only means I found to disable it at the time. BUT, in the end, the Esp8266 really can't have that interrupt disabled for too long. I believe I commented to igrr at some point last fall that we should probably undo that as it could cause worse problems; but we needed investigation into what level was best and it looks like it is happening now. |
I checked Bootrom code:
Interrupt level 3, and no counter.... ? |
You are right, I was looking at a different revision of the code. |
I also want to raise an important issue that a lot of esp8266 developers forget. Igrr does a great job keeping to this; but I want to restate this as lately when dealing with my own Arduino libraries I have to keep reminding users. We need to make sure we are "logically" compatible with Arduino AVR targeted sketches/libraries. Extensions that are specific to esp8266 are fine; but can't be a requirement to use. |
Hello! |
|
Thank you so much! Yes, sorry, I'll post to esp32 issue tracker next time |
@igrr you expressed interest in refactoring the interrupt code here, to unify esp8266/esp32. However, the issue is labeled only as Question. |
Closing due to lack of feedback in a long time. |
Hardware
Hardware: n.a.
Core Version: 2.2.0
Description
Is there any good reason why we are using xt_rsil(15)/xt_rsil(0) for noInterrupts()/interrupts() ???
Doesn't ets_intr_lock()/ets_intr_unlock() do the same job without the need for storing the result of xt_rsil(...) and calling xt_wsr_ps(..) ???
i use the following class to disable interrupts for some time now without any problems:
The text was updated successfully, but these errors were encountered: