Set default check register for shared interrupts (IDFGH-14469) #15243
+49
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The CPU interrupt signal of the ESP chip is very limited, and some basic peripherals in IDF have registered and used some interrupt signals. Usually in more complex application scenarios, it is easy to encounter the problem of being unable to register interrupts. For this situation, there are generally two ways to deal with it:
However, the current shared interrupt logic design has defects. If the driver does not explicitly set statusreg when registering a shared interrupt, different peripherals assigned to the same interrupt signal, as long as one peripheral generates an interrupt, all peripheral interrupt programs will be executed once, which will cause some peripheral driver processing logic to be abnormal (such as SPI master driver).
There are two ideas to solve this problem:
This modification corresponds to the second point above.
Related
Testing
Based on the examples/peripherals/lcd/spi_lcd_touch routine, I modified the initialization of spi to a shared interrupt, and added the initialization of the i2c peripheral to a shared interrupt, and periodically executed i2c transmission to cause a crash.
I tested this modification on the ESP32/ESP32S2/ESP32S3/ESP32C2/ESP32C3/ESP32C6 platform and no crash occurred
Checklist
Before submitting a Pull Request, please ensure the following: