Skip to content

Commit cc34b08

Browse files
committed
drivers/memory/spiflash: Fix setting of QE bit in flash register.
1 parent 0d5bcca commit cc34b08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/memory/spiflash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ void mp_spiflash_init(mp_spiflash_t *self) {
181181
// Set QE bit
182182
uint32_t data = (mp_spiflash_read_cmd(self, CMD_RDSR, 1) & 0xff)
183183
| (mp_spiflash_read_cmd(self, CMD_RDCR, 1) & 0xff) << 8;
184-
if (!(data & (QSPI_QE_MASK << 16))) {
185-
data |= QSPI_QE_MASK << 16;
184+
if (!(data & (QSPI_QE_MASK << 8))) {
185+
data |= QSPI_QE_MASK << 8;
186186
mp_spiflash_write_cmd(self, CMD_WREN);
187187
mp_spiflash_write_cmd_data(self, CMD_WRSR, 2, data);
188188
mp_spiflash_wait_wip0(self);

0 commit comments

Comments
 (0)