Merge pull request #2415 from hdoordt/patch-1

Make adc::Resolution::to_max_count const
This commit is contained in:
Dario Nieuwenhuis 2024-01-20 01:31:22 +00:00 committed by GitHub
commit 326bff322e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,7 +56,7 @@ impl Resolution {
/// Get the maximum reading value for this resolution. /// Get the maximum reading value for this resolution.
/// ///
/// This is `2**n - 1`. /// This is `2**n - 1`.
pub fn to_max_count(&self) -> u32 { pub const fn to_max_count(&self) -> u32 {
match self { match self {
#[cfg(adc_v4)] #[cfg(adc_v4)]
Resolution::SixteenBit => (1 << 16) - 1, Resolution::SixteenBit => (1 << 16) - 1,