This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::net::UdpSocket; | |
use std::env; | |
fn main() { | |
let src = env::args().nth(1).unwrap(); | |
let dst = env::args().nth(2).unwrap(); | |
println!("src {} dst {}", src, dst); | |
let mut buf = [0; 256]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#define ESCAPE "\x1B" | |
#define ESC_BAT ESCAPE"B" | |
#define ESC_MCU_BL_VER ESCAPE"U" | |
#define ESC_MCU_RUN_VER ESCAPE"R" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug, PartialEq)] | |
enum State { | |
Waiting { waiting_time: usize }, | |
Filling { rate: usize }, | |
Done, | |
Failure(String), | |
} | |
#[derive(Debug, Clone, Copy)] | |
enum Event { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(conservative_impl_trait)] | |
type Reg = usize; | |
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] | |
struct Cpu { | |
reg: [isize; 3] | |
} | |
impl Cpu { | |
fn mov(&mut self, src: Reg, dst: Reg) { |