stm32/dac: Check proper channel
This commit is contained in:
parent
ac3986e40e
commit
c1914a477d
1 changed files with 1 additions and 1 deletions
|
@ -240,7 +240,7 @@ impl<'d, T: Instance> Dac<'d, T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set(&mut self, ch: Channel, value: Value) -> Result<(), Error> {
|
pub fn set(&mut self, ch: Channel, value: Value) -> Result<(), Error> {
|
||||||
self.check_channel_exists(Channel::Ch2)?;
|
self.check_channel_exists(ch)?;
|
||||||
match ch {
|
match ch {
|
||||||
Channel::Ch1 => match value {
|
Channel::Ch1 => match value {
|
||||||
Value::Bit8(v) => unsafe {
|
Value::Bit8(v) => unsafe {
|
||||||
|
|
Loading…
Reference in a new issue