Skip to content

Commit

Permalink
Fix busy check for ESP32
Browse files Browse the repository at this point in the history
  • Loading branch information
i404788 committed Nov 23, 2022
1 parent bafb7f4 commit f4fb712
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions esp-hal-common/src/sha.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ impl Sha {
fn is_busy(&mut self) -> bool {
match self.mode {
// FIXME: These are marked WO, while being RO
ShaMode::SHA1 => unsafe { self.sha.sha1_busy.as_ptr().read() == 0 },
ShaMode::SHA256 => unsafe { self.sha.sha256_busy.as_ptr().read() == 0 },
ShaMode::SHA384 => unsafe { self.sha.sha384_busy.as_ptr().read() == 0 },
ShaMode::SHA512 => unsafe { self.sha.sha512_busy.as_ptr().read() == 0 },
ShaMode::SHA1 => unsafe { self.sha.sha1_busy.as_ptr().read() != 0 },
ShaMode::SHA256 => unsafe { self.sha.sha256_busy.as_ptr().read() != 0 },
ShaMode::SHA384 => unsafe { self.sha.sha384_busy.as_ptr().read() != 0 },
ShaMode::SHA512 => unsafe { self.sha.sha512_busy.as_ptr().read() != 0 },
}
}

Expand Down

0 comments on commit f4fb712

Please sign in to comment.