aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-11-22 11:02:50 +0000
committerGitHub <[email protected]>2022-11-22 11:02:50 +0000
commit99c561a749fee5dbf946a8ffa12f01d031dbee49 (patch)
tree5d9fa1256035d283609c3ece9782aa6dad28b5b6
parentf13639e78c1815e612a868558154d32a1bd8dc4a (diff)
parentf09745dfe122d723beeba5cd58ae9d6abdf6dddd (diff)
Merge #1065
1065: embassy-nrf: Default disable UARTE (nrf9160) r=Dirbaio a=kalkyl Uarte is enabled by default on the nrf9160, which is both bad for power consumption and renders the other "shared" peripherals unusable. This might be an SPM bug, but had the same issue with all pre-compiled SPM:s available out there, so adding this fix until we figure out. Co-authored-by: Henrik Alsér <[email protected]>
-rw-r--r--embassy-nrf/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs
index bc70fc2f6..b6fe046cf 100644
--- a/embassy-nrf/src/lib.rs
+++ b/embassy-nrf/src/lib.rs
@@ -267,5 +267,12 @@ pub fn init(config: config::Config) -> Peripherals {
267 #[cfg(feature = "_time-driver")] 267 #[cfg(feature = "_time-driver")]
268 time_driver::init(config.time_interrupt_priority); 268 time_driver::init(config.time_interrupt_priority);
269 269
270 // Disable UARTE (enabled by default for some reason)
271 #[cfg(feature = "_nrf9160")]
272 unsafe {
273 (*pac::UARTE0::ptr()).enable.write(|w| w.enable().disabled());
274 (*pac::UARTE1::ptr()).enable.write(|w| w.enable().disabled());
275 }
276
270 peripherals 277 peripherals
271} 278}