diff options
| author | Henrik Alsér <[email protected]> | 2022-11-05 00:19:52 +0100 |
|---|---|---|
| committer | Henrik Alsér <[email protected]> | 2022-11-05 00:19:52 +0100 |
| commit | a3e8a6bc3a706bc59b9d017699eaab93c1ba60d3 (patch) | |
| tree | ef7ccbc241bbb8f785b8f55dbbde9d2f56373fa8 | |
| parent | 1920e90dcdbebc1e2f86001f1491a9f28eb0f0f3 (diff) | |
rustfmt
| -rw-r--r-- | embassy-nrf/src/spis.rs | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/embassy-nrf/src/spis.rs b/embassy-nrf/src/spis.rs index 32c0b6f93..ab7986b89 100644 --- a/embassy-nrf/src/spis.rs +++ b/embassy-nrf/src/spis.rs | |||
| @@ -82,7 +82,15 @@ impl<'d, T: Instance> Spis<'d, T> { | |||
| 82 | config: Config, | 82 | config: Config, |
| 83 | ) -> Self { | 83 | ) -> Self { |
| 84 | into_ref!(cs, sck, mosi); | 84 | into_ref!(cs, sck, mosi); |
| 85 | Self::new_inner(spis, irq, cs.map_into(), sck.map_into(), None, Some(mosi.map_into()), config) | 85 | Self::new_inner( |
| 86 | spis, | ||
| 87 | irq, | ||
| 88 | cs.map_into(), | ||
| 89 | sck.map_into(), | ||
| 90 | None, | ||
| 91 | Some(mosi.map_into()), | ||
| 92 | config, | ||
| 93 | ) | ||
| 86 | } | 94 | } |
| 87 | 95 | ||
| 88 | pub fn new_rxonly( | 96 | pub fn new_rxonly( |
| @@ -94,7 +102,15 @@ impl<'d, T: Instance> Spis<'d, T> { | |||
| 94 | config: Config, | 102 | config: Config, |
| 95 | ) -> Self { | 103 | ) -> Self { |
| 96 | into_ref!(cs, sck, miso); | 104 | into_ref!(cs, sck, miso); |
| 97 | Self::new_inner(spis, irq, cs.map_into(), sck.map_into(), Some(miso.map_into()), None, config) | 105 | Self::new_inner( |
| 106 | spis, | ||
| 107 | irq, | ||
| 108 | cs.map_into(), | ||
| 109 | sck.map_into(), | ||
| 110 | Some(miso.map_into()), | ||
| 111 | None, | ||
| 112 | config, | ||
| 113 | ) | ||
| 98 | } | 114 | } |
| 99 | 115 | ||
| 100 | fn new_inner( | 116 | fn new_inner( |
| @@ -278,7 +294,7 @@ impl<'d, T: Instance> Spis<'d, T> { | |||
| 278 | 294 | ||
| 279 | // Requests acquiring the SPIS semaphore | 295 | // Requests acquiring the SPIS semaphore |
| 280 | r.tasks_acquire.write(|w| unsafe { w.bits(1) }); | 296 | r.tasks_acquire.write(|w| unsafe { w.bits(1) }); |
| 281 | 297 | ||
| 282 | // Wait for 'acquire' event. | 298 | // Wait for 'acquire' event. |
| 283 | poll_fn(|cx| { | 299 | poll_fn(|cx| { |
| 284 | s.acquire_waker.register(cx.waker()); | 300 | s.acquire_waker.register(cx.waker()); |
| @@ -511,6 +527,5 @@ impl<'d, T: Instance> SetConfig for Spis<'d, T> { | |||
| 511 | // Set auto acquire | 527 | // Set auto acquire |
| 512 | let auto_acquire = config.auto_acquire; | 528 | let auto_acquire = config.auto_acquire; |
| 513 | r.shorts.write(|w| w.end_acquire().bit(auto_acquire)); | 529 | r.shorts.write(|w| w.end_acquire().bit(auto_acquire)); |
| 514 | |||
| 515 | } | 530 | } |
| 516 | } | 531 | } |
