From 45b76455257c9b8f213b23f1164e71d8ad94446a Mon Sep 17 00:00:00 2001 From: Henk Oordt <hd@oordt.dev> Date: Mon, 8 Jan 2024 13:56:21 +0100 Subject: [PATCH] Make adc::Resolution::to_max_count const --- embassy-stm32/src/adc/resolution.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embassy-stm32/src/adc/resolution.rs b/embassy-stm32/src/adc/resolution.rs index 64c25a776..9513e1df7 100644 --- a/embassy-stm32/src/adc/resolution.rs +++ b/embassy-stm32/src/adc/resolution.rs @@ -56,7 +56,7 @@ impl Resolution { /// Get the maximum reading value for this resolution. /// /// This is `2**n - 1`. - pub fn to_max_count(&self) -> u32 { + pub const fn to_max_count(&self) -> u32 { match self { #[cfg(adc_v4)] Resolution::SixteenBit => (1 << 16) - 1,