diff options
| -rwxr-xr-x | ci.sh | 4 | ||||
| -rwxr-xr-x | ci_stable.sh | 3 | ||||
| -rw-r--r-- | embassy-rp/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-rp/src/gpio.rs | 120 | ||||
| -rw-r--r-- | embassy-rp/src/lib.rs | 3 |
5 files changed, 71 insertions, 61 deletions
| @@ -50,6 +50,10 @@ cargo batch \ | |||
| 50 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52840,gpiote,time-driver-rtc1 \ | 50 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52840,gpiote,time-driver-rtc1 \ |
| 51 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52840,log,gpiote,time-driver-rtc1 \ | 51 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52840,log,gpiote,time-driver-rtc1 \ |
| 52 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52840,defmt,gpiote,time-driver-rtc1,unstable-traits \ | 52 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52840,defmt,gpiote,time-driver-rtc1,unstable-traits \ |
| 53 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits,defmt \ | ||
| 54 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits,log \ | ||
| 55 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits \ | ||
| 56 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly \ | ||
| 53 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f410tb,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ | 57 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f410tb,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ |
| 54 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f411ce,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ | 58 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f411ce,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ |
| 55 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f429zi,log,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ | 59 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f429zi,log,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ |
diff --git a/ci_stable.sh b/ci_stable.sh index 082d0f45e..2723936e7 100755 --- a/ci_stable.sh +++ b/ci_stable.sh | |||
| @@ -27,6 +27,9 @@ cargo batch \ | |||
| 27 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,time-driver-rtc1 \ | 27 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,time-driver-rtc1 \ |
| 28 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,log,gpiote,time-driver-rtc1 \ | 28 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,log,gpiote,time-driver-rtc1 \ |
| 29 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,defmt,gpiote,time-driver-rtc1,unstable-traits \ | 29 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,defmt,gpiote,time-driver-rtc1,unstable-traits \ |
| 30 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features unstable-traits,defmt \ | ||
| 31 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features unstable-traits,log \ | ||
| 32 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi \ | ||
| 30 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g473cc,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ | 33 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g473cc,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ |
| 31 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ | 34 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ |
| 32 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585zi,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ | 35 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585zi,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ |
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml index ffb4c9148..6529e1a37 100644 --- a/embassy-rp/Cargo.toml +++ b/embassy-rp/Cargo.toml | |||
| @@ -27,7 +27,7 @@ nightly = ["embassy/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-e | |||
| 27 | unstable-traits = ["embedded-hal-1"] | 27 | unstable-traits = ["embedded-hal-1"] |
| 28 | 28 | ||
| 29 | [dependencies] | 29 | [dependencies] |
| 30 | embassy = { version = "0.1.0", path = "../embassy", features = [ "time-tick-1mhz", "nightly"] } | 30 | embassy = { version = "0.1.0", path = "../embassy", features = [ "time-tick-1mhz" ] } |
| 31 | embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-3"]} | 31 | embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-3"]} |
| 32 | embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" } | 32 | embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" } |
| 33 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } | 33 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } |
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs index ef15a5eff..f205063c6 100644 --- a/embassy-rp/src/gpio.rs +++ b/embassy-rp/src/gpio.rs | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | use core::convert::Infallible; | ||
| 2 | use core::future::Future; | 1 | use core::future::Future; |
| 3 | use core::marker::PhantomData; | 2 | use core::marker::PhantomData; |
| 4 | use core::pin::Pin as FuturePin; | 3 | use core::pin::Pin as FuturePin; |
| @@ -720,7 +719,7 @@ impl_pin!(PIN_QSPI_SD3, Bank::Qspi, 5); | |||
| 720 | // ==================== | 719 | // ==================== |
| 721 | 720 | ||
| 722 | mod eh02 { | 721 | mod eh02 { |
| 723 | use futures::FutureExt; | 722 | use core::convert::Infallible; |
| 724 | 723 | ||
| 725 | use super::*; | 724 | use super::*; |
| 726 | 725 | ||
| @@ -839,66 +838,15 @@ mod eh02 { | |||
| 839 | Ok(self.toggle()) | 838 | Ok(self.toggle()) |
| 840 | } | 839 | } |
| 841 | } | 840 | } |
| 842 | |||
| 843 | use core::convert::Infallible; | ||
| 844 | |||
| 845 | impl<'d, T: Pin> embedded_hal_async::digital::Wait for Flex<'d, T> { | ||
| 846 | type WaitForHighFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 847 | fn wait_for_high<'a>(&'a mut self) -> Self::WaitForHighFuture<'a> { | ||
| 848 | self.wait_for_high().map(Ok) | ||
| 849 | } | ||
| 850 | |||
| 851 | type WaitForLowFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 852 | fn wait_for_low<'a>(&'a mut self) -> Self::WaitForLowFuture<'a> { | ||
| 853 | self.wait_for_low().map(Ok) | ||
| 854 | } | ||
| 855 | |||
| 856 | type WaitForRisingEdgeFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 857 | fn wait_for_rising_edge<'a>(&'a mut self) -> Self::WaitForRisingEdgeFuture<'a> { | ||
| 858 | self.wait_for_rising_edge().map(Ok) | ||
| 859 | } | ||
| 860 | |||
| 861 | type WaitForFallingEdgeFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 862 | fn wait_for_falling_edge<'a>(&'a mut self) -> Self::WaitForFallingEdgeFuture<'a> { | ||
| 863 | self.wait_for_falling_edge().map(Ok) | ||
| 864 | } | ||
| 865 | |||
| 866 | type WaitForAnyEdgeFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 867 | fn wait_for_any_edge<'a>(&'a mut self) -> Self::WaitForAnyEdgeFuture<'a> { | ||
| 868 | self.wait_for_any_edge().map(Ok) | ||
| 869 | } | ||
| 870 | } | ||
| 871 | |||
| 872 | impl<'d, T: Pin> embedded_hal_async::digital::Wait for Input<'d, T> { | ||
| 873 | type WaitForHighFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 874 | fn wait_for_high<'a>(&'a mut self) -> Self::WaitForHighFuture<'a> { | ||
| 875 | self.wait_for_high().map(Ok) | ||
| 876 | } | ||
| 877 | |||
| 878 | type WaitForLowFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 879 | fn wait_for_low<'a>(&'a mut self) -> Self::WaitForLowFuture<'a> { | ||
| 880 | self.wait_for_low().map(Ok) | ||
| 881 | } | ||
| 882 | |||
| 883 | type WaitForRisingEdgeFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 884 | fn wait_for_rising_edge<'a>(&'a mut self) -> Self::WaitForRisingEdgeFuture<'a> { | ||
| 885 | self.wait_for_rising_edge().map(Ok) | ||
| 886 | } | ||
| 887 | |||
| 888 | type WaitForFallingEdgeFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 889 | fn wait_for_falling_edge<'a>(&'a mut self) -> Self::WaitForFallingEdgeFuture<'a> { | ||
| 890 | self.wait_for_falling_edge().map(Ok) | ||
| 891 | } | ||
| 892 | |||
| 893 | type WaitForAnyEdgeFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 894 | fn wait_for_any_edge<'a>(&'a mut self) -> Self::WaitForAnyEdgeFuture<'a> { | ||
| 895 | self.wait_for_any_edge().map(Ok) | ||
| 896 | } | ||
| 897 | } | ||
| 898 | } | 841 | } |
| 899 | 842 | ||
| 900 | #[cfg(feature = "unstable-traits")] | 843 | #[cfg(feature = "unstable-traits")] |
| 901 | mod eh1 { | 844 | mod eh1 { |
| 845 | use core::convert::Infallible; | ||
| 846 | |||
| 847 | #[cfg(feature = "nightly")] | ||
| 848 | use futures::FutureExt; | ||
| 849 | |||
| 902 | use super::*; | 850 | use super::*; |
| 903 | 851 | ||
| 904 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Input<'d, T> { | 852 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Input<'d, T> { |
| @@ -1014,4 +962,60 @@ mod eh1 { | |||
| 1014 | Ok(self.toggle()) | 962 | Ok(self.toggle()) |
| 1015 | } | 963 | } |
| 1016 | } | 964 | } |
| 965 | |||
| 966 | #[cfg(feature = "nightly")] | ||
| 967 | impl<'d, T: Pin> embedded_hal_async::digital::Wait for Flex<'d, T> { | ||
| 968 | type WaitForHighFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 969 | fn wait_for_high<'a>(&'a mut self) -> Self::WaitForHighFuture<'a> { | ||
| 970 | self.wait_for_high().map(Ok) | ||
| 971 | } | ||
| 972 | |||
| 973 | type WaitForLowFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 974 | fn wait_for_low<'a>(&'a mut self) -> Self::WaitForLowFuture<'a> { | ||
| 975 | self.wait_for_low().map(Ok) | ||
| 976 | } | ||
| 977 | |||
| 978 | type WaitForRisingEdgeFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 979 | fn wait_for_rising_edge<'a>(&'a mut self) -> Self::WaitForRisingEdgeFuture<'a> { | ||
| 980 | self.wait_for_rising_edge().map(Ok) | ||
| 981 | } | ||
| 982 | |||
| 983 | type WaitForFallingEdgeFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 984 | fn wait_for_falling_edge<'a>(&'a mut self) -> Self::WaitForFallingEdgeFuture<'a> { | ||
| 985 | self.wait_for_falling_edge().map(Ok) | ||
| 986 | } | ||
| 987 | |||
| 988 | type WaitForAnyEdgeFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 989 | fn wait_for_any_edge<'a>(&'a mut self) -> Self::WaitForAnyEdgeFuture<'a> { | ||
| 990 | self.wait_for_any_edge().map(Ok) | ||
| 991 | } | ||
| 992 | } | ||
| 993 | |||
| 994 | #[cfg(feature = "nightly")] | ||
| 995 | impl<'d, T: Pin> embedded_hal_async::digital::Wait for Input<'d, T> { | ||
| 996 | type WaitForHighFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 997 | fn wait_for_high<'a>(&'a mut self) -> Self::WaitForHighFuture<'a> { | ||
| 998 | self.wait_for_high().map(Ok) | ||
| 999 | } | ||
| 1000 | |||
| 1001 | type WaitForLowFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 1002 | fn wait_for_low<'a>(&'a mut self) -> Self::WaitForLowFuture<'a> { | ||
| 1003 | self.wait_for_low().map(Ok) | ||
| 1004 | } | ||
| 1005 | |||
| 1006 | type WaitForRisingEdgeFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 1007 | fn wait_for_rising_edge<'a>(&'a mut self) -> Self::WaitForRisingEdgeFuture<'a> { | ||
| 1008 | self.wait_for_rising_edge().map(Ok) | ||
| 1009 | } | ||
| 1010 | |||
| 1011 | type WaitForFallingEdgeFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 1012 | fn wait_for_falling_edge<'a>(&'a mut self) -> Self::WaitForFallingEdgeFuture<'a> { | ||
| 1013 | self.wait_for_falling_edge().map(Ok) | ||
| 1014 | } | ||
| 1015 | |||
| 1016 | type WaitForAnyEdgeFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a; | ||
| 1017 | fn wait_for_any_edge<'a>(&'a mut self) -> Self::WaitForAnyEdgeFuture<'a> { | ||
| 1018 | self.wait_for_any_edge().map(Ok) | ||
| 1019 | } | ||
| 1020 | } | ||
| 1017 | } | 1021 | } |
diff --git a/embassy-rp/src/lib.rs b/embassy-rp/src/lib.rs index 90ef1b170..7da0d30c1 100644 --- a/embassy-rp/src/lib.rs +++ b/embassy-rp/src/lib.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![feature(generic_associated_types)] | 2 | #![cfg_attr(feature = "nightly", feature(generic_associated_types, type_alias_impl_trait))] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | // This mod MUST go first, so that the others see its macros. | 4 | // This mod MUST go first, so that the others see its macros. |
| 6 | pub(crate) mod fmt; | 5 | pub(crate) mod fmt; |
