From 337da33c7a127b083652d635d956f03d79a952bc Mon Sep 17 00:00:00 2001 From: goodhoko Date: Tue, 16 Sep 2025 00:52:59 +0200 Subject: Also derive for enums that aren't available under my feature-set --- embassy-stm32/src/qspi/enums.rs | 7 +++++++ embassy-stm32/src/xspi/enums.rs | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/embassy-stm32/src/qspi/enums.rs b/embassy-stm32/src/qspi/enums.rs index fa5e36d06..8a8420127 100644 --- a/embassy-stm32/src/qspi/enums.rs +++ b/embassy-stm32/src/qspi/enums.rs @@ -23,6 +23,7 @@ impl From for u8 { /// QSPI lane width #[allow(dead_code)] #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum QspiWidth { /// None NONE, @@ -67,6 +68,7 @@ impl From for bool { /// QSPI memory size. #[allow(missing_docs)] #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum MemorySize { _1KiB, _2KiB, @@ -127,6 +129,7 @@ impl From for u8 { /// QSPI Address size #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum AddressSize { /// 8-bit address _8Bit, @@ -152,6 +155,7 @@ impl From for u8 { /// Time the Chip Select line stays high. #[allow(missing_docs)] #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum ChipSelectHighTime { _1Cycle, _2Cycle, @@ -181,6 +185,7 @@ impl From for u8 { /// FIFO threshold. #[allow(missing_docs)] #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum FIFOThresholdLevel { _1Bytes, _2Bytes, @@ -258,6 +263,7 @@ impl From for u8 { /// Dummy cycle count #[allow(missing_docs)] #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum DummyCycles { _0, _1, @@ -334,6 +340,7 @@ impl From for u8 { #[allow(missing_docs)] #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum SampleShifting { None, HalfCycle, diff --git a/embassy-stm32/src/xspi/enums.rs b/embassy-stm32/src/xspi/enums.rs index c96641180..2e510fada 100644 --- a/embassy-stm32/src/xspi/enums.rs +++ b/embassy-stm32/src/xspi/enums.rs @@ -22,6 +22,7 @@ impl Into for XspiMode { /// Xspi lane width #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum XspiWidth { /// None NONE, @@ -50,6 +51,7 @@ impl Into for XspiWidth { /// Wrap Size #[allow(missing_docs)] #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum WrapSize { None, _16Bytes, @@ -73,6 +75,7 @@ impl Into for WrapSize { /// Memory Type #[allow(missing_docs)] #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum MemoryType { Micron, Macronix, @@ -98,6 +101,7 @@ impl Into for MemoryType { /// Xspi memory size. #[allow(missing_docs)] #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum MemorySize { _1KiB, _2KiB, @@ -158,6 +162,7 @@ impl Into for MemorySize { /// Xspi Address size #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum AddressSize { /// 8-bit address _8bit, @@ -183,6 +188,7 @@ impl Into for AddressSize { /// Time the Chip Select line stays high. #[allow(missing_docs)] #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum ChipSelectHighTime { _1Cycle, _2Cycle, @@ -212,6 +218,7 @@ impl Into for ChipSelectHighTime { /// FIFO threshold. #[allow(missing_docs)] #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum FIFOThresholdLevel { _1Bytes, _2Bytes, @@ -289,6 +296,7 @@ impl Into for FIFOThresholdLevel { /// Dummy cycle count #[allow(missing_docs)] #[derive(Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum DummyCycles { _0, _1, -- cgit