aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKaitlyn Kenwell <[email protected]>2023-12-14 13:29:26 -0500
committerKaitlyn Kenwell <[email protected]>2023-12-14 13:29:26 -0500
commit9f9f6e75bb3ef6d285ebed88a20ab57fb55f3d07 (patch)
tree2a40c219cee9f20cd3b4e3d2b0067b0ba89c4a63 /examples
parentcbc8ccc51e8e747fab51ac377225495cd24eb447 (diff)
Abstract chip reset logic, add Reset impls for cortex-m and esp32c3
Diffstat (limited to 'examples')
-rw-r--r--examples/boot/application/stm32wb-dfu/Cargo.toml2
-rw-r--r--examples/boot/application/stm32wb-dfu/src/main.rs4
-rw-r--r--examples/boot/bootloader/stm32wb-dfu/Cargo.toml2
-rw-r--r--examples/boot/bootloader/stm32wb-dfu/src/main.rs4
4 files changed, 6 insertions, 6 deletions
diff --git a/examples/boot/application/stm32wb-dfu/Cargo.toml b/examples/boot/application/stm32wb-dfu/Cargo.toml
index 0ed0b75e0..f6beea498 100644
--- a/examples/boot/application/stm32wb-dfu/Cargo.toml
+++ b/examples/boot/application/stm32wb-dfu/Cargo.toml
@@ -12,7 +12,7 @@ embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", feature
12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } 12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] }
13embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } 13embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" }
14embassy-usb = { version = "0.1.0", path = "../../../../embassy-usb" } 14embassy-usb = { version = "0.1.0", path = "../../../../embassy-usb" }
15embassy-usb-dfu = { version = "0.1.0", path = "../../../../embassy-usb-dfu", features = ["application"] } 15embassy-usb-dfu = { version = "0.1.0", path = "../../../../embassy-usb-dfu", features = ["application", "cortex-m"] }
16 16
17defmt = { version = "0.3", optional = true } 17defmt = { version = "0.3", optional = true }
18defmt-rtt = { version = "0.4", optional = true } 18defmt-rtt = { version = "0.4", optional = true }
diff --git a/examples/boot/application/stm32wb-dfu/src/main.rs b/examples/boot/application/stm32wb-dfu/src/main.rs
index cdac903b5..fbecbf23b 100644
--- a/examples/boot/application/stm32wb-dfu/src/main.rs
+++ b/examples/boot/application/stm32wb-dfu/src/main.rs
@@ -16,7 +16,7 @@ use embassy_sync::blocking_mutex::Mutex;
16use embassy_time::Duration; 16use embassy_time::Duration;
17use embassy_usb::Builder; 17use embassy_usb::Builder;
18use embassy_usb_dfu::consts::DfuAttributes; 18use embassy_usb_dfu::consts::DfuAttributes;
19use embassy_usb_dfu::{usb_dfu, Control}; 19use embassy_usb_dfu::{usb_dfu, Control, ResetImmediate};
20use panic_reset as _; 20use panic_reset as _;
21 21
22bind_interrupts!(struct Irqs { 22bind_interrupts!(struct Irqs {
@@ -57,7 +57,7 @@ async fn main(_spawner: Spawner) {
57 &mut control_buf, 57 &mut control_buf,
58 ); 58 );
59 59
60 usb_dfu::<_, _>(&mut builder, &mut state, Duration::from_millis(2500)); 60 usb_dfu::<_, _, ResetImmediate>(&mut builder, &mut state, Duration::from_millis(2500));
61 61
62 let mut dev = builder.build(); 62 let mut dev = builder.build();
63 dev.run().await 63 dev.run().await
diff --git a/examples/boot/bootloader/stm32wb-dfu/Cargo.toml b/examples/boot/bootloader/stm32wb-dfu/Cargo.toml
index fde9eb57d..e849eb539 100644
--- a/examples/boot/bootloader/stm32wb-dfu/Cargo.toml
+++ b/examples/boot/bootloader/stm32wb-dfu/Cargo.toml
@@ -17,7 +17,7 @@ cortex-m-rt = { version = "0.7" }
17embedded-storage = "0.3.1" 17embedded-storage = "0.3.1"
18embedded-storage-async = "0.4.0" 18embedded-storage-async = "0.4.0"
19cfg-if = "1.0.0" 19cfg-if = "1.0.0"
20embassy-usb-dfu = { version = "0.1.0", path = "../../../../embassy-usb-dfu", features = ["bootloader"] } 20embassy-usb-dfu = { version = "0.1.0", path = "../../../../embassy-usb-dfu", features = ["bootloader", "cortex-m"] }
21embassy-usb = { version = "0.1.0", path = "../../../../embassy-usb", default-features = false } 21embassy-usb = { version = "0.1.0", path = "../../../../embassy-usb", default-features = false }
22embassy-futures = { version = "0.1.1", path = "../../../../embassy-futures" } 22embassy-futures = { version = "0.1.1", path = "../../../../embassy-futures" }
23 23
diff --git a/examples/boot/bootloader/stm32wb-dfu/src/main.rs b/examples/boot/bootloader/stm32wb-dfu/src/main.rs
index db7039e8c..a7ab813b6 100644
--- a/examples/boot/bootloader/stm32wb-dfu/src/main.rs
+++ b/examples/boot/bootloader/stm32wb-dfu/src/main.rs
@@ -14,7 +14,7 @@ use embassy_stm32::{bind_interrupts, peripherals, usb};
14use embassy_sync::blocking_mutex::Mutex; 14use embassy_sync::blocking_mutex::Mutex;
15use embassy_usb::Builder; 15use embassy_usb::Builder;
16use embassy_usb_dfu::consts::DfuAttributes; 16use embassy_usb_dfu::consts::DfuAttributes;
17use embassy_usb_dfu::{usb_dfu, Control}; 17use embassy_usb_dfu::{usb_dfu, Control, ResetImmediate};
18 18
19bind_interrupts!(struct Irqs { 19bind_interrupts!(struct Irqs {
20 USB_LP => usb::InterruptHandler<peripherals::USB>; 20 USB_LP => usb::InterruptHandler<peripherals::USB>;
@@ -64,7 +64,7 @@ fn main() -> ! {
64 &mut control_buf, 64 &mut control_buf,
65 ); 65 );
66 66
67 usb_dfu::<_, _, _, 4096>(&mut builder, &mut state); 67 usb_dfu::<_, _, _, ResetImmediate, 4096>(&mut builder, &mut state);
68 68
69 let mut dev = builder.build(); 69 let mut dev = builder.build();
70 embassy_futures::block_on(dev.run()); 70 embassy_futures::block_on(dev.run());