Fix all check-cfg errors in the entire repo.

the main ci.sh now passes if running with nightly.
This commit is contained in:
Dario Nieuwenhuis 2024-05-31 21:41:42 +02:00
parent ba940017ee
commit 999a2ad829
38 changed files with 44 additions and 29 deletions

View File

@ -22,6 +22,7 @@ target = "thumbv7em-none-eabi"
[dependencies] [dependencies]
defmt = { version = "0.3", optional = true } defmt = { version = "0.3", optional = true }
log = { version = "0.4.17", optional = true }
embassy-sync = { version = "0.6.0", path = "../embassy-sync" } embassy-sync = { version = "0.6.0", path = "../embassy-sync" }
embassy-nrf = { version = "0.1.0", path = "../embassy-nrf", default-features = false } embassy-nrf = { version = "0.1.0", path = "../embassy-nrf", default-features = false }

View File

@ -21,7 +21,6 @@ target = "thumbv6m-none-eabi"
[dependencies] [dependencies]
defmt = { version = "0.3", optional = true } defmt = { version = "0.3", optional = true }
defmt-rtt = { version = "0.4", optional = true }
log = { version = "0.4", optional = true } log = { version = "0.4", optional = true }
embassy-sync = { version = "0.6.0", path = "../embassy-sync" } embassy-sync = { version = "0.6.0", path = "../embassy-sync" }
@ -46,7 +45,6 @@ log = [
"embassy-boot/log", "embassy-boot/log",
"embassy-rp/log", "embassy-rp/log",
] ]
debug = ["defmt-rtt"]
[profile.dev] [profile.dev]
debug = 2 debug = 2

View File

@ -5,4 +5,5 @@ fn main() {
if target.starts_with("thumbv6m-") { if target.starts_with("thumbv6m-") {
println!("cargo:rustc-cfg=armv6m"); println!("cargo:rustc-cfg=armv6m");
} }
println!("cargo:rustc-check-cfg=cfg(armv6m)");
} }

View File

@ -22,7 +22,6 @@ target = "thumbv7em-none-eabi"
[dependencies] [dependencies]
defmt = { version = "0.3", optional = true } defmt = { version = "0.3", optional = true }
defmt-rtt = { version = "0.4", optional = true }
log = { version = "0.4", optional = true } log = { version = "0.4", optional = true }
embassy-sync = { version = "0.6.0", path = "../embassy-sync" } embassy-sync = { version = "0.6.0", path = "../embassy-sync" }
@ -37,7 +36,6 @@ cfg-if = "1.0.0"
[features] [features]
defmt = ["dep:defmt", "embassy-boot/defmt", "embassy-stm32/defmt"] defmt = ["dep:defmt", "embassy-boot/defmt", "embassy-stm32/defmt"]
log = ["dep:log", "embassy-boot/log", "embassy-stm32/log"] log = ["dep:log", "embassy-boot/log", "embassy-stm32/log"]
debug = ["defmt-rtt"]
[profile.dev] [profile.dev]
debug = 2 debug = 2

View File

@ -5,4 +5,5 @@ fn main() {
if target.starts_with("thumbv6m-") { if target.starts_with("thumbv6m-") {
println!("cargo:rustc-cfg=armv6m"); println!("cargo:rustc-cfg=armv6m");
} }
println!("cargo:rustc-check-cfg=cfg(armv6m)");
} }

View File

@ -29,7 +29,6 @@ critical-section = { version = "1.1.2", features = ["std"] }
futures-test = "0.3.28" futures-test = "0.3.28"
[features] [features]
default = [ ]
defmt = [ "dep:defmt", "embedded-hal-1/defmt-03" ] defmt = [ "dep:defmt", "embedded-hal-1/defmt-03" ]
log = ["dep:log"] log = ["dep:log"]

View File

@ -1,6 +1,6 @@
#![cfg_attr(not(test), no_std)]
#![deny(clippy::pedantic)] #![deny(clippy::pedantic)]
#![allow(async_fn_in_trait)] #![allow(async_fn_in_trait)]
#![cfg_attr(not(any(test, feature = "std")), no_std)]
#![allow(clippy::module_name_repetitions)] #![allow(clippy::module_name_repetitions)]
#![allow(clippy::missing_errors_doc)] #![allow(clippy::missing_errors_doc)]
#![allow(clippy::missing_panics_doc)] #![allow(clippy::missing_panics_doc)]

View File

@ -28,6 +28,8 @@ embassy-embedded-hal = { version = "0.1.0", path = "../embassy-embedded-hal" }
embassy-net-driver = { version = "0.2.0", path = "../embassy-net-driver", optional=true } embassy-net-driver = { version = "0.2.0", path = "../embassy-net-driver", optional=true }
defmt = { version = "0.3", optional = true } defmt = { version = "0.3", optional = true }
log = { version = "0.4.17", optional = true }
cortex-m = "0.7.6" cortex-m = "0.7.6"
heapless = "0.8" heapless = "0.8"
aligned = "0.4.1" aligned = "0.4.1"

