feat: Block on rsa calls, remove Option<> results
This commit is contained in:
parent
8be4ff21a9
commit
8b0142d62e
@ -12,11 +12,8 @@ impl<Dm: crate::DriverMode> Rsa<'_, Dm> {
|
||||
/// After the RSA Accelerator is released from reset, the memory blocks
|
||||
/// needs to be initialized, only after that peripheral should be used.
|
||||
/// This function would return without an error if the memory is initialized
|
||||
pub fn ready(&mut self) -> Option<()> {
|
||||
if self.rsa.clean().read().clean().bit_is_clear() {
|
||||
return None;
|
||||
}
|
||||
Some(())
|
||||
pub fn ready(&mut self) {
|
||||
while !self.rsa.clean().read().clean().bit_is_clear() {}
|
||||
}
|
||||
|
||||
/// Writes the multi-mode configuration to the RSA hardware.
|
||||
|
||||
@ -12,11 +12,8 @@ impl<Dm: crate::DriverMode> Rsa<'_, Dm> {
|
||||
/// After the RSA Accelerator is released from reset, the memory blocks
|
||||
/// needs to be initialized, only after that peripheral should be used.
|
||||
/// This function would return without an error if the memory is initialized
|
||||
pub fn ready(&mut self) -> Option<()> {
|
||||
if self.rsa.query_clean().read().query_clean().bit_is_clear() {
|
||||
return None;
|
||||
}
|
||||
Some(())
|
||||
pub fn ready(&mut self) {
|
||||
while !self.rsa.query_clean().read().query_clean().bit_is_clear() {}
|
||||
}
|
||||
|
||||
/// Enables/disables rsa interrupt.
|
||||
|
||||
@ -13,11 +13,8 @@ impl<Dm: crate::DriverMode> Rsa<'_, Dm> {
|
||||
/// needs to be initialized, only after that peripheral should be used.
|
||||
/// This function would return without an error if the memory is
|
||||
/// initialized.
|
||||
pub fn ready(&mut self) -> Option<()> {
|
||||
if self.rsa.clean().read().clean().bit_is_clear() {
|
||||
return None;
|
||||
}
|
||||
Some(())
|
||||
pub fn ready(&mut self) {
|
||||
while !self.rsa.clean().read().clean().bit_is_clear() {}
|
||||
}
|
||||
|
||||
/// Enables/disables rsa interrupt.
|
||||
|
||||
@ -56,7 +56,7 @@ mod tests {
|
||||
fn init() -> Context<'static> {
|
||||
let peripherals = esp_hal::init(esp_hal::Config::default());
|
||||
let mut rsa = Rsa::new(peripherals.RSA);
|
||||
while rsa.ready().is_none() {}
|
||||
rsa.ready();
|
||||
|
||||
Context { rsa }
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ mod tests {
|
||||
fn init() -> Context<'static> {
|
||||
let peripherals = esp_hal::init(esp_hal::Config::default());
|
||||
let mut rsa = Rsa::new(peripherals.RSA).into_async();
|
||||
while rsa.ready().is_none() {}
|
||||
rsa.ready();
|
||||
|
||||
Context { rsa }
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user