Skip to content

Commit 5488faf

Browse files
committed
Add the empty value of a byte to the algorithm! macro
1 parent 3338159 commit 5488faf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "flash-algorithm"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
edition = "2021"
55
readme = "README.md"
66
keywords = ["no-std", "embedded", "flashing"]

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ macro_rules! algorithm {
6868
flash_address: $flash_address:expr,
6969
flash_size: $flash_size:expr,
7070
page_size: $page_size:expr,
71+
empty_value: $empty_value:expr,
7172
sectors: [$({
7273
size: $size:expr,
7374
address: $address:expr,
@@ -164,7 +165,7 @@ macro_rules! algorithm {
164165
page_size: $page_size,
165166
_reserved: 0,
166167
// The empty state of a byte in flash.
167-
empty: 0xff,
168+
empty: $empty_value,
168169
// This value can be used to estimate the amount of time the flashing procedure takes worst case.
169170
program_time_out: 1000,
170171
// This value can be used to estimate the amount of time the erasing procedure takes worst case.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy