aboutsummaryrefslogtreecommitdiff
path: root/embassy-rp/src
diff options
context:
space:
mode:
authorGrant Miller <[email protected]>2023-02-24 13:01:41 -0600
committerGrant Miller <[email protected]>2023-02-24 13:01:41 -0600
commit7be4337de96de9948632bdc2fc5067d0c4a76b33 (patch)
treead08ac1de1774914dff63b4b23ad0efd8f9b3da6 /embassy-rp/src
parent2209bef4f22bf77d9d52cda0a0ea40485cc2747a (diff)
Add `#[must_use]` to all futures
Diffstat (limited to 'embassy-rp/src')
-rw-r--r--embassy-rp/src/dma.rs1
-rw-r--r--embassy-rp/src/gpio.rs1
-rw-r--r--embassy-rp/src/pio.rs3
3 files changed, 5 insertions, 0 deletions
diff --git a/embassy-rp/src/dma.rs b/embassy-rp/src/dma.rs
index fd281fd5d..05adcecdd 100644
--- a/embassy-rp/src/dma.rs
+++ b/embassy-rp/src/dma.rs
@@ -151,6 +151,7 @@ fn copy_inner<'a, C: Channel>(
151 Transfer::new(ch) 151 Transfer::new(ch)
152} 152}
153 153
154#[must_use = "futures do nothing unless you `.await` or poll them"]
154pub struct Transfer<'a, C: Channel> { 155pub struct Transfer<'a, C: Channel> {
155 channel: PeripheralRef<'a, C>, 156 channel: PeripheralRef<'a, C>,
156} 157}
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs
index 76d4281ff..fd3b05567 100644
--- a/embassy-rp/src/gpio.rs
+++ b/embassy-rp/src/gpio.rs
@@ -193,6 +193,7 @@ unsafe fn IO_IRQ_BANK0() {
193 } 193 }
194} 194}
195 195
196#[must_use = "futures do nothing unless you `.await` or poll them"]
196struct InputFuture<'a, T: Pin> { 197struct InputFuture<'a, T: Pin> {
197 pin: PeripheralRef<'a, T>, 198 pin: PeripheralRef<'a, T>,
198 level: InterruptTrigger, 199 level: InterruptTrigger,
diff --git a/embassy-rp/src/pio.rs b/embassy-rp/src/pio.rs
index 2fb2783de..3c7abea25 100644
--- a/embassy-rp/src/pio.rs
+++ b/embassy-rp/src/pio.rs
@@ -120,6 +120,7 @@ unsafe fn PIO1_IRQ_0() {
120} 120}
121 121
122/// Future that waits for TX-FIFO to become writable 122/// Future that waits for TX-FIFO to become writable
123#[must_use = "futures do nothing unless you `.await` or poll them"]
123pub struct FifoOutFuture<'a, PIO: PioInstance, SM: PioStateMachine + Unpin> { 124pub struct FifoOutFuture<'a, PIO: PioInstance, SM: PioStateMachine + Unpin> {
124 sm: &'a mut SM, 125 sm: &'a mut SM,
125 pio: PhantomData<PIO>, 126 pio: PhantomData<PIO>,
@@ -182,6 +183,7 @@ impl<'d, PIO: PioInstance, SM: PioStateMachine + Unpin> Drop for FifoOutFuture<'
182} 183}
183 184
184/// Future that waits for RX-FIFO to become readable 185/// Future that waits for RX-FIFO to become readable
186#[must_use = "futures do nothing unless you `.await` or poll them"]
185pub struct FifoInFuture<'a, PIO: PioInstance, SM: PioStateMachine> { 187pub struct FifoInFuture<'a, PIO: PioInstance, SM: PioStateMachine> {
186 sm: &'a mut SM, 188 sm: &'a mut SM,
187 pio: PhantomData<PIO>, 189 pio: PhantomData<PIO>,
@@ -241,6 +243,7 @@ impl<'d, PIO: PioInstance, SM: PioStateMachine> Drop for FifoInFuture<'d, PIO, S
241} 243}
242 244
243/// Future that waits for IRQ 245/// Future that waits for IRQ
246#[must_use = "futures do nothing unless you `.await` or poll them"]
244pub struct IrqFuture<PIO: PioInstance> { 247pub struct IrqFuture<PIO: PioInstance> {
245 pio: PhantomData<PIO>, 248 pio: PhantomData<PIO>,
246 irq_no: u8, 249 irq_no: u8,