Skip to content

Commit

Permalink
Fix overlap algorithm in cortex-m mpu
Browse files Browse the repository at this point in the history
  • Loading branch information
cmcavity committed Sep 18, 2018
1 parent 084b4e5 commit 9f66bd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
14 changes: 4 additions & 10 deletions arch/cortex-m4/src/mpu.rs
Expand Up @@ -265,17 +265,11 @@ impl CortexMRegion {
None => return false,
};

// Start of region overlaps
if other_start <= region_start && region_start < other_end {
return true;
if region_start < other_end && other_start < region_end {
true
} else {
false
}

// End of region overlaps
if other_start < region_end && region_end <= other_end {
return true;
}

false
}
}

Expand Down
4 changes: 2 additions & 2 deletions boards/hail/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9f66bd2

Please sign in to comment.