DD2-monitor/serial/t.c

22 lines
321 B
C
Raw Normal View History

2018-12-12 16:06:18 +01:00
#include <stdio.h>
#include "serial.h"
int main (int argc, char *argv[])
{
int serial_in;
int byte, foo;
serial_in = prepare_UART("/dev/ttyS0", 9600);
fprintf(stderr, "prepare uart -> %d\n", serial_in);
for (foo=0; foo<20; foo++) {
byte = getbyte(serial_in);
printf("%6d %02x\n", foo, byte);
}
return 0;
}