URL
https://opencores.org/ocsvn/eco32/eco32/trunk
Subversion Repositories eco32
Compare Revisions
- This comparison shows the changes necessary to convert path
/eco32/trunk/hwtests/serial/fpga2pc
- from Rev 39 to Rev 132
- ↔ Reverse comparison
Rev 39 → Rev 132
/receive.c
12,8 → 12,6
#include <termios.h> |
|
|
#define SERIAL_PORT "/dev/ttyS0" |
|
#define NUM_TRIES 10 |
|
#define SYN 0x16 |
49,10 → 47,10
} |
|
|
void serialOpen(void) { |
sfd = open(SERIAL_PORT, O_RDWR | O_NOCTTY | O_NDELAY); |
void serialOpen(char *serialPort) { |
sfd = open(serialPort, O_RDWR | O_NOCTTY | O_NDELAY); |
if (sfd == -1) { |
error("cannot open serial port '%s'", SERIAL_PORT); |
error("cannot open serial port '%s'", serialPort); |
} |
tcgetattr(sfd, &origOptions); |
currOptions = origOptions; |
96,14 → 94,16
|
|
int main(int argc, char *argv[]) { |
char *serialPort; |
unsigned char prev, curr; |
int count, errors; |
|
if (argc != 1) { |
printf("Usage: %s\n", argv[0]); |
if (argc != 2) { |
printf("Usage: %s <serial port>\n", argv[0]); |
exit(1); |
} |
serialOpen(); |
serialPort = argv[1]; |
serialOpen(serialPort); |
count = 0; |
errors = 0; |
while (!serialRcv(&prev)) ; |
/send1.s
8,7 → 8,7
; $11 counter |
; $31 return address |
|
.set tba,0xF0300010 |
.set tba,0xF0301000 |
|
add $8,$0,tba |
add $11,$0,0 |