summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2022-08-17 18:49:55 +0200
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2022-08-17 22:16:46 +0200
commitfc6e1e06b305d302d1b7ad17e8ef3a9be986c358 (patch)
tree545ad829660f6053d29a01da286d03ec3d49f5ca /tests
parentd881f3ad9186cf3279aa1ba27093bad94035c186 (diff)
downloadembassy-fc6e1e06b305d302d1b7ad17e8ef3a9be986c358.zip
Remove HAL initialization from #[embassy::main] macro.
Diffstat (limited to 'tests')
-rw-r--r--tests/rp/src/bin/gpio.rs4
-rw-r--r--tests/rp/src/bin/gpio_async.rs4
-rw-r--r--tests/stm32/src/bin/gpio.rs6
-rw-r--r--tests/stm32/src/bin/spi.rs6
-rw-r--r--tests/stm32/src/bin/spi_dma.rs6
-rw-r--r--tests/stm32/src/bin/timer.rs6
-rw-r--r--tests/stm32/src/bin/usart.rs6
-rw-r--r--tests/stm32/src/bin/usart_dma.rs6
8 files changed, 22 insertions, 22 deletions
diff --git a/tests/rp/src/bin/gpio.rs b/tests/rp/src/bin/gpio.rs
index 6f6baf77..2d1a2ee5 100644
--- a/tests/rp/src/bin/gpio.rs
+++ b/tests/rp/src/bin/gpio.rs
@@ -5,11 +5,11 @@
use defmt::{assert, *};
use embassy_executor::executor::Spawner;
use embassy_rp::gpio::{Flex, Input, Level, Output, OutputOpenDrain, Pull};
-use embassy_rp::Peripherals;
use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::main]
-async fn main(_spawner: Spawner, p: Peripherals) {
+async fn main(_spawner: Spawner) {
+ let p = embassy_rp::init(Default::default());
info!("Hello World!");
let (mut a, mut b) = (p.PIN_0, p.PIN_1);
diff --git a/tests/rp/src/bin/gpio_async.rs b/tests/rp/src/bin/gpio_async.rs
index 1098682a..d8878687 100644
--- a/tests/rp/src/bin/gpio_async.rs
+++ b/tests/rp/src/bin/gpio_async.rs
@@ -6,12 +6,12 @@ use defmt::{assert, *};
use embassy_executor::executor::Spawner;
use embassy_executor::time::{Duration, Instant, Timer};
use embassy_rp::gpio::{Input, Level, Output, Pull};
-use embassy_rp::Peripherals;
use futures::future::join;
use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::main]
-async fn main(_spawner: Spawner, p: Peripherals) {
+async fn main(_spawner: Spawner) {
+ let p = embassy_rp::init(Default::default());
info!("embassy-rp gpio_async test");
// On the CI device the following pins are connected with each other.
diff --git a/tests/stm32/src/bin/gpio.rs b/tests/stm32/src/bin/gpio.rs
index 8eab731b..dc7223c6 100644
--- a/tests/stm32/src/bin/gpio.rs
+++ b/tests/stm32/src/bin/gpio.rs
@@ -7,11 +7,11 @@ mod example_common;
use defmt::assert;
use embassy_executor::executor::Spawner;
use embassy_stm32::gpio::{Flex, Input, Level, Output, OutputOpenDrain, Pull, Speed};
-use embassy_stm32::Peripherals;
use example_common::*;
-#[embassy_executor::main(config = "config()")]
-async fn main(_spawner: Spawner, p: Peripherals) {
+#[embassy_executor::main]
+async fn main(_spawner: Spawner) {
+ let p = embassy_stm32::init(config());
info!("Hello World!");
// Arduino pins D0 and D1
diff --git a/tests/stm32/src/bin/spi.rs b/tests/stm32/src/bin/spi.rs
index 6d38b0bb..2c0b7fc4 100644
--- a/tests/stm32/src/bin/spi.rs
+++ b/tests/stm32/src/bin/spi.rs
@@ -9,11 +9,11 @@ use embassy_executor::executor::Spawner;
use embassy_stm32::dma::NoDma;
use embassy_stm32::spi::{self, Spi};
use embassy_stm32::time::Hertz;
-use embassy_stm32::Peripherals;
use example_common::*;
-#[embassy_executor::main(config = "config()")]
-async fn main(_spawner: Spawner, p: Peripherals) {
+#[embassy_executor::main]
+async fn main(_spawner: Spawner) {
+ let p = embassy_stm32::init(config());
info!("Hello World!");
#[cfg(feature = "stm32f103c8")]
diff --git a/tests/stm32/src/bin/spi_dma.rs b/tests/stm32/src/bin/spi_dma.rs
index 8147c5f0..af1118b5 100644
--- a/tests/stm32/src/bin/spi_dma.rs
+++ b/tests/stm32/src/bin/spi_dma.rs
@@ -8,11 +8,11 @@ use defmt::assert_eq;
use embassy_executor::executor::Spawner;
use embassy_stm32::spi::{self, Spi};
use embassy_stm32::time::Hertz;
-use embassy_stm32::Peripherals;
use example_common::*;
-#[embassy_executor::main(config = "config()")]
-async fn main(_spawner: Spawner, p: Peripherals) {
+#[embassy_executor::main]
+async fn main(_spawner: Spawner) {
+ let p = embassy_stm32::init(config());
info!("Hello World!");
#[cfg(feature = "stm32f103c8")]
diff --git a/tests/stm32/src/bin/timer.rs b/tests/stm32/src/bin/timer.rs
index 76b07ca1..34903084 100644
--- a/tests/stm32/src/bin/timer.rs
+++ b/tests/stm32/src/bin/timer.rs
@@ -7,11 +7,11 @@ mod example_common;
use defmt::assert;
use embassy_executor::executor::Spawner;
use embassy_executor::time::{Duration, Instant, Timer};
-use embassy_stm32::Peripherals;
use example_common::*;
-#[embassy_executor::main(config = "config()")]
-async fn main(_spawner: Spawner, _p: Peripherals) {
+#[embassy_executor::main]
+async fn main(_spawner: Spawner) {
+ let _p = embassy_stm32::init(config());
info!("Hello World!");
let start = Instant::now();
diff --git a/tests/stm32/src/bin/usart.rs b/tests/stm32/src/bin/usart.rs
index 7b60e4b2..f454c1f7 100644
--- a/tests/stm32/src/bin/usart.rs
+++ b/tests/stm32/src/bin/usart.rs
@@ -8,11 +8,11 @@ use defmt::assert_eq;
use embassy_executor::executor::Spawner;
use embassy_stm32::dma::NoDma;
use embassy_stm32::usart::{Config, Uart};
-use embassy_stm32::Peripherals;
use example_common::*;
-#[embassy_executor::main(config = "config()")]
-async fn main(_spawner: Spawner, p: Peripherals) {
+#[embassy_executor::main]
+async fn main(_spawner: Spawner) {
+ let p = embassy_stm32::init(config());
info!("Hello World!");
#[cfg(feature = "stm32wb55rg")]
diff --git a/tests/stm32/src/bin/usart_dma.rs b/tests/stm32/src/bin/usart_dma.rs
index 323c41ca..fbaccd17 100644
--- a/tests/stm32/src/bin/usart_dma.rs
+++ b/tests/stm32/src/bin/usart_dma.rs
@@ -7,11 +7,11 @@ mod example_common;
use defmt::assert_eq;
use embassy_executor::executor::Spawner;
use embassy_stm32::usart::{Config, Uart};
-use embassy_stm32::Peripherals;
use example_common::*;
-#[embassy_executor::main(config = "config()")]
-async fn main(_spawner: Spawner, p: Peripherals) {
+#[embassy_executor::main]
+async fn main(_spawner: Spawner) {
+ let p = embassy_stm32::init(config());
info!("Hello World!");
#[cfg(feature = "stm32wb55rg")]