From c1914a477d13eec27089975dbf996ebf7389e0a8 Mon Sep 17 00:00:00 2001 From: Michal Srb Date: Tue, 12 Apr 2022 12:49:06 +0200 Subject: [PATCH] stm32/dac: Check proper channel --- embassy-stm32/src/dac/v2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embassy-stm32/src/dac/v2.rs b/embassy-stm32/src/dac/v2.rs index 006602439..ef64f60e9 100644 --- a/embassy-stm32/src/dac/v2.rs +++ b/embassy-stm32/src/dac/v2.rs @@ -240,7 +240,7 @@ impl<'d, T: Instance> Dac<'d, T> { } pub fn set(&mut self, ch: Channel, value: Value) -> Result<(), Error> { - self.check_channel_exists(Channel::Ch2)?; + self.check_channel_exists(ch)?; match ch { Channel::Ch1 => match value { Value::Bit8(v) => unsafe {