diff options
author | Piotr Esden-Tempski <piotr@esden.net> | 2018-08-18 14:46:12 -0700 |
---|---|---|
committer | Piotr Esden-Tempski <piotr@esden.net> | 2018-08-18 14:46:12 -0700 |
commit | 3ba1acf31bc0ee83d8b545af03e144cb942d1f88 (patch) | |
tree | 90f64e446b3ba7b7b784eb03fb9bc3da2036e662 | |
parent | ee7eae0be87cc238e6b4be409d5fc3c711438e05 (diff) | |
download | icestorm-3ba1acf31bc0ee83d8b545af03e144cb942d1f88.tar.gz icestorm-3ba1acf31bc0ee83d8b545af03e144cb942d1f88.tar.bz2 icestorm-3ba1acf31bc0ee83d8b545af03e144cb942d1f88.zip |
Replaced some more magic numbers with FLASH command IDs.
I missed those the first time around.
-rw-r--r-- | iceprog/iceprog.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/iceprog/iceprog.c b/iceprog/iceprog.c index c0a1406..ca3ce48 100644 --- a/iceprog/iceprog.c +++ b/iceprog/iceprog.c @@ -450,16 +450,16 @@ static void flash_disable_protection() { fprintf(stderr, "disable flash protection...\n"); - //WRSR 0x00 - uint8_t data[2] = { 0x01, 0x00 }; + // Write Status Register 1 <- 0x00 + uint8_t data[2] = { FC_WSR1, 0x00 }; flash_chip_select(true); xfer_spi(data, 2); flash_chip_select(false); flash_wait(); - //RDSR - data[0] = 0x5; + // Read Status Register 1 + data[0] = FC_RSR1; flash_chip_select(true); xfer_spi(data, 2); |