Skip to content

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

Merged
merged 6 commits into from
Oct 6, 2019
Merged

Update EEPROM.cpp #6599

merged 6 commits into from
Oct 6, 2019

Conversation

devyte
Copy link
Collaborator

@devyte devyte commented Oct 4, 2019

use InterruptLock class for scoped interrupts instead of blindly disabling/enabling interrupts, which doesn't support nesting nor restore previous state.
Fixes #6589

devyte added 2 commits October 3, 2019 23:53
use InterruptLock class for scoped interrupts instead of blindly disabling/enabling interrupts, which doesn't support nesting nor restore previous state.
Add forgotten include
Copy link
Collaborator

@earlephilhower earlephilhower left a 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).

devyte added a commit that referenced this pull request Oct 5, 2019
devyte added 2 commits October 5, 2019 18:21
Remove locks, simplify code
Copy link
Collaborator

@earlephilhower earlephilhower left a 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.

@devyte devyte merged commit a00a474 into master Oct 6, 2019
@devyte devyte deleted the devyte-interruptLock branch October 6, 2019 01:21
devyte added a commit that referenced this pull request Oct 6, 2019
* Minor cleanups in ESPClass

Related to #6599

Fix inverted conditions

Remove useless comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace noInterrupts/Interrupts with InterruptLock in EEPROM
2 participants