Skip to content

Commit

Permalink
drivers/memory/spiflash: Fix setting of QE bit in flash register.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgeorge committed Mar 11, 2018
1 parent 0d5bcca commit cc34b08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/memory/spiflash.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ void mp_spiflash_init(mp_spiflash_t *self) {
// Set QE bit
uint32_t data = (mp_spiflash_read_cmd(self, CMD_RDSR, 1) & 0xff)
| (mp_spiflash_read_cmd(self, CMD_RDCR, 1) & 0xff) << 8;
if (!(data & (QSPI_QE_MASK << 16))) {
data |= QSPI_QE_MASK << 16;
if (!(data & (QSPI_QE_MASK << 8))) {
data |= QSPI_QE_MASK << 8;
mp_spiflash_write_cmd(self, CMD_WREN);
mp_spiflash_write_cmd_data(self, CMD_WRSR, 2, data);
mp_spiflash_wait_wip0(self);
Expand Down

0 comments on commit cc34b08

Please sign in to comment.