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

+1-1
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

+2-1
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)