async fn bracketed_echo() -> ! {
loop {
let mut buf = 0;
Serial.rx(&mut buf).await;
Serial.tx(b'>').await;
Serial.tx(buf).await;
Serial.tx(b'<').await;
}
}
This reads from the serial port and echos it back inside of `><`. The code reads very cleanly, does not require the heap, and should be very efficient.The caveat is that I am also trying to target a platform that Lust / LLVM doesn't support completely yet, so I haven't gotten this to actually work well. I bet the people using the Cortex processor are far ahead of me though.