aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2021-10-11 01:00:22 +0200
committerGitHub <[email protected]>2021-10-11 01:00:22 +0200
commit34637bf2d0e7d01003607521cf91c26317f7094c (patch)
treebdcebd75e79c17186b771ab37cead085a6899d3c
parent902f566b9a338f80520b4f1110f09f9401109b81 (diff)
parent668364da9ce97e924be9aceca4cc8a6bfb286eb4 (diff)
Merge pull request #418 from embassy-rs/fix-saadc
nrf: saadc fixes
-rw-r--r--embassy-nrf/src/chips/nrf52820.rs3
-rw-r--r--embassy-nrf/src/saadc.rs9
2 files changed, 7 insertions, 5 deletions
diff --git a/embassy-nrf/src/chips/nrf52820.rs b/embassy-nrf/src/chips/nrf52820.rs
index 4c0d3b0b8..e434c0096 100644
--- a/embassy-nrf/src/chips/nrf52820.rs
+++ b/embassy-nrf/src/chips/nrf52820.rs
@@ -22,9 +22,6 @@ embassy_hal_common::peripherals! {
22 TWISPI0, 22 TWISPI0,
23 TWISPI1, 23 TWISPI1,
24 24
25 // SAADC
26 SAADC,
27
28 // TIMER 25 // TIMER
29 TIMER0, 26 TIMER0,
30 TIMER1, 27 TIMER1,
diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs
index 96116b36a..2f2baefae 100644
--- a/embassy-nrf/src/saadc.rs
+++ b/embassy-nrf/src/saadc.rs
@@ -245,7 +245,7 @@ macro_rules! input_mappings {
245 245
246// TODO the variant names are unchecked 246// TODO the variant names are unchecked
247// the inputs are copied from nrf hal 247// the inputs are copied from nrf hal
248#[cfg(feature = "9160")] 248#[cfg(feature = "nrf9160")]
249input_mappings! { 249input_mappings! {
250 ANALOGINPUT0 => P0_13, 250 ANALOGINPUT0 => P0_13,
251 ANALOGINPUT1 => P0_14, 251 ANALOGINPUT1 => P0_14,
@@ -256,8 +256,13 @@ input_mappings! {
256 ANALOGINPUT6 => P0_19, 256 ANALOGINPUT6 => P0_19,
257 ANALOGINPUT7 => P0_20, 257 ANALOGINPUT7 => P0_20,
258} 258}
259#[cfg(feature = "nrf52805")]
260input_mappings! {
261 ANALOGINPUT2 => P0_04,
262 ANALOGINPUT3 => P0_05,
263}
259 264
260#[cfg(not(feature = "9160"))] 265#[cfg(not(any(feature = "nrf52805", feature = "nrf9160")))]
261input_mappings! { 266input_mappings! {
262 ANALOGINPUT0 => P0_02, 267 ANALOGINPUT0 => P0_02,
263 ANALOGINPUT1 => P0_03, 268 ANALOGINPUT1 => P0_03,