firmware: fix a typo replacing spiflash::SECTOR_SIZE with PAGE_SIZE.

This commit is contained in:
whitequark 2017-12-28 15:25:40 +00:00
parent 6d0168edb7
commit d2687ce3c4
2 changed files with 4 additions and 3 deletions

View File

@ -38,8 +38,8 @@ mod imp {
use super::Error; use super::Error;
// One flash sector immediately before the firmware. // One flash sector immediately before the firmware.
const ADDR: usize = ::mem::FLASH_BOOT_ADDRESS - spiflash::PAGE_SIZE; const ADDR: usize = ::mem::FLASH_BOOT_ADDRESS - spiflash::SECTOR_SIZE;
const SIZE: usize = spiflash::PAGE_SIZE; const SIZE: usize = spiflash::SECTOR_SIZE;
mod lock { mod lock {
use core::slice; use core::slice;

View File

@ -1,6 +1,7 @@
use core::cmp; use core::cmp;
use csr; use csr;
pub const SECTOR_SIZE: usize = csr::CONFIG_SPIFLASH_SECTOR_SIZE as usize;
pub const PAGE_SIZE: usize = csr::CONFIG_SPIFLASH_PAGE_SIZE as usize; pub const PAGE_SIZE: usize = csr::CONFIG_SPIFLASH_PAGE_SIZE as usize;
const PAGE_MASK: usize = PAGE_SIZE - 1; const PAGE_MASK: usize = PAGE_SIZE - 1;