Make sure we can compile with defmt (#2126)

* Set DEFMT_LOG in CI

* Set DEFMT_LOG in CI

* Set DEFMT_LOG in CI

* Fix BLE vs DEFMT issue

* Fix ESP32 defmt problems in psram.rs

* Use `defmt` feature on `bt-hci`
This commit is contained in:
Björn Quentin 2024-09-09 18:40:30 +02:00 committed by GitHub
parent be82a6521a
commit ddf4ff7e9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 1 deletions

View File

@ -25,6 +25,7 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MSRV: "1.77.0"
RUSTDOCFLAGS: -Dwarnings
DEFMT_LOG: trace
# Cancel any currently running workflows from the same PR, branch, or
# tag when a new workflow is triggered.

View File

@ -9,6 +9,7 @@ env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUSTDOCFLAGS: -Dwarnings
DEFMT_LOG: trace
jobs:

View File

@ -199,6 +199,7 @@ pub(crate) mod utils {
}
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[allow(unused)]
enum PsramCacheSpeed {
PsramCacheF80mS40m = 0,
@ -220,6 +221,7 @@ pub(crate) mod utils {
}
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
enum PsramClkMode {
PsramClkModeNorm = 0, // Normal SPI mode
PsramClkModeDclk = 1, // Two extra clock cycles after CS is set high level

View File

@ -189,7 +189,7 @@ dhcpv4 = ["wifi", "utils", "smoltcp?/proto-dhcpv4", "smoltcp?/socket-dhcpv4"]
wifi-default = ["ipv4", "tcp", "udp", "icmp", "igmp", "dns", "dhcpv4"]
## Enable support for `defmt`
defmt = ["dep:defmt", "smoltcp?/defmt", "esp-hal/defmt"]
defmt = ["dep:defmt", "smoltcp?/defmt", "esp-hal/defmt", "bt-hci?/defmt"]
## Enable support for the `log` crate
log = ["dep:log", "esp-hal/log"]

View File

@ -205,6 +205,7 @@ pub mod asynch {
}
}
warn!("[hci] error parsing packet: {:?}", e);
Err(BleConnectorError::Unknown)
}
}