aboutsummaryrefslogtreecommitdiff
path: root/examples/std/src/bin/serial.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-08-22 14:12:13 +0000
committerGitHub <[email protected]>2022-08-22 14:12:13 +0000
commit381ac97746c318963b42eec6ced6773301c91519 (patch)
treeb1b3f644b77c6fcf4a0bbe2eabe19caba27c4c08 /examples/std/src/bin/serial.rs
parent1b9599025868d3a5d0d8e773593b05df8b2fecf2 (diff)
parent478f4727846f6a43c28fff3b09cb639c0b800465 (diff)
Merge #920
920: Remove Forever, switch to static_cell. r=Dirbaio a=Dirbaio Co-authored-by: Dario Nieuwenhuis <[email protected]>
Diffstat (limited to 'examples/std/src/bin/serial.rs')
-rw-r--r--examples/std/src/bin/serial.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/std/src/bin/serial.rs b/examples/std/src/bin/serial.rs
index 35cba4cee..85ee54f70 100644
--- a/examples/std/src/bin/serial.rs
+++ b/examples/std/src/bin/serial.rs
@@ -5,10 +5,10 @@ mod serial_port;
5 5
6use async_io::Async; 6use async_io::Async;
7use embassy_executor::Executor; 7use embassy_executor::Executor;
8use embassy_util::Forever;
9use embedded_io::asynch::Read; 8use embedded_io::asynch::Read;
10use log::*; 9use log::*;
11use nix::sys::termios; 10use nix::sys::termios;
11use static_cell::StaticCell;
12 12
13use self::serial_port::SerialPort; 13use self::serial_port::SerialPort;
14 14
@@ -40,7 +40,7 @@ async fn run() {
40 } 40 }
41} 41}
42 42
43static EXECUTOR: Forever<Executor> = Forever::new(); 43static EXECUTOR: StaticCell<Executor> = StaticCell::new();
44 44
45fn main() { 45fn main() {
46 env_logger::builder() 46 env_logger::builder()
@@ -49,7 +49,7 @@ fn main() {
49 .format_timestamp_nanos() 49 .format_timestamp_nanos()
50 .init(); 50 .init();
51 51
52 let executor = EXECUTOR.put(Executor::new()); 52 let executor = EXECUTOR.init(Executor::new());
53 executor.run(|spawner| { 53 executor.run(|spawner| {
54 spawner.spawn(run()).unwrap(); 54 spawner.spawn(run()).unwrap();
55 }); 55 });