Merge pull request #1763 from rubdos/sender-receiver-with-ctx
Refactor Channel/Sender/Receiver poll methods
This commit is contained in:
@ -35,7 +35,7 @@ async fn main(spawner: Spawner) {
|
||||
unwrap!(spawner.spawn(my_task()));
|
||||
|
||||
loop {
|
||||
match CHANNEL.recv().await {
|
||||
match CHANNEL.receive().await {
|
||||
LedState::On => led.set_high(),
|
||||
LedState::Off => led.set_low(),
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ async fn recv_task(led: AnyPin, receiver: Receiver<'static, NoopRawMutex, LedSta
|
||||
let mut led = Output::new(led, Level::Low, OutputDrive::Standard);
|
||||
|
||||
loop {
|
||||
match receiver.recv().await {
|
||||
match receiver.receive().await {
|
||||
LedState::On => led.set_high(),
|
||||
LedState::Off => led.set_low(),
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ async fn main(spawner: Spawner) {
|
||||
// back out the buffer we receive from the read
|
||||
// task.
|
||||
loop {
|
||||
let buf = CHANNEL.recv().await;
|
||||
let buf = CHANNEL.receive().await;
|
||||
info!("writing...");
|
||||
unwrap!(tx.write(&buf).await);
|
||||
}
|
||||
|
Reference in New Issue
Block a user