-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Update EEPROM.cpp #6599
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
Update EEPROM.cpp #6599
Conversation
use InterruptLock class for scoped interrupts instead of blindly disabling/enabling interrupts, which doesn't support nesting nor restore previous state.
Add forgotten include
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate to be that guy but this whole code implies that spi_flash_read()
, spi_flash_write()
, and spi_flash_erase()
need interrupts disabled.
They don't, unless you allow people to use IRQ service routines not in IRAM. So the noInterrupts/Interrupts
would better be completely dropped.
If you're saying that we must disable interrupts on spi_flash_xxx, then I'd still drop the nointerrupts/interrupts here and place the IRQ lock inside the spi_xxx routines (where they actually used to be disabled, check the history).
Remove locks, simplify code
Fix typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can drop the interrupts.h include, but it's not a problem.
Drop needless include
* Minor cleanups in ESPClass Related to #6599 Fix inverted conditions Remove useless comments
use InterruptLock class for scoped interrupts instead of blindly disabling/enabling interrupts, which doesn't support nesting nor restore previous state.
Fixes #6589