Skip to content

Commit

Permalink
chore: make sure all feature names are kebab case
Browse files Browse the repository at this point in the history
Even though there is no official convention yet, we need consistent
casing and kebab case seems to be the consensus in the community.

See the following for official conventions regarding casing:
https://rust-lang.github.io/api-guidelines/naming.html#casing-conforms-to-rfc-430-c-case
  • Loading branch information
ROMemories authored and kaspar030 committed Mar 1, 2024
1 parent 93c1b66 commit bd55e31
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
8 changes: 4 additions & 4 deletions laze-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -383,25 +383,25 @@ modules:
selects:
- network_device

- name: wifi_cyw43
- name: wifi-cyw43
context:
- rpi-pico-w
provides_unique:
- network_device
env:
global:
FEATURES:
- riot-rs/wifi_cyw43
- riot-rs/wifi-cyw43

- name: usb_ethernet
- name: usb-ethernet
provides_unique:
- network_device
selects:
- usb_device_port
env:
global:
FEATURES:
- riot-rs/usb_ethernet
- riot-rs/usb-ethernet

- name: usb_device_port
context:
Expand Down
3 changes: 0 additions & 3 deletions src/riot-rs-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ riot-rs-threads = { path = "../riot-rs-threads" }

ringbuffer = { path = "../lib/ringbuffer" }

[features]
thread_info = []

[build-dependencies]
cbindgen = "0.26.*"

Expand Down
4 changes: 2 additions & 2 deletions src/riot-rs-embassy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ embassy-rp = { workspace = true, features = [
time = ["dep:embassy-time", "embassy-executor/integrated-timers"]
usb = ["dep:embassy-usb"]
net = ["dep:embassy-net"]
usb_ethernet = ["usb", "net"]
usb-ethernet = ["usb", "net"]

wifi_cyw43 = ["dep:cyw43", "dep:cyw43-pio", "dep:embassy-net-driver-channel", "net"]
wifi-cyw43 = ["dep:cyw43", "dep:cyw43-pio", "dep:embassy-net-driver-channel", "net"]

threading = ["dep:riot-rs-core"]
override-network-config = []
Expand Down
12 changes: 6 additions & 6 deletions src/riot-rs-embassy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub mod usb;
#[cfg(feature = "net")]
pub mod network;

#[cfg(feature = "wifi_cyw43")]
#[cfg(feature = "wifi-cyw43")]
mod wifi;

#[cfg(feature = "net")]
Expand All @@ -32,10 +32,10 @@ pub use static_cell::make_static;

pub use embassy_executor::Spawner;

#[cfg(feature = "usb_ethernet")]
#[cfg(feature = "usb-ethernet")]
use usb::ethernet::NetworkDevice;

#[cfg(feature = "wifi_cyw43")]
#[cfg(feature = "wifi-cyw43")]
use wifi::cyw43::NetworkDevice;

#[cfg(feature = "net")]
Expand Down Expand Up @@ -103,7 +103,7 @@ async fn init_task(mut peripherals: arch::OptionalPeripherals) {
builder
};

#[cfg(feature = "usb_ethernet")]
#[cfg(feature = "usb-ethernet")]
let device = {
use embassy_usb::class::cdc_ncm::{
embassy_net::State as NetState, CdcNcmClass, State as CdcNcmState,
Expand Down Expand Up @@ -142,7 +142,7 @@ async fn init_task(mut peripherals: arch::OptionalPeripherals) {
spawner.spawn(usb::usb_task(usb)).unwrap();
}

#[cfg(feature = "wifi_cyw43")]
#[cfg(feature = "wifi-cyw43")]
let (device, control) = {
let (net_device, control) = wifi::cyw43::device(&mut peripherals, &spawner).await;
(net_device, control)
Expand Down Expand Up @@ -187,7 +187,7 @@ async fn init_task(mut peripherals: arch::OptionalPeripherals) {
}
}

#[cfg(feature = "wifi_cyw43")]
#[cfg(feature = "wifi-cyw43")]
{
wifi::cyw43::join(control).await;
};
Expand Down
2 changes: 1 addition & 1 deletion src/riot-rs-embassy/src/usb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub(crate) async fn usb_task(mut device: embassy_usb::UsbDevice<'static, UsbDriv
device.run().await
}

#[cfg(feature = "usb_ethernet")]
#[cfg(feature = "usb-ethernet")]
pub(crate) mod ethernet {
use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner};

Expand Down
4 changes: 2 additions & 2 deletions src/riot-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ silent-panic = ["riot-rs-rt/silent-panic"]
threading = ["dep:riot-rs-threads", "riot-rs-rt/threading", "riot-rs-embassy/threading"]
time = ["riot-rs-embassy/time"]
usb = ["riot-rs-embassy/usb"]
usb_ethernet = ["riot-rs-embassy/usb_ethernet"]
wifi_cyw43 = ["riot-rs-embassy/wifi_cyw43"]
usb-ethernet = ["riot-rs-embassy/usb-ethernet"]
wifi-cyw43 = ["riot-rs-embassy/wifi-cyw43"]

0 comments on commit bd55e31

Please sign in to comment.