Skip to content

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

3 participants