Skip to content

Commit

Permalink
fixup! feat(config): add a config attribute macro
Browse files Browse the repository at this point in the history
  • Loading branch information
ROMemories committed Mar 8, 2024
1 parent 626f7de commit 189b37e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/embassy-http-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mod routes;

use riot_rs as _;

use riot_rs::embassy::{embassy_net, embassy_usb, network};
use riot_rs::embassy::{embassy_net, network};
use riot_rs::rt::debug::println;

use embassy_net::tcp::TcpSocket;
Expand Down Expand Up @@ -139,9 +139,10 @@ fn network_config() -> embassy_net::Config {
})
}

#[cfg(hw_capability = "usb_device_port")]
#[riot_rs::config(usb)]
fn usb_config() -> embassy_usb::Config<'static> {
let mut config = embassy_usb::Config::new(0xc0de, 0xcafe);
fn usb_config() -> riot_rs::embassy::embassy_usb::Config<'static> {
let mut config = riot_rs::embassy::embassy_usb::Config::new(0xc0de, 0xcafe);
config.manufacturer = Some("Embassy");
config.product = Some("HTTP-over-USB-Ethernet example");
config.serial_number = Some("12345678");
Expand Down
4 changes: 4 additions & 0 deletions laze-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,10 @@ modules:
- nrf52840dk
- rpi-pico
- rpi-pico-w
env:
global:
RUSTFLAGS:
- --cfg hw_capability=\"usb_device_port\"

builders:
# host builder (for housekeeping tasks)
Expand Down

0 comments on commit 189b37e

Please sign in to comment.