X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=mware%2Fxmodem.c;h=46a6da460f00663b4a040bcc0ca438eaaf8f2681;hb=9e2e47a31399e2eec24070a7467516baeb3e372c;hp=9041b4cc29ed6bec7b6166a50eecd6a7c891744b;hpb=4560fc1a4dc7c27243d7f8afa9a1291e646c2f8b;p=bertos.git diff --git a/mware/xmodem.c b/mware/xmodem.c index 9041b4cc..46a6da46 100755 --- a/mware/xmodem.c +++ b/mware/xmodem.c @@ -28,6 +28,9 @@ /* * $Log$ + * Revision 1.7 2004/08/15 06:30:06 bernie + * Make the buffer a local variable, as documented. + * * Revision 1.6 2004/08/15 05:31:46 bernie * Add an #error to spread some FUD about the quality of this module; * Add a few TODOs from Rasky's review; @@ -97,10 +100,6 @@ #endif /* ARCH_BOOT */ -/*! Buffer to hold a block of data */ -static char block_buffer[XM_BUFSIZE]; - - /*! * Decode serial driver errors and print them on the display. */ @@ -125,6 +124,7 @@ static void print_serial_error(struct Serial *port, int retries) } } + /*! * \brief Receive a file using the XModem protocol. * @@ -135,6 +135,7 @@ static void print_serial_error(struct Serial *port, int retries) */ bool xmodem_recv(struct Serial *port, KFile *fd) { + char block_buffer[XM_BUFSIZE]; /* Buffer to hold a block of data */ int c, i, blocksize; int blocknr = 0, last_block_done = 0, retries = 0; char *buf; @@ -351,6 +352,7 @@ bool xmodem_recv(struct Serial *port, KFile *fd) */ bool xmodem_send(struct Serial *port, KFile *fd) { + char block_buffer[XM_BUFSIZE]; /* Buffer to hold a block of data */ size_t size = -1; int blocknr = 1, retries = 0, c, i; bool proceed, usecrc = false;