From 2a09426fa61863597fc67a34630aa0bb994f8fc2 Mon Sep 17 00:00:00 2001 From: Piotr Esden-Tempski Date: Sun, 2 Sep 2018 13:56:26 -0700 Subject: [PATCH] Replace the 0xFF command with FC_EQPI. --- iceprog/iceprog.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iceprog/iceprog.c b/iceprog/iceprog.c index 6462b3d..7a4ac79 100644 --- a/iceprog/iceprog.c +++ b/iceprog/iceprog.c @@ -175,6 +175,7 @@ enum flash_cmd { FC_EPR = 0x7A, /* Erase / Program Resume */ FC_PD = 0xB9, /* Power-down */ FC_QPI = 0x38, /* Enter QPI mode */ + FC_EQPI = 0xFF, /* Exit QPI mode */ FC_ERESET = 0x66, /* Enable Reset */ FC_RESET = 0x99, /* Reset Device */ }; @@ -394,11 +395,11 @@ static void flash_read_id() static void flash_reset() { flash_chip_select(); - xfer_spi_bits(0xFF, 8); + xfer_spi_bits(FC_EQPI, 8); flash_chip_deselect(); flash_chip_select(); - xfer_spi_bits(0xFF, 2); + xfer_spi_bits(FC_EQPI, 2); flash_chip_deselect(); }