From 0b26ab7bbc0be784c011118574a84132d6747618 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 11 Oct 2021 00:55:17 +0200 Subject: [PATCH 1/2] nrf/saadc: nrf52820 doesn't have it. --- embassy-nrf/src/chips/nrf52820.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/embassy-nrf/src/chips/nrf52820.rs b/embassy-nrf/src/chips/nrf52820.rs index 4c0d3b0b..e434c009 100644 --- a/embassy-nrf/src/chips/nrf52820.rs +++ b/embassy-nrf/src/chips/nrf52820.rs @@ -22,9 +22,6 @@ embassy_hal_common::peripherals! { TWISPI0, TWISPI1, - // SAADC - SAADC, - // TIMER TIMER0, TIMER1, From 668364da9ce97e924be9aceca4cc8a6bfb286eb4 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 11 Oct 2021 00:55:31 +0200 Subject: [PATCH 2/2] nrf/saadc: nrf52805 only has 2 channels --- embassy-nrf/src/saadc.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs index 96116b36..2f2baefa 100644 --- a/embassy-nrf/src/saadc.rs +++ b/embassy-nrf/src/saadc.rs @@ -245,7 +245,7 @@ macro_rules! input_mappings { // TODO the variant names are unchecked // the inputs are copied from nrf hal -#[cfg(feature = "9160")] +#[cfg(feature = "nrf9160")] input_mappings! { ANALOGINPUT0 => P0_13, ANALOGINPUT1 => P0_14, @@ -256,8 +256,13 @@ input_mappings! { ANALOGINPUT6 => P0_19, ANALOGINPUT7 => P0_20, } +#[cfg(feature = "nrf52805")] +input_mappings! { + ANALOGINPUT2 => P0_04, + ANALOGINPUT3 => P0_05, +} -#[cfg(not(feature = "9160"))] +#[cfg(not(any(feature = "nrf52805", feature = "nrf9160")))] input_mappings! { ANALOGINPUT0 => P0_02, ANALOGINPUT1 => P0_03,