22 lines
321 B
C
22 lines
321 B
C
|
|
||
|
|
||
|
#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;
|
||
|
}
|