diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-01-20 01:31:22 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-01-20 01:31:22 +0000 |
| commit | 326bff322e95903065b35e075ffa27986a6acfc0 (patch) | |
| tree | ba519218d4c1df21e51699630732a9f606941f95 | |
| parent | 2fd391240deafe36066949db926337fe9e31433a (diff) | |
| parent | 45b76455257c9b8f213b23f1164e71d8ad94446a (diff) | |
Merge pull request #2415 from hdoordt/patch-1
Make adc::Resolution::to_max_count const
| -rw-r--r-- | embassy-stm32/src/adc/resolution.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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 { | |||
| 56 | /// Get the maximum reading value for this resolution. | 56 | /// Get the maximum reading value for this resolution. |
| 57 | /// | 57 | /// |
| 58 | /// This is `2**n - 1`. | 58 | /// This is `2**n - 1`. |
| 59 | pub fn to_max_count(&self) -> u32 { | 59 | pub const fn to_max_count(&self) -> u32 { |
| 60 | match self { | 60 | match self { |
| 61 | #[cfg(adc_v4)] | 61 | #[cfg(adc_v4)] |
| 62 | Resolution::SixteenBit => (1 << 16) - 1, | 62 | Resolution::SixteenBit => (1 << 16) - 1, |
