Skip to content

Commit c00efd4

Browse files
committed
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.
1 parent de33d11 commit c00efd4

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

embassy-usb-dfu/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
<!-- next-header -->
99
## Unreleased - ReleaseDate
1010

11+
- Allow enabling the `application` and `dfu` feature at the same time
12+
1113
## 0.2.0 - 2025-08-27
1214

1315
- First release with changelog.

embassy-usb-dfu/src/application.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Application part of DFU logic
12
use embassy_boot::BlockingFirmwareState;
23
use embassy_time::{Duration, Instant};
34
use embassy_usb::control::{InResponse, OutResponse, Recipient, RequestType};

embassy-usb-dfu/src/dfu.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! DFU bootloader part of DFU logic
12
use embassy_boot::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterError};
23
use embassy_usb::control::{InResponse, OutResponse, Recipient, RequestType};
34
use embassy_usb::driver::Driver;

embassy-usb-dfu/src/lib.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,15 @@ mod fmt;
66
pub mod consts;
77

88
#[cfg(feature = "dfu")]
9-
mod dfu;
10-
#[cfg(feature = "dfu")]
9+
pub mod dfu;
10+
#[cfg(all(feature = "dfu", not(feature = "application")))]
1111
pub use self::dfu::*;
1212

1313
#[cfg(feature = "application")]
14-
mod application;
15-
#[cfg(feature = "application")]
14+
pub mod application;
15+
#[cfg(all(feature = "application", not(feature = "dfu")))]
1616
pub use self::application::*;
1717

18-
#[cfg(any(
19-
all(feature = "dfu", feature = "application"),
20-
not(any(feature = "dfu", feature = "application"))
21-
))]
22-
compile_error!("usb-dfu must be compiled with exactly one of `dfu`, or `application` features");
23-
2418
/// Provides a platform-agnostic interface for initiating a system reset.
2519
///
2620
/// This crate exposes `ResetImmediate` when compiled with cortex-m or esp32c3 support, which immediately issues a

0 commit comments

Comments
 (0)