Skip to content

Commit

Permalink
cleanup warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bunnie committed Mar 11, 2024
1 parent 80fded7 commit 4fdd15c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions curve25519-dalek/src/backend/serial/u32e/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ pub(crate) const RF_U32_BASE: usize = 0x1_0000 / 4;
pub fn free_engine() {
log::debug!("free engine");
if let Some(base) = unsafe { ENGINE_BASE.take() } {
let mut engine = utralib::CSR::new(base.as_mut_ptr() as *mut u32);
engine.rmwf(utra::engine::POWER_ON, 1);
xous::unmap_memory(base).unwrap();
}
if let Some(mem) = unsafe { ENGINE_MEM.take() } {
Expand Down Expand Up @@ -70,6 +72,8 @@ pub fn ensure_engine() {
log::debug!("claiming engine mem {:x?}", mem.as_ptr());
unsafe { ENGINE_MEM = Some(mem) };
}
let mut engine = utralib::CSR::new(unsafe { ENGINE_BASE.unwrap() }.as_mut_ptr() as *mut u32);
engine.rmwf(utra::engine::POWER_ON, 1);
}

/// Safety: must be called after ensure_engine()
Expand Down

0 comments on commit 4fdd15c

Please sign in to comment.