Skip to content

Commit

Permalink
Merge pull request #12 from TheCacophonyProject/erase-block
Browse files Browse the repository at this point in the history
use correct range for erasing block
  • Loading branch information
gferraro authored Aug 5, 2024
2 parents 46ddee8 + f278f0d commit 0f3a7dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core1_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,9 @@ pub fn core_1_task(
// to give more breathing room.
if let Some(cptv_stream) = &mut cptv_stream {
error!("Ending current recording");
let cptv_end_block_index = flash_storage.last_used_block_index.unwrap();
let cptv_start_block_index = cptv_stream.starting_block_index as isize;
cptv_stream.finalise(&mut flash_storage);
let cptv_end_block_index = flash_storage.last_used_block_index.unwrap();

ended_recording = true;
let _ = shared_i2c
Expand Down
2 changes: 1 addition & 1 deletion src/onboard_flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ impl OnboardFlash {
start_block_index: isize,
end_block_index: isize,
) -> Result<(), &str> {
for block_index in start_block_index..end_block_index {
for block_index in start_block_index..=end_block_index {
if self.bad_blocks.contains(&(block_index as i16)) {
info!("Skipping erase of bad block {}", block_index);
} else if !self.erase_block(block_index).is_ok() {
Expand Down

0 comments on commit 0f3a7dc

Please sign in to comment.