aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-05-19 18:25:34 +0200
committerDario Nieuwenhuis <[email protected]>2023-05-19 18:25:34 +0200
commita1cbdd8d295f9fd816a65fa7ca6df67ac5a25ddf (patch)
tree8af24ae1262c5f60e2388e3deab9894cbea23707 /embassy-nrf/src
parent8b9306ed5ccc932fa91931b0c6bec6fc59694bd8 (diff)
nrf/uarte: fix deref warning, fix errata not being applied on nrf53.
Diffstat (limited to 'embassy-nrf/src')
-rw-r--r--embassy-nrf/src/uarte.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs
index 586c88b2d..032089635 100644
--- a/embassy-nrf/src/uarte.rs
+++ b/embassy-nrf/src/uarte.rs
@@ -791,20 +791,18 @@ impl<'d, T: Instance, U: TimerInstance> UarteRxWithIdle<'d, T, U> {
791 } 791 }
792} 792}
793 793
794#[cfg(not(any(feature = "_nrf9160", feature = "nrf5340")))] 794#[cfg(not(any(feature = "_nrf9160", feature = "_nrf5340")))]
795pub(crate) fn apply_workaround_for_enable_anomaly(_r: &crate::pac::uarte0::RegisterBlock) { 795pub(crate) fn apply_workaround_for_enable_anomaly(_r: &crate::pac::uarte0::RegisterBlock) {
796 // Do nothing 796 // Do nothing
797} 797}
798 798
799#[cfg(any(feature = "_nrf9160", feature = "nrf5340"))] 799#[cfg(any(feature = "_nrf9160", feature = "_nrf5340"))]
800pub(crate) fn apply_workaround_for_enable_anomaly(r: &crate::pac::uarte0::RegisterBlock) { 800pub(crate) fn apply_workaround_for_enable_anomaly(r: &crate::pac::uarte0::RegisterBlock) {
801 use core::ops::Deref;
802
803 // Apply workaround for anomalies: 801 // Apply workaround for anomalies:
804 // - nRF9160 - anomaly 23 802 // - nRF9160 - anomaly 23
805 // - nRF5340 - anomaly 44 803 // - nRF5340 - anomaly 44
806 let rxenable_reg: *const u32 = ((r.deref() as *const _ as usize) + 0x564) as *const u32; 804 let rxenable_reg: *const u32 = ((r as *const _ as usize) + 0x564) as *const u32;
807 let txenable_reg: *const u32 = ((r.deref() as *const _ as usize) + 0x568) as *const u32; 805 let txenable_reg: *const u32 = ((r as *const _ as usize) + 0x568) as *const u32;
808 806
809 // NB Safety: This is taken from Nordic's driver - 807 // NB Safety: This is taken from Nordic's driver -
810 // https://github.com/NordicSemiconductor/nrfx/blob/master/drivers/src/nrfx_uarte.c#L197 808 // https://github.com/NordicSemiconductor/nrfx/blob/master/drivers/src/nrfx_uarte.c#L197