aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-07-02 22:07:20 +0200
committerDario Nieuwenhuis <[email protected]>2023-07-02 22:16:01 +0200
commitc9b9be5b819911aaf809df9b55be7e7efa3a1fba (patch)
treebc19248a36ab6e9439e22db6fcdc835b60e61202 /embassy-stm32
parentba4344429264fa7beb99ab19c09059c2d531716d (diff)
hal-common: require DerefMut for peripherals, not just Deref.
Otherwise you can create multiple drivers on the same singleton like this: ```rust let mut input = Input::new(&pin, Pull::None); let mut output = Output::new(&pin, Level::Low, Speed::Low); input.is_high(); output.set_high(); input.is_high(); output.set_high(); ``` Thanks @pennae for reporting.
Diffstat (limited to 'embassy-stm32')
-rw-r--r--embassy-stm32/src/dac/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-stm32/src/dac/mod.rs b/embassy-stm32/src/dac/mod.rs
index 1dc13949d..31a2d8863 100644
--- a/embassy-stm32/src/dac/mod.rs
+++ b/embassy-stm32/src/dac/mod.rs
@@ -264,7 +264,7 @@ impl<'d, T: Instance, Tx> DacCh1<'d, T, Tx> {
264 }); 264 });
265 265
266 let tx_request = self.dma.request(); 266 let tx_request = self.dma.request();
267 let dma_channel = &self.dma; 267 let dma_channel = &mut self.dma;
268 268
269 let tx_options = crate::dma::TransferOptions { 269 let tx_options = crate::dma::TransferOptions {
270 circular, 270 circular,
@@ -376,7 +376,7 @@ impl<'d, T: Instance, Tx> DacCh2<'d, T, Tx> {
376 }); 376 });
377 377
378 let tx_request = self.dma.request(); 378 let tx_request = self.dma.request();
379 let dma_channel = &self.dma; 379 let dma_channel = &mut self.dma;
380 380
381 let tx_options = crate::dma::TransferOptions { 381 let tx_options = crate::dma::TransferOptions {
382 circular, 382 circular,