From d2687ce3c467457f24a7a971392ee9b70ef063ed Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 28 Dec 2017 15:25:40 +0000 Subject: [PATCH] firmware: fix a typo replacing spiflash::SECTOR_SIZE with PAGE_SIZE. --- artiq/firmware/libboard/config.rs | 4 ++-- artiq/firmware/libboard/spiflash.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/artiq/firmware/libboard/config.rs b/artiq/firmware/libboard/config.rs index 665ccc462..443221d76 100644 --- a/artiq/firmware/libboard/config.rs +++ b/artiq/firmware/libboard/config.rs @@ -38,8 +38,8 @@ mod imp { use super::Error; // One flash sector immediately before the firmware. - const ADDR: usize = ::mem::FLASH_BOOT_ADDRESS - spiflash::PAGE_SIZE; - const SIZE: usize = spiflash::PAGE_SIZE; + const ADDR: usize = ::mem::FLASH_BOOT_ADDRESS - spiflash::SECTOR_SIZE; + const SIZE: usize = spiflash::SECTOR_SIZE; mod lock { use core::slice; diff --git a/artiq/firmware/libboard/spiflash.rs b/artiq/firmware/libboard/spiflash.rs index 2273185d5..3a4e7cb59 100644 --- a/artiq/firmware/libboard/spiflash.rs +++ b/artiq/firmware/libboard/spiflash.rs @@ -1,7 +1,8 @@ use core::cmp; use csr; -pub const PAGE_SIZE: usize = csr::CONFIG_SPIFLASH_PAGE_SIZE as usize; +pub const SECTOR_SIZE: usize = csr::CONFIG_SPIFLASH_SECTOR_SIZE as usize; +pub const PAGE_SIZE: usize = csr::CONFIG_SPIFLASH_PAGE_SIZE as usize; const PAGE_MASK: usize = PAGE_SIZE - 1;