diff options
author | Damien George <damien.p.george@gmail.com> | 2018-03-11 11:25:38 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-03-11 11:25:38 +1100 |
commit | cc34b087f0fe121afb03dcfe99180737ab925372 (patch) | |
tree | 402fb502c6d7bcd0df3794c2db9db7a94d46abb4 | |
parent | 0d5bccad11f2ccc11e513c3fff3ba65d1f4846b0 (diff) |
drivers/memory/spiflash: Fix setting of QE bit in flash register.
-rw-r--r-- | drivers/memory/spiflash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/memory/spiflash.c b/drivers/memory/spiflash.c index ad451f2c5..c7f333044 100644 --- a/drivers/memory/spiflash.c +++ b/drivers/memory/spiflash.c @@ -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); |