Skip to content

Instantly share code, notes, and snippets.

@lupyuen
Created June 18, 2018 05:16
Show Gist options
  • Save lupyuen/b2b8f87da6dbf90a7b47be3a6ff19038 to your computer and use it in GitHub Desktop.
Save lupyuen/b2b8f87da6dbf90a7b47be3a6ff19038 to your computer and use it in GitHub Desktop.
Sample Rust program for PADI
pub extern fn main_entry() {
let mut s = Serial::new();
s.tx_string("Hello from Rust!\n");
loop {
let data = s.rx_i32();
s.tx_string("Received: ");
s.tx_i32(data);
s.tx_string("\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment