mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-10-02 06:40:32 +00:00
Make adc::Resolution::to_max_count const
This commit is contained in:
parent
49ee0564ed
commit
45b7645525
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user