mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-09 22:49:53 +08:00
19 lines
461 B
OCaml
19 lines
461 B
OCaml
let print_hex = fun s ->
|
|
for i = 0 to String.length s - 1 do
|
|
Printf.printf "%02x" (Char.code s.[i])
|
|
done;
|
|
print_newline ()
|
|
|
|
|
|
let _ =
|
|
let dsp = Demod.init "/dev/dsp" in
|
|
|
|
let cb = fun _ ->
|
|
let l, r = Demod.get_data () in
|
|
print_hex l; print_hex r; true in
|
|
|
|
ignore (Glib.Io.add_watch [`IN] cb (Glib.Io.channel_of_descr dsp));
|
|
|
|
let loop = Glib.Main.create true in
|
|
while Glib.Main.is_running loop do ignore (Glib.Main.iteration true) done
|