View File

@ -26,9 +26,11 @@ flavors = [
features = ["defmt", "cortex-m", "dfu"] features = ["defmt", "cortex-m", "dfu"]
[dependencies] [dependencies]
defmt = { version = "0.3.5", optional = true }
log = { version = "0.4.17", optional = true }
bitflags = "2.4.1" bitflags = "2.4.1"
cortex-m = { version = "0.7.7", features = ["inline-asm"], optional = true } cortex-m = { version = "0.7.7", features = ["inline-asm"], optional = true }
defmt = { version = "0.3.5", optional = true }
embassy-boot = { version = "0.2.0", path = "../embassy-boot" } embassy-boot = { version = "0.2.0", path = "../embassy-boot" }
embassy-futures = { version = "0.1.1", path = "../embassy-futures" } embassy-futures = { version = "0.1.1", path = "../embassy-futures" }
embassy-sync = { version = "0.6.0", path = "../embassy-sync" } embassy-sync = { version = "0.6.0", path = "../embassy-sync" }

View File

@ -25,3 +25,10 @@ cortex-m-rt = "0.7.0"
ed25519-dalek = ["embassy-boot/ed25519-dalek"] ed25519-dalek = ["embassy-boot/ed25519-dalek"]
ed25519-salty = ["embassy-boot/ed25519-salty"] ed25519-salty = ["embassy-boot/ed25519-salty"]
skip-include = [] skip-include = []
defmt = [
"dep:defmt",
"dep:defmt-rtt",
"embassy-nrf/defmt",
"embassy-boot-nrf/defmt",
"embassy-sync/defmt",
]

View File

@ -23,6 +23,7 @@ cortex-m-rt = "0.7.0"
[features] [features]
defmt = [ defmt = [
"dep:defmt", "dep:defmt",
"dep:defmt-rtt",
"embassy-stm32/defmt", "embassy-stm32/defmt",
"embassy-boot-stm32/defmt", "embassy-boot-stm32/defmt",
"embassy-sync/defmt", "embassy-sync/defmt",

View File

@ -1,7 +1,7 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig};
use embassy_embedded_hal::adapter::BlockingAsync; use embassy_embedded_hal::adapter::BlockingAsync;

View File

@ -1,7 +1,7 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_stm32::gpio::{Level, Output, Speed};

View File

@ -24,6 +24,7 @@ cortex-m-rt = "0.7.0"
[features] [features]
defmt = [ defmt = [
"dep:defmt", "dep:defmt",
"dep:defmt-rtt",
"embassy-stm32/defmt", "embassy-stm32/defmt",
"embassy-boot-stm32/defmt", "embassy-boot-stm32/defmt",
"embassy-sync/defmt", "embassy-sync/defmt",

View File

@ -3,7 +3,7 @@
use core::cell::RefCell; use core::cell::RefCell;
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig};
use embassy_executor::Spawner; use embassy_executor::Spawner;

View File

@ -1,7 +1,7 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_stm32::gpio::{Level, Output, Speed};

View File

@ -24,6 +24,7 @@ cortex-m-rt = "0.7.0"
[features] [features]
defmt = [ defmt = [
"dep:defmt", "dep:defmt",
"dep:defmt-rtt",
"embassy-stm32/defmt", "embassy-stm32/defmt",
"embassy-boot-stm32/defmt", "embassy-boot-stm32/defmt",
"embassy-sync/defmt", "embassy-sync/defmt",

View File

@ -3,7 +3,7 @@
use core::cell::RefCell; use core::cell::RefCell;
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig};
use embassy_executor::Spawner; use embassy_executor::Spawner;

View File

@ -1,7 +1,7 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_stm32::gpio::{Level, Output, Speed};

View File

@ -23,6 +23,7 @@ cortex-m-rt = "0.7.0"
[features] [features]
defmt = [ defmt = [
"dep:defmt", "dep:defmt",
"dep:defmt-rtt",
"embassy-stm32/defmt", "embassy-stm32/defmt",
"embassy-boot-stm32/defmt", "embassy-boot-stm32/defmt",
"embassy-sync/defmt", "embassy-sync/defmt",

View File

@ -1,7 +1,7 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig};
use embassy_embedded_hal::adapter::BlockingAsync; use embassy_embedded_hal::adapter::BlockingAsync;

View File

@ -1,7 +1,7 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_stm32::gpio::{Level, Output, Speed};

View File

@ -23,6 +23,7 @@ cortex-m-rt = "0.7.0"
[features] [features]
defmt = [ defmt = [
"dep:defmt", "dep:defmt",
"dep:defmt-rtt",
"embassy-stm32/defmt", "embassy-stm32/defmt",
"embassy-boot-stm32/defmt", "embassy-boot-stm32/defmt",
"embassy-sync/defmt", "embassy-sync/defmt",

View File

@ -1,7 +1,7 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig};
use embassy_embedded_hal::adapter::BlockingAsync; use embassy_embedded_hal::adapter::BlockingAsync;

View File

@ -1,7 +1,7 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_stm32::gpio::{Level, Output, Speed};

View File

@ -23,6 +23,7 @@ cortex-m-rt = "0.7.0"
[features] [features]
defmt = [ defmt = [
"dep:defmt", "dep:defmt",
"dep:defmt-rtt",
"embassy-stm32/defmt", "embassy-stm32/defmt",
"embassy-boot-stm32/defmt", "embassy-boot-stm32/defmt",
"embassy-sync/defmt", "embassy-sync/defmt",

View File

@ -1,7 +1,7 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig};
use embassy_embedded_hal::adapter::BlockingAsync; use embassy_embedded_hal::adapter::BlockingAsync;

View File

@ -1,7 +1,7 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_stm32::gpio::{Level, Output, Speed};

View File

@ -3,7 +3,7 @@
use core::cell::RefCell; use core::cell::RefCell;
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareState, FirmwareUpdaterConfig}; use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareState, FirmwareUpdaterConfig};
use embassy_executor::Spawner; use embassy_executor::Spawner;

View File

@ -23,6 +23,7 @@ cortex-m-rt = "0.7.0"
[features] [features]
defmt = [ defmt = [
"dep:defmt", "dep:defmt",
"dep:defmt-rtt",
"embassy-stm32/defmt", "embassy-stm32/defmt",
"embassy-boot-stm32/defmt", "embassy-boot-stm32/defmt",
"embassy-sync/defmt", "embassy-sync/defmt",

View File

@ -1,7 +1,7 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig};
use embassy_embedded_hal::adapter::BlockingAsync; use embassy_embedded_hal::adapter::BlockingAsync;

View File

@ -1,7 +1,7 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#[cfg(feature = "defmt-rtt")] #[cfg(feature = "defmt")]
use defmt_rtt::*; use defmt_rtt::*;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_stm32::gpio::{Level, Output, Speed};

View File

@ -19,13 +19,13 @@ cfg-if = "1.0.0"
[features] [features]
defmt = [ defmt = [
"dep:defmt", "dep:defmt",
"dep:defmt-rtt",
"embassy-boot-nrf/defmt", "embassy-boot-nrf/defmt",
"embassy-nrf/defmt", "embassy-nrf/defmt",
] ]
softdevice = [ softdevice = [
"embassy-boot-nrf/softdevice", "embassy-boot-nrf/softdevice",
] ]
debug = ["defmt-rtt", "defmt"]
[profile.dev] [profile.dev]
debug = 2 debug = 2

View File

@ -23,10 +23,10 @@ cfg-if = "1.0.0"
[features] [features]
defmt = [ defmt = [
"dep:defmt", "dep:defmt",
"dep:defmt-rtt",
"embassy-boot-rp/defmt", "embassy-boot-rp/defmt",
"embassy-rp/defmt", "embassy-rp/defmt",
] ]
debug = ["defmt-rtt", "defmt"]
[profile.release] [profile.release]
debug = true debug = true

View File

@ -22,8 +22,7 @@ embedded-storage-async = "0.4.0"
cfg-if = "1.0.0" cfg-if = "1.0.0"
[features] [features]
defmt = ["dep:defmt", "embassy-boot-stm32/defmt", "embassy-stm32/defmt"] defmt = ["dep:defmt", "dep:defmt-rtt", "embassy-boot-stm32/defmt", "embassy-stm32/defmt"]
debug = ["defmt-rtt", "defmt"]
[profile.dev] [profile.dev]
debug = 2 debug = 2

View File

@ -21,10 +21,10 @@ cfg-if = "1.0.0"
[features] [features]
defmt = [ defmt = [
"dep:defmt", "dep:defmt",
"dep:defmt-rtt",
"embassy-boot-stm32/defmt", "embassy-boot-stm32/defmt",
"embassy-stm32/defmt", "embassy-stm32/defmt",
] ]
debug = ["defmt-rtt", "defmt"]
[profile.dev] [profile.dev]
debug = 2 debug = 2

View File

@ -24,12 +24,12 @@ embassy-futures = { version = "0.1.1", path = "../../../../embassy-futures" }
[features] [features]
defmt = [ defmt = [
"dep:defmt", "dep:defmt",
"dep:defmt-rtt",
"embassy-boot-stm32/defmt", "embassy-boot-stm32/defmt",
"embassy-stm32/defmt", "embassy-stm32/defmt",
"embassy-usb/defmt", "embassy-usb/defmt",
"embassy-usb-dfu/defmt" "embassy-usb-dfu/defmt"
] ]
debug = ["defmt-rtt", "defmt"]
[profile.dev] [profile.dev]
debug = 2 debug = 2

View File

@ -92,7 +92,7 @@ fn options() -> (Config, TestOptions) {
) )
} }
#[cfg(any(feature = "stm32g491re", feature = "stm32g431cb"))] #[cfg(any(feature = "stm32g491re"))]
fn options() -> (Config, TestOptions) { fn options() -> (Config, TestOptions) {
info!("G4 config"); info!("G4 config");
( (