We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11b8584 commit f8ac1ddCopy full SHA for f8ac1dd
src/bin/echo-bot.rs
@@ -0,0 +1,22 @@
1
+//! This is an example of how to communicate with an USB Gecko using Luma.
2
+
3
+#![no_std]
4
5
+extern crate luma_core;
6
+extern crate luma_runtime;
7
8
+use luma_core::exi::Exi;
9
+use luma_core::exi::usb_gecko::UsbGecko;
10
11
+fn main() {
12
+ let exi = Exi::init();
13
+ let gecko = UsbGecko::new(&exi).unwrap();
14
+ loop {
15
+ // TODO: use interrupts here, instead of a busy loop.
16
+ let buf = match gecko.receive() {
17
+ Ok(buf) => buf,
18
+ Err(_) => continue,
19
+ };
20
+ gecko.send(&buf).unwrap();
21
+ }
22
+}
0 commit comments