Skip to content

Commit a43f6b2

Browse files
committed
Add proper flash sector size support
1 parent 91023ff commit a43f6b2

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ jobs:
4242
-d flash-start-address=0x0 \
4343
-d flash-page-size=0x400 \
4444
-d flash-size=0x40000 \
45-
-d empty-byte-value=0xFF
45+
-d empty-byte-value=0xFF \
46+
-d flash-sector-size=0x400
4647
- name: Check
4748
run: cd test && cargo check --target thumbv7em-none-eabi
4849
- name: Clippy

cargo-generate.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ type = "string"
3737
prompt = "What is the target Flash page size in bytes?"
3838
default = "0x400"
3939

40+
[placeholders.flash-sector-size]
41+
type = "string"
42+
prompt = "What is the target Flash sector size in bytes?"
43+
default = "0x400"
44+
4045
[placeholders.empty-byte-value]
4146
type = "string"
4247
prompt = "What is the erased state of a byte in Flash?"

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ algorithm!(Algorithm, {
1414
page_size: {{flash-page-size}},
1515
empty_value: 0xFF,
1616
sectors: [{
17-
size: {{flash-size}},
17+
size: {{flash-sector-size}},
1818
address: {{flash-start-address}},
1919
}]
2020
});

0 commit comments

Comments
 (0)