diff --git a/esp-hal-common/src/twai/mod.rs b/esp-hal-common/src/twai/mod.rs index c38c826216..e9a5a7d20f 100644 --- a/esp-hal-common/src/twai/mod.rs +++ b/esp-hal-common/src/twai/mod.rs @@ -1024,7 +1024,7 @@ mod asynch { let _ = rx_queue.try_send(Err(EspTwaiError::EmbeddedHAL(ErrorKind::Overrun))); } - let frame = unsafe { read_frame(register_block) }; + let frame = TWAI0::read_frame(); let _ = rx_queue.try_send(Ok(frame)); @@ -1069,7 +1069,7 @@ mod asynch { let _ = rx_queue.try_send(Err(EspTwaiError::EmbeddedHAL(ErrorKind::Overrun))); } - let frame = unsafe { read_frame(register_block) }; + let frame = TWAI1::read_frame(); let _ = rx_queue.try_send(Ok(frame));