Skip to content

Commit dd06ecf

Browse files
authored
flash: fix an off-by-one error in Page::addr_range
1 parent cd43b01 commit dd06ecf

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- `subghz::Stats`
1818
- `subghz::Status`
1919

20+
### Fixed
21+
- Fixed an off-by-one error in `flash::Page::addr_range`.
22+
2023
### Removed
2124
- Removed `util::reset_cycle_count`; this functionality is now in `cortex-m`.
2225

hal/src/flash.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,14 @@ impl Page {
189189
/// page0.addr_range(),
190190
/// Range {
191191
/// start: 0x0800_0000,
192-
/// end: 0x0800_07FF
192+
/// end: 0x0800_0800
193193
/// }
194194
/// );
195195
/// ```
196196
pub const fn addr_range(&self) -> Range<usize> {
197197
Range {
198198
start: self.addr(),
199-
end: self.addr() + (Page::SIZE - 1),
199+
end: self.addr() + Page::SIZE,
200200
}
201201
}
202202
}

0 commit comments

Comments
 (0)