aboutsummaryrefslogtreecommitdiff
path: root/embassy-usb-dfu/src
diff options
context:
space:
mode:
authorPatrick Gansterer <[email protected]>2025-09-01 18:07:31 +0200
committerPatrick Gansterer <[email protected]>2025-09-01 18:07:31 +0200
commitc00efd485c0d422188badddde13613ea50668080 (patch)
tree120f2e9bfae688960294805a153f412b0dde0913 /embassy-usb-dfu/src
parentde33d113a5fb70ca5086058cc894a2ce192c27d6 (diff)
embassy-dfu-usb: Allow `application` and `dfu` feature at the same time
Since there is no technical reason to disallow the use of both features at the same time, remove the artifical contraint to give developers more freedom with their implementations.
Diffstat (limited to 'embassy-usb-dfu/src')
-rw-r--r--embassy-usb-dfu/src/application.rs1
-rw-r--r--embassy-usb-dfu/src/dfu.rs1
-rw-r--r--embassy-usb-dfu/src/lib.rs14
3 files changed, 6 insertions, 10 deletions
diff --git a/embassy-usb-dfu/src/application.rs b/embassy-usb-dfu/src/application.rs
index 4b7b72073..78eb2c083 100644
--- a/embassy-usb-dfu/src/application.rs
+++ b/embassy-usb-dfu/src/application.rs
@@ -1,3 +1,4 @@
1//! Application part of DFU logic
1use embassy_boot::BlockingFirmwareState; 2use embassy_boot::BlockingFirmwareState;
2use embassy_time::{Duration, Instant}; 3use embassy_time::{Duration, Instant};
3use embassy_usb::control::{InResponse, OutResponse, Recipient, RequestType}; 4use embassy_usb::control::{InResponse, OutResponse, Recipient, RequestType};
diff --git a/embassy-usb-dfu/src/dfu.rs b/embassy-usb-dfu/src/dfu.rs
index 9a2f125fb..be28890bb 100644
--- a/embassy-usb-dfu/src/dfu.rs
+++ b/embassy-usb-dfu/src/dfu.rs
@@ -1,3 +1,4 @@
1//! DFU bootloader part of DFU logic
1use embassy_boot::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterError}; 2use embassy_boot::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterError};
2use embassy_usb::control::{InResponse, OutResponse, Recipient, RequestType}; 3use embassy_usb::control::{InResponse, OutResponse, Recipient, RequestType};
3use embassy_usb::driver::Driver; 4use embassy_usb::driver::Driver;
diff --git a/embassy-usb-dfu/src/lib.rs b/embassy-usb-dfu/src/lib.rs
index 54ffa7276..e9f4278b6 100644
--- a/embassy-usb-dfu/src/lib.rs
+++ b/embassy-usb-dfu/src/lib.rs
@@ -6,21 +6,15 @@ mod fmt;
6pub mod consts; 6pub mod consts;
7 7
8#[cfg(feature = "dfu")] 8#[cfg(feature = "dfu")]
9mod dfu; 9pub mod dfu;
10#[cfg(feature = "dfu")] 10#[cfg(all(feature = "dfu", not(feature = "application")))]
11pub use self::dfu::*; 11pub use self::dfu::*;
12 12
13#[cfg(feature = "application")] 13#[cfg(feature = "application")]
14mod application; 14pub mod application;
15#[cfg(feature = "application")] 15#[cfg(all(feature = "application", not(feature = "dfu")))]
16pub use self::application::*; 16pub use self::application::*;
17 17
18#[cfg(any(
19 all(feature = "dfu", feature = "application"),
20 not(any(feature = "dfu", feature = "application"))
21))]
22compile_error!("usb-dfu must be compiled with exactly one of `dfu`, or `application` features");
23
24/// Provides a platform-agnostic interface for initiating a system reset. 18/// Provides a platform-agnostic interface for initiating a system reset.
25/// 19///
26/// This crate exposes `ResetImmediate` when compiled with cortex-m or esp32c3 support, which immediately issues a 20/// This crate exposes `ResetImmediate` when compiled with cortex-m or esp32c3 support, which immediately issues a