Skip to content

Commit 1c73bfd

Browse files
authored
Implement defmt::Format for scheduler::event::Key (#578)
Part of #561
1 parent d32a3d9 commit 1c73bfd

File tree

11 files changed

+11
-0
lines changed

11 files changed

+11
-0
lines changed

crates/scheduler/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Patch
66

7+
- Implement `defmt::Format` for `Key` when `defmt` is enabled
78
- Stop using `log::Debug2Format()` when logging events
89
- Make applet optional
910
- Update dependencies

crates/scheduler/src/event.rs

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ pub mod usb;
4141
pub struct InstId;
4242

4343
// TODO: This could be encoded into a u32 for performance/footprint.
44+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
4445
#[derive(Derivative)]
4546
#[derivative(Debug(bound = ""), Copy(bound = ""), Hash(bound = ""))]
4647
#[derivative(PartialEq(bound = ""), Eq(bound = ""), Ord(bound = ""))]

crates/scheduler/src/event/button.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use derivative::Derivative;
1818
use wasefire_board_api::button::Event;
1919
use wasefire_board_api::{self as board, Api as Board, Id};
2020

21+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
2122
#[derive(Derivative)]
2223
#[derivative(Debug(bound = ""), Copy(bound = ""), Hash(bound = ""))]
2324
#[derivative(PartialEq(bound = ""), Eq(bound = ""), Ord(bound = ""))]

crates/scheduler/src/event/platform.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use wasefire_board_api::Api as Board;
1818
#[cfg(feature = "board-api-platform-protocol")]
1919
pub mod protocol;
2020

21+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
2122
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
2223
pub enum Key {
2324
#[cfg(feature = "board-api-platform-protocol")]

crates/scheduler/src/event/platform/protocol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use wasefire_board_api::platform::protocol::Event;
1616
use wasefire_board_api::Api as Board;
1717

18+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
1819
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
1920
pub enum Key {
2021
Request,

crates/scheduler/src/event/radio.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use wasefire_board_api::Api as Board;
1818
#[cfg(feature = "board-api-radio-ble")]
1919
pub mod ble;
2020

21+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
2122
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
2223
pub enum Key {
2324
#[cfg(feature = "board-api-radio-ble")]

crates/scheduler/src/event/radio/ble.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use wasefire_board_api::radio::ble::Event;
1616
use wasefire_board_api::Api as Board;
1717

18+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
1819
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
1920
pub enum Key {
2021
Advertisement,

crates/scheduler/src/event/timer.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use derivative::Derivative;
1616
use wasefire_board_api::timer::Event;
1717
use wasefire_board_api::{self as board, Api as Board, Id};
1818

19+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
1920
#[derive(Derivative)]
2021
#[derivative(Debug(bound = ""), Copy(bound = ""), Hash(bound = ""))]
2122
#[derivative(PartialEq(bound = ""), Eq(bound = ""), Ord(bound = ""))]

crates/scheduler/src/event/uart.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use derivative::Derivative;
1616
use wasefire_board_api::uart::{Direction, Event};
1717
use wasefire_board_api::{self as board, Api as Board, Id};
1818

19+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
1920
#[derive(Derivative)]
2021
#[derivative(Debug(bound = ""), Copy(bound = ""), Hash(bound = ""))]
2122
#[derivative(PartialEq(bound = ""), Eq(bound = ""), Ord(bound = ""))]

crates/scheduler/src/event/usb.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use wasefire_board_api::Api as Board;
1818
#[cfg(feature = "board-api-usb-serial")]
1919
pub mod serial;
2020

21+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
2122
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
2223
pub enum Key {
2324
#[cfg(feature = "board-api-usb-serial")]

crates/scheduler/src/event/usb/serial.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use wasefire_board_api::usb::serial::Event;
1616
use wasefire_board_api::Api as Board;
1717

18+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
1819
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
1920
pub enum Key {
2021
Read,

0 commit comments

Comments
 (0)