diff options
author | imp <imp@FreeBSD.org> | 2006-08-10 17:54:51 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2006-08-10 17:54:51 +0000 |
commit | a6500ec8aadab85a33f6ca1023ecd4f7f438db74 (patch) | |
tree | b76af0aa6bd63d894a406b54d556206c847e5ad6 | |
parent | 0b062661fdef03b0e98c5e8498282222f0e6c074 (diff) | |
download | FreeBSD-src-a6500ec8aadab85a33f6ca1023ecd4f7f438db74.zip FreeBSD-src-a6500ec8aadab85a33f6ca1023ecd4f7f438db74.tar.gz |
MFp4: Increase character timeout to 10. Make it a #define for easier
changes in the future. This helps with getting started and to
overcome the really sucky level of granuality this timeout has in
getc. A timeout of 1 means 'wait until top of next second' rather
than 'wait for at least a second'.
-rw-r--r-- | sys/boot/arm/at91/libat91/xmodem.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/boot/arm/at91/libat91/xmodem.c b/sys/boot/arm/at91/libat91/xmodem.c index c3903aa..0c4b138 100644 --- a/sys/boot/arm/at91/libat91/xmodem.c +++ b/sys/boot/arm/at91/libat91/xmodem.c @@ -39,6 +39,7 @@ #define CAN 0x18 /* Cancel */ #define EOT 0x04 /* end of text */ +#define TO 10 /* * int GetRecord(char , char *) * This private function receives a x-modem record to the pointer and @@ -53,17 +54,17 @@ GetRecord(char blocknum, char *dest) chk = 0; - if ((ch = getc(1)) == -1) + if ((ch = getc(TO)) == -1) goto err; - if (ch != blocknum) + if (ch != blocknum) goto err; - if ((ch = getc(1)) == -1) + if ((ch = getc(TO)) == -1) goto err; if (ch != (~blocknum & 0xff)) goto err; for (size = 0; size < PACKET_SIZE; ++size) { - if ((ch = getc(1)) == -1) + if ((ch = getc(TO)) == -1) goto err; chk = chk ^ ch << 8; for (j = 0; j < 8; ++j) { @@ -77,10 +78,10 @@ GetRecord(char blocknum, char *dest) chk &= 0xFFFF; - if (((ch = getc(1)) == -1) || ((ch & 0xff) != ((chk >> 8) & 0xFF))) - goto err; - if (((ch = getc(1)) == -1) || ((ch & 0xff) != (chk & 0xFF))) - goto err; + if (((ch = getc(TO)) == -1) || ((ch & 0xff) != ((chk >> 8) & 0xFF))) + goto err; + if (((ch = getc(TO)) == -1) || ((ch & 0xff) != (chk & 0xFF))) + goto err; putchar(ACK); return (1); |