Skip to content

Commit

Permalink
add comments and change wrong page number
Browse files Browse the repository at this point in the history
  • Loading branch information
krady21 committed Sep 11, 2020
1 parent 319d2f6 commit e131a13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions boards/stm32f3discovery/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,8 @@ pub unsafe fn reset_handler() {
let nonvolatile_storage = components::nonvolatile_storage::NonvolatileStorageComponent::new(
board_kernel,
&stm32f303xc::flash::FLASH,
0x08038000,
0x8000,
0x08038000, // Start address for userspace accesible region
0x8000, // Length of userspace accesible region (16 pages)
&_sstorage as *const u8 as usize,
&_estorage as *const u8 as usize - &_sstorage as *const u8 as usize,
)
Expand Down
6 changes: 3 additions & 3 deletions chips/stm32f303xc/src/flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ impl Flash {
}

pub fn erase_page(&self, page_number: usize) -> ReturnCode {
if page_number > 128 {
if page_number > 127 {
return ReturnCode::EINVAL;
}

Expand Down Expand Up @@ -517,7 +517,7 @@ impl Flash {
page_number: usize,
buffer: &'static mut StmF303Page,
) -> Result<(), (ReturnCode, &'static mut StmF303Page)> {
if page_number > 128 {
if page_number > 127 {
return Err((ReturnCode::EINVAL, buffer));
}

Expand All @@ -543,7 +543,7 @@ impl Flash {
page_number: usize,
buffer: &'static mut StmF303Page,
) -> Result<(), (ReturnCode, &'static mut StmF303Page)> {
if page_number > 128 {
if page_number > 127 {
return Err((ReturnCode::EINVAL, buffer));
}

Expand Down

0 comments on commit e131a13

Please sign in to comment.