added a small test prg for serial in
This commit is contained in:
21
serial/t.c
Normal file
21
serial/t.c
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user