|
|
@ -248,6 +248,7 @@ retry: |
|
|
|
rx->errors = 0; |
|
|
|
rx->seq = 1; |
|
|
|
|
|
|
|
recv_bytes = 0; |
|
|
|
/* start to recv file contents */ |
|
|
|
fp = &rx->data[PACKET_HEADER]; |
|
|
|
for (;;) { |
|
|
@ -311,7 +312,12 @@ retry: |
|
|
|
} |
|
|
|
|
|
|
|
if (rx->seq != rx->data[PACKET_SEQNO_INDEX]) { |
|
|
|
put_byte(uart, NAK); |
|
|
|
if (rx->data[PACKET_SEQNO_INDEX] == 0 && recv_bytes == 0) { /* YMODEM-1K only ? */ |
|
|
|
put_byte(uart, ACK); |
|
|
|
put_byte(uart, WANTCRC); |
|
|
|
} else { |
|
|
|
put_byte(uart, NAK); |
|
|
|
} |
|
|
|
#ifdef YMODEM_DEBUG |
|
|
|
printf("data phase: seq mismatch %d, expected %d\n", rx->data[PACKET_SEQNO_INDEX], rx->seq); |
|
|
|
#endif |
|
|
|